提交 771a60b5 作者: 张小凤

Cooperation(update)

上级 3a04cc50
...@@ -7,6 +7,7 @@ import lombok.Data; ...@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @Author LW * @Author LW
...@@ -36,4 +37,8 @@ public class ApplyTagEditVO implements Serializable { ...@@ -36,4 +37,8 @@ public class ApplyTagEditVO implements Serializable {
private Double lat; private Double lat;
@ApiModelProperty(value = "经度") @ApiModelProperty(value = "经度")
private Double lon; private Double lon;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "附件")
private List<AttachmentVO> attachmentList;
} }
...@@ -10,7 +10,6 @@ import java.io.Serializable; ...@@ -10,7 +10,6 @@ import java.io.Serializable;
/** /**
* @Author LW * @Author LW
*
* @date 2023/6/27 13:49 概要: * @date 2023/6/27 13:49 概要:
*/ */
@Data @Data
...@@ -18,9 +17,12 @@ import java.io.Serializable; ...@@ -18,9 +17,12 @@ import java.io.Serializable;
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class AttachmentVO implements Serializable { public class AttachmentVO implements Serializable {
@ApiModelProperty(value = "附件url") @ApiModelProperty(value = "附件url")
private String url; private String url;
@ApiModelProperty(value = "附件类型:0:图片 1:文件") @ApiModelProperty(value = "附件类型:0:图片 1:文件")
private Integer type; private Integer type;
@ApiModelProperty(value = "")
private Integer userApplyTagId;
} }
...@@ -76,4 +76,9 @@ public class UserApplyTagVO implements Serializable { ...@@ -76,4 +76,9 @@ public class UserApplyTagVO implements Serializable {
@ApiModelProperty(value = "品牌logo", example = "http://") @ApiModelProperty(value = "品牌logo", example = "http://")
private String brandLogo; private String brandLogo;
@ApiModelProperty(value = "营业执照", example = "http://")
private String licenseImg;
} }
...@@ -3,6 +3,7 @@ package com.mmc.iuav.user.dao; ...@@ -3,6 +3,7 @@ package com.mmc.iuav.user.dao;
import com.mmc.iuav.user.entity.*; import com.mmc.iuav.user.entity.*;
import com.mmc.iuav.user.model.qo.ApplyQO; import com.mmc.iuav.user.model.qo.ApplyQO;
import com.mmc.iuav.user.model.vo.ApplyTagEditVO; import com.mmc.iuav.user.model.vo.ApplyTagEditVO;
import com.mmc.iuav.user.model.vo.AttachmentVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -124,4 +125,8 @@ public interface CooperationDao { ...@@ -124,4 +125,8 @@ public interface CooperationDao {
void updateWebsiteInfo(ApplyTagEditVO applyTagEditVO); void updateWebsiteInfo(ApplyTagEditVO applyTagEditVO);
WebsiteInfoDO getWebsiteInfoByUserApplyId(Integer id); WebsiteInfoDO getWebsiteInfoByUserApplyId(Integer id);
void deleteApplyResource(Integer id);
void insertApplyResource(List<AttachmentVO> list);
} }
package com.mmc.iuav.user.entity; package com.mmc.iuav.user.entity;
import com.mmc.iuav.user.model.vo.ApplyTagEditVO; import com.mmc.iuav.user.model.vo.ApplyTagEditVO;
import com.mmc.iuav.user.model.vo.AttachmentVO;
import com.mmc.iuav.user.model.vo.UserApplyTagVO; import com.mmc.iuav.user.model.vo.UserApplyTagVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -9,6 +10,7 @@ import lombok.NoArgsConstructor; ...@@ -9,6 +10,7 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author: zj @Date: 2023/5/17 21:59 * @author: zj @Date: 2023/5/17 21:59
...@@ -44,6 +46,11 @@ public class UserApplyTagDO implements Serializable { ...@@ -44,6 +46,11 @@ public class UserApplyTagDO implements Serializable {
@ApiModelProperty(value = "品牌logo", example = "http://") @ApiModelProperty(value = "品牌logo", example = "http://")
private String brandLogo; private String brandLogo;
@ApiModelProperty(value = "营业执照", example = "http://")
private String licenseImg;
@ApiModelProperty(value = "附件", example = "http://")
private List<AttachmentVO> attachmentList;
/** /**
* 辅助字段end * 辅助字段end
*/ */
...@@ -63,6 +70,8 @@ public class UserApplyTagDO implements Serializable { ...@@ -63,6 +70,8 @@ public class UserApplyTagDO implements Serializable {
.score(score) .score(score)
.brandName(this.brandName) .brandName(this.brandName)
.brandLogo(this.brandLogo) .brandLogo(this.brandLogo)
.licenseImg(this.licenseImg)
.attachmentList(this.attachmentList)
.build(); .build();
} }
......
...@@ -169,7 +169,17 @@ public class CooperationServiceImpl implements CooperationService { ...@@ -169,7 +169,17 @@ public class CooperationServiceImpl implements CooperationService {
userApplyTagDO.setId(applyTagEditVO.getId()); userApplyTagDO.setId(applyTagEditVO.getId());
userApplyTagDO.setContent(applyTagEditVO.getContent()); userApplyTagDO.setContent(applyTagEditVO.getContent());
userApplyTagDO.setScore(applyTagEditVO.getScore()); userApplyTagDO.setScore(applyTagEditVO.getScore());
userApplyTagDO.setRemark(applyTagEditVO.getRemark());
cooperationDao.updateUserApplyTag(userApplyTagDO); cooperationDao.updateUserApplyTag(userApplyTagDO);
userApplyTagDO.setAttachmentList(applyTagEditVO.getAttachmentList());
List<AttachmentVO> attachmentList = userApplyTagDO.getAttachmentList();
if (null != attachmentList) {
cooperationDao.deleteApplyResource(applyTagEditVO.getId());
if (attachmentList.size() != 0) {
cooperationDao.insertApplyResource(userApplyTagDO.getAttachmentList());
}
}
// 保存网点之前判断该网点是否存在 存在则修改不存在则新增 // 保存网点之前判断该网点是否存在 存在则修改不存在则新增
WebsiteInfoDO websiteInfoDO = cooperationDao.getWebsiteInfoByUserApplyId(applyTagEditVO.getId()); WebsiteInfoDO websiteInfoDO = cooperationDao.getWebsiteInfoByUserApplyId(applyTagEditVO.getId());
if (websiteInfoDO == null) { if (websiteInfoDO == null) {
......
...@@ -4,6 +4,31 @@ ...@@ -4,6 +4,31 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.iuav.user.dao.CooperationDao"> <mapper namespace="com.mmc.iuav.user.dao.CooperationDao">
<resultMap id="UserApplyTagList" type="com.mmc.iuav.user.entity.UserApplyTagDO">
<result property="id" column="id"/>
<result property="cooperationTagId" column="cooperation_tag_id"/>
<result property="userAccountId" column="user_account_id"/>
<result property="applyName" column="apply_name"/>
<result property="applyPhone" column="apply_phone"/>
<result property="applyStatus" column="apply_status"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="content" column="content"/>
<result property="score" column="score"/>
<result property="tagName" column="tag_name"/>
<result property="companyName" column="company_name"/>
<result property="brandName" column="brand_name"/>
<result property="brandLogo" column="brand_logo"/>
<result property="licenseImg" column="license_img"/>
<collection property="attachmentList" ofType="com.mmc.iuav.user.entity.TagApplyResourceDO"
select="getUserApplyResource"
column="{id=id}">
</collection>
</resultMap>
<insert id="addApply" parameterType="com.mmc.iuav.user.entity.UserApplyTagDO" useGeneratedKeys="true" <insert id="addApply" parameterType="com.mmc.iuav.user.entity.UserApplyTagDO" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">
insert into user_apply_tag(cooperation_tag_id, user_account_id, apply_name, apply_phone, remark, create_time, insert into user_apply_tag(cooperation_tag_id, user_account_id, apply_name, apply_phone, remark, create_time,
...@@ -75,7 +100,7 @@ ...@@ -75,7 +100,7 @@
<if test="applyStatus != null"> <if test="applyStatus != null">
apply_status = #{applyStatus}, apply_status = #{applyStatus},
</if> </if>
<if test="remark != null"> <if test="remark != null and remark != '' ">
remark = #{remark}, remark = #{remark},
</if> </if>
<if test="content != null and content != ''"> <if test="content != null and content != ''">
...@@ -85,7 +110,7 @@ ...@@ -85,7 +110,7 @@
score = #{score} score = #{score}
</if> </if>
</set> </set>
WHERE id = #{id}; WHERE id = #{id}
</update> </update>
<update id="updateUserTag"> <update id="updateUserTag">
...@@ -179,7 +204,9 @@ ...@@ -179,7 +204,9 @@
</if> </if>
</where> </where>
</select> </select>
<select id="listUserApplyTag" resultType="com.mmc.iuav.user.entity.UserApplyTagDO">
<select id="listUserApplyTag" resultMap="UserApplyTagList">
SELECT SELECT
ua.id, ua.id,
ua.cooperation_tag_id, ua.cooperation_tag_id,
...@@ -194,7 +221,9 @@ ...@@ -194,7 +221,9 @@
ct.tag_name, ct.tag_name,
ca.company_name, ca.company_name,
ua.brand_name, ua.brand_name,
ua.brand_logo ua.brand_logo,
ca.credit_code,
ca.license_img
FROM FROM
user_apply_tag ua user_apply_tag ua
INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id
...@@ -280,4 +309,19 @@ ...@@ -280,4 +309,19 @@
from website_info from website_info
where user_apply_tag = #{id} where user_apply_tag = #{id}
</select> </select>
<delete id="deleteApplyResource" parameterType="java.lang.Integer">
DELETE
FROM tag_apply_resource
WHERE user_apply_tag_id = #{id}
</delete>
<insert id="insertApplyResource">
INSERT INTO tag_apply_resource(user_apply_tag_id,url,`type`,create_time,update_time) VALUES
<foreach collection="list" separator="," item="item">
(#{item.userApplyTagId},#{item.url},#{item.type},NOW(),NOW())
</foreach>
</insert>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论