Merge remote-tracking branch 'origin/master'

master
philip 3 years ago
commit bf1ba1d3b6

@ -99,4 +99,12 @@ public class ItemController {
return R.ok(itemService.selectById(itemBo));
}
/**
*
*/
@GetMapping("/findMapByItemBo")
public R findMapByItemBo(String itemBo){
return R.ok(itemService.findMapByItemBo(itemBo));
}
}

@ -87,6 +87,8 @@ public class ShopOrderController {
public R findByShopOrderBo(String shopOrder){
return R.ok(shopOrderService.findByShopOrderBo(shopOrder));
}
}

@ -3,13 +3,12 @@ package com.foreverwin.mesnac.meapi.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.meapi.model.Item;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -31,4 +30,6 @@ public interface ItemMapper extends BaseMapper<Item> {
Item selectById(@Param("locale") String locale, @Param("handle") String handle);
List<Item> selectListByCriteria(@Param("locale") String locale, @Param("ew") Wrapper<Item> wrapper);
Map<String,Object> findMapByItem(@Param("itemBo")String itemBo);
}

@ -7,8 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.model.Item;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -37,5 +37,7 @@ public interface ItemService extends IService<Item> {
Item selectCurrent(String site, String item);
Map<String,Object> findMapByItemBo(String itemBo);
}

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.meapi.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -11,7 +10,6 @@ import com.foreverwin.mesnac.meapi.mapper.ItemMapper;
import com.foreverwin.mesnac.meapi.model.Item;
import com.foreverwin.mesnac.meapi.service.ItemService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
@ -19,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* <p>
@ -86,4 +85,11 @@ public class ItemServiceImpl extends ServiceImpl<ItemMapper, Item> implements It
public Item selectCurrent(String site, String item) {
return itemMapper.selectCurrentRevision(site, item);
}
@Override
public Map<String, Object> findMapByItemBo(String itemBo) {
return itemMapper.findMapByItem(itemBo);
}
}

@ -1013,4 +1013,10 @@
</if>
</where>
</select>
<select id="findMapByItem" resultType="Map">
SELECT DWG.VALUE DWG_NO
FROM ITEM I
LEFT JOIN CUSTOM_FIELDS DWG ON DWG.HANDLE = I.HANDLE AND DWG."ATTRIBUTE" = 'DWG_NO'
WHERE I.HANDLE = #{itemBo}
</select>
</mapper>

@ -1009,12 +1009,11 @@
<!--根据工单找出工作令号,项目号,产品类别-->
<select id="findByShopOrderBo" resultType="com.foreverwin.mesnac.meapi.dto.ShopOrderDto">
SELECT WO.VALUE WORK_ORDER,ITEM.VALUE ITEM_NUMBER,PC.VALUE PRODUCT_CATEGORY,WC.WORK_CENTER,MAP.VALUE MAP
SELECT WO.VALUE WORK_ORDER,ITEM.VALUE ITEM_NUMBER,PC.VALUE PRODUCT_CATEGORY,WC.WORK_CENTER
FROM SHOP_ORDER SO
LEFT JOIN CUSTOM_FIELDS WO ON WO.HANDLE = SO.HANDLE AND WO."ATTRIBUTE" = 'WORK_ORDER'
LEFT JOIN CUSTOM_FIELDS ITEM ON ITEM.HANDLE = SO.HANDLE AND ITEM."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN CUSTOM_FIELDS PC ON PC.HANDLE = SO.HANDLE AND PC."ATTRIBUTE" = 'PRODUCT_CATEGORY'
LEFT JOIN CUSTOM_FIELDS MAP ON MAP.HANDLE = SO.HANDLE AND MAP."ATTRIBUTE" = 'MAP'
LEFT JOIN WORK_CENTER WC ON WC.HANDLE = SO.PLANNED_WORK_CENTER_BO
WHERE SO.HANDLE = #{handle}
</select>

Loading…
Cancel
Save