| | |
| | | @ApiModelProperty(value = "产品") |
| | | private String product; |
| | | |
| | | @ValueTableShow(2) |
| | | @ValueTableShow(3) |
| | | @ApiModelProperty(value = "创建人") |
| | | private String createUserName; |
| | | |
| | |
| | | @ApiModelProperty(value = "检验对象") |
| | | private String specimenName; |
| | | |
| | | @ValueTableShow(1) |
| | | @ApiModelProperty(value = "检验对象EN") |
| | | private String specimenNameEn; |
| | | |
| | | @ValueTableShow(2) |
| | | @ApiModelProperty(value = "对象代号") |
| | | private String code; |
| | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ValueTableShow(3) |
| | | @ValueTableShow(4) |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | sto.update_time, |
| | | sto.code, |
| | | sto.laboratory_id, |
| | | GROUP_CONCAT(p.name) product |
| | | GROUP_CONCAT(p.name) product, |
| | | sto.specimen_name_en |
| | | from structure_test_object sto |
| | | left join user u1 on sto.create_user = u1.id |
| | | left join user u2 on sto.update_user = u2.id |
| | |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists(String tree); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists3(String tree); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists2(String data1,String data2,String data3,String data4, String data5); |
| | | |
| | | List<StandardProductList> selectParameterList(String code); |
| | |
| | | import com.yuanchu.mom.service.StandardMethodListService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | private StandardProductListMapper standardProductListMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addStandardMethodList(Integer standardId, String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | Map<String, String> map = standardMethodListMapper.selectStandardMethodById(standardId); |
| | |
| | | switch (trees.length){ |
| | | case 5: |
| | | str += "\"" + trees[2] + "\",\"" + trees[3] + "\",\"" + trees[4] + "\""; |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str)); |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\",\"" + trees[3] + "\"")); |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); |
| | | break; |
| | | case 4: |
| | | str += "\"" + trees[2] + "\",\"" + trees[3] + "\""; |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str)); |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); |
| | | break; |
| | | case 3: |
| | | str += "\"" + trees[2] + "\""; |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists3(str)); |
| | | break; |
| | | default: |
| | | map.put("standardMethodList", null); |
| | | return map; |
| | | } |
| | | map.put("standardMethodList", standardMethodListMapper.selectStandardMethodLists(str)); |
| | | |
| | | map.put("standardMethodList", standardMethodLists); |
| | | return map; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int delStandardMethodByFLSSM(Integer id) { |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id)); |
| | | return standardMethodListMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardMethodList> selectStandardMethodEnum() { |
| | | return standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery().select(StandardMethodList::getId,StandardMethodList::getCode,StandardMethodList::getName)); |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.CompletableFuture; |
| | |
| | | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSample insSample) { |
| | | List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1)); |
| | | List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, insSample.getModel())); |
| | | list = list.stream().filter(a -> { |
| | | try { |
| | | if (a.getSection() != null && !Objects.equals(a.getSection(), "")) { |
| | |
| | | public List<StandardProductList> selectStandardProductListByMethodId(Integer id, String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | StringBuffer str = new StringBuffer(); |
| | | List<StandardProductList> list = new ArrayList<>(); |
| | | if (trees.length == 3) { |
| | | str.append("\"").append(trees[2]).append("\""); |
| | | } else { |
| | | str.append("\"").append(trees[2]).append("\",\"").append(trees[3]).append("\""); |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"")); |
| | | } |
| | | List<StandardProductList> list = standardTreeMapper.selectStandardProductListByTree(str + ""); |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree(str + "")); |
| | | List<StandardProductList> standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, id).eq(StandardProductList::getTree, tree)); |
| | | for (StandardProductList sp : standardProductLists) { |
| | | for (StandardProductList pl : list) { |
| | | if (sp.getInspectionItem().equals(pl.getInspectionItem()) && sp.getInspectionItemSubclass().equals(pl.getInspectionItemSubclass())) { |
| | | if (Objects.equals(sp.getInspectionItem(), pl.getInspectionItem()) |
| | | && Objects.equals(sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass())) { |
| | | pl.setId(sp.getId()); |
| | | pl.setState(sp.getState()); |
| | | pl.setFactory(sp.getFactory()); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.dto.FactoryDto; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | case 5: |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]).eq(StandardTree::getModel, trees[4])); |
| | | break; |
| | | case 4: |
| | | /*case 4: |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3])); |
| | | break; |
| | | case 3: |
| | |
| | | break; |
| | | case 1: |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0])); |
| | | break; |
| | | } |
| | | Map<String, List<?>> listMap = standardMethodListService.selectsStandardMethodByFLSSM2(tree); |
| | | if (listMap.get("standardMethodList").size() != 0) { |
| | | for (Object o : listMap.get("standardMethodList")) { |
| | | JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o)); |
| | | List<StandardProductList> list = standardProductListService.selectStandardProductListByMethodId((Integer) jsonObject.get("id"), tree); |
| | | if (list.size() != 0) { |
| | | standardProductListMapper.deleteBatchIds(list); |
| | | } |
| | | } |
| | | standardMethodListMapper.deleteBatchIds(listMap.get("standardMethodList")); |
| | | break;*/ |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | where is_use = 1 |
| | | and is_product = 1 |
| | | and ( |
| | | structure_test_object_id is null |
| | | OR structure_test_object_id = '' |
| | | OR structure_test_object_id = '[]' |
| | | or structure_test_object_id LIKE CONCAT('%', #{tree}, '%') |
| | | ) |
| | | structure_test_object_id is null |
| | | OR structure_test_object_id = '' |
| | | OR structure_test_object_id = '[]' |
| | | or structure_test_object_id LIKE CONCAT('%[', #{tree}, ']%') |
| | | ) |
| | | </select> |
| | | <select id="selectParameterList" resultType="standardProductList"> |
| | | select |
| | | inspection_item, |
| | | inspection_item_classify, |
| | | select inspection_item, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | unit, |
| | |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | |
| | | and model = #{data5} |
| | | </if> |
| | | </select> |
| | | <select id="selectStandardMethodLists3" resultType="com.yuanchu.mom.pojo.StandardMethodList"> |
| | | select id, code, name, remark |
| | | from standard_method |
| | | where is_use = 1 |
| | | and is_product = 1 |
| | | and ( |
| | | structure_test_object_id is null |
| | | OR structure_test_object_id = '' |
| | | OR structure_test_object_id = '[]' |
| | | or structure_test_object_id LIKE CONCAT('%', #{tree}, '%') |
| | | ) |
| | | </select> |
| | | </mapper> |
| | |
| | | sample is NULL |
| | | OR sample = '' |
| | | or sample = '[]' |
| | | OR sample LIKE CONCAT('%', #{tree}, '%') |
| | | OR sample LIKE CONCAT('%[', #{tree}, ']%') |
| | | ) |
| | | </select> |
| | | |