Commit 1eb3de25 authored by 李驰骋's avatar 李驰骋

Merge remote-tracking branch 'origin/dev' into dev

parents e073699f fa6c8a66
...@@ -15,4 +15,5 @@ public class TaskProWorkorderPrintData extends ProWorkorder { ...@@ -15,4 +15,5 @@ public class TaskProWorkorderPrintData extends ProWorkorder {
private String poOrderNo; private String poOrderNo;
private String clientItemNo; private String clientItemNo;
} }
...@@ -143,6 +143,6 @@ public interface ProFeedbackMapper { ...@@ -143,6 +143,6 @@ public interface ProFeedbackMapper {
int selectCount(@Param("taskIds")List<Long> taskIds); int selectCount(@Param("taskIds")List<Long> taskIds);
List<WorkOrderProgressFeedbackListResponse> getFeedbackList(@Param("workorderCode")String workorderCode,@Param("taskId") Long taskId); List<WorkOrderProgressFeedbackListResponse> getFeedbackList(@Param("workorderCode")String workorderCode,@Param("taskId") Long taskId,@Param("taskWorkunitId") Long taskWorkunitId);
} }
...@@ -601,6 +601,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService { ...@@ -601,6 +601,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
taskProWorkorderPrintData.setWorkorderType(dictDataService.getDictLabel("mes_workorder_type", taskProWorkorderPrintData.getWorkorderType())); taskProWorkorderPrintData.setWorkorderType(dictDataService.getDictLabel("mes_workorder_type", taskProWorkorderPrintData.getWorkorderType()));
value.put("header",taskProWorkorderPrintData); value.put("header",taskProWorkorderPrintData);
value.put("detail",taskProPrintDatas); value.put("detail",taskProPrintDatas);
Date over = null;
if(taskProWorkorderPrintData.getExpectStartDate() != null || taskProWorkorderPrintData.getRequestDate() != null){ if(taskProWorkorderPrintData.getExpectStartDate() != null || taskProWorkorderPrintData.getRequestDate() != null){
for (ProTask proTask : taskBatchTasks){ for (ProTask proTask : taskBatchTasks){
TaskProPrintData taskProPrintData = new TaskProPrintData(); TaskProPrintData taskProPrintData = new TaskProPrintData();
...@@ -610,9 +611,16 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService { ...@@ -610,9 +611,16 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
taskProPrintData.setExpectStartDateString(begin); taskProPrintData.setExpectStartDateString(begin);
taskProPrintData.setRequestDateString(end); taskProPrintData.setRequestDateString(end);
taskProPrintDatas.add(taskProPrintData); 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.setSize(i++);
taskProWorkorderPrintData.setDate(simpleDateFormat1.format(new Date())); taskProWorkorderPrintData.setDate(simpleDateFormat1.format(new Date()));
taskProWorkorderPrintData.setQuantity(taskBatchTasks.get(0).getQuantity()); taskProWorkorderPrintData.setQuantity(taskBatchTasks.get(0).getQuantity());
......
package com.ximai.mes.report.controller;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ximai.common.annotation.Log;
import com.ximai.common.core.controller.BaseController;
import com.ximai.common.core.domain.AjaxResult;
import com.ximai.common.core.page.TableDataInfo;
import com.ximai.common.enums.BusinessType;
import com.ximai.mes.report.request.DailyProductionReportRequest;
import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.response.FeedbackResponse;
import com.ximai.mes.report.service.DailyProductionReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Api("日产能对比统计")
@RestController
@RequestMapping("/dailyProductionReport")
public class DailyProductionReportController extends BaseController {
@Autowired
DailyProductionReportService dailyProductionReportService;
@ApiOperation("日产能对比统计:获取日期表头")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "日产能对比统计:获取日期表头", businessType = BusinessType.QUERY)
@GetMapping("/getDatas")
public AjaxResult<List> getDatas(DailyProductionReportRequest dailyProductionReportRequest) {
List data = dailyProductionReportService.getDatas(dailyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("日产能对比统计:统计方式工序")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "日产能对比统计:统计方式工序", businessType = BusinessType.QUERY)
@GetMapping("/getListByProcess")
public AjaxResult<List> getListByProcess(DailyProductionReportRequest dailyProductionReportRequest) {
List data = dailyProductionReportService.getListByProcess(dailyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("日产能对比统计:统计方式车间")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "日产能对比统计:统计方式车间", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkshop")
public AjaxResult<List> getListByWorkshop(DailyProductionReportRequest dailyProductionReportRequest) {
List data = dailyProductionReportService.getListByWorkshop(dailyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("日产能对比统计:统计方式工作中心")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "日产能对比统计:统计方式工作中心", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkstation")
public AjaxResult<List> getListByWorkstation(DailyProductionReportRequest dailyProductionReportRequest) {
List data = dailyProductionReportService.getListByWorkstation(dailyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("日产能对比统计:统计方式工作单元")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "日产能对比统计:统计方式工作单元", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkunit")
public AjaxResult<List> getListByWorkunit(DailyProductionReportRequest dailyProductionReportRequest) {
List data = dailyProductionReportService.getListByWorkunit(dailyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("日产能对比统计:统计方式报工人员")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "日产能对比统计:统计方式报工人员", businessType = BusinessType.QUERY)
@GetMapping("/getListByUser")
public AjaxResult<List> getListByUser(DailyProductionReportRequest dailyProductionReportRequest) {
List data = dailyProductionReportService.getListByUser(dailyProductionReportRequest);
return AjaxResult.success(data);
}
}
...@@ -54,7 +54,7 @@ public class FeedbackController extends BaseController { ...@@ -54,7 +54,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityQualify().add(feedbackResponse.getQuantityUnqualify()),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -74,7 +74,7 @@ public class FeedbackController extends BaseController { ...@@ -74,7 +74,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityQualify().add(feedbackResponse.getQuantityUnqualify()),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -94,7 +94,7 @@ public class FeedbackController extends BaseController { ...@@ -94,7 +94,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityQualify().add(feedbackResponse.getQuantityUnqualify()),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -115,7 +115,7 @@ public class FeedbackController extends BaseController { ...@@ -115,7 +115,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityQualify().add(feedbackResponse.getQuantityUnqualify()),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -139,7 +139,7 @@ public class FeedbackController extends BaseController { ...@@ -139,7 +139,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityQualify().add(feedbackResponse.getQuantityUnqualify()),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -160,7 +160,7 @@ public class FeedbackController extends BaseController { ...@@ -160,7 +160,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityQualify().add(feedbackResponse.getQuantityUnqualify()),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
...@@ -180,7 +180,7 @@ public class FeedbackController extends BaseController { ...@@ -180,7 +180,7 @@ public class FeedbackController extends BaseController {
if(feedbackResponse.getQuantityFeedback() != null if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0 && feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){ && feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback(),2, RoundingMode.HALF_UP).doubleValue()))); feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityQualify().add(feedbackResponse.getQuantityUnqualify()),2, RoundingMode.HALF_UP).doubleValue())));
}else{ }else{
feedbackResponse.setQualificationRate("0.00%"); feedbackResponse.setQualificationRate("0.00%");
} }
......
package com.ximai.mes.report.controller;
import com.ximai.common.annotation.Log;
import com.ximai.common.core.domain.AjaxResult;
import com.ximai.common.enums.BusinessType;
import com.ximai.mes.report.request.MonthlyProductionReportRequest;
import com.ximai.mes.report.request.MonthlyProductionReportRequest;
import com.ximai.mes.report.service.MonthlyProductionReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api("月产能对比统计")
@RestController
@RequestMapping("/monthlyProductionReport")
public class MonthlyProductionReportController {
@Autowired
MonthlyProductionReportService monthlyProductionReportService;
@ApiOperation("月产能对比统计:统计方式工序")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "月产能对比统计:统计方式工序", businessType = BusinessType.QUERY)
@GetMapping("/getListByProcess")
public AjaxResult<List> getListByProcess(MonthlyProductionReportRequest monthlyProductionReportRequest) {
List data = monthlyProductionReportService.getListByProcess(monthlyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("月产能对比统计:统计方式车间")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "月产能对比统计:统计方式车间", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkshop")
public AjaxResult<List> getListByWorkshop(MonthlyProductionReportRequest monthlyProductionReportRequest) {
List data = monthlyProductionReportService.getListByWorkshop(monthlyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("月产能对比统计:统计方式工作中心")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "月产能对比统计:统计方式工作中心", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkstation")
public AjaxResult<List> getListByWorkstation(MonthlyProductionReportRequest monthlyProductionReportRequest) {
List data = monthlyProductionReportService.getListByWorkstation(monthlyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("月产能对比统计:统计方式工作单元")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "月产能对比统计:统计方式工作单元", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkunit")
public AjaxResult<List> getListByWorkunit(MonthlyProductionReportRequest monthlyProductionReportRequest) {
List data = monthlyProductionReportService.getListByWorkunit(monthlyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("月产能对比统计:统计方式报工人员")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "月产能对比统计:统计方式报工人员", businessType = BusinessType.QUERY)
@GetMapping("/getListByUser")
public AjaxResult<List> getListByUser(MonthlyProductionReportRequest monthlyProductionReportRequest) {
List data = monthlyProductionReportService.getListByUser(monthlyProductionReportRequest);
return AjaxResult.success(data);
}
}
package com.ximai.mes.report.controller;
import com.ximai.common.annotation.Log;
import com.ximai.common.core.domain.AjaxResult;
import com.ximai.common.enums.BusinessType;
import com.ximai.mes.report.request.DailyProductionReportRequest;
import com.ximai.mes.report.request.WeeklyProductionReportRequest;
import com.ximai.mes.report.service.MonthlyProductionReportService;
import com.ximai.mes.report.service.WeeklyProductionReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api("周产能对比统计")
@RestController
@RequestMapping("/weeklyProductionReport")
public class WeeklyProductionReportController {
@Autowired
WeeklyProductionReportService weeklyProductionReportService;
@ApiOperation("日产能对比统计:获取周表头")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "日产能对比统计:获取周表头", businessType = BusinessType.QUERY)
@GetMapping("/getDatas")
public AjaxResult<List> getDatas(WeeklyProductionReportRequest weeklyProductionReportRequest) {
List data = weeklyProductionReportService.getDatas(weeklyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("周产能对比统计:统计方式工序")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "周产能对比统计:统计方式工序", businessType = BusinessType.QUERY)
@GetMapping("/getListByProcess")
public AjaxResult<List> getListByProcess(WeeklyProductionReportRequest weeklyProductionReportRequest) {
List data = weeklyProductionReportService.getListByProcess(weeklyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("周产能对比统计:统计方式车间")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "周产能对比统计:统计方式车间", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkshop")
public AjaxResult<List> getListByWorkshop(WeeklyProductionReportRequest weeklyProductionReportRequest) {
List data = weeklyProductionReportService.getListByWorkshop(weeklyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("周产能对比统计:统计方式工作中心")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "周产能对比统计:统计方式工作中心", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkstation")
public AjaxResult<List> getListByWorkstation(WeeklyProductionReportRequest weeklyProductionReportRequest) {
List data = weeklyProductionReportService.getListByWorkstation(weeklyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("周产能对比统计:统计方式工作单元")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "周产能对比统计:统计方式工作单元", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkunit")
public AjaxResult<List> getListByWorkunit(WeeklyProductionReportRequest weeklyProductionReportRequest) {
List data = weeklyProductionReportService.getListByWorkunit(weeklyProductionReportRequest);
return AjaxResult.success(data);
}
@ApiOperation("周产能对比统计:统计方式报工人员")
@PreAuthorize("@ss.hasPermi('mes:pro:dailyProductionReport:get')")
@Log(title = "周产能对比统计:统计方式报工人员", businessType = BusinessType.QUERY)
@GetMapping("/getListByUser")
public AjaxResult<List> getListByUser(WeeklyProductionReportRequest weeklyProductionReportRequest) {
List data = weeklyProductionReportService.getListByUser(weeklyProductionReportRequest);
return AjaxResult.success(data);
}
}
...@@ -51,8 +51,10 @@ public class WorkOrderProgressController extends BaseController { ...@@ -51,8 +51,10 @@ public class WorkOrderProgressController extends BaseController {
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')") @PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产进度:报工明细", businessType = BusinessType.QUERY) @Log(title = "生产进度:报工明细", businessType = BusinessType.QUERY)
@GetMapping("/getFeedbackList") @GetMapping("/getFeedbackList")
public TableDataInfo<WorkOrderProgressFeedbackListResponse> getFeedbackList( Long taskId,@RequestParam("workorderCode") String workorderCode) { public TableDataInfo<WorkOrderProgressFeedbackListResponse> getFeedbackList(Long taskWorkunitId, Long taskId,@RequestParam("workorderCode") String workorderCode) {
List<WorkOrderProgressFeedbackListResponse> workOrderProgressFeedbackListResponses = workOrderProgressService.getFeedbackList(workorderCode,taskId); if(taskWorkunitId != null && taskWorkunitId == 0)
taskWorkunitId = null;
List<WorkOrderProgressFeedbackListResponse> workOrderProgressFeedbackListResponses = workOrderProgressService.getFeedbackList(workorderCode,taskId,taskWorkunitId);
return getDataTable(workOrderProgressFeedbackListResponses); return getDataTable(workOrderProgressFeedbackListResponses);
} }
} }
package com.ximai.mes.report.mapper;
import com.ximai.mes.report.request.DailyProductionReportRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface DailyProductionReportMapper {
List<Map> getListByProcess(DailyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByWorkshop(DailyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByWorkstation(DailyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByWorkunit(DailyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByUser(DailyProductionReportRequest dailyProductionReportRequest);
}
package com.ximai.mes.report.mapper;
import com.ximai.mes.report.request.MonthlyProductionReportRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface MonthlyProductionReportMapper {
List<Map> getListByProcess(MonthlyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByWorkshop(MonthlyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByWorkstation(MonthlyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByWorkunit(MonthlyProductionReportRequest dailyProductionReportRequest);
List<Map> getListByUser(MonthlyProductionReportRequest dailyProductionReportRequest);
}
package com.ximai.mes.report.mapper;
import com.ximai.mes.report.request.WeeklyProductionReportRequest;
import java.util.List;
import java.util.Map;
public interface WeeklyProductionReportMapper {
List<Map> getListByProcess(WeeklyProductionReportRequest weeklyProductionReportRequest);
List<Map> getListByWorkshop(WeeklyProductionReportRequest weeklyProductionReportRequest);
List<Map> getListByWorkstation(WeeklyProductionReportRequest weeklyProductionReportRequest);
List<Map> getListByWorkunit(WeeklyProductionReportRequest weeklyProductionReportRequest);
List<Map> getListByUser(WeeklyProductionReportRequest weeklyProductionReportRequest);
}
package com.ximai.mes.report.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class DailyProductionReportRequest {
@ApiModelProperty("开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startDate;
@ApiModelProperty("结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endDate;
/**
* 工序ID
*/
@ApiModelProperty( "工序ID")
private Long processId;
/**
* 工序编码
*/
@ApiModelProperty( "工序编码")
private String processCode;
/**
* 工序编码
*/
@ApiModelProperty( "工序名称")
private String processName;
/**
* 车间ID
*/
@ApiModelProperty("车间ID")
private Long workshopId;
@ApiModelProperty("车间名称")
private String workshopName;
/**
* 工作中心ID
*/
@ApiModelProperty( "工作中心ID")
private Long workstationId;
/**
* 工作中心名称
*/
@ApiModelProperty( "工作中心名称")
private String workstationName;
/**
*
*/
@ApiModelProperty("工作单元ID")
private Long workunitId;
@ApiModelProperty("作业单元名称")
private String workunitName;
@ApiModelProperty("报工人员名称")
private String userName;
@ApiModelProperty("报工人员昵称")
private String nickName;
}
package com.ximai.mes.report.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class MonthlyProductionReportRequest {
@ApiModelProperty("年份 比如: 2024")
private String dateYear;
/**
* 工序ID
*/
@ApiModelProperty( "工序ID")
private Long processId;
/**
* 工序编码
*/
@ApiModelProperty( "工序编码")
private String processCode;
/**
* 工序编码
*/
@ApiModelProperty( "工序名称")
private String processName;
/**
* 车间ID
*/
@ApiModelProperty("车间ID")
private Long workshopId;
@ApiModelProperty("车间名称")
private String workshopName;
/**
* 工作中心ID
*/
@ApiModelProperty( "工作中心ID")
private Long workstationId;
/**
* 工作中心名称
*/
@ApiModelProperty( "工作中心名称")
private String workstationName;
/**
*
*/
@ApiModelProperty("工作单元ID")
private Long workunitId;
@ApiModelProperty("作业单元名称")
private String workunitName;
@ApiModelProperty("报工人员名称")
private String userName;
@ApiModelProperty("报工人员昵称")
private String nickName;
}
package com.ximai.mes.report.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class WeeklyProductionReportRequest {
@ApiModelProperty("年月份 比如:2024-01")
private String dateWeekly;
/**
* 工序ID
*/
@ApiModelProperty( "工序ID")
private Long processId;
/**
* 工序编码
*/
@ApiModelProperty( "工序编码")
private String processCode;
/**
* 工序编码
*/
@ApiModelProperty( "工序名称")
private String processName;
/**
* 车间ID
*/
@ApiModelProperty("车间ID")
private Long workshopId;
@ApiModelProperty("车间名称")
private String workshopName;
/**
* 工作中心ID
*/
@ApiModelProperty( "工作中心ID")
private Long workstationId;
/**
* 工作中心名称
*/
@ApiModelProperty( "工作中心名称")
private String workstationName;
/**
*
*/
@ApiModelProperty("工作单元ID")
private Long workunitId;
@ApiModelProperty("作业单元名称")
private String workunitName;
@ApiModelProperty("报工人员名称")
private String userName;
@ApiModelProperty("报工人员昵称")
private String nickName;
}
...@@ -23,4 +23,5 @@ public class WorkOrderProgressProcessListResponse { ...@@ -23,4 +23,5 @@ public class WorkOrderProgressProcessListResponse {
@ApiModelProperty("合格率") @ApiModelProperty("合格率")
private BigDecimal passRate; private BigDecimal passRate;
private Long taskId; private Long taskId;
private Long taskWorkunitId = 0L;
} }
package com.ximai.mes.report.service;
import com.ximai.mes.report.request.DailyProductionReportRequest;
import java.util.List;
import java.util.Map;
public interface DailyProductionReportService {
List getListByProcess(DailyProductionReportRequest dailyProductionReportRequest);
List getDatas(DailyProductionReportRequest dailyProductionReportRequest);
List getListByWorkshop(DailyProductionReportRequest dailyProductionReportRequest);
List getListByWorkstation(DailyProductionReportRequest dailyProductionReportRequest);
List getListByWorkunit(DailyProductionReportRequest dailyProductionReportRequest);
List getListByUser(DailyProductionReportRequest dailyProductionReportRequest);
}
package com.ximai.mes.report.service;
import com.ximai.mes.report.request.MonthlyProductionReportRequest;
import java.util.List;
public interface MonthlyProductionReportService {
List getListByProcess(MonthlyProductionReportRequest monthlyProductionReportRequest);
List getListByWorkshop(MonthlyProductionReportRequest dailyProductionReportRequest);
List getListByWorkstation(MonthlyProductionReportRequest dailyProductionReportRequest);
List getListByWorkunit(MonthlyProductionReportRequest dailyProductionReportRequest);
List getListByUser(MonthlyProductionReportRequest dailyProductionReportRequest);
}
package com.ximai.mes.report.service;
import com.ximai.mes.report.request.WeeklyProductionReportRequest;
import java.util.List;
public interface WeeklyProductionReportService {
List getListByProcess(WeeklyProductionReportRequest weeklyProductionReportRequest);
List getListByWorkshop(WeeklyProductionReportRequest weeklyProductionReportRequest);
List getListByWorkstation(WeeklyProductionReportRequest weeklyProductionReportRequest);
List getListByWorkunit(WeeklyProductionReportRequest weeklyProductionReportRequest);
List getListByUser(WeeklyProductionReportRequest weeklyProductionReportRequest);
List getDatas(WeeklyProductionReportRequest weeklyProductionReportRequest);
}
...@@ -12,5 +12,5 @@ public interface WorkOrderProgressService { ...@@ -12,5 +12,5 @@ public interface WorkOrderProgressService {
List<WorkOrderProgressProcessListResponse> getProcessList(String workorderCode); List<WorkOrderProgressProcessListResponse> getProcessList(String workorderCode);
List<WorkOrderProgressFeedbackListResponse> getFeedbackList(String workorderCode,Long taskId); List<WorkOrderProgressFeedbackListResponse> getFeedbackList(String workorderCode,Long taskId,Long taskWorkunitId);
} }
package com.ximai.mes.report.service.impl;
import com.ximai.common.utils.data.ExceptionUtil;
import com.ximai.mes.report.mapper.MonthlyProductionReportMapper;
import com.ximai.mes.report.request.MonthlyProductionReportRequest;
import com.ximai.mes.report.request.MonthlyProductionReportRequest;
import com.ximai.mes.report.service.MonthlyProductionReportService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class MonthlyProductionReportServiceImp implements MonthlyProductionReportService {
private List<String> dateList =new ArrayList<String>(
Arrays.asList( "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"));
@Autowired
DailyProductionReportServiceImp dailyProductionReportServiceImp;
@Autowired
MonthlyProductionReportMapper monthlyProductionReportMapper;
@Override
public List getListByProcess(MonthlyProductionReportRequest dailyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(dailyProductionReportRequest.getDateYear() == null,
"请传入年份");
List<Map> processDataList = monthlyProductionReportMapper.getListByProcess(dailyProductionReportRequest);
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"工序名称","工序编码","工序",dateList);
return returnList;
}
@Override
public List getListByWorkshop(MonthlyProductionReportRequest dailyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(dailyProductionReportRequest.getDateYear() == null,
"请传入年份");
List<Map> processDataList = monthlyProductionReportMapper.getListByWorkshop(dailyProductionReportRequest);
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"车间名称","车间编码","车间",dateList);
return returnList;
}
@Override
public List getListByWorkstation(MonthlyProductionReportRequest dailyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(dailyProductionReportRequest.getDateYear() == null,
"请传入年份");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<Map> processDataList = monthlyProductionReportMapper.getListByWorkstation(dailyProductionReportRequest);
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"工作中心名称","工作中心编码","工作中心",dateList);
return returnList;
}
@Override
public List getListByWorkunit(MonthlyProductionReportRequest dailyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(dailyProductionReportRequest.getDateYear() == null,
"请传入年份");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<Map> processDataList = monthlyProductionReportMapper.getListByWorkunit(dailyProductionReportRequest);
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"工作单元名称","工作单元编码","工作单元",dateList);
return returnList;
}
@Override
public List getListByUser(MonthlyProductionReportRequest dailyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(dailyProductionReportRequest.getDateYear() == null,
"请传入年份");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<Map> processDataList = monthlyProductionReportMapper.getListByUser(dailyProductionReportRequest);
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"报工人员名称","报工人员编码","报工人员",dateList);
return returnList;
}
}
package com.ximai.mes.report.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ximai.common.utils.data.ExceptionUtil;
import com.ximai.mes.report.mapper.MonthlyProductionReportMapper;
import com.ximai.mes.report.mapper.WeeklyProductionReportMapper;
import com.ximai.mes.report.request.WeeklyProductionReportRequest;
import com.ximai.mes.report.service.WeeklyProductionReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
@Service
public class WeeklyProductionReportServiceImp implements WeeklyProductionReportService {
// private List<String> dateList =new ArrayList<String>(
// Arrays.asList( "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"));
@Autowired
DailyProductionReportServiceImp dailyProductionReportServiceImp;
@Autowired
WeeklyProductionReportMapper weeklyProductionReportMapper;
@Override
public List getListByProcess(WeeklyProductionReportRequest weeklyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(weeklyProductionReportRequest.getDateWeekly() == null,
"请传入年月份");
List<Map> processDataList = weeklyProductionReportMapper.getListByProcess(weeklyProductionReportRequest);
List<String> dateList = getWeeks(new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[0]), new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[1]));
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"工序名称","工序编码","工序",dateList);
return returnList;
}
@Override
public List getListByWorkshop(WeeklyProductionReportRequest weeklyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(weeklyProductionReportRequest.getDateWeekly() == null,
"请传入年月份");
List<Map> processDataList = weeklyProductionReportMapper.getListByWorkshop(weeklyProductionReportRequest);
List<String> dateList = getWeeks(new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[0]), new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[1]));
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"车间名称","车间编码","车间",dateList);
return returnList;
}
@Override
public List getListByWorkstation(WeeklyProductionReportRequest weeklyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(weeklyProductionReportRequest.getDateWeekly() == null,
"请传入年月份");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<Map> processDataList = weeklyProductionReportMapper.getListByWorkstation(weeklyProductionReportRequest);
List<String> dateList = getWeeks(new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[0]), new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[1]));
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"工作中心名称","工作中心编码","工作中心",dateList);
return returnList;
}
@Override
public List getListByWorkunit(WeeklyProductionReportRequest weeklyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(weeklyProductionReportRequest.getDateWeekly() == null,
"请传入年月份");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<Map> processDataList = weeklyProductionReportMapper.getListByWorkunit(weeklyProductionReportRequest);
List<String> dateList = getWeeks(new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[0]), new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[1]));
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"工作单元名称","工作单元编码","工作单元",dateList);
return returnList;
}
@Override
public List getListByUser(WeeklyProductionReportRequest weeklyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(weeklyProductionReportRequest.getDateWeekly() == null,
"请传入年月份");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
List<Map> processDataList = weeklyProductionReportMapper.getListByUser(weeklyProductionReportRequest);
List<String> dateList = getWeeks(new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[0]), new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[1]));
List<Map> returnList = dailyProductionReportServiceImp.groupList(processDataList,"报工人员名称","报工人员编码","报工人员",dateList);
return returnList;
}
@Override
public List getDatas(WeeklyProductionReportRequest weeklyProductionReportRequest) {
ExceptionUtil.checkTrueThrowException(weeklyProductionReportRequest.getDateWeekly() == null,
"请传入年月份");
List<String> dateList = getWeeks(new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[0]), new Integer(weeklyProductionReportRequest.getDateWeekly().split("-")[1]));
return dateList;
}
public static List<String> getWeeksInMonth(String dateWeekly) {
dateWeekly = dateWeekly + "-01";
LocalDate date = LocalDate.parse(dateWeekly);
LocalDate firstDayOfMonth = date.with(TemporalAdjusters.firstDayOfMonth());
LocalDate firstDayOfNextMonth = date.with(TemporalAdjusters.firstDayOfNextMonth());
LocalDate lastDayOfMonth = firstDayOfNextMonth.minusDays(1);
// 如果月份的第一个星期一之前有足够的天数构成一周,则总周数加一
if (firstDayOfMonth.getDayOfWeek().getValue() <= firstDayOfMonth.getDayOfMonth()) {
List<String> data = new ArrayList<>();
int x = (int) ((lastDayOfMonth.getDayOfMonth() - firstDayOfMonth.getDayOfMonth()) / 7) + 1;
for (int i = 1 ; i <= x ; i ++){
data.add(""+i);
}
return data;
} else {
int x = (int) ((lastDayOfMonth.getDayOfMonth() - firstDayOfMonth.getDayOfMonth()) / 7);
List<String> data = new ArrayList<>();
for (int i = 1 ; i <= x ; i ++){
data.add(""+i);
}
return data;
}
}
private List<String> getWeeks(Integer year, Integer month) {
//天数
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, month -1);
System.out.println("天数:" + c.getActualMaximum(Calendar.DAY_OF_MONTH));
int days = c.getActualMaximum(Calendar.DAY_OF_MONTH);
//月起止时间
DateTime startTime = null;
try {
startTime = DateUtil.beginOfMonth(new SimpleDateFormat("yyyy-MM").parse(year +"-"+ month));
} catch (ParseException e) {
throw new RuntimeException(e);
}
int i = DateUtil.dayOfWeek(startTime);
int firstWeek = 0;
switch (i){
case 1 :
firstWeek = 1;
break;
case 2 :
firstWeek = 7;
break;
case 3 :
firstWeek = 6;
break;
case 4 :
firstWeek = 5;
break;
case 5 :
firstWeek = 4;
break;
case 6 :
firstWeek = 3;
break;
case 7 :
firstWeek = 2;
break;
}
int remainingDays = days - firstWeek;
int weeks = (int)Math.ceil((double)remainingDays/7) + 1;
List<String> data = new ArrayList<>();
for (int x = 1 ; x <= weeks ; x ++){
data.add(""+x);
}
return data;
}
}
...@@ -3,9 +3,12 @@ package com.ximai.mes.report.service.impl; ...@@ -3,9 +3,12 @@ package com.ximai.mes.report.service.impl;
import com.ximai.mes.constant.TaskStatusEnum; import com.ximai.mes.constant.TaskStatusEnum;
import com.ximai.mes.pro.domain.ProFeedback; import com.ximai.mes.pro.domain.ProFeedback;
import com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder; import com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder;
import com.ximai.mes.pro.domain.task.ProTask;
import com.ximai.mes.pro.domain.task.ProTaskWorkunit;
import com.ximai.mes.pro.mapper.ProFeedbackMapper; import com.ximai.mes.pro.mapper.ProFeedbackMapper;
import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkorderMapper; import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkorderMapper;
import com.ximai.mes.pro.mapper.task.ProTaskMapper; import com.ximai.mes.pro.mapper.task.ProTaskMapper;
import com.ximai.mes.pro.mapper.task.ProTaskWorkunitMapper;
import com.ximai.mes.report.request.WorkOrderProgressRequest; import com.ximai.mes.report.request.WorkOrderProgressRequest;
import com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse; import com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse;
import com.ximai.mes.report.response.WorkOrderProgressListResponse; import com.ximai.mes.report.response.WorkOrderProgressListResponse;
...@@ -31,6 +34,8 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService { ...@@ -31,6 +34,8 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
private ProTaskMapper proTaskMapper; private ProTaskMapper proTaskMapper;
@Autowired @Autowired
private ProFeedbackMapper proFeedbackMapper; private ProFeedbackMapper proFeedbackMapper;
@Autowired
ProTaskWorkunitMapper proTaskWorkunitMapper;
@Override @Override
@Transactional @Transactional
public List<WorkOrderProgressListResponse> getList(WorkOrderProgressRequest workOrderProgressRequest) { public List<WorkOrderProgressListResponse> getList(WorkOrderProgressRequest workOrderProgressRequest) {
...@@ -39,7 +44,12 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService { ...@@ -39,7 +44,12 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
workOrderProgressListResponse.setWorkorderType(dictDataService.getDictLabel("mes_workorder_type", workOrderProgressListResponse.getWorkorderType())); workOrderProgressListResponse.setWorkorderType(dictDataService.getDictLabel("mes_workorder_type", workOrderProgressListResponse.getWorkorderType()));
if(workOrderProgressListResponse.getQuantity() != null && workOrderProgressListResponse.getQuantity().compareTo(BigDecimal.ZERO) >0){ if(workOrderProgressListResponse.getQuantity() != null && workOrderProgressListResponse.getQuantity().compareTo(BigDecimal.ZERO) >0){
workOrderProgressListResponse.setQuantityProduced(workOrderProgressListResponse.getQuantityProduced() != null ? workOrderProgressListResponse.getQuantityProduced() : BigDecimal.ZERO); workOrderProgressListResponse.setQuantityProduced(workOrderProgressListResponse.getQuantityProduced() != null ? workOrderProgressListResponse.getQuantityProduced() : BigDecimal.ZERO);
workOrderProgressListResponse.setQuantityMu(workOrderProgressListResponse.getQuantityProduced().divide(workOrderProgressListResponse.getQuantity()).setScale(2, RoundingMode.HALF_UP)); if(workOrderProgressListResponse.getQuantity().compareTo(workOrderProgressListResponse.getQuantityProduced()) > 0){
workOrderProgressListResponse.setQuantityMu(workOrderProgressListResponse.getQuantityProduced().multiply(new BigDecimal(100)).divide(workOrderProgressListResponse.getQuantity(),2, RoundingMode.HALF_UP));
}else{
workOrderProgressListResponse.setQuantityMu(new BigDecimal(100));
}
}else{ }else{
workOrderProgressListResponse.setQuantityMu(new BigDecimal(100)); workOrderProgressListResponse.setQuantityMu(new BigDecimal(100));
...@@ -52,19 +62,49 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService { ...@@ -52,19 +62,49 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
public List<WorkOrderProgressProcessListResponse> getProcessList(String workorderCode) { public List<WorkOrderProgressProcessListResponse> getProcessList(String workorderCode) {
List<WorkOrderProgressProcessListResponse> workOrderProgressProcessListResponses = proTaskMapper.getProcessList(workorderCode); List<WorkOrderProgressProcessListResponse> workOrderProgressProcessListResponses = proTaskMapper.getProcessList(workorderCode);
for (WorkOrderProgressProcessListResponse workOrderProgressProcessListResponse : workOrderProgressProcessListResponses){ for (WorkOrderProgressProcessListResponse workOrderProgressProcessListResponse : workOrderProgressProcessListResponses){
if(workOrderProgressProcessListResponse.equals(TaskStatusEnum.BEGINNING.getStatus())){ // if(workOrderProgressProcessListResponse.getStatus().equals(TaskStatusEnum.BEGINNING.getStatus())){
workOrderProgressProcessListResponse.setStatus("已开工"); // workOrderProgressProcessListResponse.setStatus("加工中");
}else if(workOrderProgressProcessListResponse.equals(TaskStatusEnum.FINISHED.getStatus())){ // }else if(workOrderProgressProcessListResponse.getStatus().equals(TaskStatusEnum.FINISHED.getStatus())){
workOrderProgressProcessListResponse.setStatus("已完工"); // workOrderProgressProcessListResponse.setStatus("已完工");
// }else if(workOrderProgressProcessListResponse.getStatus().equals(TaskStatusEnum.PAUSE.getStatus())){
// workOrderProgressProcessListResponse.setStatus("暂停");
// }else if(workOrderProgressProcessListResponse.getStatus().equals(TaskStatusEnum.PREPARE.getStatus())){
// workOrderProgressProcessListResponse.setStatus("未开工");
// }else if(workOrderProgressProcessListResponse.getStatus().equals(TaskStatusEnum.ERROR_STOP.getStatus())){
// workOrderProgressProcessListResponse.setStatus("故障停工");
// }
ProTaskWorkunit proTaskWorkunitQuery = new ProTaskWorkunit();
proTaskWorkunitQuery.setTaskId(workOrderProgressProcessListResponse.getTaskId());
List<ProTaskWorkunit> proTaskWorkunitList = proTaskWorkunitMapper.selectProTaskWorkunitList(proTaskWorkunitQuery);
if(proTaskWorkunitList.size() > 0){
if(proTaskWorkunitList.stream()
.filter(proTaskWorkunit -> proTaskWorkunit.getStatus().equals(TaskStatusEnum.FINISHED.getStatus())).count() == proTaskWorkunitList.size() ){
//下面的所有派工表任务都完工时,标记为完工
workOrderProgressProcessListResponse.setStatus("已完工");
}else if(proTaskWorkunitList.stream()
.filter(proTaskWorkunit -> proTaskWorkunit.getStatus().equals(TaskStatusEnum.ERROR_STOP.getStatus())).count() > 0 ){
//下面的所有派工表任务存在有任何一条故障时,标记为故障停工
workOrderProgressProcessListResponse.setStatus("故障停工");
}else if(proTaskWorkunitList.stream()
.filter(proTaskWorkunit -> proTaskWorkunit.getStatus().equals(TaskStatusEnum.PREPARE.getStatus())).count() == proTaskWorkunitList.size() ){
//下面的所有派工表任务都未开工时,标记为未开工
workOrderProgressProcessListResponse.setStatus("未开工");
}else{
//其他加工中
workOrderProgressProcessListResponse.setStatus("加工中");
}
}else{ }else{
workOrderProgressProcessListResponse.setStatus("未开工"); workOrderProgressProcessListResponse.setStatus("未开工");
} }
if(workOrderProgressProcessListResponse.getQuantityProduced() != null && workOrderProgressProcessListResponse.getQuantityProduced().compareTo(BigDecimal.ZERO) > 0){
workOrderProgressProcessListResponse.setPassRate(workOrderProgressProcessListResponse.getQuantityQualify(). if(workOrderProgressProcessListResponse.getQuantityProduced() != null && workOrderProgressProcessListResponse.getQuantityProduced().compareTo(BigDecimal.ZERO) > 0){
divide(workOrderProgressProcessListResponse.getQuantityProduced(),2, RoundingMode.HALF_UP)); if(workOrderProgressProcessListResponse.getQuantityProduced().compareTo(workOrderProgressProcessListResponse.getQuantityQualify()) > 0){
workOrderProgressProcessListResponse.setPassRate(workOrderProgressProcessListResponse.getQuantityQualify().multiply(new BigDecimal(100)).
divide(workOrderProgressProcessListResponse.getQuantityProduced(),2, RoundingMode.HALF_UP));
}else{
workOrderProgressProcessListResponse.setPassRate(new BigDecimal(100));
}
}else{ }else{
workOrderProgressProcessListResponse.setPassRate(BigDecimal.ZERO); workOrderProgressProcessListResponse.setPassRate(BigDecimal.ZERO);
} }
} }
...@@ -72,8 +112,8 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService { ...@@ -72,8 +112,8 @@ public class WorkOrderProgressServiceImp implements WorkOrderProgressService {
} }
@Override @Override
public List<WorkOrderProgressFeedbackListResponse> getFeedbackList(String workorderCode,Long taskId) { public List<WorkOrderProgressFeedbackListResponse> getFeedbackList(String workorderCode,Long taskId,Long taskWorkunitId) {
List<WorkOrderProgressFeedbackListResponse> workOrderProgressFeedbackListResponses = proFeedbackMapper.getFeedbackList( workorderCode,taskId); List<WorkOrderProgressFeedbackListResponse> workOrderProgressFeedbackListResponses = proFeedbackMapper.getFeedbackList( workorderCode,taskId,taskWorkunitId);
return workOrderProgressFeedbackListResponses; return workOrderProgressFeedbackListResponses;
} }
} }
...@@ -185,7 +185,88 @@ ...@@ -185,7 +185,88 @@
</select> </select>
<select id="getWorkOrderProgressServiceList" <select id="getWorkOrderProgressServiceList"
resultType="com.ximai.mes.report.response.WorkOrderProgressListResponse"> 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(case task.is_last_process when 0 THEN 0 ELSE fe.quantity_qualify + fe.quantity_unqualify END) as quantity_produced
FROM
pro_workorder pw
LEFT JOIN pro_feedback fe ON fe.workorder_id = pw.workorder_id
left join pro_task task on task.task_id = fe.task_id
<where> <where>
<if test="workorderCode != null and workorderCode != ''">and pw.workorder_code = #{workorderCode}</if> <if test="workorderCode != null and workorderCode != ''">and pw.workorder_code = #{workorderCode}</if>
<if test="productId != null ">and pw.product_id = #{productId}</if> <if test="productId != null ">and pw.product_id = #{productId}</if>
...@@ -193,6 +274,82 @@ ...@@ -193,6 +274,82 @@
<if test="orderCode != null and orderCode !=''">and pw.order_code = #{orderCode}</if> <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> <if test="customerProjectNo != null and customerProjectNo !=''">and pw.customer_project_no = #{customerProjectNo}</if>
</where> </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> </select>
<insert id="insertProWorkorder" parameterType="ProWorkorder" useGeneratedKeys="true" keyProperty="workorderId"> <insert id="insertProWorkorder" parameterType="ProWorkorder" useGeneratedKeys="true" keyProperty="workorderId">
......
...@@ -346,10 +346,64 @@ ...@@ -346,10 +346,64 @@
</where> </where>
</select> </select>
<select id="selectByTaskBatch" resultType="com.ximai.mes.pro.domain.task.ProTask"> <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> <where>
t.task_batch = #{taskBatch} t.task_batch = #{taskBatch}
</where> </where>
order by t.idx
</select> </select>
<select id="getProcessList" <select id="getProcessList"
resultType="com.ximai.mes.report.response.WorkOrderProgressProcessListResponse"> resultType="com.ximai.mes.report.response.WorkOrderProgressProcessListResponse">
......
...@@ -94,7 +94,9 @@ ...@@ -94,7 +94,9 @@
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%') AND u.user_name like concat('%', #{userName}, '%')
</if> </if>
<if test="nickName != null and nickName != ''">
AND u.nick_name like concat('%', #{nickName}, '%')
</if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND u.status = #{status} AND u.status = #{status}
......
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