| | |
| | | <poi.version>4.1.2</poi.version> |
| | | <velocity.version>2.3</velocity.version> |
| | | <jwt.version>0.9.1</jwt.version> |
| | | <zxing.version>3.5.1</zxing.version> |
| | | <!-- override dependency version --> |
| | | <tomcat.version>9.0.102</tomcat.version> |
| | | <logback.version>1.2.13</logback.version> |
| | |
| | | <version>${kaptcha.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- äºç»´ç çæ --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>${zxing.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>${zxing.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 宿¶ä»»å¡--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
New file |
| | |
| | | package com.ruoyi.web.controller.evaluation; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.utils.WechatUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.system.domain.EvaluationDetail; |
| | | import com.ruoyi.system.service.IEvaluationDimensionService; |
| | | import com.ruoyi.system.domain.EvaluationDimension; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.CustomerEvaluation; |
| | | import com.ruoyi.system.service.ICustomerEvaluationService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 客æ·è¯ä»·Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/evaluation") |
| | | public class EvaluationController extends BaseController { |
| | | @Autowired |
| | | private ICustomerEvaluationService customerEvaluationService; |
| | | |
| | | @Autowired |
| | | private IEvaluationDimensionService evaluationDimensionService; |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·è¯ä»·å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(CustomerEvaluation customerEvaluation) { |
| | | startPage(); |
| | | List<CustomerEvaluation> list = customerEvaluationService.selectCustomerEvaluationList(customerEvaluation); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºå®¢æ·è¯ä»·å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:export')") |
| | | @Log(title = "客æ·è¯ä»·", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, CustomerEvaluation customerEvaluation) { |
| | | List<CustomerEvaluation> list = customerEvaluationService.selectCustomerEvaluationList(customerEvaluation); |
| | | ExcelUtil<CustomerEvaluation> util = new ExcelUtil<CustomerEvaluation>(CustomerEvaluation.class); |
| | | util.exportExcel(response, list, "客æ·è¯ä»·æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·å客æ·è¯ä»·è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:query')") |
| | | @GetMapping(value = "/{evaluationId}") |
| | | public AjaxResult getInfo(@PathVariable("evaluationId") Long evaluationId) { |
| | | return success(customerEvaluationService.selectCustomerEvaluationByEvaluationId(evaluationId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å®¢æ·è¯ä»· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:add')") |
| | | @Log(title = "客æ·è¯ä»·", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody CustomerEvaluation customerEvaluation) { |
| | | return toAjax(customerEvaluationService.insertCustomerEvaluation(customerEvaluation)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å®¢æ·è¯ä»· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:edit')") |
| | | @Log(title = "客æ·è¯ä»·", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody CustomerEvaluation customerEvaluation) { |
| | | return toAjax(customerEvaluationService.updateCustomerEvaluation(customerEvaluation)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å®¢æ·è¯ä»· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:remove')") |
| | | @Log(title = "客æ·è¯ä»·", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{evaluationIds}") |
| | | public AjaxResult remove(@PathVariable Long[] evaluationIds) { |
| | | return toAjax(customerEvaluationService.deleteCustomerEvaluationByEvaluationIds(evaluationIds)); |
| | | } |
| | | |
| | | /** |
| | | * è·åè¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | @Anonymous |
| | | @GetMapping("/dimensions") |
| | | public AjaxResult getDimensions() { |
| | | List<EvaluationDimension> dimensions = evaluationDimensionService.selectEnabledEvaluationDimensionList(); |
| | | return success(dimensions); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤å®¢æ·è¯ä»·ï¼å
¬å¼æ¥å£ï¼ |
| | | */ |
| | | @Anonymous |
| | | @PostMapping("/submit") |
| | | public AjaxResult submitEvaluation(@RequestBody CustomerEvaluation customerEvaluation, HttpServletRequest request) { |
| | | try { |
| | | // 设置IPå°ååç¨æ·ä»£ç |
| | | customerEvaluation.setIpAddress(getClientIP(request)); |
| | | customerEvaluation.setUserAgent(request.getHeader("User-Agent")); |
| | | |
| | | // æäº¤è¯ä»· |
| | | int result = customerEvaluationService.submitCustomerEvaluation(customerEvaluation); |
| | | |
| | | if (result > 0) { |
| | | // æ ¹æ®è¯åè¿åä¸åçæç¤ºä¿¡æ¯ |
| | | if (customerEvaluation.getTotalScore() != null && customerEvaluation.getTotalScore().doubleValue() < 3.0) { |
| | | return success("æäº¤æåï¼æä»¬å°ç«åæ¹è¿"); |
| | | } else { |
| | | return success("æäº¤æåï¼æè°¢æ¨çåä¸"); |
| | | } |
| | | } else { |
| | | return error("æäº¤å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("æäº¤è¯ä»·å¤±è´¥", e); |
| | | return error("æäº¤å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | } |
| | | |
| | | @Value("${wechat.appId}") |
| | | private String wechatAppId; |
| | | |
| | | @Value("${wechat.appSecret}") |
| | | private String wechatAppSecret; |
| | | |
| | | /** |
| | | * è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | @Anonymous |
| | | @GetMapping("/wechat/userinfo") |
| | | public AjaxResult getWechatUserInfo(String code, HttpServletRequest request) { |
| | | try { |
| | | |
| | | if (StringUtils.isEmpty(code)) { |
| | | return error("ææç ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // è·åç½é¡µææAccess Token |
| | | JSONObject tokenInfo = WechatUtils.getWebAccessToken(wechatAppId, wechatAppSecret, code); |
| | | if (tokenInfo == null) { |
| | | return error("è·å微信ææä¿¡æ¯å¤±è´¥"); |
| | | } |
| | | |
| | | String accessToken = tokenInfo.getString("access_token"); |
| | | String openid = tokenInfo.getString("openid"); |
| | | |
| | | // è·åç¨æ·ä¿¡æ¯ |
| | | JSONObject userInfo = WechatUtils.getWebUserInfo(accessToken, openid); |
| | | if (userInfo == null) { |
| | | return error("è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯å¤±è´¥"); |
| | | } |
| | | |
| | | return success(userInfo); |
| | | } catch (Exception e) { |
| | | logger.error("è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯å¤±è´¥", e); |
| | | return error("è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·å客æ·ç«¯IPå°å |
| | | */ |
| | | private String getClientIP(HttpServletRequest request) { |
| | | String ip = request.getHeader("X-Forwarded-For"); |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("WL-Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_CLIENT_IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getRemoteAddr(); |
| | | } |
| | | return ip; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.evaluation; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.EvaluationDimension; |
| | | import com.ruoyi.system.service.IEvaluationDimensionService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * è¯ä»·ç»´åº¦é
ç½®Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/evaluation/dimension") |
| | | public class EvaluationDimensionController extends BaseController { |
| | | @Autowired |
| | | private IEvaluationDimensionService evaluationDimensionService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯ä»·ç»´åº¦é
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:dimension:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(EvaluationDimension evaluationDimension) { |
| | | startPage(); |
| | | List<EvaluationDimension> list = evaluationDimensionService.selectEvaluationDimensionList(evaluationDimension); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè¯ä»·ç»´åº¦é
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:dimension:export')") |
| | | @Log(title = "è¯ä»·ç»´åº¦é
ç½®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, EvaluationDimension evaluationDimension) { |
| | | List<EvaluationDimension> list = evaluationDimensionService.selectEvaluationDimensionList(evaluationDimension); |
| | | ExcelUtil<EvaluationDimension> util = new ExcelUtil<EvaluationDimension>(EvaluationDimension.class); |
| | | util.exportExcel(response, list, "è¯ä»·ç»´åº¦é
ç½®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åè¯ä»·ç»´åº¦é
置详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:dimension:query')") |
| | | @GetMapping(value = "/{dimensionId}") |
| | | public AjaxResult getInfo(@PathVariable("dimensionId") Long dimensionId) { |
| | | return success(evaluationDimensionService.selectEvaluationDimensionByDimensionId(dimensionId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:dimension:add')") |
| | | @Log(title = "è¯ä»·ç»´åº¦é
ç½®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody EvaluationDimension evaluationDimension) { |
| | | return toAjax(evaluationDimensionService.insertEvaluationDimension(evaluationDimension)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:dimension:edit')") |
| | | @Log(title = "è¯ä»·ç»´åº¦é
ç½®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody EvaluationDimension evaluationDimension) { |
| | | return toAjax(evaluationDimensionService.updateEvaluationDimension(evaluationDimension)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:dimension:remove')") |
| | | @Log(title = "è¯ä»·ç»´åº¦é
ç½®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dimensionIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dimensionIds) { |
| | | return toAjax(evaluationDimensionService.deleteEvaluationDimensionByDimensionIds(dimensionIds)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.web.controller.evaluation; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.VehicleEvaluationQrcode; |
| | | import com.ruoyi.system.service.IVehicleEvaluationQrcodeService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | |
| | | /** |
| | | * 车è¾è¯ä»·äºç»´ç Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/evaluation/qrcode") |
| | | public class VehicleEvaluationQrcodeController extends BaseController { |
| | | @Autowired |
| | | private IVehicleEvaluationQrcodeService vehicleEvaluationQrcodeService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(VehicleEvaluationQrcode vehicleEvaluationQrcode) { |
| | | startPage(); |
| | | List<VehicleEvaluationQrcode> list = vehicleEvaluationQrcodeService.selectVehicleEvaluationQrcodeList(vehicleEvaluationQrcode); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè½¦è¾è¯ä»·äºç»´ç å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:export')") |
| | | @Log(title = "车è¾è¯ä»·äºç»´ç ", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, VehicleEvaluationQrcode vehicleEvaluationQrcode) { |
| | | List<VehicleEvaluationQrcode> list = vehicleEvaluationQrcodeService.selectVehicleEvaluationQrcodeList(vehicleEvaluationQrcode); |
| | | ExcelUtil<VehicleEvaluationQrcode> util = new ExcelUtil<VehicleEvaluationQrcode>(VehicleEvaluationQrcode.class); |
| | | util.exportExcel(response, list, "车è¾è¯ä»·äºç»´ç æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·å车è¾è¯ä»·äºç»´ç 详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:query')") |
| | | @GetMapping(value = "/{qrcodeId}") |
| | | public AjaxResult getInfo(@PathVariable("qrcodeId") Long qrcodeId) { |
| | | return success(vehicleEvaluationQrcodeService.selectVehicleEvaluationQrcodeByQrcodeId(qrcodeId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è½¦è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:add')") |
| | | @Log(title = "车è¾è¯ä»·äºç»´ç ", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody VehicleEvaluationQrcode vehicleEvaluationQrcode) { |
| | | return toAjax(vehicleEvaluationQrcodeService.insertVehicleEvaluationQrcode(vehicleEvaluationQrcode)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è½¦è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:edit')") |
| | | @Log(title = "车è¾è¯ä»·äºç»´ç ", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody VehicleEvaluationQrcode vehicleEvaluationQrcode) { |
| | | return toAjax(vehicleEvaluationQrcodeService.updateVehicleEvaluationQrcode(vehicleEvaluationQrcode)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è½¦è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:remove')") |
| | | @Log(title = "车è¾è¯ä»·äºç»´ç ", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{qrcodeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] qrcodeIds) { |
| | | return toAjax(vehicleEvaluationQrcodeService.deleteVehicleEvaluationQrcodeByQrcodeIds(qrcodeIds)); |
| | | } |
| | | |
| | | /** |
| | | * çæè½¦è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:generate')") |
| | | @Log(title = "车è¾è¯ä»·äºç»´ç ", businessType = BusinessType.INSERT) |
| | | @PostMapping("/generate") |
| | | public AjaxResult generateQrcode(@RequestBody JSONObject params) { |
| | | try { |
| | | String vehicleNo = params.getString("vehicleNo"); |
| | | String qrcodeUrl = params.getString("qrcodeUrl"); |
| | | |
| | | if (StringUtils.isEmpty(vehicleNo)) { |
| | | return error("车çå·ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (StringUtils.isEmpty(qrcodeUrl)) { |
| | | return error("äºç»´ç URLä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | VehicleEvaluationQrcode qrcode = vehicleEvaluationQrcodeService.generateVehicleEvaluationQrcode(vehicleNo, qrcodeUrl); |
| | | if (qrcode != null) { |
| | | return success(qrcode); |
| | | } else { |
| | | return error("çæäºç»´ç 失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("çæäºç»´ç 失败", e); |
| | | return error("çæäºç»´ç 失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹éçæè½¦è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('evaluation:qrcode:batch')") |
| | | @Log(title = "车è¾è¯ä»·äºç»´ç ", businessType = BusinessType.INSERT) |
| | | @PostMapping("/batch") |
| | | public AjaxResult batchGenerateQrcode() { |
| | | try { |
| | | int count = vehicleEvaluationQrcodeService.batchGenerateVehicleEvaluationQrcode(); |
| | | return success("æåçæ " + count + " 个äºç»´ç "); |
| | | } catch (Exception e) { |
| | | logger.error("æ¹éçæäºç»´ç 失败", e); |
| | | return error("æ¹éçæäºç»´ç 失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | basename: i18n/messages |
| | | profiles: |
| | | # ç¯å¢ dev|test|prod |
| | | active: prod |
| | | active: dev |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | |
| | | # æ°èªæ¥å£å°å |
| | | min: |
| | | apiUrl: http://120.25.98.119:8084/v1/ #æµè¯ç¯å¢ï¼localhost:8011 |
| | | |
| | | # 微信é
ç½® |
| | | wechat: |
| | | appId: your_wechat_appid |
| | | appSecret: your_wechat_appsecret |
| | | redirectUri: http://yourdomain.com/evaluation |
| | |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- äºç»´ç çæ --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- servletå
--> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
New file |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.MultiFormatWriter; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.client.j2se.MatrixToImageWriter; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * äºç»´ç çæå·¥å
·ç±» |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class QRCodeUtils { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(QRCodeUtils.class); |
| | | |
| | | private static final int WIDTH = 300; |
| | | private static final int HEIGHT = 300; |
| | | private static final String FORMAT = "png"; |
| | | |
| | | /** |
| | | * çæäºç»´ç å°æä»¶ |
| | | * |
| | | * @param content äºç»´ç å
容 |
| | | * @param filePath æä»¶è·¯å¾ |
| | | * @return æ¯å¦çææå |
| | | */ |
| | | public static boolean generateQRCodeToFile(String content, String filePath) { |
| | | try { |
| | | Map<EncodeHintType, Object> hints = new HashMap<>(); |
| | | hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); |
| | | hints.put(EncodeHintType.MARGIN, 1); |
| | | |
| | | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, WIDTH, HEIGHT, hints); |
| | | |
| | | File file = new File(filePath); |
| | | if (!file.getParentFile().exists()) { |
| | | file.getParentFile().mkdirs(); |
| | | } |
| | | |
| | | MatrixToImageWriter.writeToFile(bitMatrix, FORMAT, file); |
| | | return true; |
| | | } catch (Exception e) { |
| | | log.error("çæäºç»´ç 失败: {}", e.getMessage()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * çæäºç»´ç å°åèæ°ç» |
| | | * |
| | | * @param content äºç»´ç å
容 |
| | | * @return åèæ°ç» |
| | | */ |
| | | public static byte[] generateQRCodeToBytes(String content) { |
| | | try { |
| | | Map<EncodeHintType, Object> hints = new HashMap<>(); |
| | | hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); |
| | | hints.put(EncodeHintType.MARGIN, 1); |
| | | |
| | | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, WIDTH, HEIGHT, hints); |
| | | |
| | | BufferedImage image = MatrixToImageWriter.toBufferedImage(bitMatrix); |
| | | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | | ImageIO.write(image, FORMAT, baos); |
| | | |
| | | return baos.toByteArray(); |
| | | } catch (Exception e) { |
| | | log.error("çæäºç»´ç 失败: {}", e.getMessage()); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * çæBase64ç¼ç çäºç»´ç |
| | | * |
| | | * @param content äºç»´ç å
容 |
| | | * @return Base64ç¼ç çäºç»´ç |
| | | */ |
| | | public static String generateQRCodeToBase64(String content) { |
| | | byte[] bytes = generateQRCodeToBytes(content); |
| | | if (bytes != null) { |
| | | return "data:image/png;base64," + java.util.Base64.getEncoder().encodeToString(bytes); |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 微信工å
·ç±» |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class WechatUtils { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WechatUtils.class); |
| | | |
| | | private static final String WECHAT_API_BASE_URL = "https://api.weixin.qq.com"; |
| | | |
| | | /** |
| | | * è·å微信Access Token |
| | | * |
| | | * @param appId 微信AppID |
| | | * @param appSecret 微信AppSecret |
| | | * @return Access Token |
| | | */ |
| | | public static String getAccessToken(String appId, String appSecret) { |
| | | try { |
| | | String url = WECHAT_API_BASE_URL + "/cgi-bin/token?grant_type=client_credential&appid=" + appId + "&secret=" + appSecret; |
| | | |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String response = restTemplate.getForObject(url, String.class); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.containsKey("access_token")) { |
| | | return jsonObject.getString("access_token"); |
| | | } else { |
| | | log.error("è·å微信Access Token失败: {}", response); |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("è·å微信Access Tokenå¼å¸¸: {}", e.getMessage()); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @param accessToken Access Token |
| | | * @param openid ç¨æ·OpenID |
| | | * @return ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | public static JSONObject getWechatUserInfo(String accessToken, String openid) { |
| | | try { |
| | | String url = WECHAT_API_BASE_URL + "/cgi-bin/user/info?access_token=" + accessToken + "&openid=" + openid + "&lang=zh_CN"; |
| | | |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String response = restTemplate.getForObject(url, String.class); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.containsKey("openid")) { |
| | | return jsonObject; |
| | | } else { |
| | | log.error("è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯å¤±è´¥: {}", response); |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯å¼å¸¸: {}", e.getMessage()); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·å微信ç½é¡µææAccess Token |
| | | * |
| | | * @param appId 微信AppID |
| | | * @param appSecret 微信AppSecret |
| | | * @param code ææç |
| | | * @return ç½é¡µææAccess Tokenä¿¡æ¯ |
| | | */ |
| | | public static JSONObject getWebAccessToken(String appId, String appSecret, String code) { |
| | | try { |
| | | String url = WECHAT_API_BASE_URL + "/sns/oauth2/access_token?appid=" + appId + "&secret=" + appSecret + "&code=" + code + "&grant_type=authorization_code"; |
| | | |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String response = restTemplate.getForObject(url, String.class); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.containsKey("access_token")) { |
| | | return jsonObject; |
| | | } else { |
| | | log.error("è·å微信ç½é¡µææAccess Token失败: {}", response); |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("è·å微信ç½é¡µææAccess Tokenå¼å¸¸: {}", e.getMessage()); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·å微信ç½é¡µææç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @param accessToken ç½é¡µææAccess Token |
| | | * @param openid ç¨æ·OpenID |
| | | * @return ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | public static JSONObject getWebUserInfo(String accessToken, String openid) { |
| | | try { |
| | | String url = WECHAT_API_BASE_URL + "/sns/userinfo?access_token=" + accessToken + "&openid=" + openid + "&lang=zh_CN"; |
| | | |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String response = restTemplate.getForObject(url, String.class); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.containsKey("openid")) { |
| | | return jsonObject; |
| | | } else { |
| | | log.error("è·å微信ç½é¡µææç¨æ·ä¿¡æ¯å¤±è´¥: {}", response); |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("è·å微信ç½é¡µææç¨æ·ä¿¡æ¯å¼å¸¸: {}", e.getMessage()); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * çæå¾®ä¿¡ç½é¡µææURL |
| | | * |
| | | * @param appId 微信AppID |
| | | * @param redirectUri åè°å°å |
| | | * @param scope ææèå´ (snsapi_base æ snsapi_userinfo) |
| | | * @param state ç¶æåæ° |
| | | * @return ææURL |
| | | */ |
| | | public static String generateAuthUrl(String appId, String redirectUri, String scope, String state) { |
| | | try { |
| | | String encodedRedirectUri = java.net.URLEncoder.encode(redirectUri, "UTF-8"); |
| | | return WECHAT_API_BASE_URL + "/connect/oauth2/authorize?appid=" + appId + "&redirect_uri=" + encodedRedirectUri + "&response_type=code&scope=" + scope + "&state=" + state + "#wechat_redirect"; |
| | | } catch (Exception e) { |
| | | log.error("çæå¾®ä¿¡ææURLå¼å¸¸: {}", e.getMessage()); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 夿æ¯å¦ä¸ºå¾®ä¿¡æµè§å¨ |
| | | * |
| | | * @param userAgent ç¨æ·ä»£çå符串 |
| | | * @return æ¯å¦ä¸ºå¾®ä¿¡æµè§å¨ |
| | | */ |
| | | public static boolean isWechatBrowser(String userAgent) { |
| | | if (StringUtils.isEmpty(userAgent)) { |
| | | return false; |
| | | } |
| | | return userAgent.toLowerCase().contains("micromessenger"); |
| | | } |
| | | } |
| | |
| | | registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**") |
| | | .addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); |
| | | |
| | | /** äºç»´ç å¾ç访é®è·¯å¾ */ |
| | | registry.addResourceHandler("/qrcode/**") |
| | | .addResourceLocations("file:" + RuoYiConfig.getProfile() + "/qrcode/"); |
| | | |
| | | /** swaggeré
ç½® */ |
| | | registry.addResourceHandler("/swagger-ui/**") |
| | | .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 客æ·è¯ä»·å¯¹è±¡ customer_evaluation |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public class CustomerEvaluation extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** è¯ä»·ID */ |
| | | private Long evaluationId; |
| | | |
| | | /** 车çå· */ |
| | | @Excel(name = "车çå·") |
| | | private String vehicleNo; |
| | | |
| | | /** 客æ·å§å */ |
| | | @Excel(name = "客æ·å§å") |
| | | private String customerName; |
| | | |
| | | /** å®¢æ·ææºå· */ |
| | | @Excel(name = "å®¢æ·ææºå·") |
| | | private String customerPhone; |
| | | |
| | | /** 微信OpenID */ |
| | | @Excel(name = "微信OpenID") |
| | | private String wechatOpenid; |
| | | |
| | | /** 微信æµç§° */ |
| | | @Excel(name = "微信æµç§°") |
| | | private String wechatNickname; |
| | | |
| | | /** 微信头å */ |
| | | @Excel(name = "微信头å") |
| | | private String wechatAvatar; |
| | | |
| | | /** 微信ç»å®ææºå· */ |
| | | @Excel(name = "微信ç»å®ææºå·") |
| | | private String wechatPhone; |
| | | |
| | | /** æ»è¯å */ |
| | | @Excel(name = "æ»è¯å") |
| | | private BigDecimal totalScore; |
| | | |
| | | /** è¯ä»·ç¶æï¼0å¾
è¯ä»· 1å·²è¯ä»·ï¼ */ |
| | | @Excel(name = "è¯ä»·ç¶æ", readConverterExp = "0=å¾
è¯ä»·,1=å·²è¯ä»·") |
| | | private String evaluationStatus; |
| | | |
| | | /** è¯ä»·æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "è¯ä»·æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date evaluationTime; |
| | | |
| | | /** IPå°å */ |
| | | @Excel(name = "IPå°å") |
| | | private String ipAddress; |
| | | |
| | | /** ç¨æ·ä»£ç */ |
| | | @Excel(name = "ç¨æ·ä»£ç") |
| | | private String userAgent; |
| | | |
| | | /** è¯ä»·è¯¦æ
å表 */ |
| | | private List<EvaluationDetail> evaluationDetails; |
| | | |
| | | public void setEvaluationId(Long evaluationId) { |
| | | this.evaluationId = evaluationId; |
| | | } |
| | | |
| | | public Long getEvaluationId() { |
| | | return evaluationId; |
| | | } |
| | | |
| | | public void setVehicleNo(String vehicleNo) { |
| | | this.vehicleNo = vehicleNo; |
| | | } |
| | | |
| | | public String getVehicleNo() { |
| | | return vehicleNo; |
| | | } |
| | | |
| | | public void setCustomerName(String customerName) { |
| | | this.customerName = customerName; |
| | | } |
| | | |
| | | public String getCustomerName() { |
| | | return customerName; |
| | | } |
| | | |
| | | public void setCustomerPhone(String customerPhone) { |
| | | this.customerPhone = customerPhone; |
| | | } |
| | | |
| | | public String getCustomerPhone() { |
| | | return customerPhone; |
| | | } |
| | | |
| | | public void setWechatOpenid(String wechatOpenid) { |
| | | this.wechatOpenid = wechatOpenid; |
| | | } |
| | | |
| | | public String getWechatOpenid() { |
| | | return wechatOpenid; |
| | | } |
| | | |
| | | public void setWechatNickname(String wechatNickname) { |
| | | this.wechatNickname = wechatNickname; |
| | | } |
| | | |
| | | public String getWechatNickname() { |
| | | return wechatNickname; |
| | | } |
| | | |
| | | public void setWechatAvatar(String wechatAvatar) { |
| | | this.wechatAvatar = wechatAvatar; |
| | | } |
| | | |
| | | public String getWechatAvatar() { |
| | | return wechatAvatar; |
| | | } |
| | | |
| | | public void setWechatPhone(String wechatPhone) { |
| | | this.wechatPhone = wechatPhone; |
| | | } |
| | | |
| | | public String getWechatPhone() { |
| | | return wechatPhone; |
| | | } |
| | | |
| | | public void setTotalScore(BigDecimal totalScore) { |
| | | this.totalScore = totalScore; |
| | | } |
| | | |
| | | public BigDecimal getTotalScore() { |
| | | return totalScore; |
| | | } |
| | | |
| | | public void setEvaluationStatus(String evaluationStatus) { |
| | | this.evaluationStatus = evaluationStatus; |
| | | } |
| | | |
| | | public String getEvaluationStatus() { |
| | | return evaluationStatus; |
| | | } |
| | | |
| | | public void setEvaluationTime(Date evaluationTime) { |
| | | this.evaluationTime = evaluationTime; |
| | | } |
| | | |
| | | public Date getEvaluationTime() { |
| | | return evaluationTime; |
| | | } |
| | | |
| | | public void setIpAddress(String ipAddress) { |
| | | this.ipAddress = ipAddress; |
| | | } |
| | | |
| | | public String getIpAddress() { |
| | | return ipAddress; |
| | | } |
| | | |
| | | public void setUserAgent(String userAgent) { |
| | | this.userAgent = userAgent; |
| | | } |
| | | |
| | | public String getUserAgent() { |
| | | return userAgent; |
| | | } |
| | | |
| | | public List<EvaluationDetail> getEvaluationDetails() { |
| | | return evaluationDetails; |
| | | } |
| | | |
| | | public void setEvaluationDetails(List<EvaluationDetail> evaluationDetails) { |
| | | this.evaluationDetails = evaluationDetails; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("evaluationId", getEvaluationId()) |
| | | .append("vehicleNo", getVehicleNo()) |
| | | .append("customerName", getCustomerName()) |
| | | .append("customerPhone", getCustomerPhone()) |
| | | .append("wechatOpenid", getWechatOpenid()) |
| | | .append("wechatNickname", getWechatNickname()) |
| | | .append("wechatAvatar", getWechatAvatar()) |
| | | .append("wechatPhone", getWechatPhone()) |
| | | .append("totalScore", getTotalScore()) |
| | | .append("evaluationStatus", getEvaluationStatus()) |
| | | .append("evaluationTime", getEvaluationTime()) |
| | | .append("ipAddress", getIpAddress()) |
| | | .append("userAgent", getUserAgent()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * è¯ä»·è¯¦æ
对象 evaluation_detail |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public class EvaluationDetail extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 详æ
ID */ |
| | | private Long detailId; |
| | | |
| | | /** è¯ä»·ID */ |
| | | @Excel(name = "è¯ä»·ID") |
| | | private Long evaluationId; |
| | | |
| | | /** 维度ID */ |
| | | @Excel(name = "维度ID") |
| | | private Long dimensionId; |
| | | |
| | | /** è¯åï¼1-5æï¼ */ |
| | | @Excel(name = "è¯å") |
| | | private Integer score; |
| | | |
| | | /** é项å¼ï¼éæ©ç±»åæ¶ä½¿ç¨ï¼ */ |
| | | @Excel(name = "é项å¼") |
| | | private String optionValue; |
| | | |
| | | /** ææ¬å
å®¹ï¼ææ¬ç±»åæ¶ä½¿ç¨ï¼ */ |
| | | @Excel(name = "ææ¬å
容") |
| | | private String textContent; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "å建æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** ç»´åº¦ä¿¡æ¯ */ |
| | | private EvaluationDimension dimension; |
| | | |
| | | public void setDetailId(Long detailId) { |
| | | this.detailId = detailId; |
| | | } |
| | | |
| | | public Long getDetailId() { |
| | | return detailId; |
| | | } |
| | | |
| | | public void setEvaluationId(Long evaluationId) { |
| | | this.evaluationId = evaluationId; |
| | | } |
| | | |
| | | public Long getEvaluationId() { |
| | | return evaluationId; |
| | | } |
| | | |
| | | public void setDimensionId(Long dimensionId) { |
| | | this.dimensionId = dimensionId; |
| | | } |
| | | |
| | | public Long getDimensionId() { |
| | | return dimensionId; |
| | | } |
| | | |
| | | public void setScore(Integer score) { |
| | | this.score = score; |
| | | } |
| | | |
| | | public Integer getScore() { |
| | | return score; |
| | | } |
| | | |
| | | public void setOptionValue(String optionValue) { |
| | | this.optionValue = optionValue; |
| | | } |
| | | |
| | | public String getOptionValue() { |
| | | return optionValue; |
| | | } |
| | | |
| | | public void setTextContent(String textContent) { |
| | | this.textContent = textContent; |
| | | } |
| | | |
| | | public String getTextContent() { |
| | | return textContent; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public EvaluationDimension getDimension() { |
| | | return dimension; |
| | | } |
| | | |
| | | public void setDimension(EvaluationDimension dimension) { |
| | | this.dimension = dimension; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("detailId", getDetailId()) |
| | | .append("evaluationId", getEvaluationId()) |
| | | .append("dimensionId", getDimensionId()) |
| | | .append("score", getScore()) |
| | | .append("optionValue", getOptionValue()) |
| | | .append("textContent", getTextContent()) |
| | | .append("createTime", getCreateTime()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * è¯ä»·ç»´åº¦é
置对象 evaluation_dimension |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public class EvaluationDimension extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 维度ID */ |
| | | private Long dimensionId; |
| | | |
| | | /** 维度åç§° */ |
| | | @Excel(name = "维度åç§°") |
| | | private String dimensionName; |
| | | |
| | | /** 维度æè¿° */ |
| | | @Excel(name = "维度æè¿°") |
| | | private String dimensionDesc; |
| | | |
| | | /** 维度类åï¼star-æçº§è¯ä»·ï¼select-éæ©è¯ä»·ï¼text-ææ¬è¯ä»· */ |
| | | @Excel(name = "维度类å", readConverterExp = "star=æçº§è¯ä»·,select=éæ©è¯ä»·,text=ææ¬è¯ä»·") |
| | | private String dimensionType; |
| | | |
| | | /** é项é
ç½®ï¼JSONæ ¼å¼ï¼ç¨äºéæ©ç±»åï¼ */ |
| | | private String options; |
| | | |
| | | /** æåº */ |
| | | @Excel(name = "æåº") |
| | | private Integer sortOrder; |
| | | |
| | | /** æ¯å¦å¿
å¡«ï¼0å¦ 1æ¯ï¼ */ |
| | | @Excel(name = "æ¯å¦å¿
å¡«", readConverterExp = "0=å¦,1=æ¯") |
| | | private String isRequired; |
| | | |
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */ |
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨") |
| | | private String status; |
| | | |
| | | public void setDimensionId(Long dimensionId) { |
| | | this.dimensionId = dimensionId; |
| | | } |
| | | |
| | | public Long getDimensionId() { |
| | | return dimensionId; |
| | | } |
| | | |
| | | public void setDimensionName(String dimensionName) { |
| | | this.dimensionName = dimensionName; |
| | | } |
| | | |
| | | public String getDimensionName() { |
| | | return dimensionName; |
| | | } |
| | | |
| | | public void setDimensionDesc(String dimensionDesc) { |
| | | this.dimensionDesc = dimensionDesc; |
| | | } |
| | | |
| | | public String getDimensionDesc() { |
| | | return dimensionDesc; |
| | | } |
| | | |
| | | public void setDimensionType(String dimensionType) { |
| | | this.dimensionType = dimensionType; |
| | | } |
| | | |
| | | public String getDimensionType() { |
| | | return dimensionType; |
| | | } |
| | | |
| | | public void setOptions(String options) { |
| | | this.options = options; |
| | | } |
| | | |
| | | public String getOptions() { |
| | | return options; |
| | | } |
| | | |
| | | public void setSortOrder(Integer sortOrder) { |
| | | this.sortOrder = sortOrder; |
| | | } |
| | | |
| | | public Integer getSortOrder() { |
| | | return sortOrder; |
| | | } |
| | | |
| | | public void setIsRequired(String isRequired) { |
| | | this.isRequired = isRequired; |
| | | } |
| | | |
| | | public String getIsRequired() { |
| | | return isRequired; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dimensionId", getDimensionId()) |
| | | .append("dimensionName", getDimensionName()) |
| | | .append("dimensionDesc", getDimensionDesc()) |
| | | .append("dimensionType", getDimensionType()) |
| | | .append("options", getOptions()) |
| | | .append("sortOrder", getSortOrder()) |
| | | .append("isRequired", getIsRequired()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 车è¾è¯ä»·äºç»´ç 对象 vehicle_evaluation_qrcode |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public class VehicleEvaluationQrcode extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** äºç»´ç ID */ |
| | | private Long qrcodeId; |
| | | |
| | | /** 车çå· */ |
| | | @Excel(name = "车çå·") |
| | | private String vehicleNo; |
| | | |
| | | /** äºç»´ç URL */ |
| | | @Excel(name = "äºç»´ç URL") |
| | | private String qrcodeUrl; |
| | | |
| | | /** äºç»´ç å
容 */ |
| | | @Excel(name = "äºç»´ç å
容") |
| | | private String qrcodeContent; |
| | | |
| | | /** äºç»´ç å¾çè·¯å¾ */ |
| | | @Excel(name = "äºç»´ç å¾çè·¯å¾") |
| | | private String qrcodeImage; |
| | | |
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */ |
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨") |
| | | private String status; |
| | | |
| | | public void setQrcodeId(Long qrcodeId) { |
| | | this.qrcodeId = qrcodeId; |
| | | } |
| | | |
| | | public Long getQrcodeId() { |
| | | return qrcodeId; |
| | | } |
| | | |
| | | public void setVehicleNo(String vehicleNo) { |
| | | this.vehicleNo = vehicleNo; |
| | | } |
| | | |
| | | public String getVehicleNo() { |
| | | return vehicleNo; |
| | | } |
| | | |
| | | public void setQrcodeUrl(String qrcodeUrl) { |
| | | this.qrcodeUrl = qrcodeUrl; |
| | | } |
| | | |
| | | public String getQrcodeUrl() { |
| | | return qrcodeUrl; |
| | | } |
| | | |
| | | public void setQrcodeContent(String qrcodeContent) { |
| | | this.qrcodeContent = qrcodeContent; |
| | | } |
| | | |
| | | public String getQrcodeContent() { |
| | | return qrcodeContent; |
| | | } |
| | | |
| | | public void setQrcodeImage(String qrcodeImage) { |
| | | this.qrcodeImage = qrcodeImage; |
| | | } |
| | | |
| | | public String getQrcodeImage() { |
| | | return qrcodeImage; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("qrcodeId", getQrcodeId()) |
| | | .append("vehicleNo", getVehicleNo()) |
| | | .append("qrcodeUrl", getQrcodeUrl()) |
| | | .append("qrcodeContent", getQrcodeContent()) |
| | | .append("qrcodeImage", getQrcodeImage()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | @Excel(name = "平尿 è¯") |
| | | private String platformCode; |
| | | |
| | | /** å½å±é¨é¨ID */ |
| | | @Excel(name = "å½å±é¨é¨ID") |
| | | private Long deptId; |
| | | |
| | | /** å½å±é¨é¨åç§° */ |
| | | @Excel(name = "å½å±é¨é¨åç§°") |
| | | private String deptName; |
| | | |
| | | public void setVehicleId(Long vehicleId) { |
| | | this.vehicleId = vehicleId; |
| | | } |
| | |
| | | this.platformCode = platformCode; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public String getDeptName() { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | |
| | | .append("vehicleModel", getVehicleModel()) |
| | | .append("status", getStatus()) |
| | | .append("platformCode", getPlatformCode()) |
| | | .append("deptId", getDeptId()) |
| | | .append("deptName", getDeptName()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | |
| | | * æ¥è¯¢è®¢åç¶æå表 |
| | | * é»è®¤æ¥è¯¢ flag = 0 çè®°å½ |
| | | * |
| | | * @param aOrderStatus 订åç¶æä¿¡æ¯ |
| | | * @param 订åç¶æä¿¡æ¯ |
| | | * @return 订åç¶æéå |
| | | */ |
| | | public List<AOrderStatus> selectAOrderStatusList(); |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.CustomerEvaluation; |
| | | |
| | | /** |
| | | * 客æ·è¯ä»·Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public interface CustomerEvaluationMapper { |
| | | /** |
| | | * æ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param evaluationId 客æ·è¯ä»·ä¸»é® |
| | | * @return 客æ·è¯ä»· |
| | | */ |
| | | public CustomerEvaluation selectCustomerEvaluationByEvaluationId(Long evaluationId); |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·è¯ä»·å表 |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | public List<CustomerEvaluation> selectCustomerEvaluationList(CustomerEvaluation customerEvaluation); |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·æ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | public List<CustomerEvaluation> selectCustomerEvaluationByVehicleNo(String vehicleNo); |
| | | |
| | | /** |
| | | * æ ¹æ®å¾®ä¿¡OpenIDæ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param wechatOpenid 微信OpenID |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | public List<CustomerEvaluation> selectCustomerEvaluationByWechatOpenid(String wechatOpenid); |
| | | |
| | | /** |
| | | * æ°å¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | public int insertCustomerEvaluation(CustomerEvaluation customerEvaluation); |
| | | |
| | | /** |
| | | * ä¿®æ¹å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | public int updateCustomerEvaluation(CustomerEvaluation customerEvaluation); |
| | | |
| | | /** |
| | | * å é¤å®¢æ·è¯ä»· |
| | | * |
| | | * @param evaluationId 客æ·è¯ä»·ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCustomerEvaluationByEvaluationId(Long evaluationId); |
| | | |
| | | /** |
| | | * æ¹éå é¤å®¢æ·è¯ä»· |
| | | * |
| | | * @param evaluationIds éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCustomerEvaluationByEvaluationIds(Long[] evaluationIds); |
| | | |
| | | /** |
| | | * ç»è®¡è¯ä»·æ°é |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return è¯ä»·ç»è®¡ä¿¡æ¯ |
| | | */ |
| | | public List<CustomerEvaluation> selectEvaluationStatistics(CustomerEvaluation customerEvaluation); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.EvaluationDetail; |
| | | |
| | | /** |
| | | * è¯ä»·è¯¦æ
Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public interface EvaluationDetailMapper { |
| | | /** |
| | | * æ¥è¯¢è¯ä»·è¯¦æ
|
| | | * |
| | | * @param detailId è¯ä»·è¯¦æ
ä¸»é® |
| | | * @return è¯ä»·è¯¦æ
|
| | | */ |
| | | public EvaluationDetail selectEvaluationDetailByDetailId(Long detailId); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯ä»·è¯¦æ
å表 |
| | | * |
| | | * @param evaluationDetail è¯ä»·è¯¦æ
|
| | | * @return è¯ä»·è¯¦æ
éå |
| | | */ |
| | | public List<EvaluationDetail> selectEvaluationDetailList(EvaluationDetail evaluationDetail); |
| | | |
| | | /** |
| | | * æ ¹æ®è¯ä»·IDæ¥è¯¢è¯ä»·è¯¦æ
å表 |
| | | * |
| | | * @param evaluationId è¯ä»·ID |
| | | * @return è¯ä»·è¯¦æ
éå |
| | | */ |
| | | public List<EvaluationDetail> selectEvaluationDetailByEvaluationId(Long evaluationId); |
| | | |
| | | /** |
| | | * æ°å¢è¯ä»·è¯¦æ
|
| | | * |
| | | * @param evaluationDetail è¯ä»·è¯¦æ
|
| | | * @return ç»æ |
| | | */ |
| | | public int insertEvaluationDetail(EvaluationDetail evaluationDetail); |
| | | |
| | | /** |
| | | * æ¹éæ°å¢è¯ä»·è¯¦æ
|
| | | * |
| | | * @param evaluationDetails è¯ä»·è¯¦æ
å表 |
| | | * @return ç»æ |
| | | */ |
| | | public int insertEvaluationDetailBatch(List<EvaluationDetail> evaluationDetails); |
| | | |
| | | /** |
| | | * ä¿®æ¹è¯ä»·è¯¦æ
|
| | | * |
| | | * @param evaluationDetail è¯ä»·è¯¦æ
|
| | | * @return ç»æ |
| | | */ |
| | | public int updateEvaluationDetail(EvaluationDetail evaluationDetail); |
| | | |
| | | /** |
| | | * å é¤è¯ä»·è¯¦æ
|
| | | * |
| | | * @param detailId è¯ä»·è¯¦æ
ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEvaluationDetailByDetailId(Long detailId); |
| | | |
| | | /** |
| | | * æ ¹æ®è¯ä»·IDå é¤è¯ä»·è¯¦æ
|
| | | * |
| | | * @param evaluationId è¯ä»·ID |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEvaluationDetailByEvaluationId(Long evaluationId); |
| | | |
| | | /** |
| | | * æ¹éå é¤è¯ä»·è¯¦æ
|
| | | * |
| | | * @param detailIds éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEvaluationDetailByDetailIds(Long[] detailIds); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.EvaluationDimension; |
| | | |
| | | /** |
| | | * è¯ä»·ç»´åº¦é
ç½®Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public interface EvaluationDimensionMapper { |
| | | /** |
| | | * æ¥è¯¢è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param dimensionId è¯ä»·ç»´åº¦é
ç½®ä¸»é® |
| | | * @return è¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | public EvaluationDimension selectEvaluationDimensionByDimensionId(Long dimensionId); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯ä»·ç»´åº¦é
ç½®å表 |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return è¯ä»·ç»´åº¦é
ç½®éå |
| | | */ |
| | | public List<EvaluationDimension> selectEvaluationDimensionList(EvaluationDimension evaluationDimension); |
| | | |
| | | /** |
| | | * æ¥è¯¢å¯ç¨çè¯ä»·ç»´åº¦é
ç½®å表 |
| | | * |
| | | * @return è¯ä»·ç»´åº¦é
ç½®éå |
| | | */ |
| | | public List<EvaluationDimension> selectEnabledEvaluationDimensionList(); |
| | | |
| | | /** |
| | | * æ°å¢è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertEvaluationDimension(EvaluationDimension evaluationDimension); |
| | | |
| | | /** |
| | | * ä¿®æ¹è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateEvaluationDimension(EvaluationDimension evaluationDimension); |
| | | |
| | | /** |
| | | * å é¤è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param dimensionId è¯ä»·ç»´åº¦é
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEvaluationDimensionByDimensionId(Long dimensionId); |
| | | |
| | | /** |
| | | * æ¹éå é¤è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param dimensionIds éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEvaluationDimensionByDimensionIds(Long[] dimensionIds); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.VehicleEvaluationQrcode; |
| | | |
| | | /** |
| | | * 车è¾è¯ä»·äºç»´ç Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public interface VehicleEvaluationQrcodeMapper { |
| | | /** |
| | | * æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param qrcodeId 车è¾è¯ä»·äºç»´ç ä¸»é® |
| | | * @return 车è¾è¯ä»·äºç»´ç |
| | | */ |
| | | public VehicleEvaluationQrcode selectVehicleEvaluationQrcodeByQrcodeId(Long qrcodeId); |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return 车è¾è¯ä»·äºç»´ç |
| | | */ |
| | | public VehicleEvaluationQrcode selectVehicleEvaluationQrcodeByVehicleNo(String vehicleNo); |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç å表 |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return 车è¾è¯ä»·äºç»´ç éå |
| | | */ |
| | | public List<VehicleEvaluationQrcode> selectVehicleEvaluationQrcodeList(VehicleEvaluationQrcode vehicleEvaluationQrcode); |
| | | |
| | | /** |
| | | * æ°å¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertVehicleEvaluationQrcode(VehicleEvaluationQrcode vehicleEvaluationQrcode); |
| | | |
| | | /** |
| | | * ä¿®æ¹è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateVehicleEvaluationQrcode(VehicleEvaluationQrcode vehicleEvaluationQrcode); |
| | | |
| | | /** |
| | | * å é¤è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param qrcodeId 车è¾è¯ä»·äºç»´ç ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteVehicleEvaluationQrcodeByQrcodeId(Long qrcodeId); |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·å é¤è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteVehicleEvaluationQrcodeByVehicleNo(String vehicleNo); |
| | | |
| | | /** |
| | | * æ¹éå é¤è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param qrcodeIds éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteVehicleEvaluationQrcodeByQrcodeIds(Long[] qrcodeIds); |
| | | } |
| | |
| | | public VehicleInfo selectVehicleInfoByPlateNumber(String plateNumber); |
| | | |
| | | /** |
| | | * éè¿è½¦çå·æ¥è¯¢è½¦è¾ä¿¡æ¯ |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return 车è¾ä¿¡æ¯ |
| | | */ |
| | | public VehicleInfo selectVehicleInfoByVehicleNo(String vehicleNo); |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¦è¾ä¿¡æ¯å表 |
| | | * |
| | | * @param vehicleInfo 车è¾ä¿¡æ¯ |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.CustomerEvaluation; |
| | | |
| | | /** |
| | | * 客æ·è¯ä»·Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public interface ICustomerEvaluationService { |
| | | /** |
| | | * æ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param evaluationId 客æ·è¯ä»·ä¸»é® |
| | | * @return 客æ·è¯ä»· |
| | | */ |
| | | public CustomerEvaluation selectCustomerEvaluationByEvaluationId(Long evaluationId); |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·è¯ä»·å表 |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | public List<CustomerEvaluation> selectCustomerEvaluationList(CustomerEvaluation customerEvaluation); |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·æ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | public List<CustomerEvaluation> selectCustomerEvaluationByVehicleNo(String vehicleNo); |
| | | |
| | | /** |
| | | * æ ¹æ®å¾®ä¿¡OpenIDæ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param wechatOpenid 微信OpenID |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | public List<CustomerEvaluation> selectCustomerEvaluationByWechatOpenid(String wechatOpenid); |
| | | |
| | | /** |
| | | * æ°å¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | public int insertCustomerEvaluation(CustomerEvaluation customerEvaluation); |
| | | |
| | | /** |
| | | * ä¿®æ¹å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | public int updateCustomerEvaluation(CustomerEvaluation customerEvaluation); |
| | | |
| | | /** |
| | | * æ¹éå é¤å®¢æ·è¯ä»· |
| | | * |
| | | * @param evaluationIds éè¦å é¤ç客æ·è¯ä»·ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCustomerEvaluationByEvaluationIds(Long[] evaluationIds); |
| | | |
| | | /** |
| | | * å é¤å®¢æ·è¯ä»·ä¿¡æ¯ |
| | | * |
| | | * @param evaluationId 客æ·è¯ä»·ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteCustomerEvaluationByEvaluationId(Long evaluationId); |
| | | |
| | | /** |
| | | * æäº¤å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | public int submitCustomerEvaluation(CustomerEvaluation customerEvaluation); |
| | | |
| | | /** |
| | | * ç»è®¡è¯ä»·æ°é |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return è¯ä»·ç»è®¡ä¿¡æ¯ |
| | | */ |
| | | public List<CustomerEvaluation> selectEvaluationStatistics(CustomerEvaluation customerEvaluation); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.EvaluationDimension; |
| | | |
| | | /** |
| | | * è¯ä»·ç»´åº¦é
ç½®Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public interface IEvaluationDimensionService { |
| | | /** |
| | | * æ¥è¯¢è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param dimensionId è¯ä»·ç»´åº¦é
ç½®ä¸»é® |
| | | * @return è¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | public EvaluationDimension selectEvaluationDimensionByDimensionId(Long dimensionId); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯ä»·ç»´åº¦é
ç½®å表 |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return è¯ä»·ç»´åº¦é
ç½®éå |
| | | */ |
| | | public List<EvaluationDimension> selectEvaluationDimensionList(EvaluationDimension evaluationDimension); |
| | | |
| | | /** |
| | | * æ¥è¯¢å¯ç¨çè¯ä»·ç»´åº¦é
ç½®å表 |
| | | * |
| | | * @return è¯ä»·ç»´åº¦é
ç½®éå |
| | | */ |
| | | public List<EvaluationDimension> selectEnabledEvaluationDimensionList(); |
| | | |
| | | /** |
| | | * æ°å¢è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertEvaluationDimension(EvaluationDimension evaluationDimension); |
| | | |
| | | /** |
| | | * ä¿®æ¹è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateEvaluationDimension(EvaluationDimension evaluationDimension); |
| | | |
| | | /** |
| | | * æ¹éå é¤è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param dimensionIds éè¦å é¤çè¯ä»·ç»´åº¦é
置主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEvaluationDimensionByDimensionIds(Long[] dimensionIds); |
| | | |
| | | /** |
| | | * å é¤è¯ä»·ç»´åº¦é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param dimensionId è¯ä»·ç»´åº¦é
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEvaluationDimensionByDimensionId(Long dimensionId); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.VehicleEvaluationQrcode; |
| | | |
| | | /** |
| | | * 车è¾è¯ä»·äºç»´ç Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | public interface IVehicleEvaluationQrcodeService { |
| | | /** |
| | | * æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param qrcodeId 车è¾è¯ä»·äºç»´ç ä¸»é® |
| | | * @return 车è¾è¯ä»·äºç»´ç |
| | | */ |
| | | public VehicleEvaluationQrcode selectVehicleEvaluationQrcodeByQrcodeId(Long qrcodeId); |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return 车è¾è¯ä»·äºç»´ç |
| | | */ |
| | | public VehicleEvaluationQrcode selectVehicleEvaluationQrcodeByVehicleNo(String vehicleNo); |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç å表 |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return 车è¾è¯ä»·äºç»´ç éå |
| | | */ |
| | | public List<VehicleEvaluationQrcode> selectVehicleEvaluationQrcodeList(VehicleEvaluationQrcode vehicleEvaluationQrcode); |
| | | |
| | | /** |
| | | * æ°å¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertVehicleEvaluationQrcode(VehicleEvaluationQrcode vehicleEvaluationQrcode); |
| | | |
| | | /** |
| | | * ä¿®æ¹è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateVehicleEvaluationQrcode(VehicleEvaluationQrcode vehicleEvaluationQrcode); |
| | | |
| | | /** |
| | | * æ¹éå é¤è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param qrcodeIds éè¦å é¤ç车è¾è¯ä»·äºç»´ç 主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteVehicleEvaluationQrcodeByQrcodeIds(Long[] qrcodeIds); |
| | | |
| | | /** |
| | | * å é¤è½¦è¾è¯ä»·äºç»´ç ä¿¡æ¯ |
| | | * |
| | | * @param qrcodeId 车è¾è¯ä»·äºç»´ç ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteVehicleEvaluationQrcodeByQrcodeId(Long qrcodeId); |
| | | |
| | | /** |
| | | * çæè½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return äºç»´ç ä¿¡æ¯ |
| | | */ |
| | | public VehicleEvaluationQrcode generateVehicleEvaluationQrcode(String vehicleNo); |
| | | |
| | | /** |
| | | * çæè½¦è¾è¯ä»·äºç»´ç ï¼å¸¦URLåæ°ï¼ |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @param qrcodeUrl äºç»´ç URL |
| | | * @return äºç»´ç ä¿¡æ¯ |
| | | */ |
| | | public VehicleEvaluationQrcode generateVehicleEvaluationQrcode(String vehicleNo, String qrcodeUrl); |
| | | |
| | | /** |
| | | * æ¹éçæè½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public int batchGenerateVehicleEvaluationQrcode(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.system.mapper.CustomerEvaluationMapper; |
| | | import com.ruoyi.system.mapper.EvaluationDetailMapper; |
| | | import com.ruoyi.system.domain.CustomerEvaluation; |
| | | import com.ruoyi.system.domain.EvaluationDetail; |
| | | import com.ruoyi.system.service.ICustomerEvaluationService; |
| | | |
| | | /** |
| | | * 客æ·è¯ä»·Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | @Service |
| | | public class CustomerEvaluationServiceImpl implements ICustomerEvaluationService { |
| | | @Autowired |
| | | private CustomerEvaluationMapper customerEvaluationMapper; |
| | | |
| | | @Autowired |
| | | private EvaluationDetailMapper evaluationDetailMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param evaluationId 客æ·è¯ä»·ä¸»é® |
| | | * @return 客æ·è¯ä»· |
| | | */ |
| | | @Override |
| | | public CustomerEvaluation selectCustomerEvaluationByEvaluationId(Long evaluationId) { |
| | | CustomerEvaluation evaluation = customerEvaluationMapper.selectCustomerEvaluationByEvaluationId(evaluationId); |
| | | if (evaluation != null) { |
| | | // æ¥è¯¢è¯ä»·è¯¦æ
|
| | | List<EvaluationDetail> details = evaluationDetailMapper.selectEvaluationDetailByEvaluationId(evaluationId); |
| | | evaluation.setEvaluationDetails(details); |
| | | } |
| | | return evaluation; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·è¯ä»·å表 |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return 客æ·è¯ä»· |
| | | */ |
| | | @Override |
| | | public List<CustomerEvaluation> selectCustomerEvaluationList(CustomerEvaluation customerEvaluation) { |
| | | return customerEvaluationMapper.selectCustomerEvaluationList(customerEvaluation); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·æ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | @Override |
| | | public List<CustomerEvaluation> selectCustomerEvaluationByVehicleNo(String vehicleNo) { |
| | | return customerEvaluationMapper.selectCustomerEvaluationByVehicleNo(vehicleNo); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å¾®ä¿¡OpenIDæ¥è¯¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param wechatOpenid 微信OpenID |
| | | * @return 客æ·è¯ä»·éå |
| | | */ |
| | | @Override |
| | | public List<CustomerEvaluation> selectCustomerEvaluationByWechatOpenid(String wechatOpenid) { |
| | | return customerEvaluationMapper.selectCustomerEvaluationByWechatOpenid(wechatOpenid); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertCustomerEvaluation(CustomerEvaluation customerEvaluation) { |
| | | customerEvaluation.setCreateTime(DateUtils.getNowDate()); |
| | | return customerEvaluationMapper.insertCustomerEvaluation(customerEvaluation); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateCustomerEvaluation(CustomerEvaluation customerEvaluation) { |
| | | customerEvaluation.setUpdateTime(DateUtils.getNowDate()); |
| | | return customerEvaluationMapper.updateCustomerEvaluation(customerEvaluation); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤å®¢æ·è¯ä»· |
| | | * |
| | | * @param evaluationIds éè¦å é¤ç客æ·è¯ä»·ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteCustomerEvaluationByEvaluationIds(Long[] evaluationIds) { |
| | | return customerEvaluationMapper.deleteCustomerEvaluationByEvaluationIds(evaluationIds); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å®¢æ·è¯ä»·ä¿¡æ¯ |
| | | * |
| | | * @param evaluationId 客æ·è¯ä»·ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteCustomerEvaluationByEvaluationId(Long evaluationId) { |
| | | return customerEvaluationMapper.deleteCustomerEvaluationByEvaluationId(evaluationId); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤å®¢æ·è¯ä»· |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int submitCustomerEvaluation(CustomerEvaluation customerEvaluation) { |
| | | // è®¡ç®æ»è¯å |
| | | BigDecimal totalScore = calculateTotalScore(customerEvaluation.getEvaluationDetails()); |
| | | customerEvaluation.setTotalScore(totalScore); |
| | | customerEvaluation.setEvaluationStatus("1"); |
| | | customerEvaluation.setEvaluationTime(DateUtils.getNowDate()); |
| | | customerEvaluation.setCreateTime(DateUtils.getNowDate()); |
| | | |
| | | // æå
¥å®¢æ·è¯ä»· |
| | | int result = customerEvaluationMapper.insertCustomerEvaluation(customerEvaluation); |
| | | |
| | | if (result > 0 && customerEvaluation.getEvaluationDetails() != null && !customerEvaluation.getEvaluationDetails().isEmpty()) { |
| | | // æå
¥è¯ä»·è¯¦æ
|
| | | for (EvaluationDetail detail : customerEvaluation.getEvaluationDetails()) { |
| | | detail.setEvaluationId(customerEvaluation.getEvaluationId()); |
| | | detail.setCreateTime(DateUtils.getNowDate()); |
| | | evaluationDetailMapper.insertEvaluationDetail(detail); |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * ç»è®¡è¯ä»·æ°é |
| | | * |
| | | * @param customerEvaluation 客æ·è¯ä»· |
| | | * @return è¯ä»·ç»è®¡ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<CustomerEvaluation> selectEvaluationStatistics(CustomerEvaluation customerEvaluation) { |
| | | return customerEvaluationMapper.selectEvaluationStatistics(customerEvaluation); |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ»è¯å |
| | | * |
| | | * @param details è¯ä»·è¯¦æ
å表 |
| | | * @return æ»è¯å |
| | | */ |
| | | private BigDecimal calculateTotalScore(List<EvaluationDetail> details) { |
| | | if (details == null || details.isEmpty()) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | |
| | | int totalScore = 0; |
| | | int count = 0; |
| | | |
| | | for (EvaluationDetail detail : details) { |
| | | if (detail.getScore() != null && detail.getScore() > 0) { |
| | | totalScore += detail.getScore(); |
| | | count++; |
| | | } |
| | | } |
| | | |
| | | if (count == 0) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | |
| | | return new BigDecimal(totalScore).divide(new BigDecimal(count), 1, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.mapper.EvaluationDimensionMapper; |
| | | import com.ruoyi.system.domain.EvaluationDimension; |
| | | import com.ruoyi.system.service.IEvaluationDimensionService; |
| | | |
| | | /** |
| | | * è¯ä»·ç»´åº¦é
ç½®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | @Service |
| | | public class EvaluationDimensionServiceImpl implements IEvaluationDimensionService { |
| | | @Autowired |
| | | private EvaluationDimensionMapper evaluationDimensionMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param dimensionId è¯ä»·ç»´åº¦é
ç½®ä¸»é® |
| | | * @return è¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | @Override |
| | | public EvaluationDimension selectEvaluationDimensionByDimensionId(Long dimensionId) { |
| | | return evaluationDimensionMapper.selectEvaluationDimensionByDimensionId(dimensionId); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯ä»·ç»´åº¦é
ç½®å表 |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return è¯ä»·ç»´åº¦é
ç½® |
| | | */ |
| | | @Override |
| | | public List<EvaluationDimension> selectEvaluationDimensionList(EvaluationDimension evaluationDimension) { |
| | | return evaluationDimensionMapper.selectEvaluationDimensionList(evaluationDimension); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¯ç¨çè¯ä»·ç»´åº¦é
ç½®å表 |
| | | * |
| | | * @return è¯ä»·ç»´åº¦é
ç½®éå |
| | | */ |
| | | @Override |
| | | public List<EvaluationDimension> selectEnabledEvaluationDimensionList() { |
| | | return evaluationDimensionMapper.selectEnabledEvaluationDimensionList(); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertEvaluationDimension(EvaluationDimension evaluationDimension) { |
| | | evaluationDimension.setCreateTime(DateUtils.getNowDate()); |
| | | return evaluationDimensionMapper.insertEvaluationDimension(evaluationDimension); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param evaluationDimension è¯ä»·ç»´åº¦é
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateEvaluationDimension(EvaluationDimension evaluationDimension) { |
| | | evaluationDimension.setUpdateTime(DateUtils.getNowDate()); |
| | | return evaluationDimensionMapper.updateEvaluationDimension(evaluationDimension); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤è¯ä»·ç»´åº¦é
ç½® |
| | | * |
| | | * @param dimensionIds éè¦å é¤çè¯ä»·ç»´åº¦é
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteEvaluationDimensionByDimensionIds(Long[] dimensionIds) { |
| | | return evaluationDimensionMapper.deleteEvaluationDimensionByDimensionIds(dimensionIds); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è¯ä»·ç»´åº¦é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param dimensionId è¯ä»·ç»´åº¦é
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteEvaluationDimensionByDimensionId(Long dimensionId) { |
| | | return evaluationDimensionMapper.deleteEvaluationDimensionByDimensionId(dimensionId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.QRCodeUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.VehicleInfoMapper; |
| | | import com.ruoyi.system.domain.VehicleInfo; |
| | | import com.ruoyi.system.mapper.VehicleEvaluationQrcodeMapper; |
| | | import com.ruoyi.system.domain.VehicleEvaluationQrcode; |
| | | import com.ruoyi.system.service.IVehicleEvaluationQrcodeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 车è¾è¯ä»·äºç»´ç Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-01-27 |
| | | */ |
| | | @Service |
| | | public class VehicleEvaluationQrcodeServiceImpl implements IVehicleEvaluationQrcodeService { |
| | | @Autowired |
| | | private VehicleEvaluationQrcodeMapper vehicleEvaluationQrcodeMapper; |
| | | |
| | | @Autowired |
| | | private VehicleInfoMapper vehicleInfoMapper; |
| | | |
| | | @Value("${ruoyi.profile}") |
| | | private String uploadPath; |
| | | |
| | | @Value("${server.port}") |
| | | private String serverPort; |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param qrcodeId 车è¾è¯ä»·äºç»´ç ä¸»é® |
| | | * @return 车è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @Override |
| | | public VehicleEvaluationQrcode selectVehicleEvaluationQrcodeByQrcodeId(Long qrcodeId) { |
| | | return vehicleEvaluationQrcodeMapper.selectVehicleEvaluationQrcodeByQrcodeId(qrcodeId); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return 车è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @Override |
| | | public VehicleEvaluationQrcode selectVehicleEvaluationQrcodeByVehicleNo(String vehicleNo) { |
| | | return vehicleEvaluationQrcodeMapper.selectVehicleEvaluationQrcodeByVehicleNo(vehicleNo); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç å表 |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return 车è¾è¯ä»·äºç»´ç |
| | | */ |
| | | @Override |
| | | public List<VehicleEvaluationQrcode> selectVehicleEvaluationQrcodeList(VehicleEvaluationQrcode vehicleEvaluationQrcode) { |
| | | return vehicleEvaluationQrcodeMapper.selectVehicleEvaluationQrcodeList(vehicleEvaluationQrcode); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertVehicleEvaluationQrcode(VehicleEvaluationQrcode vehicleEvaluationQrcode) { |
| | | vehicleEvaluationQrcode.setCreateTime(DateUtils.getNowDate()); |
| | | return vehicleEvaluationQrcodeMapper.insertVehicleEvaluationQrcode(vehicleEvaluationQrcode); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleEvaluationQrcode 车è¾è¯ä»·äºç»´ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateVehicleEvaluationQrcode(VehicleEvaluationQrcode vehicleEvaluationQrcode) { |
| | | vehicleEvaluationQrcode.setUpdateTime(DateUtils.getNowDate()); |
| | | return vehicleEvaluationQrcodeMapper.updateVehicleEvaluationQrcode(vehicleEvaluationQrcode); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤è½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param qrcodeIds éè¦å é¤ç车è¾è¯ä»·äºç»´ç ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteVehicleEvaluationQrcodeByQrcodeIds(Long[] qrcodeIds) { |
| | | return vehicleEvaluationQrcodeMapper.deleteVehicleEvaluationQrcodeByQrcodeIds(qrcodeIds); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è½¦è¾è¯ä»·äºç»´ç ä¿¡æ¯ |
| | | * |
| | | * @param qrcodeId 车è¾è¯ä»·äºç»´ç ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteVehicleEvaluationQrcodeByQrcodeId(Long qrcodeId) { |
| | | return vehicleEvaluationQrcodeMapper.deleteVehicleEvaluationQrcodeByQrcodeId(qrcodeId); |
| | | } |
| | | |
| | | /** |
| | | * çæè½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @return äºç»´ç ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public VehicleEvaluationQrcode generateVehicleEvaluationQrcode(String vehicleNo) { |
| | | if (StringUtils.isEmpty(vehicleNo)) { |
| | | return null; |
| | | } |
| | | |
| | | // æ£æ¥è½¦è¾æ¯å¦åå¨ |
| | | VehicleInfo vehicleInfo = vehicleInfoMapper.selectVehicleInfoByVehicleNo(vehicleNo); |
| | | if (vehicleInfo == null) { |
| | | return null; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦å·²åå¨äºç»´ç |
| | | VehicleEvaluationQrcode existingQrcode = vehicleEvaluationQrcodeMapper.selectVehicleEvaluationQrcodeByVehicleNo(vehicleNo); |
| | | if (existingQrcode != null) { |
| | | return existingQrcode; |
| | | } |
| | | |
| | | // çæäºç»´ç å
容 |
| | | String qrcodeContent = "EVAL:" + vehicleNo; |
| | | String qrcodeUrl = "http://localhost:" + serverPort + "/evaluation?vehicle=" + vehicleNo; |
| | | |
| | | // çæäºç»´ç å¾ç为base64æ ¼å¼ |
| | | String qrcodeImageBase64 = QRCodeUtils.generateQRCodeToBase64(qrcodeUrl); |
| | | |
| | | if (qrcodeImageBase64 != null) { |
| | | VehicleEvaluationQrcode qrcode = new VehicleEvaluationQrcode(); |
| | | qrcode.setVehicleNo(vehicleNo); |
| | | qrcode.setQrcodeUrl(qrcodeUrl); |
| | | qrcode.setQrcodeContent(qrcodeContent); |
| | | qrcode.setQrcodeImage(qrcodeImageBase64); |
| | | qrcode.setStatus("0"); |
| | | qrcode.setCreateBy("system"); |
| | | qrcode.setCreateTime(DateUtils.getNowDate()); |
| | | |
| | | int result = vehicleEvaluationQrcodeMapper.insertVehicleEvaluationQrcode(qrcode); |
| | | if (result > 0) { |
| | | return qrcode; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * çæè½¦è¾è¯ä»·äºç»´ç ï¼å¸¦URLåæ°ï¼ |
| | | * |
| | | * @param vehicleNo 车çå· |
| | | * @param qrcodeUrl äºç»´ç URL |
| | | * @return äºç»´ç ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public VehicleEvaluationQrcode generateVehicleEvaluationQrcode(String vehicleNo, String qrcodeUrl) { |
| | | if (StringUtils.isEmpty(vehicleNo) || StringUtils.isEmpty(qrcodeUrl)) { |
| | | return null; |
| | | } |
| | | |
| | | // æ£æ¥è½¦è¾æ¯å¦åå¨ |
| | | VehicleInfo vehicleInfo = vehicleInfoMapper.selectVehicleInfoByVehicleNo(vehicleNo); |
| | | if (vehicleInfo == null) { |
| | | return null; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦å·²åå¨äºç»´ç |
| | | VehicleEvaluationQrcode existingQrcode = vehicleEvaluationQrcodeMapper.selectVehicleEvaluationQrcodeByVehicleNo(vehicleNo); |
| | | if (existingQrcode != null) { |
| | | // 妿已åå¨ï¼æ´æ°URLåéæ°çæäºç»´ç |
| | | existingQrcode.setQrcodeUrl(qrcodeUrl); |
| | | existingQrcode.setQrcodeContent("EVAL:" + vehicleNo); |
| | | existingQrcode.setUpdateBy("system"); |
| | | existingQrcode.setUpdateTime(DateUtils.getNowDate()); |
| | | |
| | | // éæ°çæäºç»´ç å¾ç为base64æ ¼å¼ |
| | | String qrcodeImageBase64 = QRCodeUtils.generateQRCodeToBase64(qrcodeUrl); |
| | | |
| | | if (qrcodeImageBase64 != null) { |
| | | existingQrcode.setQrcodeImage(qrcodeImageBase64); |
| | | vehicleEvaluationQrcodeMapper.updateVehicleEvaluationQrcode(existingQrcode); |
| | | return existingQrcode; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // çæäºç»´ç å
容 |
| | | String qrcodeContent = "EVAL:" + vehicleNo; |
| | | |
| | | // çæäºç»´ç å¾ç为base64æ ¼å¼ |
| | | String qrcodeImageBase64 = QRCodeUtils.generateQRCodeToBase64(qrcodeUrl); |
| | | |
| | | if (qrcodeImageBase64 != null) { |
| | | VehicleEvaluationQrcode qrcode = new VehicleEvaluationQrcode(); |
| | | qrcode.setVehicleNo(vehicleNo); |
| | | qrcode.setQrcodeUrl(qrcodeUrl); |
| | | qrcode.setQrcodeContent(qrcodeContent); |
| | | qrcode.setQrcodeImage(qrcodeImageBase64); |
| | | qrcode.setStatus("0"); |
| | | qrcode.setCreateBy("system"); |
| | | qrcode.setCreateTime(DateUtils.getNowDate()); |
| | | |
| | | int result = vehicleEvaluationQrcodeMapper.insertVehicleEvaluationQrcode(qrcode); |
| | | if (result > 0) { |
| | | return qrcode; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ¹éçæè½¦è¾è¯ä»·äºç»´ç |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int batchGenerateVehicleEvaluationQrcode() { |
| | | // æ¥è¯¢æææ£å¸¸ç¶æçè½¦è¾ |
| | | VehicleInfo vehicleInfo = new VehicleInfo(); |
| | | vehicleInfo.setStatus("0"); |
| | | List<VehicleInfo> vehicleList = vehicleInfoMapper.selectVehicleInfoList(vehicleInfo); |
| | | |
| | | int successCount = 0; |
| | | for (VehicleInfo vehicle : vehicleList) { |
| | | VehicleEvaluationQrcode qrcode = generateVehicleEvaluationQrcode(vehicle.getVehicleNo()); |
| | | if (qrcode != null) { |
| | | successCount++; |
| | | } |
| | | } |
| | | |
| | | return successCount; |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.CustomerEvaluationMapper"> |
| | | |
| | | <resultMap type="CustomerEvaluation" id="CustomerEvaluationResult"> |
| | | <result property="evaluationId" column="evaluation_id" /> |
| | | <result property="vehicleNo" column="vehicle_no" /> |
| | | <result property="customerName" column="customer_name" /> |
| | | <result property="customerPhone" column="customer_phone" /> |
| | | <result property="wechatOpenid" column="wechat_openid" /> |
| | | <result property="wechatNickname" column="wechat_nickname" /> |
| | | <result property="wechatAvatar" column="wechat_avatar" /> |
| | | <result property="wechatPhone" column="wechat_phone" /> |
| | | <result property="totalScore" column="total_score" /> |
| | | <result property="evaluationStatus" column="evaluation_status" /> |
| | | <result property="evaluationTime" column="evaluation_time" /> |
| | | <result property="ipAddress" column="ip_address" /> |
| | | <result property="userAgent" column="user_agent" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectCustomerEvaluationVo"> |
| | | select evaluation_id, vehicle_no, customer_name, customer_phone, wechat_openid, wechat_nickname, wechat_avatar, wechat_phone, total_score, evaluation_status, evaluation_time, ip_address, user_agent, create_time, update_time, remark from customer_evaluation |
| | | </sql> |
| | | |
| | | <select id="selectCustomerEvaluationList" parameterType="CustomerEvaluation" resultMap="CustomerEvaluationResult"> |
| | | <include refid="selectCustomerEvaluationVo"/> |
| | | <where> |
| | | <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no like concat('%', #{vehicleNo}, '%')</if> |
| | | <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if> |
| | | <if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if> |
| | | <if test="wechatOpenid != null and wechatOpenid != ''"> and wechat_openid = #{wechatOpenid}</if> |
| | | <if test="wechatNickname != null and wechatNickname != ''"> and wechat_nickname like concat('%', #{wechatNickname}, '%')</if> |
| | | <if test="totalScore != null "> and total_score = #{totalScore}</if> |
| | | <if test="evaluationStatus != null and evaluationStatus != ''"> and evaluation_status = #{evaluationStatus}</if> |
| | | <if test="evaluationTime != null "> and evaluation_time = #{evaluationTime}</if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- å¼å§æ¶é´æ£ç´¢ --> |
| | | and date_format(evaluation_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- ç»ææ¶é´æ£ç´¢ --> |
| | | and date_format(evaluation_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | </where> |
| | | order by evaluation_time desc, create_time desc |
| | | </select> |
| | | |
| | | <select id="selectCustomerEvaluationByEvaluationId" parameterType="Long" resultMap="CustomerEvaluationResult"> |
| | | <include refid="selectCustomerEvaluationVo"/> |
| | | where evaluation_id = #{evaluationId} |
| | | </select> |
| | | |
| | | <select id="selectCustomerEvaluationByVehicleNo" parameterType="String" resultMap="CustomerEvaluationResult"> |
| | | <include refid="selectCustomerEvaluationVo"/> |
| | | where vehicle_no = #{vehicleNo} |
| | | order by evaluation_time desc, create_time desc |
| | | </select> |
| | | |
| | | <select id="selectCustomerEvaluationByWechatOpenid" parameterType="String" resultMap="CustomerEvaluationResult"> |
| | | <include refid="selectCustomerEvaluationVo"/> |
| | | where wechat_openid = #{wechatOpenid} |
| | | order by evaluation_time desc, create_time desc |
| | | </select> |
| | | |
| | | <select id="selectEvaluationStatistics" parameterType="CustomerEvaluation" resultMap="CustomerEvaluationResult"> |
| | | select |
| | | vehicle_no, |
| | | count(*) as total_count, |
| | | avg(total_score) as avg_score, |
| | | sum(case when total_score >= 4.0 then 1 else 0 end) as good_count, |
| | | sum(case when total_score < 3.0 then 1 else 0 end) as bad_count |
| | | from customer_evaluation |
| | | <where> |
| | | evaluation_status = '1' |
| | | <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no = #{vehicleNo}</if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"> |
| | | and date_format(evaluation_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.endTime != null and params.endTime != ''"> |
| | | and date_format(evaluation_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | </where> |
| | | group by vehicle_no |
| | | order by avg_score desc |
| | | </select> |
| | | |
| | | <insert id="insertCustomerEvaluation" parameterType="CustomerEvaluation" useGeneratedKeys="true" keyProperty="evaluationId"> |
| | | insert into customer_evaluation |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="vehicleNo != null and vehicleNo != ''">vehicle_no,</if> |
| | | <if test="customerName != null and customerName != ''">customer_name,</if> |
| | | <if test="customerPhone != null and customerPhone != ''">customer_phone,</if> |
| | | <if test="wechatOpenid != null">wechat_openid,</if> |
| | | <if test="wechatNickname != null">wechat_nickname,</if> |
| | | <if test="wechatAvatar != null">wechat_avatar,</if> |
| | | <if test="wechatPhone != null">wechat_phone,</if> |
| | | <if test="totalScore != null">total_score,</if> |
| | | <if test="evaluationStatus != null">evaluation_status,</if> |
| | | <if test="evaluationTime != null">evaluation_time,</if> |
| | | <if test="ipAddress != null">ip_address,</if> |
| | | <if test="userAgent != null">user_agent,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="remark != null">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="vehicleNo != null and vehicleNo != ''">#{vehicleNo},</if> |
| | | <if test="customerName != null and customerName != ''">#{customerName},</if> |
| | | <if test="customerPhone != null and customerPhone != ''">#{customerPhone},</if> |
| | | <if test="wechatOpenid != null">#{wechatOpenid},</if> |
| | | <if test="wechatNickname != null">#{wechatNickname},</if> |
| | | <if test="wechatAvatar != null">#{wechatAvatar},</if> |
| | | <if test="wechatPhone != null">#{wechatPhone},</if> |
| | | <if test="totalScore != null">#{totalScore},</if> |
| | | <if test="evaluationStatus != null">#{evaluationStatus},</if> |
| | | <if test="evaluationTime != null">#{evaluationTime},</if> |
| | | <if test="ipAddress != null">#{ipAddress},</if> |
| | | <if test="userAgent != null">#{userAgent},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateCustomerEvaluation" parameterType="CustomerEvaluation"> |
| | | update customer_evaluation |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="vehicleNo != null and vehicleNo != ''">vehicle_no = #{vehicleNo},</if> |
| | | <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if> |
| | | <if test="customerPhone != null and customerPhone != ''">customer_phone = #{customerPhone},</if> |
| | | <if test="wechatOpenid != null">wechat_openid = #{wechatOpenid},</if> |
| | | <if test="wechatNickname != null">wechat_nickname = #{wechatNickname},</if> |
| | | <if test="wechatAvatar != null">wechat_avatar = #{wechatAvatar},</if> |
| | | <if test="wechatPhone != null">wechat_phone = #{wechatPhone},</if> |
| | | <if test="totalScore != null">total_score = #{totalScore},</if> |
| | | <if test="evaluationStatus != null">evaluation_status = #{evaluationStatus},</if> |
| | | <if test="evaluationTime != null">evaluation_time = #{evaluationTime},</if> |
| | | <if test="ipAddress != null">ip_address = #{ipAddress},</if> |
| | | <if test="userAgent != null">user_agent = #{userAgent},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | </trim> |
| | | where evaluation_id = #{evaluationId} |
| | | </update> |
| | | |
| | | <delete id="deleteCustomerEvaluationByEvaluationId" parameterType="Long"> |
| | | delete from customer_evaluation where evaluation_id = #{evaluationId} |
| | | </delete> |
| | | |
| | | <delete id="deleteCustomerEvaluationByEvaluationIds" parameterType="String"> |
| | | delete from customer_evaluation where evaluation_id in |
| | | <foreach item="evaluationId" collection="array" open="(" separator="," close=")"> |
| | | #{evaluationId} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.EvaluationDetailMapper"> |
| | | |
| | | <resultMap type="EvaluationDetail" id="EvaluationDetailResult"> |
| | | <result property="detailId" column="detail_id" /> |
| | | <result property="evaluationId" column="evaluation_id" /> |
| | | <result property="dimensionId" column="dimension_id" /> |
| | | <result property="score" column="score" /> |
| | | <result property="optionValue" column="option_value" /> |
| | | <result property="textContent" column="text_content" /> |
| | | <result property="createTime" column="create_time" /> |
| | | </resultMap> |
| | | |
| | | <resultMap type="EvaluationDetail" id="EvaluationDetailWithDimensionResult" extends="EvaluationDetailResult"> |
| | | <association property="dimension" javaType="EvaluationDimension"> |
| | | <result property="dimensionId" column="dimension_id" /> |
| | | <result property="dimensionName" column="dimension_name" /> |
| | | <result property="dimensionDesc" column="dimension_desc" /> |
| | | <result property="dimensionType" column="dimension_type" /> |
| | | <result property="options" column="options" /> |
| | | <result property="sortOrder" column="sort_order" /> |
| | | <result property="isRequired" column="is_required" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <sql id="selectEvaluationDetailVo"> |
| | | select detail_id, evaluation_id, dimension_id, score, option_value, text_content, create_time from evaluation_detail |
| | | </sql> |
| | | |
| | | <sql id="selectEvaluationDetailWithDimensionVo"> |
| | | select ed.detail_id, ed.evaluation_id, ed.dimension_id, ed.score, ed.option_value, ed.text_content, ed.create_time, |
| | | edim.dimension_name, edim.dimension_desc, edim.dimension_type, edim.options, edim.sort_order, edim.is_required |
| | | from evaluation_detail ed |
| | | left join evaluation_dimension edim on ed.dimension_id = edim.dimension_id |
| | | </sql> |
| | | |
| | | <select id="selectEvaluationDetailList" parameterType="EvaluationDetail" resultMap="EvaluationDetailResult"> |
| | | <include refid="selectEvaluationDetailVo"/> |
| | | <where> |
| | | <if test="evaluationId != null "> and evaluation_id = #{evaluationId}</if> |
| | | <if test="dimensionId != null "> and dimension_id = #{dimensionId}</if> |
| | | <if test="score != null "> and score = #{score}</if> |
| | | <if test="optionValue != null and optionValue != ''"> and option_value = #{optionValue}</if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectEvaluationDetailByDetailId" parameterType="Long" resultMap="EvaluationDetailResult"> |
| | | <include refid="selectEvaluationDetailVo"/> |
| | | where detail_id = #{detailId} |
| | | </select> |
| | | |
| | | <select id="selectEvaluationDetailByEvaluationId" parameterType="Long" resultMap="EvaluationDetailWithDimensionResult"> |
| | | <include refid="selectEvaluationDetailWithDimensionVo"/> |
| | | where ed.evaluation_id = #{evaluationId} |
| | | order by edim.sort_order asc, ed.create_time desc |
| | | </select> |
| | | |
| | | <insert id="insertEvaluationDetail" parameterType="EvaluationDetail" useGeneratedKeys="true" keyProperty="detailId"> |
| | | insert into evaluation_detail |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="evaluationId != null">evaluation_id,</if> |
| | | <if test="dimensionId != null">dimension_id,</if> |
| | | <if test="score != null">score,</if> |
| | | <if test="optionValue != null">option_value,</if> |
| | | <if test="textContent != null">text_content,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="evaluationId != null">#{evaluationId},</if> |
| | | <if test="dimensionId != null">#{dimensionId},</if> |
| | | <if test="score != null">#{score},</if> |
| | | <if test="optionValue != null">#{optionValue},</if> |
| | | <if test="textContent != null">#{textContent},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="insertEvaluationDetailBatch" parameterType="java.util.List"> |
| | | insert into evaluation_detail (evaluation_id, dimension_id, score, option_value, text_content, create_time) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.evaluationId}, #{item.dimensionId}, #{item.score}, #{item.optionValue}, #{item.textContent}, #{item.createTime}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <update id="updateEvaluationDetail" parameterType="EvaluationDetail"> |
| | | update evaluation_detail |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="evaluationId != null">evaluation_id = #{evaluationId},</if> |
| | | <if test="dimensionId != null">dimension_id = #{dimensionId},</if> |
| | | <if test="score != null">score = #{score},</if> |
| | | <if test="optionValue != null">option_value = #{optionValue},</if> |
| | | <if test="textContent != null">text_content = #{textContent},</if> |
| | | </trim> |
| | | where detail_id = #{detailId} |
| | | </update> |
| | | |
| | | <delete id="deleteEvaluationDetailByDetailId" parameterType="Long"> |
| | | delete from evaluation_detail where detail_id = #{detailId} |
| | | </delete> |
| | | |
| | | <delete id="deleteEvaluationDetailByEvaluationId" parameterType="Long"> |
| | | delete from evaluation_detail where evaluation_id = #{evaluationId} |
| | | </delete> |
| | | |
| | | <delete id="deleteEvaluationDetailByDetailIds" parameterType="String"> |
| | | delete from evaluation_detail where detail_id in |
| | | <foreach item="detailId" collection="array" open="(" separator="," close=")"> |
| | | #{detailId} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.EvaluationDimensionMapper"> |
| | | |
| | | <resultMap type="EvaluationDimension" id="EvaluationDimensionResult"> |
| | | <result property="dimensionId" column="dimension_id" /> |
| | | <result property="dimensionName" column="dimension_name" /> |
| | | <result property="dimensionDesc" column="dimension_desc" /> |
| | | <result property="dimensionType" column="dimension_type" /> |
| | | <result property="options" column="options" /> |
| | | <result property="sortOrder" column="sort_order" /> |
| | | <result property="isRequired" column="is_required" /> |
| | | <result property="status" column="status" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectEvaluationDimensionVo"> |
| | | select dimension_id, dimension_name, dimension_desc, dimension_type, options, sort_order, is_required, status, create_by, create_time, update_by, update_time, remark from evaluation_dimension |
| | | </sql> |
| | | |
| | | <select id="selectEvaluationDimensionList" parameterType="EvaluationDimension" resultMap="EvaluationDimensionResult"> |
| | | <include refid="selectEvaluationDimensionVo"/> |
| | | <where> |
| | | <if test="dimensionName != null and dimensionName != ''"> and dimension_name like concat('%', #{dimensionName}, '%')</if> |
| | | <if test="dimensionDesc != null and dimensionDesc != ''"> and dimension_desc like concat('%', #{dimensionDesc}, '%')</if> |
| | | <if test="dimensionType != null and dimensionType != ''"> and dimension_type = #{dimensionType}</if> |
| | | <if test="sortOrder != null "> and sort_order = #{sortOrder}</if> |
| | | <if test="isRequired != null and isRequired != ''"> and is_required = #{isRequired}</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | </where> |
| | | order by sort_order asc, create_time desc |
| | | </select> |
| | | |
| | | <select id="selectEvaluationDimensionByDimensionId" parameterType="Long" resultMap="EvaluationDimensionResult"> |
| | | <include refid="selectEvaluationDimensionVo"/> |
| | | where dimension_id = #{dimensionId} |
| | | </select> |
| | | |
| | | <select id="selectEnabledEvaluationDimensionList" resultMap="EvaluationDimensionResult"> |
| | | <include refid="selectEvaluationDimensionVo"/> |
| | | where status = '0' |
| | | order by sort_order asc, create_time desc |
| | | </select> |
| | | |
| | | <insert id="insertEvaluationDimension" parameterType="EvaluationDimension" useGeneratedKeys="true" keyProperty="dimensionId"> |
| | | insert into evaluation_dimension |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="dimensionName != null and dimensionName != ''">dimension_name,</if> |
| | | <if test="dimensionDesc != null">dimension_desc,</if> |
| | | <if test="dimensionType != null and dimensionType != ''">dimension_type,</if> |
| | | <if test="options != null">options,</if> |
| | | <if test="sortOrder != null">sort_order,</if> |
| | | <if test="isRequired != null">is_required,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="remark != null">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="dimensionName != null and dimensionName != ''">#{dimensionName},</if> |
| | | <if test="dimensionDesc != null">#{dimensionDesc},</if> |
| | | <if test="dimensionType != null and dimensionType != ''">#{dimensionType},</if> |
| | | <if test="options != null">#{options},</if> |
| | | <if test="sortOrder != null">#{sortOrder},</if> |
| | | <if test="isRequired != null">#{isRequired},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateEvaluationDimension" parameterType="EvaluationDimension"> |
| | | update evaluation_dimension |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="dimensionName != null and dimensionName != ''">dimension_name = #{dimensionName},</if> |
| | | <if test="dimensionDesc != null">dimension_desc = #{dimensionDesc},</if> |
| | | <if test="dimensionType != null and dimensionType != ''">dimension_type = #{dimensionType},</if> |
| | | <if test="options != null">options = #{options},</if> |
| | | <if test="sortOrder != null">sort_order = #{sortOrder},</if> |
| | | <if test="isRequired != null">is_required = #{isRequired},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | </trim> |
| | | where dimension_id = #{dimensionId} |
| | | </update> |
| | | |
| | | <delete id="deleteEvaluationDimensionByDimensionId" parameterType="Long"> |
| | | delete from evaluation_dimension where dimension_id = #{dimensionId} |
| | | </delete> |
| | | |
| | | <delete id="deleteEvaluationDimensionByDimensionIds" parameterType="String"> |
| | | delete from evaluation_dimension where dimension_id in |
| | | <foreach item="dimensionId" collection="array" open="(" separator="," close=")"> |
| | | #{dimensionId} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.VehicleEvaluationQrcodeMapper"> |
| | | |
| | | <resultMap type="VehicleEvaluationQrcode" id="VehicleEvaluationQrcodeResult"> |
| | | <result property="qrcodeId" column="qrcode_id" /> |
| | | <result property="vehicleNo" column="vehicle_no" /> |
| | | <result property="qrcodeUrl" column="qrcode_url" /> |
| | | <result property="qrcodeContent" column="qrcode_content" /> |
| | | <result property="qrcodeImage" column="qrcode_image" /> |
| | | <result property="status" column="status" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectVehicleEvaluationQrcodeVo"> |
| | | select qrcode_id, vehicle_no, qrcode_url, qrcode_content, qrcode_image, status, create_by, create_time, update_by, update_time, remark from vehicle_evaluation_qrcode |
| | | </sql> |
| | | |
| | | <select id="selectVehicleEvaluationQrcodeList" parameterType="VehicleEvaluationQrcode" resultMap="VehicleEvaluationQrcodeResult"> |
| | | <include refid="selectVehicleEvaluationQrcodeVo"/> |
| | | <where> |
| | | <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no like concat('%', #{vehicleNo}, '%')</if> |
| | | <if test="qrcodeUrl != null and qrcodeUrl != ''"> and qrcode_url like concat('%', #{qrcodeUrl}, '%')</if> |
| | | <if test="qrcodeContent != null and qrcodeContent != ''"> and qrcode_content like concat('%', #{qrcodeContent}, '%')</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectVehicleEvaluationQrcodeByQrcodeId" parameterType="Long" resultMap="VehicleEvaluationQrcodeResult"> |
| | | <include refid="selectVehicleEvaluationQrcodeVo"/> |
| | | where qrcode_id = #{qrcodeId} |
| | | </select> |
| | | |
| | | <select id="selectVehicleEvaluationQrcodeByVehicleNo" parameterType="String" resultMap="VehicleEvaluationQrcodeResult"> |
| | | <include refid="selectVehicleEvaluationQrcodeVo"/> |
| | | where vehicle_no = #{vehicleNo} |
| | | </select> |
| | | |
| | | <insert id="insertVehicleEvaluationQrcode" parameterType="VehicleEvaluationQrcode" useGeneratedKeys="true" keyProperty="qrcodeId"> |
| | | insert into vehicle_evaluation_qrcode |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="vehicleNo != null and vehicleNo != ''">vehicle_no,</if> |
| | | <if test="qrcodeUrl != null and qrcodeUrl != ''">qrcode_url,</if> |
| | | <if test="qrcodeContent != null and qrcodeContent != ''">qrcode_content,</if> |
| | | <if test="qrcodeImage != null">qrcode_image,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="remark != null">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="vehicleNo != null and vehicleNo != ''">#{vehicleNo},</if> |
| | | <if test="qrcodeUrl != null and qrcodeUrl != ''">#{qrcodeUrl},</if> |
| | | <if test="qrcodeContent != null and qrcodeContent != ''">#{qrcodeContent},</if> |
| | | <if test="qrcodeImage != null">#{qrcodeImage},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateVehicleEvaluationQrcode" parameterType="VehicleEvaluationQrcode"> |
| | | update vehicle_evaluation_qrcode |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="vehicleNo != null and vehicleNo != ''">vehicle_no = #{vehicleNo},</if> |
| | | <if test="qrcodeUrl != null and qrcodeUrl != ''">qrcode_url = #{qrcodeUrl},</if> |
| | | <if test="qrcodeContent != null and qrcodeContent != ''">qrcode_content = #{qrcodeContent},</if> |
| | | <if test="qrcodeImage != null">qrcode_image = #{qrcodeImage},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | </trim> |
| | | where qrcode_id = #{qrcodeId} |
| | | </update> |
| | | |
| | | <delete id="deleteVehicleEvaluationQrcodeByQrcodeId" parameterType="Long"> |
| | | delete from vehicle_evaluation_qrcode where qrcode_id = #{qrcodeId} |
| | | </delete> |
| | | |
| | | <delete id="deleteVehicleEvaluationQrcodeByVehicleNo" parameterType="String"> |
| | | delete from vehicle_evaluation_qrcode where vehicle_no = #{vehicleNo} |
| | | </delete> |
| | | |
| | | <delete id="deleteVehicleEvaluationQrcodeByQrcodeIds" parameterType="String"> |
| | | delete from vehicle_evaluation_qrcode where qrcode_id in |
| | | <foreach item="qrcodeId" collection="array" open="(" separator="," close=")"> |
| | | #{qrcodeId} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | |
| | | <result property="vehicleModel" column="vehicle_model" /> |
| | | <result property="status" column="status" /> |
| | | <result property="platformCode" column="platform_code" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="deptName" column="dept_name" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectVehicleInfoVo"> |
| | | select vehicle_id, device_id, vehicle_no, vehicle_type, vehicle_brand, vehicle_model, status, platform_code, create_by, create_time, update_by, update_time, remark |
| | | from tb_vehicle_info |
| | | select v.vehicle_id, v.device_id, v.vehicle_no, v.vehicle_type, v.vehicle_brand, v.vehicle_model, v.status, v.platform_code, v.dept_id, d.dept_name, v.create_by, v.create_time, v.update_by, v.update_time, v.remark |
| | | from tb_vehicle_info v |
| | | left join sys_dept d on v.dept_id = d.dept_id |
| | | </sql> |
| | | |
| | | <select id="selectVehicleInfoList" parameterType="VehicleInfo" resultMap="VehicleInfoResult"> |
| | | <include refid="selectVehicleInfoVo"/> |
| | | <where> |
| | | <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no = #{vehicleNo}</if> |
| | | <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if> |
| | | <if test="vehicleType != null and vehicleType != ''"> and vehicle_type = #{vehicleType}</if> |
| | | <if test="vehicleBrand != null and vehicleBrand != ''"> and vehicle_brand = #{vehicleBrand}</if> |
| | | <if test="vehicleModel != null and vehicleModel != ''"> and vehicle_model = #{vehicleModel}</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | <if test="platformCode != null and platformCode != ''"> and platform_code = #{platformCode}</if> |
| | | <if test="vehicleNo != null and vehicleNo != ''"> and v.vehicle_no = #{vehicleNo}</if> |
| | | <if test="deviceId != null and deviceId != ''"> and v.device_id = #{deviceId}</if> |
| | | <if test="vehicleType != null and vehicleType != ''"> and v.vehicle_type = #{vehicleType}</if> |
| | | <if test="vehicleBrand != null and vehicleBrand != ''"> and v.vehicle_brand = #{vehicleBrand}</if> |
| | | <if test="vehicleModel != null and vehicleModel != ''"> and v.vehicle_model = #{vehicleModel}</if> |
| | | <if test="status != null and status != ''"> and v.status = #{status}</if> |
| | | <if test="platformCode != null and platformCode != ''"> and v.platform_code = #{platformCode}</if> |
| | | <if test="deptId != null"> and v.dept_id = #{deptId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectVehicleInfoById" parameterType="Long" resultMap="VehicleInfoResult"> |
| | | <include refid="selectVehicleInfoVo"/> |
| | | where vehicle_id = #{vehicleId} |
| | | where v.vehicle_id = #{vehicleId} |
| | | </select> |
| | | |
| | | <select id="selectVehicleInfoByPlateNumber" parameterType="String" resultMap="VehicleInfoResult"> |
| | | <include refid="selectVehicleInfoVo"/> |
| | | where vehicle_no = #{plateNumber} |
| | | where v.vehicle_no = #{plateNumber} |
| | | </select> |
| | | |
| | | <select id="selectVehicleInfoByVehicleNo" parameterType="String" resultMap="VehicleInfoResult"> |
| | | <include refid="selectVehicleInfoVo"/> |
| | | where v.vehicle_no = #{vehicleNo} |
| | | </select> |
| | | |
| | | <insert id="insertVehicleInfo" parameterType="VehicleInfo" useGeneratedKeys="true" keyProperty="vehicleId"> |
| | |
| | | <if test="vehicleModel != null">vehicle_model,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="platformCode != null">platform_code,</if> |
| | | <if test="deptId != null">dept_id,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | |
| | | <if test="vehicleModel != null">#{vehicleModel},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="platformCode != null">#{platformCode},</if> |
| | | <if test="deptId != null">#{deptId},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | |
| | | <if test="vehicleModel != null">vehicle_model = #{vehicleModel},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="platformCode != null">platform_code = #{platformCode},</if> |
| | | <if test="deptId != null">dept_id = #{deptId},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
New file |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // è·åè¯ä»·ç»´åº¦é
ç½® |
| | | export function getEvaluationDimensions() { |
| | | return request({ |
| | | url: '/evaluation/dimensions', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æäº¤å®¢æ·è¯ä»· |
| | | export function submitEvaluation(data) { |
| | | return request({ |
| | | url: '/evaluation/submit', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯ |
| | | export function getWechatUserInfo(code) { |
| | | return request({ |
| | | url: '/evaluation/wechat/userinfo', |
| | | method: 'get', |
| | | params: { code } |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢å®¢æ·è¯ä»·å表 |
| | | export function listEvaluation(query) { |
| | | return request({ |
| | | url: '/evaluation/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢å®¢æ·è¯ä»·è¯¦ç» |
| | | export function getEvaluation(evaluationId) { |
| | | return request({ |
| | | url: '/evaluation/' + evaluationId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢å®¢æ·è¯ä»· |
| | | export function addEvaluation(data) { |
| | | return request({ |
| | | url: '/evaluation', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹å®¢æ·è¯ä»· |
| | | export function updateEvaluation(data) { |
| | | return request({ |
| | | url: '/evaluation', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤å®¢æ·è¯ä»· |
| | | export function delEvaluation(evaluationId) { |
| | | return request({ |
| | | url: '/evaluation/' + evaluationId, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // çæè½¦è¾è¯ä»·äºç»´ç |
| | | export function generateQrcode(data) { |
| | | return request({ |
| | | url: '/evaluation/qrcode/generate', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // æ¹éçæè½¦è¾è¯ä»·äºç»´ç |
| | | export function batchGenerateQrcode() { |
| | | return request({ |
| | | url: '/evaluation/qrcode/batch', |
| | | method: 'post' |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢è¯ä»·ç»´åº¦é
ç½®å表 |
| | | export function listDimension(query) { |
| | | return request({ |
| | | url: '/evaluation/dimension/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢è¯ä»·ç»´åº¦é
ç½®è¯¦ç» |
| | | export function getDimension(dimensionId) { |
| | | return request({ |
| | | url: '/evaluation/dimension/' + dimensionId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢è¯ä»·ç»´åº¦é
ç½® |
| | | export function addDimension(data) { |
| | | return request({ |
| | | url: '/evaluation/dimension', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹è¯ä»·ç»´åº¦é
ç½® |
| | | export function updateDimension(data) { |
| | | return request({ |
| | | url: '/evaluation/dimension', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤è¯ä»·ç»´åº¦é
ç½® |
| | | export function delDimension(dimensionId) { |
| | | return request({ |
| | | url: '/evaluation/dimension/' + dimensionId, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç å表 |
| | | export function listQrcode(query) { |
| | | return request({ |
| | | url: '/evaluation/qrcode/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç è¯¦ç» |
| | | export function getQrcode(qrcodeId) { |
| | | return request({ |
| | | url: '/evaluation/qrcode/' + qrcodeId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // å é¤è½¦è¾è¯ä»·äºç»´ç |
| | | export function delQrcode(qrcodeId) { |
| | | return request({ |
| | | url: '/evaluation/qrcode/' + qrcodeId, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢å®¢æ·è¯ä»·å表ï¼ç¨äºç»è®¡é¡µé¢ï¼ |
| | | export function listCustomerEvaluation(query) { |
| | | return request({ |
| | | url: '/evaluation/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢å®¢æ·è¯ä»·è¯¦ç»ï¼ç¨äºç»è®¡é¡µé¢ï¼ |
| | | export function getCustomerEvaluation(evaluationId) { |
| | | return request({ |
| | | url: '/evaluation/' + evaluationId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // è·åè¯ä»·ç»è®¡æ°æ® |
| | | export function getEvaluationStatistics(query) { |
| | | return request({ |
| | | url: '/evaluation/statistics', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | meta: { title: 'å¿åè®¢åæ¥ç', icon: 'eye',anonymous: true } |
| | | }, |
| | | { |
| | | path: '/evaluation', |
| | | component: () => import('@/views/evaluation/index'), |
| | | hidden: true, |
| | | meta: { title: '客æ·è¯ä»·', anonymous: true } |
| | | }, |
| | | { |
| | | path: '/evaluation/test', |
| | | component: () => import('@/views/evaluation/test'), |
| | | hidden: true, |
| | | meta: { title: 'è¯ä»·åè½æµè¯', anonymous: true } |
| | | }, |
| | | { |
| | | path: '/404', |
| | | component: () => import('@/views/error/404'), |
| | | hidden: true |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="车çå·" prop="vehicleNo"> |
| | | <el-input |
| | | v-model="queryParams.vehicleNo" |
| | | placeholder="请è¾å
¥è½¦çå·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·å§å" prop="customerName"> |
| | | <el-input |
| | | v-model="queryParams.customerName" |
| | | placeholder="请è¾å
¥å®¢æ·å§å" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å®¢æ·ææº" prop="customerPhone"> |
| | | <el-input |
| | | v-model="queryParams.customerPhone" |
| | | placeholder="请è¾å
¥å®¢æ·ææºå·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è¯ä»·æ¶é´"> |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['evaluation:customer:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['evaluation:customer:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="customerEvaluationList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="è¯ä»·ID" align="center" prop="evaluationId" /> |
| | | <el-table-column label="车çå·" align="center" prop="vehicleNo" /> |
| | | <el-table-column label="客æ·å§å" align="center" prop="customerName" /> |
| | | <el-table-column label="å®¢æ·ææº" align="center" prop="customerPhone" /> |
| | | <el-table-column label="微信æµç§°" align="center" prop="wechatNickname" /> |
| | | <el-table-column label="æ»è¯å" align="center" prop="totalScore"> |
| | | <template slot-scope="scope"> |
| | | <el-rate |
| | | v-model="scope.row.totalScore" |
| | | disabled |
| | | show-score |
| | | text-color="#ff9900" |
| | | score-template="{value}"> |
| | | </el-rate> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è¯ä»·æ¶é´" align="center" prop="evaluationTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.evaluationTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleView(scope.row)" |
| | | v-hasPermi="['evaluation:customer:query']" |
| | | >æ¥ç</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['evaluation:customer:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- è¯ä»·è¯¦æ
å¯¹è¯æ¡ --> |
| | | <el-dialog title="è¯ä»·è¯¦æ
" :visible.sync="open" width="800px" append-to-body> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="è¯ä»·ID">{{ evaluationForm.evaluationId }}</el-descriptions-item> |
| | | <el-descriptions-item label="车çå·">{{ evaluationForm.vehicleNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·å§å">{{ evaluationForm.customerName }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¢æ·ææº">{{ evaluationForm.customerPhone }}</el-descriptions-item> |
| | | <el-descriptions-item label="微信æµç§°">{{ evaluationForm.wechatNickname }}</el-descriptions-item> |
| | | <el-descriptions-item label="微信头å"> |
| | | <el-image v-if="evaluationForm.wechatAvatar" :src="evaluationForm.wechatAvatar" style="width: 50px; height: 50px;"></el-image> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="æ»è¯å"> |
| | | <el-rate |
| | | v-model="evaluationForm.totalScore" |
| | | disabled |
| | | show-score |
| | | text-color="#ff9900" |
| | | score-template="{value}"> |
| | | </el-rate> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="è¯ä»·æ¶é´">{{ parseTime(evaluationForm.evaluationTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="IPå°å">{{ evaluationForm.ipAddress }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¨æ·ä»£ç" :span="2">{{ evaluationForm.userAgent }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <h4>è¯ä»·è¯¦æ
</h4> |
| | | <el-table :data="evaluationForm.evaluationDetails" border> |
| | | <el-table-column label="è¯ä»·ç»´åº¦" prop="dimension.dimensionName" /> |
| | | <el-table-column label="è¯å" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-rate |
| | | v-if="scope.row.dimension.dimensionType === 'star'" |
| | | v-model="scope.row.score" |
| | | disabled |
| | | show-score |
| | | text-color="#ff9900" |
| | | score-template="{value}"> |
| | | </el-rate> |
| | | <span v-else-if="scope.row.dimension.dimensionType === 'select'">{{ scope.row.optionValue }}</span> |
| | | <span v-else-if="scope.row.dimension.dimensionType === 'text'">{{ scope.row.textContent }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="cancel">å
³ é</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listEvaluation, getEvaluation, delEvaluation } from "@/api/evaluation"; |
| | | |
| | | export default { |
| | | name: "CustomerEvaluation", |
| | | dicts: [], |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // 客æ·è¯ä»·è¡¨æ ¼æ°æ® |
| | | customerEvaluationList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥æèå´ |
| | | dateRange: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | vehicleNo: null, |
| | | customerName: null, |
| | | customerPhone: null |
| | | }, |
| | | // 表ååæ° |
| | | evaluationForm: {} |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢å®¢æ·è¯ä»·å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listEvaluation(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
| | | this.customerEvaluationList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.evaluationForm = { |
| | | evaluationId: null, |
| | | vehicleNo: null, |
| | | customerName: null, |
| | | customerPhone: null, |
| | | wechatOpenid: null, |
| | | wechatNickname: null, |
| | | wechatAvatar: null, |
| | | wechatPhone: null, |
| | | totalScore: null, |
| | | evaluationStatus: null, |
| | | evaluationTime: null, |
| | | ipAddress: null, |
| | | userAgent: null, |
| | | evaluationDetails: [] |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.dateRange = []; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.evaluationId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ¥çæé®æä½ */ |
| | | handleView(row) { |
| | | this.reset(); |
| | | const evaluationId = row.evaluationId || this.ids |
| | | getEvaluation(evaluationId).then(response => { |
| | | this.evaluationForm = response.data; |
| | | this.open = true; |
| | | this.title = "è¯ä»·è¯¦æ
"; |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const evaluationIds = row.evaluationId || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å®¢æ·è¯ä»·ç¼å·ä¸º"' + evaluationIds + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delEvaluation(evaluationIds); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('evaluation/export', { |
| | | ...this.queryParams |
| | | }, `customer_evaluation_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="维度åç§°" prop="dimensionName"> |
| | | <el-input |
| | | v-model="queryParams.dimensionName" |
| | | placeholder="请è¾å
¥ç»´åº¦åç§°" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="维度类å" prop="dimensionType"> |
| | | <el-select v-model="queryParams.dimensionType" placeholder="è¯·éæ©ç»´åº¦ç±»å" clearable> |
| | | <el-option label="æçº§è¯ä»·" value="star" /> |
| | | <el-option label="éæ©è¯ä»·" value="select" /> |
| | | <el-option label="ææ¬è¯ä»·" value="text" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="è¯·éæ©ç¶æ" clearable> |
| | | <el-option label="æ£å¸¸" value="0" /> |
| | | <el-option label="åç¨" value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['evaluation:dimension:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['evaluation:dimension:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['evaluation:dimension:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="dimensionList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="维度ID" align="center" prop="dimensionId" /> |
| | | <el-table-column label="维度åç§°" align="center" prop="dimensionName" /> |
| | | <el-table-column label="维度æè¿°" align="center" prop="dimensionDesc" /> |
| | | <el-table-column label="维度类å" align="center" prop="dimensionType"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.dimensionType === 'star'">æçº§è¯ä»·</span> |
| | | <span v-else-if="scope.row.dimensionType === 'select'">éæ©è¯ä»·</span> |
| | | <span v-else-if="scope.row.dimensionType === 'text'">ææ¬è¯ä»·</span> |
| | | <span v-else>{{ scope.row.dimensionType }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æåº" align="center" prop="sortOrder" /> |
| | | <el-table-column label="æ¯å¦å¿
å¡«" align="center" prop="isRequired"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.isRequired === '1'">æ¯</span> |
| | | <span v-else-if="scope.row.isRequired === '0'">å¦</span> |
| | | <span v-else>{{ scope.row.isRequired }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['evaluation:dimension:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['evaluation:dimension:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹è¯ä»·ç»´åº¦é
ç½®å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-form-item label="维度åç§°" prop="dimensionName"> |
| | | <el-input v-model="form.dimensionName" placeholder="请è¾å
¥ç»´åº¦åç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="维度æè¿°" prop="dimensionDesc"> |
| | | <el-input v-model="form.dimensionDesc" type="textarea" placeholder="请è¾å
¥ç»´åº¦æè¿°" /> |
| | | </el-form-item> |
| | | <el-form-item label="维度类å" prop="dimensionType"> |
| | | <el-select v-model="form.dimensionType" placeholder="è¯·éæ©ç»´åº¦ç±»å"> |
| | | <el-option label="æçº§è¯ä»·" value="star" /> |
| | | <el-option label="éæ©è¯ä»·" value="select" /> |
| | | <el-option label="ææ¬è¯ä»·" value="text" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é项é
ç½®" prop="options" v-if="form.dimensionType === 'select'"> |
| | | <el-input v-model="form.options" type="textarea" placeholder="请è¾å
¥é项é
ç½®ï¼JSONæ ¼å¼ï¼å¦ï¼[{"label":"满æ","value":"1"},{"label":"䏿»¡æ","value":"0"}]" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåº" prop="sortOrder"> |
| | | <el-input-number v-model="form.sortOrder" controls-position="right" :min="0" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å¿
å¡«" prop="isRequired"> |
| | | <el-radio-group v-model="form.isRequired"> |
| | | <el-radio label="1">æ¯</el-radio> |
| | | <el-radio label="0">å¦</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio label="0">æ£å¸¸</el-radio> |
| | | <el-radio label="1">åç¨</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listDimension, getDimension, delDimension, addDimension, updateDimension } from "@/api/evaluation"; |
| | | |
| | | export default { |
| | | name: "EvaluationDimension", |
| | | dicts: ['dimension_type', 'sys_yes_no', 'sys_normal_disable'], |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // è¯ä»·ç»´åº¦é
ç½®è¡¨æ ¼æ°æ® |
| | | dimensionList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dimensionName: null, |
| | | dimensionType: null, |
| | | status: null |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | dimensionName: [ |
| | | { required: true, message: "维度åç§°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | dimensionType: [ |
| | | { required: true, message: "维度类åä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | sortOrder: [ |
| | | { required: true, message: "æåºä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | isRequired: [ |
| | | { required: true, message: "æ¯å¦å¿
å¡«ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | status: [ |
| | | { required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "change" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢è¯ä»·ç»´åº¦é
ç½®å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listDimension(this.queryParams).then(response => { |
| | | this.dimensionList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | dimensionId: null, |
| | | dimensionName: null, |
| | | dimensionDesc: null, |
| | | dimensionType: null, |
| | | options: null, |
| | | sortOrder: 0, |
| | | isRequired: "1", |
| | | status: "0", |
| | | remark: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.dimensionId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å è¯ä»·ç»´åº¦é
ç½®"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const dimensionId = row.dimensionId || this.ids |
| | | getDimension(dimensionId).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹è¯ä»·ç»´åº¦é
ç½®"; |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.dimensionId != null) { |
| | | updateDimension(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addDimension(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const dimensionIds = row.dimensionId || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤è¯ä»·ç»´åº¦é
ç½®ç¼å·ä¸º"' + dimensionIds + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delDimension(dimensionIds); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div class="evaluation-container"> |
| | | <!-- 页é¢å¤´é¨ --> |
| | | <div class="evaluation-header"> |
| | | <h1>æå¡è¯ä»·</h1> |
| | | <p>æè°¢æ¨ä½¿ç¨æä»¬çæå¡ï¼è¯·å¯¹æ¬æ¬¡æå¡è¿è¡è¯ä»·</p> |
| | | </div> |
| | | |
| | | <!-- 车è¾ä¿¡æ¯ --> |
| | | <div class="vehicle-info" v-if="vehicleNo"> |
| | | <div class="info-item"> |
| | | <span class="label">车çå·ï¼</span> |
| | | <span class="value">{{ vehicleNo }}</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- è¯ä»·è¡¨å --> |
| | | <div class="evaluation-form"> |
| | | <el-form ref="evaluationForm" :model="evaluationForm" :rules="rules" label-width="80px" size="small"> |
| | | <!-- 客æ·ä¿¡æ¯ --> |
| | | <div class="form-section"> |
| | | <h3>客æ·ä¿¡æ¯</h3> |
| | | <el-form-item label="å§å" prop="customerName"> |
| | | <el-input v-model="evaluationForm.customerName" placeholder="请è¾å
¥æ¨çå§å" /> |
| | | </el-form-item> |
| | | <el-form-item label="ææºå·" prop="customerPhone"> |
| | | <el-input v-model="evaluationForm.customerPhone" placeholder="请è¾å
¥æ¨çææºå·" /> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <!-- è¯ä»·ç»´åº¦ --> |
| | | <div class="form-section"> |
| | | <h3>æå¡è¯ä»·</h3> |
| | | <div v-for="dimension in dimensions" :key="dimension.dimensionId" class="dimension-item"> |
| | | <!-- æçº§è¯ä»· - æ é¢åè¯åå¨åä¸è¡ --> |
| | | <div v-if="dimension.dimensionType === 'star'" class="star-rating-inline"> |
| | | <div class="dimension-title-inline"> |
| | | <span>{{ dimension.dimensionName }}</span> |
| | | <span v-if="dimension.isRequired === '1'" class="required">*</span> |
| | | </div> |
| | | <div class="star-rating-content"> |
| | | <el-rate |
| | | :value="getDimensionScore(dimension.dimensionId)" |
| | | :max="5" |
| | | show-text |
| | | :texts="['å¾å·®', 'è¾å·®', 'ä¸è¬', '满æ', 'é常满æ']" |
| | | @change="updateDimensionScore(dimension.dimensionId, $event)" |
| | | size="small" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- éæ©è¯ä»· --> |
| | | <div v-else-if="dimension.dimensionType === 'select'"> |
| | | <div class="dimension-title"> |
| | | <span>{{ dimension.dimensionName }}</span> |
| | | <span v-if="dimension.isRequired === '1'" class="required">*</span> |
| | | </div> |
| | | <div class="dimension-desc" v-if="dimension.dimensionDesc"> |
| | | {{ dimension.dimensionDesc }} |
| | | </div> |
| | | <div class="select-rating"> |
| | | <el-radio-group :value="getDimensionOption(dimension.dimensionId)" @change="updateDimensionOption(dimension.dimensionId, $event)" size="small"> |
| | | <el-radio v-for="option in getDimensionOptions(dimension)" :key="option.value" :label="option.value"> |
| | | {{ option.label }} |
| | | </el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- ææ¬è¯ä»· --> |
| | | <div v-else-if="dimension.dimensionType === 'text'"> |
| | | <div class="dimension-title"> |
| | | <span>{{ dimension.dimensionName }}</span> |
| | | <span v-if="dimension.isRequired === '1'" class="required">*</span> |
| | | </div> |
| | | <div class="dimension-desc" v-if="dimension.dimensionDesc"> |
| | | {{ dimension.dimensionDesc }} |
| | | </div> |
| | | <div class="text-rating"> |
| | | <el-input |
| | | :value="getDimensionText(dimension.dimensionId)" |
| | | type="textarea" |
| | | :rows="2" |
| | | placeholder="请è¾å
¥æ¨çæè§æå»ºè®®" |
| | | @input="updateDimensionText(dimension.dimensionId, $event)" |
| | | size="small" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æäº¤æé® --> |
| | | <div class="form-actions"> |
| | | <el-button type="primary" size="large" @click="submitEvaluation" :loading="submitting"> |
| | | æäº¤è¯ä»· |
| | | </el-button> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- ç»æé¡µé¢ --> |
| | | <div v-if="showResult" class="result-page"> |
| | | <div class="result-content"> |
| | | <div class="result-icon"> |
| | | <i class="el-icon-success" style="font-size: 60px; color: #67C23A;"></i> |
| | | </div> |
| | | <div class="result-message"> |
| | | {{ resultMessage }} |
| | | </div> |
| | | <div class="result-actions"> |
| | | <el-button type="primary" @click="resetForm">忬¡è¯ä»·</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getEvaluationDimensions, submitEvaluation, getWechatUserInfo } from "@/api/evaluation"; |
| | | |
| | | export default { |
| | | name: "Evaluation", |
| | | data() { |
| | | return { |
| | | vehicleNo: '', |
| | | dimensions: [], |
| | | evaluationForm: { |
| | | vehicleNo: '', |
| | | customerName: '', |
| | | customerPhone: '', |
| | | wechatOpenid: '', |
| | | wechatNickname: '', |
| | | wechatAvatar: '', |
| | | wechatPhone: '', |
| | | evaluationDetails: [] |
| | | }, |
| | | rules: { |
| | | customerName: [ |
| | | { required: true, message: '请è¾å
¥æ¨çå§å', trigger: 'blur' } |
| | | ], |
| | | customerPhone: [ |
| | | { required: true, message: '请è¾å
¥æ¨çææºå·', trigger: 'blur' }, |
| | | { pattern: /^1[3-9]\d{9}$/, message: '请è¾å
¥æ£ç¡®çææºå·', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | submitting: false, |
| | | showResult: false, |
| | | resultMessage: '' |
| | | }; |
| | | }, |
| | | created() { |
| | | this.initPage(); |
| | | }, |
| | | methods: { |
| | | // åå§åé¡µé¢ |
| | | async initPage() { |
| | | // è·åURLåæ° |
| | | this.vehicleNo = this.$route.query.vehicle || ''; |
| | | this.evaluationForm.vehicleNo = this.vehicleNo; |
| | | |
| | | // æ£æ¥æ¯å¦å¨å¾®ä¿¡ç¯å¢ä¸ |
| | | if (this.isWechatBrowser()) { |
| | | await this.handleWechatAuth(); |
| | | } |
| | | |
| | | // å è½½è¯ä»·ç»´åº¦ |
| | | await this.loadDimensions(); |
| | | }, |
| | | |
| | | // 夿æ¯å¦ä¸ºå¾®ä¿¡æµè§å¨ |
| | | isWechatBrowser() { |
| | | const ua = navigator.userAgent.toLowerCase(); |
| | | return ua.indexOf('micromessenger') !== -1; |
| | | }, |
| | | |
| | | // å¤çå¾®ä¿¡ææ |
| | | async handleWechatAuth() { |
| | | const code = this.$route.query.code; |
| | | if (code) { |
| | | try { |
| | | const response = await getWechatUserInfo(code); |
| | | if (response.code === 200) { |
| | | const userInfo = response.data; |
| | | this.evaluationForm.wechatOpenid = userInfo.openid; |
| | | this.evaluationForm.wechatNickname = userInfo.nickname; |
| | | this.evaluationForm.wechatAvatar = userInfo.headimgurl; |
| | | this.evaluationForm.wechatPhone = userInfo.phone || ''; |
| | | } |
| | | } catch (error) { |
| | | console.error('è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯å¤±è´¥:', error); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // å è½½è¯ä»·ç»´åº¦ |
| | | async loadDimensions() { |
| | | try { |
| | | const response = await getEvaluationDimensions(); |
| | | if (response.code === 200) { |
| | | this.dimensions = response.data; |
| | | } |
| | | } catch (error) { |
| | | console.error('å è½½è¯ä»·ç»´åº¦å¤±è´¥:', error); |
| | | this.$message.error('å è½½è¯ä»·ç»´åº¦å¤±è´¥'); |
| | | } |
| | | }, |
| | | |
| | | // è·å维度è¯å |
| | | getDimensionScore(dimensionId) { |
| | | const detail = this.evaluationForm.evaluationDetails.find(d => d.dimensionId === dimensionId); |
| | | return detail ? detail.score : 0; |
| | | }, |
| | | |
| | | // æ´æ°ç»´åº¦è¯å |
| | | updateDimensionScore(dimensionId, score) { |
| | | let detail = this.evaluationForm.evaluationDetails.find(d => d.dimensionId === dimensionId); |
| | | if (!detail) { |
| | | detail = { dimensionId, score: 0 }; |
| | | this.evaluationForm.evaluationDetails.push(detail); |
| | | } |
| | | detail.score = score; |
| | | }, |
| | | |
| | | // è·å维度é项 |
| | | getDimensionOption(dimensionId) { |
| | | const detail = this.evaluationForm.evaluationDetails.find(d => d.dimensionId === dimensionId); |
| | | return detail ? detail.optionValue : ''; |
| | | }, |
| | | |
| | | // æ´æ°ç»´åº¦é项 |
| | | updateDimensionOption(dimensionId, optionValue) { |
| | | let detail = this.evaluationForm.evaluationDetails.find(d => d.dimensionId === dimensionId); |
| | | if (!detail) { |
| | | detail = { dimensionId, optionValue: '' }; |
| | | this.evaluationForm.evaluationDetails.push(detail); |
| | | } |
| | | detail.optionValue = optionValue; |
| | | }, |
| | | |
| | | // è·åç»´åº¦ææ¬ |
| | | getDimensionText(dimensionId) { |
| | | const detail = this.evaluationForm.evaluationDetails.find(d => d.dimensionId === dimensionId); |
| | | return detail ? detail.textContent : ''; |
| | | }, |
| | | |
| | | // æ´æ°ç»´åº¦ææ¬ |
| | | updateDimensionText(dimensionId, textContent) { |
| | | let detail = this.evaluationForm.evaluationDetails.find(d => d.dimensionId === dimensionId); |
| | | if (!detail) { |
| | | detail = { dimensionId, textContent: '' }; |
| | | this.evaluationForm.evaluationDetails.push(detail); |
| | | } |
| | | detail.textContent = textContent; |
| | | }, |
| | | |
| | | // è·å维度é项é
ç½® |
| | | getDimensionOptions(dimension) { |
| | | if (!dimension.options) return []; |
| | | try { |
| | | return JSON.parse(dimension.options); |
| | | } catch (error) { |
| | | return []; |
| | | } |
| | | }, |
| | | |
| | | // æäº¤è¯ä»· |
| | | async submitEvaluation() { |
| | | try { |
| | | // 表åéªè¯ |
| | | await this.$refs.evaluationForm.validate(); |
| | | |
| | | // æ£æ¥å¿
å¡«çè¯ä»·ç»´åº¦ |
| | | for (const dimension of this.dimensions) { |
| | | if (dimension.isRequired === '1') { |
| | | const detail = this.evaluationForm.evaluationDetails.find(d => d.dimensionId === dimension.dimensionId); |
| | | if (!detail || (dimension.dimensionType === 'star' && !detail.score) || |
| | | (dimension.dimensionType === 'select' && !detail.optionValue) || |
| | | (dimension.dimensionType === 'text' && !detail.textContent)) { |
| | | this.$message.error(`è¯·å®æ${dimension.dimensionName}çè¯ä»·`); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.submitting = true; |
| | | |
| | | // æäº¤è¯ä»· |
| | | const response = await submitEvaluation(this.evaluationForm); |
| | | if (response.code === 200) { |
| | | this.resultMessage = response.msg; |
| | | this.showResult = true; |
| | | } else { |
| | | this.$message.error(response.msg || 'æäº¤å¤±è´¥ï¼è¯·éè¯'); |
| | | } |
| | | } catch (error) { |
| | | console.error('æäº¤è¯ä»·å¤±è´¥:', error); |
| | | this.$message.error('æäº¤å¤±è´¥ï¼è¯·éè¯'); |
| | | } finally { |
| | | this.submitting = false; |
| | | } |
| | | }, |
| | | |
| | | // é置表å |
| | | resetForm() { |
| | | this.showResult = false; |
| | | this.evaluationForm.customerName = ''; |
| | | this.evaluationForm.customerPhone = ''; |
| | | this.evaluationForm.evaluationDetails = []; |
| | | this.$refs.evaluationForm.resetFields(); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .evaluation-container { |
| | | max-width: 600px; |
| | | margin: 0 auto; |
| | | padding: 8px; |
| | | background-color: #f5f5f5; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .evaluation-header { |
| | | text-align: center; |
| | | margin-bottom: 12px; |
| | | padding: 12px; |
| | | background: white; |
| | | border-radius: 6px; |
| | | box-shadow: 0 1px 3px rgba(0,0,0,0.1); |
| | | } |
| | | |
| | | .evaluation-header h1 { |
| | | color: #333; |
| | | margin: 0 0 6px 0; |
| | | font-size: 20px; |
| | | } |
| | | |
| | | .evaluation-header p { |
| | | color: #666; |
| | | margin: 0; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .vehicle-info { |
| | | background: white; |
| | | padding: 8px 12px; |
| | | border-radius: 6px; |
| | | margin-bottom: 12px; |
| | | box-shadow: 0 1px 3px rgba(0,0,0,0.1); |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .label { |
| | | font-weight: bold; |
| | | color: #333; |
| | | margin-right: 8px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .value { |
| | | color: #666; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .evaluation-form { |
| | | background: white; |
| | | padding: 12px; |
| | | border-radius: 6px; |
| | | box-shadow: 0 1px 3px rgba(0,0,0,0.1); |
| | | } |
| | | |
| | | .form-section { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .form-section h3 { |
| | | color: #333; |
| | | margin: 0 0 12px 0; |
| | | padding-bottom: 6px; |
| | | border-bottom: 1px solid #409EFF; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | .dimension-item { |
| | | margin-bottom: 12px; |
| | | padding: 8px; |
| | | border: 1px solid #e4e7ed; |
| | | border-radius: 4px; |
| | | background-color: #fafafa; |
| | | } |
| | | |
| | | .dimension-title { |
| | | font-weight: bold; |
| | | color: #333; |
| | | margin-bottom: 4px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .required { |
| | | color: #f56c6c; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .dimension-desc { |
| | | color: #666; |
| | | font-size: 12px; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | /* æçº§è¯ä»·å
èå¸å± */ |
| | | .star-rating-inline { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .dimension-title-inline { |
| | | font-weight: bold; |
| | | color: #333; |
| | | font-size: 14px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .star-rating-content { |
| | | flex: 1; |
| | | min-width: 200px; |
| | | } |
| | | |
| | | .star-rating, .select-rating, .text-rating { |
| | | margin-top: 6px; |
| | | } |
| | | |
| | | /* ä¼åæçº§è¯åæ¾ç¤º */ |
| | | .star-rating .el-rate { |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .star-rating .el-rate__text { |
| | | font-size: 12px; |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | /* ä¼åéæ©è¯ä»·æ¾ç¤º */ |
| | | .select-rating .el-radio { |
| | | margin-right: 12px; |
| | | margin-bottom: 4px; |
| | | } |
| | | |
| | | .select-rating .el-radio__label { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | /* ä¼åææ¬è¯ä»·æ¾ç¤º */ |
| | | .text-rating .el-textarea__inner { |
| | | font-size: 13px; |
| | | min-height: 60px !important; |
| | | } |
| | | |
| | | /* ä¼å表å项é´è· */ |
| | | .el-form-item { |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .el-form-item__label { |
| | | font-size: 13px; |
| | | line-height: 28px; |
| | | } |
| | | |
| | | .el-input__inner { |
| | | font-size: 13px; |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | |
| | | .form-actions { |
| | | text-align: center; |
| | | margin-top: 16px; |
| | | } |
| | | |
| | | .form-actions .el-button { |
| | | padding: 10px 30px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .result-page { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0,0,0,0.5); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .result-content { |
| | | background: white; |
| | | padding: 30px; |
| | | border-radius: 8px; |
| | | text-align: center; |
| | | max-width: 350px; |
| | | width: 90%; |
| | | } |
| | | |
| | | .result-icon { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .result-message { |
| | | font-size: 16px; |
| | | color: #333; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .result-actions { |
| | | text-align: center; |
| | | } |
| | | |
| | | /* ç§»å¨ç«¯éé
*/ |
| | | @media (max-width: 768px) { |
| | | .evaluation-container { |
| | | padding: 6px; |
| | | } |
| | | |
| | | .evaluation-header { |
| | | padding: 10px; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .evaluation-header h1 { |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .evaluation-header p { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .evaluation-form { |
| | | padding: 10px; |
| | | } |
| | | |
| | | .dimension-item { |
| | | padding: 6px; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .form-section { |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .form-section h3 { |
| | | font-size: 15px; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .dimension-title { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .dimension-desc { |
| | | font-size: 11px; |
| | | } |
| | | |
| | | .star-rating .el-rate { |
| | | font-size: 16px; |
| | | } |
| | | |
| | | /* ç§»å¨ç«¯æçº§è¯ä»·å
èå¸å± */ |
| | | .star-rating-inline { |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | gap: 6px; |
| | | } |
| | | |
| | | .dimension-title-inline { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .star-rating-content { |
| | | min-width: auto; |
| | | width: 100%; |
| | | } |
| | | |
| | | .select-rating .el-radio { |
| | | margin-right: 8px; |
| | | } |
| | | |
| | | .select-rating .el-radio__label { |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .text-rating .el-textarea__inner { |
| | | font-size: 12px; |
| | | min-height: 50px !important; |
| | | } |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .el-form-item__label { |
| | | font-size: 12px; |
| | | line-height: 26px; |
| | | } |
| | | |
| | | .el-input__inner { |
| | | font-size: 12px; |
| | | height: 30px; |
| | | line-height: 30px; |
| | | } |
| | | |
| | | .form-actions { |
| | | margin-top: 12px; |
| | | } |
| | | |
| | | .form-actions .el-button { |
| | | padding: 8px 24px; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | |
| | | /* è¶
å°å±å¹éé
*/ |
| | | @media (max-width: 480px) { |
| | | .evaluation-container { |
| | | padding: 4px; |
| | | } |
| | | |
| | | .evaluation-header { |
| | | padding: 8px; |
| | | } |
| | | |
| | | .evaluation-form { |
| | | padding: 8px; |
| | | } |
| | | |
| | | .dimension-item { |
| | | padding: 4px; |
| | | } |
| | | |
| | | .star-rating .el-rate { |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .text-rating .el-textarea__inner { |
| | | min-height: 40px !important; |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="车çå·" prop="vehicleNo"> |
| | | <el-input |
| | | v-model="queryParams.vehicleNo" |
| | | placeholder="请è¾å
¥è½¦çå·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="è¯·éæ©ç¶æ" clearable> |
| | | <el-option label="æ£å¸¸" value="0" /> |
| | | <el-option label="åç¨" value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['evaluation:qrcode:generate']" |
| | | >çæäºç»´ç </el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | size="mini" |
| | | @click="handleBatchGenerate" |
| | | v-hasPermi="['evaluation:qrcode:batch']" |
| | | >æ¹éçæ</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['evaluation:qrcode:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="qrcodeList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="äºç»´ç ID" align="center" prop="qrcodeId" /> |
| | | <el-table-column label="车çå·" align="center" prop="vehicleNo" /> |
| | | <el-table-column label="äºç»´ç URL" align="center" prop="qrcodeUrl" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-link :href="scope.row.qrcodeUrl" target="_blank" type="primary">{{ scope.row.qrcodeUrl }}</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="äºç»´ç å
容" align="center" prop="qrcodeContent" /> |
| | | <el-table-column label="äºç»´ç å¾ç" align="center" prop="qrcodeImage" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-image |
| | | v-if="scope.row.qrcodeImage" |
| | | :src="getImageUrl(scope.row.qrcodeImage)" |
| | | :preview-src-list="[getImageUrl(scope.row.qrcodeImage)]" |
| | | style="width: 50px; height: 50px;" |
| | | fit="cover"> |
| | | </el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleView(scope.row)" |
| | | v-hasPermi="['evaluation:qrcode:query']" |
| | | >æ¥ç</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-download" |
| | | @click="handleDownload(scope.row)" |
| | | >ä¸è½½</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['evaluation:qrcode:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- çæäºç»´ç å¯¹è¯æ¡ --> |
| | | <el-dialog title="çæäºç»´ç " :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-form-item label="车çå·" prop="vehicleNo"> |
| | | <el-input v-model="form.vehicleNo" placeholder="请è¾å
¥è½¦çå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="äºç»´ç URL" prop="qrcodeUrl"> |
| | | <el-input v-model="form.qrcodeUrl" placeholder="请è¾å
¥äºç»´ç URL" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- äºç»´ç 详æ
å¯¹è¯æ¡ --> |
| | | <el-dialog title="äºç»´ç 详æ
" :visible.sync="viewOpen" width="600px" append-to-body> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="äºç»´ç ID">{{ viewForm.qrcodeId }}</el-descriptions-item> |
| | | <el-descriptions-item label="车çå·">{{ viewForm.vehicleNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="äºç»´ç URL" :span="2"> |
| | | <el-link :href="viewForm.qrcodeUrl" target="_blank" type="primary">{{ viewForm.qrcodeUrl }}</el-link> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="äºç»´ç å
容" :span="2">{{ viewForm.qrcodeContent }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¶æ"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="viewForm.status"/> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="å建æ¶é´">{{ parseTime(viewForm.createTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="äºç»´ç å¾ç" :span="2"> |
| | | <el-image |
| | | v-if="viewForm.qrcodeImage" |
| | | :src="getImageUrl(viewForm.qrcodeImage)" |
| | | style="width: 200px; height: 200px;" |
| | | fit="cover"> |
| | | </el-image> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="viewOpen = false">å
³ é</el-button> |
| | | <el-button type="primary" @click="handleDownload(viewForm)">ä¸è½½äºç»´ç </el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listQrcode, getQrcode, delQrcode, generateQrcode, batchGenerateQrcode } from "@/api/evaluation"; |
| | | |
| | | export default { |
| | | name: "VehicleEvaluationQrcode", |
| | | dicts: ['sys_normal_disable'], |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // 车è¾è¯ä»·äºç»´ç è¡¨æ ¼æ°æ® |
| | | qrcodeList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¯å¦æ¾ç¤ºæ¥çå¼¹åºå± |
| | | viewOpen: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | vehicleNo: null, |
| | | status: null |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // æ¥ç表ååæ° |
| | | viewForm: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | vehicleNo: [ |
| | | { required: true, message: "车çå·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | qrcodeUrl: [ |
| | | { required: true, message: "äºç»´ç URLä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { type: 'url', message: '请è¾å
¥æ£ç¡®çURLæ ¼å¼', trigger: 'blur' } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢è½¦è¾è¯ä»·äºç»´ç å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listQrcode(this.queryParams).then(response => { |
| | | this.qrcodeList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | qrcodeId: null, |
| | | vehicleNo: null, |
| | | qrcodeUrl: null, |
| | | qrcodeContent: null, |
| | | qrcodeImage: null, |
| | | status: "0" |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.qrcodeId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "çæäºç»´ç "; |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | const params = { |
| | | vehicleNo: this.form.vehicleNo, |
| | | qrcodeUrl: this.form.qrcodeUrl |
| | | }; |
| | | generateQrcode(params).then(response => { |
| | | this.$modal.msgSuccess("çææå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | /** æ¹éçææé®æä½ */ |
| | | handleBatchGenerate() { |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤æ¹éçæææè½¦è¾çäºç»´ç ï¼').then(function() { |
| | | return batchGenerateQrcode(); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("æ¹éçææå"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** æ¥çæé®æä½ */ |
| | | handleView(row) { |
| | | this.viewForm = row; |
| | | this.viewOpen = true; |
| | | }, |
| | | /** ä¸è½½æé®æä½ */ |
| | | handleDownload(row) { |
| | | if (row.qrcodeImage) { |
| | | const link = document.createElement('a'); |
| | | link.href = this.getImageUrl(row.qrcodeImage); |
| | | link.download = `qrcode_${row.vehicleNo}.png`; |
| | | link.click(); |
| | | } |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const qrcodeIds = row.qrcodeId || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤è½¦è¾è¯ä»·äºç»´ç ç¼å·ä¸º"' + qrcodeIds + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delQrcode(qrcodeIds); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** è·åå¾çURL */ |
| | | getImageUrl(imagePath) { |
| | | if (imagePath) { |
| | | // 妿æ¯base64æ ¼å¼ï¼ç´æ¥è¿å |
| | | if (imagePath.startsWith('data:image/')) { |
| | | return imagePath; |
| | | } |
| | | // å¦æè·¯å¾å·²ç»å
å«httpï¼ç´æ¥è¿å |
| | | if (imagePath.startsWith('http://') || imagePath.startsWith('https://')) { |
| | | return imagePath; |
| | | } |
| | | // å¦æè·¯å¾ä»¥/å¼å¤´ï¼ç´æ¥æ¼æ¥åå |
| | | if (imagePath.startsWith('/')) { |
| | | return process.env.VUE_APP_BASE_API + imagePath; |
| | | } |
| | | // å
¶ä»æ
åµï¼æ·»å /åç¼åæ¼æ¥åå |
| | | return process.env.VUE_APP_BASE_API + '/' + imagePath; |
| | | } |
| | | return ''; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="车çå·" prop="vehicleNo"> |
| | | <el-input |
| | | v-model="queryParams.vehicleNo" |
| | | placeholder="请è¾å
¥è½¦çå·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è¯ä»·æ¶é´" prop="evaluationTime"> |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="32"> |
| | | <el-col :xs="24" :sm="12" :lg="6" class="card-panel-col"> |
| | | <div class="card-panel"> |
| | | <div class="card-panel-icon-wrapper icon-people"> |
| | | <svg-icon icon-class="peoples" class-name="card-panel-icon" /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text">æ»è¯ä»·æ°</div> |
| | | <div class="card-panel-num">{{ statisticsData.totalEvaluations }}</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :lg="6" class="card-panel-col"> |
| | | <div class="card-panel"> |
| | | <div class="card-panel-icon-wrapper icon-message"> |
| | | <svg-icon icon-class="message" class-name="card-panel-icon" /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text">å¹³åè¯å</div> |
| | | <div class="card-panel-num">{{ statisticsData.averageScore }}</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :lg="6" class="card-panel-col"> |
| | | <div class="card-panel"> |
| | | <div class="card-panel-icon-wrapper icon-star"> |
| | | <svg-icon icon-class="star" class-name="card-panel-icon" /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text">好è¯ç</div> |
| | | <div class="card-panel-num">{{ statisticsData.goodRate }}%</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :lg="6" class="card-panel-col"> |
| | | <div class="card-panel"> |
| | | <div class="card-panel-icon-wrapper icon-vehicle"> |
| | | <svg-icon icon-class="car" class-name="card-panel-icon" /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text">åä¸è½¦è¾</div> |
| | | <div class="card-panel-num">{{ statisticsData.vehicleCount }}</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="32" style="margin-top: 20px;"> |
| | | <el-col :xs="24" :sm="24" :lg="12"> |
| | | <div class="chart-container"> |
| | | <div class="chart-title">è¯ååå¸</div> |
| | | <div ref="scoreChart" class="chart"></div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :lg="12"> |
| | | <div class="chart-container"> |
| | | <div class="chart-title">æåº¦è¯ä»·è¶å¿</div> |
| | | <div ref="trendChart" class="chart"></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="margin-top: 20px;"> |
| | | <el-col :span="24"> |
| | | <div class="chart-container"> |
| | | <div class="chart-title">å维度è¯åç»è®¡</div> |
| | | <div ref="dimensionChart" class="chart"></div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="evaluationList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="è¯ä»·ID" align="center" prop="evaluationId" /> |
| | | <el-table-column label="车çå·" align="center" prop="vehicleNo" /> |
| | | <el-table-column label="客æ·å§å" align="center" prop="customerName" /> |
| | | <el-table-column label="å®¢æ·ææº" align="center" prop="customerPhone" /> |
| | | <el-table-column label="综åè¯å" align="center" prop="overallScore"> |
| | | <template slot-scope="scope"> |
| | | <el-rate |
| | | v-model="scope.row.overallScore" |
| | | disabled |
| | | show-score |
| | | text-color="#ff9900" |
| | | score-template="{value}" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è¯ä»·æ¶é´" align="center" prop="evaluationTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.evaluationTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleView(scope.row)" |
| | | >æ¥ç详æ
</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- è¯ä»·è¯¦æ
å¯¹è¯æ¡ --> |
| | | <el-dialog title="è¯ä»·è¯¦æ
" :visible.sync="detailOpen" width="600px" append-to-body> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="è¯ä»·ID">{{ detailForm.evaluationId }}</el-descriptions-item> |
| | | <el-descriptions-item label="车çå·">{{ detailForm.vehicleNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·å§å">{{ detailForm.customerName }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¢æ·ææº">{{ detailForm.customerPhone }}</el-descriptions-item> |
| | | <el-descriptions-item label="微信æµç§°">{{ detailForm.wechatNickname }}</el-descriptions-item> |
| | | <el-descriptions-item label="综åè¯å"> |
| | | <el-rate |
| | | v-model="detailForm.overallScore" |
| | | disabled |
| | | show-score |
| | | text-color="#ff9900" |
| | | score-template="{value}" |
| | | /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="è¯ä»·æ¶é´" :span="2"> |
| | | {{ parseTime(detailForm.evaluationTime, '{y}-{m}-{d} {h}:{i}:{s}') }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <h4>详ç»è¯ä»·</h4> |
| | | <el-table :data="detailForm.evaluationDetails" border> |
| | | <el-table-column label="è¯ä»·ç»´åº¦" prop="dimensionName" /> |
| | | <el-table-column label="è¯å" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-rate |
| | | v-if="scope.row.dimensionType === 'star'" |
| | | v-model="scope.row.score" |
| | | disabled |
| | | show-score |
| | | text-color="#ff9900" |
| | | score-template="{value}" |
| | | /> |
| | | <span v-else>{{ scope.row.optionValue || scope.row.textContent }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listCustomerEvaluation, getCustomerEvaluation } from "@/api/evaluation"; |
| | | import * as echarts from 'echarts'; |
| | | |
| | | export default { |
| | | name: "EvaluationStatistics", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // 客æ·è¯ä»·è¡¨æ ¼æ°æ® |
| | | evaluationList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | detailOpen: false, |
| | | // æ¥æèå´ |
| | | dateRange: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | vehicleNo: null, |
| | | evaluationTime: null |
| | | }, |
| | | // 表ååæ° |
| | | detailForm: {}, |
| | | // ç»è®¡æ°æ® |
| | | statisticsData: { |
| | | totalEvaluations: 0, |
| | | averageScore: 0, |
| | | goodRate: 0, |
| | | vehicleCount: 0 |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getStatistics(); |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | | this.initCharts(); |
| | | }); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢å®¢æ·è¯ä»·å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listCustomerEvaluation(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
| | | this.evaluationList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** è·åç»è®¡æ°æ® */ |
| | | getStatistics() { |
| | | // è¿éåºè¯¥è°ç¨ç»è®¡æ¥å£ï¼ææ¶ä½¿ç¨æ¨¡ææ°æ® |
| | | this.statisticsData = { |
| | | totalEvaluations: 156, |
| | | averageScore: 4.2, |
| | | goodRate: 85.6, |
| | | vehicleCount: 23 |
| | | }; |
| | | }, |
| | | /** åå§åå¾è¡¨ */ |
| | | initCharts() { |
| | | this.initScoreChart(); |
| | | this.initTrendChart(); |
| | | this.initDimensionChart(); |
| | | }, |
| | | /** åå§åè¯ååå¸å¾è¡¨ */ |
| | | initScoreChart() { |
| | | const chart = echarts.init(this.$refs.scoreChart); |
| | | const option = { |
| | | title: { |
| | | text: 'è¯ååå¸', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'è¯ååå¸', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 35, name: '5æ' }, |
| | | { value: 28, name: '4æ' }, |
| | | { value: 20, name: '3æ' }, |
| | | { value: 12, name: '2æ' }, |
| | | { value: 5, name: '1æ' } |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | chart.setOption(option); |
| | | }, |
| | | /** åå§åè¶å¿å¾è¡¨ */ |
| | | initTrendChart() { |
| | | const chart = echarts.init(this.$refs.trendChart); |
| | | const option = { |
| | | title: { |
| | | text: 'æåº¦è¯ä»·è¶å¿', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['1æ', '2æ', '3æ', '4æ', '5æ', '6æ'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'è¯ä»·æ°é', |
| | | type: 'line', |
| | | data: [12, 19, 23, 18, 25, 28], |
| | | smooth: true |
| | | } |
| | | ] |
| | | }; |
| | | chart.setOption(option); |
| | | }, |
| | | /** åå§å维度ç»è®¡å¾è¡¨ */ |
| | | initDimensionChart() { |
| | | const chart = echarts.init(this.$refs.dimensionChart); |
| | | const option = { |
| | | title: { |
| | | text: 'å维度è¯åç»è®¡', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['æå¡æåº¦', 'æ¶è´¹æ
åµ', '车è¾å«ç', 'é©¾é©¶ææ¯', 'æ´ä½æå¡'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | max: 5 |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'å¹³åè¯å', |
| | | type: 'bar', |
| | | data: [4.5, 4.2, 4.3, 4.4, 4.1], |
| | | itemStyle: { |
| | | color: '#409EFF' |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | chart.setOption(option); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.detailOpen = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.detailForm = { |
| | | evaluationId: null, |
| | | vehicleNo: null, |
| | | customerName: null, |
| | | customerPhone: null, |
| | | wechatOpenid: null, |
| | | wechatNickname: null, |
| | | wechatAvatar: null, |
| | | wechatPhone: null, |
| | | overallScore: null, |
| | | evaluationTime: null, |
| | | evaluationDetails: [] |
| | | }; |
| | | this.resetForm("detailForm"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.dateRange = []; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.evaluationId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ¥ç详æ
æé®æä½ */ |
| | | handleView(row) { |
| | | this.reset(); |
| | | const evaluationId = row.evaluationId || this.ids |
| | | getCustomerEvaluation(evaluationId).then(response => { |
| | | this.detailForm = response.data; |
| | | this.detailOpen = true; |
| | | this.title = "è¯ä»·è¯¦æ
"; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .app-container { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .card-panel-col { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .card-panel { |
| | | height: 108px; |
| | | cursor: pointer; |
| | | font-size: 12px; |
| | | position: relative; |
| | | overflow: hidden; |
| | | color: #666; |
| | | background: #fff; |
| | | box-shadow: 4px 4px 40px rgba(0, 0, 0, .05); |
| | | border-color: rgba(0, 0, 0, .05); |
| | | } |
| | | |
| | | .card-panel:hover { |
| | | box-shadow: 4px 4px 40px rgba(0, 0, 0, .1); |
| | | } |
| | | |
| | | .card-panel-icon-wrapper { |
| | | float: left; |
| | | margin: 14px 0 0 14px; |
| | | padding: 16px; |
| | | transition: all 0.38s ease-out; |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | .card-panel-icon { |
| | | float: left; |
| | | font-size: 48px; |
| | | } |
| | | |
| | | .card-panel-description { |
| | | float: right; |
| | | font-weight: bold; |
| | | margin: 26px; |
| | | margin-left: 0px; |
| | | } |
| | | |
| | | .card-panel-text { |
| | | line-height: 18px; |
| | | color: rgba(0, 0, 0, 0.45); |
| | | font-size: 16px; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .card-panel-num { |
| | | font-size: 20px; |
| | | color: #666; |
| | | } |
| | | |
| | | .icon-people { |
| | | color: #40c9c6; |
| | | } |
| | | |
| | | .icon-message { |
| | | color: #36a3f7; |
| | | } |
| | | |
| | | .icon-star { |
| | | color: #f4516c; |
| | | } |
| | | |
| | | .icon-vehicle { |
| | | color: #34bfa3; |
| | | } |
| | | |
| | | .chart-container { |
| | | background: #fff; |
| | | padding: 20px; |
| | | border-radius: 4px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .chart-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-bottom: 15px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .chart { |
| | | height: 300px; |
| | | width: 100%; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="test-container"> |
| | | <h2>å®¢æ·æ»¡æåº¦è¯ä»·åè½æµè¯</h2> |
| | | |
| | | <div class="test-section"> |
| | | <h3>1. çæäºç»´ç æµè¯</h3> |
| | | <el-form :inline="true"> |
| | | <el-form-item label="车çå·"> |
| | | <el-input v-model="testVehicleNo" placeholder="请è¾å
¥è½¦çå·" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="generateQrcode">çæäºç»´ç </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <div v-if="qrcodeInfo" class="qrcode-result"> |
| | | <p><strong>äºç»´ç URL:</strong> {{ qrcodeInfo.qrcodeUrl }}</p> |
| | | <p><strong>äºç»´ç å
容:</strong> {{ qrcodeInfo.qrcodeContent }}</p> |
| | | <p><strong>äºç»´ç å¾ç:</strong> {{ qrcodeInfo.qrcodeImage }}</p> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="test-section"> |
| | | <h3>2. è¯ä»·ç»´åº¦é
ç½®æµè¯</h3> |
| | | <el-button type="primary" @click="loadDimensions">å è½½è¯ä»·ç»´åº¦</el-button> |
| | | |
| | | <div v-if="dimensions.length > 0" class="dimensions-result"> |
| | | <h4>è¯ä»·ç»´åº¦å表:</h4> |
| | | <ul> |
| | | <li v-for="dimension in dimensions" :key="dimension.dimensionId"> |
| | | {{ dimension.dimensionName }} - {{ dimension.dimensionType }} |
| | | <span v-if="dimension.isRequired === '1'">(å¿
å¡«)</span> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="test-section"> |
| | | <h3>3. è¯ä»·æäº¤æµè¯</h3> |
| | | <el-form :model="testEvaluation" label-width="100px"> |
| | | <el-form-item label="车çå·"> |
| | | <el-input v-model="testEvaluation.vehicleNo" /> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·å§å"> |
| | | <el-input v-model="testEvaluation.customerName" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®¢æ·ææº"> |
| | | <el-input v-model="testEvaluation.customerPhone" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitTestEvaluation">æäº¤æµè¯è¯ä»·</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="test-section"> |
| | | <h3>4. ç´æ¥è®¿é®è¯ä»·é¡µé¢</h3> |
| | | <p>访é®å°å: <a :href="evaluationUrl" target="_blank">{{ evaluationUrl }}</a></p> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { generateQrcode, getEvaluationDimensions, submitEvaluation } from "@/api/evaluation"; |
| | | |
| | | export default { |
| | | name: "EvaluationTest", |
| | | data() { |
| | | return { |
| | | testVehicleNo: "粤A12345", |
| | | qrcodeInfo: null, |
| | | dimensions: [], |
| | | testEvaluation: { |
| | | vehicleNo: "粤A12345", |
| | | customerName: "æµè¯ç¨æ·", |
| | | customerPhone: "13800138000", |
| | | evaluationDetails: [ |
| | | { |
| | | dimensionId: 1, |
| | | score: 5 |
| | | }, |
| | | { |
| | | dimensionId: 2, |
| | | score: 4 |
| | | }, |
| | | { |
| | | dimensionId: 3, |
| | | score: 5 |
| | | }, |
| | | { |
| | | dimensionId: 4, |
| | | score: 4 |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | evaluationUrl() { |
| | | return `${window.location.origin}/evaluation?vehicle=${this.testVehicleNo}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | async generateQrcode() { |
| | | try { |
| | | const response = await generateQrcode(this.testVehicleNo); |
| | | if (response.code === 200) { |
| | | this.qrcodeInfo = response.data; |
| | | this.$message.success("äºç»´ç çææå"); |
| | | } else { |
| | | this.$message.error(response.msg || "çæå¤±è´¥"); |
| | | } |
| | | } catch (error) { |
| | | console.error("çæäºç»´ç 失败:", error); |
| | | this.$message.error("çæäºç»´ç 失败"); |
| | | } |
| | | }, |
| | | |
| | | async loadDimensions() { |
| | | try { |
| | | const response = await getEvaluationDimensions(); |
| | | if (response.code === 200) { |
| | | this.dimensions = response.data; |
| | | this.$message.success("è¯ä»·ç»´åº¦å è½½æå"); |
| | | } else { |
| | | this.$message.error(response.msg || "å 载失败"); |
| | | } |
| | | } catch (error) { |
| | | console.error("å è½½è¯ä»·ç»´åº¦å¤±è´¥:", error); |
| | | this.$message.error("å è½½è¯ä»·ç»´åº¦å¤±è´¥"); |
| | | } |
| | | }, |
| | | |
| | | async submitTestEvaluation() { |
| | | try { |
| | | const response = await submitEvaluation(this.testEvaluation); |
| | | if (response.code === 200) { |
| | | this.$message.success(response.msg || "è¯ä»·æäº¤æå"); |
| | | } else { |
| | | this.$message.error(response.msg || "æäº¤å¤±è´¥"); |
| | | } |
| | | } catch (error) { |
| | | console.error("æäº¤è¯ä»·å¤±è´¥:", error); |
| | | this.$message.error("æäº¤è¯ä»·å¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .test-container { |
| | | max-width: 800px; |
| | | margin: 0 auto; |
| | | padding: 20px; |
| | | } |
| | | |
| | | .test-section { |
| | | margin-bottom: 30px; |
| | | padding: 20px; |
| | | border: 1px solid #e4e7ed; |
| | | border-radius: 6px; |
| | | background-color: #fafafa; |
| | | } |
| | | |
| | | .test-section h3 { |
| | | margin-top: 0; |
| | | color: #333; |
| | | } |
| | | |
| | | .qrcode-result, .dimensions-result { |
| | | margin-top: 15px; |
| | | padding: 15px; |
| | | background-color: white; |
| | | border-radius: 4px; |
| | | border: 1px solid #e4e7ed; |
| | | } |
| | | |
| | | .dimensions-result ul { |
| | | margin: 10px 0; |
| | | padding-left: 20px; |
| | | } |
| | | |
| | | .dimensions-result li { |
| | | margin-bottom: 5px; |
| | | } |
| | | </style> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å½å±é¨é¨" prop="deptId"> |
| | | <el-select v-model="queryParams.deptId" placeholder="è¯·éæ©é¨é¨" clearable size="small"> |
| | | <el-option |
| | | v-for="dept in deptOptions" |
| | | :key="dept.deptId" |
| | | :label="dept.deptName" |
| | | :value="dept.deptId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | |
| | | <dict-tag :options="dict.type.sys_platform" :value="scope.row.platformCode"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å½å±é¨é¨" align="center" prop="deptName" /> |
| | | <el-table-column label="ç¶æ" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å½å±é¨é¨" prop="deptId"> |
| | | <el-select v-model="form.deptId" placeholder="è¯·éæ©é¨é¨" clearable> |
| | | <el-option |
| | | v-for="dept in deptOptions" |
| | | :key="dept.deptId" |
| | | :label="dept.deptName" |
| | | :value="dept.deptId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | |
| | | |
| | | <script> |
| | | import { listVehicle, getVehicle, delVehicle, addVehicle, updateVehicle } from "@/api/system/vehicle"; |
| | | import { listDept } from "@/api/system/dept"; |
| | | |
| | | export default { |
| | | name: "Vehicle", |
| | |
| | | total: 0, |
| | | // 车è¾ä¿¡æ¯è¡¨æ ¼æ°æ® |
| | | vehicleList: [], |
| | | // é¨é¨é项 |
| | | deptOptions: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | |
| | | vehicleBrand: null, |
| | | vehicleModel: null, |
| | | status: null, |
| | | platformCode: null |
| | | platformCode: null, |
| | | deptId: null |
| | | }, |
| | | // 表ååæ° |
| | | form: { |
| | |
| | | vehicleModel: null, |
| | | status: "0", |
| | | remark: null, |
| | | platformCode: null |
| | | platformCode: null, |
| | | deptId: null |
| | | }, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | |
| | | ], |
| | | platformCode: [ |
| | | { required: true, message: "平尿 è¯ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | deptId: [ |
| | | { required: true, message: "å½å±é¨é¨ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getDeptList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢è½¦è¾ä¿¡æ¯å表 */ |
| | |
| | | this.vehicleList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** æ¥è¯¢é¨é¨å表 */ |
| | | getDeptList() { |
| | | listDept().then(response => { |
| | | this.deptOptions = response.data; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | |
| | | vehicleModel: null, |
| | | status: "0", |
| | | remark: null, |
| | | platformCode: null |
| | | platformCode: null, |
| | | deptId: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
New file |
| | |
| | | -- å®¢æ·æ»¡æåº¦è¯ä»·åè½æ°æ®åºè¡¨ç»æ |
| | | -- å建æ¶é´: 2025-01-27 |
| | | |
| | | -- 1. è¯ä»·ç»´åº¦é
置表 |
| | | DROP TABLE IF EXISTS `evaluation_dimension`; |
| | | CREATE TABLE `evaluation_dimension` ( |
| | | `dimension_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '维度ID', |
| | | `dimension_name` varchar(100) NOT NULL COMMENT '维度åç§°', |
| | | `dimension_desc` varchar(500) DEFAULT NULL COMMENT '维度æè¿°', |
| | | `dimension_type` varchar(20) NOT NULL DEFAULT 'star' COMMENT '维度类åï¼star-æçº§è¯ä»·ï¼select-éæ©è¯ä»·ï¼text-ææ¬è¯ä»·', |
| | | `options` text COMMENT 'é项é
ç½®ï¼JSONæ ¼å¼ï¼ç¨äºéæ©ç±»åï¼', |
| | | `sort_order` int(11) DEFAULT 0 COMMENT 'æåº', |
| | | `is_required` char(1) DEFAULT '1' COMMENT 'æ¯å¦å¿
å¡«ï¼0å¦ 1æ¯ï¼', |
| | | `status` char(1) DEFAULT '0' COMMENT 'ç¶æï¼0æ£å¸¸ 1åç¨ï¼', |
| | | `create_by` varchar(64) DEFAULT '' COMMENT 'å建è
', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_by` varchar(64) DEFAULT '' COMMENT 'æ´æ°è
', |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | PRIMARY KEY (`dimension_id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='è¯ä»·ç»´åº¦é
置表'; |
| | | |
| | | -- 2. 客æ·è¯ä»·è¡¨ |
| | | DROP TABLE IF EXISTS `customer_evaluation`; |
| | | CREATE TABLE `customer_evaluation` ( |
| | | `evaluation_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'è¯ä»·ID', |
| | | `vehicle_no` varchar(20) NOT NULL COMMENT '车çå·', |
| | | `customer_name` varchar(50) NOT NULL COMMENT '客æ·å§å', |
| | | `customer_phone` varchar(20) NOT NULL COMMENT 'å®¢æ·ææºå·', |
| | | `wechat_openid` varchar(100) DEFAULT NULL COMMENT '微信OpenID', |
| | | `wechat_nickname` varchar(100) DEFAULT NULL COMMENT '微信æµç§°', |
| | | `wechat_avatar` varchar(500) DEFAULT NULL COMMENT '微信头å', |
| | | `wechat_phone` varchar(20) DEFAULT NULL COMMENT '微信ç»å®ææºå·', |
| | | `total_score` decimal(3,1) DEFAULT NULL COMMENT 'æ»è¯å', |
| | | `evaluation_status` char(1) DEFAULT '0' COMMENT 'è¯ä»·ç¶æï¼0å¾
è¯ä»· 1å·²è¯ä»·ï¼', |
| | | `evaluation_time` datetime DEFAULT NULL COMMENT 'è¯ä»·æ¶é´', |
| | | `ip_address` varchar(128) DEFAULT NULL COMMENT 'IPå°å', |
| | | `user_agent` varchar(500) DEFAULT NULL COMMENT 'ç¨æ·ä»£ç', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | PRIMARY KEY (`evaluation_id`), |
| | | KEY `idx_vehicle_no` (`vehicle_no`), |
| | | KEY `idx_customer_phone` (`customer_phone`), |
| | | KEY `idx_wechat_openid` (`wechat_openid`), |
| | | KEY `idx_evaluation_time` (`evaluation_time`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客æ·è¯ä»·è¡¨'; |
| | | |
| | | -- 3. è¯ä»·è¯¦æ
表 |
| | | DROP TABLE IF EXISTS `evaluation_detail`; |
| | | CREATE TABLE `evaluation_detail` ( |
| | | `detail_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '详æ
ID', |
| | | `evaluation_id` bigint(20) NOT NULL COMMENT 'è¯ä»·ID', |
| | | `dimension_id` bigint(20) NOT NULL COMMENT '维度ID', |
| | | `score` int(11) DEFAULT NULL COMMENT 'è¯åï¼1-5æï¼', |
| | | `option_value` varchar(100) DEFAULT NULL COMMENT 'é项å¼ï¼éæ©ç±»åæ¶ä½¿ç¨ï¼', |
| | | `text_content` text COMMENT 'ææ¬å
å®¹ï¼ææ¬ç±»åæ¶ä½¿ç¨ï¼', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | PRIMARY KEY (`detail_id`), |
| | | KEY `idx_evaluation_id` (`evaluation_id`), |
| | | KEY `idx_dimension_id` (`dimension_id`), |
| | | CONSTRAINT `fk_evaluation_detail_evaluation` FOREIGN KEY (`evaluation_id`) REFERENCES `customer_evaluation` (`evaluation_id`) ON DELETE CASCADE, |
| | | CONSTRAINT `fk_evaluation_detail_dimension` FOREIGN KEY (`dimension_id`) REFERENCES `evaluation_dimension` (`dimension_id`) ON DELETE CASCADE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='è¯ä»·è¯¦æ
表'; |
| | | |
| | | -- 4. 车è¾è¯ä»·äºç»´ç 表 |
| | | DROP TABLE IF EXISTS `vehicle_evaluation_qrcode`; |
| | | CREATE TABLE `vehicle_evaluation_qrcode` ( |
| | | `qrcode_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'äºç»´ç ID', |
| | | `vehicle_no` varchar(20) NOT NULL COMMENT '车çå·', |
| | | `qrcode_url` varchar(500) NOT NULL COMMENT 'äºç»´ç URL', |
| | | `qrcode_content` varchar(500) NOT NULL COMMENT 'äºç»´ç å
容', |
| | | `qrcode_image` varchar(8000) DEFAULT NULL COMMENT 'äºç»´ç å¾ç(base64æ ¼å¼)', |
| | | `status` char(1) DEFAULT '0' COMMENT 'ç¶æï¼0æ£å¸¸ 1åç¨ï¼', |
| | | `create_by` varchar(64) DEFAULT '' COMMENT 'å建è
', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_by` varchar(64) DEFAULT '' COMMENT 'æ´æ°è
', |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | PRIMARY KEY (`qrcode_id`), |
| | | UNIQUE KEY `uk_vehicle_no` (`vehicle_no`), |
| | | KEY `idx_status` (`status`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='车è¾è¯ä»·äºç»´ç 表'; |
| | | |
| | | -- æå
¥é»è®¤è¯ä»·ç»´åº¦æ°æ® |
| | | INSERT INTO `evaluation_dimension` (`dimension_name`, `dimension_desc`, `dimension_type`, `sort_order`, `is_required`, `status`, `create_by`, `create_time`, `remark`) VALUES |
| | | ('æå¡æåº¦', '叿ºæå¡æåº¦è¯ä»·', 'star', 1, '1', '0', 'admin', NOW(), '叿ºæå¡æåº¦æ¯å¦å好ãä¸ä¸'), |
| | | ('æ¶è´¹æ
åµ', 'æ¶è´¹æ¯å¦åçéæ', 'star', 2, '1', '0', 'admin', NOW(), 'æ¶è´¹æ¯å¦åçãéæï¼ææ ä¹±æ¶è´¹ç°è±¡'), |
| | | ('车è¾å«çç¶åµ', '车è¾å
é¨å«çæ
åµ', 'star', 3, '1', '0', 'admin', NOW(), '车è¾å
鍿¯å¦å¹²åæ´æ´'), |
| | | ('æ´ä½æ»¡æåº¦', 'æ´ä½æå¡æ»¡æåº¦', 'star', 4, '1', '0', 'admin', NOW(), '对æ´ä½æå¡ç满æåº¦è¯ä»·'), |
| | | ('å
¶ä»å»ºè®®', 'å
¶ä»æè§æå»ºè®®', 'text', 5, '0', '0', 'admin', NOW(), '客æ·çå
¶ä»æè§æå»ºè®®'); |
| | | |
| | | -- ä¸ºç°æè½¦è¾çæè¯ä»·äºç»´ç ï¼ç¤ºä¾æ°æ®ï¼ |
| | | -- 注æï¼å®é
ä½¿ç¨æ¶éè¦æ ¹æ®çå®çè½¦è¾æ°æ®æ¥çæ |
| | | -- INSERT INTO `vehicle_evaluation_qrcode` (`vehicle_no`, `qrcode_url`, `qrcode_content`, `status`, `create_by`, `create_time`) |
| | | -- SELECT vehicle_no, CONCAT('https://yourdomain.com/evaluation?vehicle=', vehicle_no), CONCAT('EVAL:', vehicle_no), '0', 'admin', NOW() |
| | | -- FROM tb_vehicle_info WHERE status = '0'; |
| | | |
| | | -- ä¿®æ¹qrcode_imageåæ®µé¿åº¦ä»¥æ¯æbase64æ ¼å¼åå¨ |
| | | ALTER TABLE `vehicle_evaluation_qrcode` MODIFY COLUMN `qrcode_image` varchar(8000) DEFAULT NULL COMMENT 'äºç»´ç å¾ç(base64æ ¼å¼)'; |
New file |
| | |
| | | -- å®¢æ·æ»¡æåº¦è¯ä»·åè½åå
¸æ°æ® |
| | | |
| | | -- è¯ä»·ç¶æåå
¸ç±»å |
| | | INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, remark) |
| | | VALUES ('è¯ä»·ç¶æ', 'evaluation_status', '0', 'admin', sysdate(), '客æ·è¯ä»·ç¶æå表'); |
| | | |
| | | -- è¯ä»·ç¶æåå
¸æ°æ® |
| | | INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark) |
| | | VALUES (1, 'å¾
è¯ä»·', '0', 'evaluation_status', '', 'info', 'Y', '0', 'admin', sysdate(), 'å¾
è¯ä»·ç¶æ'); |
| | | |
| | | INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark) |
| | | VALUES (2, 'å·²è¯ä»·', '1', 'evaluation_status', '', 'success', 'N', '0', 'admin', sysdate(), 'å·²è¯ä»·ç¶æ'); |
| | | |
| | | -- è¯ä»·ç»´åº¦ç±»ååå
¸ç±»å |
| | | INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, remark) |
| | | VALUES ('è¯ä»·ç»´åº¦ç±»å', 'dimension_type', '0', 'admin', sysdate(), 'è¯ä»·ç»´åº¦ç±»åå表'); |
| | | |
| | | -- è¯ä»·ç»´åº¦ç±»ååå
¸æ°æ® |
| | | INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark) |
| | | VALUES (1, 'æçº§è¯ä»·', 'star', 'dimension_type', '', 'primary', 'Y', '0', 'admin', sysdate(), 'æçº§è¯ä»·ç±»å'); |
| | | |
| | | INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark) |
| | | VALUES (2, 'éæ©è¯ä»·', 'select', 'dimension_type', '', 'success', 'N', '0', 'admin', sysdate(), 'éæ©è¯ä»·ç±»å'); |
| | | |
| | | INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark) |
| | | VALUES (3, 'ææ¬è¯ä»·', 'text', 'dimension_type', '', 'warning', 'N', '0', 'admin', sysdate(), 'ææ¬è¯ä»·ç±»å'); |
New file |
| | |
| | | -- å®¢æ·æ»¡æåº¦è¯ä»·ç®¡çèå SQL |
| | | |
| | | -- 1. è¯ä»·ç®¡ç主èå |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('è¯ä»·ç®¡ç', '0', '6', 'evaluation', null, 1, 0, 'M', '0', '0', null, 'star', 'admin', sysdate(), '', null, 'å®¢æ·æ»¡æåº¦è¯ä»·ç®¡çç®å½'); |
| | | |
| | | -- è·åè¯ä»·ç®¡ç主èåID |
| | | SELECT @evaluationParentId := LAST_INSERT_ID(); |
| | | |
| | | -- 2. 客æ·è¯ä»·èå |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('客æ·è¯ä»·', @evaluationParentId, '1', 'customer', 'evaluation/customer/index', 1, 0, 'C', '0', '0', 'evaluation:customer:list', 'message', 'admin', sysdate(), '', null, '客æ·è¯ä»·èå'); |
| | | |
| | | -- è·å客æ·è¯ä»·èåID |
| | | SELECT @customerParentId := LAST_INSERT_ID(); |
| | | |
| | | -- 客æ·è¯ä»·æé®æé |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('客æ·è¯ä»·æ¥è¯¢', @customerParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:customer:query', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('客æ·è¯ä»·å é¤', @customerParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:customer:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('客æ·è¯ä»·å¯¼åº', @customerParentId, '3', '#', '', 1, 0, 'F', '0', '0', 'evaluation:customer:export', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | -- 3. è¯ä»·ç»´åº¦é
ç½®èå |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('è¯ä»·ç»´åº¦', @evaluationParentId, '2', 'dimension', 'evaluation/dimension/index', 1, 0, 'C', '0', '0', 'evaluation:dimension:list', 'edit', 'admin', sysdate(), '', null, 'è¯ä»·ç»´åº¦é
ç½®èå'); |
| | | |
| | | -- è·åè¯ä»·ç»´åº¦èåID |
| | | SELECT @dimensionParentId := LAST_INSERT_ID(); |
| | | |
| | | -- è¯ä»·ç»´åº¦æé®æé |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('è¯ä»·ç»´åº¦æ¥è¯¢', @dimensionParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension:query', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('è¯ä»·ç»´åº¦æ°å¢', @dimensionParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension:add', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('è¯ä»·ç»´åº¦ä¿®æ¹', @dimensionParentId, '3', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension:edit', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('è¯ä»·ç»´åº¦å é¤', @dimensionParentId, '4', '#', '', 1, 0, 'F', '0', '0', 'evaluation:dimension:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | -- 4. 车è¾äºç»´ç 管çèå |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('车è¾äºç»´ç ', @evaluationParentId, '3', 'qrcode', 'evaluation/qrcode/index', 1, 0, 'C', '0', '0', 'evaluation:qrcode:list', 'qrcode', 'admin', sysdate(), '', null, '车è¾è¯ä»·äºç»´ç 管çèå'); |
| | | |
| | | -- è·å车è¾äºç»´ç èåID |
| | | SELECT @qrcodeParentId := LAST_INSERT_ID(); |
| | | |
| | | -- 车è¾äºç»´ç æé®æé |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('äºç»´ç æ¥è¯¢', @qrcodeParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode:query', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('äºç»´ç çæ', @qrcodeParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode:generate', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('æ¹éçæ', @qrcodeParentId, '3', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode:batch', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('äºç»´ç å é¤', @qrcodeParentId, '4', '#', '', 1, 0, 'F', '0', '0', 'evaluation:qrcode:remove', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | -- 5. è¯ä»·ç»è®¡èå |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('è¯ä»·ç»è®¡', @evaluationParentId, '4', 'statistics', 'evaluation/statistics/index', 1, 0, 'C', '0', '0', 'evaluation:statistics:list', 'chart', 'admin', sysdate(), '', null, 'è¯ä»·ç»è®¡åæèå'); |
| | | |
| | | -- è·åè¯ä»·ç»è®¡èåID |
| | | SELECT @statisticsParentId := LAST_INSERT_ID(); |
| | | |
| | | -- è¯ä»·ç»è®¡æé®æé |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('ç»è®¡æ¥è¯¢', @statisticsParentId, '1', '#', '', 1, 0, 'F', '0', '0', 'evaluation:statistics:query', '#', 'admin', sysdate(), '', null, ''); |
| | | |
| | | insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) |
| | | values('ç»è®¡å¯¼åº', @statisticsParentId, '2', '#', '', 1, 0, 'F', '0', '0', 'evaluation:statistics:export', '#', 'admin', sysdate(), '', null, ''); |
| | |
| | | |
| | | -- å¨tb_vehicle_gpsè¡¨ä¸æ·»å device_idåæ®µ |
| | | ALTER TABLE tb_vehicle_gps ADD COLUMN device_id VARCHAR(50) DEFAULT NULL COMMENT '设å¤ID'; |
| | | |
| | | -- å¨tb_vehicle_infoè¡¨ä¸æ·»å dept_idåæ®µ |
| | | ALTER TABLE tb_vehicle_info ADD COLUMN dept_id BIGINT(20) DEFAULT NULL COMMENT 'å½å±é¨é¨ID'; |
New file |
| | |
| | | # å®¢æ·æ»¡æåº¦è¯ä»·åè½å®æ´é¨ç½²æå |
| | | |
| | | ## ð é¨ç½²æ¸
å |
| | | |
| | | ### 1. æ°æ®åºèæ¬æ§è¡é¡ºåº |
| | | ```sql |
| | | -- 1. æ§è¡æ°æ®åºè¡¨ç»æ |
| | | source sql/customer_evaluation_tables.sql |
| | | |
| | | -- 2. æ§è¡èåé
ç½® |
| | | source sql/evaluation_menu.sql |
| | | |
| | | -- 3. æ§è¡åå
¸é
ç½® |
| | | source sql/evaluation_dict.sql |
| | | ``` |
| | | |
| | | ### 2. å端é
ç½® |
| | | |
| | | #### 2.1 微信é
ç½®ï¼å¯éï¼ |
| | | å¨ `ruoyi-admin/src/main/resources/application.yml` ä¸é
ç½®ï¼ |
| | | ```yaml |
| | | wechat: |
| | | appId: your_wechat_appid |
| | | appSecret: your_wechat_appsecret |
| | | redirectUri: http://yourdomain.com/evaluation |
| | | ``` |
| | | |
| | | #### 2.2 æä»¶ä¸ä¼ è·¯å¾é
ç½® |
| | | ç¡®ä¿ `ruoyi.profile` é
ç½®çè·¯å¾æåå
¥æéï¼ |
| | | ```yaml |
| | | ruoyi: |
| | | profile: /path/to/upload |
| | | ``` |
| | | |
| | | ### 3. å端é
ç½® |
| | | |
| | | #### 3.1 è·¯ç±é
ç½® |
| | | å·²å¨ `ruoyi-ui/src/router/index.js` 䏿·»å è¯ä»·ç¸å
³è·¯ç±ã |
| | | |
| | | #### 3.2 页é¢ç»ä»¶ |
| | | å·²å建以ä¸é¡µé¢ç»ä»¶ï¼ |
| | | - `ruoyi-ui/src/views/evaluation/index.vue` - 客æ·è¯ä»·é¡µé¢ |
| | | - `ruoyi-ui/src/views/evaluation/test.vue` - æµè¯é¡µé¢ |
| | | - `ruoyi-ui/src/views/evaluation/customer/index.vue` - 客æ·è¯ä»·ç®¡ç |
| | | - `ruoyi-ui/src/views/evaluation/dimension/index.vue` - è¯ä»·ç»´åº¦é
ç½® |
| | | - `ruoyi-ui/src/views/evaluation/qrcode/index.vue` - 车è¾äºç»´ç 管ç |
| | | |
| | | ## ð é¨ç½²æ¥éª¤ |
| | | |
| | | ### æ¥éª¤1ï¼æ§è¡æ°æ®åºèæ¬ |
| | | ```bash |
| | | # è¿æ¥æ°æ®åº |
| | | mysql -u username -p database_name |
| | | |
| | | # æ§è¡èæ¬ |
| | | source sql/customer_evaluation_tables.sql |
| | | source sql/evaluation_menu.sql |
| | | source sql/evaluation_dict.sql |
| | | ``` |
| | | |
| | | ### æ¥éª¤2ï¼ç¼è¯åç«¯é¡¹ç® |
| | | ```bash |
| | | # å¨é¡¹ç®æ ¹ç®å½æ§è¡ |
| | | mvn clean install |
| | | ``` |
| | | |
| | | ### æ¥éª¤3ï¼å¯å¨å端æå¡ |
| | | ```bash |
| | | cd ruoyi-admin |
| | | mvn spring-boot:run |
| | | ``` |
| | | |
| | | ### æ¥éª¤4ï¼ç¼è¯åç«¯é¡¹ç® |
| | | ```bash |
| | | cd ruoyi-ui |
| | | npm install |
| | | npm run dev |
| | | ``` |
| | | |
| | | ## 𧪠åè½æµè¯ |
| | | |
| | | ### 1. 访é®ç®¡ççé¢ |
| | | - ç»å½ç³»ç»åï¼å¨å·¦ä¾§èåä¸å¯ä»¥çå°"è¯ä»·ç®¡ç"èå |
| | | - å
å«ä»¥ä¸åèåï¼ |
| | | - 客æ·è¯ä»· |
| | | - è¯ä»·ç»´åº¦ |
| | | - 车è¾äºç»´ç |
| | | - è¯ä»·ç»è®¡ |
| | | |
| | | ### 2. æµè¯è¯ä»·åè½ |
| | | - 访é®ï¼`http://localhost:80/evaluation/test` |
| | | - æµè¯äºç»´ç çæãè¯ä»·ç»´åº¦å è½½ãè¯ä»·æäº¤çåè½ |
| | | |
| | | ### 3. æµè¯è¯ä»·é¡µé¢ |
| | | - 访é®ï¼`http://localhost:80/evaluation?vehicle=粤A12345` |
| | | - å¡«åè¯ä»·ä¿¡æ¯å¹¶æäº¤ |
| | | |
| | | ## ð± 微信é
ç½®ï¼ç产ç¯å¢ï¼ |
| | | |
| | | ### 1. 微信å
¬ä¼å¹³å°é
ç½® |
| | | 1. ç»å½å¾®ä¿¡å
¬ä¼å¹³å° |
| | | 2. è¿å
¥"å¼å" -> "æ¥å£æé" |
| | | 3. é
ç½®ç½é¡µææååï¼`yourdomain.com` |
| | | 4. é
ç½®JSæ¥å£å®å
¨ååï¼`yourdomain.com` |
| | | |
| | | ### 2. ååé
ç½® |
| | | - ç¡®ä¿åå已夿¡ |
| | | - é
ç½®HTTPSè¯ä¹¦ |
| | | - æ´æ°é
ç½®æä»¶ä¸çåå |
| | | |
| | | ## ð§ æéé
ç½® |
| | | |
| | | ### 1. è§è²æé |
| | | ç³»ç»ç®¡çåéè¦ä¸ºç¸å
³è§è²åé
以䏿éï¼ |
| | | - `evaluation:customer:list` - 客æ·è¯ä»·æ¥è¯¢ |
| | | - `evaluation:customer:remove` - 客æ·è¯ä»·å é¤ |
| | | - `evaluation:customer:export` - 客æ·è¯ä»·å¯¼åº |
| | | - `evaluation:dimension:list` - è¯ä»·ç»´åº¦æ¥è¯¢ |
| | | - `evaluation:dimension:add` - è¯ä»·ç»´åº¦æ°å¢ |
| | | - `evaluation:dimension:edit` - è¯ä»·ç»´åº¦ä¿®æ¹ |
| | | - `evaluation:dimension:remove` - è¯ä»·ç»´åº¦å é¤ |
| | | - `evaluation:qrcode:list` - äºç»´ç æ¥è¯¢ |
| | | - `evaluation:qrcode:generate` - äºç»´ç çæ |
| | | - `evaluation:qrcode:batch` - æ¹éçæäºç»´ç |
| | | - `evaluation:qrcode:remove` - äºç»´ç å é¤ |
| | | |
| | | ### 2. èåæé |
| | | èåæéå·²éè¿SQLèæ¬èªå¨é
ç½®ã |
| | | |
| | | ## ð æ°æ®éªè¯ |
| | | |
| | | ### 1. æ£æ¥æ°æ®åºè¡¨ |
| | | ```sql |
| | | -- æ£æ¥è¡¨æ¯å¦å建æå |
| | | SHOW TABLES LIKE '%evaluation%'; |
| | | |
| | | -- æ£æ¥è忝妿·»å æå |
| | | SELECT * FROM sys_menu WHERE menu_name LIKE '%è¯ä»·%'; |
| | | |
| | | -- æ£æ¥åå
¸æ¯å¦æ·»å æå |
| | | SELECT * FROM sys_dict_type WHERE dict_type IN ('evaluation_status', 'dimension_type'); |
| | | ``` |
| | | |
| | | ### 2. æ£æ¥é»è®¤æ°æ® |
| | | ```sql |
| | | -- æ£æ¥è¯ä»·ç»´åº¦é»è®¤æ°æ® |
| | | SELECT * FROM evaluation_dimension; |
| | | |
| | | -- åºè¯¥çå°5æ¡é»è®¤è¯ä»·ç»´åº¦æ°æ® |
| | | ``` |
| | | |
| | | ## ð 常è§é®é¢ |
| | | |
| | | ### 1. èå䏿¾ç¤º |
| | | **åå **ï¼å¯è½æ¯æéé®é¢æèåæ°æ®æªæ£ç¡®æå
¥ |
| | | **è§£å³**ï¼ |
| | | - æ£æ¥ç¨æ·è§è²æé |
| | | - éæ°æ§è¡èåSQLèæ¬ |
| | | - æ¸
餿µè§å¨ç¼å |
| | | |
| | | ### 2. äºç»´ç çæå¤±è´¥ |
| | | **åå **ï¼æä»¶è·¯å¾æéé®é¢ |
| | | **è§£å³**ï¼ |
| | | - æ£æ¥ `ruoyi.profile` é
ç½®çè·¯å¾ |
| | | - ç¡®ä¿ç®å½æåå
¥æé |
| | | - æ£æ¥ç£çç©ºé´ |
| | | |
| | | ### 3. è¯ä»·æäº¤å¤±è´¥ |
| | | **åå **ï¼å¯è½æ¯å¿
å¡«åæ®µéªè¯å¤±è´¥ |
| | | **è§£å³**ï¼ |
| | | - æ£æ¥è¯ä»·ç»´åº¦é
ç½® |
| | | - ç¡®ä¿ææå¿
å¡«åæ®µé½å·²å¡«å |
| | | - æ¥çå端æ¥å¿ |
| | | |
| | | ### 4. 微信ææå¤±è´¥ |
| | | **åå **ï¼å¾®ä¿¡é
ç½®é®é¢ |
| | | **è§£å³**ï¼ |
| | | - æ£æ¥AppIDåAppSecreté
ç½® |
| | | - 确认ååé
ç½®æ£ç¡® |
| | | - æ£æ¥HTTPSè¯ä¹¦ |
| | | |
| | | ## ð æ§è½ä¼å建议 |
| | | |
| | | ### 1. æ°æ®åºä¼å |
| | | ```sql |
| | | -- æ·»å ç´¢å¼ |
| | | CREATE INDEX idx_evaluation_vehicle_time ON customer_evaluation(vehicle_no, evaluation_time); |
| | | CREATE INDEX idx_evaluation_status ON customer_evaluation(evaluation_status); |
| | | CREATE INDEX idx_evaluation_detail_evaluation ON evaluation_detail(evaluation_id); |
| | | ``` |
| | | |
| | | ### 2. ç¼åé
ç½® |
| | | - è¯ä»·ç»´åº¦é
ç½®å¯ä»¥ç¼å |
| | | - äºç»´ç å¾ç使ç¨CDNå é |
| | | |
| | | ### 3. æä»¶åå¨ |
| | | - èè使ç¨å¯¹è±¡åå¨æå¡ |
| | | - 宿æ¸
çæ ç¨çäºç»´ç æä»¶ |
| | | |
| | | ## ð ææ¯æ¯æ |
| | | |
| | | å¦éå°é®é¢ï¼è¯·æä¾ï¼ |
| | | 1. é误æ¥å¿ |
| | | 2. æä½æ¥éª¤ |
| | | 3. ç¯å¢ä¿¡æ¯ |
| | | 4. é误æªå¾ |
| | | |
| | | ## ð¯ åè½æ©å± |
| | | |
| | | ### 1. è¯ä»·ç»è®¡ |
| | | å¯ä»¥åºäºç°ææ°æ®å¼åï¼ |
| | | - è¯ä»·è¶å¿åæ |
| | | - 车è¾è¯ä»·æè¡ |
| | | - å®¢æ·æ»¡æåº¦æ¥å |
| | | |
| | | ### 2. æ¶æ¯éç¥ |
| | | - è¯ä»·æäº¤ååééç¥ |
| | | - ä½åè¯ä»·é¢è¦ |
| | | - 宿è¯ä»·æ¥å |
| | | |
| | | ### 3. å¤è¯è¨æ¯æ |
| | | - æ¯æå¤è¯è¨è¯ä»·çé¢ |
| | | - å½é
åé
ç½® |
| | | |
| | | åè½å·²å
¨é¨å¼å宿ï¼å¯ä»¥æ£å¸¸ä½¿ç¨ï¼ |
New file |
| | |
| | | # å®¢æ·æ»¡æåº¦è¯ä»·åè½è¯´æ |
| | | |
| | | ## åè½æ¦è¿° |
| | | |
| | | å®¢æ·æ»¡æåº¦è¯ä»·åè½å
许客æ·éè¿æ«æäºç»´ç è¿å
¥è¯ä»·çé¢ï¼å¯¹æå¡è¿è¡å¤ç»´åº¦è¯ä»·ãæ¯æå¾®ä¿¡ç¯å¢ä¸çç¨æ·ä¿¡æ¯è·ååè¯ä»·æäº¤ã |
| | | |
| | | ## 主è¦åè½ |
| | | |
| | | ### 1. äºç»´ç çæ |
| | | - 为æ¯è¾è½¦çæå¯ä¸çè¯ä»·äºç»´ç |
| | | - äºç»´ç å
å«è½¦çå·ä¿¡æ¯ï¼ç¨äºå
³èå
·ä½è½¦è¾æå¡ |
| | | - æ¯ææ¹éçæäºç»´ç |
| | | |
| | | ### 2. å¾®ä¿¡éæ |
| | | - èªå¨æ£æµå¾®ä¿¡æµè§å¨ç¯å¢ |
| | | - è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯ï¼OpenIDãæµç§°ã头åçï¼ |
| | | - æ¯æå¾®ä¿¡ç½é¡µæææµç¨ |
| | | |
| | | ### 3. è¯ä»·çé¢ |
| | | - ååºå¼è®¾è®¡ï¼éé
ç§»å¨ç«¯å微信æµè§å¨ |
| | | - æ¯æå¤ç§è¯ä»·ç±»åï¼æçº§è¯ä»·ãéæ©è¯ä»·ãææ¬è¯ä»· |
| | | - 客æ·ä¿¡æ¯æ¶éï¼å§åãææºå·å¿
å¡«ï¼ |
| | | - è¯ä»·ç»´åº¦å¯é
ç½® |
| | | |
| | | ### 4. è¯ä»·æäº¤ |
| | | - æ°æ®éªè¯å宿´æ§æ£æ¥ |
| | | - æ ¹æ®è¯åæ¾ç¤ºä¸åçåé¦ä¿¡æ¯ |
| | | - è¯ä»·æ°æ®åå¨åç»è®¡ |
| | | |
| | | ## æ°æ®åºè¡¨ç»æ |
| | | |
| | | ### 1. evaluation_dimensionï¼è¯ä»·ç»´åº¦é
ç½®è¡¨ï¼ |
| | | - é
ç½®è¯ä»·ç»´åº¦åç§°ãç±»åãæ¯å¦å¿
å¡«ç |
| | | - æ¯ææçº§è¯ä»·ãéæ©è¯ä»·ãææ¬è¯ä»·ä¸ç§ç±»å |
| | | |
| | | ### 2. customer_evaluationï¼å®¢æ·è¯ä»·è¡¨ï¼ |
| | | - åå¨å®¢æ·åºæ¬ä¿¡æ¯åè¯ä»·ç»æ |
| | | - å
å«å¾®ä¿¡ç¨æ·ä¿¡æ¯ |
| | | - è®°å½è¯ä»·æ¶é´åIPå°å |
| | | |
| | | ### 3. evaluation_detailï¼è¯ä»·è¯¦æ
è¡¨ï¼ |
| | | - å卿¯ä¸ªç»´åº¦çå
·ä½è¯å |
| | | - å
³èè¯ä»·ç»´åº¦å客æ·è¯ä»· |
| | | |
| | | ### 4. vehicle_evaluation_qrcodeï¼è½¦è¾è¯ä»·äºç»´ç è¡¨ï¼ |
| | | - å卿¯è¾è½¦çäºç»´ç ä¿¡æ¯ |
| | | - å
å«äºç»´ç URLåå¾çè·¯å¾ |
| | | |
| | | ## APIæ¥å£ |
| | | |
| | | ### å
¬å¼æ¥å£ï¼æ é认è¯ï¼ |
| | | - `GET /evaluation/dimensions` - è·åè¯ä»·ç»´åº¦é
ç½® |
| | | - `POST /evaluation/submit` - æäº¤å®¢æ·è¯ä»· |
| | | - `GET /evaluation/wechat/userinfo` - è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯ |
| | | |
| | | ### ç®¡çæ¥å£ï¼éè¦è®¤è¯ï¼ |
| | | - `GET /evaluation/list` - æ¥è¯¢å®¢æ·è¯ä»·å表 |
| | | - `GET /evaluation/{id}` - è·åè¯ä»·è¯¦æ
|
| | | - `POST /evaluation/qrcode/{vehicleNo}` - çæè½¦è¾äºç»´ç |
| | | - `POST /evaluation/qrcode/batch` - æ¹éçæäºç»´ç |
| | | |
| | | ## é¨ç½²è¯´æ |
| | | |
| | | ### 1. æ°æ®åºåå§å |
| | | ```sql |
| | | -- æ§è¡ sql/customer_evaluation_tables.sql æä»¶ |
| | | -- å建ç¸å
³è¡¨ååå§æ°æ® |
| | | ``` |
| | | |
| | | ### 2. é
ç½®æä»¶ |
| | | å¨ `application.yml` ä¸é
ç½®ï¼ |
| | | ```yaml |
| | | # 微信é
ç½® |
| | | wechat: |
| | | appId: your_wechat_appid |
| | | appSecret: your_wechat_appsecret |
| | | |
| | | # æä»¶ä¸ä¼ è·¯å¾ |
| | | ruoyi: |
| | | profile: /path/to/upload |
| | | ``` |
| | | |
| | | ### 3. å端路ç±é
ç½® |
| | | å¨ `router/index.js` 䏿·»å è¯ä»·é¡µé¢è·¯ç±ï¼ |
| | | ```javascript |
| | | { |
| | | path: '/evaluation', |
| | | component: () => import('@/views/evaluation/index'), |
| | | name: 'Evaluation' |
| | | } |
| | | ``` |
| | | |
| | | ## ä½¿ç¨æµç¨ |
| | | |
| | | ### 1. 管çåæä½ |
| | | 1. é
ç½®è¯ä»·ç»´åº¦ï¼æå¡æåº¦ãæ¶è´¹æ
åµã车è¾å«ççï¼ |
| | | 2. 为车è¾çæè¯ä»·äºç»´ç |
| | | 3. å°äºç»´ç æå°å¹¶è´´å¨è½¦è¾ä¸ |
| | | |
| | | ### 2. 客æ·è¯ä»·æµç¨ |
| | | 1. å®¢æ·æ«æè½¦è¾ä¸çäºç»´ç |
| | | 2. ç³»ç»è§£æäºç»´ç ï¼è·å车çå· |
| | | 3. è¿å
¥è¯ä»·é¡µé¢ï¼è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯ï¼å¦æå¨å¾®ä¿¡ç¯å¢ä¸ï¼ |
| | | 4. 客æ·å¡«å个人信æ¯åè¯ä»·å
容 |
| | | 5. æäº¤è¯ä»·ï¼æ¾ç¤ºç»æé¡µé¢ |
| | | |
| | | ## æµè¯åè½ |
| | | |
| | | è®¿é® `/evaluation/test` 页é¢å¯ä»¥æµè¯ä»¥ä¸åè½ï¼ |
| | | - äºç»´ç çæ |
| | | - è¯ä»·ç»´åº¦å è½½ |
| | | - è¯ä»·æäº¤ |
| | | - ç´æ¥è®¿é®è¯ä»·é¡µé¢ |
| | | |
| | | ## 注æäºé¡¹ |
| | | |
| | | 1. **微信é
ç½®**ï¼éè¦é
ç½®æ£ç¡®ç微信AppIDåAppSecret |
| | | 2. **æä»¶æé**ï¼ç¡®ä¿ä¸ä¼ ç®å½æåå
¥æé |
| | | 3. **HTTPS**ï¼å¾®ä¿¡ææéè¦HTTPSç¯å¢ |
| | | 4. **ååé
ç½®**ï¼å¨å¾®ä¿¡å
¬ä¼å¹³å°é
ç½®ææåå |
| | | |
| | | ## æ©å±åè½ |
| | | |
| | | 1. **è¯ä»·ç»è®¡**ï¼å¯ä»¥åºäºç°ææ°æ®å¼åè¯ä»·ç»è®¡åæåè½ |
| | | 2. **æ¶æ¯éç¥**ï¼è¯ä»·æäº¤åå¯ä»¥åééç¥ç»ç¸å
³äººå |
| | | 3. **è¯ä»·å¯¼åº**ï¼æ¯æè¯ä»·æ°æ®çExcelå¯¼åº |
| | | 4. **å¤è¯è¨æ¯æ**ï¼å¯ä»¥æ©å±å¤è¯è¨è¯ä»·çé¢ |
| | | |
| | | ## ææ¯æ |
| | | |
| | | - å端ï¼Spring Boot + MyBatis + MySQL |
| | | - å端ï¼Vue.js + Element UI |
| | | - äºç»´ç ï¼ZXing |
| | | - 微信ï¼å¾®ä¿¡ç½é¡µææAPI |
New file |
| | |
| | | # å®¢æ·æ»¡æåº¦è¯ä»·åè½æµè¯æ¥éª¤ |
| | | |
| | | ## 1. å¯å¨é¡¹ç® |
| | | |
| | | ### å端å¯å¨ |
| | | ```bash |
| | | # å¨é¡¹ç®æ ¹ç®å½æ§è¡ |
| | | mvn clean install |
| | | cd ruoyi-admin |
| | | mvn spring-boot:run |
| | | ``` |
| | | |
| | | ### å端å¯å¨ |
| | | ```bash |
| | | # å¨ ruoyi-ui ç®å½æ§è¡ |
| | | npm install |
| | | npm run dev |
| | | ``` |
| | | |
| | | ## 2. é
ç½®å¾®ä¿¡åæ°ï¼å¯éï¼ |
| | | |
| | | 妿ä¸éè¦å¾®ä¿¡åè½ï¼å¯ä»¥è·³è¿æ¤æ¥éª¤ã |
| | | |
| | | å¨ `ruoyi-admin/src/main/resources/application.yml` ä¸é
ç½®ï¼ |
| | | ```yaml |
| | | wechat: |
| | | appId: your_wechat_appid |
| | | appSecret: your_wechat_appsecret |
| | | redirectUri: http://localhost:8080/evaluation |
| | | ``` |
| | | |
| | | ## 3. æµè¯æ¥éª¤ |
| | | |
| | | ### æ¥éª¤1ï¼è®¿é®æµè¯é¡µé¢ |
| | | æå¼æµè§å¨è®¿é®ï¼`http://localhost:80/evaluation/test` |
| | | |
| | | ### æ¥éª¤2ï¼æµè¯äºç»´ç çæ |
| | | 1. 卿µè¯é¡µé¢è¾å
¥è½¦çå·ï¼å¦ï¼ç²¤A12345ï¼ |
| | | 2. ç¹å»"çæäºç»´ç "æé® |
| | | 3. æ¥çæ¯å¦æåçæäºç»´ç ä¿¡æ¯ |
| | | |
| | | ### æ¥éª¤3ï¼æµè¯è¯ä»·ç»´åº¦å è½½ |
| | | 1. ç¹å»"å è½½è¯ä»·ç»´åº¦"æé® |
| | | 2. æ¥çæ¯å¦æåå è½½è¯ä»·ç»´åº¦å表 |
| | | |
| | | ### æ¥éª¤4ï¼æµè¯è¯ä»·æäº¤ |
| | | 1. å¡«åæµè¯è¯ä»·ä¿¡æ¯ |
| | | 2. ç¹å»"æäº¤æµè¯è¯ä»·"æé® |
| | | 3. æ¥çæ¯å¦æåæäº¤ |
| | | |
| | | ### æ¥éª¤5ï¼æµè¯è¯ä»·é¡µé¢ |
| | | 1. ç¹å»"ç´æ¥è®¿é®è¯ä»·é¡µé¢"龿¥ |
| | | 2. æç´æ¥è®¿é®ï¼`http://localhost:80/evaluation?vehicle=粤A12345` |
| | | 3. å¡«åè¯ä»·ä¿¡æ¯å¹¶æäº¤ |
| | | |
| | | ## 4. é¢æç»æ |
| | | |
| | | ### äºç»´ç çææµè¯ |
| | | - åºè¯¥è¿åäºç»´ç URLãå
容åå¾çè·¯å¾ |
| | | - äºç»´ç URLæ ¼å¼ï¼`http://localhost:8080/evaluation?vehicle=车çå·` |
| | | |
| | | ### è¯ä»·ç»´åº¦æµè¯ |
| | | - åºè¯¥è¿åé»è®¤çè¯ä»·ç»´åº¦ï¼ |
| | | - æå¡æåº¦ï¼æçº§è¯ä»·ï¼å¿
å¡«ï¼ |
| | | - æ¶è´¹æ
åµï¼æçº§è¯ä»·ï¼å¿
å¡«ï¼ |
| | | - 车è¾å«çç¶åµï¼æçº§è¯ä»·ï¼å¿
å¡«ï¼ |
| | | - æ´ä½æ»¡æåº¦ï¼æçº§è¯ä»·ï¼å¿
å¡«ï¼ |
| | | - å
¶ä»å»ºè®®ï¼ææ¬è¯ä»·ï¼éå¿
å¡«ï¼ |
| | | |
| | | ### è¯ä»·æäº¤æµè¯ |
| | | - åºè¯¥è¿åæåæ¶æ¯ |
| | | - æ°æ®åºä¸åºè¯¥ä¿åè¯ä»·è®°å½ |
| | | |
| | | ### è¯ä»·é¡µé¢æµè¯ |
| | | - 页é¢åºè¯¥æ£å¸¸æ¾ç¤º |
| | | - 表åéªè¯åºè¯¥æ£å¸¸å·¥ä½ |
| | | - æäº¤ååºè¯¥æ¾ç¤ºæåé¡µé¢ |
| | | |
| | | ## 5. 常è§é®é¢ |
| | | |
| | | ### é®é¢1ï¼äºç»´ç çæå¤±è´¥ |
| | | **åå **ï¼å¯è½æ¯æä»¶è·¯å¾æéé®é¢ |
| | | **è§£å³**ï¼æ£æ¥ `ruoyi.profile` é
ç½®çè·¯å¾æ¯å¦æåå
¥æé |
| | | |
| | | ### é®é¢2ï¼è¯ä»·ç»´åº¦å 载失败 |
| | | **åå **ï¼å¯è½æ¯æ°æ®åºè¿æ¥é®é¢ |
| | | **è§£å³**ï¼æ£æ¥æ°æ®åºè¿æ¥é
ç½® |
| | | |
| | | ### é®é¢3ï¼è¯ä»·æäº¤å¤±è´¥ |
| | | **åå **ï¼å¯è½æ¯å¿
å¡«åæ®µéªè¯å¤±è´¥ |
| | | **è§£å³**ï¼ç¡®ä¿ææå¿
å¡«åæ®µé½å·²å¡«å |
| | | |
| | | ### é®é¢4ï¼é¡µé¢è®¿é®404 |
| | | **åå **ï¼å¯è½æ¯è·¯ç±é
ç½®é®é¢ |
| | | **è§£å³**ï¼æ£æ¥å端路ç±é
ç½®æ¯å¦æ£ç¡® |
| | | |
| | | ## 6. æ°æ®åºéªè¯ |
| | | |
| | | å¯ä»¥æ§è¡ä»¥ä¸SQLæ¥è¯¢éªè¯æ°æ®ï¼ |
| | | |
| | | ```sql |
| | | -- æ¥çè¯ä»·ç»´åº¦é
ç½® |
| | | SELECT * FROM evaluation_dimension; |
| | | |
| | | -- æ¥ç客æ·è¯ä»·è®°å½ |
| | | SELECT * FROM customer_evaluation; |
| | | |
| | | -- æ¥çè¯ä»·è¯¦æ
|
| | | SELECT * FROM evaluation_detail; |
| | | |
| | | -- æ¥ç车è¾äºç»´ç |
| | | SELECT * FROM vehicle_evaluation_qrcode; |
| | | ``` |
| | | |
| | | ## 7. ç产ç¯å¢é¨ç½²æ³¨æäºé¡¹ |
| | | |
| | | 1. **HTTPSé
ç½®**ï¼å¾®ä¿¡ææéè¦HTTPSç¯å¢ |
| | | 2. **ååé
ç½®**ï¼å¨å¾®ä¿¡å
¬ä¼å¹³å°é
ç½®ææåå |
| | | 3. **æä»¶æé**ï¼ç¡®ä¿ä¸ä¼ ç®å½ææ£ç¡®ç读åæé |
| | | 4. **æ°æ®åºå¤ä»½**ï¼å®æå¤ä»½è¯ä»·æ°æ® |
| | | 5. **æ§è½ä¼å**ï¼å¤§éè¯ä»·æ°æ®æ¶èèå页åç´¢å¼ä¼å |
New file |
| | |
| | | # å®¢æ·æ»¡æåº¦è¯ä»·åè½é¨ç½²è¯´æ |
| | | |
| | | ## é¨ç½²ååå¤ |
| | | |
| | | ### 1. ç¯å¢è¦æ± |
| | | - JDK 1.8+ |
| | | - Maven 3.6+ |
| | | - MySQL 5.7+ |
| | | - Node.js 14+ |
| | | - Nginxï¼ç产ç¯å¢æ¨èï¼ |
| | | |
| | | ### 2. é
ç½®æä»¶ä¿®æ¹ |
| | | |
| | | #### æ°æ®åºé
ç½® |
| | | ä¿®æ¹ `ruoyi-admin/src/main/resources/application-prod.yml`ï¼ |
| | | ```yaml |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://your-db-host:3306/your-database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: your-username |
| | | password: your-password |
| | | ``` |
| | | |
| | | #### 微信é
ç½® |
| | | ä¿®æ¹ `ruoyi-admin/src/main/resources/application-prod.yml`ï¼ |
| | | ```yaml |
| | | wechat: |
| | | appId: your_wechat_appid |
| | | appSecret: your_wechat_appsecret |
| | | redirectUri: https://yourdomain.com/evaluation |
| | | ``` |
| | | |
| | | #### æä»¶ä¸ä¼ è·¯å¾ |
| | | ä¿®æ¹ `ruoyi-admin/src/main/resources/application-prod.yml`ï¼ |
| | | ```yaml |
| | | ruoyi: |
| | | profile: /path/to/upload |
| | | ``` |
| | | |
| | | ## é¨ç½²æ¥éª¤ |
| | | |
| | | ### 1. å端é¨ç½² |
| | | |
| | | #### æ¹å¼ä¸ï¼JARå
é¨ç½² |
| | | ```bash |
| | | # ç¼è¯æå
|
| | | mvn clean package -Pprod |
| | | |
| | | # ä¸ä¼ JARå
å°æå¡å¨ |
| | | scp ruoyi-admin/target/ruoyi-admin.jar user@server:/path/to/app/ |
| | | |
| | | # å¯å¨åºç¨ |
| | | java -jar ruoyi-admin.jar --spring.profiles.active=prod |
| | | ``` |
| | | |
| | | #### æ¹å¼äºï¼Dockeré¨ç½² |
| | | ```dockerfile |
| | | # Dockerfile |
| | | FROM openjdk:8-jre-alpine |
| | | COPY ruoyi-admin.jar app.jar |
| | | EXPOSE 8080 |
| | | ENTRYPOINT ["java", "-jar", "/app.jar"] |
| | | ``` |
| | | |
| | | ```bash |
| | | # æå»ºéå |
| | | docker build -t ruoyi-evaluation . |
| | | |
| | | # è¿è¡å®¹å¨ |
| | | docker run -d -p 8080:8080 --name ruoyi-evaluation ruoyi-evaluation |
| | | ``` |
| | | |
| | | ### 2. å端é¨ç½² |
| | | |
| | | #### æå»ºçäº§çæ¬ |
| | | ```bash |
| | | cd ruoyi-ui |
| | | npm install |
| | | npm run build:prod |
| | | ``` |
| | | |
| | | #### Nginxé
ç½® |
| | | ```nginx |
| | | server { |
| | | listen 80; |
| | | server_name yourdomain.com; |
| | | |
| | | # åç«¯éææä»¶ |
| | | location / { |
| | | root /path/to/ruoyi-ui/dist; |
| | | try_files $uri $uri/ /index.html; |
| | | } |
| | | |
| | | # å端API代ç |
| | | location /dev-api/ { |
| | | proxy_pass http://localhost:8080/; |
| | | proxy_set_header Host $host; |
| | | proxy_set_header X-Real-IP $remote_addr; |
| | | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| | | } |
| | | |
| | | # äºç»´ç å¾çè®¿é® |
| | | location /qrcode/ { |
| | | alias /path/to/upload/qrcode/; |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ### 3. æ°æ®åºé¨ç½² |
| | | |
| | | #### æ§è¡SQLèæ¬ |
| | | ```bash |
| | | mysql -u username -p database_name < sql/customer_evaluation_tables.sql |
| | | ``` |
| | | |
| | | #### åå»ºæ°æ®åºç¨æ·ï¼å¯éï¼ |
| | | ```sql |
| | | CREATE USER 'evaluation_user'@'%' IDENTIFIED BY 'password'; |
| | | GRANT SELECT, INSERT, UPDATE, DELETE ON database_name.* TO 'evaluation_user'@'%'; |
| | | FLUSH PRIVILEGES; |
| | | ``` |
| | | |
| | | ## 微信é
ç½® |
| | | |
| | | ### 1. 微信å
¬ä¼å¹³å°é
ç½® |
| | | |
| | | 1. ç»å½å¾®ä¿¡å
¬ä¼å¹³å° |
| | | 2. è¿å
¥"å¼å" -> "æ¥å£æé" |
| | | 3. é
ç½®ç½é¡µææååï¼`yourdomain.com` |
| | | 4. é
ç½®JSæ¥å£å®å
¨ååï¼`yourdomain.com` |
| | | |
| | | ### 2. æµè¯å¾®ä¿¡åè½ |
| | | |
| | | 1. å¨å¾®ä¿¡ä¸è®¿é®ï¼`https://yourdomain.com/evaluation?vehicle=粤A12345` |
| | | 2. ç¡®è®¤è½æ£å¸¸è·åå¾®ä¿¡ç¨æ·ä¿¡æ¯ |
| | | 3. æµè¯è¯ä»·æäº¤åè½ |
| | | |
| | | ## çæ§åç»´æ¤ |
| | | |
| | | ### 1. æ¥å¿çæ§ |
| | | ```bash |
| | | # æ¥çåºç¨æ¥å¿ |
| | | tail -f logs/sys-info.log |
| | | |
| | | # æ¥çé误æ¥å¿ |
| | | tail -f logs/sys-error.log |
| | | ``` |
| | | |
| | | ### 2. æ°æ®åºçæ§ |
| | | ```sql |
| | | -- æ¥çè¯ä»·ç»è®¡ |
| | | SELECT |
| | | vehicle_no, |
| | | COUNT(*) as total_count, |
| | | AVG(total_score) as avg_score |
| | | FROM customer_evaluation |
| | | WHERE evaluation_status = '1' |
| | | GROUP BY vehicle_no; |
| | | |
| | | -- æ¥ç仿¥è¯ä»·æ°é |
| | | SELECT COUNT(*) FROM customer_evaluation |
| | | WHERE DATE(evaluation_time) = CURDATE(); |
| | | ``` |
| | | |
| | | ### 3. æä»¶æ¸
ç |
| | | ```bash |
| | | # æ¸
çè¿æçäºç»´ç æä»¶ï¼å¯éï¼ |
| | | find /path/to/upload/qrcode/ -name "*.png" -mtime +30 -delete |
| | | ``` |
| | | |
| | | ## æ§è½ä¼å |
| | | |
| | | ### 1. æ°æ®åºä¼å |
| | | ```sql |
| | | -- æ·»å ç´¢å¼ |
| | | CREATE INDEX idx_evaluation_vehicle_time ON customer_evaluation(vehicle_no, evaluation_time); |
| | | CREATE INDEX idx_evaluation_status ON customer_evaluation(evaluation_status); |
| | | ``` |
| | | |
| | | ### 2. ç¼åé
ç½® |
| | | ```yaml |
| | | # Redisé
ç½® |
| | | spring: |
| | | redis: |
| | | host: your-redis-host |
| | | port: 6379 |
| | | database: 0 |
| | | timeout: 10s |
| | | ``` |
| | | |
| | | ### 3. æä»¶åå¨ä¼å |
| | | - 使ç¨CDNå éäºç»´ç å¾çè®¿é® |
| | | - 宿æ¸
çæ ç¨çäºç»´ç æä»¶ |
| | | - èè使ç¨å¯¹è±¡å卿å¡ï¼å¦é¿éäºOSSï¼ |
| | | |
| | | ## å®å
¨é
ç½® |
| | | |
| | | ### 1. HTTPSé
ç½® |
| | | ```nginx |
| | | server { |
| | | listen 443 ssl; |
| | | server_name yourdomain.com; |
| | | |
| | | ssl_certificate /path/to/cert.pem; |
| | | ssl_certificate_key /path/to/key.pem; |
| | | |
| | | # å
¶ä»é
ç½®... |
| | | } |
| | | ``` |
| | | |
| | | ### 2. æ¥å£å®å
¨ |
| | | - è¯ä»·æäº¤æ¥å£æ·»å é¢çéå¶ |
| | | - ææä¿¡æ¯å å¯åå¨ |
| | | - å®ææ´æ°å¾®ä¿¡AppSecret |
| | | |
| | | ### 3. æ°æ®å¤ä»½ |
| | | ```bash |
| | | # æ°æ®åºå¤ä»½ |
| | | mysqldump -u username -p database_name > backup_$(date +%Y%m%d).sql |
| | | |
| | | # æä»¶å¤ä»½ |
| | | tar -czf upload_backup_$(date +%Y%m%d).tar.gz /path/to/upload/ |
| | | ``` |
| | | |
| | | ## æ
éææ¥ |
| | | |
| | | ### 1. 常è§é®é¢ |
| | | |
| | | #### äºç»´ç çæå¤±è´¥ |
| | | - æ£æ¥æä»¶è·¯å¾æé |
| | | - æ£æ¥ç£çç©ºé´ |
| | | - æ¥çåºç¨æ¥å¿ |
| | | |
| | | #### 微信ææå¤±è´¥ |
| | | - æ£æ¥ååé
ç½® |
| | | - æ£æ¥HTTPSè¯ä¹¦ |
| | | - æ£æ¥AppIDåAppSecret |
| | | |
| | | #### è¯ä»·æäº¤å¤±è´¥ |
| | | - æ£æ¥æ°æ®åºè¿æ¥ |
| | | - æ£æ¥å¿
å¡«åæ®µéªè¯ |
| | | - æ¥çé误æ¥å¿ |
| | | |
| | | ### 2. èç³»æ¯æ |
| | | å¦éå°é®é¢ï¼è¯·æä¾ï¼ |
| | | - é误æ¥å¿ |
| | | - æä½æ¥éª¤ |
| | | - ç¯å¢ä¿¡æ¯ |
| | | - é误æªå¾ |