'20240311'
This commit is contained in:
parent
80ebfe6bf0
commit
b167b18527
|
@ -83,7 +83,7 @@ public class CYlMaterialController extends BaseController
|
||||||
{
|
{
|
||||||
if (!cYlMaterialService.checkMaterialNoUnique(cYlMaterial))
|
if (!cYlMaterialService.checkMaterialNoUnique(cYlMaterial))
|
||||||
{
|
{
|
||||||
return error("新增材料'" + cYlMaterial.getMaterialNo() + "'失败,编码已存在");
|
return error("添加材料失败,编码:'" + cYlMaterial.getMaterialNo() + "' 已存在");
|
||||||
}
|
}
|
||||||
return toAjax(cYlMaterialService.insertCYlMaterial(cYlMaterial));
|
return toAjax(cYlMaterialService.insertCYlMaterial(cYlMaterial));
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class CFactoryController extends BaseController
|
||||||
{
|
{
|
||||||
if (!cFactoryService.checkFactoryNoUnique(cFactory))
|
if (!cFactoryService.checkFactoryNoUnique(cFactory))
|
||||||
{
|
{
|
||||||
return error("新增车间'" + cFactory.getFactoryNo() + "'失败,编码已存在");
|
return error("添加车间失败,编码:'" + cFactory.getFactoryNo() + "' 已存在");
|
||||||
}
|
}
|
||||||
return toAjax(cFactoryService.insertCFactory(cFactory));
|
return toAjax(cFactoryService.insertCFactory(cFactory));
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,11 @@ public class CMaterialTypeController extends BaseController
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody CMaterialType cMaterialType)
|
public AjaxResult add(@RequestBody CMaterialType cMaterialType)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!cMaterialTypeService.checkTypeNoUnique(cMaterialType))
|
||||||
|
{
|
||||||
|
return error("添加物料类型失败,编码:'" + cMaterialType.getTypeNo() + "' 已存在");
|
||||||
|
}
|
||||||
return toAjax(cMaterialTypeService.insertCMaterialType(cMaterialType));
|
return toAjax(cMaterialTypeService.insertCMaterialType(cMaterialType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,4 +58,11 @@ public interface CMaterialTypeMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCMaterialTypeByTypeIds(Long[] typeIds);
|
public int deleteCMaterialTypeByTypeIds(Long[] typeIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查物料编码是否存在
|
||||||
|
* @param typeNo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CMaterialType checkTypeNoUnique(String typeNo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,11 @@ public interface ICMaterialTypeService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCMaterialTypeByTypeId(Long typeId);
|
public int deleteCMaterialTypeByTypeId(Long typeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查物料编码是否存在
|
||||||
|
* @param cMaterialType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean checkTypeNoUnique(CMaterialType cMaterialType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
package com.ruoyi.materialType.service.impl;
|
package com.ruoyi.materialType.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.materialType.mapper.CMaterialTypeMapper;
|
import com.ruoyi.materialType.mapper.CMaterialTypeMapper;
|
||||||
|
@ -90,4 +94,20 @@ public class CMaterialTypeServiceImpl implements ICMaterialTypeService
|
||||||
{
|
{
|
||||||
return cMaterialTypeMapper.deleteCMaterialTypeByTypeId(typeId);
|
return cMaterialTypeMapper.deleteCMaterialTypeByTypeId(typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查物料编码是否存在
|
||||||
|
* @param cMaterialType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkTypeNoUnique(CMaterialType cMaterialType) {
|
||||||
|
Long typeId = StringUtils.isNull(cMaterialType.getTypeId()) ? -1L : cMaterialType.getTypeId();
|
||||||
|
CMaterialType info = cMaterialTypeMapper.checkTypeNoUnique(cMaterialType.getTypeNo());
|
||||||
|
if (StringUtils.isNotNull(info) && info.getTypeId().longValue() != typeId.longValue())
|
||||||
|
{
|
||||||
|
return UserConstants.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.UNIQUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="checkMaterialNoUnique" parameterType="String" resultMap="CYlMaterialResult">
|
<select id="checkMaterialNoUnique" parameterType="String" resultMap="CYlMaterialResult">
|
||||||
select top(1) material_id, material_no from c_yl_material where material_no = #{materialNo}
|
select top(1) material_id, material_no from c_yl_material where material_no = #{materialNo} and material_state = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBjData" resultType="CYlMaterial">
|
<select id="getBjData" resultType="CYlMaterial">
|
||||||
|
|
|
@ -64,4 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{typeId}
|
#{typeId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="checkTypeNoUnique" parameterType="String" resultMap="CMaterialTypeResult">
|
||||||
|
select top(1) type_id, type_no from c_material_type where type_no = #{typeNo} and type_state = '0'
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -241,7 +241,7 @@ export default {
|
||||||
materialNo: null,
|
materialNo: null,
|
||||||
materialName: null,
|
materialName: null,
|
||||||
materialPrice: null,
|
materialPrice: null,
|
||||||
materialState: "0"
|
materialState: '0'
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -267,6 +267,7 @@ export default {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加材料管理";
|
this.title = "添加材料管理";
|
||||||
this.isDis = false;
|
this.isDis = false;
|
||||||
|
this.materialState = '0'
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|
|
@ -376,7 +376,7 @@ export default {
|
||||||
materialGuig: null,
|
materialGuig: null,
|
||||||
materialDiany: null,
|
materialDiany: null,
|
||||||
materialDw: null,
|
materialDw: null,
|
||||||
materialState: 0
|
materialState: '0'
|
||||||
};
|
};
|
||||||
this.cMaterialCostList = [];
|
this.cMaterialCostList = [];
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
|
@ -402,6 +402,7 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加物料管理";
|
this.title = "添加物料管理";
|
||||||
|
this.materialState = '0';
|
||||||
this.getClMaterials();
|
this.getClMaterials();
|
||||||
this.getMaterialType();
|
this.getMaterialType();
|
||||||
},
|
},
|
||||||
|
|
|
@ -218,7 +218,8 @@ export default {
|
||||||
typeId: null,
|
typeId: null,
|
||||||
typeNo: null,
|
typeNo: null,
|
||||||
typeName: null,
|
typeName: null,
|
||||||
factoryId: null
|
factoryId: null,
|
||||||
|
typeState: '0'
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -244,6 +245,7 @@ export default {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加物料类别";
|
this.title = "添加物料类别";
|
||||||
this.isDis = false;
|
this.isDis = false;
|
||||||
|
this.form.typeState = '0';
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|
Loading…
Reference in New Issue