检验任务

philip 4 years ago
parent 7f25989760
commit a8e475e169

@ -12,7 +12,8 @@ public interface Constants {
String BOOL_TRUE = "true";
String BOOL_FALSE = "false";
String RSESULT_OK = "OK";
String RSESULT_NG = "NG";
String STATUS_Y = "Y";
String STATUS_N = "N";
@ -20,6 +21,22 @@ public interface Constants {
String RESOURCE_INSPECT_TASK = "RESOURCE_INSPECT_TASK";
String SITE_ADMIN = "SITE_ADMIN";
//--------------------检验项目|任务-----------------------------------------------------------------------------------
String INSPECTION_TASK_STATUS_NEW="NEW";
String INSPECTION_TASK_STATUS_COMPLETE="COMPLETE";
String INSPECTION_TASK_STATUS_DOING="DOING";
//附加类型物料
String ADDITIONAL_OBJECT_TYPE_ITEM="ITEM";
//附加类型工序
String ADDITIONAL_OBJECT_TYPE_OPERATION="OPERATION";
//附加类型工步
String ADDITIONAL_OBJECT_TYPE_STEP="SUB_STEP";
//附加类型设备类型
String ADDITIONAL_OBJECT_TYPE_RESOURCE_TYPE="RESOURCE_TYPE";
//首件检验
String INSPECTION_TYPE_S="S";
//互检检验

@ -0,0 +1,152 @@
package com.foreverwin.mesnac.common.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.InspectionTask;
import com.foreverwin.mesnac.common.service.InspectionTaskService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
*
* @author Philip
* @since 2021-07-05
*/
@RestController
@RequestMapping("/Z-INSPECTION-TASK")
public class InspectionTaskController {
@Autowired
public InspectionTaskService inspectionTaskService;
/**
*
*
* @return
*/
@ResponseBody
@PostMapping("/save")
public R getInspectionTaskList(@RequestBody Map<String, Object> paramMap){
inspectionTaskService.save(paramMap);
return R.ok("保存成功");
}
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/createTask")
public R createTask(@RequestBody Map<String, Object> paramMap) {
inspectionTaskService.createTask(paramMap);
return R.ok("创建任务成功!");
}
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getInspectionTaskById(@PathVariable String id) {
return R.ok( inspectionTaskService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getInspectionTaskList(InspectionTask inspectionTask){
List<InspectionTask> result;
QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTask);
result = inspectionTaskService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<InspectionTask> frontPage, InspectionTask inspectionTask){
IPage result;
QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTask);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(InspectionTask::getHandle, frontPage.getGlobalQuery())
.or().like(InspectionTask::getSite, frontPage.getGlobalQuery())
.or().like(InspectionTask::getCategory, frontPage.getGlobalQuery())
.or().like(InspectionTask::getTaskNo, frontPage.getGlobalQuery())
.or().like(InspectionTask::getDescription, frontPage.getGlobalQuery())
.or().like(InspectionTask::getStatus, frontPage.getGlobalQuery())
.or().like(InspectionTask::getInspectionItemBo, frontPage.getGlobalQuery())
.or().like(InspectionTask::getWorkCenter, frontPage.getGlobalQuery())
.or().like(InspectionTask::getShopOrder, frontPage.getGlobalQuery())
.or().like(InspectionTask::getSfc, frontPage.getGlobalQuery())
.or().like(InspectionTask::getOperation, frontPage.getGlobalQuery())
.or().like(InspectionTask::getStepId, frontPage.getGlobalQuery())
.or().like(InspectionTask::getResrce, frontPage.getGlobalQuery())
.or().like(InspectionTask::getResult, frontPage.getGlobalQuery())
.or().like(InspectionTask::getComments, frontPage.getGlobalQuery())
.or().like(InspectionTask::getCreateUser, frontPage.getGlobalQuery())
.or().like(InspectionTask::getModifyUser, frontPage.getGlobalQuery())
.or().like(InspectionTask::getSfcDispatchBo, frontPage.getGlobalQuery())
);
}
result = inspectionTaskService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param inspectionTask
* @return null
*/
@PostMapping
public R save(@RequestBody InspectionTask inspectionTask) {
return R.ok(inspectionTaskService.save(inspectionTask));
}
/**
*
* @param inspectionTask
* @return null
*/
@PutMapping
public R updateById(@RequestBody InspectionTask inspectionTask) {
return R.ok(inspectionTaskService.updateById(inspectionTask));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(inspectionTaskService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(inspectionTaskService.removeByIds(ids));
}
}

@ -0,0 +1,128 @@
package com.foreverwin.mesnac.common.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.common.service.InspectionTaskDetailService;
import com.foreverwin.mesnac.common.model.InspectionTaskDetail;
import java.util.List;
/**
*
* @author Philip
* @since 2021-07-05
*/
@RestController
@RequestMapping("/Z-INSPECTION-TASK-DETAIL")
public class InspectionTaskDetailController {
@Autowired
public InspectionTaskDetailService inspectionTaskDetailService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getInspectionTaskDetailById(@PathVariable String id) {
return R.ok( inspectionTaskDetailService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getInspectionTaskDetailList(InspectionTaskDetail inspectionTaskDetail){
List<InspectionTaskDetail> result;
QueryWrapper<InspectionTaskDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTaskDetail);
result = inspectionTaskDetailService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<InspectionTaskDetail> frontPage, InspectionTaskDetail inspectionTaskDetail){
IPage result;
QueryWrapper<InspectionTaskDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTaskDetail);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(InspectionTaskDetail::getHandle, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getSite, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getTaskBo, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getInspectionItemDetailBo, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getCheckValues, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getResult, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getCheckUser, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getRemark, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getPictureNo, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getSfc, frontPage.getGlobalQuery())
.or().like(InspectionTaskDetail::getPictureQty, frontPage.getGlobalQuery())
);
}
result = inspectionTaskDetailService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param inspectionTaskDetail
* @return null
*/
@PostMapping
public R save(@RequestBody InspectionTaskDetail inspectionTaskDetail) {
return R.ok(inspectionTaskDetailService.save(inspectionTaskDetail));
}
/**
*
* @param inspectionTaskDetail
* @return null
*/
@PutMapping
public R updateById(@RequestBody InspectionTaskDetail inspectionTaskDetail) {
return R.ok(inspectionTaskDetailService.updateById(inspectionTaskDetail));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(inspectionTaskDetailService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(inspectionTaskDetailService.removeByIds(ids));
}
}

@ -113,6 +113,12 @@ public enum HandleEnum {
/**设备检验任务的检验项**/
RESOURCE_INSPECT_TASK_SPARE("ResourceInspectTaskSpareBo","ResourceInspectTaskSpareBo:{0},{1}"),
/**检验任务**/
INSPECTION_TASK("InspectionBO:","InspectionBO:{0},{1}"),
/**检验任务明细**/
INSPECTION_TASK_DETAIL("InspectionTaskDetailBO:","InspectionTaskDetailBO:{0},{1}"),
/**用户**/
USR("UserBo","UserBo:{0},{1}");

@ -2,8 +2,12 @@ package com.foreverwin.mesnac.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.common.model.InspectionItem;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -15,4 +19,9 @@ import org.springframework.stereotype.Repository;
@Repository
public interface InspectionItemMapper extends BaseMapper<InspectionItem> {
List<InspectionItemDetail> selectQualityInspection(@Param("site")String site,@Param("sfc")String sfc,@Param("operation") String operation, @Param("stepId")String stepId,@Param("inspectionType") String inspectionType);
List<InspectionItemDetail> selectWidestQualityInspection(@Param("site")String site,@Param("inspectionType")String inspectionType,@Param("additionalObject")String additionalObject);
Integer checkRouterStep(@Param("site")String site,@Param("operation") String operation,@Param("step") String step);
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.common.mapper;
import com.foreverwin.mesnac.common.model.InspectionTaskDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* - Mapper
* </p>
*
* @author Philip
* @since 2021-07-05
*/
@Repository
public interface InspectionTaskDetailMapper extends BaseMapper<InspectionTaskDetail> {
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.common.mapper;
import com.foreverwin.mesnac.common.model.InspectionTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Philip
* @since 2021-07-05
*/
@Repository
public interface InspectionTaskMapper extends BaseMapper<InspectionTask> {
}

@ -0,0 +1,358 @@
package com.foreverwin.mesnac.common.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-05
*/
@TableName("Z_INSPECTION_TASK")
public class InspectionTask extends Model<InspectionTask> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField("HANDLE")
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("CATEGORY")
private String category;
/**
*
*/
@TableField("TASK_NO")
private String taskNo;
/**
*
*/
@TableField("DESCRIPTION")
private String description;
/**
*
*/
@TableField("STATUS")
private String status;
/**
* HANDLE
*/
@TableField("INSPECTION_ITEM_BO")
private String inspectionItemBo;
/**
*
*/
@TableField("WORK_CENTER")
private String workCenter;
/**
*
*/
@TableField("SHOP_ORDER")
private String shopOrder;
/**
*
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("OPERATION")
private String operation;
/**
* 线
*/
@TableField("STEP_ID")
private String stepId;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("RESULT")
private String result;
/**
*
*/
@TableField("COMMENTS")
private String comments;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/**
* BO
*/
@TableField("SFC_DISPATCH_BO")
private String sfcDispatchBo;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getTaskNo() {
return taskNo;
}
public void setTaskNo(String taskNo) {
this.taskNo = taskNo;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getInspectionItemBo() {
return inspectionItemBo;
}
public void setInspectionItemBo(String inspectionItemBo) {
this.inspectionItemBo = inspectionItemBo;
}
public String getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getStepId() {
return stepId;
}
public void setStepId(String stepId) {
this.stepId = stepId;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public String getSfcDispatchBo() {
return sfcDispatchBo;
}
public void setSfcDispatchBo(String sfcDispatchBo) {
this.sfcDispatchBo = sfcDispatchBo;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String CATEGORY = "CATEGORY";
public static final String TASK_NO = "TASK_NO";
public static final String DESCRIPTION = "DESCRIPTION";
public static final String STATUS = "STATUS";
public static final String INSPECTION_ITEM_BO = "INSPECTION_ITEM_BO";
public static final String WORK_CENTER = "WORK_CENTER";
public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String SFC = "SFC";
public static final String OPERATION = "OPERATION";
public static final String STEP_ID = "STEP_ID";
public static final String RESRCE = "RESRCE";
public static final String RESULT = "RESULT";
public static final String COMMENTS = "COMMENTS";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String SFC_DISPATCH_BO = "SFC_DISPATCH_BO";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "InspectionTask{" +
"handle = " + handle +
", site = " + site +
", category = " + category +
", taskNo = " + taskNo +
", description = " + description +
", status = " + status +
", inspectionItemBo = " + inspectionItemBo +
", workCenter = " + workCenter +
", shopOrder = " + shopOrder +
", sfc = " + sfc +
", operation = " + operation +
", stepId = " + stepId +
", resrce = " + resrce +
", result = " + result +
", comments = " + comments +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
", sfcDispatchBo = " + sfcDispatchBo +
"}";
}
}

@ -0,0 +1,233 @@
package com.foreverwin.mesnac.common.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
* -
* </p>
*
* @author Philip
* @since 2021-07-05
*/
@TableName("Z_INSPECTION_TASK_DETAIL")
public class InspectionTaskDetail extends Model<InspectionTaskDetail> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("TASK_BO")
private String taskBo;
/**
*
*/
@TableField("INSPECTION_ITEM_DETAIL_BO")
private String inspectionItemDetailBo;
/**
*
*/
@TableField("CHECK_VALUES")
private String checkValues;
/**
* OK,NG
*/
@TableField("RESULT")
private String result;
/**
*
*/
@TableField("CHECK_DATE")
private LocalDateTime checkDate;
/**
*
*/
@TableField("CHECK_USER")
private String checkUser;
/**
*
*/
@TableField("REMARK")
private String remark;
/**
* /
*/
@TableField("PICTURE_NO")
private String pictureNo;
/**
*
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("PICTURE_QTY")
private String pictureQty;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getTaskBo() {
return taskBo;
}
public void setTaskBo(String taskBo) {
this.taskBo = taskBo;
}
public String getInspectionItemDetailBo() {
return inspectionItemDetailBo;
}
public void setInspectionItemDetailBo(String inspectionItemDetailBo) {
this.inspectionItemDetailBo = inspectionItemDetailBo;
}
public String getCheckValues() {
return checkValues;
}
public void setCheckValues(String checkValues) {
this.checkValues = checkValues;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public LocalDateTime getCheckDate() {
return checkDate;
}
public void setCheckDate(LocalDateTime checkDate) {
this.checkDate = checkDate;
}
public String getCheckUser() {
return checkUser;
}
public void setCheckUser(String checkUser) {
this.checkUser = checkUser;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getPictureNo() {
return pictureNo;
}
public void setPictureNo(String pictureNo) {
this.pictureNo = pictureNo;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getPictureQty() {
return pictureQty;
}
public void setPictureQty(String pictureQty) {
this.pictureQty = pictureQty;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String TASK_BO = "TASK_BO";
public static final String INSPECTION_ITEM_DETAIL_BO = "INSPECTION_ITEM_DETAIL_BO";
public static final String CHECK_VALUES = "CHECK_VALUES";
public static final String RESULT = "RESULT";
public static final String CHECK_DATE = "CHECK_DATE";
public static final String CHECK_USER = "CHECK_USER";
public static final String REMARK = "REMARK";
public static final String PICTURE_NO = "PICTURE_NO";
public static final String SFC = "SFC";
public static final String PICTURE_QTY = "PICTURE_QTY";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "InspectionTaskDetail{" +
"handle = " + handle +
", site = " + site +
", taskBo = " + taskBo +
", inspectionItemDetailBo = " + inspectionItemDetailBo +
", checkValues = " + checkValues +
", result = " + result +
", checkDate = " + checkDate +
", checkUser = " + checkUser +
", remark = " + remark +
", pictureNo = " + pictureNo +
", sfc = " + sfc +
", pictureQty = " + pictureQty +
"}";
}
}

@ -3,6 +3,7 @@ package com.foreverwin.mesnac.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.InspectionItem;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@ -33,4 +34,7 @@ public interface InspectionItemService extends IService<InspectionItem> {
void saveAll(InspectionItem inspectionItem);
void deleteServece(InspectionItem inspectionItem);
//是否存在质量检验项目
List<InspectionItemDetail> selectQualityInspection(String sfc, String operation, String stepId, String inspectionType);
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.InspectionTaskDetail;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author Philip
* @since 2021-07-05
*/
public interface InspectionTaskDetailService extends IService<InspectionTaskDetail> {
/**
*
* @param frontPage
* @return
*/
IPage<InspectionTaskDetail> selectPage(FrontPage<InspectionTaskDetail> frontPage, InspectionTaskDetail inspectionTaskDetail);
List<InspectionTaskDetail> selectList(InspectionTaskDetail inspectionTaskDetail);
}

@ -0,0 +1,33 @@
package com.foreverwin.mesnac.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.InspectionTask;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
import java.util.Map;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-05
*/
public interface InspectionTaskService extends IService<InspectionTask> {
/**
*
* @param frontPage
* @return
*/
IPage<InspectionTask> selectPage(FrontPage<InspectionTask> frontPage, InspectionTask inspectionTask);
List<InspectionTask> selectList(InspectionTask inspectionTask);
void save(Map<String, Object> paramMap);
void createTask(Map<String, Object> paramMap);
}

@ -15,6 +15,10 @@ import com.foreverwin.mesnac.common.service.InspectionItemAdditionService;
import com.foreverwin.mesnac.common.service.InspectionItemDetailService;
import com.foreverwin.mesnac.common.service.InspectionItemService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.model.Item;
import com.foreverwin.mesnac.meapi.model.ResourceType;
import com.foreverwin.mesnac.meapi.service.ItemService;
import com.foreverwin.mesnac.meapi.service.ResourceTypeService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.visiprise.common.exception.BaseException;
@ -39,7 +43,10 @@ import java.util.UUID;
@Transactional(rollbackFor = Exception.class)
public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper, InspectionItem> implements InspectionItemService {
@Autowired
private ItemService itemService;
@Autowired
private ResourceTypeService resourceTypeService;
@Autowired
private InspectionItemMapper inspectionItemMapper;
@Autowired
@ -64,12 +71,12 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
@Override
public String findRevisionByCurrentRevision(String inspectionItemNo) {
String site = CommonMethods.getSite();
LambdaQueryWrapper<InspectionItem> lambdaQuery=new LambdaQueryWrapper<>();
lambdaQuery.eq(InspectionItem::getInspectionItemNo,inspectionItemNo);
LambdaQueryWrapper<InspectionItem> lambdaQuery = new LambdaQueryWrapper<>();
lambdaQuery.eq(InspectionItem::getInspectionItemNo, inspectionItemNo);
lambdaQuery.eq(InspectionItem::getCurrentRevision, Constants.BOOL_TRUE);
lambdaQuery.eq(InspectionItem::getSite, site);
InspectionItem one = getOne(lambdaQuery, false);
if (one!=null){
if (one != null) {
return one.getRevision();
}
return null;
@ -78,37 +85,38 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
@Override
public String inspectItemNoGenerationRules(InspectionItem inspectionItem) {
List<InspectionItemAddition> inspectionItemAdditionList = inspectionItem.getInspectionItemAdditionList();
StringBuilder inspectionItemNo=new StringBuilder();
inspectionItemAdditionList.forEach(inspectionItemAddition->inspectionItemNo.append(inspectionItemAddition.getAdditionalObject()));
StringBuilder inspectionItemNo = new StringBuilder();
inspectionItemAdditionList.forEach(inspectionItemAddition -> inspectionItemNo.append(inspectionItemAddition.getAdditionalObject()));
return inspectionItemNo.toString();
}
@Override
public void saveAll(InspectionItem inspectionItem) {
String site = CommonMethods.getSite();
boolean b = false;
if(StringUtil.isEmpty(inspectionItem.getInspectionItemNo())){
if (StringUtil.isEmpty(inspectionItem.getInspectionItemNo())) {
b = true;
inspectionItem.setInspectionItemNo(inspectItemNoGenerationRules(inspectionItem));
}
if (inspectionItem.getInspectionType().length()>1){
if (inspectionItem.getInspectionType().length() > 1) {
inspectionItem.setCategory("EQ");
}else {
} else {
inspectionItem.setCategory("QC");
}
inspectionItem.setSite(CommonMethods.getSite());
if (StringUtil.isBlank(inspectionItem.getRevision())){
inspectionItem.setSite(site);
if (StringUtil.isBlank(inspectionItem.getRevision())) {
inspectionItem.setRevision("1");
}
inspectionItem.setHandle(HandleEnum
.INSPECTION_ITEM.getHandle(inspectionItem.getSite(),inspectionItem.getInspectionItemNo(),inspectionItem.getRevision()));
.INSPECTION_ITEM.getHandle(inspectionItem.getSite(), inspectionItem.getInspectionItemNo(), inspectionItem.getRevision()));
//保存检验项目维护-副
//移除
HashMap<String, Object> removeCondition = new HashMap<>();
removeCondition.put(InspectionItemDetail.INSPECTION_ITEM_BO,inspectionItem.getHandle());
removeCondition.put(InspectionItemDetail.INSPECTION_ITEM_BO, inspectionItem.getHandle());
inspectionItemDetailService.removeByMap(removeCondition);
inspectionItemAdditionService.removeByMap(removeCondition);
if(null != inspectionItem.getInspectionItemDetailList() && inspectionItem.getInspectionItemDetailList().size() > 0){
if (null != inspectionItem.getInspectionItemDetailList() && inspectionItem.getInspectionItemDetailList().size() > 0) {
List<InspectionItemDetail> inspectionItemDetailList = inspectionItem.getInspectionItemDetailList();
for (InspectionItemDetail inspectionItemDetail : inspectionItemDetailList) {
inspectionItemDetail.setHandle(UUID.randomUUID().toString());
@ -121,9 +129,37 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
//保存
inspectionItemDetailService.saveBatch(inspectionItemDetailList);
}
if(null != inspectionItem.getInspectionItemAdditionList() && inspectionItem.getInspectionItemAdditionList().size() > 0){
if (null != inspectionItem.getInspectionItemAdditionList() && inspectionItem.getInspectionItemAdditionList().size() > 0) {
List<InspectionItemAddition> inspectionItemAdditionList = inspectionItem.getInspectionItemAdditionList();
long count = inspectionItemAdditionList.stream().filter(inspectionItemAddition -> inspectionItemAddition.getAdditionalObject().equals("*")).count();
if (count>0 && inspectionItemAdditionList.size()!=count){
throw new BaseException("检验对象不能部分为*");
}
for (InspectionItemAddition inspectionItemAddition : inspectionItemAdditionList) {
String additionalObject = inspectionItemAddition.getAdditionalObject();
String additionalObjectType = inspectionItemAddition.getAdditionalObjectType();
if (additionalObjectType.equals(Constants.ADDITIONAL_OBJECT_TYPE_ITEM) && !additionalObject.equals("*")) {
Item item = itemService.selectCurrent(CommonMethods.getSite(), additionalObject);
if (item == null) {
throw new BaseException("物料[" + additionalObject + "]不存在");
}
}
if (additionalObjectType.equals(Constants.ADDITIONAL_OBJECT_TYPE_OPERATION) && !additionalObject.equals("*")) {
String[] split = additionalObject.split("/");
String operation = split[0];
String step = split[1];
Integer integer = inspectionItemMapper.checkRouterStep(site, operation, step);
if (integer < 1) {
throw new BaseException("工序/步骤[" + additionalObject + "]不存在");
}
}
if (additionalObjectType.equals(Constants.ADDITIONAL_OBJECT_TYPE_RESOURCE_TYPE) && !additionalObject.equals("*")) {
String handle = HandleEnum.RESOURCE_TYPE.getHandle(site, additionalObject);
ResourceType byId = resourceTypeService.getById(handle);
if (byId == null) {
throw new BaseException("设备类型[" + additionalObject + "]不存在");
}
}
inspectionItemAddition.setHandle(UUID.randomUUID().toString());
inspectionItemAddition.setInspectionItemBo(inspectionItem.getHandle());
inspectionItemAddition.setCreatedDateTime(LocalDateTime.now());
@ -136,25 +172,25 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
}
//保存检验项目维护-主
if (inspectionItem.getCurrentRevision().equals(Constants.BOOL_TRUE)){
if (inspectionItem.getCurrentRevision().equals(Constants.BOOL_TRUE)) {
String inspectionItemNo = inspectionItem.getInspectionItemNo();
UpdateWrapper<InspectionItem> updateWrapper=new UpdateWrapper<>();
updateWrapper.eq(InspectionItem.INSPECTION_ITEM_NO,inspectionItemNo);
updateWrapper.eq(InspectionItem.SITE,inspectionItem.getSite());
updateWrapper.ne(InspectionItem.REVISION,inspectionItem.getRevision());
updateWrapper.set(InspectionItem.CURRENT_REVISION,Constants.BOOL_FALSE);
UpdateWrapper<InspectionItem> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq(InspectionItem.INSPECTION_ITEM_NO, inspectionItemNo);
updateWrapper.eq(InspectionItem.SITE, inspectionItem.getSite());
updateWrapper.ne(InspectionItem.REVISION, inspectionItem.getRevision());
updateWrapper.set(InspectionItem.CURRENT_REVISION, Constants.BOOL_FALSE);
update(updateWrapper);
}
if(inspectionItem.selectById(inspectionItem.getHandle()) == null){
if (inspectionItem.selectById(inspectionItem.getHandle()) == null) {
inspectionItem.setCreatedDateTime(LocalDateTime.now());
inspectionItem.setCreateUser(CommonMethods.getUser());
inspectionItem.setModifiedDateTime(LocalDateTime.now());
inspectionItem.setModifyUser(CommonMethods.getUser());
save(inspectionItem);
}else{
} else {
inspectionItem.setModifiedDateTime(LocalDateTime.now());
inspectionItem.setModifyUser(CommonMethods.getUser());
if(b){
if (b) {
throw new BaseException("请先检索再保存");
}
saveOrUpdate(inspectionItem);
@ -163,20 +199,33 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
@Override
public void deleteServece(InspectionItem inspectionItem) {
if(StringUtil.isBlank(inspectionItem.getInspectionItemNo())){
if (StringUtil.isBlank(inspectionItem.getInspectionItemNo())) {
throw new BaseException("请输入编号");
}
if(StringUtil.isBlank(inspectionItem.getRevision())){
if (StringUtil.isBlank(inspectionItem.getRevision())) {
throw new BaseException("请输入版本");
}
inspectionItem.setSite(CommonMethods.getSite());
inspectionItem.setHandle(HandleEnum.INSPECTION_ITEM.getHandle(inspectionItem.getSite(),inspectionItem.getInspectionItemNo(),inspectionItem.getRevision()));
inspectionItem.setHandle(HandleEnum.INSPECTION_ITEM.getHandle(inspectionItem.getSite(), inspectionItem.getInspectionItemNo(), inspectionItem.getRevision()));
HashMap<String, Object> removeCondition = new HashMap<>();
removeCondition.put(InspectionItemAddition.INSPECTION_ITEM_BO,inspectionItem.getHandle());
removeCondition.put(InspectionItemAddition.INSPECTION_ITEM_BO, inspectionItem.getHandle());
inspectionItemAdditionService.removeByMap(removeCondition);
inspectionItemDetailService.removeByMap(removeCondition);
removeById(inspectionItem.getHandle());
}
//是否存在质量自检互检任务
@Override
public List<InspectionItemDetail> selectQualityInspection(String sfc, String operation, String stepId, String inspectionType) {
String site = CommonMethods.getSite();
List<InspectionItemDetail> inspectionItemDetails = inspectionItemMapper.selectQualityInspection(site, sfc, operation, stepId, inspectionType);
if (inspectionItemDetails.isEmpty()) {
//是否有维护*的项目
inspectionItemDetails = inspectionItemMapper.selectWidestQualityInspection(site, inspectionType, "*");
}
return inspectionItemDetails;
}
}

@ -0,0 +1,46 @@
package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.InspectionTaskDetail;
import com.foreverwin.mesnac.common.mapper.InspectionTaskDetailMapper;
import com.foreverwin.mesnac.common.service.InspectionTaskDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
* -
* </p>
*
* @author Philip
* @since 2021-07-05
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InspectionTaskDetailServiceImpl extends ServiceImpl<InspectionTaskDetailMapper, InspectionTaskDetail> implements InspectionTaskDetailService {
@Autowired
private InspectionTaskDetailMapper inspectionTaskDetailMapper;
@Override
public IPage<InspectionTaskDetail> selectPage(FrontPage<InspectionTaskDetail> frontPage, InspectionTaskDetail inspectionTaskDetail) {
QueryWrapper<InspectionTaskDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTaskDetail);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<InspectionTaskDetail> selectList(InspectionTaskDetail inspectionTaskDetail) {
QueryWrapper<InspectionTaskDetail> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTaskDetail);
return super.list(queryWrapper);
}
}

@ -0,0 +1,219 @@
package com.foreverwin.mesnac.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.mapper.InspectionTaskMapper;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
import com.foreverwin.mesnac.common.model.InspectionTask;
import com.foreverwin.mesnac.common.model.InspectionTaskDetail;
import com.foreverwin.mesnac.common.service.InspectionItemService;
import com.foreverwin.mesnac.common.service.InspectionTaskDetailService;
import com.foreverwin.mesnac.common.service.InspectionTaskService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-05
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, InspectionTask> implements InspectionTaskService {
@Autowired
private InspectionTaskMapper inspectionTaskMapper;
@Autowired
private InspectionTaskDetailService inspectionTaskDetailService;
@Autowired
private InspectionItemService inspectionItemService;
@Override
public IPage<InspectionTask> selectPage(FrontPage<InspectionTask> frontPage, InspectionTask inspectionTask) {
QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTask);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<InspectionTask> selectList(InspectionTask inspectionTask) {
QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inspectionTask);
return super.list(queryWrapper);
}
@Override
public void save(Map<String, Object> paramMap) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
//类型(首检|S/巡检|X/专检|Y/FQC|F/尾检|W/自检|Z/互检|H)
String category = (String) paramMap.get("CATEGORY");
//获取检验项目
List<Map<String, Object>> taskList = (List<Map<String, Object>>) paramMap.get("TASK_LIST");
//更新任务表
InspectionTask task = new InspectionTask();
String taskHandle = (String) paramMap.get("TASK_HANDLE");
if(StringUtil.isEmpty(taskHandle)){
throw new BaseException("保存失败,请先进行检索数据!");
}
task.setHandle(taskHandle);
task.setComments((String) paramMap.get("COMMENTS"));
task.setStatus("COMPLETE");
task.setModifyUser(user);
task.setModifiedDateTime(LocalDateTime.now());
task.setResult((String) paramMap.get("RESULT"));
updateById(task);
//新增任务从表
if (taskList != null && taskList.size() != 0) {
List<InspectionTaskDetail> detailList = new ArrayList<>();
for (int i = 0; i < taskList.size(); i++) {
String taskListHandle = HandleEnum.INSPECTION_TASK_DETAIL.getHandle(site, UUID.randomUUID().toString());
InspectionTaskDetail inspectionTaskDetail = new InspectionTaskDetail();
inspectionTaskDetail.setHandle(taskListHandle);
inspectionTaskDetail.setSite(site);
inspectionTaskDetail.setTaskBo((String) paramMap.get("TASK_HANDLE"));
inspectionTaskDetail.setInspectionItemDetailBo((String) taskList.get(i).get("HANDLE"));
inspectionTaskDetail.setCheckUser((String) paramMap.get("CHECK_USER"));
String paramType = (String) taskList.get(i).get("PARAM_TYPE");
String checkValue = "";
if (paramType.equals("布尔")) {
checkValue = (String) taskList.get(i).get("CHECK_VALUE1");
} else {
checkValue = (String) taskList.get(i).get("CHECK_VALUE2");
}
inspectionTaskDetail.setCheckValues(checkValue);
inspectionTaskDetail.setResult((String) taskList.get(i).get("RESULT"));
String remark = (String) taskList.get(i).get("REMARK");
if (StringUtil.isBlank(remark)) {
inspectionTaskDetail.setRemark("");
} else {
inspectionTaskDetail.setRemark(remark);
}
String pictureNo = (String) taskList.get(i).get("PICTURE_NO");
if (StringUtil.isBlank(pictureNo)) {
inspectionTaskDetail.setPictureNo("");
} else {
inspectionTaskDetail.setPictureNo(pictureNo);
}
String pictureQty = (String) taskList.get(i).get("PICTURE_QTY");
if ("".equals(pictureQty) || null == pictureQty || "NULL".equals(pictureQty)) {
inspectionTaskDetail.setPictureQty("0");
} else {
inspectionTaskDetail.setPictureQty(pictureQty);
}
detailList.add(inspectionTaskDetail);
}
inspectionTaskDetailService.saveBatch(detailList);
}
}
@Override
public void createTask(Map<String, Object> paramMap) {
//站点
String site = CommonMethods.getSite();
//类型(自检|Z;互检|H;FQC|F;尾检|W)
String category = (String) paramMap.get("CATEGORY");
//产品批次
String sfc = (String) paramMap.get("SFC");
//产品批次
String shopOrder = (String) paramMap.get("SHOP_ORDER");
//工序
String operation = (String) paramMap.get("OPERATION");
//工序标识
String stepId = (String) paramMap.get("STEP_ID");
//自检/互检/包装 校验是否在当前工序+工序标识 做过检验任务
InspectionTask createTask = isCreateTask(site, category, sfc, operation, stepId);
if (createTask!=null&&createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) {
throw new BaseException("当前产品批次[" + sfc + "]已做完检验任务");
}
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, category);
if (inspectionItemDetails.size() == 0||StringUtil.isBlank(inspectionItemDetails.get(0).getInspectionItemBo())) {
throw new BaseException("创建任务失败,未维护数据收集组!");
}
String handle = "InspectionTaskBO:" + site + "," + UUID.randomUUID().toString();
Date date = new Date(System.currentTimeMillis());
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss");
String taskNo = "";
String itemNumber = (String) paramMap.get("ITEM_NUMBER");
String description = "";
if (category.equals(Constants.INSPECTION_TYPE_Z)) {
if (StringUtil.isBlank(itemNumber) ) {
taskNo = "Z_" + dateFormat1.format(date);
} else{
taskNo = "Z_" + itemNumber + "_" + dateFormat1.format(date);
}
description = "自检检验任务";
} else if (category.equals(Constants.INSPECTION_TYPE_H)) {
if (StringUtil.isBlank(itemNumber)) {
taskNo = "H_" + dateFormat1.format(date);
} else {
taskNo = "H_" + itemNumber + "_" + dateFormat1.format(date);
}
description = "互检检验任务";
} else {
throw new BaseException("生成任务号失败,请传入检验类型!");
}
InspectionTask task = new InspectionTask();
task.setHandle(handle);
task.setSite(site);
task.setCategory(category);
task.setTaskNo(taskNo);
task.setStatus(Constants.INSPECTION_TASK_STATUS_NEW);
task.setDescription(description);
task.setInspectionItemBo( inspectionItemDetails.get(0).getInspectionItemBo());
task.setShopOrder(shopOrder);
task.setWorkCenter((String) paramMap.get("WORK_CENTER"));
task.setSfc(sfc);
task.setOperation(operation);
task.setStepId(stepId);
task.setResrce((String) paramMap.get("RESRCE"));
task.setCreateUser((String) paramMap.get("CREATE_USER"));
task.setCreatedDateTime(LocalDateTime.now());
task.setModifyUser((String) paramMap.get("CREATE_USER"));
task.setModifiedDateTime(LocalDateTime.now());
task.setSfcDispatchBo((String) paramMap.get("SFC_DISPATCH_DETAIL_BO"));
task.setSfc(sfc);
save(task);
}
public InspectionTask isCreateTask(String site,String category,String sfc,String operation ,String stepId) {
//自检/互检 校验是否在当前工序+工序标识 做过检验任务
QueryWrapper<InspectionTask> queryWrapper=new QueryWrapper<>();
queryWrapper.eq(InspectionTask.SITE,site);
queryWrapper.eq(InspectionTask.SFC,sfc);
queryWrapper.eq(InspectionTask.CATEGORY,category);
queryWrapper.eq(InspectionTask.OPERATION,operation);
queryWrapper.eq(InspectionTask.STEP_ID,stepId);
queryWrapper.orderByDesc(InspectionTask.CREATED_DATE_TIME);
List<InspectionTask> list = list(queryWrapper);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -447,4 +447,32 @@
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectQualityInspection" resultType="com.foreverwin.mesnac.common.model.InspectionItemDetail">
SELECT ziid.* FROM Z_INSPECTION_ITEM zii
JOIN Z_INSPECTION_ITEM_ADDITION ziia ON zii.HANDLE=ZIIA.INSPECTION_ITEM_BO
LEFT JOIN Z_INSPECTION_ITEM_DETAIL ziid ON ZIID.INSPECTION_ITEM_BO=zii.HANDLE
JOIN Z_INSPECTION_ITEM_ADDITION ziiao ON zii.HANDLE=ziiao.INSPECTION_ITEM_BO
JOIN ITEM i ON ziia.ADDITIONAL_OBJECT_TYPE='ITEM' AND ziia.ADDITIONAL_OBJECT=i.ITEM AND I.CURRENT_REVISION='true'
JOIN SFC SFC ON sfc.ITEM_BO=i.HANDLE
JOIN SFC_ROUTING SR ON SFC.HANDLE=SR.SFC_BO
JOIN SFC_ROUTER SR2 ON SR.HANDLE =SR2.SFC_ROUTING_BO AND SR2.IN_USE = 'true'
JOIN SFC_STEP SS ON SR2.HANDLE =SS.SFC_ROUTER_BO
JOIN OPERATION OP ON 'OperationBO:'|| OP.SITE ||','|| OP.OPERATION||',#'=SS.OPERATION_BO
WHERE SFC.SITE = #{site} AND SFC.SFC = #{sfc} AND (SS.QTY_IN_QUEUE>0 or SS.QTY_IN_WORK>0) AND op.OPERATION||'/'||ss.STEP_ID=ziiao.ADDITIONAL_OBJECT
AND OP.OPERATION=#{operation} AND ss.STEP_ID=#{stepId} AND zii.INSPECTION_TYPE=#{inspectionType} AND zii.STATUS='Y'
</select>
<select id="checkRouterStep" resultType="java.lang.Integer">
SELECTRS FROM ROUTER_STEP RS
JOIN ROUTER_OPERATION ro ON RS.HANDLE =ro.ROUTER_STEP_BO
JOIN OPERATION OP ON OP.HANDLE= ro.OPERATION_BO OR ('OperationBO:' || OP.SITE || ',' || OP.OPERATION || ',#' = ro.OPERATION_BO AND OP.CURRENT_REVISION = 'true')
WHERE op.SITE=#{site} AND rs.STEP_ID=#{stepId} AND op.OPERATION=#{operation}
</select>
<select id="selectWidestQualityInspection" resultType="com.foreverwin.mesnac.common.model.InspectionItemDetail">
SELECT ziid.* FROM Z_INSPECTION_ITEM zii
JOIN Z_INSPECTION_ITEM_ADDITION ziia ON zii.HANDLE=ZIIA.INSPECTION_ITEM_BO
LEFT JOIN Z_INSPECTION_ITEM_DETAIL ziid ON ZIID.INSPECTION_ITEM_BO=zii.HANDLE
WHERE (ziia.ADDITIONAL_OBJECT_TYPE='ITEM' OR ziia.ADDITIONAL_OBJECT_TYPE='OPERATION') AND zii.STATUS='Y' AND zii.INSPECTION_TYPE=#{inspectionType}
AND ziia.ADDITIONAL_OBJECT=#{additionalObject} AND zii.SITE=#{site};
</select>
</mapper>

@ -0,0 +1,434 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.common.mapper.InspectionTaskDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.InspectionTaskDetail">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="TASK_BO" property="taskBo" />
<result column="INSPECTION_ITEM_DETAIL_BO" property="inspectionItemDetailBo" />
<result column="CHECK_VALUES" property="checkValues" />
<result column="RESULT" property="result" />
<result column="CHECK_DATE" property="checkDate" />
<result column="CHECK_USER" property="checkUser" />
<result column="REMARK" property="remark" />
<result column="PICTURE_NO" property="pictureNo" />
<result column="SFC" property="sfc" />
<result column="PICTURE_QTY" property="pictureQty" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, TASK_BO, INSPECTION_ITEM_DETAIL_BO, CHECK_VALUES, RESULT, CHECK_DATE, CHECK_USER, REMARK, PICTURE_NO, SFC, PICTURE_QTY
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECTION_TASK_DETAIL
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.InspectionTaskDetail">
INSERT INTO Z_INSPECTION_TASK_DETAIL
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="taskBo!=null">TASK_BO,</if>
<if test="inspectionItemDetailBo!=null">INSPECTION_ITEM_DETAIL_BO,</if>
<if test="checkValues!=null">CHECK_VALUES,</if>
<if test="result!=null">RESULT,</if>
<if test="checkDate!=null">CHECK_DATE,</if>
<if test="checkUser!=null">CHECK_USER,</if>
<if test="remark!=null">REMARK,</if>
<if test="pictureNo!=null">PICTURE_NO,</if>
<if test="sfc!=null">SFC,</if>
<if test="pictureQty!=null">PICTURE_QTY,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="taskBo!=null">#{taskBo},</if>
<if test="inspectionItemDetailBo!=null">#{inspectionItemDetailBo},</if>
<if test="checkValues!=null">#{checkValues},</if>
<if test="result!=null">#{result},</if>
<if test="checkDate!=null">#{checkDate},</if>
<if test="checkUser!=null">#{checkUser},</if>
<if test="remark!=null">#{remark},</if>
<if test="pictureNo!=null">#{pictureNo},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="pictureQty!=null">#{pictureQty},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.InspectionTaskDetail">
INSERT INTO Z_INSPECTION_TASK_DETAIL
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{taskBo},
#{inspectionItemDetailBo},
#{checkValues},
#{result},
#{checkDate},
#{checkUser},
#{remark},
#{pictureNo},
#{sfc},
#{pictureQty},
</trim>
</insert>
<update id="updateById">
UPDATE Z_INSPECTION_TASK_DETAIL <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.taskBo!=null">TASK_BO=#{et.taskBo},</if>
<if test="et.inspectionItemDetailBo!=null">INSPECTION_ITEM_DETAIL_BO=#{et.inspectionItemDetailBo},</if>
<if test="et.checkValues!=null">CHECK_VALUES=#{et.checkValues},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.checkDate!=null">CHECK_DATE=#{et.checkDate},</if>
<if test="et.checkUser!=null">CHECK_USER=#{et.checkUser},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.pictureNo!=null">PICTURE_NO=#{et.pictureNo},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.pictureQty!=null">PICTURE_QTY=#{et.pictureQty},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_INSPECTION_TASK_DETAIL <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
TASK_BO=#{et.taskBo},
INSPECTION_ITEM_DETAIL_BO=#{et.inspectionItemDetailBo},
CHECK_VALUES=#{et.checkValues},
RESULT=#{et.result},
CHECK_DATE=#{et.checkDate},
CHECK_USER=#{et.checkUser},
REMARK=#{et.remark},
PICTURE_NO=#{et.pictureNo},
SFC=#{et.sfc},
PICTURE_QTY=#{et.pictureQty},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_INSPECTION_TASK_DETAIL <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.taskBo!=null">TASK_BO=#{et.taskBo},</if>
<if test="et.inspectionItemDetailBo!=null">INSPECTION_ITEM_DETAIL_BO=#{et.inspectionItemDetailBo},</if>
<if test="et.checkValues!=null">CHECK_VALUES=#{et.checkValues},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.checkDate!=null">CHECK_DATE=#{et.checkDate},</if>
<if test="et.checkUser!=null">CHECK_USER=#{et.checkUser},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.pictureNo!=null">PICTURE_NO=#{et.pictureNo},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.pictureQty!=null">PICTURE_QTY=#{et.pictureQty},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_INSPECTION_TASK_DETAIL
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_INSPECTION_TASK_DETAIL
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
<if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
<if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
<if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -0,0 +1,500 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.common.mapper.InspectionTaskMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.InspectionTask">
<result column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="CATEGORY" property="category" />
<result column="TASK_NO" property="taskNo" />
<result column="DESCRIPTION" property="description" />
<result column="STATUS" property="status" />
<result column="INSPECTION_ITEM_BO" property="inspectionItemBo" />
<result column="WORK_CENTER" property="workCenter" />
<result column="SHOP_ORDER" property="shopOrder" />
<result column="SFC" property="sfc" />
<result column="OPERATION" property="operation" />
<result column="STEP_ID" property="stepId" />
<result column="RESRCE" property="resrce" />
<result column="RESULT" property="result" />
<result column="COMMENTS" property="comments" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, CATEGORY, TASK_NO, DESCRIPTION, STATUS, INSPECTION_ITEM_BO, WORK_CENTER, SHOP_ORDER, SFC, OPERATION, STEP_ID, RESRCE, RESULT, COMMENTS, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, SFC_DISPATCH_BO
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_INSPECTION_TASK
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_TASK
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_INSPECTION_TASK
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.InspectionTask">
INSERT INTO Z_INSPECTION_TASK
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="category!=null">CATEGORY,</if>
<if test="taskNo!=null">TASK_NO,</if>
<if test="description!=null">DESCRIPTION,</if>
<if test="status!=null">STATUS,</if>
<if test="inspectionItemBo!=null">INSPECTION_ITEM_BO,</if>
<if test="workCenter!=null">WORK_CENTER,</if>
<if test="shopOrder!=null">SHOP_ORDER,</if>
<if test="sfc!=null">SFC,</if>
<if test="operation!=null">OPERATION,</if>
<if test="stepId!=null">STEP_ID,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="result!=null">RESULT,</if>
<if test="comments!=null">COMMENTS,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
<if test="sfcDispatchBo!=null">SFC_DISPATCH_BO,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="category!=null">#{category},</if>
<if test="taskNo!=null">#{taskNo},</if>
<if test="description!=null">#{description},</if>
<if test="status!=null">#{status},</if>
<if test="inspectionItemBo!=null">#{inspectionItemBo},</if>
<if test="workCenter!=null">#{workCenter},</if>
<if test="shopOrder!=null">#{shopOrder},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="operation!=null">#{operation},</if>
<if test="stepId!=null">#{stepId},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="result!=null">#{result},</if>
<if test="comments!=null">#{comments},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
<if test="sfcDispatchBo!=null">#{sfcDispatchBo},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.InspectionTask">
INSERT INTO Z_INSPECTION_TASK
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{category},
#{taskNo},
#{description},
#{status},
#{inspectionItemBo},
#{workCenter},
#{shopOrder},
#{sfc},
#{operation},
#{stepId},
#{resrce},
#{result},
#{comments},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
#{sfcDispatchBo},
</trim>
</insert>
<update id="update">
UPDATE Z_INSPECTION_TASK <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.category!=null">CATEGORY=#{et.category},</if>
<if test="et.taskNo!=null">TASK_NO=#{et.taskNo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.inspectionItemBo!=null">INSPECTION_ITEM_BO=#{et.inspectionItemBo},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.comments!=null">COMMENTS=#{et.comments},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteByMap">
DELETE FROM Z_INSPECTION_TASK
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_INSPECTION_TASK
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.inspectionItemBo!=null"> AND INSPECTION_ITEM_BO=#{ew.entity.inspectionItemBo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.comments!=null"> AND COMMENTS=#{ew.entity.comments}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -6,9 +6,7 @@ import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -47,12 +45,24 @@ public class PodTemplateController {
* @return
*/
@ResponseBody
@GetMapping("/sfcStart")
public R sfcStart(List<SfcDto> sfcDtoList) {
@PostMapping("/sfcStart")
public R sfcStart(@RequestBody List<SfcDto> sfcDtoList) {
podTemplateService.sfcStart(sfcDtoList);
return R.ok();
}
/**
* sfc
* @param sfcDtoList
* @return
*/
@ResponseBody
@PostMapping("/sfcComplete")
public R sfcComplete(@RequestBody List<SfcDto> sfcDtoList) {
podTemplateService.sfcComplete(sfcDtoList);
return R.ok();
}
/**
*
* @param sfcDto

@ -14,4 +14,6 @@ public interface PodTemplateService {
Object getSfcInfo(SfcDto sfcDto);
void sfcStart(List<SfcDto> sfcDto);
void sfcComplete(List<SfcDto> sfcDtoList);
}

@ -65,7 +65,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//查询在该设备存在活动中的SFC
List<Sfc> sfcList = sfcService.getSfcListByResrceBO(resrceBO);
//List<Map<String, Object>> proReadyList = sfcDataMainMapper.queryPrdReadyByResrce(site, resrce);
//List<Map<String, Object>> proReadyList = sfcDa
// taMainMapper.queryPrdReadyByResrce(site, resrce);
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("SFC_LIST", sfcList);
//resultMap.put("READY_LIST", proReadyList);
@ -111,105 +112,10 @@ public class PodTemplateServiceImpl implements PodTemplateService {
resultMap.put("SFC_STEP_LIST", substepList);
String stepId = (String) resultMap.get("STEP_ID");
//2021/1/20 roc 根据SFC和步骤标识查找是否维护了尾检项
/*List<Map<String, Object>> checkOperationCheckW = sfcDataMainMapper.checkOperationCheckW(site, sfc, stepId);
if(null != checkOperationCheckW && checkOperationCheckW.size() >0){
resultMap.put("IS_CREATE_W", "Y");
}else{
resultMap.put("IS_CREATE_W", "N");
}*/
resultMap.put("IS_CREATE_W", "N");
String isCreateH = "N";
String isCreateZ = "N";
/*if(!"403".equals(resultMap.get("STATUS"))) {
//SFC未开始
//判断对否需要进行互检
*//* List<Map<String, Object>> checkOperationCheckH = sfcDataMainMapper.checkOperationCheckH(site, sfc, stepId);
if(checkOperationCheckH.size() > 0 ){
resultMap.put("IS_CHECK_H", "Y");
//自检/互检 校验是否在当前工序+工序标识 做过检验任务
List<Map<String, Object>> checkList = taskMapper.checkCreateTaskSfc(sfc, site, "H", (String) resultMap.get("OPERATION"), stepId);
if (checkList.size() > 0) {
for (int i = 0; i < checkList.size(); i++) {
if (checkList.get(i).get("STATUS").equals("COMPLETE") && checkList.get(i).get("RESULT").equals("OK")) {
isCreateH = "N";
}
}
}
}*//*
}else{
//sfc已开始
for (int i = 0; i < substepList.size(); i++) {
if ("READY".equals(substepList.get(i).get("STATE")) && "true".equals(substepList.get(i).get("IS_SEQTRUE"))) {
substep = (String) substepList.get(i).get("STEP_ID");
substepHandle = (String) substepList.get(i).get("HANDLE");
}
}
//判断是否存在工步
if(StringUtil.isEmpty(substep)){
//判断对否需要进行自检(无工步)
List<Map<String, Object>> checkOperationCheckZ = sfcDataMainMapper.checkOperationCheckZ(site, sfc, stepId);
if(checkOperationCheckZ.size() > 0 ){
resultMap.put("IS_CHECK_Z", "Y");
//自检/互检 校验是否在当前工序+工序标识 做过检验任务
List<Map<String, Object>> checkList = taskMapper.checkCreateTaskSfc(sfc, site, "Z", (String) resultMap.get("OPERATION"), stepId);
if (checkList.size() > 0) {
for (int i = 0; i < checkList.size(); i++) {
if (checkList.get(i).get("STATUS").equals("COMPLETE") && "OK".equals(checkList.get(i).get("RESULT"))) {
isCreateZ = "N";
}
}
}
}
//判断对否需要进行互检(无工步)
List<Map<String, Object>> checkOperationCheckH = sfcDataMainMapper.checkOperationCheckH(site, sfc, stepId);
if(checkOperationCheckH.size() > 0 ){
resultMap.put("IS_CHECK_H", "Y");
//自检/互检 校验是否在当前工序+工序标识 做过检验任务
List<Map<String, Object>> checkList = taskMapper.checkCreateTaskSfc(sfc, site, "H", (String) resultMap.get("OPERATION"), stepId);
if (checkList.size() > 0) {
for (int i = 0; i < checkList.size(); i++) {
if (checkList.get(i).get("STATUS").equals("COMPLETE") && "OK".equals(checkList.get(i).get("RESULT"))) {
isCreateH = "N";
}
}
}
}
}else{
//判断对否需要进行自检(有工步)
List<Map<String, Object>> checkSubstepCheckZ = sfcDataMainMapper.checkSubstepCheckZ(substepHandle);
if(checkSubstepCheckZ.size() > 0 ){
resultMap.put("IS_CHECK_Z", "Y");
//自检/互检 校验是否在当前工序+工序+工步标识 做过检验任务
List<Map<String, Object>> checkList = taskMapper.checkCreateTaskSfcDetail(sfc, site, "Z", (String) resultMap.get("OPERATION"), stepId, substep);
if (checkList.size() > 0) {
for (int i = 0; i < checkList.size(); i++) {
if (checkList.get(i).get("STATUS").equals("COMPLETE") && "OK".equals(checkList.get(i).get("RESULT"))) {
isCreateZ = "N";
}
}
}
}
//判断对否需要进行互检(有工步)
List<Map<String, Object>> checkSubstepCheckH = sfcDataMainMapper.checkSubstepCheckH(substepHandle);
if(checkSubstepCheckH.size() > 0 ){
resultMap.put("IS_CHECK_H", "Y");
//自检/互检 校验是否在当前工序+工序标识 做过检验任务
List<Map<String, Object>> checkList = taskMapper.checkCreateTaskSfcDetail(sfc, site, "H", (String) resultMap.get("OPERATION"), stepId, substep);
if (checkList.size() > 0) {
for (int i = 0; i < checkList.size(); i++) {
if (checkList.get(i).get("STATUS").equals("COMPLETE") && "OK".equals(checkList.get(i).get("RESULT"))) {
isCreateH = "N";
}
}
}
}
}
}*/
resultMap.put("IS_CREATE_H", isCreateH);
resultMap.put("IS_CREATE_Z", isCreateZ);
return resultMap;
@ -232,7 +138,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
String resrce = sfcDto.getResrce();
String sfc = sfcDto.getSfc();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(sfc, sfc));
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString());
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(),resrce,sfcServiceById.getHandle(),qty);
@ -241,4 +147,21 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
});
}
@Override
public void sfcComplete(List<SfcDto> sfcDtoList) {
sfcDtoList.forEach(sfcDto -> {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
String resrce = sfcDto.getResrce();
String sfc = sfcDto.getSfc();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString());
try {
sfcCrossService.completeAction(site, currentRevisionRef.getHandle(),resrce,sfcServiceById.getHandle(),qty);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
});
}
}

Loading…
Cancel
Save