物料检验项目维护修复

highway
shaoyong 1 year ago
parent f60d6559f9
commit 7329c54eab

@ -98,7 +98,7 @@ public class QcMaterialGroupController extends BaseController {
*/
@RequiresPermissions("quality:materialGroup:remove")
@Log(title = "物料组", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable String id) {
QcMaterialGroup parent = new QcMaterialGroup();
parent.setId(id);

@ -92,7 +92,7 @@ public class QcMaterialGroupDetailController extends BaseController {
*/
@RequiresPermissions("quality:materialGroupDetail:remove")
@Log(title = "物料组成员", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable String id) {
QcMaterialGroupDetail groupDetail = qcMaterialGroupDetailService.selectQcMaterialGroupDetailById(id);
boolean hasRule = qcMaterialGroupDetailService.validationData(groupDetail.getMaterialCode());

@ -56,6 +56,8 @@ public class QcCheckProject extends BaseEntity {
/** 删除标识1删除0正常 */
private String delFlag;
private Long serialNumber;
public void setId(String id) {
this.id = id;
}
@ -134,6 +136,14 @@ public class QcCheckProject extends BaseEntity {
return delFlag;
}
public Long getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(Long serialNumber) {
this.serialNumber = serialNumber;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -72,6 +72,8 @@ public class QcCheckTypeProject extends BaseEntity {
private Integer sort;
private String projectNo;
public Integer getSort() {
return sort;
}
@ -191,11 +193,18 @@ public class QcCheckTypeProject extends BaseEntity {
public String getPropertyCode() {
return propertyCode;
}
public void setPropertyCode(String propertyCode) {
this.propertyCode = propertyCode;
}
public String getProjectNo() {
return projectNo;
}
public void setProjectNo(String projectNo) {
this.projectNo = projectNo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -60,4 +60,6 @@ public interface QcCheckProjectMapper {
* @return
*/
public int deleteQcCheckProjectByIds(String[] ids);
public QcCheckProject selectSerialNumber();
}

@ -63,6 +63,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
public int insertQcCheckProject(QcCheckProject qcCheckProject) {
if (StringUtils.isNotBlank(qcCheckProject.getRuleName())){
qcCheckProject.setId(IdUtils.fastSimpleUUID());
qcCheckProject.setOrderNum(getOrderNum());
qcCheckProject.setCreateBy(SecurityUtils.getUsername());
qcCheckProject.setCreateTime(DateUtils.getNowDate());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
@ -111,4 +112,13 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
public int deleteQcCheckProjectById(String id) {
return qcCheckProjectMapper.deleteQcCheckProjectById(id);
}
private String getOrderNum() {
String orderNum = "";
String now = DateUtils.getDate();
now = now.replace("-","");
QcCheckProject checkProject = qcCheckProjectMapper.selectSerialNumber();
orderNum = now + "0" + checkProject.getSerialNumber();
return orderNum;
}
}

@ -6,7 +6,6 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import org.apache.catalina.security.SecurityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcCheckTypeProjectMapper;

@ -107,6 +107,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
}
@Override
@DS("#header.poolName")
public boolean validationData(String materialCode) {
return qcMaterialGroupDetailMapper.validationData(materialCode).size() > 0;
}

@ -174,6 +174,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
}
@Override
@DS("#header.poolName")
public boolean validationData(String id) {
return qcMaterialGroupMapper.validationData(id).size() > 0;
}

@ -30,6 +30,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
private QcUserMaterialMapper qcUserMaterialMapper;
@Override
@DS("#header.poolName")
public List<QcUserMaterial> selectUserList(QcUserMaterial qcUserMaterial) {
return qcUserMaterialMapper.selectUserList( qcUserMaterial);
}

@ -116,4 +116,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectSerialNumber" resultType="com.op.quality.domain.QcCheckProject">
SELECT COUNT(id)+1 AS serialNumber
FROM qc_check_project
WHERE del_flag = '0'
</select>
</mapper>

@ -156,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupId != null">group_id,</if>
<if test="materialCode != null">material_code,</if>
<if test="sampleNum != null">sample_num</if>
<if test="projectNo != null">project_no</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -175,7 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">#{delFlag},</if>
<if test="groupId != null">#{groupId},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="sampleNum != null">#{sampleNum}</if>
<if test="projectNo != null">#{projectNo}</if>
</trim>
</insert>
@ -199,6 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupId != null">group_id = #{groupId},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="sampleNum != null">sample_num = #{sampleNum}</if>
<if test="projectNo != null">project_no = #{projectNo}</if>
</trim>
where id = #{id}
</update>

@ -102,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="validationData" parameterType="String">
<select id="validationData" parameterType="String" resultMap="QcMaterialGroupDetailResult">
select
id,
create_by,

@ -107,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="validationData" parameterType="String">
<select id="validationData" parameterType="String" resultMap="QcMaterialGroupResult">
select
id,
create_by,

Loading…
Cancel
Save