wuzhenyue 3 жил өмнө
parent
commit
5e67b1e324
15 өөрчлөгдсөн 291 нэмэгдсэн , 72 устгасан
  1. 16 8
      application-facade/src/main/java/com/factory/controller/web/PreventMistakeController.java
  2. 4 1
      application-facade/src/main/java/com/factory/web/entity/pm/OnsiteApprovalPlan.java
  3. 15 1
      application-facade/src/main/java/com/factory/web/entity/pm/OnsiteApprovalTask.java
  4. 35 0
      application-facade/src/main/java/com/factory/web/entity/pm/req/SearchCheckRecordReq.java
  5. 1 4
      application-facade/src/main/java/com/factory/web/entity/pm/req/SearchPmCheckRecordListReq.java
  6. 0 2
      application-facade/src/main/java/com/factory/web/entity/pm/req/SearchTaskReq.java
  7. 4 3
      application-facade/src/main/java/com/factory/web/entity/pm/res/PmCheckRecordListRes.java
  8. 35 0
      application-facade/src/main/java/com/factory/web/entity/pm/res/PmCheckRecordRes.java
  9. 0 9
      application-facade/src/main/java/com/factory/web/entity/pm/res/PmItemNoGoListRes.java
  10. 41 0
      application-facade/src/main/java/com/factory/web/entity/pm/res/PmNoGoTaskAapprovalRes.java
  11. 21 4
      application-facade/src/main/java/com/factory/web/mapper/pm/PreventMistakeMapper.java
  12. 40 9
      application-facade/src/main/java/com/factory/web/service/impl/pm/PreventMistakeServiceImpl.java
  13. 12 3
      application-facade/src/main/java/com/factory/web/service/pm/PreventMistakeService.java
  14. 63 28
      application-facade/src/main/resources/mapper/PreventMistakeMapper.xml
  15. 4 0
      common-base/src/main/java/com/factory/base/entity/po/benteler/BentelerPlan.java

+ 16 - 8
application-facade/src/main/java/com/factory/controller/web/PreventMistakeController.java

@@ -22,8 +22,8 @@ import com.factory.web.entity.pm.req.EditItemResultListReq;
 import com.factory.web.entity.pm.req.EditPmPlanReq;
 import com.factory.web.entity.pm.req.PmPlanPauseFlagReq;
 import com.factory.web.entity.pm.req.SearchAllWorkshopReq;
+import com.factory.web.entity.pm.req.SearchPmCheckRecordListReq;
 import com.factory.web.entity.pm.req.SearchPmItemNoGoListReq;
-import com.factory.web.entity.pm.req.SearchPmItemResultListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanCheckListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListForPadReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListReq;
@@ -33,8 +33,9 @@ import com.factory.web.entity.pm.req.SearchTaskReq;
 import com.factory.web.entity.pm.req.SearchWorkshopReq;
 import com.factory.web.entity.pm.res.PmAllWorkshopListRes;
 import com.factory.web.entity.pm.res.PmCheckListRes;
+import com.factory.web.entity.pm.res.PmCheckRecordListRes;
 import com.factory.web.entity.pm.res.PmItemNoGoListRes;
-import com.factory.web.entity.pm.res.PmItemResultListRes;
+import com.factory.web.entity.pm.res.PmNoGoTaskAapprovalRes;
 import com.factory.web.entity.pm.res.PmPlanListForPadRes;
 import com.factory.web.entity.pm.res.PmPlanListRes;
 import com.factory.web.entity.pm.res.PmPlanRes;
@@ -74,7 +75,7 @@ public class PreventMistakeController {
 		return preventMistakeService.getPmPlanCheckList(req);
 	}
 
-	@ApiOperation(value = "取得Web端防错计划列表(暂时不用)")
+	@ApiOperation(value = "取得Web端防错计划列表")
 	@ApiOperationSupport(order = 3)
 	@PostMapping("/getPmPlanlist")
 	public ResponseBean<PageBean<PmPlanListRes>> getPmPlanlist(@RequestBody SearchPmPlanListReq req) {
@@ -133,9 +134,9 @@ public class PreventMistakeController {
 
 	@ApiOperation(value = "检查记录列表")
 	@ApiOperationSupport(order = 11)
-	@PostMapping("/getPmItemResultList")
-	public ResponseBean<List<PmItemResultListRes>> getPmItemResultList(@RequestBody SearchPmItemResultListReq req) {
-		return preventMistakeService.getPmItemResultList(req);
+	@PostMapping("/getPmCheckRecordList")
+	public ResponseBean<List<PmCheckRecordListRes>> getPmCheckRecordList(@RequestBody SearchPmCheckRecordListReq req) {
+		return preventMistakeService.getPmCheckRecordList(req);
 	}
 
 	@ApiOperation(value = "取得Pad端防错计划列表")
@@ -195,16 +196,23 @@ public class PreventMistakeController {
 		return preventMistakeService.getPmItemNoGoList(req);
 	}
 	
+	@ApiOperation(value = "取得不放行任务对应的质量经理审批信息")
+	@ApiOperationSupport(order = 20)
+	@PostMapping("/getPmNoGoTaskAapproval")
+	public ResponseBean<PmNoGoTaskAapprovalRes> getPmNoGoTaskAapproval(@RequestBody SearchTaskReq req) {
+		return preventMistakeService.getPmNoGoTaskAapproval(req);
+	}
+	
 	@ApiOperation(value = "修改巡检项目检查结果")
 	@PostMapping("/editItemResult")
-	@ApiOperationSupport(order = 20)
+	@ApiOperationSupport(order = 21)
 	public ResponseBean editItemResult(@RequestBody EditItemResultListReq req) {
 		return ResponseBeanBuilder.ok(preventMistakeService.editItemResult(req));
 	}
 	
 	@ApiOperation(value = "取得所有工作站")
 	@PostMapping("/getAllWorkshopList")
-	@ApiOperationSupport(order = 21)
+	@ApiOperationSupport(order = 22)
 	public ResponseBean<List<PmAllWorkshopListRes>> getAllWorkshopList(@RequestBody SearchAllWorkshopReq req) {
 		return preventMistakeService.getAllWorkshopList(req);
 	}

+ 4 - 1
application-facade/src/main/java/com/factory/web/entity/pm/OnsiteApprovalPlan.java

@@ -35,7 +35,7 @@ public class OnsiteApprovalPlan implements Serializable {
 	@ApiModelProperty(value = "计划id")
 	private Long bentelerPlanId;
 
-	@ApiModelProperty(value = "1代表1级别审批 2代表2级别审批")
+	@ApiModelProperty(value = "1质量经理审批 2生产经理审批")
 	private Integer approvalLevel;
 
 	@ApiModelProperty(value = "审批人")
@@ -44,6 +44,9 @@ public class OnsiteApprovalPlan implements Serializable {
 	@ApiModelProperty(value = "审批状态 0未审批 1审批通过 2驳回")
 	private Integer status;
 	
+	@ApiModelProperty(value = "审批意见")
+	private String reason;
+	
 	@TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private LocalDateTime createdTime;

+ 15 - 1
application-facade/src/main/java/com/factory/web/entity/pm/OnsiteApprovalTask.java

@@ -1,8 +1,11 @@
 package com.factory.web.entity.pm;
 
 import java.io.Serializable;
+import java.time.LocalDateTime;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
@@ -32,7 +35,7 @@ public class OnsiteApprovalTask implements Serializable {
 	@ApiModelProperty(value = "任务id")
 	private Long onsiteTaskId;
 
-	@ApiModelProperty(value = "1代表1级别审批 2代表2级别审批")
+	@ApiModelProperty(value = "1质量工程师审批 2质量经理审批")
 	private Integer approvalLevel;
 
 	@ApiModelProperty(value = "审批人")
@@ -40,5 +43,16 @@ public class OnsiteApprovalTask implements Serializable {
 	
 	@ApiModelProperty(value = "审批状态 0初始化 1放行")
 	private Integer status;
+	
+	@ApiModelProperty(value = "审批意见")
+	private String reason;
+	
+	@TableField(fill = FieldFill.INSERT)
+    @ApiModelProperty(value = "创建时间")
+    private LocalDateTime createdTime;
+
+    @TableField(fill = FieldFill.UPDATE)
+    @ApiModelProperty(value = "审批时间")
+    private LocalDateTime updatedTime;
 
 }

+ 35 - 0
application-facade/src/main/java/com/factory/web/entity/pm/req/SearchCheckRecordReq.java

@@ -0,0 +1,35 @@
+package com.factory.web.entity.pm.req;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 检查记录
+ *
+ * @author wzy
+ * @date 2021-07-09 12:00:00
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude()
+@ApiModel("")
+public class SearchCheckRecordReq {
+
+	@ApiModelProperty(value = "点检频次")
+	private Integer typeFlag;
+	
+	@ApiModelProperty(value = "年月", example = "2021-06")
+	private String yearMonth;
+	
+	@ApiModelProperty(value = "巡检项目id")
+	private Long onsiteItemId;
+	
+}

+ 1 - 4
application-facade/src/main/java/com/factory/web/entity/pm/req/SearchPmItemResultListReq.java → application-facade/src/main/java/com/factory/web/entity/pm/req/SearchPmCheckRecordListReq.java

@@ -21,7 +21,7 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @JsonInclude()
 @ApiModel("")
-public class SearchPmItemResultListReq {
+public class SearchPmCheckRecordListReq {
 	
 	@ApiModelProperty(value = "计划Id")
 	private Long bentelerPlanId;
@@ -29,9 +29,6 @@ public class SearchPmItemResultListReq {
 	@ApiModelProperty(value = "点检频次")
 	private Integer typeFlag;
 	
-//	@ApiModelProperty(value = "年", example = "2021")
-//	private String year;
-	
 	@ApiModelProperty(value = "年月", example = "2021-06")
 	private String yearMonth;
 	

+ 0 - 2
application-facade/src/main/java/com/factory/web/entity/pm/req/SearchTaskReq.java

@@ -26,6 +26,4 @@ public class SearchTaskReq {
 	@ApiModelProperty(value = "任务id")
 	private Long onsiteTaskId;
 
-//	@ApiModelProperty(value = "0初始化 1待审核状态 2放行 3不通过")
-//	private Integer status;
 }

+ 4 - 3
application-facade/src/main/java/com/factory/web/entity/pm/res/PmItemResultListRes.java → application-facade/src/main/java/com/factory/web/entity/pm/res/PmCheckRecordListRes.java

@@ -1,6 +1,7 @@
 package com.factory.web.entity.pm.res;
 
 import java.io.Serializable;
+import java.util.List;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 
@@ -23,7 +24,7 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @JsonInclude()
 @ApiModel("")
-public class PmItemResultListRes implements Serializable {
+public class PmCheckRecordListRes implements Serializable {
 
 	@ApiModelProperty(value = "工作站id")
 	private Long workshopId;
@@ -37,7 +38,7 @@ public class PmItemResultListRes implements Serializable {
 	@ApiModelProperty(value = "巡检项目内容")
 	private String itemContent;
 	
-	@ApiModelProperty(value = "巡检结果 0通过  1巡检不通过 2没有巡检")
-	private String result;
+	@ApiModelProperty(value = "一个月内的点检记录")
+	private List<PmCheckRecordRes> checkRecordList;
 
 }

+ 35 - 0
application-facade/src/main/java/com/factory/web/entity/pm/res/PmCheckRecordRes.java

@@ -0,0 +1,35 @@
+package com.factory.web.entity.pm.res;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 检查记录
+ *
+ * @author wzy
+ * @date 2021-07-09 12:00:00
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude()
+@ApiModel("")
+public class PmCheckRecordRes implements Serializable {
+
+	@ApiModelProperty(value = "任务创建时间")
+	private LocalDate taskTime;
+	
+	@ApiModelProperty(value = "巡检结果 0通过  1巡检不通过 2没有巡检")
+	private String result;
+
+}

+ 0 - 9
application-facade/src/main/java/com/factory/web/entity/pm/res/PmItemNoGoListRes.java

@@ -31,14 +31,5 @@ public class PmItemNoGoListRes implements Serializable {
 
 	@ApiModelProperty(value = "巡检项目内容")
 	private String itemContent;
-	
-	@ApiModelProperty(value = "质量经理用户id")
-	private Long approvalUserId;
 
-	@ApiModelProperty(value = "质量经理")
-	private String approvalPerson;
-	
-	@ApiModelProperty(value = "审批时间")
-	private LocalDateTime approvalTime;
-	
 }

+ 41 - 0
application-facade/src/main/java/com/factory/web/entity/pm/res/PmNoGoTaskAapprovalRes.java

@@ -0,0 +1,41 @@
+package com.factory.web.entity.pm.res;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 取得不放行任务对应的审批人、审批意见、审批时间
+ *
+ * @author wzy
+ * @date 2021-07-09 12:00:00
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude()
+@ApiModel("")
+public class PmNoGoTaskAapprovalRes implements Serializable {
+
+	@ApiModelProperty(value = "质量经理用户id")
+	private Long approvalUserId;
+
+	@ApiModelProperty(value = "质量经理")
+	private String approvalPerson;
+	
+	@ApiModelProperty(value = "评审意见")
+	private String reason;
+	
+	@ApiModelProperty(value = "审批时间")
+	private LocalDateTime approvalTime;
+	
+}

+ 21 - 4
application-facade/src/main/java/com/factory/web/mapper/pm/PreventMistakeMapper.java

@@ -9,17 +9,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.factory.base.entity.po.benteler.BentelerPlan;
 import com.factory.web.entity.pm.req.SearchApprovalUserReq;
+import com.factory.web.entity.pm.req.SearchCheckRecordReq;
 import com.factory.web.entity.pm.req.SearchPmItemNoGoListReq;
-import com.factory.web.entity.pm.req.SearchPmItemResultListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanCheckListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListForPadReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanReq;
 import com.factory.web.entity.pm.req.SearchPmWorkshopNoGoListReq;
+import com.factory.web.entity.pm.req.SearchTaskReq;
 import com.factory.web.entity.pm.res.ApprovalUserRes;
 import com.factory.web.entity.pm.res.PmCheckListRes;
+import com.factory.web.entity.pm.res.PmCheckRecordListRes;
+import com.factory.web.entity.pm.res.PmCheckRecordRes;
 import com.factory.web.entity.pm.res.PmItemNoGoListRes;
-import com.factory.web.entity.pm.res.PmItemResultListRes;
+import com.factory.web.entity.pm.res.PmNoGoTaskAapprovalRes;
 import com.factory.web.entity.pm.res.PmPlanListForPadRes;
 import com.factory.web.entity.pm.res.PmPlanListRes;
 import com.factory.web.entity.pm.res.PmTaskListRes;
@@ -58,11 +61,18 @@ public interface PreventMistakeMapper extends BaseMapper<BentelerPlan> {
     public List<PmTaskListRes> getTaskList(@Param("req") SearchPmPlanReq req);
     
     /**
-     * 取得检查记录列表
+     * 取得工作站和巡检项目
      * @param req
      * @return 检查记录列表
      */
-    public List<PmItemResultListRes> getPmItemResultList(@Param("req") SearchPmItemResultListReq req);
+    public List<PmCheckRecordListRes> getPmWorkshopItemList(@Param("req") SearchPmPlanReq req);
+    
+    /**
+     * 取得一个巡检项目对应的一个月的巡检结果
+     * @param req
+     * @return 检查记录列表
+     */
+    public List<PmCheckRecordRes> getPmItemResultList(@Param("req") SearchCheckRecordReq req);
     
     /**
      * 取得Pad端防错计划列表
@@ -98,4 +108,11 @@ public interface PreventMistakeMapper extends BaseMapper<BentelerPlan> {
      * @return 不放行任务对应的点检项目
      */
     public List<PmItemNoGoListRes> getPmItemNoGoList(@Param("req") SearchPmItemNoGoListReq req);
+    
+    /**
+     * 取得不放行任务对应的审批人、审批意见、审批时间
+     * @param req
+     * @return 不放行任务对应的审批人、审批意见、审批时间
+     */
+    public PmNoGoTaskAapprovalRes getPmNoGoTaskAapproval(@Param("req") SearchTaskReq req);
 }

+ 40 - 9
application-facade/src/main/java/com/factory/web/service/impl/pm/PreventMistakeServiceImpl.java

@@ -46,8 +46,9 @@ import com.factory.web.entity.pm.req.OnsiteWorkshopReq;
 import com.factory.web.entity.pm.req.PmPlanPauseFlagReq;
 import com.factory.web.entity.pm.req.SearchAllWorkshopReq;
 import com.factory.web.entity.pm.req.SearchApprovalUserReq;
+import com.factory.web.entity.pm.req.SearchCheckRecordReq;
+import com.factory.web.entity.pm.req.SearchPmCheckRecordListReq;
 import com.factory.web.entity.pm.req.SearchPmItemNoGoListReq;
-import com.factory.web.entity.pm.req.SearchPmItemResultListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanCheckListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListForPadReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListReq;
@@ -58,8 +59,10 @@ import com.factory.web.entity.pm.req.SearchWorkshopReq;
 import com.factory.web.entity.pm.res.ApprovalUserRes;
 import com.factory.web.entity.pm.res.PmAllWorkshopListRes;
 import com.factory.web.entity.pm.res.PmCheckListRes;
+import com.factory.web.entity.pm.res.PmCheckRecordListRes;
+import com.factory.web.entity.pm.res.PmCheckRecordRes;
 import com.factory.web.entity.pm.res.PmItemNoGoListRes;
-import com.factory.web.entity.pm.res.PmItemResultListRes;
+import com.factory.web.entity.pm.res.PmNoGoTaskAapprovalRes;
 import com.factory.web.entity.pm.res.PmPlanListForPadRes;
 import com.factory.web.entity.pm.res.PmPlanListRes;
 import com.factory.web.entity.pm.res.PmPlanRes;
@@ -140,17 +143,16 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
 			return ResponseBeanBuilder.fail("计划名称已存在");
 		}
 
-		/* 添加放错计划 */
-		// TODO 计划生效日期
+		/* 添加防错计划 */
 		BentelerPlan plan = BentelerPlan.builder()
 				.planType(PlanType.防错.value)
 				.name(req.getBentelerPlanName())
 				.pauseFlag(false)
+				.effectiveDate(req.getEffectiveDate())
 				.build();
 		planService.save(plan);
 
 		/* 添加日周月点检规则 */
-		// TODO 确认个别字段没传或是空串的情况
 		List<OnsiteCalendarReq> onsiteCalendarList = req.getOnsiteCalendarList();
 		for (OnsiteCalendarReq onsiteCalendarReq : onsiteCalendarList) {
 			OnsiteCalendar onsiteCalendar = OnsiteCalendar.builder()
@@ -337,6 +339,7 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
 		pmPlanRes.setBentelerPlanId(plan.getId());
 		pmPlanRes.setBentelerPlanName(plan.getName());
 		pmPlanRes.setPlanType(plan.getPlanType());
+		pmPlanRes.setEffectiveDate(plan.getEffectiveDate());;
 		
 		List<OnsiteCalendar> onsiteCalendarList = onsiteCalendarService.list(Wrappers.<OnsiteCalendar>lambdaQuery()
                 .eq(OnsiteCalendar::getBentelerPlanId, plan.getId()));
@@ -432,10 +435,10 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
 //		}
 
 		/* 修改防错计划 */
-		// TODO 计划生效日期
 		BentelerPlan plan = BentelerPlan.builder()
 				.id(req.getBentelerPlanId())
 				.name(req.getBentelerPlanName())
+				.effectiveDate(req.getEffectiveDate())
 				.build();
 		planService.updateById(plan);
 
@@ -560,9 +563,22 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
      * @return 检查记录列表
      */
     @Override
-    public ResponseBean<List<PmItemResultListRes>> getPmItemResultList(SearchPmItemResultListReq req) {
-    	List<PmItemResultListRes> listRes = preventMistakeMapper.getPmItemResultList(req);
-		return ResponseBeanBuilder.ok(listRes, Function.identity());
+    public ResponseBean<List<PmCheckRecordListRes>> getPmCheckRecordList(SearchPmCheckRecordListReq req) {
+    	SearchPmPlanReq workshopItemReq = new SearchPmPlanReq();
+    	workshopItemReq.setBentelerPlanId(req.getBentelerPlanId());    	
+    	List<PmCheckRecordListRes> workshopItemList = preventMistakeMapper.getPmWorkshopItemList(workshopItemReq);
+    	
+    	for (PmCheckRecordListRes workshopItem : workshopItemList) {
+    		SearchCheckRecordReq itemResultReq = new SearchCheckRecordReq();
+    		itemResultReq.setOnsiteItemId(workshopItem.getOnsiteItemId());    		
+    		itemResultReq.setYearMonth(req.getYearMonth());
+    		itemResultReq.setTypeFlag(req.getTypeFlag());
+    		List<PmCheckRecordRes> itemResultList = preventMistakeMapper.getPmItemResultList(itemResultReq);
+    		
+    		workshopItem.setCheckRecordList(itemResultList);
+    	}
+
+		return ResponseBeanBuilder.ok(workshopItemList, Function.identity());
     }
     
     /**
@@ -753,6 +769,18 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
 		List<PmItemNoGoListRes> pmItemNoGoList = preventMistakeMapper.getPmItemNoGoList(req);
     	return ResponseBeanBuilder.ok(pmItemNoGoList, Function.identity());
 	}
+	
+	/**
+	 * 取得不放行任务对应的质量经理审批信息
+	 * 
+	 * @param req
+	 * @return 不放行任务对应的质量经理审批信息
+	 */
+	@Override
+	public ResponseBean<PmNoGoTaskAapprovalRes> getPmNoGoTaskAapproval(SearchTaskReq req) {
+		PmNoGoTaskAapprovalRes pmNoGoTaskAapprovalRes = preventMistakeMapper.getPmNoGoTaskAapproval(req);
+    	return ResponseBeanBuilder.ok(pmNoGoTaskAapprovalRes);
+	}
     
 	/**
 	 * 修改巡检项目检查结果(这里只有重检走这里)
@@ -760,6 +788,7 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
 	 * @param req
 	 * @return
 	 */
+	@Override
 	public ResponseBean editItemResult(EditItemResultListReq req) {
 //		/* 任务和巡检结果记录历史 */
 //		PmTaskRes pmTaskRes = new PmTaskRes();
@@ -832,6 +861,7 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
 	 * @param onsiteTaskId
 	 * @return
 	 */
+	@Override
 	public void setOnsiteTaskHis(Long onsiteTaskId) {
 		/* 任务和巡检结果记录历史 */
 		PmTaskRes pmTaskRes = new PmTaskRes();
@@ -864,6 +894,7 @@ public class PreventMistakeServiceImpl extends ServiceImpl<PreventMistakeMapper,
 	 * @param req
 	 * @return 所有工作站
 	 */
+	@Override
 	public ResponseBean<List<PmAllWorkshopListRes>> getAllWorkshopList(SearchAllWorkshopReq req) {
 		QueryWrapper<OnsiteWorkshop> queryWrapper = new QueryWrapper<>();
 		if (req.getWsName() != null && !"".equals(req.getWsName())) {

+ 12 - 3
application-facade/src/main/java/com/factory/web/service/pm/PreventMistakeService.java

@@ -18,8 +18,8 @@ import com.factory.web.entity.pm.req.EditPmPlanReq;
 import com.factory.web.entity.pm.req.PmPlanPauseFlagReq;
 import com.factory.web.entity.pm.req.SearchAllWorkshopReq;
 import com.factory.web.entity.pm.req.SearchApprovalUserReq;
+import com.factory.web.entity.pm.req.SearchPmCheckRecordListReq;
 import com.factory.web.entity.pm.req.SearchPmItemNoGoListReq;
-import com.factory.web.entity.pm.req.SearchPmItemResultListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanCheckListReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListForPadReq;
 import com.factory.web.entity.pm.req.SearchPmPlanListReq;
@@ -30,8 +30,9 @@ import com.factory.web.entity.pm.req.SearchWorkshopReq;
 import com.factory.web.entity.pm.res.ApprovalUserRes;
 import com.factory.web.entity.pm.res.PmAllWorkshopListRes;
 import com.factory.web.entity.pm.res.PmCheckListRes;
+import com.factory.web.entity.pm.res.PmCheckRecordListRes;
 import com.factory.web.entity.pm.res.PmItemNoGoListRes;
-import com.factory.web.entity.pm.res.PmItemResultListRes;
+import com.factory.web.entity.pm.res.PmNoGoTaskAapprovalRes;
 import com.factory.web.entity.pm.res.PmPlanListForPadRes;
 import com.factory.web.entity.pm.res.PmPlanListRes;
 import com.factory.web.entity.pm.res.PmPlanRes;
@@ -148,7 +149,7 @@ public interface PreventMistakeService extends IService<BentelerPlan> {
 	 * @param req
 	 * @return 检查记录列表
 	 */
-	public ResponseBean<List<PmItemResultListRes>> getPmItemResultList(SearchPmItemResultListReq req);
+	public ResponseBean<List<PmCheckRecordListRes>> getPmCheckRecordList(SearchPmCheckRecordListReq req);
 
 	/**
 	 * 取得Pad端防错计划列表
@@ -238,6 +239,14 @@ public interface PreventMistakeService extends IService<BentelerPlan> {
 	 */
 	public ResponseBean<List<PmItemNoGoListRes>> getPmItemNoGoList(SearchPmItemNoGoListReq req);
 	
+	/**
+	 * 取得不放行任务对应的质量经理审批信息
+	 * 
+	 * @param req
+	 * @return 不放行任务对应的质量经理审批信息
+	 */
+	public ResponseBean<PmNoGoTaskAapprovalRes> getPmNoGoTaskAapproval(SearchTaskReq req);
+	
 	/**
 	 * 修改巡检项目检查结果(这里只有重检走这里)
 	 * 

+ 63 - 28
application-facade/src/main/resources/mapper/PreventMistakeMapper.xml

@@ -2,8 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
 <mapper namespace="com.factory.web.mapper.pm.PreventMistakeMapper">
-	
-	
+
     <!--取得防错计划点检列表(审批通过的   防错计划)(计划当天点检状态,plan_status,0未完成 1已完成 2待重检) -->
     <select id="getPmPlanCheckList" resultType="com.factory.web.entity.pm.res.PmPlanListRes">
         SELECT
@@ -61,7 +60,7 @@
 			bp.id
     </select>
     
-    <!-- 取得防错计划列表(备用)(查询所有的防错计划)(计划审批状态plan_status 0待质量经理审批、1待生产经理审批、2已驳回待修改、3审批通过) -->
+    <!-- 取得防错计划列表(查询所有的防错计划)(计划审批状态plan_status 0待质量经理审批、1待生产经理审批、2已驳回待修改、3审批通过) -->
     <select id="getPmPlanList" resultType="com.factory.web.entity.pm.res.PmPlanListRes">
         SELECT
 			bp.id AS benteler_plan_id,
@@ -133,34 +132,34 @@
 		AND     bp.id = #{req.bentelerPlanId}
     </select>
     
-    <!--取得检查记录 --><!-- 暂时取onsite_task得时间,如果取onsite_item_result的时间,会不会有第二天才处理头一天的任务的 -->
-    <select id="getPmItemResultList" resultType="com.factory.web.entity.pm.res.PmItemResultListRes">
+    <!--取得检查记录 -->
+    <!-- 取得计划下的工作站和巡检项目 -->
+    <select id="getPmWorkshopItemList" resultType="com.factory.web.entity.pm.res.PmCheckRecordListRes">
         SELECT oi.workshop_id,
-		       ow.ws_name,
-		       oir.onsite_item_id,
-		       oi.item_content,
-		       oir.result
-		FROM   onsite_item_result oir,
-		       onsite_item oi,
-		       onsite_workshop ow,
-		       onsite_task ot,
-		       onsite_calendar oc
-		WHERE  oir.onsite_item_id = oi.id
-		AND    oi.workshop_id = ow.id
-		AND    oir.onsite_task_id = ot.id
-		AND    ot.onsite_calendar_id = oc.id
+			   ow.ws_name,
+			   oi.id AS onsite_item_id,
+			   oi.item_content 
+		FROM   onsite_item oi,
+			   onsite_workshop ow 
+		WHERE  oi.workshop_id = ow.id 
 		AND    ow.benteler_plan_id = #{req.bentelerPlanId}
+		ORDER BY oi.workshop_id, oi.id
+    </select>
+    <!-- 取得一个月里巡检项目每天的检查结果 --><!-- 暂时取onsite_task的时间,如果取onsite_item_result的时间,会不会有第二天才处理头一天的任务的 -->
+    <select id="getPmItemResultList" resultType="com.factory.web.entity.pm.res.PmCheckRecordRes">
+        SELECT ot.task_time,
+			   oir.result 
+		FROM   onsite_item_result oir,
+			   onsite_task ot,
+			   onsite_calendar oc 
+		WHERE  oir.onsite_task_id = ot.id 
+		AND    ot.onsite_calendar_id = oc.id 
 		AND    oc.type_flag = #{req.typeFlag}
 		<if test="req.yearMonth != null and req.yearMonth != ''">
-		AND    DATE_FORMAT(ot.task_time,'%Y-%m') = #{req.yearMonth}
-		-- AND    DATE_FORMAT(oir.created_time,'%Y-%m') = #{req.yearMonth}
+		AND    DATE_FORMAT(ot.task_time, '%Y-%m') = #{req.yearMonth}
 		</if>
-		<!-- 
-		<if test="req.year != null and req.year != ''">
-		AND    DATE_FORMAT(oir.created_time,'%Y') = #{req.year}
-		</if>
-		 -->
-        ORDER BY oi.workshop_id, oir.onsite_item_id
+		AND    oir.onsite_item_id = #{req.onsiteItemId}
+		ORDER BY ot.task_time
     </select>
 
     <!--取得Pad端防错计划列表 -->
@@ -239,7 +238,43 @@
 		AND     oir.onsite_task_id = #{req.onsiteTaskId}
     </select>
     
-    <!--取得不放行任务对应的点检项目(onsite_approval_task中status应该追加一个2不放行状态,追加一个审批时间字段) -->
+    <!-- 取得不放行任务对应的点检项目 -->
+    <select id="getPmItemNoGoList" resultType="com.factory.web.entity.pm.res.PmItemNoGoListRes">
+        SELECT
+			oir.onsite_item_id,
+			oi.item_content 
+		FROM
+			onsite_item_result oir,
+			onsite_task ot,
+			onsite_item oi 
+		WHERE
+			oir.onsite_task_id = ot.id 
+			AND oir.onsite_item_id = oi.id 
+			AND ot.`status` = 3 
+			AND oir.result = 1 
+			AND oi.workshop_id = #{req.workshopId}
+			AND oir.onsite_task_id = #{req.onsiteTaskId}
+    </select>
+    <!-- 取得不放行任务对应的审批人、审批意见、审批时间 -->
+    <select id="getPmNoGoTaskAapproval" resultType="com.factory.web.entity.pm.res.PmNoGoTaskAapprovalRes">
+        SELECT
+			oat.approval_user_id,
+			uu.`name` AS approval_person,
+			oat.reason,
+			oat.updated_time AS approval_time 
+		FROM
+			onsite_task ot,
+			onsite_approval_task oat,
+			us_user uu 
+		WHERE
+			ot.id = oat.onsite_task_id 
+			AND oat.approval_user_id = uu.id 
+			AND ot.`status` = 3 
+			AND oat.approval_level = 2 
+			AND oat.`status` = 2 
+			AND ot.id = #{req.onsiteTaskId}
+    </select>
+    <!-- 
     <select id="getPmItemNoGoList" resultType="com.factory.web.entity.pm.res.PmItemNoGoListRes">
         SELECT  oir.onsite_item_id,
 		        oi.item_content,
@@ -262,5 +297,5 @@
 		AND     oi.workshop_id = #{req.workshopId}
 		AND     oir.onsite_task_id = #{req.onsiteTaskId}
     </select>
-
+     -->
 </mapper>

+ 4 - 0
common-base/src/main/java/com/factory/base/entity/po/benteler/BentelerPlan.java

@@ -9,6 +9,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 
 /**
@@ -39,6 +40,9 @@ public class BentelerPlan implements Serializable {
 
     @ApiModelProperty(value = "是否禁用暂停 0否 1是")
     private Boolean pauseFlag;
+    
+    @ApiModelProperty(value = "生效日期")
+	private LocalDate effectiveDate;
 
     @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "逻辑删除", hidden = true)