fix:物料产品管理中的SIP和SOP图片展示顺序和图片和导入功能问题解决
This commit is contained in:
parent
1fc0123e17
commit
f675187f81
@ -76,7 +76,7 @@ public class MdProductSipController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdProductSip mdProductSip)
|
||||
{
|
||||
return toAjax(mdProductSipService.insertMdProductSip(mdProductSip));
|
||||
return mdProductSipService.insertMdProductSip(mdProductSip);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,7 +87,7 @@ public class MdProductSipController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdProductSip mdProductSip)
|
||||
{
|
||||
return toAjax(mdProductSipService.updateMdProductSip(mdProductSip));
|
||||
return mdProductSipService.updateMdProductSip(mdProductSip);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ public class MdProductSopController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdProductSop mdProdutSop)
|
||||
{
|
||||
return toAjax(mdProductSopService.insertMdProductSop(mdProdutSop));
|
||||
return mdProductSopService.insertMdProductSop(mdProdutSop);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,7 +87,7 @@ public class MdProductSopController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdProductSop mdProdutSop)
|
||||
{
|
||||
return toAjax(mdProductSopService.updateMdProductSop(mdProdutSop));
|
||||
return mdProductSopService.updateMdProductSop(mdProdutSop);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.mes.md.domain.MdProductSip;
|
||||
|
||||
/**
|
||||
@ -29,19 +31,19 @@ public interface IMdProductSipService
|
||||
|
||||
/**
|
||||
* 新增产品SIP
|
||||
*
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdProductSip(MdProductSip mdProductSip);
|
||||
public AjaxResult insertMdProductSip(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 修改产品SIP
|
||||
*
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdProductSip(MdProductSip mdProductSip);
|
||||
public AjaxResult updateMdProductSip(MdProductSip mdProductSip);
|
||||
|
||||
/**
|
||||
* 批量删除产品SIP
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.mes.md.domain.MdProductSop;
|
||||
|
||||
/**
|
||||
@ -29,19 +31,19 @@ public interface IMdProductSopService
|
||||
|
||||
/**
|
||||
* 新增产品SOP
|
||||
*
|
||||
*
|
||||
* @param mdProdutSop 产品SOP
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdProductSop(MdProductSop mdProductSop);
|
||||
public AjaxResult insertMdProductSop(MdProductSop mdProductSop);
|
||||
|
||||
/**
|
||||
* 修改产品SOP
|
||||
*
|
||||
*
|
||||
* @param mdProdutSop 产品SOP
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdProductSop(MdProductSop mdProductSop);
|
||||
public AjaxResult updateMdProductSop(MdProductSop mdProductSop);
|
||||
|
||||
/**
|
||||
* 批量删除产品SOP
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ktg.common.core.domain.entity.ItemType;
|
||||
import com.ktg.common.exception.ServiceException;
|
||||
import com.ktg.common.utils.bean.BeanValidators;
|
||||
@ -65,6 +66,21 @@ public class MdItemServiceImpl implements IMdItemService {
|
||||
for (MdItem item : itemList)
|
||||
{
|
||||
try{
|
||||
if (ObjectUtil.isEmpty(item.getItemCode())) {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、物料/产品 " + item.getItemName() + " 缺少必填项");
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(item.getItemName())) {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、物料/产品 " + item.getItemName() + " 缺少必填项");
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(item.getUnitOfMeasure())) {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、物料/产品 " + item.getItemName() + " 缺少必填项");
|
||||
continue;
|
||||
}
|
||||
//物料分类是否正确
|
||||
if(StringUtils.isNotNull(item.getItemTypeName())){
|
||||
List<ItemType> types = itemTypeMapper.selectItemTypeByName(item.getItemTypeName());
|
||||
|
@ -1,6 +1,10 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -41,33 +45,53 @@ public class MdProductSipServiceImpl implements IMdProductSipService
|
||||
@Override
|
||||
public List<MdProductSip> selectMdProductSipList(MdProductSip mdProductSip)
|
||||
{
|
||||
return mdProductSipMapper.selectMdProductSipList(mdProductSip);
|
||||
List<MdProductSip> mdProductSips = mdProductSipMapper.selectMdProductSipList(mdProductSip);
|
||||
List<MdProductSip> collect = mdProductSips.stream().sorted(Comparator.comparing(MdProductSip::getOrderNum)).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品SIP
|
||||
*
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdProductSip(MdProductSip mdProductSip)
|
||||
public AjaxResult insertMdProductSip(MdProductSip mdProductSip)
|
||||
{
|
||||
// 查询当前物料下所有的SIP
|
||||
MdProductSip parame = new MdProductSip();
|
||||
parame.setItemId(mdProductSip.getItemId());
|
||||
List<MdProductSip> list = mdProductSipMapper.selectMdProductSipList(parame);
|
||||
for (MdProductSip item : list) {
|
||||
if (item.getOrderNum() == mdProductSip.getOrderNum()) {
|
||||
return AjaxResult.error("展示序号已存在");
|
||||
}
|
||||
}
|
||||
mdProductSip.setCreateTime(DateUtils.getNowDate());
|
||||
return mdProductSipMapper.insertMdProductSip(mdProductSip);
|
||||
return AjaxResult.success(mdProductSipMapper.insertMdProductSip(mdProductSip));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品SIP
|
||||
*
|
||||
*
|
||||
* @param mdProductSip 产品SIP
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdProductSip(MdProductSip mdProductSip)
|
||||
public AjaxResult updateMdProductSip(MdProductSip mdProductSip)
|
||||
{
|
||||
// 查询当前物料下所有的SIP
|
||||
MdProductSip parame = new MdProductSip();
|
||||
parame.setItemId(mdProductSip.getItemId());
|
||||
List<MdProductSip> list = mdProductSipMapper.selectMdProductSipList(parame);
|
||||
for (MdProductSip item : list) {
|
||||
if (item.getOrderNum() == mdProductSip.getOrderNum()) {
|
||||
return AjaxResult.error("展示序号已存在");
|
||||
}
|
||||
}
|
||||
mdProductSip.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdProductSipMapper.updateMdProductSip(mdProductSip);
|
||||
return AjaxResult.success(mdProductSipMapper.updateMdProductSip(mdProductSip));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,12 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.mes.md.domain.MdProductSip;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.md.mapper.MdProductSopMapper;
|
||||
@ -41,33 +46,53 @@ public class MdProductSopServiceImpl implements IMdProductSopService
|
||||
@Override
|
||||
public List<MdProductSop> selectMdProductSopList(MdProductSop mdProdutSop)
|
||||
{
|
||||
return mdProductSopMapper.selectMdProductSopList(mdProdutSop);
|
||||
List<MdProductSop> mdProductSops = mdProductSopMapper.selectMdProductSopList(mdProdutSop);
|
||||
List<MdProductSop> collect = mdProductSops.stream().sorted(Comparator.comparing(MdProductSop::getOrderNum)).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品SOP
|
||||
*
|
||||
*
|
||||
* @param mdProdutSop 产品SOP
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdProductSop(MdProductSop mdProdutSop)
|
||||
public AjaxResult insertMdProductSop(MdProductSop mdProdutSop)
|
||||
{
|
||||
// 查询当前物料下所有的SOP
|
||||
MdProductSop parame = new MdProductSop();
|
||||
parame.setItemId(mdProdutSop.getItemId());
|
||||
List<MdProductSop> list = mdProductSopMapper.selectMdProductSopList(mdProdutSop);
|
||||
for (MdProductSop item : list) {
|
||||
if (item.getOrderNum() == mdProdutSop.getOrderNum()) {
|
||||
return AjaxResult.error("展示序号已存在");
|
||||
}
|
||||
}
|
||||
mdProdutSop.setCreateTime(DateUtils.getNowDate());
|
||||
return mdProductSopMapper.insertMdProductSop(mdProdutSop);
|
||||
return AjaxResult.success(mdProductSopMapper.insertMdProductSop(mdProdutSop));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品SOP
|
||||
*
|
||||
*
|
||||
* @param mdProdutSop 产品SOP
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdProductSop(MdProductSop mdProdutSop)
|
||||
public AjaxResult updateMdProductSop(MdProductSop mdProdutSop)
|
||||
{
|
||||
// 查询当前物料下所有的SOP
|
||||
MdProductSop parame = new MdProductSop();
|
||||
parame.setItemId(mdProdutSop.getItemId());
|
||||
List<MdProductSop> list = mdProductSopMapper.selectMdProductSopList(mdProdutSop);
|
||||
for (MdProductSop item : list) {
|
||||
if (item.getOrderNum() == mdProdutSop.getOrderNum()) {
|
||||
return AjaxResult.error("展示序号已存在");
|
||||
}
|
||||
}
|
||||
mdProdutSop.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdProductSopMapper.updateMdProductSop(mdProdutSop);
|
||||
return AjaxResult.success(mdProductSopMapper.updateMdProductSop(mdProdutSop));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,15 +84,21 @@
|
||||
where item_type_name=#{itemTypeName} and parent_type_id = #{parentTypeId} limit 1
|
||||
</select>
|
||||
|
||||
<!-- <select id="selectItemTypeByName" parameterType="String" resultMap="ItemTypeResult">-->
|
||||
<!-- select *-->
|
||||
<!-- from (-->
|
||||
<!-- select CONCAT((select group_concat(item_type_name separator '/')-->
|
||||
<!-- from md_item_type b-->
|
||||
<!-- where FIND_IN_SET(CAST(item_type_id as CHAR),a.ancestors)>0),'/',a.item_type_name) as fullType,a.*-->
|
||||
<!-- from md_item_type a-->
|
||||
<!-- ) t-->
|
||||
<!-- where fullType = #{itemTypeName} or t.item_type_name = #{itemTypeName}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectItemTypeByName" parameterType="String" resultMap="ItemTypeResult">
|
||||
select *
|
||||
from (
|
||||
select CONCAT((select group_concat(item_type_name separator '/')
|
||||
from md_item_type b
|
||||
where FIND_IN_SET(CAST(item_type_id as CHAR),a.ancestors)>0),'/',a.item_type_name) as fullType,a.*
|
||||
from md_item_type a
|
||||
) t
|
||||
where fullType = #{itemTypeName} or t.item_type_name = #{itemTypeName}
|
||||
from md_item_type
|
||||
where item_type_name = #{itemTypeName}
|
||||
</select>
|
||||
|
||||
<select id="checkItemTypeCodeUnique" resultMap="ItemTypeResult">
|
||||
|
Loading…
Reference in New Issue
Block a user