Commit 6ccc86299f6ad4bcba9cb47ec700d78383a7aaf6
1 parent
90b99676
feat: 新增登录角色推荐,删除多余地址地址保留湖南省
Showing
6 changed files
with
97 additions
and
34 deletions
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageUserController.java
| @@ -15,6 +15,7 @@ import com.trash.garbage.pojo.domain.GarAddress; | @@ -15,6 +15,7 @@ import com.trash.garbage.pojo.domain.GarAddress; | ||
| 15 | import com.trash.garbage.pojo.domain.GarUser; | 15 | import com.trash.garbage.pojo.domain.GarUser; |
| 16 | import com.trash.garbage.pojo.dto.AddressDto; | 16 | import com.trash.garbage.pojo.dto.AddressDto; |
| 17 | import com.trash.garbage.pojo.dto.LoginDto; | 17 | import com.trash.garbage.pojo.dto.LoginDto; |
| 18 | +import com.trash.garbage.pojo.vo.LoginVo; | ||
| 18 | import com.trash.garbage.service.GarUserService; | 19 | import com.trash.garbage.service.GarUserService; |
| 19 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | import org.springframework.security.access.prepost.PreAuthorize; | 21 | import org.springframework.security.access.prepost.PreAuthorize; |
| @@ -41,7 +42,7 @@ public class GarbageUserController { | @@ -41,7 +42,7 @@ public class GarbageUserController { | ||
| 41 | * @return | 42 | * @return |
| 42 | */ | 43 | */ |
| 43 | @PostMapping("/login") | 44 | @PostMapping("/login") |
| 44 | - public Result<String> login(@RequestBody LoginDto user) { | 45 | + public Result<LoginVo> login(@RequestBody LoginDto user) { |
| 45 | return Result.OK(garUserService.login(user)); | 46 | return Result.OK(garUserService.login(user)); |
| 46 | } | 47 | } |
| 47 | 48 |
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/LoginVo.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.vo; | ||
| 2 | + | ||
| 3 | +import lombok.EqualsAndHashCode; | ||
| 4 | +import lombok.ToString; | ||
| 5 | + | ||
| 6 | +@ToString | ||
| 7 | +@EqualsAndHashCode | ||
| 8 | +public class LoginVo { | ||
| 9 | + private String token; | ||
| 10 | + private Boolean companyFlag; | ||
| 11 | + private String parentCompanyName; | ||
| 12 | + private String transportCompanyName; | ||
| 13 | + | ||
| 14 | + public String getToken() { | ||
| 15 | + return token; | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + public void setToken(String token) { | ||
| 19 | + this.token = token; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + public Boolean getCompanyFlag() { | ||
| 23 | + return companyFlag; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + public void setCompanyFlag(Boolean companyFlag) { | ||
| 27 | + this.companyFlag = companyFlag; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public String getParentCompanyName() { | ||
| 31 | + return parentCompanyName; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + public void setParentCompanyName(String parentCompanyName) { | ||
| 35 | + this.parentCompanyName = parentCompanyName; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public String getTransportCompanyName() { | ||
| 39 | + return transportCompanyName; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + public void setTransportCompanyName(String transportCompanyName) { | ||
| 43 | + this.transportCompanyName = transportCompanyName; | ||
| 44 | + } | ||
| 45 | +} |
trash-garbage/src/main/java/com/trash/garbage/service/GarUserService.java
| @@ -7,6 +7,7 @@ import com.trash.garbage.pojo.domain.GarUser; | @@ -7,6 +7,7 @@ import com.trash.garbage.pojo.domain.GarUser; | ||
| 7 | import com.baomidou.mybatisplus.extension.service.IService; | 7 | import com.baomidou.mybatisplus.extension.service.IService; |
| 8 | import com.trash.garbage.pojo.dto.AddressDto; | 8 | import com.trash.garbage.pojo.dto.AddressDto; |
| 9 | import com.trash.garbage.pojo.dto.LoginDto; | 9 | import com.trash.garbage.pojo.dto.LoginDto; |
| 10 | +import com.trash.garbage.pojo.vo.LoginVo; | ||
| 10 | 11 | ||
| 11 | import javax.servlet.http.HttpServletRequest; | 12 | import javax.servlet.http.HttpServletRequest; |
| 12 | import java.util.List; | 13 | import java.util.List; |
| @@ -18,7 +19,7 @@ import java.util.List; | @@ -18,7 +19,7 @@ import java.util.List; | ||
| 18 | */ | 19 | */ |
| 19 | public interface GarUserService extends IService<GarUser> { | 20 | public interface GarUserService extends IService<GarUser> { |
| 20 | 21 | ||
| 21 | - String login(LoginDto user); | 22 | + LoginVo login(LoginDto user); |
| 22 | 23 | ||
| 23 | String sendVerify(String tel) throws ClientException; | 24 | String sendVerify(String tel) throws ClientException; |
| 24 | 25 |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| 1 | package com.trash.garbage.service.impl; | 1 | package com.trash.garbage.service.impl; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.collection.CollectionUtil; | ||
| 3 | import cn.hutool.http.HttpUtil; | 4 | import cn.hutool.http.HttpUtil; |
| 4 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.aliyuncs.exceptions.ClientException; | 6 | import com.aliyuncs.exceptions.ClientException; |
| @@ -15,6 +16,10 @@ import com.trash.common.core.domain.model.LoginUser; | @@ -15,6 +16,10 @@ import com.trash.common.core.domain.model.LoginUser; | ||
| 15 | import com.trash.common.core.redis.RedisCache; | 16 | import com.trash.common.core.redis.RedisCache; |
| 16 | import com.trash.common.utils.SecurityUtils; | 17 | import com.trash.common.utils.SecurityUtils; |
| 17 | import com.trash.common.utils.StringUtils; | 18 | import com.trash.common.utils.StringUtils; |
| 19 | +import com.trash.driver.domain.vo.DriverVo; | ||
| 20 | +import com.trash.driver.service.IDriverService; | ||
| 21 | +import com.trash.enterprise.domain.TransportationEnterprise; | ||
| 22 | +import com.trash.enterprise.service.ITransportationEnterpriseService; | ||
| 18 | import com.trash.framework.web.service.TokenService; | 23 | import com.trash.framework.web.service.TokenService; |
| 19 | import com.trash.garbage.config.WxConfig; | 24 | import com.trash.garbage.config.WxConfig; |
| 20 | import com.trash.garbage.custom.BizException; | 25 | import com.trash.garbage.custom.BizException; |
| @@ -22,9 +27,11 @@ import com.trash.garbage.global.GlobalRedisProperties; | @@ -22,9 +27,11 @@ import com.trash.garbage.global.GlobalRedisProperties; | ||
| 22 | import com.trash.garbage.global.GlobalStatus; | 27 | import com.trash.garbage.global.GlobalStatus; |
| 23 | import com.trash.garbage.global.ResultCode; | 28 | import com.trash.garbage.global.ResultCode; |
| 24 | import com.trash.garbage.pojo.domain.GarAddress; | 29 | import com.trash.garbage.pojo.domain.GarAddress; |
| 30 | +import com.trash.garbage.pojo.domain.GarOrder; | ||
| 25 | import com.trash.garbage.pojo.domain.GarUser; | 31 | import com.trash.garbage.pojo.domain.GarUser; |
| 26 | import com.trash.garbage.pojo.dto.AddressDto; | 32 | import com.trash.garbage.pojo.dto.AddressDto; |
| 27 | import com.trash.garbage.pojo.dto.LoginDto; | 33 | import com.trash.garbage.pojo.dto.LoginDto; |
| 34 | +import com.trash.garbage.pojo.vo.LoginVo; | ||
| 28 | import com.trash.garbage.service.GarAddressService; | 35 | import com.trash.garbage.service.GarAddressService; |
| 29 | import com.trash.garbage.service.GarUserService; | 36 | import com.trash.garbage.service.GarUserService; |
| 30 | import com.trash.garbage.mapper.GarUserMapper; | 37 | import com.trash.garbage.mapper.GarUserMapper; |
| @@ -60,6 +67,12 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | @@ -60,6 +67,12 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | ||
| 60 | @Autowired | 67 | @Autowired |
| 61 | private GarAddressService garAddressService; | 68 | private GarAddressService garAddressService; |
| 62 | 69 | ||
| 70 | + @Autowired | ||
| 71 | + private IDriverService driverService; | ||
| 72 | + | ||
| 73 | + @Autowired | ||
| 74 | + private ITransportationEnterpriseService enterpriseService; | ||
| 75 | + | ||
| 63 | 76 | ||
| 64 | @Resource | 77 | @Resource |
| 65 | private RedisCache redisCache; | 78 | private RedisCache redisCache; |
| @@ -69,7 +82,9 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | @@ -69,7 +82,9 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | ||
| 69 | 82 | ||
| 70 | 83 | ||
| 71 | @Override | 84 | @Override |
| 72 | - public String login(LoginDto loginDto) { | 85 | + public LoginVo login(LoginDto loginDto) { |
| 86 | + LoginVo vo = new LoginVo(); | ||
| 87 | + | ||
| 73 | if (Objects.isNull(loginDto)) { | 88 | if (Objects.isNull(loginDto)) { |
| 74 | throw new UsernameNotFoundException("当前用户不存在!"); | 89 | throw new UsernameNotFoundException("当前用户不存在!"); |
| 75 | } | 90 | } |
| @@ -120,7 +135,22 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | @@ -120,7 +135,22 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> | ||
| 120 | String token = JwtUtils.createToken(nUser.getGarUserId(), nUser.getGarUserTel()); | 135 | String token = JwtUtils.createToken(nUser.getGarUserId(), nUser.getGarUserTel()); |
| 121 | loginUser.setToken(token); | 136 | loginUser.setToken(token); |
| 122 | tokenService.refreshToken(loginUser); | 137 | tokenService.refreshToken(loginUser); |
| 123 | - return token; | 138 | + vo.setToken(token); |
| 139 | + loginDto.getTel(); | ||
| 140 | + DriverVo driver = new DriverVo(); | ||
| 141 | + driver.setPhoneNo(loginDto.getTel()); | ||
| 142 | + List<DriverVo> driverList = driverService.selectDriverList(driver); | ||
| 143 | + if (CollectionUtil.isEmpty(driverList)) { | ||
| 144 | + vo.setCompanyFlag(false); | ||
| 145 | + return vo; | ||
| 146 | + } | ||
| 147 | + DriverVo driverVo = driverList.get(0); | ||
| 148 | + TransportationEnterprise enterprise = enterpriseService.selectTransportationEnterpriseById(driverVo.getCompanyId()); | ||
| 149 | + TransportationEnterprise parentEnterprise = enterpriseService.selectTransportationEnterpriseById(enterprise.getParentId()); | ||
| 150 | + vo.setTransportCompanyName(enterprise.getName()); | ||
| 151 | + vo.setParentCompanyName(parentEnterprise.getName()); | ||
| 152 | + vo.setCompanyFlag(true); | ||
| 153 | + return vo; | ||
| 124 | } | 154 | } |
| 125 | 155 | ||
| 126 | @Override | 156 | @Override |
trash-ui/src/views/gar/order/index.vue
| @@ -50,7 +50,6 @@ | @@ -50,7 +50,6 @@ | ||
| 50 | </el-table-column> | 50 | </el-table-column> |
| 51 | <el-table-column label="约定时间" width="180" align="center" prop="garOrderAgreementTime" /> | 51 | <el-table-column label="约定时间" width="180" align="center" prop="garOrderAgreementTime" /> |
| 52 | <el-table-column label="备注" align="center" prop="garRemark" /> | 52 | <el-table-column label="备注" align="center" prop="garRemark" /> |
| 53 | - <el-table-column label="取消原因" width="200px" align="center" prop="garReason" /> | ||
| 54 | <el-table-column label="是否取消" align="center" prop="garCancelFlag"> | 53 | <el-table-column label="是否取消" align="center" prop="garCancelFlag"> |
| 55 | <template slot-scope="scope"> | 54 | <template slot-scope="scope"> |
| 56 | {{ computedCancelFlagString(scope.row.garCancelFlag).toString() }} | 55 | {{ computedCancelFlagString(scope.row.garCancelFlag).toString() }} |
| @@ -109,15 +108,14 @@ | @@ -109,15 +108,14 @@ | ||
| 109 | type="date" value-format="yyyy-MM-dd" placeholder="选择订单创建时间"> | 108 | type="date" value-format="yyyy-MM-dd" placeholder="选择订单创建时间"> |
| 110 | </el-date-picker> | 109 | </el-date-picker> |
| 111 | </el-form-item> | 110 | </el-form-item> |
| 112 | - <el-form-item label="备注" prop="garRemark"> | ||
| 113 | - <el-input :disabled="true" v-model="form.garRemark" type="textarea" placeholder="请输入内容" /> | 111 | + <el-form-item label="车子类型" prop="garOrderCarType"> |
| 112 | + <el-input :disabled="true" v-model="form.garOrderCarType" placeholder="请输入车子类型" /> | ||
| 114 | </el-form-item> | 113 | </el-form-item> |
| 115 | - | ||
| 116 | <el-form-item label="车子数量" prop="garOrderCarNumber"> | 114 | <el-form-item label="车子数量" prop="garOrderCarNumber"> |
| 117 | <el-input :disabled="true" v-model="form.garOrderCarNumber" placeholder="请输入车子数量" /> | 115 | <el-input :disabled="true" v-model="form.garOrderCarNumber" placeholder="请输入车子数量" /> |
| 118 | </el-form-item> | 116 | </el-form-item> |
| 119 | - <el-form-item label="车子类型" prop="garOrderCarType"> | ||
| 120 | - <el-input :disabled="true" v-model="form.garOrderCarType" placeholder="请输入车子类型" /> | 117 | + <el-form-item label="备注" prop="garRemark"> |
| 118 | + <el-input :disabled="true" v-model="form.garRemark" type="textarea" placeholder="请输入内容" /> | ||
| 121 | </el-form-item> | 119 | </el-form-item> |
| 122 | <el-form-item v-if="form.currentImages" label="现场图片" prop="currentImages"> | 120 | <el-form-item v-if="form.currentImages" label="现场图片" prop="currentImages"> |
| 123 | <el-image style="width: 100px; height: 100px" :src="form.currentImages[0]" | 121 | <el-image style="width: 100px; height: 100px" :src="form.currentImages[0]" |
| @@ -138,7 +136,6 @@ | @@ -138,7 +136,6 @@ | ||
| 138 | <el-form-item label="派单负责人电话" prop="garOrderHandlerTel"> | 136 | <el-form-item label="派单负责人电话" prop="garOrderHandlerTel"> |
| 139 | <el-input v-model="form.garOrderHandleTel" placeholder="派单负责人电话" /> | 137 | <el-input v-model="form.garOrderHandleTel" placeholder="派单负责人电话" /> |
| 140 | </el-form-item> | 138 | </el-form-item> |
| 141 | - | ||
| 142 | <el-form-item v-if="form.putOnImages" label="现场图片" prop="putOnImages"> | 139 | <el-form-item v-if="form.putOnImages" label="现场图片" prop="putOnImages"> |
| 143 | <el-image style="width: 100px; height: 100px" :src="form.putOnImages[0]" :preview-src-list="form.putOnImages"> | 140 | <el-image style="width: 100px; height: 100px" :src="form.putOnImages[0]" :preview-src-list="form.putOnImages"> |
| 144 | </el-image> | 141 | </el-image> |
| @@ -183,6 +180,8 @@ export default { | @@ -183,6 +180,8 @@ export default { | ||
| 183 | title: "", | 180 | title: "", |
| 184 | // 是否显示弹出层 | 181 | // 是否显示弹出层 |
| 185 | open: false, | 182 | open: false, |
| 183 | + // 是否显示弹出层 | ||
| 184 | + openEvaluate: false, | ||
| 186 | // 查询参数 | 185 | // 查询参数 |
| 187 | queryParams: { | 186 | queryParams: { |
| 188 | pageNum: 1, | 187 | pageNum: 1, |
| @@ -290,8 +289,7 @@ export default { | @@ -290,8 +289,7 @@ export default { | ||
| 290 | garHandlerEvaluateFlag: null | 289 | garHandlerEvaluateFlag: null |
| 291 | }; | 290 | }; |
| 292 | this.resetForm("form"); | 291 | this.resetForm("form"); |
| 293 | - } | ||
| 294 | - , | 292 | + }, |
| 295 | /** 搜索按钮操作 */ | 293 | /** 搜索按钮操作 */ |
| 296 | handleQuery() { | 294 | handleQuery() { |
| 297 | this.queryParams.pageNum = 1; | 295 | this.queryParams.pageNum = 1; |
trash-ui/src/views/gar/user/index.vue
| @@ -15,16 +15,6 @@ | @@ -15,16 +15,6 @@ | ||
| 15 | <el-option label="管理负责人" value="管理负责人" /> | 15 | <el-option label="管理负责人" value="管理负责人" /> |
| 16 | </el-select> | 16 | </el-select> |
| 17 | </el-form-item> | 17 | </el-form-item> |
| 18 | - <el-form-item label="创建时间" prop="garCreateTime"> | ||
| 19 | - <el-date-picker clearable size="small" style="width: 200px" v-model="queryParams.garCreateTime" type="date" | ||
| 20 | - value-format="yyyy-MM-dd" placeholder="选择创建时间"> | ||
| 21 | - </el-date-picker> | ||
| 22 | - </el-form-item> | ||
| 23 | - <el-form-item label="修改时间" prop="garUpdateTime"> | ||
| 24 | - <el-date-picker clearable size="small" style="width: 200px" v-model="queryParams.garUpdateTime" type="date" | ||
| 25 | - value-format="yyyy-MM-dd" placeholder="选择修改时间"> | ||
| 26 | - </el-date-picker> | ||
| 27 | - </el-form-item> | ||
| 28 | <el-form-item> | 18 | <el-form-item> |
| 29 | <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | 19 | <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| 30 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | 20 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| @@ -32,12 +22,6 @@ | @@ -32,12 +22,6 @@ | ||
| 32 | </el-form> | 22 | </el-form> |
| 33 | 23 | ||
| 34 | <el-row :gutter="10" class="mb8"> | 24 | <el-row :gutter="10" class="mb8"> |
| 35 | - <el-col :span="1.5"> | ||
| 36 | - <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" | ||
| 37 | - v-hasPermi="['GarUser:GarUser:remove']">删除</el-button> | ||
| 38 | - </el-col> | ||
| 39 | - <el-col :span="1.5"> | ||
| 40 | - </el-col> | ||
| 41 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | 25 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| 42 | </el-row> | 26 | </el-row> |
| 43 | 27 | ||
| @@ -57,13 +41,12 @@ | @@ -57,13 +41,12 @@ | ||
| 57 | </template> | 41 | </template> |
| 58 | </el-table-column> | 42 | </el-table-column> |
| 59 | <el-table-column label="备注" align="center" prop="garRemark" /> | 43 | <el-table-column label="备注" align="center" prop="garRemark" /> |
| 60 | - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | 44 | + <!-- <el-table-column fixed="right" label="操作" width="200px" align="center" class-name="small-padding fixed-width"> |
| 61 | <template slot-scope="scope"> | 45 | <template slot-scope="scope"> |
| 62 | - | ||
| 63 | - <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | ||
| 64 | - v-hasPermi="['GarUser:GarUser:remove']">删除</el-button> | 46 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="queryEvaluate(scope.row)" |
| 47 | + v-hasPermi="['garbage:order:edit']">过往评价</el-button> | ||
| 65 | </template> | 48 | </template> |
| 66 | - </el-table-column> | 49 | + </el-table-column> --> |
| 67 | </el-table> | 50 | </el-table> |
| 68 | 51 | ||
| 69 | <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" | 52 | <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" |
| @@ -158,6 +141,11 @@ export default { | @@ -158,6 +141,11 @@ export default { | ||
| 158 | this.getList(); | 141 | this.getList(); |
| 159 | }, | 142 | }, |
| 160 | methods: { | 143 | methods: { |
| 144 | + | ||
| 145 | + queryEvaluate(row) { | ||
| 146 | + this.open = true; | ||
| 147 | + console.log(row); | ||
| 148 | + }, | ||
| 161 | /** 查询建筑垃圾-用户列表 */ | 149 | /** 查询建筑垃圾-用户列表 */ |
| 162 | getList() { | 150 | getList() { |
| 163 | this.loading = true; | 151 | this.loading = true; |