| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.common; |
| | | |
| | | import java.net.InetAddress; |
| | | import java.util.concurrent.ThreadLocalRandom; |
| | | |
| | | public class IdGeneratorUtils { |
| | | // æºå¨IDï¼0-31ï¼ |
| | | private static final long MACHINE_ID = getMachineId() & 31L; |
| | | // æ¶é´æ³å·¦ç§»ç使°ï¼22ä½ç»è®¡æ°å¨ï¼5ä½ç»æºå¨IDï¼ |
| | | private static final long TIMESTAMP_SHIFT = 22 + 5; |
| | | private static final long COUNTER_BITS = 22L; |
| | | private static final long MAX_COUNTER = (1L << COUNTER_BITS) - 1; |
| | | |
| | | private static long lastTimestamp = -1L; |
| | | private static long counter = 0L; |
| | | |
| | | public synchronized static long nextId() { |
| | | long timestamp = System.currentTimeMillis(); |
| | | |
| | | if (timestamp < lastTimestamp) { |
| | | throw new RuntimeException("Clock moved backwards"); |
| | | } |
| | | |
| | | if (timestamp == lastTimestamp) { |
| | | counter = (counter + 1) & MAX_COUNTER; |
| | | if (counter == 0) { |
| | | // å䏿¯«ç§å
计æ°å¨ç¨å®ï¼çå¾
ä¸ä¸æ¯«ç§ |
| | | timestamp = waitNextMillis(lastTimestamp); |
| | | } |
| | | } else { |
| | | counter = 0L; |
| | | } |
| | | |
| | | lastTimestamp = timestamp; |
| | | |
| | | return ((timestamp) << TIMESTAMP_SHIFT) | |
| | | (MACHINE_ID << COUNTER_BITS) | |
| | | counter; |
| | | } |
| | | |
| | | private static long waitNextMillis(long lastTimestamp) { |
| | | long timestamp = System.currentTimeMillis(); |
| | | while (timestamp <= lastTimestamp) { |
| | | timestamp = System.currentTimeMillis(); |
| | | } |
| | | return timestamp; |
| | | } |
| | | |
| | | private static long getMachineId() { |
| | | try { |
| | | // å¯ä»¥æ ¹æ®éè¦è·åæºå¨æ è¯ï¼æ¯å¦IPå°åæå䏿®µ |
| | | String hostAddress = InetAddress.getLocalHost().getHostAddress(); |
| | | return Long.parseLong(hostAddress.split("\\.")[3]); |
| | | } catch (Exception e) { |
| | | return ThreadLocalRandom.current().nextLong(32); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | private String donorno; |
| | | |
| | | /** |
| | | * æç®å»é¢ |
| | | */ |
| | | @ApiModelProperty("æç®å»é¢") |
| | | @Excel(name = "æç®å»é¢") |
| | | private String donateHospital; |
| | | |
| | | /** |
| | | * å¨å®è·åæºæç¼å· |
| | | */ |
| | | @ApiModelProperty("å¨å®è·åæºæç¼å·") |
| | |
| | | private String organname; |
| | | |
| | | /** |
| | | * æç®å»é¢ |
| | | */ |
| | | @ApiModelProperty("æç®å»é¢") |
| | | @Excel(name = "æç®å»é¢") |
| | | private String donateHospital ; |
| | | |
| | | /** |
| | | * å¨å®ç¼å· |
| | | */ |
| | | @ApiModelProperty("å¨å®ç¼å· ") |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.common.IdGeneratorUtils; |
| | | import com.ruoyi.project.domain.*; |
| | | import com.ruoyi.project.domain.vo.*; |
| | | import com.ruoyi.project.mapper.*; |
| | |
| | | return true; |
| | | } |
| | | |
| | | private static final AtomicLong COUNTER = new AtomicLong(System.currentTimeMillis()); |
| | | |
| | | private Map<String, List<Map<String, Object>>> formson_0832(List<ServiceFunddetailShared> serviceFunddetailSharedList) { |
| | | Map<String, List<Map<String, Object>>> allMap = new HashMap<>(); |
| | | |
| | |
| | | map.put("æ¶çäººå®¶å±æä¸å®¶", serviceFunddetailShared.getBeneficiaryname()); |
| | | map.put("ç¨åéé¢", serviceFunddetailShared.getTaxedamount()); |
| | | map.put("ä½åºæç»éé¢", null); |
| | | Long fpuuid = COUNTER.incrementAndGet(); |
| | | Long fpuuid = IdGeneratorUtils.nextId(); |
| | | map.put("å票éä»¶", ""); |
| | | if (StringUtils.isNotEmpty(invoicefiles)) { |
| | | map.put("å票éä»¶", fpuuid); |
| | |
| | | map.put("å票è¯å«", null); |
| | | map.put("è¯å«äºº", null); |
| | | map.put("ç¨é¢", serviceFunddetailShared.getTaxamount()); |
| | | long qtuuid = COUNTER.incrementAndGet(); |
| | | long qtuuid = IdGeneratorUtils.nextId(); |
| | | map.put("å
¶ä»éä»¶", ""); |
| | | if (StringUtils.isNotEmpty(annexfiles)) { |
| | | map.put("å
¶ä»éä»¶", qtuuid); |
| | |
| | | import com.ruoyi.common.utils.HttpClientKit; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.project.common.IdGeneratorUtils; |
| | | import com.ruoyi.project.domain.*; |
| | | import com.ruoyi.project.domain.dto.ServiceReimbursementDto; |
| | | import com.ruoyi.project.domain.vo.CheckFundVO; |
| | |
| | | return true; |
| | | } |
| | | |
| | | private static final AtomicLong COUNTER = new AtomicLong(System.currentTimeMillis()); |
| | | |
| | | private Map<String, List<Map<String, Object>>> formson_1210(List<ServiceReimbursementdetailShared> serviceReimbursementdetailSharedList) { |
| | | Map<String, List<Map<String, Object>>> allMap = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | |
| | | map.put("人åç±»å«", reimbursementdetailShared.getPersontype()); |
| | | map.put("ä½å®¿è´¹æ å", ""); |
| | | map.put("ä½å®¿è´¹æ åå计", reimbursementdetailShared.getHotelexpense()); |
| | | Long fpuuid = COUNTER.incrementAndGet(); |
| | | Long fpuuid = IdGeneratorUtils.nextId(); |
| | | map.put("å票éä»¶", fpuuid); |
| | | map.put("票æ®è¯å«", ""); |
| | | map.put("è¯å«äºº", ""); |
| | | map.put("åºå·1", ""); |
| | | Long qtuuid = COUNTER.incrementAndGet(); |
| | | Long qtuuid = IdGeneratorUtils.nextId(); |
| | | map.put("å
¶ä»éä»¶", qtuuid); |
| | | map.put("ä¸ªäººç¥¨å¤¹ç¨æ·", ""); |
| | | map.put("è¯å«ç¥¨æ®", ""); |
| | |
| | | <result property="coordinatorOutOperating" column="coordinator_out_operating"/> |
| | | <result property="coordinatorSign" column="coordinator_sign"/> |
| | | <result property="coordinatorSignTime" column="coordinator_sign_time"/> |
| | | <result property="donateHospital" column="donate_hospital"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectServiceDonationwitnessVo"> |
| | | select ID, |
| | | InfoID, |
| | | donate_hospital, |
| | | coordinator_in_operating, |
| | | coordinator_out_operating, |
| | | coordinator_sign, |
| | |
| | | <include refid="selectServiceDonationwitnessVo"/> |
| | | <where> |
| | | <if test="donorno != null and donorno != ''">and DonorNo = #{donorno}</if> |
| | | <if test="donateHospital != null and donateHospital != ''">and donate_hospital = #{donateHospital}</if> |
| | | <if test="gainhospitalname != null and gainhospitalname != ''">and GainHospitalName like concat('%', |
| | | #{gainhospitalname}, '%') |
| | | </if> |
| | |
| | | `service_donationwitness`.`coordinator_out_operating` AS `coordinatorOutOperating`, |
| | | `service_donationwitness`.`coordinator_sign` AS `coordinatorSign`, |
| | | `service_donationwitness`.`coordinator_sign_time` AS `coordinatorSignTime` |
| | | `service_donationwitness`.`donate_hospital` AS `donate_hospital` |
| | | FROM |
| | | `service_donatebaseinfo` |
| | | LEFT JOIN `service_donationwitness` ON |
| | |
| | | w.del_flag=0 |
| | | and b.del_flag=0 |
| | | <if test="starttime != null ">and w.OperationBegTime >= #{starttime}</if> |
| | | <if test="donateHospital != null ">and w.donate_hospital >= #{donateHospital}</if> |
| | | <if test="endtime != null ">and w.OperationBegTime <= #{endtime}</if> |
| | | <if test="city != null and city != ''">and o.City = #{city}</if> |
| | | <if test="reporterno != null and reporterno != ''">and b.ReporterNo = #{reporterno}</if> |