作者 雷海东

生产计划查看、派工

package org.jeecg.modules.erp.order_form.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
... ... @@ -18,17 +16,11 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.erp.order_form.entity.TblOrderForm;
import org.jeecg.modules.erp.order_form.entity.TblProductType;
import org.jeecg.modules.erp.order_form.entity.TblWorkOrder;
import org.jeecg.modules.erp.order_form.entity.TblWorkPrice;
import org.jeecg.modules.erp.order_form.form.OrderForm;
import org.jeecg.modules.erp.order_form.service.ITblOrderFormService;
import org.jeecg.modules.erp.order_form.service.ITblWorkOrderService;
import org.jeecg.modules.erp.order_form.service.ITblWorkPriceService;
import org.jeecg.modules.erp.production.entity.TblProductionGongxu;
import org.jeecg.modules.erp.production.entity.TblProductionPlan;
import org.jeecg.modules.erp.production.service.ITblProductionGongxuService;
import org.jeecg.modules.erp.production.service.ITblProductionPlanService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
... ... @@ -43,7 +35,6 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
... ... @@ -71,8 +62,6 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr
@Autowired
private ITblWorkPriceService iTblWorkPriceService;
@Autowired
private ITblProductionPlanService planService;
/*---------------------------------主表处理-begin-------------------------------------*/
... ...
... ... @@ -74,4 +74,5 @@ public class TblOrderFormServiceImpl extends ServiceImpl<TblOrderFormMapper, Tbl
return tblOrderFormMapper.selectList(page,tblOrderForm);
}
}
... ...
... ... @@ -20,16 +20,16 @@
NOW())>= 0
AND STATUS = '生产中'
</select>
<select id="selectAll" resultType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">
SELECT
a.id,a.create_by,a.create_time,a.update_by,a.update_time,a.sys_org_code,a.order_id,a.order_company,
a.work_order,a.product_name,b.product_type_name as product_type,a.order_date,a.designer,
a.dispatch_date,a.delivery_date,a.quantity,a.total_working_hours,a.dispatched_working_hours,a.STATUS,
a.finish_date,a.dispatch_status,a.product_design_status,a.verify_status,a.verify_result,a.delivery_date1,a.pics,a.pics2
FROM
tbl_order_form a
LEFT JOIN tbl_product_type b on a.product_type = b.product_type_id
</select>
<!-- <select id="selectAll" resultType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">-->
<!-- SELECT-->
<!-- a.id,a.create_by,a.create_time,a.update_by,a.update_time,a.sys_org_code,a.order_id,a.order_company,-->
<!-- a.work_order,a.product_name,b.product_type_name as product_type,a.order_date,a.designer,-->
<!-- a.dispatch_date,a.delivery_date,a.quantity,a.total_working_hours,a.dispatched_working_hours,a.STATUS,-->
<!-- a.finish_date,a.dispatch_status,a.product_design_status,a.verify_status,a.verify_result,a.delivery_date1,a.pics,a.pics2-->
<!-- FROM-->
<!-- tbl_order_form a-->
<!-- LEFT JOIN tbl_product_type b on a.product_type = b.product_type_id-->
<!-- </select>-->
<select id="getCountByType" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
count(product_type)
... ... @@ -55,4 +55,29 @@
<update id="updateProductDesignStatusByOrderId" parameterType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">
update tbl_order_form set product_design_status = #{productDesignStatus} where order_id =#{orderId}
</update>
<select id="selectList" resultType="org.jeecg.modules.erp.order_form.entity.TblOrderForm">
SELECT
a.id,a.create_by,a.create_time,a.update_by,a.update_time,
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,
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,
a.dispatch_status,a.product_design_status,a.verify_status,a.verify_result,a.delivery_date1,a.pics,a.files,a.pics2
FROM
tbl_order_form a
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
left join tbl_product_type c on a.product_type = c.product_type_id
where 1=1
<if test="qc.designer!=null and qc.designer !=''">
and a.designer like concat('%',#{qc.designer},'%')
</if>
<if test="qc.orderCompany!=null and qc.orderCompany !=''">
and a.order_company like concat('%',#{qc.orderCompany},'%')
</if>
<if test="qc.workOrder!=null and qc.workOrder !=''">
and a.work_order like concat('%',#{qc.workOrder},'%')
</if>
<if test="qc.productType!=null and qc.productType !=''">
and c.product_type_id like concat('%', #{qc.productType}, '%')
</if>
order by a.create_time desc
</select>
</mapper>
\ No newline at end of file
... ...