在开关阀时刷卡记录中添加用户余额;修改刷卡记录中的刷卡时间格式;刷卡记录倒序
This commit is contained in:
@ -257,6 +257,7 @@ public class DeviceOtherMsgConsumer {
|
|||||||
|
|
||||||
String cardNumber= String.valueOf(dataJson.getInt("cardId"));//解析cardId
|
String cardNumber= String.valueOf(dataJson.getInt("cardId"));//解析cardId
|
||||||
userIrrigationRecord.setCardNumber(cardNumber);//卡号
|
userIrrigationRecord.setCardNumber(cardNumber);//卡号
|
||||||
|
System.err.println("cardNumber"+cardNumber);
|
||||||
|
|
||||||
String areaCode=dataJson.getStr("areaCode");
|
String areaCode=dataJson.getStr("areaCode");
|
||||||
userIrrigationRecord.setAreaCode(areaCode);//区域号
|
userIrrigationRecord.setAreaCode(areaCode);//区域号
|
||||||
@ -269,18 +270,22 @@ public class DeviceOtherMsgConsumer {
|
|||||||
.eq(UserRechargeCards::getCardNumber, cardNumber)
|
.eq(UserRechargeCards::getCardNumber, cardNumber)
|
||||||
// .ne(UserRechargeCards::getDeptId, null)
|
// .ne(UserRechargeCards::getDeptId, null)
|
||||||
.list();
|
.list();
|
||||||
|
System.err.println("卡信息条数:"+cardList);
|
||||||
// Long deptId= null;//获取deptId
|
// Long deptId= null;//获取deptId
|
||||||
if(!cardList.isEmpty()){
|
if(!cardList.isEmpty()){
|
||||||
// if(cardList.get(0).getDeptId()!=null){
|
// if(cardList.get(0).getDeptId()!=null){
|
||||||
// deptId= cardList.get(0).getDeptId();
|
// deptId= cardList.get(0).getDeptId();
|
||||||
// }
|
// }
|
||||||
|
System.err.println("卡存在");
|
||||||
//添加一条刷卡记录
|
//添加一条刷卡记录
|
||||||
|
BigDecimal userBalance=dataJson.getBigDecimal("userBalance");//用户余额
|
||||||
NgCardSwipeRecords ngCardSwipeRecords=new NgCardSwipeRecords();
|
NgCardSwipeRecords ngCardSwipeRecords=new NgCardSwipeRecords();
|
||||||
ngCardSwipeRecords.setCardNumber(cardNumber);//卡号
|
ngCardSwipeRecords.setCardNumber(cardNumber);//卡号
|
||||||
ngCardSwipeRecords.setDeviceNumber(serialNumber);//设备编码
|
ngCardSwipeRecords.setDeviceNumber(serialNumber);//设备编码
|
||||||
ngCardSwipeRecords.setAreaCode(areaCode);//区域号
|
ngCardSwipeRecords.setAreaCode(areaCode);//区域号
|
||||||
ngCardSwipeRecords.setCardSwipeType(0);//开阀
|
ngCardSwipeRecords.setCardSwipeType(0);//开阀
|
||||||
ngCardSwipeRecords.setCardSwipeTime(DateUtils.getNowDate());//刷卡时间
|
ngCardSwipeRecords.setCardSwipeTime(DateUtils.getNowDate());//刷卡时间
|
||||||
|
ngCardSwipeRecords.setAmountDue(userBalance);//用户余额
|
||||||
if(cardInfo!=null && cardInfo.getUserId()!=null){
|
if(cardInfo!=null && cardInfo.getUserId()!=null){
|
||||||
ngCardSwipeRecords.setUserId(cardList.get(0).getUserId());//用户id
|
ngCardSwipeRecords.setUserId(cardList.get(0).getUserId());//用户id
|
||||||
}
|
}
|
||||||
@ -382,6 +387,7 @@ public class DeviceOtherMsgConsumer {
|
|||||||
ngCardSwipeRecords.setAreaCode(areaCode);//区域号
|
ngCardSwipeRecords.setAreaCode(areaCode);//区域号
|
||||||
ngCardSwipeRecords.setCardSwipeType(1);//关阀
|
ngCardSwipeRecords.setCardSwipeType(1);//关阀
|
||||||
ngCardSwipeRecords.setCardSwipeTime(DateUtils.getNowDate());//刷卡时间
|
ngCardSwipeRecords.setCardSwipeTime(DateUtils.getNowDate());//刷卡时间
|
||||||
|
ngCardSwipeRecords.setAmountDue(userBalance);//用户余额
|
||||||
|
|
||||||
// ngCardSwipeRecords.setUserId(cardList.get(0).getUserId());//用户id
|
// ngCardSwipeRecords.setUserId(cardList.get(0).getUserId());//用户id
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ public class NgCardSwipeRecords extends BaseEntity
|
|||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/** 刷卡时间 */
|
/** 刷卡时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "刷卡时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "刷卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty("刷卡时间")
|
@ApiModelProperty("刷卡时间")
|
||||||
private Date cardSwipeTime;
|
private Date cardSwipeTime;
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
||||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY card_swipe_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectNgCardSwipeRecordsUserList" parameterType="NgCardSwipeRecords" resultMap="NgCardSwipeRecordsResult">
|
<select id="selectNgCardSwipeRecordsUserList" parameterType="NgCardSwipeRecords" resultMap="NgCardSwipeRecordsResult">
|
||||||
|
Reference in New Issue
Block a user