| | |
| | | import com.yuanchu.mom.service.StandardMethodListService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | 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); |
| | |
| | | public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | Map<String, List<?>> map = new HashMap<>(); |
| | | if(trees.length < 3) { |
| | | map.put("standardMethodList", null); |
| | | return map; |
| | | String str = ""; |
| | | List<StandardMethodList> standardMethodLists = new ArrayList<>(); |
| | | 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; |
| | | } |
| | | List<StandardMethodList> standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[2]); |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodListsByNull(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)); |
| | | return standardMethodListMapper.selectListEnum(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer getStandardMethodId(String code) { |
| | | return baseMapper.getStandardMethodId(code); |
| | | } |
| | | } |
| | | |