| | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientMapper; |
| | |
| | | @Autowired |
| | | private SeGeneralMapper seGeneralMapper; |
| | | |
| | | @Autowired |
| | | private BaSettingsMapper baSettingsMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加开卡记录 |
| | |
| | | * @param clientNum 农户编号 |
| | | * @return 5级行政区划代码 |
| | | */ |
| | | public Long getAreaCodeByNum(String clientNum) { |
| | | return seClientMapper.getAreaCodeByNum(clientNum); |
| | | public String getAreaCodeByNum(String clientNum) { |
| | | Long areaCode = seClientMapper.getAreaCodeByNum(clientNum); |
| | | if (areaCode == null) { |
| | | return ""; |
| | | } |
| | | return String.valueOf(areaCode); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | Long cardId = 0L; |
| | | Long clientId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | Long cardNum = po.getCardNum(); |
| | | Float money = po.getMoney(); |
| | | Float amount = po.getAmount(); |
| | | Float gift = po.getGift(); |
| | |
| | | |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(cardNum)).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("正常")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取充值记录 |
| | |
| | | |
| | | return map_result; |
| | | } |
| | | |
| | | /** |
| | | * 判断指定水卡是否为挂失状态且无补卡记录 |
| | | * @param cardNum 水卡编号 |
| | | * @return 是否已挂失未补卡 |
| | | */ |
| | | public Boolean isLostAndUnreplaced(Long cardNum) { |
| | | Integer rec = seClientCardMapper.isLostAndUnreplaced(cardNum); |
| | | if(rec != null && rec > 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 修改农户水卡 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer updateClientCard(SeClientCard po) { |
| | | return seClientCardMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 获取项目编号 |
| | | * @return |
| | | */ |
| | | public String getProjectNo() { |
| | | return baSettingsMapper.getItemValue("projectNo"); |
| | | } |
| | | } |