质量cpk配置
parent
3460f4ec24
commit
040ffed149
@ -0,0 +1,111 @@
|
||||
package com.op.quality.controller;
|
||||
|
||||
import java.security.Security;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import com.op.quality.domain.QcProductCpkUpdown;
|
||||
import com.op.quality.service.IQcProductCpkUpdownService;
|
||||
import org.apache.catalina.security.SecurityUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* CPK上下限维护Controller
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-09-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cpkUpdown")
|
||||
public class QcProductCpkUpdownController extends BaseController {
|
||||
@Autowired
|
||||
private IQcProductCpkUpdownService qcProductCpkUpdownService;
|
||||
|
||||
/**
|
||||
* 查询CPK上下限维护列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
startPage();
|
||||
List<QcProductCpkUpdown> list = qcProductCpkUpdownService.selectQcProductCpkUpdownList(qcProductCpkUpdown);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出CPK上下限维护列表
|
||||
*/
|
||||
@Log(title = "CPK上下限维护", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
List<QcProductCpkUpdown> list = qcProductCpkUpdownService.selectQcProductCpkUpdownList(qcProductCpkUpdown);
|
||||
ExcelUtil<QcProductCpkUpdown> util = new ExcelUtil<QcProductCpkUpdown>(QcProductCpkUpdown. class);
|
||||
util.exportExcel(response, list, "CPK上下限维护数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPK上下限维护详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(qcProductCpkUpdownService.selectQcProductCpkUpdownById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增CPK上下限维护
|
||||
*/
|
||||
@RequiresPermissions("quality:cpkUpDowConfig:add")
|
||||
@Log(title = "CPK上下限维护", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
qcProductCpkUpdown.setId(IdUtils.fastSimpleUUID());
|
||||
qcProductCpkUpdown.setCreateBy(SecurityUtils.getUsername());
|
||||
qcProductCpkUpdown.setCreateTime(DateUtils.getNowDate());
|
||||
QcProductCpkUpdown exsit = qcProductCpkUpdownService.checkCpkUpdown(qcProductCpkUpdown);
|
||||
if(exsit!=null){
|
||||
return AjaxResult.error("数据已存在");
|
||||
}
|
||||
|
||||
return toAjax(qcProductCpkUpdownService.insertQcProductCpkUpdown(qcProductCpkUpdown));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CPK上下限维护
|
||||
*/
|
||||
@RequiresPermissions("quality:cpkUpDowConfig:edit")
|
||||
@Log(title = "CPK上下限维护", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
qcProductCpkUpdown.setUpdateBy(SecurityUtils.getUsername());
|
||||
qcProductCpkUpdown.setUpdateTime(DateUtils.getNowDate());
|
||||
return toAjax(qcProductCpkUpdownService.updateQcProductCpkUpdown(qcProductCpkUpdown));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除CPK上下限维护
|
||||
*/
|
||||
@RequiresPermissions("quality:cpkUpDowConfig:remove")
|
||||
@Log(title = "CPK上下限维护", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(qcProductCpkUpdownService.deleteQcProductCpkUpdownByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.op.quality.mapper;
|
||||
|
||||
import com.op.quality.domain.QcProductCpkUpdown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 检验节点维护Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-09-12
|
||||
*/
|
||||
public interface QcProductCpkUpdownMapper {
|
||||
/**
|
||||
* 查询检验节点维护
|
||||
*
|
||||
* @param id 检验节点维护主键
|
||||
* @return 检验节点维护
|
||||
*/
|
||||
public QcProductCpkUpdown selectQcProductCpkUpdownById(String id);
|
||||
|
||||
/**
|
||||
* 查询检验节点维护列表
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 检验节点维护集合
|
||||
*/
|
||||
public List<QcProductCpkUpdown> selectQcProductCpkUpdownList(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
|
||||
/**
|
||||
* 新增检验节点维护
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcProductCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
|
||||
/**
|
||||
* 修改检验节点维护
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcProductCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
|
||||
/**
|
||||
* 删除检验节点维护
|
||||
*
|
||||
* @param id 检验节点维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcProductCpkUpdownById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除检验节点维护
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcProductCpkUpdownByIds(String[] ids);
|
||||
|
||||
QcProductCpkUpdown checkCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.op.quality.service;
|
||||
|
||||
import com.op.quality.domain.QcProductCpkUpdown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 检验节点维护Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-09-12
|
||||
*/
|
||||
public interface IQcProductCpkUpdownService {
|
||||
/**
|
||||
* 查询检验节点维护
|
||||
*
|
||||
* @param id 检验节点维护主键
|
||||
* @return 检验节点维护
|
||||
*/
|
||||
public QcProductCpkUpdown selectQcProductCpkUpdownById(String id);
|
||||
|
||||
/**
|
||||
* 查询检验节点维护列表
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 检验节点维护集合
|
||||
*/
|
||||
public List<QcProductCpkUpdown> selectQcProductCpkUpdownList(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
|
||||
/**
|
||||
* 新增检验节点维护
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcProductCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
|
||||
/**
|
||||
* 修改检验节点维护
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcProductCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
|
||||
/**
|
||||
* 批量删除检验节点维护
|
||||
*
|
||||
* @param ids 需要删除的检验节点维护主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcProductCpkUpdownByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除检验节点维护信息
|
||||
*
|
||||
* @param id 检验节点维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcProductCpkUpdownById(String id);
|
||||
|
||||
QcProductCpkUpdown checkCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown);
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.op.quality.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.quality.domain.QcProductCpkUpdown;
|
||||
import com.op.quality.mapper.QcProductCpkUpdownMapper;
|
||||
import com.op.quality.service.IQcProductCpkUpdownService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 检验节点维护Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-09-12
|
||||
*/
|
||||
@Service
|
||||
public class QcProductCpkUpdownServiceImpl implements IQcProductCpkUpdownService {
|
||||
@Autowired
|
||||
private QcProductCpkUpdownMapper qcProductCpkUpdownMapper;
|
||||
|
||||
/**
|
||||
* 查询检验节点维护
|
||||
*
|
||||
* @param id 检验节点维护主键
|
||||
* @return 检验节点维护
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public QcProductCpkUpdown selectQcProductCpkUpdownById(String id) {
|
||||
return qcProductCpkUpdownMapper.selectQcProductCpkUpdownById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检验节点维护列表
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 检验节点维护
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcProductCpkUpdown> selectQcProductCpkUpdownList(QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
return qcProductCpkUpdownMapper.selectQcProductCpkUpdownList(qcProductCpkUpdown);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增检验节点维护
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertQcProductCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
qcProductCpkUpdown.setCreateTime(DateUtils.getNowDate());
|
||||
return qcProductCpkUpdownMapper.insertQcProductCpkUpdown(qcProductCpkUpdown);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改检验节点维护
|
||||
*
|
||||
* @param qcProductCpkUpdown 检验节点维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateQcProductCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
qcProductCpkUpdown.setUpdateTime(DateUtils.getNowDate());
|
||||
return qcProductCpkUpdownMapper.updateQcProductCpkUpdown(qcProductCpkUpdown);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除检验节点维护
|
||||
*
|
||||
* @param ids 需要删除的检验节点维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcProductCpkUpdownByIds(String[] ids) {
|
||||
return qcProductCpkUpdownMapper.deleteQcProductCpkUpdownByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检验节点维护信息
|
||||
*
|
||||
* @param id 检验节点维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcProductCpkUpdownById(String id) {
|
||||
return qcProductCpkUpdownMapper.deleteQcProductCpkUpdownById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public QcProductCpkUpdown checkCpkUpdown(QcProductCpkUpdown qcProductCpkUpdown) {
|
||||
return qcProductCpkUpdownMapper.checkCpkUpdown(qcProductCpkUpdown);
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
<?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.op.quality.mapper.QcProductCpkUpdownMapper">
|
||||
|
||||
<resultMap type="QcProductCpkUpdown" id="QcProductCpkUpdownResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="typeCode" column="type_code"/>
|
||||
<result property="checkType" column="check_type"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="factoryCode" column="factory_code"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="materialCode" column="material_code"/>
|
||||
<result property="materialName" column="material_name"/>
|
||||
<result property="upVal" column="up_val"/>
|
||||
<result property="downVal" column="down_val"/>
|
||||
<result property="ruleCode" column="rule_code"/>
|
||||
<result property="ruleName" column="rule_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQcProductCpkUpdownVo">
|
||||
select id, type_code, check_type, create_by, create_time, update_by, update_time,
|
||||
factory_code, del_flag, material_code, material_name, up_val, down_val,
|
||||
rule_code,rule_name
|
||||
from qc_product_cpk_updown
|
||||
</sql>
|
||||
|
||||
<select id="selectQcProductCpkUpdownList" parameterType="QcProductCpkUpdown" resultMap="QcProductCpkUpdownResult">
|
||||
select qpcu.id, qpcu.type_code, qpcu.create_by,
|
||||
qpcu.create_time, qpcu.update_by, qpcu.update_time,
|
||||
qpcu.material_code, qpcu.material_name, qpcu.up_val, qpcu.down_val,
|
||||
qpcu.rule_code,qpcu.rule_name,qct.check_name check_type
|
||||
from qc_product_cpk_updown qpcu
|
||||
left join qc_check_type qct on qct.order_code = qpcu.check_type
|
||||
<where>
|
||||
<if test="typeCode != null and typeCode != ''">
|
||||
and qpcu.type_code = #{typeCode}
|
||||
</if>
|
||||
<if test="checkType != null and checkType != ''">
|
||||
and qpcu.check_type = #{checkType}
|
||||
</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">
|
||||
and qpcu.factory_code = #{factoryCode}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and qpcu.material_code like concat('%', #{materialCode}, '%')
|
||||
</if>
|
||||
<if test="materialName != null and materialName != ''">
|
||||
and qpcu.material_name like concat('%', #{materialName}, '%')
|
||||
</if>
|
||||
<if test="upVal != null ">
|
||||
and qpcu.up_val = #{upVal}
|
||||
</if>
|
||||
<if test="downVal != null ">
|
||||
and qpcu.down_val = #{downVal}
|
||||
</if>
|
||||
<if test="ruleCode != null ">
|
||||
and qpcu.rule_code like concat('%', #{ruleCode}, '%')
|
||||
</if>
|
||||
<if test="ruleName != null ">
|
||||
and qpcu.rule_name like concat('%', #{ruleName}, '%')
|
||||
</if>
|
||||
and qpcu.del_flag = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQcProductCpkUpdownById" parameterType="String"
|
||||
resultMap="QcProductCpkUpdownResult">
|
||||
<include refid="selectQcProductCpkUpdownVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="checkCpkUpdown" resultType="com.op.quality.domain.QcProductCpkUpdown">
|
||||
select top 1 type_code typeCode, check_type checkType,
|
||||
material_code materialCode, material_name materialName,
|
||||
rule_code ruleCode,rule_name ruleName
|
||||
from qc_product_cpk_updown
|
||||
where check_type = #{checkType}
|
||||
and material_code = #{materialCode}
|
||||
and rule_code = #{ruleCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertQcProductCpkUpdown" parameterType="QcProductCpkUpdown">
|
||||
insert into qc_product_cpk_updown
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="typeCode != null">type_code,</if>
|
||||
<if test="checkType != null">check_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="materialCode != null">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="upVal != null">up_val,</if>
|
||||
<if test="downVal != null">down_val,</if>
|
||||
<if test="ruleCode != null">rule_code,</if>
|
||||
<if test="ruleName != null">rule_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="typeCode != null">#{typeCode},</if>
|
||||
<if test="checkType != null">#{checkType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">#{factoryCode}, </if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="materialCode != null">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="upVal != null">#{upVal},</if>
|
||||
<if test="downVal != null">#{downVal},</if>
|
||||
<if test="ruleCode != null">#{ruleCode},</if>
|
||||
<if test="ruleName != null">#{ruleName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateQcProductCpkUpdown" parameterType="QcProductCpkUpdown">
|
||||
update qc_product_cpk_updown
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="typeCode != null">type_code =#{typeCode},</if>
|
||||
<if test="checkType != null">check_type = #{checkType},</if>
|
||||
<if test="updateBy != null">update_by =#{updateBy},</if>
|
||||
<if test="updateTime != null">update_time =#{updateTime}, </if>
|
||||
<if test="delFlag != null">del_flag =#{delFlag},</if>
|
||||
<if test="materialCode != null">material_code =#{materialCode},</if>
|
||||
<if test="materialName != null">material_name =#{materialName},</if>
|
||||
<if test="upVal != null">up_val =#{upVal},</if>
|
||||
<if test="downVal != null">down_val =#{downVal},</if>
|
||||
<if test="ruleCode != null">rule_code =#{ruleCode},</if>
|
||||
<if test="ruleName != null">rule_name = #{ruleName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQcProductCpkUpdownById" parameterType="String">
|
||||
update qc_product_cpk_updown set del_flag = '1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQcProductCpkUpdownByIds" parameterType="String">
|
||||
update qc_product_cpk_updown set del_flag = '1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue