| | |
| | | import com.dy.pipIrrGlobal.pojoIr.IrGroupUnit; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupDetail; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupSimple; |
| | | import com.dy.pipIrrIrrigate.irrigateGroup.dto.IrrigateGroup; |
| | | import com.dy.pipIrrIrrigate.irrigateGroup.qo.QoGroup; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class IrrigateGroupSv { |
| | | @Autowired |
| | | private IrIrrigateGroupMapper irIrrigateGroupMapper; |
| | | |
| | | @Autowired |
| | | private IrGroupUnitMapper irGroupUnitMapper; |
| | | |
| | |
| | | return map; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改轮灌组 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Map updateIrrigateGroup(IrrigateGroup po) { |
| | | Long groupId = po.getGroupId(); |
| | | Map map_deleteGroup = deleteGroup(groupId); |
| | | if(map_deleteGroup.get("success").equals(false)) { |
| | | Map map = new HashMap<>(); |
| | | map.put("success", false); |
| | | map.put("msg", map_deleteGroup.get("msg").toString()); |
| | | map.put("content", null); |
| | | return map; |
| | | } |
| | | |
| | | Map map_addGroup = addIrrigateGroup(po); |
| | | if(map_addGroup.get("success").equals(false)) { |
| | | Map map = new HashMap<>(); |
| | | map.put("success", false); |
| | | map.put("msg", map_addGroup.get("msg").toString()); |
| | | map.put("content", null); |
| | | return map; |
| | | } |
| | | |
| | | Map map = new HashMap<>(); |
| | | map.put("success", true); |
| | | map.put("msg", "修改轮灌组成功"); |
| | | map.put("content", null); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 查询轮灌组列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoGroupSimple>> getSimpleGroups(QoGroup queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = irIrrigateGroupMapper.getSimpleGroupCount(params); |
| | | |
| | | QueryResultVo<List<VoGroupSimple>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = irIrrigateGroupMapper.getSimpleGroups(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 查询全部轮灌组 |
| | | * @return |
| | | */ |
| | | public List<VoGroupSimple> getAllGroups() { |
| | | //Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | //Long itemTotal = irIrrigateGroupMapper.getSimpleGroupCount(params); |
| | | |
| | | //QueryResultVo<List<VoGroupSimple>> rsVo = new QueryResultVo<>(); |
| | | //rsVo.pageSize = queryVo.pageSize; |
| | | //rsVo.pageCurr = queryVo.pageCurr; |
| | | //rsVo.calculateAndSet(itemTotal, params); |
| | | //rsVo.obj = irIrrigateGroupMapper.getSimpleGroups(null); |
| | | //return rsVo; |
| | | |
| | | return irIrrigateGroupMapper.getSimpleGroups(null); |
| | | } |
| | | |
| | | /** |
| | | * 获取轮灌组详情 |
| | | * @param groupId |
| | | * @return |
| | | */ |
| | | public Map getGroupDetail(Long groupId) { |
| | | try { |
| | | VoGroupDetail voGroupDetail = irIrrigateGroupMapper.getGroupDetail(groupId); |
| | | Map map = new HashMap<>(); |
| | | map.put("success", true); |
| | | map.put("msg", "获取轮灌组详情成功"); |
| | | map.put("content", voGroupDetail); |
| | | return map; |
| | | } catch (Exception e) { |
| | | Map map = new HashMap<>(); |
| | | map.put("success", false); |
| | | map.put("msg", "获取轮灌组详情失败"); |
| | | map.put("content", null); |
| | | return map; |
| | | } |
| | | } |
| | | |
| | | } |