Commit 0a674156 authored by 温志超's avatar 温志超

更新报表查询以及工序模板

parent 64c631b8
......@@ -15,4 +15,5 @@ public class TaskProWorkorderPrintData extends ProWorkorder {
private String poOrderNo;
private String clientItemNo;
}
......@@ -601,6 +601,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
taskProWorkorderPrintData.setWorkorderType(dictDataService.getDictLabel("mes_workorder_type", taskProWorkorderPrintData.getWorkorderType()));
value.put("header",taskProWorkorderPrintData);
value.put("detail",taskProPrintDatas);
Date over = null;
if(taskProWorkorderPrintData.getExpectStartDate() != null || taskProWorkorderPrintData.getRequestDate() != null){
for (ProTask proTask : taskBatchTasks){
TaskProPrintData taskProPrintData = new TaskProPrintData();
......@@ -610,9 +611,16 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
taskProPrintData.setExpectStartDateString(begin);
taskProPrintData.setRequestDateString(end);
taskProPrintDatas.add(taskProPrintData);
if(proTask.getScheduleEndDate() != null){
if(over == null || over.getTime() < proTask.getScheduleEndDate().getTime()) {
over = proTask.getScheduleEndDate();
}
}
}
}
if(over != null){
taskProWorkorderPrintData.setRequestDate(over);
}
taskProWorkorderPrintData.setSize(i++);
taskProWorkorderPrintData.setDate(simpleDateFormat1.format(new Date()));
taskProWorkorderPrintData.setQuantity(taskBatchTasks.get(0).getQuantity());
......
......@@ -39,7 +39,7 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
workOrderProgressListResponse.setWorkorderType(dictDataService.getDictLabel("mes_workorder_type", workOrderProgressListResponse.getWorkorderType()));
if(workOrderProgressListResponse.getQuantity() != null && workOrderProgressListResponse.getQuantity().compareTo(BigDecimal.ZERO) >0){
workOrderProgressListResponse.setQuantityProduced(workOrderProgressListResponse.getQuantityProduced() != null ? workOrderProgressListResponse.getQuantityProduced() : BigDecimal.ZERO);
workOrderProgressListResponse.setQuantityMu(workOrderProgressListResponse.getQuantityProduced().divide(workOrderProgressListResponse.getQuantity()).setScale(2, RoundingMode.HALF_UP));
workOrderProgressListResponse.setQuantityMu(workOrderProgressListResponse.getQuantityProduced().multiply(new BigDecimal(100)).divide(workOrderProgressListResponse.getQuantity()).setScale(2, RoundingMode.HALF_UP));
}else{
workOrderProgressListResponse.setQuantityMu(new BigDecimal(100));
......@@ -53,7 +53,7 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
List<WorkOrderProgressProcessListResponse> workOrderProgressProcessListResponses = proTaskMapper.getProcessList(workorderCode);
for (WorkOrderProgressProcessListResponse workOrderProgressProcessListResponse : workOrderProgressProcessListResponses){
if(workOrderProgressProcessListResponse.equals(TaskStatusEnum.BEGINNING.getStatus())){
workOrderProgressProcessListResponse.setStatus("已开工");
workOrderProgressProcessListResponse.setStatus("加工中");
}else if(workOrderProgressProcessListResponse.equals(TaskStatusEnum.FINISHED.getStatus())){
workOrderProgressProcessListResponse.setStatus("已完工");
}else{
......@@ -61,7 +61,7 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
}
if(workOrderProgressProcessListResponse.getQuantityProduced() != null && workOrderProgressProcessListResponse.getQuantityProduced().compareTo(BigDecimal.ZERO) > 0){
workOrderProgressProcessListResponse.setPassRate(workOrderProgressProcessListResponse.getQuantityQualify().
workOrderProgressProcessListResponse.setPassRate(workOrderProgressProcessListResponse.getQuantityQualify().multiply(new BigDecimal(100)).
divide(workOrderProgressProcessListResponse.getQuantityProduced(),2, RoundingMode.HALF_UP));
}else{
......
......@@ -182,6 +182,7 @@
pt.workstation_Name,
workunit.workunit_id,
mw.workunit_name,
mw.workunit_code,
f.user_name,
f.nick_name,
workunit.quantity,
......@@ -224,7 +225,7 @@
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
<if test=" abnormalReason != null and abnormalReason != '' ">and f.abnormal_reason like '%${abnormalReason}%'</if>
<if test="defectStatus != null">f.quantity_unqualify > 0 </if>
<if test="defectStatus != null"> and f.quantity_unqualify > 0 </if>
</where>
</select>
<select id="getListByWorkOrder" resultType="com.ximai.mes.report.response.FeedbackResponse">
......@@ -271,7 +272,7 @@
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
<if test=" abnormalReason != null and abnormalReason != '' ">and f.abnormal_reason like '%${abnormalReason}%'</if>
<if test="defectStatus != null">f.quantity_unqualify > 0 </if>
<if test="defectStatus != null">and f.quantity_unqualify > 0 </if>
</where>
group by
workorder.workorder_Type,
......@@ -321,7 +322,7 @@
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
<if test=" abnormalReason != null and abnormalReason != '' ">and f.abnormal_reason like '%${abnormalReason}%'</if>
<if test="defectStatus != null">f.quantity_unqualify > 0 </if>
<if test="defectStatus != null">and f.quantity_unqualify > 0 </if>
</where>
group by
workstation.workshop_code,
......@@ -366,7 +367,7 @@
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
<if test=" abnormalReason != null and abnormalReason != '' ">and f.abnormal_reason like '%${abnormalReason}%'</if>
<if test="defectStatus != null">f.quantity_unqualify > 0 </if>
<if test="defectStatus != null">and f.quantity_unqualify > 0 </if>
</where>
group by
workstation.workstation_code,
......@@ -411,7 +412,7 @@
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
<if test=" abnormalReason != null and abnormalReason != '' ">and f.abnormal_reason like '%${abnormalReason}%'</if>
<if test="defectStatus != null">f.quantity_unqualify > 0 </if>
<if test="defectStatus != null">and f.quantity_unqualify > 0 </if>
</where>
group by
mw.workunit_code,
......@@ -456,7 +457,7 @@
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
<if test=" abnormalReason != null and abnormalReason != '' ">and f.abnormal_reason like '%${abnormalReason}%'</if>
<if test="defectStatus != null">f.quantity_unqualify > 0 </if>
<if test="defectStatus != null">and f.quantity_unqualify > 0 </if>
</where>
group by
pt.process_code,
......@@ -501,7 +502,7 @@
<if test=" workstationName != null and workstationName != '' ">and workstation.workstation_name like '%${workstationName}%'</if>
<if test=" workunitName != null and workunitName != '' ">and mw.workunit_name like '%${workunitName}%'</if>
<if test=" abnormalReason != null and abnormalReason != '' ">and f.abnormal_reason like '%${abnormalReason}%'</if>
<if test="defectStatus != null">f.quantity_unqualify > 0 </if>
<if test="defectStatus != null">and f.quantity_unqualify > 0 </if>
</where>
group by
f.user_name,
......
......@@ -185,7 +185,87 @@
</select>
<select id="getWorkOrderProgressServiceList"
resultType="com.ximai.mes.report.response.WorkOrderProgressListResponse">
select * from pro_workorder pw
SELECT
pw.workorder_id,
pw.workorder_code,
pw.workorder_name,
pw.order_source,
pw.source_code,
pw.product_id,
pw.product_code,
pw.product_name,
pw.product_spc,
pw.unit_of_measure,
pw.arrange_code,
pw.quantity,
pw.client_id,
pw.client_code,
pw.client_name,
pw.request_date,
pw.parent_id,
pw.ancestors,
pw.`status`,
pw.remark,
pw.attr1,
pw.attr2,
pw.attr3,
pw.attr4,
pw.create_by,
pw.create_time,
pw.update_by,
pw.update_time,
pw.batch_code,
pw.finish_date,
pw.workorder_type,
pw.vendor_id,
pw.vendor_code,
pw.vendor_name,
pw.sales_voucher,
pw.sales_voucher_item,
pw.sap_item_code,
pw.ep_item_code,
pw.start_date,
pw.end_date,
pw.production_manager_id,
pw.storage_location,
pw.dispatch_multiple,
pw.row_num,
pw.single_weight,
pw.thickness,
pw.group_key,
pw.group_counter,
pw.materials_group_bill,
pw.alternative_bill,
pw.factory_code,
pw.pack_num,
pw.pack_type,
pw.pack_unit_of_measure,
pw.loss_individually_wrap,
pw.usage_pack_num,
pw.usage_encasement_num,
pw.merge_pack,
pw.start_serial,
pw.end_serial,
pw.rush_order,
pw.batch_serial,
pw.production_solution_id,
pw.production_solution_code,
pw.production_solution_name,
pw.billing_date,
pw.expect_start_date,
pw.order_type,
pw.order_code,
pw.order_serial,
pw.customer_drawing_no,
pw.customer_project_no,
pw.in_drawing_no,
pw.erp_create_time,
pw.erp_update_time ,
sum(fe.quantity_qualify + fe.quantity_unqualify) as quantity_produced
FROM
pro_workorder pw
LEFT JOIN pro_feedback fe ON fe.workorder_id = pw.workorder_id
<where>
<if test="workorderCode != null and workorderCode != ''">and pw.workorder_code = #{workorderCode}</if>
<if test="productId != null ">and pw.product_id = #{productId}</if>
......@@ -193,6 +273,82 @@
<if test="orderCode != null and orderCode !=''">and pw.order_code = #{orderCode}</if>
<if test="customerProjectNo != null and customerProjectNo !=''">and pw.customer_project_no = #{customerProjectNo}</if>
</where>
GROUP BY
pw.workorder_id,
pw.workorder_code,
pw.workorder_name,
pw.order_source,
pw.source_code,
pw.product_id,
pw.product_code,
pw.product_name,
pw.product_spc,
pw.unit_of_measure,
pw.arrange_code,
pw.quantity,
pw.client_id,
pw.client_code,
pw.client_name,
pw.request_date,
pw.parent_id,
pw.ancestors,
pw.`status`,
pw.remark,
pw.attr1,
pw.attr2,
pw.attr3,
pw.attr4,
pw.create_by,
pw.create_time,
pw.update_by,
pw.update_time,
pw.batch_code,
pw.finish_date,
pw.workorder_type,
pw.vendor_id,
pw.vendor_code,
pw.vendor_name,
pw.sales_voucher,
pw.sales_voucher_item,
pw.sap_item_code,
pw.ep_item_code,
pw.start_date,
pw.end_date,
pw.production_manager_id,
pw.storage_location,
pw.dispatch_multiple,
pw.row_num,
pw.single_weight,
pw.thickness,
pw.group_key,
pw.group_counter,
pw.materials_group_bill,
pw.alternative_bill,
pw.factory_code,
pw.pack_num,
pw.pack_type,
pw.pack_unit_of_measure,
pw.loss_individually_wrap,
pw.usage_pack_num,
pw.usage_encasement_num,
pw.merge_pack,
pw.start_serial,
pw.end_serial,
pw.rush_order,
pw.batch_serial,
pw.production_solution_id,
pw.production_solution_code,
pw.production_solution_name,
pw.billing_date,
pw.expect_start_date,
pw.order_type,
pw.order_code,
pw.order_serial,
pw.customer_drawing_no,
pw.customer_project_no,
pw.in_drawing_no,
pw.erp_create_time,
pw.erp_update_time
</select>
<insert id="insertProWorkorder" parameterType="ProWorkorder" useGeneratedKeys="true" keyProperty="workorderId">
......
......@@ -346,10 +346,64 @@
</where>
</select>
<select id="selectByTaskBatch" resultType="com.ximai.mes.pro.domain.task.ProTask">
<include refid="selectProTaskDetailVo"/>
SELECT ptw.task_workunit_id,
t.task_id,
t.task_code,
t.task_name,
t.workstation_id,
ws.workstation_code,
ws.workstation_name,
t.process_id,
t.arrange_code,
p.process_code,
p.process_name,
p.remark as processRemark,
t.item_id,
i.item_code,
i.item_name,
t.specification,
t.client_id,
t.client_code,
t.client_name,
t.client_nick,
t.start_time,
t.duration,
t.end_time,
t.color_code,
t.request_date,
t.remark,
t.attr1,
t.attr2,
t.attr3,
t.attr4,
t.create_by,
t.create_time,
t.update_by,
t.update_time,
t.idx,
ptw.task_workunit_id,
ptw.quantity,
ptw.quantity_produced,
ptw.quantity_changed,
ptw.quantity_qualify,
ptw.unit_of_measure,
ptw.STATUS,
mw.workunit_name workunit_name,
mw.workunit_id workunit_id,
mw.workunit_code workunit_code,
ptw.quantity_unqualify,
ptw.schedule_end_date,
ptw.schedule_start_date
FROM pro_task_workunit ptw
LEFT JOIN pro_task t ON t.task_id = ptw.task_id
LEFT JOIN pro_process p ON t.process_id = p.process_id
LEFT JOIN md_item i ON t.item_id = i.item_id
LEFT JOIN md_workunit mw ON ptw.workunit_id = mw.workunit_id
LEFT JOIN md_workstation ws ON t.workstation_id = ws.workstation_id
<where>
t.task_batch = #{taskBatch}
</where>
order by t.idx
</select>
<select id="getProcessList"
resultType="com.ximai.mes.report.response.WorkOrderProgressProcessListResponse">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment