Просмотр исходного кода

Merge remote-tracking branch 'origin/develop' into develop

release_toaliyun_real
luozukai 6 лет назад
Родитель
Сommit
2b750c51dc
8 измененных файлов: 80 добавлений и 36 удалений
  1. +0
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/device/KwMerchantMeterController.java
  2. +1
    -1
      mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/dto/KwMerchantMeterDto.java
  4. +2
    -1
      mallinkService/src/main/java/com/iformall/domain/po/KwMeter.java
  5. +0
    -1
      mallinkService/src/main/java/com/iformall/mapper/KwMerchantMeterMapper.java
  6. +1
    -1
      mallinkService/src/main/resources/mapper/KwBoxMapper.xml
  7. +73
    -26
      mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml
  8. +1
    -1
      mallinkService/src/main/resources/mapper/KwMeterMapper.xml

+ 0
- 3
mallinkAdmin/src/main/java/com/iformall/controller/device/KwMerchantMeterController.java Просмотреть файл

@@ -60,9 +60,6 @@ public class KwMerchantMeterController extends BaseController {
KwMerchantMeterVo kwMerchantMeterVo = kwMerchantMeterService.getById(id);
if (kwMerchantMeterVo == null)
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);
kwMerchantMeterVo.getMeterList().stream().forEach(m->{
m.setLatestRecord(kwMeterDataService.findLastRecord(m.getId()));
});
return new ResultData(kwMerchantMeterVo);
}



+ 1
- 1
mallinkCallback/src/main/java/com/iformall/controller/device/KwBoxV1Controller.java Просмотреть файл

@@ -96,7 +96,7 @@ public class KwBoxV1Controller extends BaseController {
data.put(KwBoxService.PREFIX_SYS_STATUS,record.getRegisterStatus());
data.put(KwBoxService.PREFIX_COM_KEY,record.getComKey());
if (kwBox.getConfig() != null)
data.put(KwBoxService.PREFIX_CONFIG,kwBox.getConfig());
data.put(KwBoxService.PREFIX_CONFIG,JSONObject.parseObject(kwBox.getConfig()));
List<String> meters = kwBoxService.findMetersAddress(kwBox);
if (!meters.isEmpty())
data.put(KwBoxService.PREFIX_METERS,meters);


+ 2
- 2
mallinkService/src/main/java/com/iformall/domain/dto/KwMerchantMeterDto.java Просмотреть файл

@@ -21,10 +21,10 @@ public class KwMerchantMeterDto extends BaseEntity {
private String merchantName;

@io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson")
private String linkPerson;
private String merchantLinkPerson;

@io.swagger.annotations.ApiModelProperty(value="联系方式",name="linkPhone")
private String linkPhone;
private String merchantLinkPhone;

@io.swagger.annotations.ApiModelProperty(value="经营业态ID:参照wx_business表",name="businessId")
private Integer businessId;


+ 2
- 1
mallinkService/src/main/java/com/iformall/domain/po/KwMeter.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.domain.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@@ -17,7 +18,7 @@ import java.util.List;
*/
@Table(name = "kw_meter")
@Data
@ToString(callSuper = true)
@JsonIgnoreProperties(value = {"handler"})
@EqualsAndHashCode(callSuper = true)
public class KwMeter extends BaseEntity {
@Id


+ 0
- 1
mallinkService/src/main/java/com/iformall/mapper/KwMerchantMeterMapper.java Просмотреть файл

@@ -13,7 +13,6 @@ import java.util.List;
public interface KwMerchantMeterMapper extends CommonMapper<KwMerchantMeter, Long> {

List<KwMerchantMeterVo> findVoList(KwMerchantMeterDto param);

List<KwMerchantMeterDataVo> findDataVoList(KwMerchantMeterDataDto param);

KwMerchantMeterVo getById(@Param("merchantId")Long merchantId);


+ 1
- 1
mallinkService/src/main/resources/mapper/KwBoxMapper.xml Просмотреть файл

@@ -38,7 +38,7 @@
</if>
<if test=" null != imei ">
and `imei` = #{imei}
and `imei` like concat('%', #{imei},'%')
</if>
<if test=" null != iccid ">


+ 73
- 26
mallinkService/src/main/resources/mapper/KwMerchantMeterMapper.xml Просмотреть файл

@@ -10,7 +10,6 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>


</resultMap>
<sql id="allColumns">
@@ -73,10 +72,22 @@
<result column="box_id" jdbcType="BIGINT" property="boxId"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="bind_status" jdbcType="INTEGER" property="bindStatus"/>

<association column="{meterId=id}" property="latestRecord"
select="com.iformall.mapper.KwMeterDataMapper.findLastRecordList">
</association >

</resultMap>

<select id="findMeterList" parameterType="java.util.Map" resultMap="MeterBaseResultMap">
select m.* from kw_merchant_meter mm
<resultMap id="MeterSimpleResultMap" type="com.iformall.domain.po.KwMeter">
<id column="id" jdbcType="BIGINT" property="id"/>
<association column="{meterId=id}" property="latestRecord"
select="com.iformall.mapper.KwMeterDataMapper.findLastRecordList">
</association >
</resultMap>

<select id="findSimpleMeterList" parameterType="java.util.Map" resultMap="MeterSimpleResultMap">
select m.id from kw_merchant_meter mm
left join kw_meter m on mm.`meter_id` = m.id
where mm.`status` = 0
<if test=" null != merchantId ">
@@ -84,8 +95,16 @@
</if>
</select>

<select id="countMeterList" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(*) from kw_merchant_meter mm
left join kw_meter m on mm.`meter_id` = m.id
where mm.`status` = 0
<if test=" null != merchantId ">
and mm.`merchant_id` = #{merchantId}
</if>
</select>

<resultMap id="BaseResultMapVo" type="com.iformall.domain.vo.KwMerchantMeterVo">
<resultMap id="BaseResultMapListVo" type="com.iformall.domain.vo.KwMerchantMeterVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="status" jdbcType="INTEGER" property="status"/>
@@ -93,25 +112,22 @@
<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>

<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>
<association column="{merchantId=id}" property="meterCount"
select="com.iformall.mapper.KwMerchantMeterMapper.countMeterList">
</association>

<collection column="{merchantId=id}" property="meterList"
ofType="com.iformall.domain.po.kwMeter"
javaType="java.util.List"
select="com.iformall.mapper.KwMerchantMeterMapper.findMeterList">
select="com.iformall.mapper.KwMerchantMeterMapper.findSimpleMeterList">
</collection>

</resultMap>

<sql id="allColumnsVo">
`id`, `tenant_id`, `merchant_id`, `status`, `name`, `link_phone`
</sql>

<select id="findVoList" parameterType="com.iformall.domain.dto.KwMerchantMeterDto" resultMap="BaseResultMapVo">
<select id="findVoList" parameterType="com.iformall.domain.dto.KwMerchantMeterDto" resultMap="BaseResultMapListVo">
select <include refid="allColumnsVo"/>
from (
select merchant_id from kw_merchant_meter
@@ -133,8 +149,8 @@
and `name` like concat('%', #{merchantName},'%')
</if>

<if test=" null != linkPhone and ''!=linkPhone ">
and `link_phone` like concat('%', #{linkPhone},'%')
<if test=" null != merchantLinkPhone and ''!=merchantLinkPhone ">
and `link_phone` like concat('%', #{merchantLinkPhone},'%')
</if>

<if test=" null != merchantStatus ">
@@ -147,6 +163,49 @@

</select>

<select id="findMeterList" parameterType="java.util.Map" resultMap="MeterBaseResultMap">
select m.* from kw_merchant_meter mm
left join kw_meter m on mm.`meter_id` = m.id
where mm.`status` = 0
<if test=" null != merchantId ">
and mm.`merchant_id` = #{merchantId}
</if>
</select>


<resultMap id="BaseResultMapVo" type="com.iformall.domain.vo.KwMerchantMeterVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="status" jdbcType="INTEGER" property="status"/>

<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>

<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>

<collection column="{merchantId=id}" property="meterList"
ofType="com.iformall.domain.po.kwMeter"
javaType="java.util.List"
select="com.iformall.mapper.KwMerchantMeterMapper.findMeterList">
</collection>
</resultMap>

<select id="getById" parameterType="Long" resultMap="BaseResultMapVo">
select <include refid="allColumnsVo"/>
from (
select merchant_id from kw_merchant_meter
where `status` = 0
and `merchant_id` = #{merchantId}
group by merchant_id
) temp
, wx_merchant
where temp.merchant_id = id
</select>


<sql id="dynamicWhereConditionsVo">
where 1 = 1
@@ -240,18 +299,6 @@



<select id="getById" parameterType="java.lang.Long" resultMap="BaseResultMapVo">
select <include refid="allColumnsVo"/>
from (
select merchant_id from kw_merchant_meter
where `status` = 0
and `merchant_id` = #{merchantId}
group by merchant_id
) temp
, wx_merchant
where temp.merchant_id = id
</select>

<update id="unbindBatch" parameterType="java.lang.Long">
update kw_merchant_meter set status = 1
where status = 0


+ 1
- 1
mallinkService/src/main/resources/mapper/KwMeterMapper.xml Просмотреть файл

@@ -36,7 +36,7 @@
</if>
<if test=" null != address">
and `address` = #{address}
and `address` like concat('%', #{address},'%')
</if>
<if test=" null != brand and '' != brand ">


Загрузка…
Отмена
Сохранить