Merge pull request '质量计划' (#11) from yanyang into master
Reviewed-on: #11
This commit is contained in:
commit
e6b5583d05
@ -124,4 +124,10 @@ public class FactoryController {
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
@ApiOperation(value = "获取工厂列表")
|
||||
@LogOperation("获取工厂列表")
|
||||
public List<FactoryDTO> list() {
|
||||
return factoryService.list();
|
||||
}
|
||||
}
|
@ -48,6 +48,8 @@ public class MachineController {
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||
@ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
@PreAuthorize("@ex.hasAuthority('basic:machine:page')")
|
||||
|
@ -48,6 +48,8 @@ public class PlatformController {
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||
@ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
@PreAuthorize("@ex.hasAuthority('basic:platform:page')")
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.cnbm.basic.controller;
|
||||
|
||||
import com.cnbm.admin.annotation.LogOperation;
|
||||
import com.cnbm.basic.dto.ProductWorkingprocedureRelationDTO;
|
||||
import com.cnbm.common.constant.Constant;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.utils.ExcelUtils;
|
||||
@ -114,4 +115,14 @@ public class ProductFactoryRelationController {
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, ProductFactoryRelationExcel.class);
|
||||
}
|
||||
|
||||
@PostMapping("batchInsertFactory")
|
||||
@ApiOperation("添加多个工厂关联")
|
||||
@LogOperation("添加多个工厂关联")
|
||||
public Result batchInsertFactory(@RequestBody ProductFactoryRelationDTO[] lists){
|
||||
|
||||
productFactoryRelationService.batchInsertFactory(lists);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
}
|
@ -50,6 +50,8 @@ public class UnitController {
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||
@ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
@PreAuthorize("@ex.hasAuthority('basic:unit:page')")
|
||||
|
@ -49,6 +49,8 @@ public class WorkingProcedureTypeController {
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||
@ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
@PreAuthorize("@ex.hasAuthority('basic:workingProcedureType:page')")
|
||||
|
@ -6,6 +6,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -82,4 +83,7 @@ public class ProductDTO implements Serializable {
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private List<Long> factoryList;
|
||||
|
||||
}
|
@ -4,6 +4,8 @@ import com.cnbm.common.dao.BaseDao;
|
||||
import com.cnbm.basic.entity.ProductFactoryRelation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品-工厂 关系表
|
||||
*
|
||||
@ -12,5 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductFactoryRelationMapper extends BaseDao<ProductFactoryRelation> {
|
||||
|
||||
List<Long> getFactoryListByProductId(Long productId);
|
||||
}
|
@ -23,4 +23,6 @@ public interface ProductFeaturesMapper extends BaseDao<ProductFeatures> {
|
||||
List<FeaturesProcedureDTO> getFeaturesByStageProcedure(Map<String, Object> params);
|
||||
|
||||
List<ProductFeaturesDTO> getFeaturesList(Map<String, Object> params);
|
||||
|
||||
String getControlGraphNameById(Long id);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.cnbm.basic.service;
|
||||
|
||||
import com.cnbm.basic.dto.ProductWorkingprocedureRelationDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.basic.dto.ProductFactoryRelationDTO;
|
||||
@ -25,4 +26,6 @@ public interface IProductFactoryRelationService extends CrudService<ProductFacto
|
||||
|
||||
void delete(Long[] ids);
|
||||
|
||||
void batchInsertFactory(ProductFactoryRelationDTO[] lists);
|
||||
|
||||
}
|
@ -12,6 +12,7 @@ import com.cnbm.basic.mapper.MachineMapper;
|
||||
import com.cnbm.basic.entity.Machine;
|
||||
import com.cnbm.basic.service.IMachineService;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -36,8 +37,12 @@ public class MachineServiceImpl extends CrudServiceImpl<MachineMapper, Machine,
|
||||
|
||||
@Override
|
||||
public QueryWrapper<Machine> getWrapper(Map<String, Object> params){
|
||||
String name = (String)params.get("name");
|
||||
String code = (String)params.get("code");
|
||||
|
||||
QueryWrapper<Machine> wrapper = new QueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(name), "name", name);
|
||||
wrapper.like(StringUtils.isNotBlank(code), "code", code);
|
||||
wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status"));
|
||||
|
||||
return wrapper;
|
||||
|
@ -34,8 +34,12 @@ private PlatformMapper mapper;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<Platform> getWrapper(Map<String, Object> params){
|
||||
String name = (String)params.get("name");
|
||||
String code = (String)params.get("code");
|
||||
|
||||
QueryWrapper<Platform> wrapper = new QueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(name), "name", name);
|
||||
wrapper.like(StringUtils.isNotBlank(code), "code", code);
|
||||
wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status"));
|
||||
|
||||
return wrapper;
|
||||
|
@ -2,6 +2,7 @@ package com.cnbm.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cnbm.basic.dto.ProductWorkingprocedureRelationDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.ProductFactoryRelationDTO;
|
||||
@ -9,6 +10,9 @@ import com.cnbm.basic.mapper.ProductFactoryRelationMapper;
|
||||
import com.cnbm.basic.entity.ProductFactoryRelation;
|
||||
import com.cnbm.basic.service.IProductFactoryRelationService;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import com.cnbm.common.validator.ValidatorUtils;
|
||||
import com.cnbm.common.validator.group.AddGroup;
|
||||
import com.cnbm.common.validator.group.DefaultGroup;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -71,4 +75,13 @@ public class ProductFactoryRelationServiceImpl extends CrudServiceImpl<ProductFa
|
||||
deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchInsertFactory(ProductFactoryRelationDTO[] lists) {
|
||||
for(ProductFactoryRelationDTO dto:lists){
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
save(dto);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -74,6 +74,16 @@ public class ProductFeaturesServiceImpl extends CrudServiceImpl<ProductFeaturesM
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductFeaturesDTO dto) {
|
||||
//若控制图配置为“单值移动极差”,样本量为1
|
||||
// if (dto.getControlGraphName()=="单值移动极差"){
|
||||
// dto.setSampleSize(1);
|
||||
// }
|
||||
if(dto.getControlGraphId()!=null){
|
||||
String controlGraphName = mapper.getControlGraphNameById(dto.getControlGraphId());
|
||||
if((controlGraphName!=null) && (controlGraphName.equals("单值移动极差"))) {
|
||||
dto.setSampleSize(1);
|
||||
}
|
||||
}
|
||||
//当产品特性出现update的时候,就会把旧数据 全量备份到这张表
|
||||
ProductFeatures oentity = baseDao.selectById(dto.getId());
|
||||
ProductFeaturesHisDTO history = ConvertUtils.sourceToTarget(oentity, ProductFeaturesHisDTO.class);
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cnbm.basic.entity.ProductType;
|
||||
import com.cnbm.basic.mapper.ProductFactoryRelationMapper;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.ProductDTO;
|
||||
@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -46,7 +48,7 @@ public class ProductServiceImpl extends CrudServiceImpl<ProductMapper, Product,
|
||||
wrapper.like(StringUtils.isNotBlank(code), "code", code);
|
||||
wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status"));
|
||||
wrapper.eq(ObjectUtils.isNotNull(params.get("product_type_id")), "product_type_id", params.get("product_type_id"));
|
||||
wrapper.eq(StringUtils.isNotBlank(inspection_stage), "inspection_stage", inspection_stage);
|
||||
wrapper.like(StringUtils.isNotBlank(inspection_stage), "inspection_stage", inspection_stage);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@ -76,10 +78,18 @@ public class ProductServiceImpl extends CrudServiceImpl<ProductMapper, Product,
|
||||
return productDTOPageData;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ProductFactoryRelationMapper relationMapper;
|
||||
|
||||
@Override
|
||||
public ProductDTO get(Long id) {
|
||||
Product entity = baseDao.selectById(id);
|
||||
return ConvertUtils.sourceToTarget(entity, ProductDTO.class);
|
||||
ProductDTO dto = ConvertUtils.sourceToTarget(entity, ProductDTO.class);
|
||||
|
||||
List<Long> factoryList = relationMapper.getFactoryListByProductId(id);
|
||||
dto.setFactoryList(factoryList);
|
||||
//return ConvertUtils.sourceToTarget(entity, ProductDTO.class);
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,6 +11,7 @@ import com.cnbm.basic.entity.Unit;
|
||||
import com.cnbm.basic.mapper.UnitMapper;
|
||||
import com.cnbm.basic.service.IUnitService;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -33,8 +34,12 @@ public class UnitServiceImpl extends CrudServiceImpl<UnitMapper, Unit, UnitDTO>
|
||||
|
||||
@Override
|
||||
public QueryWrapper<Unit> getWrapper(Map<String, Object> params){
|
||||
String name = (String)params.get("name");
|
||||
String code = (String)params.get("code");
|
||||
|
||||
QueryWrapper<Unit> wrapper = new QueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(name), "name", name);
|
||||
wrapper.like(StringUtils.isNotBlank(code), "code", code);
|
||||
wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status"));
|
||||
|
||||
return wrapper;
|
||||
|
@ -29,8 +29,12 @@ public class WorkingProcedureTypeServiceImpl extends CrudServiceImpl<WorkingProc
|
||||
|
||||
@Override
|
||||
public QueryWrapper<WorkingProcedureType> getWrapper(Map<String, Object> params){
|
||||
String name = (String)params.get("name");
|
||||
String code = (String)params.get("code");
|
||||
|
||||
QueryWrapper<WorkingProcedureType> wrapper = new QueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(name), "name", name);
|
||||
wrapper.like(StringUtils.isNotBlank(code), "code", code);
|
||||
wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status"));
|
||||
|
||||
return wrapper;
|
||||
|
@ -2,4 +2,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cnbm.basic.mapper.ProductFactoryRelationMapper">
|
||||
|
||||
<select id="getFactoryListByProductId" resultType="Long">
|
||||
select factory_id from product_factory_relation
|
||||
where product_id = #{productId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -69,4 +69,8 @@
|
||||
</where>
|
||||
order by pf.id asc
|
||||
</select>
|
||||
|
||||
<select id="getControlGraphNameById" resultType="String">
|
||||
select name from control_graph where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -49,7 +49,7 @@ public class ControlGraphController {
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||
@ApiImplicitParam(name = "type", value = "产品特征类型", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
@PreAuthorize("@ex.hasAuthority('code:controlGraph:page')")
|
||||
@PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:page')")
|
||||
public Result<PageData<ControlGraphDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<ControlGraphDTO> page = controlGraphService.page(params);
|
||||
|
||||
@ -58,7 +58,7 @@ public class ControlGraphController {
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
@PreAuthorize("@ex.hasAuthority('code:controlGraph:info')")
|
||||
@PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:info')")
|
||||
public Result<ControlGraphDTO> get(@PathVariable("id") Long id){
|
||||
ControlGraphDTO data = controlGraphService.get(id);
|
||||
|
||||
@ -68,7 +68,7 @@ public class ControlGraphController {
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
@PreAuthorize("@ex.hasAuthority('code:controlGraph:save')")
|
||||
@PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:save')")
|
||||
public Result<Long> save(@RequestBody ControlGraphDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
@ -81,7 +81,7 @@ public class ControlGraphController {
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
@PreAuthorize("@ex.hasAuthority('code:controlGraph:update')")
|
||||
@PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:update')")
|
||||
public Result<Long> update(@RequestBody ControlGraphDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
@ -94,7 +94,7 @@ public class ControlGraphController {
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
@PreAuthorize("@ex.hasAuthority('code:controlGraph:delete')")
|
||||
@PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:delete')")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
//效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
@ -107,7 +107,7 @@ public class ControlGraphController {
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
@PreAuthorize("@ex.hasAuthority('code:controlGraph:export')")
|
||||
@PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:export')")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<ControlGraphDTO> list = controlGraphService.list(params);
|
||||
|
||||
|
@ -92,6 +92,15 @@ public class InterpretationSchemeController {
|
||||
return new Result<Long>().ok(dto.getId());
|
||||
}
|
||||
|
||||
@PutMapping("batchUpdate")
|
||||
@ApiOperation("批量修改")
|
||||
public Result batchupdate(@RequestBody InterpretationSchemeDTO[] lists){
|
||||
|
||||
interpretationSchemeService.batchUpdate(lists);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
@ -121,4 +130,13 @@ public class InterpretationSchemeController {
|
||||
return interpretationSchemeService.list();
|
||||
}
|
||||
|
||||
@PostMapping(value = "listByMyInterpretationSchemeId")
|
||||
@ApiOperation(value = "获取判读方案列表 依据自定义判读方案id")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "myInterpretationSchemeId", value = "自定义判读方案id", paramType = "query", required = true, dataTypeClass=Long.class)
|
||||
})
|
||||
public List<InterpretationSchemeDTO> listByMyInterpretationSchemeId(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
return interpretationSchemeService.listByMyInterpretationSchemeId(params);
|
||||
}
|
||||
|
||||
}
|
@ -12,6 +12,7 @@ import com.cnbm.common.validator.group.DefaultGroup;
|
||||
import com.cnbm.common.validator.group.UpdateGroup;
|
||||
import com.cnbm.qualityPlanning.dto.MyInterpretationSchemeDTO;
|
||||
import com.cnbm.qualityPlanning.excel.MyInterpretationSchemeExcel;
|
||||
import com.cnbm.qualityPlanning.service.IInterpretationSchemeService;
|
||||
import com.cnbm.qualityPlanning.service.IMyInterpretationSchemeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -66,6 +67,9 @@ public class MyInterpretationSchemeController {
|
||||
return new Result<MyInterpretationSchemeDTO>().ok(data);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IInterpretationSchemeService interpretationSchemeService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
@ -75,6 +79,9 @@ public class MyInterpretationSchemeController {
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
myInterpretationSchemeService.save(dto);
|
||||
//System.out.println(dto.getId());
|
||||
//每新增一条自定义判读方案,同时对应新增十条判读方案
|
||||
//interpretationSchemeService.batchInsert(dto.getId());
|
||||
|
||||
return new Result<Long>().ok(dto.getId());
|
||||
}
|
||||
|
@ -7,12 +7,14 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 判读方案 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-08-15
|
||||
* @since 2022-09-20
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "判读方案 表DTO对象")
|
||||
@ -39,6 +41,12 @@ public class InterpretationSchemeDTO implements Serializable {
|
||||
@ApiModelProperty(value = "判读方案vaule2,(2)")
|
||||
private Integer ruleValue2;
|
||||
|
||||
@ApiModelProperty(value = "自定义判读方案id")
|
||||
private Long myInterpretationSchemeId;
|
||||
|
||||
@ApiModelProperty(value = "'1 = activate, 0 = inactivate '")
|
||||
private Integer flag;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
@ -30,9 +30,6 @@ public class MyInterpretationSchemeDTO implements Serializable {
|
||||
@ApiModelProperty(value = "自定义判读方案名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3")
|
||||
private String interpretationSchemeIds;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
package com.cnbm.qualityPlanning.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 判读方案 表
|
||||
* </p>
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-08-16
|
||||
* @since 2022-09-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("interpretation_scheme")
|
||||
@ -41,6 +41,12 @@ public class InterpretationScheme implements Serializable {
|
||||
@ApiModelProperty("判读方案vaule2,(2)")
|
||||
private Integer ruleValue2;
|
||||
|
||||
@ApiModelProperty("自定义判读方案id")
|
||||
private Long myInterpretationSchemeId;
|
||||
|
||||
@ApiModelProperty("'1 = activate, 0 = inactivate '")
|
||||
private Integer flag;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
@ -32,9 +32,6 @@ public class MyInterpretationScheme implements Serializable {
|
||||
@ApiModelProperty("自定义判读方案名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3")
|
||||
private String interpretationSchemeIds;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
@ -4,12 +4,15 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 判读方案 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-08-15
|
||||
* @since 2022-09-20
|
||||
*/
|
||||
@Data
|
||||
public class InterpretationSchemeExcel {
|
||||
@ -25,6 +28,10 @@ public class InterpretationSchemeExcel {
|
||||
private Integer ruleValue1;
|
||||
@Excel(name = "判读方案vaule2,(2)")
|
||||
private Integer ruleValue2;
|
||||
@Excel(name = "自定义判读方案id")
|
||||
private Long myInterpretationSchemeId;
|
||||
@Excel(name = "'1 = activate, 0 = inactivate '")
|
||||
private Integer flag;
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
|
||||
|
@ -19,8 +19,6 @@ public class MyInterpretationSchemeExcel {
|
||||
private Integer code;
|
||||
@Excel(name = "自定义判读方案名")
|
||||
private String name;
|
||||
@Excel(name = "判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3")
|
||||
private String interpretationSchemeIds;
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
|
||||
|
@ -6,6 +6,7 @@ import com.cnbm.qualityPlanning.entity.InterpretationScheme;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 判读方案 表
|
||||
@ -18,4 +19,8 @@ public interface InterpretationSchemeMapper extends BaseDao<InterpretationScheme
|
||||
|
||||
List<InterpretationSchemeDTO> list();
|
||||
|
||||
List<InterpretationSchemeDTO> listByMyInterpretationSchemeId(Map<String, Object> params);
|
||||
|
||||
void batchInsert(Long myInterpretationSchemeId);
|
||||
|
||||
}
|
@ -24,7 +24,13 @@ public interface IInterpretationSchemeService extends CrudService<Interpretation
|
||||
|
||||
void update(InterpretationSchemeDTO dto);
|
||||
|
||||
void batchUpdate(InterpretationSchemeDTO[] lists);
|
||||
|
||||
void delete(Long[] ids);
|
||||
|
||||
List<InterpretationSchemeDTO> list();
|
||||
|
||||
List<InterpretationSchemeDTO> listByMyInterpretationSchemeId(Map<String, Object> params);
|
||||
|
||||
void batchInsert(Long myInterpretationSchemeId);
|
||||
}
|
@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import com.cnbm.common.validator.ValidatorUtils;
|
||||
import com.cnbm.common.validator.group.DefaultGroup;
|
||||
import com.cnbm.common.validator.group.UpdateGroup;
|
||||
import com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO;
|
||||
import com.cnbm.qualityPlanning.entity.InterpretationScheme;
|
||||
import com.cnbm.qualityPlanning.mapper.InterpretationSchemeMapper;
|
||||
@ -64,12 +67,48 @@ public class InterpretationSchemeServiceImpl extends CrudServiceImpl<Interpretat
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchInsert(Long myInterpretationSchemeId) {
|
||||
/*
|
||||
List<InterpretationSchemeDTO> lists= new ArrayList<>();
|
||||
lists.add(InterpretationSchemeDTO.builder().code(1).ruleNum(1).ruleKey("规则一:有1点落在三倍标准差以外").myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(2).ruleNum(2).ruleKey("规则二:连续x点落在管制中心线同一侧").ruleValue1(6).myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(3).ruleNum(3).ruleKey("规则三:连续x点持续上升或下降").ruleValue1(6).myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(4).ruleNum(4).ruleKey("规则四:连续x点交替上下跳动").ruleValue1(14).myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(5).ruleNum(5).ruleKey("规则五:连续x点中有x点落在中心线同侧两倍标准差以外").ruleValue1(3).ruleValue2(2).myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(6).ruleNum(6).ruleKey("规则六:连续x点中有x点落在中心线同侧一倍标准差以外").ruleValue1(5).ruleValue2(4).myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(7).ruleNum(7).ruleKey("规则七:连续x点落在中心线两侧的一倍标准差以内").ruleValue1(15).myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(8).ruleNum(8).ruleKey("规则八:连续x点落在中心线两侧但未在一倍标准差以内").ruleValue1(8).myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(9).ruleNum(9).ruleKey("规则九:落在规格线以外").myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
lists.add(InterpretationSchemeDTO.builder().code(10).ruleNum(10).ruleKey("规则十:CPK小于目标值").myInterpretationSchemeId(myInterpretationSchemeId).build());
|
||||
|
||||
for(InterpretationSchemeDTO dto:lists){
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
save(dto);
|
||||
}
|
||||
*/
|
||||
mapper.batchInsert(myInterpretationSchemeId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(InterpretationSchemeDTO dto) {
|
||||
InterpretationScheme entity = ConvertUtils.sourceToTarget(dto, InterpretationScheme.class);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchUpdate(InterpretationSchemeDTO[] lists) {
|
||||
for(InterpretationSchemeDTO dto:lists){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
update(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -84,5 +123,12 @@ public class InterpretationSchemeServiceImpl extends CrudServiceImpl<Interpretat
|
||||
List<InterpretationSchemeDTO> list = mapper.list();
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<InterpretationSchemeDTO> listByMyInterpretationSchemeId(Map<String, Object> params) {
|
||||
List<InterpretationSchemeDTO> listByMyInterpretationSchemeId = mapper.listByMyInterpretationSchemeId(params);
|
||||
return listByMyInterpretationSchemeId;
|
||||
}
|
||||
|
||||
}
|
@ -10,6 +10,7 @@ import com.cnbm.qualityPlanning.entity.MyInterpretationScheme;
|
||||
import com.cnbm.qualityPlanning.mapper.MyInterpretationSchemeMapper;
|
||||
import com.cnbm.qualityPlanning.service.IMyInterpretationSchemeService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -52,11 +53,18 @@ public class MyInterpretationSchemeServiceImpl extends CrudServiceImpl<MyInterpr
|
||||
return ConvertUtils.sourceToTarget(entity, MyInterpretationSchemeDTO.class);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private InterpretationSchemeServiceImpl interpretationSchemeService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(MyInterpretationSchemeDTO dto) {
|
||||
MyInterpretationScheme entity = ConvertUtils.sourceToTarget(dto, MyInterpretationScheme.class);
|
||||
insert(entity);
|
||||
//每新增一条自定义判读方案,同时对应新增十条判读方案
|
||||
interpretationSchemeService.batchInsert(entity.getId());
|
||||
//System.out.println(dto);
|
||||
//System.out.println(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,32 @@
|
||||
|
||||
<select id="list" resultType="com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO">
|
||||
select * from interpretation_scheme
|
||||
order by id asc
|
||||
order by rule_num asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<select id="listByMyInterpretationSchemeId" resultType="com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO">
|
||||
select * from interpretation_scheme
|
||||
<where>
|
||||
valid = 1
|
||||
<if test="myInterpretationSchemeId != null">
|
||||
and my_interpretation_scheme_id=#{myInterpretationSchemeId}
|
||||
</if>
|
||||
</where>
|
||||
order by rule_num asc
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into interpretation_scheme(code,rule_num,rule_key,rule_value1,rule_value2,my_interpretation_scheme_id) values
|
||||
(1,1,'规则一:有1点落在三倍标准差以外',null,null,#{myInterpretationSchemeId}),
|
||||
(2,2,'规则二:连续x点落在管制中心线同一侧',6,null,#{myInterpretationSchemeId}),
|
||||
(3,3,'规则三:连续x点持续上升或下降',6,null,#{myInterpretationSchemeId}),
|
||||
(4,4,'规则四:连续x点交替上下跳动',14,null,#{myInterpretationSchemeId}),
|
||||
(5,5,'规则五:连续x点中有x点落在中心线同侧两倍标准差以外',3,2,#{myInterpretationSchemeId}),
|
||||
(6,6,'规则六:连续x点中有x点落在中心线同侧一倍标准差以外',5,4,#{myInterpretationSchemeId}),
|
||||
(7,7,'规则七:连续x点落在中心线两侧的一倍标准差以内',15,null,#{myInterpretationSchemeId}),
|
||||
(8,8,'规则八:连续x点落在中心线两侧但未在一倍标准差以内',8,null,#{myInterpretationSchemeId}),
|
||||
(9,9,'规则九:落在规格线以外',null,null,#{myInterpretationSchemeId}),
|
||||
(10,10,'规则十:CPK小于目标值',null,null,#{myInterpretationSchemeId})
|
||||
</insert>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user