瀏覽代碼

销售订单单证 新表头查询

liuchaohui 3 年之前
父節點
當前提交
e8bf4a86db

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/controller/SyOrderDataController.java

@@ -68,7 +68,7 @@ public class SyOrderDataController extends JeecgController<SyOrderData, ISyOrder
 		QueryWrapper<SyOrderData> queryWrapper = QueryGenerator.initQueryWrapper(syOrderData, req.getParameterMap());
 		queryWrapper.orderByDesc("order_date");
 		Page<SyOrderData> page = new Page<SyOrderData>(pageNo, pageSize);
-		IPage<SyOrderData> pageList = syOrderDataService.page(page, queryWrapper);
+		IPage<SyOrderData> pageList = syOrderDataService.queryList(syOrderData,page);
 		return Result.OK(pageList);
 	}
 	

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/entity/SyOrderData.java

@@ -189,4 +189,8 @@ public class SyOrderData {
 	@Excel(name = "成衣件数", width = 15)
 	@ApiModelProperty(value = "成衣件数")
 	private java.lang.String garmentNmb;
+
+	/*接受 成衣面辅料判断*/
+	@TableField(exist = false)
+	private java.lang.String isProduct;
 }

+ 3 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/SyOrderDataMapper.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.documents.orderData.mapper;
 
 import java.util.List;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.documents.orderData.entity.SyOrderData;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -13,5 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Version: V1.0
  */
 public interface SyOrderDataMapper extends BaseMapper<SyOrderData> {
-
+    IPage<SyOrderData> queryList(@Param("sy") SyOrderData sy, Page<SyOrderData> page);
 }

+ 68 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/mapper/xml/SyOrderDataMapper.xml

@@ -2,4 +2,72 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.documents.orderData.mapper.SyOrderDataMapper">
 
+    <select id="queryList" resultType="org.jeecg.modules.documents.orderData.entity.SyOrderData" >
+        SELECT
+            a.id,
+            order_number,
+            order_date,
+            business_type_value,
+            business_type_text,
+            sales_type_value,
+            sales_type_text,
+            customer_abbreviation,
+            customer_name,
+            exchange_rate,
+            sales_department,
+            salesman,
+            currency_value,
+            currency_text,
+            brand_side,
+            third_party,
+            deposit_ratio,
+            deposit,
+            collaborative_route,
+            order_remarks,
+            price_remarks,
+            customer_order_number,
+            whole_order_total,
+            end_customer,
+            term_of_payment,
+            order_change_description,
+            a.memo,
+            supplier,
+            account,
+            dilivery,
+            garment_factory,
+            garment_nmb
+        FROM
+            sy_order_data a
+            <if test="(sy.isProduct != null and sy.isProduct != '') or (sy.dilivery != null and sy.dilivery != '')">
+        left join sy_order_data_item b on a.id=b.sy_order_data_id
+            </if>
+        WHERE 1=1
+            <if test="sy.orderNumber != null and sy.orderNumber !=''">
+                AND order_number = #{sy.orderNumber}
+            </if>
+             <if test="sy.customerAbbreviation != null and sy.customerAbbreviation !=''">
+                 AND customer_abbreviation = #{sy.customerAbbreviation}
+             </if>
+             <if test="sy.orderDate !=null and sy.orderDate !=''">
+                 AND order_date = #{sy.orderDate}
+             </if>
+             <if test="sy.account != null and sy.account !=''">
+                 AND account = #{sy.account}
+             </if>
+             <if test="(sy.dilivery != null and sy.dilivery != '') and (sy.dilivery == '0' or sy.dilivery ==0)">
+                 AND b.surplus_num <![CDATA[ < ]]> b.quantity
+             </if>
+            <if test="(sy.dilivery != null and sy.dilivery != '') and (sy.dilivery == '1' or sy.dilivery ==1)">
+                AND b.surplus_num <![CDATA[ >= ]]> b.quantity
+            </if>
+             <if test="(sy.isProduct != null and sy.isProduct != '') and (sy.isProduct == '0' or sy.isProduct ==0) ">
+                 AND b.inventory_code like '19%'
+             </if>
+             <if test="(sy.isProduct != null and sy.isProduct != '') and (sy.isProduct == '1' or sy.isProduct == 1) ">
+                 AND b.inventory_code not like '19%'
+             </if>
+        ORDER BY
+            order_date DESC
+    </select>
+
 </mapper>

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/ISyOrderDataService.java

@@ -1,5 +1,7 @@
 package org.jeecg.modules.documents.orderData.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.modules.documents.orderData.entity.SyOrderData;
 import com.baomidou.mybatisplus.extension.service.IService;
 
@@ -12,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
 public interface ISyOrderDataService extends IService<SyOrderData> {
      void doQuerySyOrder();
 
+     IPage<SyOrderData> queryList(SyOrderData sy, Page<SyOrderData> page);
 }

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

@@ -41,6 +41,8 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
 
     private static IDxpDataPlanService dxpDataPlanService;
 
+    private SyOrderDataMapper syOrderDataMapper;
+
     private static ISyOrderDataItemService syOrderDataItemService;
     //数据源one
     private static ISenYuDataSourceOne senYuDataSourceOne;
@@ -50,7 +52,12 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
         QuerySyOrder();
     }
 
-    @Scheduled(cron = "0 59 23 * * ?")
+    @Override
+    public IPage<SyOrderData> queryList(SyOrderData sy, Page<SyOrderData> page) {
+        return syOrderDataMapper.queryList(sy,page);
+    }
+
+    @Scheduled(cron = "0 05 11 * * ?")
     public JSONObject QuerySyOrder() {
         //得到系统时间
         Date day=new Date();
@@ -167,6 +174,7 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
         this.dxpDataPlanService = applicationContext.getBean(IDxpDataPlanService.class);
         this.senYuDataSourceOne = applicationContext.getBean(ISenYuDataSourceOne.class);
         this.syOrderDataItemService = applicationContext.getBean(SyOrderDataItemServiceImpl.class);
+        this.syOrderDataMapper = applicationContext.getBean(SyOrderDataMapper.class);
 
     }
 }