Several bugs encountered in the system recently

Withhold a penny less

       Today, the careful financial girl reconciled the accounts, and found that the amount in the withholding system was 1 cent different from the amount that the system should pay back. Yes, it was 1 cent. Then the serious financial girl suddenly became unhappy and forced R&D to find the reason. Well, the reason is found, the problem lies in the method new Double(amout*100).intValue().

        amount=643.81 yuan, then new Double(amout*100) may not necessarily be 64381 as we imagined (unit points, the amount withheld is generally an integer, but the unit is points), for example, it may be 64380.999999, which happens to be .intValue( ) The rounding method in this rough stage will become 64380 points, which is 643.80 yuan.

         In this case, it is safer to do rounding, such as new BigDecimal(value).setScale(0, BigDecimal.ROUND_HALF_UP).intValue()

 

ID verification is always less than 18 years old

          In business needs, our ID card is verified, and people under the age of 18 are not allowed to handle business. I reported a question earlier. When an SA recorded a ticket, it indicated that he was under 18 years old, but from the ID card, he should be 20 years old. There is no problem with other people's records or other people's work number records. After the SAs launched a careful investigation, they finally found that his machine was different from others. The system time was still 11 years old, and it was better after changing the time.

          Ashamed, this should actually be a development problem. The development is to use js to verify the time in the front end. The current time taken by new Date() is compared with the birth date of the ID card, and js takes the time of the client. Therefore, there is a serious security vulnerability; here, it should be judged by the time of the server.

          I didn't know enough about the front end before, but it was a long experience.

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326827043&siteId=291194637