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