Browse Source

发运明细调整,材料出库单调整

zengtx 3 years ago
parent
commit
f48e9957cd

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

@@ -325,6 +325,41 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 		return result;
 	}
 
+	 /**
+	  * 详情
+	  *
+	  * @param id
+	  * @return
+	  */
+	 @AutoLog(value = "发运明细主表-通过id查询详情")
+	 @ApiOperation(value="发运明细主表-通过id查询详情", notes="发运明细主表-通过id查询详情")
+	 @GetMapping(value = "/queryByDetails")
+	 public Result<SyShippingDetails> queryByDetails(@RequestParam(name="id",required=true) String id,String itemIds) {
+
+		 Result<SyShippingDetails> result = new Result<>();
+		 List<String> strList = new ArrayList<>();
+		 if(oConvertUtils.isEmpty(id)){
+			 throw new JeecgBootException("未拿到ID");
+		 }
+		 SyShippingDetails syShippingDetails = syShippingDetailsService.getById(id);
+		 //查询子表
+		 String idsSplit[] = itemIds.split(",");
+		 for(String str:idsSplit){
+			 strList.add(str);
+		 }
+		 QueryWrapper<SyShippingDetailsItem> syShippingDetailsItemQueryWrapper = new QueryWrapper<SyShippingDetailsItem>();
+		 syShippingDetailsItemQueryWrapper.in("id",strList).eq("del_flag",0);
+		 List<SyShippingDetailsItem> syShippingDetailsItemList = syShippingDetailsItemService.list(syShippingDetailsItemQueryWrapper);
+		 if(syShippingDetailsItemList.size()!=0){
+			 syShippingDetails.setSyShippingDetailsItemList(syShippingDetailsItemList);
+		 }
+
+		 result.setSuccess(true);
+		 result.setResult(syShippingDetails);
+		 result.setMessage("查询成功!");
+		 return result;
+	 }
+
   /**
    * 导出excel
    *
@@ -357,6 +392,13 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 
 	  Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(1, -1);
 	  IPage<SyShippingDetailsVo> pageList = syShippingDetailsMapper.exCelQuery(page, queryWrapper);
+	  for(SyShippingDetailsVo li:pageList.getRecords()){
+	  	if(li.getIsTc().equals("0")){
+	  		li.setIsTc("否");
+		}else{
+			li.setIsTc("是");
+		}
+	  }
 
 	  ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
 	  mv.addObject(NormalExcelConstants.FILE_NAME, "发运明细");
@@ -448,7 +490,8 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
   @AutoLog(value = "发运明细查询订单")
   @ApiOperation(value="发运明细查询订单", notes="发运明细查询订单")
   @GetMapping(value = "/queryOrderData")
-  public Result<IPage<OrderDataVo>> queryOrderData(String orderNumber,String account,
+  public Result<IPage<OrderDataVo>> queryOrderData(String orderNumber,String account,String startDeliveryDate,String endDeliveryDate,
+												   String salesman,String customerName,
 												   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 												   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 												   HttpServletRequest request, HttpServletResponse response) {
@@ -464,6 +507,17 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 	  if (oConvertUtils.isNotEmpty(account)) {
 		  queryWrapper.eq("a.account", account);
 	  }
+	  if(oConvertUtils.isNotEmpty(startDeliveryDate)){
+		  queryWrapper.ge("b.pre_delivery_date", startDeliveryDate);
+		  queryWrapper.le("b.pre_delivery_date", endDeliveryDate);
+	  }
+	  if (oConvertUtils.isNotEmpty(salesman)) {
+		  queryWrapper.eq("a.salesman", salesman);
+	  }
+	  if (oConvertUtils.isNotEmpty(customerName)) {
+		  queryWrapper.like("a.customer_name", customerName);
+	  }
+
 	  queryWrapper.eq("a.del_flag", 0);
 	  queryWrapper.eq("b.del_flag", 0);
 	  queryWrapper.gt("b.surplus_num", 0);

+ 2 - 15
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetails.java

@@ -56,18 +56,7 @@ public class SyShippingDetails {
 	@Excel(name = "客户", width = 15)
     @ApiModelProperty(value = "客户")
 	private java.lang.String customer;
-	/**预发货日期*/
-	@Excel(name = "预发货日期", width = 20, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
-    @ApiModelProperty(value = "预发货日期")
-	private java.util.Date preDeliveryDate;
-	/**预完工日期*/
-	@Excel(name = "预完工日期", width = 20, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
-    @ApiModelProperty(value = "预完工日期")
-	private java.util.Date preCompletionDate;
+
 	/**U8备注*/
 	@Excel(name = "U8备注", width = 15)
     @ApiModelProperty(value = "U8备注")
@@ -138,9 +127,7 @@ public class SyShippingDetails {
 	@TableField(exist = false)
 	private String type;
 
-	@Excel(name = "成衣工厂", width = 15)
-	@ApiModelProperty(value = "成衣工厂")
-	private String garmentFactory;
+
 
 	@Excel(name = "订单类型", width = 15)
 	@ApiModelProperty(value = "订单类型")

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

@@ -287,5 +287,42 @@ public class SyShippingDetailsItem {
 	@ApiModelProperty(value = "剩余数量")
 	private java.math.BigDecimal surplusQuantity;
 
+	/**预发货日期*/
+	@Excel(name = "预发货日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "预发货日期")
+	private java.util.Date preDeliveryDate;
+
+	/**预完工日期*/
+	@Excel(name = "预完工日期", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "预完工日期")
+	private java.util.Date preCompletionDate;
+
+	@Excel(name = "成衣工厂", width = 15)
+	@ApiModelProperty(value = "成衣工厂")
+	private String garmentFactory;
 
+	/**规格型号*/
+	@Excel(name = "规格型号", width = 15)
+	@ApiModelProperty(value = "规格型号")
+	private java.lang.String specificationAndModel;
+	/**颜色*/
+	@Excel(name = "颜色", width = 15)
+	@ApiModelProperty(value = "颜色")
+	private java.lang.String colour;
+	/**尺码*/
+	@Excel(name = "尺码", width = 15)
+	@ApiModelProperty(value = "尺码")
+	private java.lang.String size;
+	/**配码规则*/
+	@Excel(name = "配码规则", width = 15)
+	@ApiModelProperty(value = "配码规则")
+	private java.lang.String codingRules;
+	/**光坯毛门幅CM*/
+	@Excel(name = "光坯毛门幅CM", width = 15)
+	@ApiModelProperty(value = "光坯毛门幅CM")
+	private java.math.BigDecimal guangpeiGateWidth;
 }

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

@@ -21,23 +21,26 @@
     </select>
 
 <select id="queryShippingDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
-    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,
+    select t.* from(select a.id as id,GROUP_CONCAT(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,
+    b.small_po as smallPo,b.pack_id as packId,b.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,
     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.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,b.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,a.account as account,
-    a.english_product_name as englishProductName,a.garment_factory as garmentFactory from sy_shipping_details a
+    a.english_product_name as englishProductName,b.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 GROUP BY a.document_no,b.order_number,b.customer_abbreviation,b.sales_department,b.salesman,b.small_po,b.pack_id,b.distribution_point,
-				b.item_number,a.pre_delivery_date,a.pre_completion_date,b.inventory_name,b.pur_or_sub_order,a.order_type,a.garment_factory order by a.document_no desc) as t
+where a.del_flag = 0 GROUP BY
+b.order_number,b.customer_abbreviation,b.sales_department,b.salesman,a.account,b.pre_delivery_date,b.order_remarks,
+			  b.item_number,b.small_po,b.inventory_name,b.colour,b.distribution_point,b.pack_id,b.coding_rules
+
+ order by a.document_no desc) as t
 ${ew.customSqlSegment}
 
 </select>
@@ -92,15 +95,17 @@ ${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,
+          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,
-           a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,a.account as account,
+           a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,b.surplus_num as surplusNum,DATE_FORMAT(b.pre_completion_date,'%y-%m-%d') as preCompletionDate,
+           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.supplier_code as supplierCode,a.garment_nmb as garmentNmb,a.garment_factory as garmentFactory,DATE_FORMAT(b.pre_delivery_date,'%y-%m-%d') as preDeliveryDate,b.box_number as boxNumber,
            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
-        left join sy_order_data_item b
+             a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription
+             from sy_order_data a
+              left join sy_order_data_item b
         on a.id = b.sy_order_data_id and b.del_flag = 0
         ${ew.customSqlSegment}
 
@@ -111,17 +116,17 @@ ${ew.customSqlSegment}
     <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.small_po as smallPo,b.pack_id as packId,b.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.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,b.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
+    a.english_product_name as englishProductName,b.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

+ 7 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/PurchaseWarehousingServiceImpl.java

@@ -991,7 +991,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
         if(mapList!=null&&mapList.size()>0){
             for(Map<String,Object> map:mapList){
                 map.put("CACCID",accId);//账套
-                map.put("CVOUCHCODE",map.get("cOrderCode"));//单号
+//                map.put("CVOUCHCODE",map.get("cOrderCode"));//单号
                 map.put("DDATE",map.get("dDate"));//单据日期
                 //获取汇率、币种
                 //根据订单号获取委外订单
@@ -1029,7 +1029,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
                     }
                     map.put("CMEMO",OM_MOmainMap.get("cMemo"));//备注
                     map.put("CMAKER","云工厂管理员");
-                    map.put("CHANDLER","云工厂管理员");
+                   // map.put("CHANDLER","云工厂管理员");
                 }else{
                     throw new RuntimeException("委外订单没有匹配的订单号");
                 }
@@ -1087,12 +1087,13 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
                 //主表
                 JSONObject saveJson=new JSONObject();//0412
                 String cCode=oConvertUtils.addOne(this.baseMapper.getMaxCode("cCode","rdrecord11","dnmaketime"));
-                saveJson.put("cCode",cCode);
+                //saveJson.put("cCode",cCode);
                 System.out.println("单据编号:"+cCode);
                 //修改最大编码
-                this.baseMapper.updateVoucherHistoryCNumber(oConvertUtils.maxNumber(String.valueOf(saveJson.get("cCode"))),"0412");
+                this.baseMapper.updateVoucherHistoryCNumber(oConvertUtils.maxNumber(cCode),"0412");
                 saveJson.put("CACCID",accID);
-                saveJson.put("CVOUCHCODE",map.get("CVOUCHCODE"));
+                saveJson.put("CVOUCHCODE",cCode);
+                //saveJson.put("CGLTYPE","委外订单");
                 saveJson.put("CBUSTYPE",map.get("CBUSTYPE"));
                 saveJson.put("DDATE",map.get("DDATE"));
                 saveJson.put("CPERSONCODE",map.get("CPERSONCODE"));
@@ -1103,7 +1104,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
                 saveJson.put("IEXCHRATE",map.get("IEXCHRATE"));
                 saveJson.put("CMEMO",map.get("CMEMO"));
                 saveJson.put("CMAKER",map.get("CMAKER"));
-                saveJson.put("CHANDLER",map.get("CHANDLER"));
+                saveJson.put("CHANDLER","");
                 List<Map<String,Object>> itemMapList=(List<Map<String,Object>>)map.get("detailList");
                 //子表
                 if(itemMapList!=null&&itemMapList.size()>0){