作者 雷海东

生产计划查看、派工

1 package org.jeecg.modules.erp.order_form.controller; 1 package org.jeecg.modules.erp.order_form.controller;
2 2
3 import cn.hutool.core.date.DateUtil; 3 import cn.hutool.core.date.DateUtil;
4 -import cn.hutool.core.util.NumberUtil;  
5 import cn.hutool.core.util.StrUtil; 4 import cn.hutool.core.util.StrUtil;
6 -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;  
7 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 5 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
8 import com.baomidou.mybatisplus.core.metadata.IPage; 6 import com.baomidou.mybatisplus.core.metadata.IPage;
9 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 7 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -18,17 +16,11 @@ import org.jeecg.common.system.query.QueryGenerator; @@ -18,17 +16,11 @@ import org.jeecg.common.system.query.QueryGenerator;
18 import org.jeecg.common.system.vo.LoginUser; 16 import org.jeecg.common.system.vo.LoginUser;
19 import org.jeecg.common.util.oConvertUtils; 17 import org.jeecg.common.util.oConvertUtils;
20 import org.jeecg.modules.erp.order_form.entity.TblOrderForm; 18 import org.jeecg.modules.erp.order_form.entity.TblOrderForm;
21 -import org.jeecg.modules.erp.order_form.entity.TblProductType;  
22 import org.jeecg.modules.erp.order_form.entity.TblWorkOrder; 19 import org.jeecg.modules.erp.order_form.entity.TblWorkOrder;
23 import org.jeecg.modules.erp.order_form.entity.TblWorkPrice; 20 import org.jeecg.modules.erp.order_form.entity.TblWorkPrice;
24 -import org.jeecg.modules.erp.order_form.form.OrderForm;  
25 import org.jeecg.modules.erp.order_form.service.ITblOrderFormService; 21 import org.jeecg.modules.erp.order_form.service.ITblOrderFormService;
26 import org.jeecg.modules.erp.order_form.service.ITblWorkOrderService; 22 import org.jeecg.modules.erp.order_form.service.ITblWorkOrderService;
27 import org.jeecg.modules.erp.order_form.service.ITblWorkPriceService; 23 import org.jeecg.modules.erp.order_form.service.ITblWorkPriceService;
28 -import org.jeecg.modules.erp.production.entity.TblProductionGongxu;  
29 -import org.jeecg.modules.erp.production.entity.TblProductionPlan;  
30 -import org.jeecg.modules.erp.production.service.ITblProductionGongxuService;  
31 -import org.jeecg.modules.erp.production.service.ITblProductionPlanService;  
32 import org.jeecgframework.poi.excel.ExcelImportUtil; 24 import org.jeecgframework.poi.excel.ExcelImportUtil;
33 import org.jeecgframework.poi.excel.def.NormalExcelConstants; 25 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
34 import org.jeecgframework.poi.excel.entity.ExportParams; 26 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -43,7 +35,6 @@ import org.springframework.web.servlet.ModelAndView; @@ -43,7 +35,6 @@ import org.springframework.web.servlet.ModelAndView;
43 import javax.servlet.http.HttpServletRequest; 35 import javax.servlet.http.HttpServletRequest;
44 import javax.servlet.http.HttpServletResponse; 36 import javax.servlet.http.HttpServletResponse;
45 import java.io.IOException; 37 import java.io.IOException;
46 -import java.math.BigDecimal;  
47 import java.util.Arrays; 38 import java.util.Arrays;
48 import java.util.Date; 39 import java.util.Date;
49 import java.util.List; 40 import java.util.List;
@@ -71,8 +62,6 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr @@ -71,8 +62,6 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr
71 @Autowired 62 @Autowired
72 private ITblWorkPriceService iTblWorkPriceService; 63 private ITblWorkPriceService iTblWorkPriceService;
73 64
74 - @Autowired  
75 - private ITblProductionPlanService planService;  
76 65
77 /*---------------------------------主表处理-begin-------------------------------------*/ 66 /*---------------------------------主表处理-begin-------------------------------------*/
78 67
@@ -74,4 +74,5 @@ public class TblOrderFormServiceImpl extends ServiceImpl<TblOrderFormMapper, Tbl @@ -74,4 +74,5 @@ public class TblOrderFormServiceImpl extends ServiceImpl<TblOrderFormMapper, Tbl
74 return tblOrderFormMapper.selectList(page,tblOrderForm); 74 return tblOrderFormMapper.selectList(page,tblOrderForm);
75 } 75 }
76 76
  77 +
77 } 78 }
@@ -20,16 +20,16 @@ @@ -20,16 +20,16 @@
20 NOW())>= 0 20 NOW())>= 0
21 AND STATUS = '生产中' 21 AND STATUS = '生产中'
22 </select> 22 </select>
23 - <select id="selectAll" resultType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">  
24 - SELECT  
25 - a.id,a.create_by,a.create_time,a.update_by,a.update_time,a.sys_org_code,a.order_id,a.order_company,  
26 - a.work_order,a.product_name,b.product_type_name as product_type,a.order_date,a.designer,  
27 - a.dispatch_date,a.delivery_date,a.quantity,a.total_working_hours,a.dispatched_working_hours,a.STATUS,  
28 - a.finish_date,a.dispatch_status,a.product_design_status,a.verify_status,a.verify_result,a.delivery_date1,a.pics,a.pics2  
29 - FROM  
30 - tbl_order_form a  
31 - LEFT JOIN tbl_product_type b on a.product_type = b.product_type_id  
32 - </select> 23 +<!-- <select id="selectAll" resultType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">-->
  24 +<!-- SELECT-->
  25 +<!-- a.id,a.create_by,a.create_time,a.update_by,a.update_time,a.sys_org_code,a.order_id,a.order_company,-->
  26 +<!-- a.work_order,a.product_name,b.product_type_name as product_type,a.order_date,a.designer,-->
  27 +<!-- a.dispatch_date,a.delivery_date,a.quantity,a.total_working_hours,a.dispatched_working_hours,a.STATUS,-->
  28 +<!-- a.finish_date,a.dispatch_status,a.product_design_status,a.verify_status,a.verify_result,a.delivery_date1,a.pics,a.pics2-->
  29 +<!-- FROM-->
  30 +<!-- tbl_order_form a-->
  31 +<!-- LEFT JOIN tbl_product_type b on a.product_type = b.product_type_id-->
  32 +<!-- </select>-->
33 <select id="getCountByType" parameterType="java.lang.String" resultType="java.lang.Integer"> 33 <select id="getCountByType" parameterType="java.lang.String" resultType="java.lang.Integer">
34 SELECT 34 SELECT
35 count(product_type) 35 count(product_type)
@@ -55,4 +55,29 @@ @@ -55,4 +55,29 @@
55 <update id="updateProductDesignStatusByOrderId" parameterType="org.jeecg.modules.erp.order_form.entity.TblOrderForm"> 55 <update id="updateProductDesignStatusByOrderId" parameterType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">
56 update tbl_order_form set product_design_status = #{productDesignStatus} where order_id =#{orderId} 56 update tbl_order_form set product_design_status = #{productDesignStatus} where order_id =#{orderId}
57 </update> 57 </update>
  58 + <select id="selectList" resultType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">
  59 + SELECT
  60 + a.id,a.create_by,a.create_time,a.update_by,a.update_time,
  61 + a.sys_org_code,a.order_id,a.order_company,a.work_order,a.product_name, c.product_type_id as product_type_id,c.product_type_name as product_type,a.order_date,a.design_role,a.designer,a.dispatch_date,
  62 + a.delivery_date,a.quantity,a.total_working_hours,if(b.dispatched_working_hours != 0,b.dispatched_working_hours,0) dispatched_working_hours,a.STATUS,a.finish_date,a.assign_design_status,
  63 + a.dispatch_status,a.product_design_status,a.verify_status,a.verify_result,a.delivery_date1,a.pics,a.files,a.pics2
  64 + FROM
  65 + tbl_order_form a
  66 + LEFT JOIN ( SELECT order_number, sum( work_hours ) dispatched_working_hours FROM tbl_production_gongxu GROUP BY order_number ) b ON a.order_id = b.order_number
  67 + left join tbl_product_type c on a.product_type = c.product_type_id
  68 + where 1=1
  69 + <if test="qc.designer!=null and qc.designer !=''">
  70 + and a.designer like concat('%',#{qc.designer},'%')
  71 + </if>
  72 + <if test="qc.orderCompany!=null and qc.orderCompany !=''">
  73 + and a.order_company like concat('%',#{qc.orderCompany},'%')
  74 + </if>
  75 + <if test="qc.workOrder!=null and qc.workOrder !=''">
  76 + and a.work_order like concat('%',#{qc.workOrder},'%')
  77 + </if>
  78 + <if test="qc.productType!=null and qc.productType !=''">
  79 + and c.product_type_id like concat('%', #{qc.productType}, '%')
  80 + </if>
  81 + order by a.create_time desc
  82 + </select>
58 </mapper> 83 </mapper>