1.获取补卡记录2.修改取水口是否绑定查询和地址查询3查询返回取水口ID
| | |
| | | * @return |
| | | */ |
| | | List<VoActiveCardNew> getActiveCards(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取补卡记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getReissueCardRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取补卡记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoReissueCard> getReissueCards(Map<?, ?> params); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/1/26 9:31 |
| | | * @LastEditTime :2024/1/26 9:31 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(title = "补卡记录视图对象") |
| | | public class VoReissueCard implements BaseEntity { |
| | | private static final long serialVersionUID = 2024012609330001L; |
| | | |
| | | @Schema(title = "ID") |
| | | private Long id; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private String cardNum; |
| | | |
| | | @Schema(title = "卡片费用") |
| | | private Integer cardCost; |
| | | |
| | | @Schema(title = "补卡金额") |
| | | private Double reissueAmount; |
| | | |
| | | @Schema(title = "操作人") |
| | | private String operator; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Schema(title = "操作时间") |
| | | private Date operateDt; |
| | | } |
| | |
| | | <if test="blockName != null and blockName != ''"> |
| | | AND blo.name = #{blockName} |
| | | </if> |
| | | |
| | | <if test="isBinded == 0"> |
| | | AND ge.id NOT IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == 1"> |
| | | AND ge.id IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == null"> |
| | | |
| | | </if> |
| | | <if test="address != null and address != ''"> |
| | | AND CONCAT(country.`name`, town.`name`, village.`name`) LIKE CONCAT('%', #{address}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取取水口记录--> |
| | | <select id="getIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntake"> |
| | | SELECT (@i:=@i+1) AS id, |
| | | SELECT ge.id AS id, |
| | | ge.`name` AS intakeName, |
| | | divi.`name` AS divideName, |
| | | blo.`name` AS blockName, |
| | |
| | | INNER JOIN ba_district country ON ge.countyId = country.id |
| | | INNER JOIN ba_district town ON ge.townId = town.id |
| | | INNER JOIN ba_district village ON ge.villageId = village.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | ge.deleted = 0 |
| | | AND divi.deleted = 0 |
| | |
| | | <if test="intakeName != null and intakeName != ''"> |
| | | AND ge.name LIKE CONCAT('%', #{intakeName}, '%') |
| | | </if> |
| | | |
| | | <if test="divideName != null and divideName != ''"> |
| | | AND divi.name LIKE CONCAT('%', #{divideName}, '%') |
| | | </if> |
| | |
| | | <if test="blockName != null and blockName != ''"> |
| | | AND blo.name = #{blockName} |
| | | </if> |
| | | |
| | | <if test="isBinded == 0"> |
| | | AND ge.id NOT IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == 1"> |
| | | AND ge.id IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == null"> |
| | | |
| | | </if> |
| | | <if test="address != null and address != ''"> |
| | | AND CONCAT(country.`name`, town.`name`, village.`name`) LIKE CONCAT('%', #{address}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY ge.operateDt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取补卡记录数量--> |
| | | <select id="getReissueCardRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(*) AS recordCount |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 4 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "activeTimeStart != null and activeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{reissueCardTimeStart} AND #{reissueCardTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取补卡记录--> |
| | | <select id="getReissueCards" resultType="com.dy.pipIrrGlobal.voSe.VoReissueCard"> |
| | | SELECT |
| | | CAST(ope.id AS char) AS id , |
| | | cli.name AS clientName, |
| | | cli.clientNum AS clientNum, |
| | | card.cardNum AS cardNum, |
| | | ope.card_cost AS cardCost, |
| | | IFNULL(ope.no_trade_amount,0) AS reissueAmount, |
| | | (SELECT `name` FROM ba_user WHERE id = ope.operator) AS operator, |
| | | ope.operate_dt AS operateDt |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 4 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "activeTimeStart != null and activeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{reissueCardTimeStart} AND #{reissueCardTimeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ope.operate_dt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return 取水口记录列表 |
| | | */ |
| | | public QueryResultVo<List<VoIntake>> getIntakes(QueryVo queryVo) { |
| | | // String isBinded = queryVo.getIsBinded(); |
| | | // |
| | | // if(isBinded == null || isBinded.length() <= 0) { |
| | | // |
| | | // } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = prIntakeMapper.getRecordCount(params); |
| | | |
| | |
| | | public String blockName; |
| | | |
| | | @Schema(description = "是否绑定设备") |
| | | public String isBind; |
| | | //0未绑定 1已绑定 |
| | | public Integer isBinded; |
| | | |
| | | @Schema(description = "地址") |
| | | public String address; |
| | |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCardNew; |
| | | import com.dy.pipIrrGlobal.voSe.VoRecharge; |
| | | import com.dy.pipIrrGlobal.voSe.VoReissueCard; |
| | | import com.dy.pipIrrSell.cardOperate.converter.RechargeDtoMapper; |
| | | import com.dy.pipIrrSell.cardOperate.dto.*; |
| | | import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoActiveCard; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoRecharge; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoTransaction; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoTransactionStatistics; |
| | | import com.dy.pipIrrSell.cardOperate.qo.*; |
| | | import com.dy.pipIrrSell.clientCard.CardStateENUM; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | |
| | | }) |
| | | @GetMapping(path = "/getActiveCards") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoActiveCardNew>>> get(QoActiveCard vo){ |
| | | public BaseResponse<QueryResultVo<List<VoActiveCardNew>>> getActiveCards(QoActiveCard vo){ |
| | | try { |
| | | QueryResultVo<List<VoActiveCardNew>> res = cardOperateSv.getActiveCards(vo); |
| | | if(res.itemTotal == 0) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取补卡记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获取补卡记录", description = "返回补卡记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页补卡数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getReissueCards") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoReissueCard>>> getReissueCards(QoReissueCard vo){ |
| | | try { |
| | | QueryResultVo<List<VoReissueCard>> res = cardOperateSv.getReissueCards(vo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.No_ReissueCards.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取补卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.voSe.*; |
| | | import com.dy.pipIrrSell.cardOperate.dto.DtoRecharge; |
| | | import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoActiveCard; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoRecharge; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoTransaction; |
| | | import com.dy.pipIrrSell.cardOperate.qo.QoTransactionStatistics; |
| | | import com.dy.pipIrrSell.cardOperate.qo.*; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | |
| | | rsVo.obj = seCardOperateMapper.getActiveCards(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取补卡记录 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoReissueCard>> getReissueCards(QoReissueCard queryVo) { |
| | | //完善查询充值记录的起止时间 |
| | | String reissueCardTimeStart = queryVo.reissueCardTimeStart; |
| | | String reissueCardTimeStop = queryVo.reissueCardTimeStop; |
| | | if(reissueCardTimeStart != null) { |
| | | reissueCardTimeStart = reissueCardTimeStart + " 00:00:00"; |
| | | queryVo.setReissueCardTimeStart(reissueCardTimeStart); |
| | | } |
| | | if(reissueCardTimeStop != null) { |
| | | reissueCardTimeStop = reissueCardTimeStop + " 23:59:59"; |
| | | queryVo.setReissueCardTimeStop(reissueCardTimeStop); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = seCardOperateMapper.getReissueCardRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoReissueCard>> rsVo = new QueryResultVo<>() ; |
| | | 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 = seCardOperateMapper.getReissueCards(params); |
| | | return rsVo ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/1/26 9:17 |
| | | * @LastEditTime :2024/1/26 9:17 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "IC卡补卡记录查询条件") |
| | | public class QoReissueCard extends QueryConditionVo { |
| | | |
| | | @Schema(description = "农户姓名") |
| | | public String clientName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | //public String cardAddr; |
| | | public String cardNum; |
| | | |
| | | @Schema(description = "补卡时间_开始") |
| | | public String reissueCardTimeStart; |
| | | |
| | | @Schema(description = "补卡时间_结束") |
| | | public String reissueCardTimeStop; |
| | | } |
| | |
| | | REPLACE_FAIL_WRITE_CLIENT_CARD_ERROR(10007, "补卡失败-农户卡修改异常"), |
| | | REPLACE_FAIL_WRITE_RECHARGE_ERROR(10008, "补卡失败-补卡记录写入异常"), |
| | | No_ActiveCards(10009, "没有符合条件的开卡数据"), |
| | | No_ReissueCards(10010, "没有符合条件的补卡数据"), |
| | | |
| | | /** |
| | | * 充值 |