添加根据企业id查找单位

上级 03f8db84
......@@ -21,6 +21,8 @@ import java.util.List;
public class ApplyTagEditVO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "用户id")
private Integer companyInfoId;
@ApiModelProperty(value = "网点id")
private Integer websiteId;
@ApiModelProperty(value = "标签id")
......
......@@ -39,6 +39,8 @@ public interface CooperationDao {
*/
UserApplyTagDO getUserApplyTag(Integer id);
UserApplyTagDO getUserApplyTagByCompanyId(Integer companyId);
/**
* 根据合同编号查询用户
* @param contractNo
......
......@@ -300,12 +300,17 @@ public class CooperationServiceImpl implements CooperationService {
@Override
public ResultBody editUserApplyTag(ApplyTagEditVO applyTagEditVO) {
Integer companyInfoId = applyTagEditVO.getCompanyInfoId();
UserApplyTagDO userApplyTag = new UserApplyTagDO();
if(companyInfoId != null ){
userApplyTag = cooperationDao.getUserApplyTagByCompanyId(companyInfoId);
}else {
//判断当前服务商是否通过审核
UserApplyTagDO userApplyTag = cooperationDao.getUserApplyTag(applyTagEditVO.getId());
userApplyTag = cooperationDao.getUserApplyTag(applyTagEditVO.getId());
}
if (!userApplyTag.getApplyStatus().equals(1)) {
return ResultBody.error("当前服务商暂未通过审核!");
}
//if (StringUtils.isBlank(applyTagEditVO.getRemark())) {
UserApplyTagDO userApplyTagDO = new UserApplyTagDO();
userApplyTagDO.setId(applyTagEditVO.getId());
......@@ -314,7 +319,8 @@ public class CooperationServiceImpl implements CooperationService {
// }
cooperationDao.deleteApplyResource(applyTagEditVO.getId());
if (!CollectionUtils.isEmpty(applyTagEditVO.getAttachmentList())) {
applyTagEditVO.getAttachmentList().forEach(d -> d.setUserApplyTagId(userApplyTag.getId()));
UserApplyTagDO finalUserApplyTag = userApplyTag;
applyTagEditVO.getAttachmentList().forEach(d -> d.setUserApplyTagId(finalUserApplyTag.getId()));
cooperationDao.insertApplyResource(applyTagEditVO.getAttachmentList());
}
// 修改单位网点位置信息
......
......@@ -180,6 +180,41 @@
AND ua.is_deleted = 0
</select>
<select id="getUserApplyTagByCompanyId" resultMap="UserApplyTagResultMap">
SELECT ua.id,
ua.cooperation_tag_id,
ua.user_account_id,
ua.apply_name,
ua.apply_phone,
ua.apply_status,
ua.remark,
ua.create_time,
ua.order_no,
ct.tag_name,
ci.id AS company_info_id,
ci.company_name,
ci.brand_name,
ci.brand_logo,
ci.credit_code,
ci.license_img,
ci.address,
ci.lat,
ci.lon,
ci.content,
ci.score,
ci.profile_url,
cti.contract_no,
cti.sign_status
FROM user_apply_tag ua
INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = ua.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
left join contract_info cti on ua.order_no = cti.order_no
WHERE ci.id = #{companyInfoId}
AND ua.is_deleted = 0
</select>
<select id="getUserApplyTagByContractId" resultType="com.mmc.iuav.user.entity.UserApplyTagDO">
SELECT ua.id,
ua.cooperation_tag_id,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论