| | |
| | | import com.ycl.framework.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | baseMapper.updateById(codingRuler); |
| | | return Result.ok(msg); |
| | | } |
| | | /** |
| | | * 获得启动的赋码规则 |
| | | * @return 存放的字段 yellowRuler启用的黄码规则,redRuler启用的红码规则 |
| | | */ |
| | | @Override |
| | | public Result getStartRuler() { |
| | | Result result = new Result(); |
| | | //获得启用的赋码规则 |
| | | List<CodingRulerVO> codingRulerVOS = codingRulerMapper.getStartRuler(); |
| | | if (CollectionUtils.isEmpty(codingRulerVOS)){ |
| | | log.error("未启用赋码规则"); |
| | | return result; |
| | | } |
| | | CodingRulerVO yellowRuler = null; |
| | | CodingRulerVO redRuler = null; |
| | | for (CodingRulerVO codingRulerVO : codingRulerVOS){ |
| | | if (CodingRulerCodeTypeEnum.YELLOW.getValue().equals(codingRulerVO.getProjectCodeType())){ |
| | | yellowRuler = codingRulerVO; |
| | | }else if (CodingRulerCodeTypeEnum.RED.getValue().equals(codingRulerVO.getProjectCodeType())){ |
| | | redRuler = codingRulerVO; |
| | | } |
| | | } |
| | | result.put("yellowRuler",yellowRuler); |
| | | result.put("redRuler",redRuler); |
| | | return result; |
| | | } |
| | | } |