工单汇总需求变更

tags/yfai-mes-ext-v1.7
jun 8 months ago
parent e722c262b3
commit 65e2a26cc8

@ -35,9 +35,9 @@ public class MesWorkOrderDaoImpl implements IMesWorkOrderDao {
@Override
public List<MesWorkOrderModel> sumMesWorkOrderQtyToSap(String organizeCode) {
StringBuffer hql = new StringBuffer("select organize_code as organizeCode,part_no as partNo, date_format(plan_start_time, '%Y-%m-%d' ) as planStartTime, product_version as productVersion, " +
" sum(case when work_order_status = 40 then 0 else qty end ) as qty " +
" sum(case when work_order_status = 40 then reported_qty else qty end ) as qty " +
" from mes_work_order where is_deleted=:isDeleted and is_valid = :isValid and organize_code = :organizeCode " +
" and work_order_type = :workOrderType and order_flag != :orderFlag and work_order_status in (20,40) and plan_start_time >= :today" +
" and work_order_type = :workOrderType and order_flag != :orderFlag and work_order_status in (20,30,40) and plan_start_time >= :today" +
" group by organize_code,part_no, date_format(plan_start_time, '%Y-%m-%d' ), product_version ");
Query query = entityManager.createNativeQuery(hql.toString());
query.setParameter("organizeCode", organizeCode);

Loading…
Cancel
Save