basic-server/src/main/java/com/ruoyi/basic/mapper/StandardProductListMapper.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.ruoyi.basic.pojo.StandardProductList; import com.ruoyi.basic.vo.StandardProductListVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -70,6 +71,8 @@ * @param productLists */ void saveBatchProductLists(@Param("productLists") List<StandardProductList> productLists); List<StandardProductListVO> selectStandardProductList(@Param("standardMethodListId") Integer standardMethodListId, @Param("tree") String tree, @Param("isDrag") boolean isDrag); } basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java
@@ -9,6 +9,7 @@ import com.ruoyi.basic.pojo.StandardMethodList; import com.ruoyi.basic.pojo.StandardProductList; import com.ruoyi.basic.pojo.StandardTree; import com.ruoyi.basic.vo.StandardProductListVO; import com.ruoyi.basic.vo.StandardTreeVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,9 +34,9 @@ List<StandardProductList> getStandardProductListBySample(String sampleType); List<StandardProductList> selectStandardProductListByTree(@Param("tree") String tree, @Param("sample") String sample, @Param("model") String model, @Param("trees") String trees, @Param("laboratory") String laboratory); List<StandardProductListVO> selectStandardProductListByTree(@Param("tree") String tree, @Param("sample") String sample, @Param("model") String model, @Param("trees") String trees, @Param("laboratory") String laboratory); List<StandardProductList> selectStandardProductListByTree2(@Param("tree") String tree, @Param("sample") String sample, @Param("model") String model, @Param("trees") String trees, @Param("laboratory") String laboratory); List<StandardProductListVO> selectStandardProductListByTree2(@Param("tree") String tree, @Param("sample") String sample, @Param("model") String model, @Param("trees") String trees, @Param("laboratory") String laboratory); List<SampleTypeDto> getStandardTree2(); basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.*; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.basic.vo.StandardProductListVO; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.basic.dto.CopyStandardProductListDto; @@ -259,7 +260,7 @@ String[] trees = tree.split(" - "); // 夿æ¯å¦ææ½ boolean isDrag = false; List<StandardProductList> list = new ArrayList<>(); List<StandardProductListVO> list = new ArrayList<>(); if (trees.length == 3) { List<StandardTree> treeList = new ArrayList<>(); StandardTree standardTree = new StandardTree(); @@ -296,10 +297,6 @@ .eq(StandardProductList::getStandardMethodListId, id) .isNull(StandardProductList::getModel) .like(StandardProductList::getTree, tree)); if (count == 0) { isDrag = true; } isDrag = true; List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3])); if (treeList.size() == 0) { @@ -323,23 +320,22 @@ for (StandardProductList productList : list) { productList.setId(IdWorker.getId()); } List<StandardProductList> standardProductLists; List<StandardProductListVO> standardProductLists; if (isDrag) { standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() .eq(StandardProductList::getStandardMethodListId, id) .like(StandardProductList::getTree, tree) .orderByAsc(StandardProductList::getSort)); // 夿æ¯å¦ææ²¡æåºå·ç, 没æåºå·éç½® boolean b = standardProductLists.stream().anyMatch(standardProductList -> standardProductList.getSort() == null); } else { standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() .eq(StandardProductList::getStandardMethodListId, id) .like(StandardProductList::getTree, tree)); } // if (isDrag) { // standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() // .eq(StandardProductList::getStandardMethodListId, id) // .like(StandardProductList::getTree, tree) // .orderByAsc(StandardProductList::getSort)); // } else { // standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() // .eq(StandardProductList::getStandardMethodListId, id) // .like(StandardProductList::getTree, tree)); // } standardProductLists = standardProductListMapper.selectStandardProductList(id,tree,isDrag); for (StandardProductList sp : standardProductLists) { for (StandardProductList pl : list) { for (StandardProductListVO sp : standardProductLists) { for (StandardProductListVO pl : list) { // 夿æ¡ä»¶æ¯å¦åªæä¸ä¸ª, æä¸ä¸ªçè¯é»è®¤ç¬¬ä¸ä¸ª String radiusList = pl.getRadiusList(); if (StringUtils.isNotBlank(radiusList) && !radiusList.equals("null") && !radiusList.equals("\"\"")) { @@ -358,6 +354,12 @@ pl.setId(sp.getId()); // æ·»å æåºå段 pl.setSort(sp.getSort()); pl.setCreateUserName(sp.getCreateUserName()); pl.setCreateTime(sp.getCreateTime()); pl.setCreateUser(sp.getCreateUser()); pl.setUpdateUserName(sp.getUpdateUserName()); pl.setUpdateTime(sp.getUpdateTime()); pl.setUpdateUser(sp.getUpdateUser()); if (sp.getState() != null && !sp.getState().equals("")) { pl.setState(sp.getState()); } else { @@ -428,7 +430,7 @@ // this.saveBatch(productLists); // æ¹éæ·»å æ å if (CollectionUtils.isNotEmpty(productLists)) { baseMapper.saveBatchProductLists(productLists); this.saveOrUpdateBatch(productLists); } basic-server/src/main/java/com/ruoyi/basic/vo/StandardProductListVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package com.ruoyi.basic.vo; import com.ruoyi.basic.pojo.StandardProductList; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class StandardProductListVO extends StandardProductList { /** * å建人åç§° */ @ApiModelProperty("å建人åç§°") private String createUserName; /** * æ´æ°äººåç§° */ @ApiModelProperty("æ´æ°äººåç§°") private String updateUserName; } basic-server/src/main/resources/mapper/StandardProductListMapper.xml
@@ -154,4 +154,19 @@ from structure_test_object_part where part_no = #{partNo} </select> <select id="selectStandardProductList" resultType="com.ruoyi.basic.vo.StandardProductListVO"> select spl.*, u1.name AS create_user_name, u2.name AS update_user_name from standard_product_list spl left join user u1 on u1.id = spl.create_user left join user u2 on u2.id = spl.update_user where 1=1 and spl.standard_method_list_id = #{standardMethodListId} and spl.tree like concat('%',#{tree},'%') <if test="isDrag!=null and isDrag"> ORDER BY spl.sort </if> </select> </mapper> basic-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -171,7 +171,7 @@ where sto.specimen_name = #{sampleType} group by sto.specimen_name </select> <select id="selectStandardProductListByTree" resultType="com.ruoyi.basic.pojo.StandardProductList"> <select id="selectStandardProductListByTree" resultType="com.ruoyi.basic.vo.StandardProductListVO"> select <include refid="selectStandardTree"/> from structure_item_parameter where ( @@ -186,7 +186,7 @@ order by inspection_item_class, inspection_item, id asc </select> <select id="selectStandardProductListByTree2" resultType="com.ruoyi.basic.pojo.StandardProductList"> <select id="selectStandardProductListByTree2" resultType="com.ruoyi.basic.vo.StandardProductListVO"> select <include refid="selectStandardTree"/> from structure_item_parameter where sample LIKE CONCAT('%[', #{tree}, ']%')