Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| | |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"orderNumber", "clientName", "cardNum", "idCard", "clientNum", "phone", "operateType", "tradeAmount", "waterCost", "cardCost", "gift", "refundAmount", "money", "paymentName", "tradeTime", "cashierId", "cardState", "districtTitle", "villageId"}) |
| | | @JsonPropertyOrder({"orderNumber", "clientName", "cardNum", "idCard", "clientNum", "phone", "operateType", "tradeAmount", "waterCost", "cardCost", "gift", "refundAmount", "money", "paymentName", "tradeTime", "cashierId", "cashierName", "cardState", "districtTitle", "villageId"}) |
| | | @HeadRowHeight(30) |
| | | @ContentRowHeight(20) |
| | | public class VoTradeDetails implements BaseEntity { |
| | |
| | | private Long cashierId; |
| | | |
| | | /** |
| | | * 收银员姓名 |
| | | */ |
| | | @ColumnWidth(15) |
| | | private String cashierName; |
| | | |
| | | /** |
| | | * 卡片状态 |
| | | */ |
| | | @ColumnWidth(15) |
| | |
| | | * 开阀次数 |
| | | */ |
| | | private Integer openCount; |
| | | |
| | | /** |
| | | * 用水量 |
| | | */ |
| | | private Double waterConsumption; |
| | | |
| | | /** |
| | | * 消费金额 |
| | | */ |
| | | private Double amountSpent; |
| | | |
| | | /** |
| | | * 用水时长 |
| | | */ |
| | | private Double waterDuration; |
| | | |
| | | |
| | | } |
| | |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | # url: jdbc:mysql://192.168.40.166:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://8.130.130.233:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | #url: jdbc:mysql://8.140.179.55:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | url: jdbc:mysql://127.0.0.1:3306/pipIrr_pj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | username: root |
| | | password: dysql,;.abc!@# |
| | |
| | | <item2 name="微信支付"/> |
| | | <item3 name="支付宝支付"/> |
| | | <item4 name="银行转账"/> |
| | | <item5 name="换卡"/> |
| | | </payments> |
| | | <settings> |
| | | <item1 item_name="lng" item_value="101.87345" remarks="经度"/> |
| | |
| | | cli.clientNum, |
| | | CONCAT(cli.districtTitle, cli.address) AS address, |
| | | cli.phone, |
| | | cli.idCard |
| | | cli.idCard, |
| | | IFNULL((SELECT SUM(his.cl_this_amount) |
| | | FROM rm_open_close_valve_history his |
| | | <where> |
| | | his.client_id = cli.id |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ),0) AS waterConsumption |
| | | FROM se_client cli |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterConsumption != null"> |
| | |
| | | cli.clientNum, |
| | | CONCAT(cli.districtTitle, cli.address) AS address, |
| | | cli.phone, |
| | | cli.idCard |
| | | cli.idCard, |
| | | IFNULL((SELECT SUM(his.cl_this_money) |
| | | FROM rm_open_close_valve_history his |
| | | <where> |
| | | his.client_id = cli.id |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ),0) AS amountSpent |
| | | FROM se_client cli |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and amountSpent != null"> |
| | |
| | | cli.clientNum, |
| | | CONCAT(cli.districtTitle, cli.address) AS address, |
| | | cli.phone, |
| | | cli.idCard |
| | | cli.idCard, |
| | | IFNULL((SELECT SUM(his.cl_this_time) |
| | | FROM rm_open_close_valve_history his |
| | | <where> |
| | | his.client_id = cli.id |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''"> |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ),0) AS waterDuration |
| | | FROM se_client cli |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterDuration != null"> |
| | |
| | | <select id="getTransactionRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM v_trade_details |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | INNER JOIN se_client_card card ON card.id = ope.card_id |
| | | LEFT JOIN se_payment_method pay ON ope.payment_id = pay.id |
| | | INNER JOIN ba_user us ON ope.operator = us.id |
| | | <where> |
| | | AND ope.operate_type IN(1,2,3,5) |
| | | |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = #{villageId} |
| | | AND cli.villageId = #{villageId} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeTime BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | AND ope.operate_dt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | |
| | | <if test = "cashierId != null and cashierId > 0"> |
| | | AND cashierId = #{cashierId} |
| | | AND us.id = #{cashierId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取交易记录--> |
| | | <select id="getTransactions" resultType="com.dy.pipIrrGlobal.voSe.VoTradeDetails"> |
| | | SELECT * FROM v_trade_details |
| | | SELECT |
| | | ope.id AS orderNumber, |
| | | cli.name AS clientName, |
| | | card.cardNum AS cardNum, |
| | | cli.idCard, |
| | | cli.clientNum, |
| | | cli.phone, |
| | | (CASE ope.operate_type |
| | | WHEN 1 THEN '开卡' |
| | | WHEN 2 THEN '充值' |
| | | WHEN 3 THEN '销卡' |
| | | WHEN 5 THEN '补扣' |
| | | END) AS operateType, |
| | | (IFNULL(ope.trade_amount,0.00) + IFNULL(ope.card_cost,0.00)) AS tradeAmount, |
| | | IFNULL(ope.trade_amount,0.00) AS waterCost, |
| | | IFNULL(ope.card_cost,0.00) AS cardCost, |
| | | IFNULL(ope.gift,0.00) AS gift, |
| | | IFNULL(ope.refund_amount,0.00) AS refundAmount, |
| | | ope.money, |
| | | pay.name AS paymentName, |
| | | ope.operate_dt as tradeTime, |
| | | us.id AS cashierId, |
| | | us.name AS cashierName, |
| | | (CASE card.state |
| | | WHEN 1 THEN '正常' |
| | | WHEN 2 THEN '已注销' |
| | | WHEN 3 THEN '已挂失' |
| | | END) AS cardState, |
| | | cli.districtTitle, |
| | | cli.villageId AS villageId |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | INNER JOIN se_client_card card ON card.id = ope.card_id |
| | | LEFT JOIN se_payment_method pay ON ope.payment_id = pay.id |
| | | INNER JOIN ba_user us ON ope.operator = us.id |
| | | <where> |
| | | AND ope.operate_type IN(1,2,3,5) |
| | | |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = #{villageId} |
| | | AND cli.villageId = #{villageId} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeTime BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | AND ope.operate_dt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | |
| | | <if test = "cashierId != null and cashierId > 0"> |
| | | AND cashierId = #{cashierId} |
| | | AND us.id = #{cashierId} |
| | | </if> |
| | | </where> |
| | | ORDER BY tradeTime |
| | | ORDER BY ope.operate_dt |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | |
| | | private Integer projectNo; |
| | | /** |
| | | * 开卡 |
| | | * 当卡片费用为0时即为换卡操作,不收卡片费用,不收余额 |
| | | * @param po 开卡传入对象 |
| | | * @param bindingResult |
| | | * @return 水卡编号 |
| | |
| | | seClientCard.setOriginalCardId(originalCardId); |
| | | } |
| | | seClientCard.setCreatedt(activeTime); |
| | | if(cardCost == 0) { |
| | | // 换卡 |
| | | seClientCard.setLastoper(LastOperateENUM.CHANGE_CARD.getCode()); |
| | | }else { |
| | | // 开卡 |
| | | seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode()); |
| | | } |
| | | //if(cardCost == 0) { |
| | | // // 换卡 |
| | | // seClientCard.setLastoper(LastOperateENUM.CHANGE_CARD.getCode()); |
| | | //}else { |
| | | // // 开卡 |
| | | //seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode()); |
| | | //} |
| | | seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode()); |
| | | Long cardId = Optional.ofNullable(clientCardSv.add(seClientCard)).orElse(0L) ; |
| | | if(cardId == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加开卡记录,退还金额作为充值金额 |
| | | * 添加开卡操作记录,退还金额作为充值金额 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | |
| | | seCardOperate.setOperateType(OperateTypeENUM.REISSUE.getCode()); |
| | | }else { |
| | | // 开新卡或换卡 |
| | | if(cardCost > 0) { |
| | | //if(cardCost > 0) { |
| | | // seCardOperate.setOperateType(OperateTypeENUM.ACTIVE.getCode()); |
| | | //}else { |
| | | // seCardOperate.setOperateType(OperateTypeENUM.CHANGE_CARD.getCode()); |
| | | //} |
| | | seCardOperate.setOperateType(OperateTypeENUM.ACTIVE.getCode()); |
| | | }else { |
| | | seCardOperate.setOperateType(OperateTypeENUM.CHANGE_CARD.getCode()); |
| | | } |
| | | } |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 添加注销记录 |
| | | * 添加注销操作记录 |
| | | * 支付方式为现金 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 添加补扣记录 |
| | | * 添加补扣操作记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setMoney(afterRecharge); |
| | | seClientCard.setRechargedt(rechargeTime); |
| | | if(paymentName != null && paymentName.equals("换卡")) { |
| | | seClientCard.setLastoper(LastOperateENUM.CHANGE_RECHARGE.getCode ()); |
| | | }else { |
| | | //if(paymentName != null && paymentName.equals("换卡")) { |
| | | // seClientCard.setLastoper(LastOperateENUM.CHANGE_RECHARGE.getCode ()); |
| | | //}else { |
| | | // seClientCard.setLastoper(LastOperateENUM.RECHARGE.getCode ()); |
| | | //} |
| | | seClientCard.setLastoper(LastOperateENUM.RECHARGE.getCode ()); |
| | | } |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加水卡操作记录 |
| | | * 添加水卡充值操作记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | |
| | | seCardOperate.setMoney(money); |
| | | seCardOperate.setTradeAmount(amount); |
| | | seCardOperate.setGift(gift); |
| | | if(paymentName != null && paymentName.equals("换卡")) { |
| | | seCardOperate.setOperateType(OperateTypeENUM.CHANGE_RECHARGE.getCode()); |
| | | }else { |
| | | //if(paymentName != null && paymentName.equals("换卡")) { |
| | | // seCardOperate.setOperateType(OperateTypeENUM.CHANGE_RECHARGE.getCode()); |
| | | //}else { |
| | | // seCardOperate.setOperateType(OperateTypeENUM.RECHARGE.getCode()); |
| | | //} |
| | | seCardOperate.setOperateType(OperateTypeENUM.RECHARGE.getCode()); |
| | | } |
| | | seCardOperate.setPaymentId(paymentId); |
| | | seCardOperate.setPrice(price); |
| | | seCardOperate.setRemarks(remarks); |
| | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = Optional.ofNullable(seCardOperateMapper.getTransactionRecordCount(params)).orElse(0L); |
| | | |
| | | QueryResultVo rsVo = new QueryResultVo<>() ; |
| | | QueryResultVo<List<VoTradeDetails>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = vo.pageSize ; |
| | | rsVo.pageCurr = vo.pageCurr ; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | List<VoTradeDetails> list = seCardOperateMapper.getTransactions(params); |
| | | rsVo.obj = seCardOperateMapper.getTransactions(params); |
| | | List<VoTradeDetails> list = rsVo.obj; |
| | | if(list.size() == 0) { |
| | | return new HashMap(); |
| | | } |
| | |
| | | } |
| | | |
| | | Map map_record = new HashMap(); |
| | | map_record.put("itemTotal", itemTotal); |
| | | map_record.put("list", list); |
| | | map_record.put("list", rsVo); |
| | | |
| | | Map map_result = new HashMap(); |
| | | map_result.put("waterCost", df.format(totalWaterCost)); |
| | | map_result.put("cardCost", df.format(totalCardCost)); |
| | | map_result.put("gift", df.format(totalGift)); |
| | | map_result.put("refund", df.format(totalRefund)); |
| | | |
| | | |
| | | map_result.put("records", map_record); |
| | | |
| | |
| | | LOSS((byte)6, "挂失"), |
| | | REVERSAL((byte)7, "冲正"), |
| | | UNLOCK((byte)8, "解锁"), |
| | | CONSUME((byte)9, "消费"), |
| | | CHANGE_CARD((byte)10, "换卡"), |
| | | CHANGE_RECHARGE((byte)11, "换卡充值"); |
| | | CONSUME((byte)9, "消费"); |
| | | //CHANGE_CARD((byte)10, "换卡"), |
| | | //CHANGE_RECHARGE((byte)11, "换卡充值"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |
| | |
| | | LOSS((byte)6, "挂失"), |
| | | REVERSAL((byte)7, "冲正"), |
| | | UNLOCK((byte)8, "解锁"), |
| | | CONSUME((byte)9, "消费"), |
| | | CHANGE_CARD((byte)10,"换卡"), |
| | | CHANGE_RECHARGE((byte)11,"换卡充值"); |
| | | CONSUME((byte)9, "消费"); |
| | | //CHANGE_CARD((byte)10,"换卡"), |
| | | //CHANGE_RECHARGE((byte)11,"换卡充值"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |