质量计划
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user