提交 e7f2e07d 作者: xiaowang

修复:修复网点编辑报错问题

上级 df5b953a
......@@ -20,6 +20,8 @@ import java.io.Serializable;
public class ApplyTagEditVO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "网点id")
private Integer websiteId;
@ApiModelProperty(value = "标签id")
private Integer cooperationTagId;
@ApiModelProperty(value = "网点名称")
......
......@@ -120,4 +120,8 @@ public interface CooperationDao {
int countServiceBitmapData(Integer type);
List<WebsiteInfoDO> listServiceBitmapData(Integer type, Double lon, Double lat, int pageNo, Integer pageSize);
void updateWebsiteInfo(ApplyTagEditVO applyTagEditVO);
WebsiteInfoDO getWebsiteInfoByUserApplyId(Integer id);
}
......@@ -162,8 +162,16 @@ public class CooperationServiceImpl implements CooperationService {
userApplyTagDO.setContent(applyTagEditVO.getContent());
userApplyTagDO.setScore(applyTagEditVO.getScore());
cooperationDao.updateUserApplyTag(userApplyTagDO);
// 保存网点信息
cooperationDao.addWebsiteInfo(applyTagEditVO);
// 保存网点之前判断该网点是否存在 存在则修改不存在则新增
WebsiteInfoDO websiteInfoDO = cooperationDao.getWebsiteInfoByUserApplyId(applyTagEditVO.getId());
if (websiteInfoDO == null) {
// 保存网点信息
cooperationDao.addWebsiteInfo(applyTagEditVO);
} else {
applyTagEditVO.setWebsiteId(websiteInfoDO.getId());
// 修改网点信息
cooperationDao.updateWebsiteInfo(applyTagEditVO);
}
return ResultBody.success();
}
......
......@@ -34,6 +34,27 @@
values (#{name}, #{address}, #{lat}, #{lon}, #{cooperationTagId}, #{id})
</insert>
<update id="updateWebsiteInfo">
update website_info
<set>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="address != null and address != ''">
address = #{address},
</if>
<if test="lat != null">
lat = #{lat},
</if>
<if test="lon != null">
lon = #{lon},
</if>
<if test="cooperationTagId != null">
type = #{cooperationTagId}
</if>
</set>
where id = #{websiteId}
</update>
<update id="updateUserApplyTag" parameterType="com.mmc.iuav.user.entity.UserApplyTagDO">
UPDATE user_apply_tag
<set>
......@@ -239,4 +260,15 @@
ORDER BY distance ASC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="getWebsiteInfoByUserApplyId" resultType="com.mmc.iuav.user.entity.WebsiteInfoDO">
select id,
`name`,
address,
lat,
lon,
`type`,
user_apply_tag
from website_info
where user_apply_tag = #{id}
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论