|
@@ -73,6 +73,7 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
|
|
if ((m != null && m.getId() == mould.getId()) || m == null) {
|
|
if ((m != null && m.getId() == mould.getId()) || m == null) {
|
|
if (mould.getProduceCompanyId() != null) {
|
|
if (mould.getProduceCompanyId() != null) {
|
|
Company company = companyMapper.selectById(mould.getProduceCompanyId());
|
|
Company company = companyMapper.selectById(mould.getProduceCompanyId());
|
|
|
|
+ mould.setProduceCompanyName(company.getCompanyName());
|
|
mould.setArea(company.getCompanyAddress());
|
|
mould.setArea(company.getCompanyAddress());
|
|
}
|
|
}
|
|
mouldMapper.updateById(mould);
|
|
mouldMapper.updateById(mould);
|
|
@@ -84,6 +85,9 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
|
|
//更新模具操作
|
|
//更新模具操作
|
|
//取出之前模具的信息
|
|
//取出之前模具的信息
|
|
Mould model = mouldMapper.selectById(mould.getPreUpdateId());
|
|
Mould model = mouldMapper.selectById(mould.getPreUpdateId());
|
|
|
|
+ model.setProjectId(null);
|
|
|
|
+ model.setEquipmentId(null);
|
|
|
|
+ mouldMapper.updateById(model);
|
|
//查询当前模具编号的模具是否存在
|
|
//查询当前模具编号的模具是否存在
|
|
Integer count = mouldMapper.selectCount(new QueryWrapper<Mould>().eq("model_no", mould.getModelNo()));
|
|
Integer count = mouldMapper.selectCount(new QueryWrapper<Mould>().eq("model_no", mould.getModelNo()));
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
@@ -92,15 +96,18 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
|
|
} else {
|
|
} else {
|
|
if (mould.getProduceCompanyId() != null) {
|
|
if (mould.getProduceCompanyId() != null) {
|
|
Company company = companyMapper.selectById(mould.getProduceCompanyId());
|
|
Company company = companyMapper.selectById(mould.getProduceCompanyId());
|
|
|
|
+ mould.setProduceCompanyName(company.getCompanyName());
|
|
mould.setArea(company.getCompanyAddress());
|
|
mould.setArea(company.getCompanyAddress());
|
|
}
|
|
}
|
|
mould.setCreatorId(user.getId());
|
|
mould.setCreatorId(user.getId());
|
|
mould.setCompanyId(user.getCompanyId());
|
|
mould.setCompanyId(user.getCompanyId());
|
|
mould.setEquipmentId(model.getEquipmentId());
|
|
mould.setEquipmentId(model.getEquipmentId());
|
|
mould.setProjectId(model.getProjectId());
|
|
mould.setProjectId(model.getProjectId());
|
|
|
|
+ mould.setRunTimes(model.getRunTimes());
|
|
mouldMapper.insert(mould);
|
|
mouldMapper.insert(mould);
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
|
|
+ //普通创建模具
|
|
//查询当前模具编号的模具是否存在
|
|
//查询当前模具编号的模具是否存在
|
|
Integer count = mouldMapper.selectCount(new QueryWrapper<Mould>().eq("model_no", mould.getModelNo()));
|
|
Integer count = mouldMapper.selectCount(new QueryWrapper<Mould>().eq("model_no", mould.getModelNo()));
|
|
if (count > 0) {
|
|
if (count > 0) {
|