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 | 15 | import com.trash.garbage.pojo.domain.GarUser; |
| 16 | 16 | import com.trash.garbage.pojo.dto.AddressDto; |
| 17 | 17 | import com.trash.garbage.pojo.dto.LoginDto; |
| 18 | +import com.trash.garbage.pojo.vo.LoginVo; | |
| 18 | 19 | import com.trash.garbage.service.GarUserService; |
| 19 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | 21 | import org.springframework.security.access.prepost.PreAuthorize; |
| ... | ... | @@ -41,7 +42,7 @@ public class GarbageUserController { |
| 41 | 42 | * @return |
| 42 | 43 | */ |
| 43 | 44 | @PostMapping("/login") |
| 44 | - public Result<String> login(@RequestBody LoginDto user) { | |
| 45 | + public Result<LoginVo> login(@RequestBody LoginDto user) { | |
| 45 | 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 | 7 | import com.baomidou.mybatisplus.extension.service.IService; |
| 8 | 8 | import com.trash.garbage.pojo.dto.AddressDto; |
| 9 | 9 | import com.trash.garbage.pojo.dto.LoginDto; |
| 10 | +import com.trash.garbage.pojo.vo.LoginVo; | |
| 10 | 11 | |
| 11 | 12 | import javax.servlet.http.HttpServletRequest; |
| 12 | 13 | import java.util.List; |
| ... | ... | @@ -18,7 +19,7 @@ import java.util.List; |
| 18 | 19 | */ |
| 19 | 20 | public interface GarUserService extends IService<GarUser> { |
| 20 | 21 | |
| 21 | - String login(LoginDto user); | |
| 22 | + LoginVo login(LoginDto user); | |
| 22 | 23 | |
| 23 | 24 | String sendVerify(String tel) throws ClientException; |
| 24 | 25 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| 1 | 1 | package com.trash.garbage.service.impl; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollectionUtil; | |
| 3 | 4 | import cn.hutool.http.HttpUtil; |
| 4 | 5 | import com.alibaba.fastjson.JSONObject; |
| 5 | 6 | import com.aliyuncs.exceptions.ClientException; |
| ... | ... | @@ -15,6 +16,10 @@ import com.trash.common.core.domain.model.LoginUser; |
| 15 | 16 | import com.trash.common.core.redis.RedisCache; |
| 16 | 17 | import com.trash.common.utils.SecurityUtils; |
| 17 | 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 | 23 | import com.trash.framework.web.service.TokenService; |
| 19 | 24 | import com.trash.garbage.config.WxConfig; |
| 20 | 25 | import com.trash.garbage.custom.BizException; |
| ... | ... | @@ -22,9 +27,11 @@ import com.trash.garbage.global.GlobalRedisProperties; |
| 22 | 27 | import com.trash.garbage.global.GlobalStatus; |
| 23 | 28 | import com.trash.garbage.global.ResultCode; |
| 24 | 29 | import com.trash.garbage.pojo.domain.GarAddress; |
| 30 | +import com.trash.garbage.pojo.domain.GarOrder; | |
| 25 | 31 | import com.trash.garbage.pojo.domain.GarUser; |
| 26 | 32 | import com.trash.garbage.pojo.dto.AddressDto; |
| 27 | 33 | import com.trash.garbage.pojo.dto.LoginDto; |
| 34 | +import com.trash.garbage.pojo.vo.LoginVo; | |
| 28 | 35 | import com.trash.garbage.service.GarAddressService; |
| 29 | 36 | import com.trash.garbage.service.GarUserService; |
| 30 | 37 | import com.trash.garbage.mapper.GarUserMapper; |
| ... | ... | @@ -60,6 +67,12 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 60 | 67 | @Autowired |
| 61 | 68 | private GarAddressService garAddressService; |
| 62 | 69 | |
| 70 | + @Autowired | |
| 71 | + private IDriverService driverService; | |
| 72 | + | |
| 73 | + @Autowired | |
| 74 | + private ITransportationEnterpriseService enterpriseService; | |
| 75 | + | |
| 63 | 76 | |
| 64 | 77 | @Resource |
| 65 | 78 | private RedisCache redisCache; |
| ... | ... | @@ -69,7 +82,9 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 69 | 82 | |
| 70 | 83 | |
| 71 | 84 | @Override |
| 72 | - public String login(LoginDto loginDto) { | |
| 85 | + public LoginVo login(LoginDto loginDto) { | |
| 86 | + LoginVo vo = new LoginVo(); | |
| 87 | + | |
| 73 | 88 | if (Objects.isNull(loginDto)) { |
| 74 | 89 | throw new UsernameNotFoundException("当前用户不存在!"); |
| 75 | 90 | } |
| ... | ... | @@ -120,7 +135,22 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 120 | 135 | String token = JwtUtils.createToken(nUser.getGarUserId(), nUser.getGarUserTel()); |
| 121 | 136 | loginUser.setToken(token); |
| 122 | 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 | 156 | @Override | ... | ... |
trash-ui/src/views/gar/order/index.vue
| ... | ... | @@ -50,7 +50,6 @@ |
| 50 | 50 | </el-table-column> |
| 51 | 51 | <el-table-column label="约定时间" width="180" align="center" prop="garOrderAgreementTime" /> |
| 52 | 52 | <el-table-column label="备注" align="center" prop="garRemark" /> |
| 53 | - <el-table-column label="取消原因" width="200px" align="center" prop="garReason" /> | |
| 54 | 53 | <el-table-column label="是否取消" align="center" prop="garCancelFlag"> |
| 55 | 54 | <template slot-scope="scope"> |
| 56 | 55 | {{ computedCancelFlagString(scope.row.garCancelFlag).toString() }} |
| ... | ... | @@ -109,15 +108,14 @@ |
| 109 | 108 | type="date" value-format="yyyy-MM-dd" placeholder="选择订单创建时间"> |
| 110 | 109 | </el-date-picker> |
| 111 | 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 | 113 | </el-form-item> |
| 115 | - | |
| 116 | 114 | <el-form-item label="车子数量" prop="garOrderCarNumber"> |
| 117 | 115 | <el-input :disabled="true" v-model="form.garOrderCarNumber" placeholder="请输入车子数量" /> |
| 118 | 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 | 119 | </el-form-item> |
| 122 | 120 | <el-form-item v-if="form.currentImages" label="现场图片" prop="currentImages"> |
| 123 | 121 | <el-image style="width: 100px; height: 100px" :src="form.currentImages[0]" |
| ... | ... | @@ -138,7 +136,6 @@ |
| 138 | 136 | <el-form-item label="派单负责人电话" prop="garOrderHandlerTel"> |
| 139 | 137 | <el-input v-model="form.garOrderHandleTel" placeholder="派单负责人电话" /> |
| 140 | 138 | </el-form-item> |
| 141 | - | |
| 142 | 139 | <el-form-item v-if="form.putOnImages" label="现场图片" prop="putOnImages"> |
| 143 | 140 | <el-image style="width: 100px; height: 100px" :src="form.putOnImages[0]" :preview-src-list="form.putOnImages"> |
| 144 | 141 | </el-image> |
| ... | ... | @@ -183,6 +180,8 @@ export default { |
| 183 | 180 | title: "", |
| 184 | 181 | // 是否显示弹出层 |
| 185 | 182 | open: false, |
| 183 | + // 是否显示弹出层 | |
| 184 | + openEvaluate: false, | |
| 186 | 185 | // 查询参数 |
| 187 | 186 | queryParams: { |
| 188 | 187 | pageNum: 1, |
| ... | ... | @@ -290,8 +289,7 @@ export default { |
| 290 | 289 | garHandlerEvaluateFlag: null |
| 291 | 290 | }; |
| 292 | 291 | this.resetForm("form"); |
| 293 | - } | |
| 294 | - , | |
| 292 | + }, | |
| 295 | 293 | /** 搜索按钮操作 */ |
| 296 | 294 | handleQuery() { |
| 297 | 295 | this.queryParams.pageNum = 1; | ... | ... |
trash-ui/src/views/gar/user/index.vue
| ... | ... | @@ -15,16 +15,6 @@ |
| 15 | 15 | <el-option label="管理负责人" value="管理负责人" /> |
| 16 | 16 | </el-select> |
| 17 | 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 | 18 | <el-form-item> |
| 29 | 19 | <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| 30 | 20 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| ... | ... | @@ -32,12 +22,6 @@ |
| 32 | 22 | </el-form> |
| 33 | 23 | |
| 34 | 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 | 25 | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| 42 | 26 | </el-row> |
| 43 | 27 | |
| ... | ... | @@ -57,13 +41,12 @@ |
| 57 | 41 | </template> |
| 58 | 42 | </el-table-column> |
| 59 | 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 | 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 | 48 | </template> |
| 66 | - </el-table-column> | |
| 49 | + </el-table-column> --> | |
| 67 | 50 | </el-table> |
| 68 | 51 | |
| 69 | 52 | <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" |
| ... | ... | @@ -158,6 +141,11 @@ export default { |
| 158 | 141 | this.getList(); |
| 159 | 142 | }, |
| 160 | 143 | methods: { |
| 144 | + | |
| 145 | + queryEvaluate(row) { | |
| 146 | + this.open = true; | |
| 147 | + console.log(row); | |
| 148 | + }, | |
| 161 | 149 | /** 查询建筑垃圾-用户列表 */ |
| 162 | 150 | getList() { |
| 163 | 151 | this.loading = true; | ... | ... |