feat: 检验计划维护修改,新增表字段
This commit is contained in:
parent
296fa856dc
commit
b9f6d536ac
@ -23,4 +23,11 @@ public class QmsQcPlanTargetDTO extends QmsQcPlanTarget {
|
||||
private String calibrationFreq;
|
||||
|
||||
private List<String> freq;
|
||||
|
||||
private String itemBo;
|
||||
private String item;
|
||||
private String itemDesc;
|
||||
private String operationBo;
|
||||
private String operation;
|
||||
private String operationDesc;
|
||||
}
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
package com.foreverwin.iep.qms.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.foreverwin.iep.common.utils.HandleBoProcessor;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 选项集主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:04
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_qc_item_type_text_sub")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "选项集主表")
|
||||
public class QmsQcItemTypeTextSub extends Model<QmsQcItemTypeTextSub> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String QC_ITEM_TYPE_TEXT_SUB_BO = "QcItemTypeTextSubBO";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value="工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 选项集编号
|
||||
*/
|
||||
@ApiModelProperty(value="选项集编号")
|
||||
private String textGroupNo;
|
||||
|
||||
/**
|
||||
* 选项集说明
|
||||
*/
|
||||
@ApiModelProperty(value="选项集说明")
|
||||
private String textGroupDesc;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@ApiModelProperty(value="创建日期")
|
||||
private LocalDateTime createdDateTime;
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
@ApiModelProperty(value="创建人员")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@ApiModelProperty(value="更新日期")
|
||||
private LocalDateTime updatedDateTime;
|
||||
|
||||
/**
|
||||
* 更新人员
|
||||
*/
|
||||
@ApiModelProperty(value="更新人员")
|
||||
private String updateUser;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<QmsQcItemTypeTextSubDetail> detailList;
|
||||
|
||||
public static String genHandle(String site, String textGroupNo) {
|
||||
return HandleBoProcessor.genHandle(QC_ITEM_TYPE_TEXT_SUB_BO, site, textGroupNo);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.foreverwin.iep.qms.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.foreverwin.iep.common.utils.HandleBoProcessor;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 选项集明细表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:10
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_qc_item_type_text_sub_detail")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "选项集明细表")
|
||||
public class QmsQcItemTypeTextSubDetail extends Model<QmsQcItemTypeTextSubDetail> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String QC_ITEM_TYPE_TEXT_SUB_DETAIL_BO = "QcItemTypeTextSubDetailBO";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value="工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty(value="主键")
|
||||
private String qmsQcItemTypeTextSubBo;
|
||||
|
||||
/**
|
||||
* 选项编号
|
||||
*/
|
||||
@ApiModelProperty(value="选项编号")
|
||||
private String textNo;
|
||||
|
||||
/**
|
||||
* 选项描述
|
||||
*/
|
||||
@ApiModelProperty(value="选项描述")
|
||||
private String textNoDesc;
|
||||
|
||||
/**
|
||||
* 判定标准
|
||||
*/
|
||||
@ApiModelProperty(value="判定标准")
|
||||
private String textNoDecide;
|
||||
|
||||
public static String genHandle(String site,String qmsQcItemTypeTextSubBo, String textNo) {
|
||||
return HandleBoProcessor.genHandle(QC_ITEM_TYPE_TEXT_SUB_DETAIL_BO, site,qmsQcItemTypeTextSubBo, textNo);
|
||||
}
|
||||
}
|
||||
@ -146,7 +146,43 @@ public class QmsQcPlan extends Model<QmsQcPlan> {
|
||||
*/
|
||||
@ApiModelProperty(value = "校验频率")
|
||||
private String calibrationFreq;
|
||||
|
||||
|
||||
/**
|
||||
*抽样规则
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样规则")
|
||||
private String samplePlan;
|
||||
|
||||
/**
|
||||
* 检验细类
|
||||
*/
|
||||
@ApiModelProperty(value = "检验细类")
|
||||
private String qcSubCategories;
|
||||
|
||||
/**
|
||||
* 复核人员群组
|
||||
*/
|
||||
@ApiModelProperty(value = "复核人员群组")
|
||||
private String checkUserGroup;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String itemBo;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String item;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String itemDesc;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String operationBo;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String operation;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String operationDesc;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String inspecFreqNo;
|
||||
|
||||
|
||||
@ -106,6 +106,37 @@ public class QmsQcPlanDetail extends Model<QmsQcPlanDetail> {
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 检验方法说明
|
||||
*/
|
||||
@ApiModelProperty(value = "检验方法说明")
|
||||
private String inspInstructions;
|
||||
|
||||
/**
|
||||
* 测试次数
|
||||
*/
|
||||
@ApiModelProperty(value = "测试次数")
|
||||
private String testTimes;
|
||||
|
||||
/**
|
||||
* 文本选项集
|
||||
*/
|
||||
@ApiModelProperty(value = "文本选项集")
|
||||
private String textGroupNo;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
@ApiModelProperty(value = "是否必填")
|
||||
private String isRequired;
|
||||
|
||||
/**
|
||||
* 需上传照片
|
||||
*/
|
||||
@ApiModelProperty(value = "需上传照片")
|
||||
private String photosMust;
|
||||
|
||||
|
||||
public static String genHandle(String qcPlanBo, String qcItemBo) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_QC_PLAN_DETAIL_BO, qcPlanBo, qcItemBo);
|
||||
|
||||
@ -0,0 +1,117 @@
|
||||
package com.foreverwin.iep.qms.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSub;
|
||||
import com.foreverwin.iep.qms.service.QmsQcItemTypeTextSubService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 选项集主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:04
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/qms-qc-item-type-text-sub" )
|
||||
@Api(value = "qms-qc-item-type-text-sub", tags = "选项集主表管理")
|
||||
public class QmsQcItemTypeTextSubController {
|
||||
|
||||
private final QmsQcItemTypeTextSubService qmsQcItemTypeTextSubService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param qmsQcItemTypeTextSub 选项集主表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
public R getQmsQcItemTypeTextSubPage(Page page, QmsQcItemTypeTextSub qmsQcItemTypeTextSub) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
qmsQcItemTypeTextSub.setSite(site);
|
||||
return R.ok(qmsQcItemTypeTextSubService.page(page, Wrappers.query(qmsQcItemTypeTextSub)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询选项集主表
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
return R.ok(qmsQcItemTypeTextSubService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存和更新
|
||||
*/
|
||||
@ApiOperation(value = "保存和更新", notes = "保存和更新")
|
||||
@SysLog("保存和更新" )
|
||||
@PostMapping("/saveAndUpdate")
|
||||
public R saveOrUpdate(@RequestBody QmsQcItemTypeTextSub qmsQcItemTypeTextSub) {
|
||||
qmsQcItemTypeTextSubService.saveAndUpdate(qmsQcItemTypeTextSub);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增选项集主表
|
||||
* @param qmsQcItemTypeTextSub 选项集主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增选项集主表", notes = "新增选项集主表")
|
||||
@SysLog("新增选项集主表" )
|
||||
@PostMapping
|
||||
public R save(@RequestBody QmsQcItemTypeTextSub qmsQcItemTypeTextSub) {
|
||||
return R.ok(qmsQcItemTypeTextSubService.save(qmsQcItemTypeTextSub));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改选项集主表
|
||||
* @param qmsQcItemTypeTextSub 选项集主表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改选项集主表", notes = "修改选项集主表")
|
||||
@SysLog("修改选项集主表" )
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody QmsQcItemTypeTextSub qmsQcItemTypeTextSub) {
|
||||
return R.ok(qmsQcItemTypeTextSubService.updateById(qmsQcItemTypeTextSub));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除选项集主表
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除选项集主表", notes = "通过id删除选项集主表")
|
||||
@SysLog("通过id删除选项集主表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(qmsQcItemTypeTextSubService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param qmsQcItemTypeTextSub 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<QmsQcItemTypeTextSub> export(QmsQcItemTypeTextSub qmsQcItemTypeTextSub) {
|
||||
return qmsQcItemTypeTextSubService.list(Wrappers.query(qmsQcItemTypeTextSub));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.foreverwin.iep.qms.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSubDetail;
|
||||
import com.foreverwin.iep.qms.service.QmsQcItemTypeTextSubDetailService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 选项集明细表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:10
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/qms-qc-item-type-text-sub-detail" )
|
||||
@Api(value = "qms-qc-item-type-text-sub-detail", tags = "选项集明细表管理")
|
||||
public class QmsQcItemTypeTextSubDetailController {
|
||||
|
||||
private final QmsQcItemTypeTextSubDetailService qmsQcItemTypeTextSubDetailService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param qmsQcItemTypeTextSubDetail 选项集明细表
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page" )
|
||||
public R getQmsQcItemTypeTextSubDetailPage(Page page, QmsQcItemTypeTextSubDetail qmsQcItemTypeTextSubDetail) {
|
||||
return R.ok(qmsQcItemTypeTextSubDetailService.page(page, Wrappers.query(qmsQcItemTypeTextSubDetail)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@ApiOperation(value = "查询", notes = "查询")
|
||||
@SysLog("查询")
|
||||
@GetMapping("/getList")
|
||||
public R getQmsQcItemTypeTextSubDetailList(QmsQcItemTypeTextSubDetail qmsQcItemTypeTextSubDetail) {
|
||||
return R.ok(qmsQcItemTypeTextSubDetailService.list(Wrappers.query(qmsQcItemTypeTextSubDetail)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询选项集明细表
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{handle}" )
|
||||
public R getById(@PathVariable("handle" ) String handle) {
|
||||
return R.ok(qmsQcItemTypeTextSubDetailService.getById(handle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增选项集明细表
|
||||
* @param qmsQcItemTypeTextSubDetail 选项集明细表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "新增选项集明细表", notes = "新增选项集明细表")
|
||||
@SysLog("新增选项集明细表" )
|
||||
@PostMapping
|
||||
public R save(@RequestBody QmsQcItemTypeTextSubDetail qmsQcItemTypeTextSubDetail) {
|
||||
return R.ok(qmsQcItemTypeTextSubDetailService.save(qmsQcItemTypeTextSubDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改选项集明细表
|
||||
* @param qmsQcItemTypeTextSubDetail 选项集明细表
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "修改选项集明细表", notes = "修改选项集明细表")
|
||||
@SysLog("修改选项集明细表" )
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody QmsQcItemTypeTextSubDetail qmsQcItemTypeTextSubDetail) {
|
||||
return R.ok(qmsQcItemTypeTextSubDetailService.updateById(qmsQcItemTypeTextSubDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除选项集明细表
|
||||
* @param handle id
|
||||
* @return R
|
||||
*/
|
||||
@ApiOperation(value = "通过id删除选项集明细表", notes = "通过id删除选项集明细表")
|
||||
@SysLog("通过id删除选项集明细表" )
|
||||
@DeleteMapping("/{handle}" )
|
||||
public R removeById(@PathVariable String handle) {
|
||||
return R.ok(qmsQcItemTypeTextSubDetailService.removeById(handle));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param qmsQcItemTypeTextSubDetail 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<QmsQcItemTypeTextSubDetail> export(QmsQcItemTypeTextSubDetail qmsQcItemTypeTextSubDetail) {
|
||||
return qmsQcItemTypeTextSubDetailService.list(Wrappers.query(qmsQcItemTypeTextSubDetail));
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,7 @@ public class QmsQcPlanController {
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getQmsQcPlanPage(FrontPage page, QmsQcPlan qmsQcPlan) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
IPage<QmsQcPlan> iPage = qmsQcPlanService.page(page.genOrders(), Wrappers.<QmsQcPlan>lambdaQuery()
|
||||
.eq(QmsQcPlan::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getQcPlan()), QmsQcPlan::getQcPlan, qmsQcPlan.getQcPlan())
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.foreverwin.iep.qms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSubDetail;
|
||||
|
||||
/**
|
||||
* 选项集明细表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:10
|
||||
*/
|
||||
public interface QmsQcItemTypeTextSubDetailService extends IService<QmsQcItemTypeTextSubDetail> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.foreverwin.iep.qms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSub;
|
||||
|
||||
/**
|
||||
* 选项集主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:04
|
||||
*/
|
||||
public interface QmsQcItemTypeTextSubService extends IService<QmsQcItemTypeTextSub> {
|
||||
void saveAndUpdate(QmsQcItemTypeTextSub qmsQcItemTypeTextSub);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.iep.qms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSubDetail;
|
||||
import com.foreverwin.iep.qms.mapper.QmsQcItemTypeTextSubDetailMapper;
|
||||
import com.foreverwin.iep.qms.service.QmsQcItemTypeTextSubDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 选项集明细表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:10
|
||||
*/
|
||||
@Service
|
||||
public class QmsQcItemTypeTextSubDetailServiceImpl extends ServiceImpl<QmsQcItemTypeTextSubDetailMapper, QmsQcItemTypeTextSubDetail> implements QmsQcItemTypeTextSubDetailService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.foreverwin.iep.qms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSub;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSubDetail;
|
||||
import com.foreverwin.iep.qms.mapper.QmsQcItemTypeTextSubMapper;
|
||||
import com.foreverwin.iep.qms.service.QmsQcItemTypeTextSubDetailService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcItemTypeTextSubService;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.nlv.wms.enums.HandleEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 选项集主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:04
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@AllArgsConstructor
|
||||
public class QmsQcItemTypeTextSubServiceImpl extends ServiceImpl<QmsQcItemTypeTextSubMapper, QmsQcItemTypeTextSub> implements QmsQcItemTypeTextSubService {
|
||||
|
||||
private final QmsQcItemTypeTextSubDetailService qmsQcItemTypeTextSubDetailService;
|
||||
@Override
|
||||
public void saveAndUpdate(QmsQcItemTypeTextSub qmsQcItemTypeTextSub) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
//删除明细
|
||||
List<QmsQcItemTypeTextSubDetail> removeList = qmsQcItemTypeTextSubDetailService.list(Wrappers.<QmsQcItemTypeTextSubDetail>lambdaQuery()
|
||||
.eq(QmsQcItemTypeTextSubDetail::getQmsQcItemTypeTextSubBo, qmsQcItemTypeTextSub.getHandle()));
|
||||
qmsQcItemTypeTextSubDetailService.removeBatchByIds(removeList);
|
||||
if (qmsQcItemTypeTextSub.getHandle() != null) {
|
||||
super.update(Wrappers.<QmsQcItemTypeTextSub>lambdaUpdate()
|
||||
.eq(QmsQcItemTypeTextSub::getHandle, qmsQcItemTypeTextSub.getHandle())
|
||||
.eq(QmsQcItemTypeTextSub::getSite, site)
|
||||
.set(QmsQcItemTypeTextSub::getTextGroupDesc, qmsQcItemTypeTextSub.getTextGroupDesc()));
|
||||
} else {
|
||||
qmsQcItemTypeTextSub.setHandle(QmsQcItemTypeTextSub.genHandle(site, qmsQcItemTypeTextSub.getTextGroupNo()));
|
||||
QmsQcItemTypeTextSub qcItemTypeTextSub = getById(qmsQcItemTypeTextSub);
|
||||
if (qcItemTypeTextSub != null) {
|
||||
throw BusinessException.build("选项集编号["+qmsQcItemTypeTextSub.getTextGroupNo()+"已存在,请检索");
|
||||
}
|
||||
qmsQcItemTypeTextSub.setSite(site);
|
||||
qmsQcItemTypeTextSub.setCreateUser(SecurityUtils.getUserName());
|
||||
qmsQcItemTypeTextSub.setCreatedDateTime(LocalDateTime.now());
|
||||
qmsQcItemTypeTextSub.setUpdateUser(SecurityUtils.getUserName());
|
||||
qmsQcItemTypeTextSub.setUpdatedDateTime(LocalDateTime.now());
|
||||
save(qmsQcItemTypeTextSub);
|
||||
}
|
||||
for (QmsQcItemTypeTextSubDetail detail : qmsQcItemTypeTextSub.getDetailList()) {
|
||||
detail.setHandle(QmsQcItemTypeTextSubDetail.genHandle(site, qmsQcItemTypeTextSub.getHandle(),detail.getTextNo()));
|
||||
detail.setSite(site);
|
||||
detail.setQmsQcItemTypeTextSubBo(qmsQcItemTypeTextSub.getHandle());
|
||||
}
|
||||
qmsQcItemTypeTextSubDetailService.saveBatch(qmsQcItemTypeTextSub.getDetailList());
|
||||
}
|
||||
}
|
||||
@ -13,23 +13,17 @@ import com.foreverwin.iep.common.model.spc.base.SpcExecuteRequest;
|
||||
import com.foreverwin.iep.common.model.spc.plan.PlanItem;
|
||||
import com.foreverwin.iep.common.spc.SpcInvoke;
|
||||
import com.foreverwin.iep.common.spc.constant.SpcMethod;
|
||||
import com.foreverwin.iep.common.utils.HandleBoProcessor;
|
||||
import com.foreverwin.iep.common.utils.SidUtils;
|
||||
import com.foreverwin.iep.prd.domain.SaveCustomDataRequest;
|
||||
import com.foreverwin.iep.prd.feign.RemoteCustomFieldsService;
|
||||
import com.foreverwin.iep.qms.domain.UserGroup;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecFreq;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItem;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcPlan;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcPlanDetail;
|
||||
import com.foreverwin.iep.qms.entity.QmsSamplePlan;
|
||||
import com.foreverwin.iep.qms.dto.QmsQcPlanTargetDTO;
|
||||
import com.foreverwin.iep.qms.entity.*;
|
||||
import com.foreverwin.iep.qms.mapper.QmsQcPlanDetailMapper;
|
||||
import com.foreverwin.iep.qms.mapper.QmsQcPlanMapper;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecFreqService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecJobService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcItemService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcPlanDetailService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcPlanService;
|
||||
import com.foreverwin.iep.qms.mapper.QmsQcPlanTargetMapper;
|
||||
import com.foreverwin.iep.qms.service.*;
|
||||
import com.foreverwin.iep.sys.entity.SystemTransactionLog;
|
||||
import com.foreverwin.iep.sys.feign.RemoteSystemTransactionLogService;
|
||||
import com.foreverwin.mom.admin.api.entity.SysRole;
|
||||
@ -74,6 +68,9 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
private final RemoteRoleService remoteRoleService;
|
||||
|
||||
private final RemoteCustomFieldsService remoteCustomFieldsService;
|
||||
|
||||
private final QmsQcPlanTargetService qmsQcPlanTargetService;
|
||||
private final QmsQcPlanTargetMapper qmsQcPlanTargetMapper;
|
||||
|
||||
private QmsInspecJobService getQmsInspecJobService() {
|
||||
return SpringUtil.getBean(QmsInspecJobService.class);
|
||||
@ -90,6 +87,16 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
qcPlan.setInspecFreqNo(inspecFreq.getInspecNo());
|
||||
qcPlan.setInspecFreqDesc(inspecFreq.getDescription());
|
||||
}
|
||||
qcPlan.setInspecFreqNo(HandleBoProcessor.trimHandle(qcPlan.getInspecFreqBo()));
|
||||
QmsQcPlanTargetDTO byTargetBo = qmsQcPlanTargetMapper.getByTargetBo(qcPlan.getSite(), qcPlan.getQcPlan());
|
||||
if (byTargetBo != null) {
|
||||
qcPlan.setItemBo(byTargetBo.getItemBo());
|
||||
qcPlan.setItem(byTargetBo.getItem());
|
||||
qcPlan.setItemDesc(byTargetBo.getItemDesc());
|
||||
qcPlan.setOperationBo(byTargetBo.getOperationBo());
|
||||
qcPlan.setOperation(byTargetBo.getOperation());
|
||||
qcPlan.setOperationDesc(byTargetBo.getOperationDesc());
|
||||
}
|
||||
|
||||
qcPlan.setQcPlanDetailList(qmsQcPlanDetailMapper.getFullDetailByQcPlanBo(handle));
|
||||
|
||||
@ -132,6 +139,7 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
}
|
||||
|
||||
super.save(qmsQcPlan);
|
||||
saveAndUpdateTargetBo(qmsQcPlan);
|
||||
saveCustomData(qmsQcPlan);
|
||||
|
||||
qmsQcPlanDetailService.remove(
|
||||
@ -165,6 +173,7 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
|
||||
super.updateById(qmsQcPlan);
|
||||
saveCustomData(qmsQcPlan);
|
||||
saveAndUpdateTargetBo(qmsQcPlan);
|
||||
|
||||
qmsQcPlanDetailService.remove(
|
||||
Wrappers.<QmsQcPlanDetail>lambdaQuery().eq(QmsQcPlanDetail::getQcPlanBo, qmsQcPlan.getHandle()));
|
||||
@ -319,4 +328,36 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
saveCustomDataRequest.setCustomData(qmsQcPlan.getCustomFields());
|
||||
remoteCustomFieldsService.saveCustomData(saveCustomDataRequest, SecurityConstants.FROM_IN);
|
||||
}
|
||||
|
||||
private void saveAndUpdateTargetBo(QmsQcPlan qmsQcPlan) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(qmsQcPlan.getItemBo());
|
||||
list.add(qmsQcPlan.getOperationBo());
|
||||
String targetBo = qmsQcPlan.getItemBo()+"|"+qmsQcPlan.getOperationBo();
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// String targetBo = list.get(i);
|
||||
QmsQcPlanTarget planTarget = qmsQcPlanTargetService.getOne(Wrappers.<QmsQcPlanTarget>lambdaQuery()
|
||||
.eq(QmsQcPlanTarget::getTargetBo, targetBo)
|
||||
.eq(QmsQcPlanTarget::getSite, site)
|
||||
.eq(QmsQcPlanTarget::getQcPlan, qmsQcPlan.getQcPlan()));
|
||||
if (planTarget == null) {
|
||||
planTarget = new QmsQcPlanTarget();
|
||||
planTarget.setSeq("1");
|
||||
planTarget.setHandle(QmsQcPlanTarget.genHandle(site, qmsQcPlan.getQcPlan(), targetBo, "0"));
|
||||
planTarget.setSite(site);
|
||||
planTarget.setTargetBo(targetBo);
|
||||
planTarget.setQcPlan(qmsQcPlan.getQcPlan());
|
||||
planTarget.setDateCreate(LocalDateTime.now());
|
||||
planTarget.setCreator(SecurityUtils.getUserName());
|
||||
planTarget.setInspectLevel("0");
|
||||
qmsQcPlanTargetService.save(planTarget);
|
||||
} else {
|
||||
planTarget.setTargetBo(targetBo);
|
||||
planTarget.setDateUpdate(LocalDateTime.now());
|
||||
planTarget.setUpdater(SecurityUtils.getUserName());
|
||||
qmsQcPlanTargetService.updateById(planTarget);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package com.foreverwin.iep.qms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSubDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 选项集明细表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:10
|
||||
*/
|
||||
@Mapper
|
||||
public interface QmsQcItemTypeTextSubDetailMapper extends BaseMapper<QmsQcItemTypeTextSubDetail> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.foreverwin.iep.qms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSub;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 选项集主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-11-04 15:17:04
|
||||
*/
|
||||
@Mapper
|
||||
public interface QmsQcItemTypeTextSubMapper extends BaseMapper<QmsQcItemTypeTextSub> {
|
||||
|
||||
}
|
||||
@ -20,4 +20,6 @@ public interface QmsQcPlanMapper extends MomBaseMapper<QmsQcPlan> {
|
||||
IPage<UserGroup> getUserGroup(FrontPage page, @Param("site") String site, @Param("userGroup") String userGroup);
|
||||
|
||||
IPage<QmsQcPlan> getDistinctQcPlan(FrontPage page, @Param("site") String site, @Param("qcPlan") String qcPlan);
|
||||
|
||||
IPage<QmsQcPlan> getListPage(FrontPage page, @Param("entity")QmsQcPlan entity);
|
||||
}
|
||||
|
||||
@ -20,4 +20,6 @@ public interface QmsQcPlanTargetMapper extends MomBaseMapper<QmsQcPlanTarget> {
|
||||
List<QmsQcPlanTargetDTO> get(@Param("targetBo") String targetBo, @Param("inspectLevel") String inspectLevel);
|
||||
|
||||
List<QmsQcPlanTargetDTO> selectTargetByInstrumentGroup(@Param("site") String site);
|
||||
|
||||
QmsQcPlanTargetDTO getByTargetBo(@Param("site")String site,@Param("qcPlan")String qcPlan);
|
||||
}
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
<?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.iep.qms.mapper.QmsQcItemTypeTextSubDetailMapper">
|
||||
|
||||
<resultMap id="qmsQcItemTypeTextSubDetailMap" type="com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSubDetail">
|
||||
<id property="handle" column="HANDLE"/>
|
||||
<result property="site" column="SITE"/>
|
||||
<result property="qmsQcItemTypeTextSubBo" column="QMS_QC_ITEM_TYPE_TEXT_SUB_BO"/>
|
||||
<result property="textNo" column="TEXT_NO"/>
|
||||
<result property="textNoDesc" column="TEXT_NO_DESC"/>
|
||||
<result property="textNoDecide" column="TEXT_NO_DECIDE"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@ -0,0 +1,17 @@
|
||||
<?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.iep.qms.mapper.QmsQcItemTypeTextSubMapper">
|
||||
|
||||
<resultMap id="qmsQcItemTypeTextSubMap" type="com.foreverwin.iep.qms.entity.QmsQcItemTypeTextSub">
|
||||
<id property="handle" column="HANDLE"/>
|
||||
<result property="site" column="SITE"/>
|
||||
<result property="textGroupNo" column="TEXT_GROUP_NO"/>
|
||||
<result property="textGroupDesc" column="TEXT_GROUP_DESC"/>
|
||||
<result property="createdDateTime" column="CREATED_DATE_TIME"/>
|
||||
<result property="createUser" column="CREATE_USER"/>
|
||||
<result property="updatedDateTime" column="UPDATED_DATE_TIME"/>
|
||||
<result property="updateUser" column="UPDATE_USER"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@ -21,6 +21,15 @@
|
||||
<result property="updater" column="UPDATER"/>
|
||||
<result property="calibrationType" column="CALIBRATION_TYPE"/>
|
||||
<result property="calibrationFreq" column="CALIBRATION_FREQ"/>
|
||||
<result property="samplePlan" column="SAMPLE_PLAN"/>
|
||||
<result property="qcSubCategories" column="QC_SUB_CATEGORIES"/>
|
||||
<result property="checkUserGroup" column="CHECK_USER_GROUP"/>
|
||||
<result property="item" column="ITEM"/>
|
||||
<result property="itemDesc" column="ITEM_DESC"/>
|
||||
<result property="itemBo" column="ITEM_BO"/>
|
||||
<result property="operation" column="OPERATION"/>
|
||||
<result property="operationDesc" column="OPERATION_DESC"/>
|
||||
<result property="operationBo" column="OPERATION_BO"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="userGroupMap" type="com.foreverwin.iep.qms.domain.UserGroup">
|
||||
@ -46,4 +55,8 @@
|
||||
and a.qc_plan like concat('%', concat(#{qcPlan},'%'))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getListPage" resultMap="qmsQcPlanMap">
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -26,6 +26,12 @@
|
||||
<result property="resourceBo" column="RESOURCE_BO"/>
|
||||
<result property="qcPlanBo" column="QC_PLAN_BO"/>
|
||||
<result property="calibrationFreq" column="CALIBRATION_FREQ"/>
|
||||
<result property="item" column="ITEM"/>
|
||||
<result property="itemDesc" column="ITEM_DESC"/>
|
||||
<result property="itemBo" column="ITEM_BO"/>
|
||||
<result property="operation" column="OPERATION"/>
|
||||
<result property="operationDesc" column="OPERATION_DESC"/>
|
||||
<result property="operationBo" column="OPERATION_BO"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="get" resultMap="userGroupMap">
|
||||
@ -56,4 +62,12 @@
|
||||
where a.SITE = #{site}
|
||||
and d.CALIBRATION_FREQ is not null
|
||||
</select>
|
||||
|
||||
<select id="getByTargetBo" resultMap="full">
|
||||
SELECT b.HANDLE ITEM_BO,b.ITEM ,b.DESCRIPTION ITEM_DESC,c.HANDLE OPERATION_BO,c.OPERATION ,c.DESCRIPTION OPERATION_DESC
|
||||
FROM QMS_QC_PLAN_TARGET a
|
||||
left join ITEM b on SUBSTRING_INDEX(a.TARGET_BO,'|',1) = b.HANDLE
|
||||
left join OPERATION c on SUBSTRING_INDEX(SUBSTRING_INDEX(a.TARGET_BO,'|',2),'|',-1) = c.HANDLE
|
||||
where a.SITE =#{site} and a.QC_PLAN =#{qcPlan}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user