| | |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeActiveCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeActiveCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.VoActiveCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Autowired |
| | | private SeActiveCardMapper seActiveCardMapper; |
| | | |
| | | @Autowired |
| | | private SeClientCardMapper seClientCardMapper; |
| | | |
| | | //@Autowired |
| | | //private BaClientMapper baClientMapper; |
| | | |
| | | @Autowired |
| | | private SeClientMapper seClientMapper; |
| | | |
| | | public QueryResultVo<List<VoActiveCard>> getActiveCards(QueryVo queryVo) { |
| | | //完善查询开卡记录的起止时间 |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | LocalDateTime activeTimeStart = queryVo.activeTimeStart; |
| | | LocalDateTime activeTimeStop = queryVo.activeTimeStop; |
| | | String activeTimeStart = queryVo.activeTimeStart; |
| | | String activeTimeStop = queryVo.activeTimeStop; |
| | | if(activeTimeStart != null) { |
| | | activeTimeStart = LocalDateTime.parse(df.format(activeTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | activeTimeStart = activeTimeStart + " 00:00:00"; |
| | | queryVo.setActiveTimeStart(activeTimeStart); |
| | | } |
| | | |
| | | if(activeTimeStop != null) { |
| | | activeTimeStop = LocalDateTime.parse(df.format(activeTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | activeTimeStop = activeTimeStop + " 23:59:59"; |
| | | queryVo.setActiveTimeStop(activeTimeStop); |
| | | } |
| | | |
| | |
| | | Long itemTotal = seActiveCardMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoActiveCard>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seActiveCardMapper.getActiveCards(params); |
| | | return rsVo ; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据水卡编号和操作类型删除某卡补卡记录 |
| | | * @param cardId |
| | | * @param operateType |
| | | * 根据农户编号获取5级行政区划代码 |
| | | * @param clientNum 农户编号 |
| | | * @return 5级行政区划代码 |
| | | */ |
| | | public Long getAreaCodeByNum(String clientNum) { |
| | | return seClientMapper.getAreaCodeByNum(clientNum); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID |
| | | * @param clientNum |
| | | * @return |
| | | */ |
| | | public Integer deleteByIdAndOperateType(Long cardId, Byte operateType) { |
| | | return seActiveCardMapper.deleteByIdAndOperateType(cardId, operateType); |
| | | public Long getClientIdByNum(String clientNum) { |
| | | return seClientMapper.getClientIdByNum(clientNum); |
| | | } |
| | | |
| | | /** |
| | | * 根据行政区划串模块查询水卡编号 |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | | String getCardNumOfMax(String areaCode) { |
| | | return seClientCardMapper.getCardNumOfMax(areaCode); |
| | | } |
| | | } |