Parcourir la source

Merge branch 'refs/heads/master' into master-碰一下

tanbin il y a 9 mois
Parent
commit
c3cb881fff

+ 0 - 1
device-api-service/src/main/java/com/xy/service/DeviceChargingServiceImpl.java

@@ -244,7 +244,6 @@ public class DeviceChargingServiceImpl extends ServiceImpl<DeviceChargingMapper,
             MercDto.Vo merc = mercService.obj(new MercDto.Vo().setId(mercId)).getData();
             // 佣金配置查询
             MercFeeConfigDto.FeeConfigByMercVO mercFeeConfig = R.feignCheckData(mercFeeConfigService.getFeeConfigByMerc(new MercFeeConfigDto.FeeConfigByMerc().setMercCode(merc.getMercCode())));
-            log.info("商户:{},设备管理费佣金", mercId, JSONUtil.toJsonPrettyStr(mercFeeConfig));
             // 设备管理费佣金
             Integer feeDevice = mercFeeConfig.getFeeDevice();
             for (DeviceChargingDto.PageVo record : records) {

+ 18 - 1
device-api-service/src/main/java/com/xy/service/DevicePartServiceImpl.java

@@ -1,10 +1,14 @@
 package com.xy.service;
 
+import cn.hutool.core.util.BooleanUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.yitter.idgen.YitIdHelper;
 import com.xy.dto.DevicePartDto;
 import com.xy.entity.DevicePart;
+import com.xy.entity.DeviceSysinfo;
 import com.xy.mapper.DevicePartMapper;
 import com.xy.utils.Emptys;
 import com.xy.utils.MybatisPlusQuery;
@@ -35,6 +39,8 @@ import static com.xy.utils.Beans.copy;
 @Api(tags = "设备配件表")
 public class DevicePartServiceImpl extends ServiceImpl<DevicePartMapper, DevicePart> implements DevicePartService {
 
+    private final DeviceSysinfoServiceImpl deviceSysinfoService;
+
     @ApiOperation("集合查询")
     @PostMapping("list")
     public R<List<DevicePartDto.Vo>> list(@RequestBody DevicePartDto.SelectList selectList) {
@@ -49,8 +55,9 @@ public class DevicePartServiceImpl extends ServiceImpl<DevicePartMapper, DeviceP
         LocalDateTime now = LocalDateTime.now();
         //循环处理
         saveOrUpdates.forEach(saveOrUpdate -> {
+            Long deviceId = saveOrUpdate.getDeviceId();
             DevicePart devicePart = getOne(new LambdaQueryWrapper<DevicePart>()
-                    .eq(DevicePart::getDeviceId, saveOrUpdate.getDeviceId())
+                    .eq(DevicePart::getDeviceId, deviceId)
                     .eq(DevicePart::getCode, saveOrUpdate.getCode())
             );
             //删除
@@ -58,6 +65,15 @@ public class DevicePartServiceImpl extends ServiceImpl<DevicePartMapper, DeviceP
                 removeById(devicePart.getId());
                 return;
             }
+
+            String code = saveOrUpdate.getCode();
+            //nfc 系统信息表更新
+            if (Emptys.check(code) && "zfbNfc".equals(code)) {
+                String value = saveOrUpdate.getValue();
+                JSONObject jsonObject = JSONUtil.parseObj(value);
+                boolean haveNfc = BooleanUtil.isTrue(jsonObject.getBool("is"));
+                deviceSysinfoService.updateById(new DeviceSysinfo().setDeviceId(deviceId).setIsHaveAlipayNpad(haveNfc));
+            }
             //新增
             if (devicePart == null) {
                 DevicePart info = copy(DevicePart.class, saveOrUpdate)
@@ -71,6 +87,7 @@ public class DevicePartServiceImpl extends ServiceImpl<DevicePartMapper, DeviceP
             if (Emptys.check(saveOrUpdate.getValue())) {
                 updateById(devicePart.setValue(saveOrUpdate.getValue()));
             }
+
         });
         return R.ok();
     }

+ 4 - 0
device-api-service/src/main/resources/mapper/DeviceChargingMapper.xml

@@ -54,6 +54,10 @@
         <if test="queryPage.deviceId != null">
             and di.device_id = #{queryPage.deviceId}
         </if>
+        <if test="queryPage.freezeStatus != null">
+            and di.freeze_status = #{queryPage.freezeStatus}
+        </if>
+
         <if test="queryPage.chargingStatus != null and queryPage.chargingStatus != ''">
             <!-- 即将过期 -->
             <if test="queryPage.chargingStatus == 1">

+ 4 - 0
device-api/src/main/java/com/xy/dto/DeviceChargingDto.java

@@ -84,6 +84,10 @@ public class DeviceChargingDto {
         @ApiModelProperty("设备id")
         private Long deviceId;
 
+        @ApiModelProperty("是否已冻结")
+        private Integer freezeStatus;
+
+
         @ApiModelProperty("状态类型 字典=device_charging_query_type")
         private Integer chargingStatus;