Commit b5ed61d3 authored by 温志超's avatar 温志超

更新报表

parent 053d0d3b
......@@ -6,8 +6,7 @@ import com.ximai.mes.pro.domain.vo.ProFeedbackVo;
import com.ximai.mes.pro.domain.vo.ProProcessTaskVo;
import com.ximai.mes.pro.dto.ProFeedbackDto;
import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.response.FeedbackResponse;
import com.ximai.mes.report.response.WorkOrderProgressFeedbackListResponse;
import com.ximai.mes.report.response.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;
......@@ -145,4 +144,19 @@ public interface ProFeedbackMapper {
List<WorkOrderProgressFeedbackListResponse> getFeedbackList(@Param("workorderCode")String workorderCode,@Param("taskId") Long taskId,@Param("taskWorkunitId") Long taskWorkunitId);
List<FeedbackResponseExportByList> export(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkOrder> getListByWorkOrderExport(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkshop> getListByWorkshopExport(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkstation> getListByWorkstationExport(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkunit> getListByWorkunitExport(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByProcess> getListByProcessExport(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByUser> getListByUserExport(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByDefect> getListByDefectExport(FeedbackRequest feedbackRequest);
}
......@@ -3,12 +3,15 @@ package com.ximai.mes.report.controller;
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.domain.entity.SysDictData;
import com.ximai.common.core.page.TableDataInfo;
import com.ximai.common.enums.BusinessType;
import com.ximai.common.utils.data.StringUtils;
import com.ximai.common.utils.poi.ExcelUtil;
import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.response.FeedbackResponse;
import com.ximai.mes.report.response.*;
import com.ximai.mes.report.service.FeedbackService;
import com.ximai.system.service.ISysDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.checkerframework.checker.units.qual.A;
......@@ -21,12 +24,15 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Api("生产报工报表")
@RestController
@RequestMapping("/report/pro/feedback")
public class FeedbackController extends BaseController {
@Autowired
private ISysDictDataService dictDataService;
@Autowired
FeedbackService feedbackService;
/**
......@@ -51,9 +57,17 @@ public class FeedbackController extends BaseController {
@PostMapping("/getList/export")
@ApiOperation("生产报工记录:明细界面导出")
public void export(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getList(feedbackRequest);
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表明细");
// List<FeedbackResponse> feedbackResponseList = feedbackService.getList(feedbackRequest);
List<FeedbackResponseExportByList> feedbackResponseList = feedbackService.export(feedbackRequest);
SysDictData dictData = new SysDictData();
dictData.setDictType("mes_workorder_type");
List<SysDictData> sysDictDataList = dictDataService.selectDictDataList(dictData);
Map<String,List<SysDictData>> stringListMap = sysDictDataList.stream().collect(Collectors.groupingBy(SysDictData::getDictValue));
feedbackResponseList.stream().forEach(feedbackResponse ->{
feedbackResponse.setWorkorderType(stringListMap.get(feedbackResponse.getWorkorderType()) == null ? null : stringListMap.get(feedbackResponse.getWorkorderType()).get(0).getDictLabel());
} );
ExcelUtil<FeedbackResponseExportByList> util = new ExcelUtil<>(FeedbackResponseExportByList.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表明细","生产报工报表明细");
}
@ApiOperation("生产报工记录:统计方式工单")
......@@ -86,9 +100,9 @@ public class FeedbackController extends BaseController {
@PostMapping("/getListByWorkOrder/export")
@ApiOperation("生产报工记录:统计方式工单界面导出")
public void getListByWorkOrderExport(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkOrder(feedbackRequest);
List<FeedbackResponseExportByWorkOrder> feedbackResponseList = feedbackService.getListByWorkOrderExport(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
for(FeedbackResponseExportByWorkOrder feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
......@@ -97,8 +111,8 @@ public class FeedbackController extends BaseController {
feedbackResponse.setQualificationRate("0.00%");
}
}
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工单");
ExcelUtil<FeedbackResponseExportByWorkOrder> util = new ExcelUtil<>(FeedbackResponseExportByWorkOrder.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工单","生产报工报表-统计方式工单");
}
......@@ -132,9 +146,9 @@ public class FeedbackController extends BaseController {
@PostMapping("/getListByWorkshop/export")
@ApiOperation("生产报工记录:统计方式车间界面导出")
public void getListByWorkshopExport(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkshop(feedbackRequest);
List<FeedbackResponseExportByWorkshop> feedbackResponseList = feedbackService.getListByWorkshopExport(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
for(FeedbackResponseExportByWorkshop feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
......@@ -143,8 +157,8 @@ public class FeedbackController extends BaseController {
feedbackResponse.setQualificationRate("0.00%");
}
}
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式车间");
ExcelUtil<FeedbackResponseExportByWorkshop> util = new ExcelUtil<>(FeedbackResponseExportByWorkshop.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式车间","生产报工报表-统计方式车间");
}
......@@ -177,9 +191,9 @@ public class FeedbackController extends BaseController {
@PostMapping("/getListByWorkstation/export")
@ApiOperation("生产报工记录:统计方式工作中心导出")
public void getListByWorkstationExport(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkstation(feedbackRequest);
List<FeedbackResponseExportByWorkstation> feedbackResponseList = feedbackService.getListByWorkstationExport(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
for(FeedbackResponseExportByWorkstation feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
......@@ -188,8 +202,8 @@ public class FeedbackController extends BaseController {
feedbackResponse.setQualificationRate("0.00%");
}
}
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工作中心");
ExcelUtil<FeedbackResponseExportByWorkstation> util = new ExcelUtil<>(FeedbackResponseExportByWorkstation.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工作中心","生产报工报表-统计方式工作中心");
}
@ApiOperation("生产报工记录:统计方式工作单元")
......@@ -221,9 +235,9 @@ public class FeedbackController extends BaseController {
@PostMapping("/getListByWorkunit/export")
@ApiOperation("生产报工记录:统计统计方式工作单元导出")
public void getListByWorkunitExport(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkunit(feedbackRequest);
List<FeedbackResponseExportByWorkunit> feedbackResponseList = feedbackService.getListByWorkunitExport(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
for(FeedbackResponseExportByWorkunit feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
......@@ -232,8 +246,8 @@ public class FeedbackController extends BaseController {
feedbackResponse.setQualificationRate("0.00%");
}
}
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工作单元");
ExcelUtil<FeedbackResponseExportByWorkunit> util = new ExcelUtil<>(FeedbackResponseExportByWorkunit.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工作单元","生产报工报表-统计方式工作单元");
}
......@@ -266,9 +280,9 @@ public class FeedbackController extends BaseController {
@PostMapping("/getListByProcess/export")
@ApiOperation("生产报工记录:统计方式工序导出")
public void getListByProcessExport(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByProcess(feedbackRequest);
List<FeedbackResponseExportByProcess> feedbackResponseList = feedbackService.getListByProcessExport(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
for(FeedbackResponseExportByProcess feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
......@@ -277,8 +291,8 @@ public class FeedbackController extends BaseController {
feedbackResponse.setQualificationRate("0.00%");
}
}
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工序");
ExcelUtil<FeedbackResponseExportByProcess> util = new ExcelUtil<>(FeedbackResponseExportByProcess.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式工序","生产报工报表-统计方式工序");
}
@ApiOperation("生产报工记录:统计方式用户")
......@@ -309,9 +323,9 @@ public class FeedbackController extends BaseController {
@PostMapping("/getListByUser/export")
@ApiOperation("生产报工记录:统计方式用户导出")
public void getListByUserExport(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByUser(feedbackRequest);
List<FeedbackResponseExportByUser> feedbackResponseList = feedbackService.getListByUserExport(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
for(FeedbackResponseExportByUser feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
......@@ -320,8 +334,8 @@ public class FeedbackController extends BaseController {
feedbackResponse.setQualificationRate("0.00%");
}
}
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式用户");
ExcelUtil<FeedbackResponseExportByUser> util = new ExcelUtil<>(FeedbackResponseExportByUser.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式用户","生产报工报表-统计方式用户");
}
......@@ -358,9 +372,9 @@ public class FeedbackController extends BaseController {
@PostMapping("/getListByDefect/export")
@ApiOperation("生产报工记录:统计方式不合格原因导出")
public void getListByDefectExport(HttpServletResponse response, FeedbackRequest feedbackRequest) {
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByDefect(feedbackRequest);
List<FeedbackResponseExportByDefect> feedbackResponseList = feedbackService.getListByDefectExport(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
for(FeedbackResponseExportByDefect feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
......@@ -369,7 +383,7 @@ public class FeedbackController extends BaseController {
feedbackResponse.setQualificationRate("0.00%");
}
}
ExcelUtil<FeedbackResponse> util = new ExcelUtil<>(FeedbackResponse.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式不合格原因");
ExcelUtil<FeedbackResponseExportByDefect> util = new ExcelUtil<>(FeedbackResponseExportByDefect.class);
util.exportExcel(response, feedbackResponseList, "生产报工报表-统计方式不合格原因","生产报工报表-统计方式不合格原因");
}
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class FeedbackResponseExportByDefect {
/** 异常原因 */
@ApiModelProperty( "异常原因")
@Excel(name = "异常原因")
private String abnormalReason;
@ApiModelProperty("异常备注")
@Excel(name = "异常备注")
private String abnormalRemark;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("良率")
@Excel(name = "良率")
private String qualificationRate;
}
package com.ximai.mes.report.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class FeedbackResponseExportByList {
/**
* 工单类型
*/
@ApiModelProperty( "工单类型")
@Excel(name = "工单类型")
private String workorderType;
@ApiModelProperty("客户项目号")
@Excel(name = "客户项目号")
private String customerProjectNo;
@ApiModelProperty("订单单号")
@Excel(name = "订单单号")
private String orderCode;
@ApiModelProperty( "工单编码")
@Excel(name = "生产工单")
private String workorderCode;
@ApiModelProperty( "工单名称")
//@Excel(name = "工单名称")
private String workorderName;
/**
* 产品编号
*/
@ApiModelProperty( "产品编号")
@Excel(name = "产品编号")
private String productCode;
/**
* 产品名称
*/
@ApiModelProperty( "产品名称")
@Excel(name = "产品名称")
private String productName;
/**
* 任务编号
*/
@ApiModelProperty( "工序任务号")
@Excel(name = "工序任务号")
private String taskCode;
/**
* 工序名称
*/
@ApiModelProperty( "工序编码")
@Excel(name = "工序编码")
private String processCode;
/**
* 工序名称
*/
@ApiModelProperty( "工序名称")
@Excel(name = "工序名称")
private String processName;
/**
* 工作中心编号
*/
@ApiModelProperty( "工作中心编号")
@Excel(name = "工作中心编号")
private String workstationCode;
/**
* 工作中心名称
*/
@ApiModelProperty( "工作中心名称")
@Excel(name = "工作中心名称")
private String workstationName;
/**
*
*/
@ApiModelProperty("工作单元编码")
@Excel(name = "工作单元编码")
private String workunitCode;
@ApiModelProperty("工作单元名称")
@Excel(name = "工作单元名称")
private String workunitName;
@ApiModelProperty("报工人员")
@Excel(name = "报工人员")
private String userName;
@ApiModelProperty("报工人员名称")
@Excel(name = "报工人员名称")
private String nickName;
/**
* 排产数量
*/
@ApiModelProperty( "派工数量")
@Excel(name = "派工数量")
private BigDecimal quantity;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
/** 异常原因 */
@ApiModelProperty( "异常原因")
@Excel(name = "不合格原因")
private String abnormalReason;
@ApiModelProperty("标准工时")
@Excel(name = "标准工时")
private BigDecimal stdWorkingTime;
@ApiModelProperty("实际工时")
@Excel(name = "实际工时")
private BigDecimal machineTime;
// @ApiModelProperty("实际工时")
// @Excel(name = "实际工时")
private BigDecimal machineTimeBigDecimal;
/**
* 预计结束时间
*/
@ApiModelProperty("计划完成时间")
@Excel(name = "计划完成时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scheduleEndDate;
/**
* 报工时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty( "报工时间")
@Excel(name = "报工时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime;
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class FeedbackResponseExportByProcess {
/**
* 工序名称
*/
@ApiModelProperty( "工序编码")
@Excel(name = "工序编码")
private String processCode;
/**
* 工序名称
*/
@ApiModelProperty( "工序名称")
@Excel(name = "工序名称")
private String processName;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("良率")
@Excel(name = "良率")
private String qualificationRate;
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class FeedbackResponseExportByUser {
@ApiModelProperty("报工人员")
@Excel(name = "报工人员")
private String userName;
@ApiModelProperty("报工人员名称")
@Excel(name = "报工人员名称")
private String nickName;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("良率")
@Excel(name = "良率")
private String qualificationRate;
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class FeedbackResponseExportByWorkOrder {
@ApiModelProperty( "工单编码")
@Excel(name = "生产工单")
private String workorderCode;
@ApiModelProperty( "工单名称")
@Excel(name = "工单名称")
private String workorderName;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("良率")
@Excel(name = "良率")
private String qualificationRate;
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class FeedbackResponseExportByWorkshop {
@ApiModelProperty("车间编号")
@Excel(name = "车间编号")
private String workshopCode;
@ApiModelProperty("车间名称")
@Excel(name = "车间名称")
private String workshopName;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("良率")
@Excel(name = "良率")
private String qualificationRate;
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class FeedbackResponseExportByWorkstation {
/**
* 工作中心编号
*/
@ApiModelProperty( "工作中心编号")
@Excel(name = "工作中心编号")
private String workstationCode;
/**
* 工作中心名称
*/
@ApiModelProperty( "工作中心名称")
@Excel(name = "工作中心名称")
private String workstationName;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("良率")
@Excel(name = "良率")
private String qualificationRate;
}
package com.ximai.mes.report.response;
import com.ximai.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class FeedbackResponseExportByWorkunit {
/**
*
*/
@ApiModelProperty("工作单元编码")
@Excel(name = "工作单元编码")
private String workunitCode;
@ApiModelProperty("工作单元名称")
@Excel(name = "工作单元名称")
private String workunitName;
/**
* 本次报工数量
*/
@ApiModelProperty( "报工数量")
@Excel(name = "报工数量")
private BigDecimal quantityFeedback;
/**
* 合格品数量
*/
@ApiModelProperty( "合格数量")
@Excel(name = "合格数量")
private BigDecimal quantityQualify;
/**
* 不良品数量
*/
@ApiModelProperty( "不合格数量")
@Excel(name = "不合格数量")
private BigDecimal quantityUnqualify;
@ApiModelProperty("良率")
@Excel(name = "良率")
private String qualificationRate;
}
package com.ximai.mes.report.service;
import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.response.FeedbackResponse;
import com.ximai.mes.report.response.*;
import java.util.List;
public interface FeedbackService {
List<FeedbackResponse> getList(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByList> export(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkOrder(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkOrder> getListByWorkOrderExport(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkshop(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkshop> getListByWorkshopExport(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkstation(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkstation> getListByWorkstationExport(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkunit(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByWorkunit> getListByWorkunitExport(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByProcess(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByProcess> getListByProcessExport(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByUser(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByUser> getListByUserExport(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByDefect(FeedbackRequest feedbackRequest);
List<FeedbackResponseExportByDefect> getListByDefectExport(FeedbackRequest feedbackRequest);
}
......@@ -3,7 +3,7 @@ package com.ximai.mes.report.service.impl;
import com.ximai.mes.pro.domain.ProFeedback;
import com.ximai.mes.pro.mapper.ProFeedbackMapper;
import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.response.FeedbackResponse;
import com.ximai.mes.report.response.*;
import com.ximai.mes.report.service.FeedbackService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -19,39 +19,79 @@ public class FeedbackServiceImp implements FeedbackService {
public List<FeedbackResponse> getList(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getList(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByList> export(FeedbackRequest feedbackRequest){
return proFeedbackMapper.export(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkOrder(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkOrder(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByWorkOrder> getListByWorkOrderExport(FeedbackRequest feedbackRequest){
return proFeedbackMapper.getListByWorkOrderExport(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkshop(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkshop(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByWorkshop> getListByWorkshopExport(FeedbackRequest feedbackRequest){
return proFeedbackMapper.getListByWorkshopExport(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkstation(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkstation(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByWorkstation> getListByWorkstationExport(FeedbackRequest feedbackRequest){
return proFeedbackMapper.getListByWorkstationExport(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkunit(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkunit(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByWorkunit> getListByWorkunitExport(FeedbackRequest feedbackRequest){
return proFeedbackMapper.getListByWorkunitExport(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByProcess(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByProcess(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByProcess> getListByProcessExport(FeedbackRequest feedbackRequest){
return proFeedbackMapper.getListByProcessExport(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByUser(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByUser(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByUser> getListByUserExport(FeedbackRequest feedbackRequest){
return proFeedbackMapper.getListByUserExport(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByDefect(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByDefect(feedbackRequest);
}
@Override
public List<FeedbackResponseExportByDefect> getListByDefectExport(FeedbackRequest feedbackRequest){
return proFeedbackMapper.getListByDefectExport(feedbackRequest);
}
}
......@@ -589,6 +589,405 @@
f.abnormal_reason,
f.abnormal_remark
</select>
<select id="export" resultType="com.ximai.mes.report.response.FeedbackResponseExportByList">
select
workorder.workorder_Type,
workorder.customer_Project_No,
workorder.order_Code,
workorder.workorder_Code,
workorder.product_Code,
workorder.product_Name,
pt.task_Code,
pt.process_Name,
pt.workstation_code,
pt.workstation_Name,
workunit.workunit_id,
mw.workunit_name,
mw.workunit_code,
f.user_name,
f.nick_name,
workunit.quantity,
f.quantity_qualify,
f.quantity_unqualify,
(f.quantity_qualify + f.quantity_unqualify) as quantity_feedback,
f.abnormal_reason,
CAST(f.machine_time AS DECIMAL(10, 2)) as machine_time,
f.feedback_time,
workunit.std_working_time,
workunit.schedule_end_date
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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"> and f.quantity_unqualify > 0 </if>
</where>
</select>
<select id="getListByWorkOrderExport"
resultType="com.ximai.mes.report.response.FeedbackResponseExportByWorkOrder">
select
workorder.workorder_Type,
workorder.customer_Project_No,
workorder.workorder_name,
workorder.order_Code,
workorder.workorder_Code,
workorder.product_Code,
workorder.product_Name,
sum(workunit.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_qualify) + sum(f.quantity_unqualify) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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">and f.quantity_unqualify > 0 </if>
</where>
group by
workorder.workorder_Type,
workorder.customer_Project_No,
workorder.workorder_name,
workorder.order_Code,
workorder.workorder_Code,
workorder.product_Code,
workorder.product_Name
</select>
<select id="getListByWorkshopExport"
resultType="com.ximai.mes.report.response.FeedbackResponseExportByWorkshop">
select
workstation.workshop_code,
workstation.workshop_name,
sum(workunit.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_qualify) + sum(f.quantity_unqualify) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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">and f.quantity_unqualify > 0 </if>
</where>
group by
workstation.workshop_code,
workstation.workshop_name
</select>
<select id="getListByWorkstationExport"
resultType="com.ximai.mes.report.response.FeedbackResponseExportByWorkstation">
select
workstation.workstation_code,
workstation.workstation_name,
sum(workunit.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_qualify) + sum(f.quantity_unqualify) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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">and f.quantity_unqualify > 0 </if>
</where>
group by
workstation.workstation_code,
workstation.workstation_name
</select>
<select id="getListByWorkunitExport"
resultType="com.ximai.mes.report.response.FeedbackResponseExportByWorkunit">
select
mw.workunit_code,
mw.workunit_name,
sum(workunit.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_qualify) + sum(f.quantity_unqualify) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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">and f.quantity_unqualify > 0 </if>
</where>
group by
mw.workunit_code,
mw.workunit_name
</select>
<select id="getListByProcessExport"
resultType="com.ximai.mes.report.response.FeedbackResponseExportByProcess">
select
pt.process_code,
pt.process_name,
sum(workunit.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_qualify) + sum(f.quantity_unqualify) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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">and f.quantity_unqualify > 0 </if>
</where>
group by
pt.process_code,
pt.process_name
</select>
<select id="getListByUserExport"
resultType="com.ximai.mes.report.response.FeedbackResponseExportByUser">
select
f.user_name,
f.nick_name,
sum(workunit.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_qualify) + sum(f.quantity_unqualify) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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">and f.quantity_unqualify > 0 </if>
</where>
group by
f.user_name,
f.nick_name
</select>
<select id="getListByDefectExport"
resultType="com.ximai.mes.report.response.FeedbackResponseExportByDefect">
select
f.abnormal_reason,
f.abnormal_remark,
sum(workunit.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_qualify) + sum(f.quantity_unqualify) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test="userName != null and userName != ''">and f.user_name like concat('%', #{userName}, '%')</if>
<if test=" nickName != null and nickName != '' ">and f.nick_Name like '%${nickName}%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
<if test=" abnormalId != null">and f.abnormal_id = #{abnormalId}</if>
<if test=" productName != null and productName != '' ">and workorder.product_Name like '%${productName}%'</if>
<if test=" processName != null and processName != '' ">and pt.process_name like '%${processName}%'</if>
<if test=" workshopName != null and workshopName != '' ">and workstation.workshop_name like '%${workshopName}%'</if>
<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"> and f.quantity_unqualify > 0 </if>
</where>
group by
f.abnormal_reason,
f.abnormal_remark
</select>
<insert id="insertProFeedback" parameterType="ProFeedback" useGeneratedKeys="true" keyProperty="recordId">
insert into pro_feedback
......
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