提交 45028d2c 作者: zhenjie

Merge branch 'develop' of ssh://git.mmcuav.cn:8222/iuav/cms into develop-rcd

package com.mmc.iuav.user.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author LW
* @date 2022/4/22 10:02
* 概要:
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WebsiteRangeDTO implements Serializable {
private String address;
private String name;
private Double lon;
private Double lat;
private Double distance;
}
...@@ -11,36 +11,38 @@ import javax.validation.constraints.NotNull; ...@@ -11,36 +11,38 @@ import javax.validation.constraints.NotNull;
/** /**
* @Author LW * @Author LW
*
* @date 2023/6/27 14:59 概要: * @date 2023/6/27 14:59 概要:
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class ApplyQO { public class ApplyQO {
@ApiModelProperty(value = "申请加盟类型", example = "1") @ApiModelProperty(value = "申请加盟类型", example = "1")
private Integer cooperationTagId; private Integer cooperationTagId;
@ApiModelProperty(value = "申请状态", example = "0") @ApiModelProperty(value = "申请状态", example = "0")
private Integer applyStatus; private Integer applyStatus;
@ApiModelProperty(value = "开始时间", example = "2023-01-01 00:00:00") @ApiModelProperty(value = "认证公司名称", example = "科比特")
private String startTime; private String companyName;
@ApiModelProperty(value = "结束时间", example = "2023-12-31 23:59:59") @ApiModelProperty(value = "开始时间", example = "2023-01-01 00:00:00")
private String endTime; private String startTime;
@ApiModelProperty(value = "页码", required = true, example = "1") @ApiModelProperty(value = "结束时间", example = "2023-12-31 23:59:59")
@NotNull(message = "页码不能为空", groups = Page.class) private String endTime;
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10") @ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull(message = "每页显示数不能为空", groups = Page.class) @NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class) @Min(value = 1, groups = Page.class)
private Integer pageSize; private Integer pageNo;
public void buildCurrentPage() { @ApiModelProperty(value = "每页显示数", required = true, example = "10")
this.pageNo = (pageNo - 1) * pageSize; @NotNull(message = "每页显示数不能为空", groups = Page.class)
} @Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
} }
package com.mmc.iuav.user.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author LW
* @date 2023/7/15 10:10
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
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 = "网点名称")
private String name;
@ApiModelProperty(value = "服务资质")
private String content;
@ApiModelProperty(value = "服务评价分数")
private Integer score;
@ApiModelProperty(value = "地址信息")
private String address;
@ApiModelProperty(value = "纬度")
private Double lat;
@ApiModelProperty(value = "经度")
private Double lon;
}
...@@ -21,44 +21,53 @@ import java.util.List; ...@@ -21,44 +21,53 @@ import java.util.List;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class UserApplyTagVO implements Serializable { public class UserApplyTagVO implements Serializable {
private static final long serialVersionUID = -1004953417393220972L; private static final long serialVersionUID = -1004953417393220972L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "加盟标签id") @ApiModelProperty(value = "加盟标签id")
@NotNull( @NotNull(
message = "加盟标签id不能为空", message = "加盟标签id不能为空",
groups = {Insert.class}) groups = {Insert.class})
private Integer cooperationTagId; private Integer cooperationTagId;
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private Integer userAccountId; private Integer userAccountId;
@ApiModelProperty(value = "申请人名称") @ApiModelProperty(value = "申请人名称")
@NotBlank( @NotBlank(
message = "申请人名称不能为空", message = "申请人名称不能为空",
groups = {Insert.class}) groups = {Insert.class})
private String applyName; private String applyName;
@ApiModelProperty(value = "申请人手机号") @ApiModelProperty(value = "申请人手机号")
@NotBlank( @NotBlank(
message = "申请人手机号不能为空", message = "申请人手机号不能为空",
groups = {Insert.class}) groups = {Insert.class})
private String applyPhone; private String applyPhone;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "附件") @ApiModelProperty(value = "附件")
private List<AttachmentVO> attachmentList; private List<AttachmentVO> attachmentList;
@ApiModelProperty(value = "申请时间") @ApiModelProperty(value = "申请时间")
private Date applyTime; private Date applyTime;
@ApiModelProperty(value = "加盟类型名称") @ApiModelProperty(value = "加盟类型名称")
private String cooperationTagName; private String cooperationTagName;
@ApiModelProperty(value = "审批状态 0:申请中 1:通过 2:驳回") @ApiModelProperty(value = "认证企业名称")
private Integer approvalStatus; private String companyName;
@ApiModelProperty(value = "审批状态 0:申请中 1:通过 2:驳回")
private Integer approvalStatus;
@ApiModelProperty(value = "服务资质内容")
private String content;
@ApiModelProperty(value = "服务评价⭐⭐⭐⭐⭐")
private Integer score;
} }
...@@ -44,7 +44,9 @@ public enum ResultEnum implements BaseErrorInfoInterface { ...@@ -44,7 +44,9 @@ public enum ResultEnum implements BaseErrorInfoInterface {
UPDATE_OWNER_ROLE_MENUS_ERROR("8007", "禁止修改与当前登录账号角色相同的角色权限"), UPDATE_OWNER_ROLE_MENUS_ERROR("8007", "禁止修改与当前登录账号角色相同的角色权限"),
UPDATE_OWNER_ROLE_ERROR("8008", "禁止修改当前账号的角色"), UPDATE_OWNER_ROLE_ERROR("8008", "禁止修改当前账号的角色"),
UPDATE_ADMIN_ROLE_ERROR("8009", "禁止修改admin账号的角色"), UPDATE_ADMIN_ROLE_ERROR("8009", "禁止修改admin账号的角色"),
ONLY_ONE_ADMIN_ERROR("8010", "禁止该账号获取超级管理员角色"); ONLY_ONE_ADMIN_ERROR("8010", "禁止该账号获取超级管理员角色"),
DELETE_ADMIN_ERROR("8011", "禁止删除超级管理员角色账号"),
DELETE_YOURSELF_ERROR("8011", "禁止删除自己的账号");
/** /**
* 错误码 * 错误码
......
...@@ -47,7 +47,7 @@ public class BackUserAccountController extends BaseController { ...@@ -47,7 +47,7 @@ public class BackUserAccountController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("removeBAccount") @GetMapping("removeBAccount")
public ResultBody disableBAccount(@RequestParam Integer userAccountId, HttpServletRequest request) { public ResultBody disableBAccount(@RequestParam Integer userAccountId, HttpServletRequest request) {
return backUserAccountService.disableBAccount(userAccountId); return backUserAccountService.disableBAccount(userAccountId, this.getUserLoginInfoFromRedis(request).getUserAccountId());
} }
@ApiOperation(value = "账号-列表") @ApiOperation(value = "账号-列表")
......
...@@ -4,15 +4,9 @@ import com.mmc.iuav.group.Insert; ...@@ -4,15 +4,9 @@ import com.mmc.iuav.group.Insert;
import com.mmc.iuav.group.Update; import com.mmc.iuav.group.Update;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.qo.ApplyQO; import com.mmc.iuav.user.model.qo.ApplyQO;
import com.mmc.iuav.user.model.vo.CooperationTagVO; import com.mmc.iuav.user.model.vo.*;
import com.mmc.iuav.user.model.vo.UserApplyTagDetailsVO;
import com.mmc.iuav.user.model.vo.UserApplyTagVO;
import com.mmc.iuav.user.model.vo.UserCooperationTagVO;
import com.mmc.iuav.user.service.CooperationService; import com.mmc.iuav.user.service.CooperationService;
import io.swagger.annotations.Api; import io.swagger.annotations.*;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -27,76 +21,102 @@ import java.util.List; ...@@ -27,76 +21,102 @@ import java.util.List;
@RequestMapping("/cooperation/") @RequestMapping("/cooperation/")
@RestController @RestController
public class CooperationController extends BaseController { public class CooperationController extends BaseController {
@Autowired private CooperationService cooperationService; @Autowired
private CooperationService cooperationService;
@ApiOperation(value = "加盟标签列表") @ApiOperation(value = "加盟标签列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class)})
@GetMapping("listTag") @GetMapping("listTag")
public ResultBody listTag() { public ResultBody listTag() {
return ResultBody.success(cooperationService.listTag()); return ResultBody.success(cooperationService.listTag());
} }
@ApiOperation(value = "根据id获取标签信息") @ApiOperation(value = "根据id获取标签信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class)})
@GetMapping("getTagById") @GetMapping("getTagById")
public ResultBody getTagById(@RequestParam("id") Integer id) { public ResultBody getTagById(@RequestParam("id") Integer id) {
return cooperationService.getTagById(id); return cooperationService.getTagById(id);
} }
@ApiOperation(value = "申请加盟") @ApiOperation(value = "申请加盟")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("apply") @PostMapping("apply")
public ResultBody apply( public ResultBody apply(
@Validated(value = {Insert.class}) @RequestBody UserApplyTagVO userApplyTagVO, @Validated(value = {Insert.class}) @RequestBody UserApplyTagVO userApplyTagVO,
HttpServletRequest request) { HttpServletRequest request) {
Integer userAccountId = this.getUserLoginInfoFromRedis(request).getUserAccountId(); Integer userAccountId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
userApplyTagVO.setUserAccountId(userAccountId); userApplyTagVO.setUserAccountId(userAccountId);
return cooperationService.apply(userApplyTagVO); return cooperationService.apply(userApplyTagVO);
} }
@ApiOperation(value = "后台-申请列表") @ApiOperation(value = "后台-申请列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UserApplyTagVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = UserApplyTagVO.class)})
@PostMapping("listUserApplyTag") @PostMapping("listUserApplyTag")
public ResultBody<UserApplyTagVO> listUserApplyTag(@RequestBody ApplyQO applyQO) { public ResultBody<UserApplyTagVO> listUserApplyTag(@RequestBody ApplyQO applyQO) {
return ResultBody.success(cooperationService.listUserApplyTag(applyQO)); return ResultBody.success(cooperationService.listUserApplyTag(applyQO));
} }
@ApiOperation(value = "强制删除") @ApiOperation(value = "后台-编辑服务商信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("deleteApplyTag") @PostMapping("editUserApplyTag")
public ResultBody deleteApplyTag(Integer id) { public ResultBody editUserApplyTag(@RequestBody ApplyTagEditVO applyTagEditVO) {
return ResultBody.success(cooperationService.deleteApplyTag(id)); return cooperationService.editUserApplyTag(applyTagEditVO);
} }
@ApiOperation(value = "审批详情") @ApiOperation(value = "后台-编辑详情信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UserApplyTagDetailsVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ApplyTagEditVO.class)})
@GetMapping("applyTagDetails") @GetMapping("editUserApplyTagDetails")
public ResultBody applyTagDetails( public ResultBody editUserApplyTagDetails(@RequestParam Integer id) {
@RequestParam(value = "id") Integer id, return cooperationService.editUserApplyTagDetails(id);
@RequestParam(value = "userAccountId") Integer userAccountId) { }
return cooperationService.applyTagDetails(id, userAccountId);
}
@ApiOperation(value = "审批") @ApiOperation(value = "服务商网点数据")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("approvalApplyTag") @GetMapping("service/bitmap")
public ResultBody approvalApplyTag( public ResultBody listServiceBitmapData(@ApiParam(value = "类型 注:按照渠道标签的id传入即可") @RequestParam Integer type,
@RequestParam(value = "id") Integer id, @RequestParam(value = "status") Boolean status) { @RequestParam Integer pageNo,
return cooperationService.approvalApplyTag(id, status); @RequestParam Integer pageSize,
} @RequestParam Double lon,
@RequestParam Double lat) {
return ResultBody.success(cooperationService.listServiceBitmapData(type, pageNo, pageSize, lon, lat));
}
@ApiOperation(value = "后台设置小程序用户标签") @ApiOperation(value = "强制删除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("changeUserTag") @GetMapping("deleteApplyTag")
public ResultBody changeUserTag( public ResultBody deleteApplyTag(Integer id) {
@Validated(Update.class) @RequestBody UserCooperationTagVO userCooperationTagVO) { return ResultBody.success(cooperationService.deleteApplyTag(id));
return cooperationService.changeUserTag(userCooperationTagVO); }
}
@ApiOperation(value = "获取合作渠道标签", hidden = true) @ApiOperation(value = "审批详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = UserApplyTagDetailsVO.class)})
@GetMapping("feignListCooperationTag") @GetMapping("applyTagDetails")
public List<CooperationTagVO> feignListCooperationTag() { public ResultBody applyTagDetails(
return cooperationService.listTag(); @RequestParam(value = "id") Integer id,
} @RequestParam(value = "userAccountId") Integer userAccountId) {
return cooperationService.applyTagDetails(id, userAccountId);
}
@ApiOperation(value = "审批")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("approvalApplyTag")
public ResultBody approvalApplyTag(
@RequestParam(value = "id") Integer id, @RequestParam(value = "status") Boolean status) {
return cooperationService.approvalApplyTag(id, status);
}
@ApiOperation(value = "后台设置小程序用户标签")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("changeUserTag")
public ResultBody changeUserTag(
@Validated(Update.class) @RequestBody UserCooperationTagVO userCooperationTagVO) {
return cooperationService.changeUserTag(userCooperationTagVO);
}
@ApiOperation(value = "获取合作渠道标签", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class)})
@GetMapping("feignListCooperationTag")
public List<CooperationTagVO> feignListCooperationTag() {
return cooperationService.listTag();
}
} }
...@@ -69,7 +69,6 @@ public class RoleController extends BaseController { ...@@ -69,7 +69,6 @@ public class RoleController extends BaseController {
return roleService.listRoleMenuInfo(roleId); return roleService.listRoleMenuInfo(roleId);
} }
@ApiOperation(value = "修改角色菜单权限") @ApiOperation(value = "修改角色菜单权限")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("updateRoleMenuInfo") @PostMapping("updateRoleMenuInfo")
......
package com.mmc.iuav.user.dao; package com.mmc.iuav.user.dao;
import com.mmc.iuav.user.entity.CooperationTagDO; import com.mmc.iuav.user.entity.*;
import com.mmc.iuav.user.entity.TagApplyResourceDO;
import com.mmc.iuav.user.entity.UserApplyTagDO;
import com.mmc.iuav.user.entity.UserTagDO;
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 org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -16,91 +14,94 @@ import java.util.Set; ...@@ -16,91 +14,94 @@ import java.util.Set;
*/ */
@Mapper @Mapper
public interface CooperationDao { public interface CooperationDao {
/** /**
* 加盟标签列表 * 加盟标签列表
* *
* @return * @return
*/ */
List<CooperationTagDO> listTags(); List<CooperationTagDO> listTags();
/** /**
* 加盟申请 * 加盟申请
* *
* @param userApplyTagDO * @param userApplyTagDO
*/ */
void addApply(UserApplyTagDO userApplyTagDO); void addApply(UserApplyTagDO userApplyTagDO);
/** /**
* 根据id获取合作申请 * 根据id获取合作申请
* *
* @param id * @param id
* @return * @return
*/ */
UserApplyTagDO getUserApplyTag(Integer id); UserApplyTagDO getUserApplyTag(Integer id);
/** /**
* 修改用户申请 * 修改用户申请
* *
* @param userApplyTagDO * @param userApplyTagDO
*/ */
void updateUserApplyTag(UserApplyTagDO userApplyTagDO); void updateUserApplyTag(UserApplyTagDO userApplyTagDO);
/** /**
* 根据用户id查询合作标签信息 * 根据用户id查询合作标签信息
*
* @param userAccountId * @param userAccountId
* @return * @return
*/ */
List<CooperationTagDO> listUserCooperationTag(Integer userAccountId); List<CooperationTagDO> listUserCooperationTag(Integer userAccountId);
/** /**
* 用户设置渠道等级 * 用户设置渠道等级
* *
* @param userTagDO * @param userTagDO
*/ */
void insertUserTag(UserTagDO userTagDO); void insertUserTag(UserTagDO userTagDO);
/** /**
* 修改用户渠道等级 * 修改用户渠道等级
* *
* @param userTagDO * @param userTagDO
*/ */
void updateUserTag(UserTagDO userTagDO); void updateUserTag(UserTagDO userTagDO);
/** /**
* 根据id查询标签信息 * 根据id查询标签信息
* *
* @param id * @param id
* @return * @return
*/ */
CooperationTagDO getTagById(Integer id); CooperationTagDO getTagById(Integer id);
/** /**
* 添加加盟入驻的附件资源 * 添加加盟入驻的附件资源
* *
* @param tagApplyResourceDO 标签应用资源做 * @param tagApplyResourceDO 标签应用资源做
*/ */
void addApplyResource(TagApplyResourceDO tagApplyResourceDO); void addApplyResource(TagApplyResourceDO tagApplyResourceDO);
int countListUserApplyTag(ApplyQO applyQO); int countListUserApplyTag(ApplyQO applyQO);
List<UserApplyTagDO> listUserApplyTag(ApplyQO applyQO); List<UserApplyTagDO> listUserApplyTag(ApplyQO applyQO);
void deleteApplyTag(Integer id); void deleteApplyTag(Integer id);
List<TagApplyResourceDO> getUserApplyResource(Integer id); List<TagApplyResourceDO> getUserApplyResource(Integer id);
void updateApplyTagStatus(Integer id, int i); void updateApplyTagStatus(Integer id, int i);
int userTagInfo(Integer cooperationTagId, Integer userAccountId); int userTagInfo(Integer cooperationTagId, Integer userAccountId);
/** /**
* 删除用户原来的标签 * 删除用户原来的标签
*
* @param userAccountId * @param userAccountId
*/ */
void removeUserTag(Integer userAccountId); void removeUserTag(Integer userAccountId);
/** /**
* 添加用户合作加盟标签 * 添加用户合作加盟标签
*
* @param userAccountId * @param userAccountId
* @param cooperationTagIds * @param cooperationTagIds
*/ */
...@@ -108,8 +109,19 @@ public interface CooperationDao { ...@@ -108,8 +109,19 @@ public interface CooperationDao {
/** /**
* 根据用户id查询用户拥有的合作标签 * 根据用户id查询用户拥有的合作标签
*
* @param uIds * @param uIds
* @return * @return
*/ */
List<CooperationTagDO> listUserCooperationTagByUIds(@Param("uIds") List<Integer> uIds); List<CooperationTagDO> listUserCooperationTagByUIds(@Param("uIds") List<Integer> uIds);
void addWebsiteInfo(ApplyTagEditVO applyTagEditVO);
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);
} }
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.UserApplyTagVO; import com.mmc.iuav.user.model.vo.UserApplyTagVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -15,38 +16,61 @@ import java.util.Date; ...@@ -15,38 +16,61 @@ import java.util.Date;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class UserApplyTagDO implements Serializable { public class UserApplyTagDO implements Serializable {
private static final long serialVersionUID = -7581203992821286124L; private static final long serialVersionUID = -7581203992821286124L;
private Integer id; private Integer id;
private Integer cooperationTagId; private Integer cooperationTagId;
private Integer userAccountId; private Integer userAccountId;
private String applyName; private String applyName;
private String applyPhone; private String applyPhone;
private String remark; private String remark;
private Date createTime; private Date createTime;
private Integer applyStatus; private Integer applyStatus;
private String content;
private Integer score;
/** 辅助字段start */ /**
private String tagName; * 辅助字段start
/** 辅助字段end */ */
public UserApplyTagVO buildUserApplyTagVO() { private String tagName;
return UserApplyTagVO.builder() private String companyName;
.id(id) private String address;
.cooperationTagId(cooperationTagId) private String name;
.userAccountId(this.userAccountId) private Double lat;
.applyName(this.applyName) private Double lon;
.applyPhone(this.applyPhone)
.remark(this.remark)
.applyTime(createTime)
.approvalStatus(applyStatus)
.cooperationTagName(tagName)
.build();
}
public UserApplyTagDO(UserApplyTagVO userApplyTagVO) { /**
this.cooperationTagId = userApplyTagVO.getCooperationTagId(); * 辅助字段end
this.userAccountId = userApplyTagVO.getUserAccountId(); */
this.applyName = userApplyTagVO.getApplyName(); public UserApplyTagVO buildUserApplyTagVO() {
this.applyPhone = userApplyTagVO.getApplyPhone(); return UserApplyTagVO.builder()
this.remark = userApplyTagVO.getRemark(); .id(id)
} .cooperationTagId(cooperationTagId)
.userAccountId(this.userAccountId)
.applyName(this.applyName)
.applyPhone(this.applyPhone)
.remark(this.remark)
.applyTime(createTime)
.approvalStatus(applyStatus)
.cooperationTagName(tagName)
.companyName(companyName)
.content(content)
.score(score)
.build();
}
public UserApplyTagDO(UserApplyTagVO userApplyTagVO) {
this.cooperationTagId = userApplyTagVO.getCooperationTagId();
this.userAccountId = userApplyTagVO.getUserAccountId();
this.applyName = userApplyTagVO.getApplyName();
this.applyPhone = userApplyTagVO.getApplyPhone();
this.remark = userApplyTagVO.getRemark();
}
public ApplyTagEditVO buildApplyTagEditVO() {
return ApplyTagEditVO.builder().id(id)
.cooperationTagId(cooperationTagId).name(name)
.address(address).lat(lat).lon(lon)
.content(content).score(score)
.build();
}
} }
package com.mmc.iuav.user.entity;
import com.mmc.iuav.user.model.dto.WebsiteRangeDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author LW
* @date 2022/4/21 20:09 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WebsiteInfoDO implements Serializable {
private Integer id;
private String name;
private String address;
private Double lat;
private Double lon;
private Double distance;
private Integer type;
private Integer userApplyTag;
public WebsiteRangeDTO buildWebsiteRangeDTO() {
this.distance = this.distance == null ? 0 : (BigDecimal.valueOf(this.distance).setScale(2, BigDecimal.ROUND_HALF_DOWN)).doubleValue();
return WebsiteRangeDTO.builder()
.name(name)
.address(address)
.lon(this.lon)
.lat(this.lat)
.distance(this.distance / 1000)
.build();
}
}
...@@ -34,10 +34,11 @@ public interface BackUserAccountService { ...@@ -34,10 +34,11 @@ public interface BackUserAccountService {
/** /**
* 禁用后台用户 * 禁用后台用户
* *
* @param userAccountId * @param accountId
* @param backUserAccountId
* @return * @return
*/ */
ResultBody disableBAccount(Integer userAccountId); ResultBody disableBAccount(Integer accountId, Integer backUserAccountId);
/** /**
* 后台用户列表 * 后台用户列表
......
...@@ -3,52 +3,59 @@ package com.mmc.iuav.user.service; ...@@ -3,52 +3,59 @@ package com.mmc.iuav.user.service;
import com.mmc.iuav.page.PageResult; import com.mmc.iuav.page.PageResult;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
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.CooperationTagVO; import com.mmc.iuav.user.model.vo.CooperationTagVO;
import com.mmc.iuav.user.model.vo.UserApplyTagVO; import com.mmc.iuav.user.model.vo.UserApplyTagVO;
import com.mmc.iuav.user.model.vo.UserCooperationTagVO; import com.mmc.iuav.user.model.vo.UserCooperationTagVO;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* @author: zj @Date: 2023/5/17 21:19 * @author: zj @Date: 2023/5/17 21:19
*/ */
public interface CooperationService { public interface CooperationService {
/** /**
* 加盟标签列表 * 加盟标签列表
* *
* @return * @return
*/ */
List<CooperationTagVO> listTag(); List<CooperationTagVO> listTag();
/** /**
* 用户申请加盟 * 用户申请加盟
* *
* @param cooperationTagVO * @param cooperationTagVO
* @return * @return
*/ */
ResultBody apply(UserApplyTagVO cooperationTagVO); ResultBody apply(UserApplyTagVO cooperationTagVO);
/** /**
* 后台用户设置小程序用户等级标签 * 后台用户设置小程序用户等级标签
*
* @param userCooperationTagVO * @param userCooperationTagVO
* @return * @return
*/ */
ResultBody changeUserTag(UserCooperationTagVO userCooperationTagVO); ResultBody changeUserTag(UserCooperationTagVO userCooperationTagVO);
/** /**
* 根据ID查询标签信息 * 根据ID查询标签信息
* *
* @param id * @param id
* @return * @return
*/ */
ResultBody getTagById(Integer id); ResultBody getTagById(Integer id);
PageResult listUserApplyTag(ApplyQO applyQO);
ResultBody deleteApplyTag(Integer id);
ResultBody applyTagDetails(Integer id, Integer userAccountId);
PageResult listUserApplyTag(ApplyQO applyQO); ResultBody approvalApplyTag(Integer id, Boolean status);
ResultBody deleteApplyTag(Integer id); ResultBody editUserApplyTag(ApplyTagEditVO applyTagEditVO);
ResultBody applyTagDetails(Integer id, Integer userAccountId); ResultBody editUserApplyTagDetails(Integer id);
ResultBody approvalApplyTag(Integer id, Boolean status); PageResult listServiceBitmapData(Integer type, Integer pageNo, Integer pageSize, Double lon, Double lat);
} }
...@@ -47,24 +47,25 @@ public class BackUserAccountServiceImpl implements BackUserAccountService { ...@@ -47,24 +47,25 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
public ResultBody insertBAccount(BUserAccountVO bUserAccountVO) { public ResultBody insertBAccount(BUserAccountVO bUserAccountVO) {
if (!bUserAccountVO.getPassWord().equals(bUserAccountVO.getAlertPwd())) { if (!bUserAccountVO.getPassWord().equals(bUserAccountVO.getAlertPwd())) {
// 两次密码不一致 // 两次密码不一致
throw new BizException(ResultEnum.PWD_ALERT_ERROR); return ResultBody.error(ResultEnum.PWD_ALERT_ERROR);
} }
// 获取新增的账户名是否已经存在 // 获取新增的账户名是否已经存在
int count = backUserAccountDao.countUserAccountNo(null, bUserAccountVO.getAccountNo()); int count = backUserAccountDao.countUserAccountNo(null, bUserAccountVO.getAccountNo());
if (count > 0) { if (count > 0) {
throw new BizException(ResultEnum.ADD_USER_ACCOUNT_NAME_EXISTS); return ResultBody.error(ResultEnum.ADD_USER_ACCOUNT_NAME_EXISTS);
} }
if (bUserAccountVO.getRoleId().equals(RoleEnums.ADMIN.getId())) { if (bUserAccountVO.getRoleId().equals(RoleEnums.ADMIN.getId())) {
throw new BizException(ResultEnum.ONLY_ONE_ADMIN_ERROR); return ResultBody.error(ResultEnum.ONLY_ONE_ADMIN_ERROR);
} }
roleDao.insertUserRoleRel(bUserAccountVO.getId(), bUserAccountVO.getRoleId());
BackUserAccountDO backUserAccountDO = new BackUserAccountDO(bUserAccountVO); BackUserAccountDO backUserAccountDO = new BackUserAccountDO(bUserAccountVO);
try { try {
backUserAccountDO.setPassword(PwdUtil.securityPwd(bUserAccountVO.getPassWord())); backUserAccountDO.setPassword(PwdUtil.securityPwd(bUserAccountVO.getPassWord()));
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
throw new BizException(ResultEnum.PWD_CREATE_ERROR); return ResultBody.error(ResultEnum.PWD_CREATE_ERROR);
} }
backUserAccountDao.insertBackUserAccount(backUserAccountDO); backUserAccountDao.insertBackUserAccount(backUserAccountDO);
// 添加角色
roleDao.insertUserRoleRel(backUserAccountDO.getId(), bUserAccountVO.getRoleId());
// 添加单位信息 // 添加单位信息
if (bUserAccountVO.getCompanyId() != null) { if (bUserAccountVO.getCompanyId() != null) {
CompanyBackUserDO companyBackUserDO = new CompanyBackUserDO(); CompanyBackUserDO companyBackUserDO = new CompanyBackUserDO();
...@@ -86,35 +87,43 @@ public class BackUserAccountServiceImpl implements BackUserAccountService { ...@@ -86,35 +87,43 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
throw new BizException(ResultEnum.UPDATE_USER_ACCOUNT_REPEAT); throw new BizException(ResultEnum.UPDATE_USER_ACCOUNT_REPEAT);
} }
} }
BackUserAccountDO userAccountDO = new BackUserAccountDO(bUserAccountVO);
backUserAccountDao.updateBackUserAccount(userAccountDO);
// 修改单位信息
if (bUserAccountVO.getCompanyId() != null) {
CompanyBackUserDO companyBackUserDO = new CompanyBackUserDO();
companyBackUserDO.setBackUserAccountId(userAccountDO.getId());
companyBackUserDO.setCompanyInfoId(bUserAccountVO.getCompanyId());
companyService.updateCompanyBackUser(companyBackUserDO);
}
// 当前角色不是超级管理员,则不能修改为管理员账号 // 当前角色不是超级管理员,则不能修改为管理员账号
RoleInfoDO roleInfoDO = roleDao.getRoleInfoByUserId(bUserAccountVO.getId()); RoleInfoDO roleInfoDO = roleDao.getRoleInfoByUserId(bUserAccountVO.getId());
if (!roleInfoDO.getId().equals(RoleEnums.ADMIN.getId()) && bUserAccountVO.getRoleId().equals(RoleEnums.ADMIN.getId())) { if (!roleInfoDO.getId().equals(RoleEnums.ADMIN.getId()) && bUserAccountVO.getRoleId().equals(RoleEnums.ADMIN.getId())) {
throw new BizException(ResultEnum.ONLY_ONE_ADMIN_ERROR); return ResultBody.error(ResultEnum.ONLY_ONE_ADMIN_ERROR);
} }
// 不能修改自己的角色 // 不能修改自己的角色
if (loginSuccessDTO.getUserAccountId().toString().equals(bUserAccountVO.getId().toString())) { if (loginSuccessDTO.getUserAccountId().toString().equals(bUserAccountVO.getId().toString())
throw new BizException(ResultEnum.UPDATE_OWNER_ROLE_ERROR); && !bUserAccountVO.getRoleId().toString().equals(roleInfoDO.getId())) {
return ResultBody.error(ResultEnum.UPDATE_OWNER_ROLE_ERROR);
} }
// 不能修改admin账号的角色 // 不能修改admin账号的角色
if (bUserAccountVO.getId().equals(1) && !bUserAccountVO.getRoleId().equals(RoleEnums.ADMIN.getId())) { if (bUserAccountVO.getId().equals(1) && !bUserAccountVO.getRoleId().equals(RoleEnums.ADMIN.getId())) {
throw new BizException(ResultEnum.UPDATE_ADMIN_ROLE_ERROR); return ResultBody.error(ResultEnum.UPDATE_ADMIN_ROLE_ERROR);
}
BackUserAccountDO userAccountDO = new BackUserAccountDO(bUserAccountVO);
backUserAccountDao.updateBackUserAccount(userAccountDO);
// 修改单位信息
if (bUserAccountVO.getCompanyId() != null) {
CompanyBackUserDO companyBackUserDO = new CompanyBackUserDO();
companyBackUserDO.setBackUserAccountId(userAccountDO.getId());
companyBackUserDO.setCompanyInfoId(bUserAccountVO.getCompanyId());
companyService.updateCompanyBackUser(companyBackUserDO);
} }
roleDao.updateUserRoleRel(bUserAccountVO.getId(), bUserAccountVO.getRoleId()); roleDao.updateUserRoleRel(bUserAccountVO.getId(), bUserAccountVO.getRoleId());
return ResultBody.success(); return ResultBody.success();
} }
@Override @Override
public ResultBody disableBAccount(Integer userAccountId) { public ResultBody disableBAccount(Integer accountId, Integer backUserAccountId) {
backUserAccountDao.disableBackUserAccountDO(userAccountId); RoleInfoDO roleInfoDO = roleDao.getRoleInfoByUserId(accountId);
if (roleInfoDO.getSuperAdmin().equals(RoleEnums.ADMIN.getId())) {
return ResultBody.error(ResultEnum.DELETE_ADMIN_ERROR);
}
if (accountId.toString().equals(backUserAccountId.toString())) {
return ResultBody.error(ResultEnum.DELETE_YOURSELF_ERROR);
}
backUserAccountDao.disableBackUserAccountDO(accountId);
return ResultBody.success(); return ResultBody.success();
} }
......
...@@ -101,19 +101,17 @@ public class RoleServiceImpl implements RoleService { ...@@ -101,19 +101,17 @@ public class RoleServiceImpl implements RoleService {
if (roleMenuInfoVO.getRoleId().equals(loginSuccessDTO.getRoleInfo().getId())) { if (roleMenuInfoVO.getRoleId().equals(loginSuccessDTO.getRoleInfo().getId())) {
return ResultBody.error(ResultEnum.UPDATE_OWNER_ROLE_MENUS_ERROR); return ResultBody.error(ResultEnum.UPDATE_OWNER_ROLE_MENUS_ERROR);
} }
if (!CollectionUtils.isEmpty(roleMenuInfoVO.getMenuInfoIds())) { List<MenuInfoDO> menuInfoDOList = roleDao.listRoleMenuInfo(roleMenuInfoVO.getRoleId());
List<MenuInfoDO> menuInfoDOList = roleDao.listRoleMenuInfo(roleMenuInfoVO.getRoleId()); List<Integer> existMenuIds = menuInfoDOList.stream().map(MenuInfoDO::getId).collect(Collectors.toList());
List<Integer> existMenuIds = menuInfoDOList.stream().map(MenuInfoDO::getId).collect(Collectors.toList()); // 新添加的权限
// 新添加的权限 List<Integer> addMenuIds = roleMenuInfoVO.getMenuInfoIds().stream().filter(v -> !existMenuIds.contains(v)).collect(Collectors.toList());
List<Integer> addMenuIds = roleMenuInfoVO.getMenuInfoIds().stream().filter(v -> !existMenuIds.contains(v)).collect(Collectors.toList()); // 需删除的权限
// 需删除的权限 List<Integer> deleteMenuIds = existMenuIds.stream().filter(v -> !roleMenuInfoVO.getMenuInfoIds().contains(v)).collect(Collectors.toList());
List<Integer> deleteMenuIds = existMenuIds.stream().filter(v -> !roleMenuInfoVO.getMenuInfoIds().contains(v)).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(addMenuIds)) {
if (!CollectionUtils.isEmpty(addMenuIds)) { roleDao.batchAddMenuIds(roleMenuInfoVO.getRoleId(), addMenuIds);
roleDao.batchAddMenuIds(roleMenuInfoVO.getRoleId(), addMenuIds); }
} if (!CollectionUtils.isEmpty(deleteMenuIds)) {
if (!CollectionUtils.isEmpty(deleteMenuIds)) { roleDao.batchDeleteMenuIds(roleMenuInfoVO.getRoleId(), deleteMenuIds);
roleDao.batchDeleteMenuIds(roleMenuInfoVO.getRoleId(), deleteMenuIds);
}
} }
return ResultBody.success(); return ResultBody.success();
} }
......
.".".".
(` `) _.-=-.
'._.--.-; .-` -' '.
.-'`.o ) \ / .-_.--' `\
`;---) \ ; / / ;' _-_.-' `
`;"` ; \ ; . .' _-' \
( ) | | / .-.-' -`
'-.-' \ | .' ` '.-'-\`
/_./\_.|\_\ ; ' .'-'.-.
/ '-._ \` / _;-,
| .-=-.;-._ \ -'-,
\ / `";`-`,-"`)
\ \ '-- `\.\
'. '._ '-- '--'/
`-._ `'----'`;
`"""--.____,/
\\ \
// /`
___// /__
(`(`(---"-`)
...@@ -29,7 +29,32 @@ ...@@ -29,7 +29,32 @@
(#{userAccountId}, #{d}, NOW()) (#{userAccountId}, #{d}, NOW())
</foreach> </foreach>
</insert> </insert>
<insert id="addWebsiteInfo">
insert into website_info (`name`, address, lat, lon, `type`, user_apply_tag)
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 id="updateUserApplyTag" parameterType="com.mmc.iuav.user.entity.UserApplyTagDO">
UPDATE user_apply_tag UPDATE user_apply_tag
<set> <set>
...@@ -51,6 +76,12 @@ ...@@ -51,6 +76,12 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark}, remark = #{remark},
</if> </if>
<if test="content != null and content != ''">
content = #{content},
</if>
<if test="score != null">
score = #{score}
</if>
</set> </set>
WHERE id = #{id}; WHERE id = #{id};
</update> </update>
...@@ -62,7 +93,10 @@ ...@@ -62,7 +93,10 @@
</update> </update>
<update id="removeUserTag"> <update id="removeUserTag">
update user_tag set is_deleted = 1 where user_account_id = #{userAccountId} and is_deleted = 0 update user_tag
set is_deleted = 1
where user_account_id = #{userAccountId}
and is_deleted = 0
</update> </update>
<update id="updateApplyTagStatus"> <update id="updateApplyTagStatus">
...@@ -84,22 +118,33 @@ ...@@ -84,22 +118,33 @@
</select> </select>
<select id="getUserApplyTag" resultType="com.mmc.iuav.user.entity.UserApplyTagDO"> <select id="getUserApplyTag" resultType="com.mmc.iuav.user.entity.UserApplyTagDO">
select id, SELECT ua.id,
cooperation_tag_id, ua.cooperation_tag_id,
user_account_id, ua.user_account_id,
apply_name, ua.apply_name,
apply_phone, ua.apply_phone,
apply_status, ua.apply_status,
remark, ua.remark,
create_time ua.content,
from user_apply_tag ua.score,
where id = #{id} ua.create_time,
and is_deleted = 0 wi.address,
wi.`name`,
wi.lat,
wi.lon
FROM user_apply_tag ua
LEFT JOIN website_info wi ON ua.id = wi.user_apply_tag
WHERE ua.id = #{id}
AND ua.is_deleted = 0
</select> </select>
<select id="listUserCooperationTag" resultType="com.mmc.iuav.user.entity.CooperationTagDO"> <select id="listUserCooperationTag" resultType="com.mmc.iuav.user.entity.CooperationTagDO">
select ct.id,ct.tag_name from cooperation_tag ct LEFT JOIN user_tag ut ON ct.id = ut.cooperation_tag_id select ct.id, ct.tag_name
where ct.is_deleted = 0 and ut.is_deleted = 0 and ut.user_account_id = #{userAccountId} from cooperation_tag ct
LEFT JOIN user_tag ut ON ct.id = ut.cooperation_tag_id
where ct.is_deleted = 0
and ut.is_deleted = 0
and ut.user_account_id = #{userAccountId}
</select> </select>
<select id="getTagById" resultType="com.mmc.iuav.user.entity.CooperationTagDO"> <select id="getTagById" resultType="com.mmc.iuav.user.entity.CooperationTagDO">
...@@ -110,20 +155,25 @@ ...@@ -110,20 +155,25 @@
</select> </select>
<select id="countListUserApplyTag" resultType="java.lang.Integer"> <select id="countListUserApplyTag" resultType="java.lang.Integer">
select count(*) select count(*)
from user_apply_tag from user_apply_tag ua
INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id
INNER JOIN company_auth ca ON ca.user_account_id = ua.user_account_id
<where> <where>
is_deleted = 0 ua.is_deleted = 0
<if test="cooperationTagId != null"> <if test="cooperationTagId != null">
and cooperation_tag_id = #{cooperationTagId} and ua.cooperation_tag_id = #{cooperationTagId}
</if> </if>
<if test="applyStatus != null"> <if test="applyStatus != null">
and apply_status = #{applyStatus} and ua.apply_status = #{applyStatus}
</if> </if>
<if test="startTime != null and startTime != '' "> <if test="startTime != null and startTime != '' ">
and create_time &gt;= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s') and ua.create_time &gt;= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if> </if>
<if test="endTime != null and endTime != '' "> <if test="endTime != null and endTime != '' ">
and create_time &lt;= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s') and ua.create_time &lt;= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="companyName != null and companyName != ''">
and ca.company_name like CONCAT("%",#{companyName},"%")
</if> </if>
</where> </where>
</select> </select>
...@@ -137,10 +187,14 @@ ...@@ -137,10 +187,14 @@
ua.apply_status, ua.apply_status,
ua.remark, ua.remark,
ua.create_time, ua.create_time,
ct.tag_name ua.content,
ua.score,
ct.tag_name,
ca.company_name
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
INNER JOIN company_auth ca ON ca.user_account_id = ua.user_account_id
<where> <where>
ua.is_deleted = 0 ua.is_deleted = 0
<if test="cooperationTagId != null"> <if test="cooperationTagId != null">
...@@ -155,6 +209,9 @@ ...@@ -155,6 +209,9 @@
<if test="endTime != null"> <if test="endTime != null">
and ua.create_time &lt;= #{endTime} and ua.create_time &lt;= #{endTime}
</if> </if>
<if test="companyName != null and companyName != ''">
and ca.company_name like CONCAT("%",#{companyName},"%")
</if>
</where> </where>
order by ua.create_time desc order by ua.create_time desc
limit #{pageNo},#{pageSize} limit #{pageNo},#{pageSize}
...@@ -175,7 +232,8 @@ ...@@ -175,7 +232,8 @@
</select> </select>
<select id="listUserCooperationTagByUIds" resultType="com.mmc.iuav.user.entity.CooperationTagDO"> <select id="listUserCooperationTagByUIds" resultType="com.mmc.iuav.user.entity.CooperationTagDO">
select ct.id,ct.tag_name,ut.user_account_id from cooperation_tag ct LEFT JOIN user_tag ut ON ct.id = ut.cooperation_tag_id select ct.id,ct.tag_name,ut.user_account_id from cooperation_tag ct LEFT JOIN user_tag ut ON ct.id =
ut.cooperation_tag_id
where ct.is_deleted = 0 and ut.is_deleted = 0 where ct.is_deleted = 0 and ut.is_deleted = 0
<if test="uIds != null"> <if test="uIds != null">
<foreach collection="uIds" item="userAccountId" separator="," open=" and ut.user_account_id in (" close=")"> <foreach collection="uIds" item="userAccountId" separator="," open=" and ut.user_account_id in (" close=")">
...@@ -183,4 +241,34 @@ ...@@ -183,4 +241,34 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="countServiceBitmapData" resultType="java.lang.Integer">
select count(*)
from website_info
where type = #{type}
</select>
<select id="listServiceBitmapData" resultType="com.mmc.iuav.user.entity.WebsiteInfoDO">
SELECT id,
`name`,
address,
lat,
lon,
`type`,
user_apply_tag,
st_distance_sphere(point(lon, lat), point(${lon}, ${lat})) as distance
FROM website_info
where type = #{type}
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> </mapper>
\ No newline at end of file
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</insert> </insert>
<insert id="insertUserRoleRel"> <insert id="insertUserRoleRel">
INSERT INTO user_role_rel(back_back_user_account_id, role_id, create_time) INSERT INTO user_role_rel(back_user_account_id, role_id, create_time)
VALUES (#{backUserAccountId}, #{roleId}, NOW()); VALUES (#{backUserAccountId}, #{roleId}, NOW());
</insert> </insert>
...@@ -113,9 +113,7 @@ ...@@ -113,9 +113,7 @@
</select> </select>
<delete id="removeRoleInfo" parameterType="java.lang.Integer"> <delete id="removeRoleInfo" parameterType="java.lang.Integer">
delete update role_info set is_deleted = 1 where id = #{id}
from role_info
where id = #{id}
</delete> </delete>
<delete id="batchDeleteMenuIds"> <delete id="batchDeleteMenuIds">
...@@ -182,7 +180,7 @@ ...@@ -182,7 +180,7 @@
<select id="countNotDelUserAccountByRole" resultType="java.lang.Integer"> <select id="countNotDelUserAccountByRole" resultType="java.lang.Integer">
SELECT count(*) SELECT count(*)
FROM user_role_rel ur FROM user_role_rel ur
INNER JOIN user_account ua ON ur.back_user_account_id = ua.id INNER JOIN back_user_account ua ON ur.back_user_account_id = ua.id
WHERE ur.role_id = #{id} WHERE ur.role_id = #{id}
AND ua.is_deleted = 0 AND ua.is_deleted = 0
</select> </select>
......
...@@ -21,3 +21,4 @@ data-filter: ...@@ -21,3 +21,4 @@ data-filter:
- /userapp/back-user/listTest - /userapp/back-user/listTest
- /userapp/company/listCompanyPageBack - /userapp/company/listCompanyPageBack
- /userapp/company/getCompanyInfoById - /userapp/company/getCompanyInfoById
- /userapp/cooperation/service/bitmap
...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: f86c973b664b1c5c6905d64cc5a98a4ed9a785bb newTag: c1e73fcb0750d5461e6ebfe920c6bc14bac3e160
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论