diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml deleted file mode 100644 index 9a657a4b..00000000 --- a/.gitea/workflows/dev.yml +++ /dev/null @@ -1,205 +0,0 @@ -run-name: ${{ gitea.actor }} 构建镜像并推送(不含JAR依赖上传)🚀 -on: - push: - branches: - - main - -jobs: - build-parent-pom: - runs-on: ubuntu - steps: - - name: 拉取代码仓库 - uses: http://git.missmoc.top/mocheng/checkout@v4 - - - name: 配置环境变量(绝对路径) - run: | - export JAVA_HOME="/java17/java17" - export MAVEN_HOME="/maven/apache-maven-3.9.11" - - if [ ! -f "$JAVA_HOME/bin/java" ]; then - echo "错误:JDK可执行文件不存在于 $JAVA_HOME/bin/java" - exit 1 - fi - if [ ! -f "$MAVEN_HOME/bin/mvn" ]; then - echo "错误:Maven可执行文件不存在于 $MAVEN_HOME/bin/mvn" - exit 1 - fi - - echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - echo "$JAVA_HOME/bin" >> $GITHUB_PATH - echo "MAVEN_HOME=$MAVEN_HOME" >> $GITHUB_ENV - echo "$MAVEN_HOME/bin" >> $GITHUB_PATH - - "$JAVA_HOME/bin/java" -version - "$MAVEN_HOME/bin/mvn" -v - - - name: 配置Maven仓库 - run: | - mkdir -p ~/.m2 - cat > ~/.m2/settings.xml << EOF - - - /root/.m2/repository - - - multi-repo - - - local-repo - file:///root/.m2/repository - - - aliyun-public - https://maven.aliyun.com/repository/public - - - - - - multi-repo - - - EOF - - - name: 构建主POM(仅本地安装,不上传) - run: | - MAIN_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/pom.xml" - if [ ! -f "$MAIN_POM_ABSOLUTE_PATH" ]; then - echo "错误:主POM文件不存在" - exit 1 - fi - - retries=3 - count=0 - until "$MAVEN_HOME/bin/mvn" clean install -U -DskipTests -f "$MAIN_POM_ABSOLUTE_PATH"; do - count=$((count + 1)) - if [ $count -ge $retries ]; then - echo "错误:主POM构建失败" - exit 1 - fi - sleep 10 - done - - # build-common-modules: - # needs: build-parent-pom - # runs-on: ubuntu - # steps: - # - name: 拉取代码仓库 - # uses: http://git.missmoc.top/mocheng/checkout@v4 - - # - name: 配置环境变量 - # run: | - # export JAVA_HOME="/java17/java17" - # export MAVEN_HOME="/maven/apache-maven-3.9.11" - # echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - # echo "$JAVA_HOME/bin" >> $GITHUB_PATH - # echo "MAVEN_HOME=$MAVEN_HOME" >> $GITHUB_ENV - # echo "$MAVEN_HOME/bin" >> $GITHUB_PATH - - # - name: 构建通用模块(仅本地使用,不上传) - # run: | - # COMMON_MODULES=( - # "ruoyi-common" - # "ruoyi-api" - # "ruoyi-common-bom" - # "ruoyi-common-alibaba-bom" - # "ruoyi-api-bom" - # ) - - # for module in "${COMMON_MODULES[@]}"; do - # MODULE_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${module}/pom.xml" - # if [ ! -f "$MODULE_POM_ABSOLUTE_PATH" ]; then - # echo "警告:模块 $module 不存在,跳过" - # continue - # fi - - # retries=3 - # count=0 - # until "$MAVEN_HOME/bin/mvn" clean compile install -U -DskipTests -f "$MODULE_POM_ABSOLUTE_PATH"; do - # count=$((count + 1)) - # if [ $count -ge $retries ]; then - # echo "错误:模块 $module 构建失败" - # exit 1 - # fi - # sleep 10 - # done - # done - - build-and-push-services: - needs: build-common-modules - runs-on: ubuntu - strategy: - matrix: - service: - - ruoyi-auth - - ruoyi-gateway - - ruoyi-modules/Property - - ruoyi-modules/ruoyi-gen - - ruoyi-modules/ruoyi-job - - ruoyi-modules/ruoyi-resource - - ruoyi-modules/ruoyi-system - - ruoyi-modules/ruoyi-workflow - - ruoyi-modules/Sis - - ruoyi-visual/ruoyi-monitor - - ruoyi-visual/ruoyi-nacos - - ruoyi-seata-server - - ruoyi-sentinel-dashboard - - ruoyi-snailjob-server - steps: - - name: 拉取代码仓库 - uses: http://git.missmoc.top/mocheng/checkout@v4 - - - name: 配置环境变量 - run: | - export JAVA_HOME="/java17/java17" - export MAVEN_HOME="/maven/apache-maven-3.9.11" - echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV - echo "$JAVA_HOME/bin" >> $GITHUB_PATH - echo "MAVEN_HOME=$MAVEN_HOME" >> $GITHUB_ENV - echo "$MAVEN_HOME/bin" >> $GITHUB_PATH - - - name: 构建服务模块 - run: | - SERVICE_NAME="${{ matrix.service }}" - SERVICE_POM_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${SERVICE_NAME}/pom.xml" - if [ ! -f "$SERVICE_POM_ABSOLUTE_PATH" ]; then - echo "错误:服务 $SERVICE_NAME 的POM文件不存在" - exit 1 - fi - - "$MAVEN_HOME/bin/mvn" clean package -U -DskipTests -f "$SERVICE_POM_ABSOLUTE_PATH" - - - name: 配置Docker Buildx - uses: http://git.missmoc.top/mocheng/setup-buildx-action@v3 - - - name: 登录到容器仓库 - uses: http://git.missmoc.top/mocheng/login-action@v3 - with: - registry: ${{ secrets.REGISTRY_URL }} - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_PASS }} - - - name: 确定Dockerfile路径 - id: dockerfile-path - run: | - SERVICE_NAME="${{ matrix.service }}" - DOCKERFILE_ABSOLUTE_PATH="${GITHUB_WORKSPACE}/${SERVICE_NAME}/Dockerfile" - - if [ -f "$DOCKERFILE_ABSOLUTE_PATH" ]; then - echo "dockerfile_path=$DOCKERFILE_ABSOLUTE_PATH" >> $GITHUB_OUTPUT - else - echo "dockerfile_path=${GITHUB_WORKSPACE}/Dockerfile" >> $GITHUB_OUTPUT - fi - - - name: 构建并推送Docker镜像(仅推送镜像,不上传JAR) - uses: http://git.missmoc.top/mocheng/build-push-action@v5 - with: - context: "${{ github.workspace }}" - file: ${{ github.workspace }}/${{ matrix.service }}/Dockerfile - tags: 172.100.10.45:3000/by2025/smartparks/${{ matrix.service }}:latest - # tags: ${{ secrets.REGISTRY_URL }}/by2025/$(echo ${{ matrix.service }} | tr 'A-Z' 'a-z'):${{ github.sha }} - # tags: ${{ secrets.REGISTRY_URL }}/by2025/${{ matrix.service }}:2.0.4 - push: true - cache-from: type=gha - cache-to: type=gha,mode=max - diff --git a/.gitea/workflows/master.yml b/.gitea/workflows/master.yml index 9ca94237..52fde7ea 100644 --- a/.gitea/workflows/master.yml +++ b/.gitea/workflows/master.yml @@ -3,7 +3,7 @@ name: Build and Push to Target Registry # 监听master分支的推送事件 on: push: - branches: [ master ] + branches: [ prod ] jobs: build-and-deploy: @@ -15,7 +15,7 @@ jobs: - name: 拉取代码 uses: http://git.missmoc.top/mocheng/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 1 - name: 使用Maven构建项目 run: | @@ -87,3 +87,8 @@ jobs: echo "===== 清理操作 =====" docker system prune -f echo "===== 所有操作完成 ====" + + - name: 重启服务 + run: | + kubectl rollout restart deployment sis -n smartparks + kubectl rollout restart deployment property -n smartparks \ No newline at end of file diff --git a/ruoyi-modules/Property/Dockerfile b/ruoyi-modules/Property/Dockerfile index c369d781..4df39854 100644 --- a/ruoyi-modules/Property/Dockerfile +++ b/ruoyi-modules/Property/Dockerfile @@ -11,7 +11,7 @@ RUN mkdir -p /ruoyi/Property/logs \ WORKDIR /ruoyi/Property -ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" +ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Duser.timezone=Asia/Shanghai" EXPOSE ${SERVER_PORT} diff --git a/ruoyi-modules/Property/pom.xml b/ruoyi-modules/Property/pom.xml index 4164e16b..4135f974 100644 --- a/ruoyi-modules/Property/pom.xml +++ b/ruoyi-modules/Property/pom.xml @@ -125,6 +125,11 @@ ruoyi-common-websocket + + org.apache.rocketmq + rocketmq-spring-boot-starter + + diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java index 14b01122..81d91396 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/InspectionRouteController.java @@ -40,7 +40,7 @@ public class InspectionRouteController extends BaseController { /** * 查询巡检路线列表 */ - @SaCheckPermission("property:route:list") + @SaCheckPermission("property:inspectionRoute:list") @GetMapping("/list") public TableDataInfo list(InspectionRouteBo bo, PageQuery pageQuery) { return inspectionRouteService.queryPageList(bo, pageQuery); @@ -49,7 +49,7 @@ public class InspectionRouteController extends BaseController { /** * 导出巡检路线列表 */ - @SaCheckPermission("property:route:export") + @SaCheckPermission("property:inspectionRoute:export") @Log(title = "巡检路线", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(InspectionRouteBo bo, HttpServletResponse response) { @@ -62,7 +62,7 @@ public class InspectionRouteController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("property:route:query") + @SaCheckPermission("property:inspectionRoute:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { @@ -72,7 +72,7 @@ public class InspectionRouteController extends BaseController { /** * 新增巡检路线 */ - @SaCheckPermission("property:route:add") + @SaCheckPermission("property:inspectionRoute:add") @Log(title = "巡检路线", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() @@ -83,7 +83,7 @@ public class InspectionRouteController extends BaseController { /** * 修改巡检路线 */ - @SaCheckPermission("property:route:edit") + @SaCheckPermission("property:inspectionRoute:edit") @Log(title = "巡检路线", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() @@ -96,7 +96,7 @@ public class InspectionRouteController extends BaseController { * * @param ids 主键串 */ - @SaCheckPermission("property:route:remove") + @SaCheckPermission("property:inspectionRoute:remove") @Log(title = "巡检路线", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java index ffa91146..623d5ccd 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/MeetAttachController.java @@ -40,7 +40,7 @@ public class MeetAttachController extends BaseController { /** * 查询分页会议室增值服务列表 */ - @SaCheckPermission("property:attach:list") + @SaCheckPermission("property:conferenceAddServices:list") @GetMapping("/list") public TableDataInfo pageList(MeetAttachBo bo, PageQuery pageQuery) { return meetAttachService.queryPageList(bo, pageQuery); @@ -57,7 +57,7 @@ public class MeetAttachController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("property:attach:query") + @SaCheckPermission("property:conferenceAddServices:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { @@ -67,7 +67,7 @@ public class MeetAttachController extends BaseController { /** * 新增会议室增值服务 */ - @SaCheckPermission("property:attach:add") + @SaCheckPermission("property:conferenceAddServices:add") @Log(title = "会议室增值服务", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() @@ -78,7 +78,7 @@ public class MeetAttachController extends BaseController { /** * 修改会议室增值服务 */ - @SaCheckPermission("property:attach:edit") + @SaCheckPermission("property:conferenceAddServices:edit") @Log(title = "会议室增值服务", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() @@ -91,7 +91,7 @@ public class MeetAttachController extends BaseController { * * @param ids 主键串 */ - @SaCheckPermission("property:attach:remove") + @SaCheckPermission("property:conferenceAddServices:remove") @Log(title = "会议室增值服务", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java index 72906e58..870364de 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/ServiceWorkOrdersController.java @@ -26,7 +26,7 @@ import java.util.List; /** * 【业务管理-工单处理】 - * 前端访问路由地址为:/system/workOrders + * 前端访问路由地址为:/property/workOrders * * @author mocheng * @date 2025-07-07 @@ -42,7 +42,7 @@ public class ServiceWorkOrdersController extends BaseController { /** * 查询【工单处理】列表 */ - //@SaCheckPermission("system:workOrders:list") + @SaCheckPermission("property:workOrders:list") @GetMapping("/list") public TableDataInfo list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { return serviceWorkOrdersService.queryPageList(bo, pageQuery); @@ -51,7 +51,7 @@ public class ServiceWorkOrdersController extends BaseController { /** * 导出【工单处理】列表 */ - // @SaCheckPermission("system:workOrders:export") + @SaCheckPermission("property:workOrders:export") @Log(title = "【工单处理】", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(ServiceWorkOrdersBo bo, HttpServletResponse response) { @@ -64,7 +64,7 @@ public class ServiceWorkOrdersController extends BaseController { * * @param id 主键 */ - // @SaCheckPermission("system:workOrders:query") + @SaCheckPermission("property:workOrders:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { @@ -74,7 +74,7 @@ public class ServiceWorkOrdersController extends BaseController { /** * 新增【工单处理】 */ - // @SaCheckPermission("system:workOrders:add") + @SaCheckPermission("property:workOrders:add") @Log(title = "【工单处理】", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() @@ -85,20 +85,40 @@ public class ServiceWorkOrdersController extends BaseController { /** * 修改【工单处理】 */ - //@SaCheckPermission("system:workOrders:edit") + @SaCheckPermission("property:workOrders:edit") @Log(title = "【工单处理】", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody ServiceWorkOrdersBo bo) { return toAjax(serviceWorkOrdersService.updateByBo(bo)); } + /** + * 派单【工单处理】 + */ + @SaCheckPermission("property:workOrders:dispatch") + @Log(title = "【工单处理】", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/dispatch") + public R dispatch(@Validated(EditGroup.class) @RequestBody ServiceWorkOrdersBo bo) { + return toAjax(serviceWorkOrdersService.updateByBo(bo)); + } + /** + * 抢单【工单处理】 + */ + @SaCheckPermission("property:workOrders:grab") + @Log(title = "【工单处理】", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("grab") + public R grab(@Validated(EditGroup.class) @RequestBody ServiceWorkOrdersBo bo) { + return toAjax(serviceWorkOrdersService.updateByBo(bo)); + } /** * 删除【工单处理】 * * @param ids 主键串 */ - // @SaCheckPermission("system:workOrders:remove") + @SaCheckPermission("property:workOrders:remove") @Log(title = "【工单处理】", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java index 71cbd677..ba5153bc 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/TbVisitorManagementController.java @@ -149,10 +149,28 @@ public class TbVisitorManagementController extends BaseController { return toAjax(tbVisitorManagementService.insertByBo(bo)); } + /** + * h5端新增访客管理 + * @param bo + * @return + */ + @SaCheckPermission("property:visitorManagement:addH5VistorManagement") + @Log(title = "访客管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/addH5VistorManagement") + public R addH5VistorManagement(@Validated(AddGroup.class) @RequestBody TbVisitorManagementBo bo) { + QrCodeInfo info = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY +"Qrcode" + bo.getQrCodeId()); + if (info==null){ + return R.fail("请确认Qr码有效"); + } + bo.setType(0); + return toAjax(tbVisitorManagementService.insertH5ByBo(bo)); + } + /** * pc端新增访客管理 */ - @SaCheckPermission("property:visitorManagement::addVisitorManagement") + @SaCheckPermission("property:visitorManagement:addVisitorManagement") @Log(title = "访客管理", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java index 2d3f5a13..96ea5b21 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/cleanOrder/CleanOrderController.java @@ -40,7 +40,7 @@ public class CleanOrderController extends BaseController { /** * 查询保洁订单列表 */ - @SaCheckPermission("property:clean_order:list") + //@SaCheckPermission("property:clean_order:list") @GetMapping("/list") public TableDataInfo list(CleanOrderBo bo, PageQuery pageQuery) { return cleanOrderService.queryPageList(bo, pageQuery); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java index 4961fa12..4e83e415 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/mobile/MServiceWorkOrdersController.java @@ -13,6 +13,7 @@ import org.dromara.common.web.core.BaseController; import org.dromara.property.domain.bo.ServiceWorkOrdersBo; import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo; import org.dromara.property.domain.vo.ServiceWorkOrdersVo; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo; import org.dromara.property.service.IServiceWorkOrdersService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -35,7 +36,6 @@ public class MServiceWorkOrdersController extends BaseController { * 小程序新增【工单处理】 */ @Log(title = "【小程序新增工单处理】", businessType = BusinessType.INSERT) - @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody MServiceWorkOrdersBo bo) { return toAjax(serviceWorkOrdersService.insertMServiceWorkOrdersBo(bo)); @@ -44,8 +44,8 @@ public class MServiceWorkOrdersController extends BaseController { * 小程序查询【工单处理】 */ @GetMapping("/list") - public TableDataInfo list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { - return serviceWorkOrdersService.queryPageList(bo, pageQuery); + public TableDataInfo list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { + return serviceWorkOrdersService.queryMobilePageList(bo, pageQuery); } /** * 修改【工单处理】 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java index ebd38779..6567fad3 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/Meet.java @@ -93,6 +93,11 @@ public class Meet extends TenantEntity { */ private String appointmentTime; + /** + * 图片 + */ + private String picture; + /** * 开放开始时段 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java index 932b39b5..2642cfa6 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrders.java @@ -47,7 +47,7 @@ public class ServiceWorkOrders extends TenantEntity { private Long type; /** - * 状态 + * 状态(0创建工单,1已派单2已抢单3处理中,4已完成,5已评价) */ private String status; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java index 9d88bdfe..118998aa 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java @@ -38,7 +38,7 @@ public class ServiceWorkOrdersType extends TenantEntity { private String orderTypeName; /** - * 运作模式 + * 运作模式(0派单+抢单,1派单,2自动派单) */ private String operationMode; @@ -56,7 +56,10 @@ public class ServiceWorkOrdersType extends TenantEntity { * 是否支持转单(0支持,1不支持) */ private Integer isTransfers; - + /** + * 权重(1一般2紧急3危急) + */ + private String processingWeight; /** * 搜索值 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java index e149f6be..54d530b1 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/CostCarChargeBo.java @@ -50,6 +50,11 @@ public class CostCarChargeBo extends BaseEntity { * 车位 */ private String location; + /** + * 车位名称 + */ + private String locationName; + /** * 缴费状态 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java index 9e1f7492..0512f2f3 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/MeetBookingBo.java @@ -67,7 +67,7 @@ public class MeetBookingBo extends BaseEntity { * 参会人数 */ @NotNull(message = "参会人数不能为空", groups = { AddGroup.class, EditGroup.class }) - private int personSum; + private Integer personSum; /** * 费用 @@ -78,17 +78,17 @@ public class MeetBookingBo extends BaseEntity { /** * 是否包含增值服务 */ - private int attach; + private Integer attach; /** * 支付状态 */ - private int payState; + private Integer payState; /** * 状态 */ - private int state; + private Integer state; /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java index 68cafea7..416643ab 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersBo.java @@ -107,10 +107,6 @@ public class ServiceWorkOrdersBo extends BaseEntity { * 图片 */ private String imgUrl; - /** - * 工单图片 - */ - private String orderImgUrl; /** * 备注 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java index aa7376a5..a9a15f6c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java @@ -54,7 +54,10 @@ public class ServiceWorkOrdersTypeBo extends BaseEntity { */ @NotNull(message = "完成时效不能为空", groups = { AddGroup.class, EditGroup.class }) private Integer completionNumber; - + /** + * 权重(1一般2紧急3危急) + */ + private String processingWeight; /** * 是否支持转单(0支持,1不支持) */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java index d1e8799d..fcac6c8b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/mobile/MServiceWorkOrdersBo.java @@ -105,6 +105,10 @@ public class MServiceWorkOrdersBo extends BaseEntity { * 工单图片 */ private String orderImgUrl; + /** + * 问题描述 + */ + private String issueDesc; /** * 备注 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java index 93d4461e..cbec0af7 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbLightInfoBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; @@ -47,7 +47,7 @@ public class TbLightInfoBo extends BaseEntity { /** * 楼层ID */ - @NotNull(message = "层ID不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotNull(message = "楼层ID不能为空", groups = {AddGroup.class, EditGroup.class}) private Long floorId; /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java index b96d76d0..b7d7a8e5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterConfigBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.EditGroup; import io.github.linpeilie.annotations.AutoMapper; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java index e25ae4fc..73db1b9f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterInfoBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterInfo; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; @@ -9,6 +9,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; +import java.math.BigDecimal; + /** * 水电气业务对象 tb_meter_info * @@ -23,7 +25,7 @@ public class TbMeterInfoBo extends BaseEntity { /** * 主键id */ - @NotNull(message = "主键id不能为空", groups = { EditGroup.class }) + @NotNull(message = "主键id不能为空", groups = {EditGroup.class}) private Long id; /** @@ -44,15 +46,42 @@ public class TbMeterInfoBo extends BaseEntity { /** * 设备类型(1-电表,2-水表,3-气表) */ - @NotNull(message = "设备类型(1-电表,2-水表,3-气表)不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotNull(message = "设备类型(1-电表,2-水表,3-气表)不能为空", groups = {AddGroup.class, EditGroup.class}) private Long meterType; /** * 计量单位(1-度,2-吨,3-立方米) */ - @NotNull(message = "计量单位(1-度,2-吨,3-立方米)不能为空", groups = { AddGroup.class, EditGroup.class }) + @NotNull(message = "计量单位(1-度,2-吨,3-立方米)不能为空", groups = {AddGroup.class, EditGroup.class}) private Long meterUnit; + /** + * 采集器IP + */ + @NotNull(message = "采集器IP不能为空", groups = {AddGroup.class, EditGroup.class}) + private String hostIp; + + /** + * 楼层ID + */ + @NotNull(message = "楼层ID不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long floorId; + + /** + * 园区编码 + */ + private Long communityId; + + /** + * 建筑名称 + */ + private Long buildingId; + + /** + * 单元编码 + */ + private Long unitId; + /** * 安装位置 */ @@ -61,12 +90,12 @@ public class TbMeterInfoBo extends BaseEntity { /** * 初始读数 */ - private Long initReading; + private BigDecimal initReading; /** * 最大量程 */ - private Long maxRang; + private BigDecimal maxRang; /** * 通信状态 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java index a88a08cb..abd989aa 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRecordBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterRecord; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; @@ -8,13 +8,15 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; + +import java.math.BigDecimal; import java.util.Date; /** * 抄记录业务对象 tb_meter_record * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ @Data @EqualsAndHashCode(callSuper = true) @@ -33,6 +35,12 @@ public class TbMeterRecordBo extends BaseEntity { @NotBlank(message = "仪表编号不能为空", groups = { AddGroup.class, EditGroup.class }) private String meterId; + /** + * 设备类型(1-电表,2-水表,3-气表) + */ + @NotNull(message = "仪表类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long meterType; + /** * 抄表员ID */ @@ -49,18 +57,13 @@ public class TbMeterRecordBo extends BaseEntity { * 当前读数 */ @NotNull(message = "当前读数不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long currentReading; + private BigDecimal currentReading; /** * 上次读数 */ @NotNull(message = "上次读数不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long previousReading; - - /** - * 用量 - */ - private Long consumption; + private BigDecimal previousReading; /** * 抄表方式(1手动 2自动 3用户上报) @@ -71,7 +74,7 @@ public class TbMeterRecordBo extends BaseEntity { /** * 抄表照片 */ - private Long imgOssid; + private Long imgOssId; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java index 1d986a4b..b5262897 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/smartDevicesBo/TbMeterRoomBo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.bo.smartDevicesBo; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.EditGroup; import io.github.linpeilie.annotations.AutoMapper; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbLightInfo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbLightInfo.java similarity index 94% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbLightInfo.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbLightInfo.java index 09a1bcf4..2af8af8d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbLightInfo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbLightInfo.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.tenant.core.TenantEntity; import com.baomidou.mybatisplus.annotation.*; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterConfig.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterConfig.java similarity index 95% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterConfig.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterConfig.java index 6dc59a9c..497e9e1b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterConfig.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterConfig.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterInfo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterInfo.java similarity index 72% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterInfo.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterInfo.java index 6c748a13..f363203d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterInfo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterInfo.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.tenant.core.TenantEntity; import com.baomidou.mybatisplus.annotation.*; @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serial; +import java.math.BigDecimal; /** * 水电气对象 tb_meter_info @@ -60,12 +61,12 @@ public class TbMeterInfo extends TenantEntity { /** * 初始读数 */ - private Long initReading; + private BigDecimal initReading; /** * 最大量程 */ - private Long maxRang; + private BigDecimal maxRang; /** * 通信状态 @@ -82,5 +83,30 @@ public class TbMeterInfo extends TenantEntity { */ private String remark; + /** + * 园区编码 + */ + private Long communityId; + + /** + * 建筑名称 + */ + private Long buildingId; + + /** + * 单元编码 + */ + private Long unitId; + + /** + * 所属楼层ID + */ + private Long floorId; + + /** + * 采集器IP + */ + private String hostIp; + } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRecord.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRecord.java similarity index 73% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRecord.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRecord.java index 7d0f6f25..4c3d6296 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRecord.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRecord.java @@ -1,11 +1,12 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.tenant.core.TenantEntity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import java.io.Serial; @@ -13,7 +14,7 @@ import java.io.Serial; * 抄记录对象 tb_meter_record * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ @Data @EqualsAndHashCode(callSuper = true) @@ -34,6 +35,11 @@ public class TbMeterRecord extends TenantEntity { */ private String meterId; + /** + * 设备类型(1-电表,2-水表,3-气表) + */ + private Long meterType; + /** * 抄表员ID */ @@ -47,17 +53,17 @@ public class TbMeterRecord extends TenantEntity { /** * 当前读数 */ - private Long currentReading; + private BigDecimal currentReading; /** * 上次读数 */ - private Long previousReading; + private BigDecimal previousReading; /** * 用量 */ - private Long consumption; + private BigDecimal consumption; /** * 抄表方式(1手动 2自动 3用户上报) @@ -67,7 +73,7 @@ public class TbMeterRecord extends TenantEntity { /** * 抄表照片 */ - private Long imgOssid; + private Long imgOssId; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRoom.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRoom.java similarity index 92% rename from ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRoom.java rename to ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRoom.java index 8cbe4275..c65b8ae5 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/TbMeterRoom.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/entity/smartDevices/TbMeterRoom.java @@ -1,4 +1,4 @@ -package org.dromara.property.domain; +package org.dromara.property.domain.entity.smartDevices; import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.*; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/ChargeTypeEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/ChargeTypeEnum.java new file mode 100644 index 00000000..b54c9402 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/ChargeTypeEnum.java @@ -0,0 +1,30 @@ +package org.dromara.property.domain.enums; + +/** + * 收费类型枚举 + */ +public enum ChargeTypeEnum { + /** + * 房屋收费 + */ + HOUS_CHARGES("房屋收费", "1"), + /** + * 车辆收费 + */ + CARD_CHARGES("车辆收费", "2"); + private final String name; + private final String value; + + ChargeTypeEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderReportingTypeEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderReportingTypeEnum.java new file mode 100644 index 00000000..48b898ef --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderReportingTypeEnum.java @@ -0,0 +1,28 @@ +package org.dromara.property.domain.enums; + +/** + * 工单上报类型 + */ +public enum OrderReportingTypeEnum { + TELEPHONE_REPORT("电话上报", "1"), + SCENE_REPORT("现场上报", "2"), + SYSTEM_REPORT("系统上报", "3"), + PHONE_REPORT("手机上报", "4"); + + + private final String name; + private final String value; + + OrderReportingTypeEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderTypeOperationEnum.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderTypeOperationEnum.java new file mode 100644 index 00000000..72e9bb2c --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/enums/OrderTypeOperationEnum.java @@ -0,0 +1,28 @@ +package org.dromara.property.domain.enums; +/** + * @Author:yuyongle + * @Date:2025/7/4 10:35 + * @Description:工单类型运作模式 + **/ +public enum OrderTypeOperationEnum { + DISPATCH_ORDERS_AND_GRAB_ORDERS("派单+抢单", "0"), + DISPATCH("派单", "1"), + AUTOMATE_DISPATCH("自动派单", "2"); + + + private final String name; + private final String value; + + OrderTypeOperationEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeDetailVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeDetailVo.java index 777a9e9c..24b326a8 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeDetailVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeDetailVo.java @@ -35,6 +35,10 @@ public class CostHouseChargeDetailVo implements Serializable { */ @ExcelProperty(value = "房屋") private Long roomId; + /** + * 房屋名称 + */ + private String roomName; /** * 业主 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java index 0cb4e6d5..b2109a73 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostHouseChargeVo.java @@ -42,10 +42,19 @@ public class CostHouseChargeVo implements Serializable { */ @ExcelProperty(value = "房屋") private Long roomId; + + /** + * 房屋名称 + */ + private String roomName; /** * 业主 */ private Long personId; + /** + * 业主 + */ + private String personName; /** * 收费项目 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java index 6e3a2185..815a6ddd 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostMeterWaterVo.java @@ -45,6 +45,10 @@ public class CostMeterWaterVo implements Serializable { * 费用类型 */ private String costType; + /** + * 费用名称 + */ + private String costTypeName; /** * 房间id */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostPayFeeAuditVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostPayFeeAuditVo.java index e7704979..45aabf19 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostPayFeeAuditVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/CostPayFeeAuditVo.java @@ -53,8 +53,12 @@ public class CostPayFeeAuditVo implements Serializable { /** * 房间号(如101,202) */ - @ExcelProperty(value = "房间号(如101,202)") + @ExcelProperty(value = "房间号") private String roomNumber; + /** + * 车牌号 + */ + private String carNumber; /** * 费用项目id diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java index 1ed2899e..0c688eb7 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/InspectionPointVo.java @@ -41,7 +41,7 @@ public class InspectionPointVo implements Serializable { * 巡检项目id */ @ExcelProperty(value = "巡检项目id") - private Long itemName; + private String itemName; /** * 巡检点名称 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java index 902cec12..b562928e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/MeetVo.java @@ -123,6 +123,10 @@ public class MeetVo implements Serializable { * 预约时间 */ private String appointmentTime; + /** + * 图片 + */ + private String picture; /** * (1免费2.付费,3面议) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java index 87a9e11f..67ab2f1e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersInfoVo.java @@ -57,7 +57,10 @@ public class ServiceWorkOrdersInfoVo implements Serializable { */ @ExcelProperty(value = "权重") private String processingWeight; - + /** + * 运作模式(0派单+抢单,1派单,2自动派单) + */ + private String operationMode; /** * 状态 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java index c6c49fab..9b44e8a4 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java @@ -68,7 +68,10 @@ public class ServiceWorkOrdersTypeVo implements Serializable { */ @ExcelProperty(value = "是否支持转单(0支持,1不支持)") private Integer isTransfers; - + /** + * 权重(1一般2紧急3危急) + */ + private String processingWeight; /** * 搜索值 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java index 67a807cd..5ab02bee 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersVo.java @@ -67,7 +67,7 @@ public class ServiceWorkOrdersVo implements Serializable { /** * 状态 */ - @ExcelProperty(value = "状态") + @ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成,5已评价)") private String status; /** @@ -75,7 +75,10 @@ public class ServiceWorkOrdersVo implements Serializable { */ @ExcelProperty(value = "派单时间") private Date dispatchTime; - + /** + * 运作模式(0派单+抢单,1派单,2自动派单) + */ + private String operationMode; /** * 发起人 */ @@ -143,6 +146,7 @@ public class ServiceWorkOrdersVo implements Serializable { * 图片 */ private String imgUrl; + /** * 备注 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java index e9bc10ac..c9e1762b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/cleanOrderVo/CleanOrderVo.java @@ -38,6 +38,11 @@ public class CleanOrderVo implements Serializable { */ @ExcelProperty(value = "位置") private Long location; + /** + * 位置 + */ + @ExcelProperty(value = "位置") + private String locationName; /** * 面积 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersRecordVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersRecordVo.java new file mode 100644 index 00000000..ff858da1 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersRecordVo.java @@ -0,0 +1,61 @@ +package org.dromara.property.domain.vo.mobile; + + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.property.domain.ServiceWorkOrdersRecord; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +/** + * @author yuyongle + * @version 1.0 + * @description: TODO + * @date 2025/8/26 13:53 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ServiceWorkOrdersRecord.class) +public class MServiceWorkOrdersRecordVo implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 工单id + */ + @ExcelProperty(value = "工单id") + private String orderId; + + /** + * 状态(0创建工单,1已派单2已抢单3处理中,4已完成) + */ + @ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成)") + private String status; + + /** + * 处理人 + */ + @ExcelProperty(value = "处理人") + private Long handler; + /** + * 处理人 + */ + @ExcelProperty(value = "处理人") + private String handlerName; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersVo.java new file mode 100644 index 00000000..cb4a5d53 --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/mobile/MServiceWorkOrdersVo.java @@ -0,0 +1,166 @@ +package org.dromara.property.domain.vo.mobile; + + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.property.domain.ServiceWorkOrders; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author yuyongle + * @version 1.0 + * @description: TODO + * @date 2025/8/26 13:52 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ServiceWorkOrders.class) +public class MServiceWorkOrdersVo implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 工单编号 + */ + @ExcelProperty(value = "工单编号") + private String orderNo; + /** + * 权重 + */ + @ExcelProperty(value = "权重") + private String processingWeight; + + /** + * 工单名称 + */ + @ExcelProperty(value = "工单名称") + private String orderName; + + /** + * 工单类型 + */ + @ExcelProperty(value = "工单类型") + private Long type; + /** + * 上报类型 + */ + private String reportingType; + /** + * 工单类型名称 + */ + @ExcelProperty(value = "工单类型名称") + private String typeName; + + /** + * 状态 + */ + @ExcelProperty(value = "状态(0创建工单,1已派单2已抢单3处理中,4已完成,5已评价)") + private String status; + + /** + * 派单时间 + */ + @ExcelProperty(value = "派单时间") + private Date dispatchTime; + /** + * 运作模式(0派单+抢单,1派单,2自动派单) + */ + private String operationMode; + /** + * 发起人 + */ + private String initiatorPeople; + + /** + * 处理人姓名 + */ + private long handler; + /** + * 抄送人 + */ + private long ccPeople; + /** + * 发起人手机号 + */ + @ExcelProperty(value = "发起人手机号") + private String initiatorPhone; + /** + * 处理人姓名文本 + */ + @ExcelProperty(value = "处理人姓名文本") + private String handlerText; + + /** + * 处理人姓名文本 + */ + @ExcelProperty(value = "处理人电话") + private String handlerPhone; + + /** + * 地址 + */ + @ExcelProperty(value = "地址") + private String location; + + /** + * 计划完成时间 + */ + @ExcelProperty(value = "计划完成时间") + private Date planCompleTime; + + /** + * 完成时间 + */ + @ExcelProperty(value = "完成时间") + private Date compleTime; + + /** + * 评价 + */ + @ExcelProperty(value = "评价") + private Integer serviceEvalua; + + /** + * 是否超时 + */ + @ExcelProperty(value = "是否超时") + private String isTimeOut; + + /** + * 评价文本 + */ + private String serviceEvaluaText; + /** + * 工单图片 + */ + private String orderImgUrl; + /** + * 图片 + */ + private String imgUrl; + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + /** + * 工单记录 + */ + List recordVoList; +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java index ad609103..08a6314b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbLightInfoVo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.vo.smartDevicesVo; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import org.dromara.common.excel.annotation.ExcelDictFormat; @@ -10,8 +10,6 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; -import java.util.Date; - /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java index ba26038e..5904d265 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterConfigVo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.vo.smartDevicesVo; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import org.dromara.common.excel.annotation.ExcelDictFormat; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java index 5bd428b8..467f85c3 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterInfoVo.java @@ -2,7 +2,7 @@ package org.dromara.property.domain.vo.smartDevicesVo; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; -import org.dromara.property.domain.TbMeterInfo; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; @@ -10,7 +10,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; - +import java.math.BigDecimal; /** @@ -54,7 +54,7 @@ public class TbMeterInfoVo implements Serializable { /** * 设备类型(1-电表,2-水表,3-气表) */ - @ExcelProperty(value = "设备类型(1-电表,2-水表,3-气表)" ,converter = ExcelDictConvert.class) + @ExcelProperty(value = "设备类型(1-电表,2-水表,3-气表)", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "meter_type") private Long meterType; @@ -75,13 +75,13 @@ public class TbMeterInfoVo implements Serializable { * 初始读数 */ @ExcelProperty(value = "初始读数") - private Long initReading; + private BigDecimal initReading; /** * 最大量程 */ @ExcelProperty(value = "最大量程") - private Long maxRang; + private BigDecimal maxRang; /** * 通信状态 @@ -97,6 +97,42 @@ public class TbMeterInfoVo implements Serializable { @ExcelDictFormat(dictType = "sis_device_status") private Long runningState; + /** + * 园区编码 + */ + @ExcelProperty(value = "园区编码") + private Long communityId; + + /** + * 建筑名称 + */ + @ExcelProperty(value = "建筑名称") + private Long buildingId; + + /** + * 单元编码 + */ + @ExcelProperty(value = "单元编码") + private Long unitId; + + /** + * 楼层ID + */ + @ExcelProperty(value = "楼层ID") + private Long floorId; + + /** + * 楼层 + */ + @ExcelProperty(value = "楼层") + private String floorName; + + /** + * 采集器IP + */ + @ExcelProperty(value = "采集器IP") + private String hostIp; + /** * 备注 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java index e01494f5..8fbec766 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRecordVo.java @@ -1,8 +1,9 @@ package org.dromara.property.domain.vo.smartDevicesVo; +import java.math.BigDecimal; import java.util.Date; -import org.dromara.property.domain.TbMeterRecord; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; @@ -16,7 +17,7 @@ import java.io.Serializable; * 抄记录视图对象 tb_meter_record * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ @Data @ExcelIgnoreUnannotated @@ -38,6 +39,12 @@ public class TbMeterRecordVo implements Serializable { @ExcelProperty(value = "仪表编号") private String meterId; + /** + * 设备类型(1-电表,2-水表,3-气表) + */ + @ExcelProperty(value = "仪表类型") + private Long meterType; + /** * 抄表员ID */ @@ -54,19 +61,19 @@ public class TbMeterRecordVo implements Serializable { * 当前读数 */ @ExcelProperty(value = "当前读数") - private Long currentReading; + private BigDecimal currentReading; /** * 上次读数 */ @ExcelProperty(value = "上次读数") - private Long previousReading; + private BigDecimal previousReading; /** * 用量 */ @ExcelProperty(value = "用量") - private Long consumption; + private BigDecimal consumption; /** * 抄表方式(1手动 2自动 3用户上报) @@ -78,7 +85,7 @@ public class TbMeterRecordVo implements Serializable { * 抄表照片 */ @ExcelProperty(value = "抄表照片") - private Long imgOssid; + private Long imgOssId; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java index 47ca9c6c..c273d81d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/smartDevicesVo/TbMeterRoomVo.java @@ -1,6 +1,6 @@ package org.dromara.property.domain.vo.smartDevicesVo; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java index 44f2a5bb..c933d2c8 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/PlantsPlanProductMapper.java @@ -17,6 +17,7 @@ import java.util.List; public interface PlantsPlanProductMapper extends BaseMapperPlus { void deleteByPlanId(Long planId); + void deleteByPlanIds(List planIds); List queryProductsInfo(Long planId); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java index bcb15a59..87a23973 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/TbRoomMapper.java @@ -1,6 +1,7 @@ package org.dromara.property.mapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.dromara.property.domain.TbRoom; import org.dromara.property.domain.vo.TbRoomVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; @@ -19,5 +20,5 @@ public interface TbRoomMapper extends BaseMapperPlus { //查询房间名称 String queryRoomName(Long roomId); - Map queryRoomNameList(List ids); + List queryRoomNameList(@Param("ids") List ids); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java index d94a0397..57cc3eaf 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbLightInfoMapper.java @@ -1,7 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; import org.apache.ibatis.annotations.Mapper; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import org.dromara.property.domain.vo.smartDevicesVo.TbLightInfoVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java index e6f62996..2351ce3b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterConfigMapper.java @@ -1,7 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; import org.apache.ibatis.annotations.Mapper; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterConfigVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java index d454c792..a9401847 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterInfoMapper.java @@ -1,6 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; -import org.dromara.property.domain.TbMeterInfo; +import org.apache.ibatis.annotations.Mapper; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; @@ -8,8 +9,9 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; * 水电气Mapper接口 * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ +@Mapper public interface TbMeterInfoMapper extends BaseMapperPlus { } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java index 4c227b72..e82a4650 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRecordMapper.java @@ -1,6 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; -import org.dromara.property.domain.TbMeterRecord; +import org.apache.ibatis.annotations.Mapper; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; @@ -8,8 +9,9 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; * 抄记录Mapper接口 * * @author lsm - * @date 2025-07-19 + * @since 2025-07-19 */ +@Mapper public interface TbMeterRecordMapper extends BaseMapperPlus { } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java index d25eb64b..fd2d46bc 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/mapper/smartDevicesMapper/TbMeterRoomMapper.java @@ -1,7 +1,7 @@ package org.dromara.property.mapper.smartDevicesMapper; import org.apache.ibatis.annotations.Mapper; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRoomVo; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/rocketmq/RocketMqConstants.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/rocketmq/RocketMqConstants.java new file mode 100644 index 00000000..df5b8a4e --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/rocketmq/RocketMqConstants.java @@ -0,0 +1,18 @@ +package org.dromara.property.rocketmq; + +/** + * @author lsm + * @apiNote RocketMqConstants + * @since 2025/8/25 + */ +public interface RocketMqConstants { + // mq topic + String TOPIC = "SmartParks"; + + // mq GROUP + String METER_GROUP = "METER_GROUP"; + + /*-----------------------------------消息tag------------------------------------*/ + String METER_RECORD = "METER_RECORD_TAG"; + +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/rocketmq/consumer/MeterRecordConsumer.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/rocketmq/consumer/MeterRecordConsumer.java new file mode 100644 index 00000000..ed0b801b --- /dev/null +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/rocketmq/consumer/MeterRecordConsumer.java @@ -0,0 +1,40 @@ +package org.dromara.property.rocketmq.consumer; + +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.dromara.property.rocketmq.RocketMqConstants; +import org.springframework.stereotype.Component; + +import java.util.Arrays; + +/** + * @author lsm + * @apiNote MeterRecordConsumer + * @since 2025/8/25 + */ +@Slf4j +@Component +@RequiredArgsConstructor +@RocketMQMessageListener( + topic = RocketMqConstants.TOPIC, + consumerGroup = RocketMqConstants.METER_GROUP, + selectorExpression = RocketMqConstants.METER_RECORD +) +public class MeterRecordConsumer implements RocketMQListener { + + @Override + public void onMessage(MessageExt ext) { + log.info("消费仪表上报数据,数据长度={}", ext.getBody().length); + try { + String message = new String(ext.getBody()); + log.info("物业仪表上报数据,数据={}", message); + } catch (Exception e) { + log.error("消费仪表上报数据处理失败,", e); + } + + } +} diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java index d7a72d32..50015766 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IPlantsPlanProductService.java @@ -67,6 +67,12 @@ public interface IPlantsPlanProductService { */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + /** + * 根据方案id删除方案产品 + * @param ids + */ + void deleteByPlanIds(List ids); + /** * 批量保存租赁方案植物 * diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java index c7ac8752..a9707a0c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/IServiceWorkOrdersService.java @@ -8,6 +8,7 @@ import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo; import org.dromara.property.domain.vo.ServiceWorkOrderAnalysisVo; import org.dromara.property.domain.vo.ServiceWorkOrdersInfoVo; import org.dromara.property.domain.vo.ServiceWorkOrdersVo; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo; import java.util.Collection; import java.util.List; @@ -94,4 +95,12 @@ public interface IServiceWorkOrdersService { * @return */ List> getServiceWorkOrdersHandler(String type); + /** + * 分页查询【工单处理】列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 【工单处理】分页列表 + */ + TableDataInfo queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java index ea077fbe..a9a2dc56 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbRoomService.java @@ -9,6 +9,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import java.util.Collection; import java.util.List; +import java.util.Map; /** * 房间信息Service接口 @@ -76,5 +77,11 @@ public interface ITbRoomService { * @return 房间名称 */ String queryRoomName(Long roomId); + /** + * 获取详细房间名称 + * @param ids 房间id集合 + * @return 房间名称 + */ + List queryRoomNameList(List ids); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java index c79756d4..a36e3151 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/ITbVisitorManagementService.java @@ -56,6 +56,14 @@ public interface ITbVisitorManagementService { */ Boolean insertByBo(TbVisitorManagementBo bo); + /** + * 新增访客管理 + * + * @param bo 访客管理 + * @return 是否新增成功 + */ + Boolean insertH5ByBo(TbVisitorManagementBo bo); + Boolean insertVistorManagementByBo(TbVisitorManagementBo bo); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java index 13ef526d..fad7357c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/AssetTypeServiceImpl.java @@ -73,7 +73,7 @@ public class AssetTypeServiceImpl implements IAssetTypeService { private LambdaQueryWrapper buildQueryWrapper(AssetTypeBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); - lqw.orderByAsc(AssetType::getId); + lqw.orderByAsc(AssetType::getSort); lqw.like(StringUtils.isNotBlank(bo.getAssetTypeName()), AssetType::getAssetTypeName, bo.getAssetTypeName()); lqw.eq(bo.getSort() != null, AssetType::getSort, bo.getSort()); return lqw; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java index f7fd951d..993f144f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostCarChargeServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.RandomUtil; @@ -16,15 +17,13 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.property.domain.CostCarCharge; import org.dromara.property.domain.CostPayFeeAudit; import org.dromara.property.domain.CostReturnPayFee; +import org.dromara.property.domain.ResidentPerson; import org.dromara.property.domain.bo.CostCarChargeBo; import org.dromara.property.domain.bo.CostChargeReturnFeeBo; import org.dromara.property.domain.enums.ChargeStatusEnum; import org.dromara.property.domain.vo.CostCarChargeVo; import org.dromara.property.domain.vo.CostItemsVo; -import org.dromara.property.mapper.CostCarChargeMapper; -import org.dromara.property.mapper.CostItemsMapper; -import org.dromara.property.mapper.CostPayFeeAuditMapper; -import org.dromara.property.mapper.CostReturnPayFeeMapper; +import org.dromara.property.mapper.*; import org.dromara.property.service.ICostCarChargeService; import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.vo.RemoteUserVo; @@ -55,6 +54,7 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService { private final CostReturnPayFeeMapper costReturnPayFeeMapper; @DubboReference private RemoteUserService remoteUserService; + private final ResidentPersonMapper residentPersonMapper; /** @@ -79,11 +79,17 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService { public TableDataInfo queryPageList(CostCarChargeBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - List residentPersonIdList = result.getRecords().stream().map(vo -> vo.getPersonId()).distinct().collect(Collectors.toList()); - List remoteUserVos = remoteUserService.selectListByIds(residentPersonIdList); +// List residentPersonIdList = result.getRecords().stream().map(vo -> vo.getPersonId()).distinct().collect(Collectors.toList()); +// List remoteUserVos = remoteUserService.selectListByIds(residentPersonIdList); + + List residentPeoplelist = residentPersonMapper.selectList(); +// List roomNames = roomService.queryRoomNameList(idList); result.getRecords().stream().forEach(s -> { - RemoteUserVo remoteUserVo = remoteUserVos.stream().filter(vo -> vo.getUserId() != null && vo.getUserId().equals(s.getPersonId())).findFirst().orElse(null); - s.setPersonName(Objects.nonNull(remoteUserVo) ? remoteUserVo.getNickName() : null); + if (CollUtil.isNotEmpty(residentPeoplelist)) { + ResidentPerson residentPerson = residentPeoplelist.stream() + .filter(vo -> vo.getId() != null && vo.getId().equals(s.getPersonId())).findFirst().orElse(null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPerson)?residentPerson.getUserName():null); + } }); return TableDataInfo.build(result); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java index acadc285..2debf50a 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostHouseChargeServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.property.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.RandomUtil; @@ -16,6 +17,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.dromara.property.domain.CostPayFeeAudit; import org.dromara.property.domain.CostReturnPayFee; +import org.dromara.property.domain.ResidentPerson; import org.dromara.property.domain.bo.CostChargeReturnFeeBo; import org.dromara.property.domain.enums.ChargeStatusEnum; import org.dromara.property.domain.vo.*; @@ -53,6 +55,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { private final ResidentPersonMapper residentPersonMapper; @DubboReference private RemoteUserService remoteUserService; + /** * 查询房屋收费 * @@ -64,12 +67,14 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { CostHouseChargeVo costHouseChargeVo = baseMapper.selectVoById(id); CostHouseChargeDetailVo costHouseChargeDetailVo = BeanUtil.copyProperties(costHouseChargeVo, CostHouseChargeDetailVo.class); CostItemsVo costItemsVo = costItemsMapper.selectVoById(costHouseChargeDetailVo.getCostItemsId()); - costHouseChargeDetailVo.setCostItemsVo(ObjectUtil.isNotEmpty(costItemsVo)?costItemsVo:null); + costHouseChargeDetailVo.setCostItemsVo(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo : null); TbRoomVo tbRoomVo = tbRoomMapper.selectVoById(costHouseChargeDetailVo.getRoomId()); - costHouseChargeDetailVo.setRoomVo(ObjectUtil.isNotEmpty(tbRoomVo)?tbRoomVo:null); -// ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(costHouseChargeVo.getPersonId()); - RemoteUserVo userInfo = remoteUserService.getUserInfoById(costHouseChargeVo.getPersonId()); - costHouseChargeDetailVo.setPersonName(ObjectUtil.isNotEmpty(userInfo)?userInfo.getUserName():null); + costHouseChargeDetailVo.setRoomVo(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo : null); + ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(costHouseChargeVo.getPersonId()); + //RemoteUserVo userInfo = remoteUserService.getUserInfoById(costHouseChargeVo.getPersonId()); + String roomName = tbRoomMapper.queryRoomName(costHouseChargeDetailVo.getRoomId()); + costHouseChargeDetailVo.setRoomName(StringUtils.isNotBlank(roomName) ? roomName : null); + costHouseChargeDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); return costHouseChargeDetailVo; } @@ -83,7 +88,17 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { @Override public TableDataInfo queryPageList(CostHouseChargeBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); + List residentPeoplelist = residentPersonMapper.selectList(); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + result.getRecords().stream().forEach(s -> { + if (CollUtil.isNotEmpty(residentPeoplelist)) { + ResidentPerson residentPerson = residentPeoplelist.stream() + .filter(vo -> vo.getId() != null && vo.getId().equals(s.getPersonId())).findFirst().orElse(null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPerson) ? residentPerson.getUserName() : null); + String roomName = tbRoomMapper.queryRoomName(s.getRoomId()); + s.setRoomName(StringUtils.isNotBlank(roomName) ? roomName : null); + } + }); return TableDataInfo.build(result); } @@ -171,7 +186,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { @Transactional(rollbackFor = Exception.class) public Boolean returnFree(CostChargeReturnFeeBo bo) { CostHouseChargeVo costHouseChargeVo = baseMapper.selectVoById(bo.getId()); - Assert.isTrue(ObjectUtil.isNotEmpty(costHouseChargeVo),"该费用不存在"); + Assert.isTrue(ObjectUtil.isNotEmpty(costHouseChargeVo), "该费用不存在"); var CostReturnPayFee = new CostReturnPayFee().setItemId(costHouseChargeVo.getCostItemsId()) .setReturnNo(RandomUtil.randomNumbers(11)) .setReason(bo.getReason()) @@ -179,8 +194,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService { .setUserId(costHouseChargeVo.getPersonId()) .setPayNo(costHouseChargeVo.getId().toString()) .setPayAcount(costHouseChargeVo.getAmountReceivable()) - .setState("0") - ; + .setState("0"); boolean flag = costReturnPayFeeMapper.insert(CostReturnPayFee) > 0; CostHouseCharge costHouseCharge = BeanUtil.copyProperties(costHouseChargeVo, CostHouseCharge.class); costHouseCharge.setChargeStatus(ChargeStatusEnum.REFUND_PENDING_REVIEW.getValue()); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java index 87110271..b8e5e537 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostMeterWaterServiceImpl.java @@ -1,6 +1,8 @@ package org.dromara.property.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -10,6 +12,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.vo.CostMeterTypeVo; +import org.dromara.property.mapper.CostMeterTypeMapper; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.CostMeterWaterBo; import org.dromara.property.domain.vo.CostMeterWaterVo; @@ -35,6 +39,7 @@ import java.util.Collection; public class CostMeterWaterServiceImpl implements ICostMeterWaterService { private final CostMeterWaterMapper baseMapper; + private final CostMeterTypeMapper costMeterTypeMapper; /** * 查询费用-水电抄 @@ -58,6 +63,16 @@ public class CostMeterWaterServiceImpl implements ICostMeterWaterService { public TableDataInfo queryPageList(CostMeterWaterBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + if (CollUtil.isNotEmpty(result.getRecords())){ + //收集抄表类型id + List meterTypeIds = result.getRecords().stream().map(CostMeterWaterVo::getMeterTypeId).toList(); + List costMeterTypeVos = costMeterTypeMapper.selectVoByIds(meterTypeIds); + result.getRecords().stream().forEach(s -> { + //查找抄表类型名称 + CostMeterTypeVo costMeterTypeVo = costMeterTypeVos.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getMeterTypeId())).findFirst().orElse(null); + s.setCostTypeName(ObjectUtil.isNotEmpty(costMeterTypeVo)?costMeterTypeVo.getName():null); + }); + } return TableDataInfo.build(result); } @@ -79,6 +94,7 @@ public class CostMeterWaterServiceImpl implements ICostMeterWaterService { lqw.orderByAsc(CostMeterWater::getId); lqw.eq(bo.getItemId() != null, CostMeterWater::getItemId, bo.getItemId()); lqw.eq(bo.getMeterTypeId() != null, CostMeterWater::getMeterTypeId, bo.getMeterTypeId()); + lqw.eq(StringUtils.isNotBlank(bo.getCostType()), CostMeterWater::getCostType, bo.getCostType()); lqw.like(StringUtils.isNotBlank(bo.getObjName()), CostMeterWater::getObjName, bo.getObjName()); lqw.eq(StringUtils.isNotBlank(bo.getCurDegrees()), CostMeterWater::getCurDegrees, bo.getCurDegrees()); lqw.eq(StringUtils.isNotBlank(bo.getPreDegrees()), CostMeterWater::getPreDegrees, bo.getPreDegrees()); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java index 6062d170..c2875629 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CostPayFeeAuditServiceImpl.java @@ -18,6 +18,7 @@ import org.dromara.property.domain.CostHouseCharge; import org.dromara.property.domain.CostPayFeeAudit; import org.dromara.property.domain.bo.CostPayFeeAuditBo; import org.dromara.property.domain.enums.ChargeStatusEnum; +import org.dromara.property.domain.enums.ChargeTypeEnum; import org.dromara.property.domain.vo.*; import org.dromara.property.mapper.*; import org.dromara.property.service.ICostPayFeeAuditService; @@ -59,7 +60,18 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { CostItemsVo costItemsVo = costItemsMapper.selectVoById(costPayFeeAuditVo.getItemId()); costPayFeeAuditVo.setChargeItem(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeItem() : null); costPayFeeAuditVo.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null); - //TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId()); + if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) { + CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(costPayFeeAuditVo.getChargeId()); + if (ObjectUtil.isNotEmpty(costHouseCharge)) { + String queryRoomName = roomMapper.queryRoomName(costHouseCharge.getRoomId()); + costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(queryRoomName) ? queryRoomName : null); + } + } + if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) { + CostCarCharge costCarCharge = costCarChargeMapper.selectById(costPayFeeAuditVo.getChargeId()); + costPayFeeAuditVo.setCarNumber(ObjectUtil.isNotEmpty(costCarCharge) ? costCarCharge.getCarNumber() : null); + } + // TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId()); //costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(roomVo)? roomVo.getRoomNumber() :null ); return costPayFeeAuditVo; } @@ -92,7 +104,7 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { } if (CollUtil.isNotEmpty(roomVoList)) { TbRoomVo tbRoomVo = roomVoList.stream() - .filter(vo -> vo.getId() != null && vo.getId().equals(s.getChargeId())).findFirst().orElse(null); + .filter(vo -> vo.getId() != null && vo.getId().equals(s.getRoomNumber())).findFirst().orElse(null); s.setRoomNumber(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo.getRoomNumber() : null); } costPayFeeAuditVoList.add(s); @@ -175,13 +187,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { private void validEntityBeforeUpdate(CostPayFeeAudit entity) { //TODO 做一些数据校验,如唯一约束 if (entity.getState().equals("1")) { - if (entity.getChargeType().equals("1")) { + if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) { CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项不存在!"); costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_WAS_APPROVED.getValue()); coinHouseChargeMapper.updateById(costHouseCharge); } - if (entity.getChargeType().equals("2")) { + if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) { CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空"); @@ -190,13 +202,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService { } } if (entity.getState().equals("2")) { - if (entity.getChargeType().equals("1")) { + if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) { CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项为空"); costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue()); coinHouseChargeMapper.updateById(costHouseCharge); } - if (entity.getChargeType().equals("2")) { + if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) { CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId()); Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空"); costCarCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue()); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java index b8ff931e..82bc8d29 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerFeedbacksServiceImpl.java @@ -64,11 +64,11 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { * @return 客户服务-意见反馈 */ @Override - public CustomerFeedbacksVo queryById(Long id){ + public CustomerFeedbacksVo queryById(Long id) { CustomerFeedbacksVo customerFeedbacksVo = baseMapper.selectVoById(id); ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(customerFeedbacksVo.getFeedbackType()); - customerFeedbacksVo.setFeedbackTypeName(StringUtils.isNotBlank(serviceWorkOrdersType.getOrderTypeName())?serviceWorkOrdersType.getOrderTypeName():null); - String nikName = remoteUserService.selectNicknameById(customerFeedbacksVo.getFeedbackPersion()); + customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotEmpty(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null); + String nikName = remoteUserService.selectNicknameById(ObjectUtil.isNotEmpty(customerFeedbacksVo) ?customerFeedbacksVo.getFeedbackPersion():null); customerFeedbacksVo.setFeedbackPersionName(nikName); return customerFeedbacksVo; } @@ -100,28 +100,29 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { .collect(Collectors.toList()); List remoteUserVos = remoteUserService.selectListByIds(uerIds); result.getRecords().stream().forEach(s -> { - assembly(s,serviceWorkOrdersTypes,remoteUserVos); - }); + assembly(s, serviceWorkOrdersTypes, remoteUserVos); + }); } return TableDataInfo.build(result); } + /** * * @param customerFeedbacksVo 意见反馈返回信息 * */ - private void assembly(CustomerFeedbacksVo customerFeedbacksVo,List serviceWorkOrdersTypes,List remoteUserVos){ - - if(CollUtil.isNotEmpty(remoteUserVos)){ - RemoteUserVo remoteUserVo = remoteUserVos.stream() - .filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null); - customerFeedbacksVo.setFeedbackPersionName(StringUtils.isNotBlank(remoteUserVo.getNickName())?remoteUserVo.getNickName():null); - } + private void assembly(CustomerFeedbacksVo customerFeedbacksVo, List serviceWorkOrdersTypes, List remoteUserVos) { + if (CollUtil.isNotEmpty(remoteUserVos)) { + RemoteUserVo remoteUserVo = remoteUserVos.stream() + .filter(vo -> vo.getUserId() != null && vo.getUserId().equals(customerFeedbacksVo.getFeedbackPersion())).findFirst().orElse(null); + customerFeedbacksVo.setFeedbackPersionName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null); + } if (CollUtil.isNotEmpty(serviceWorkOrdersTypes)) { ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypes.stream().filter(vo -> vo.getId() != null && vo.getId().equals(customerFeedbacksVo.getFeedbackType())).findFirst().orElse(null); - customerFeedbacksVo.setFeedbackTypeName(StringUtils.isNotBlank(serviceWorkOrdersType.getOrderTypeName())?serviceWorkOrdersType.getOrderTypeName():null); + customerFeedbacksVo.setFeedbackTypeName(ObjectUtil.isNotEmpty(serviceWorkOrdersType) ? serviceWorkOrdersType.getOrderTypeName() : null); } } + /** * 查询符合条件的客户服务-意见反馈列表 * @@ -179,22 +180,23 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(CustomerFeedbacksBo bo) { CustomerFeedbacks update = MapstructUtils.convert(bo, CustomerFeedbacks.class); - validEntityBeforeUpdate(update); + validEntityBeforeUpdate(update); return baseMapper.updateById(update) > 0; } /** * 保存前的数据校验 */ - private void validEntityBeforeSave(CustomerFeedbacks entity){ + private void validEntityBeforeSave(CustomerFeedbacks entity) { //TODO 做一些数据校验,如唯一约束 } + /** * 保存前的数据校验 */ - private void validEntityBeforeUpdate(CustomerFeedbacks entity){ + private void validEntityBeforeUpdate(CustomerFeedbacks entity) { //TODO 做一些数据校验,如唯一约束 - if(entity.getIsWorkOrder().equals("0")&& ObjectUtil.isEmpty(entity.getOrderId())){ + if (entity.getIsWorkOrder().equals("0") && ObjectUtil.isEmpty(entity.getOrderId())) { ServiceWorkOrders serviceWorkOrders = new ServiceWorkOrders(); serviceWorkOrders.setOrderName("意见反馈转工单"); LoginUser user = LoginHelper.getLoginUser(); @@ -226,7 +228,7 @@ public class CustomerFeedbacksServiceImpl implements ICustomerFeedbacksService { */ @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ + if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 } return baseMapper.deleteByIds(ids) > 0; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java index 5e0a865b..b10e19d8 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/EnumFetcherServiceImpl.java @@ -7,11 +7,13 @@ import lombok.RequiredArgsConstructor; import org.apache.dubbo.config.annotation.DubboReference; import org.dromara.property.domain.AttendanceUserGroup; import org.dromara.property.domain.ServiceWorkOrdersType; +import org.dromara.property.domain.TbUnit; import org.dromara.property.domain.enums.BookingPayStatusEnum; import org.dromara.property.domain.enums.BookingStatusEnum; import org.dromara.property.domain.enums.MeetAttachStatusEnum; import org.dromara.property.domain.enums.MeetStatusEnum; import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper; +import org.dromara.property.mapper.TbUnitMapper; import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper; import org.dromara.property.service.*; import org.dromara.system.api.RemoteUserService; @@ -47,6 +49,8 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { @Autowired private ServiceWorkOrdersTypeMapper serviceWorkOrdersTypeMapper; @Autowired + private TbUnitMapper unitMapper; + @Autowired private AttendanceUserGroupMapper attendanceUserGroupMapper; @Override @@ -74,11 +78,29 @@ public class EnumFetcherServiceImpl implements EnumFetcherService { return getAccount(new ArrayList<>()); case "getServiceWorkOrdersHandler": return serviceWorkOrdersService.getServiceWorkOrdersHandler(type); + case "getUnit": + return getUnit(); default: throw new IllegalArgumentException("Unknown type: " + type); } } + /** + * 获取单位枚举接口下拉 + * @return + */ + + private List> getUnit() { + List tbUnitList = unitMapper.selectList(); + return tbUnitList.stream() + .map(e -> { + Map map = new HashMap<>(); + map.put("value", e.getId()); + map.put("name", e.getUnitName()); + return map; + }) + .collect(Collectors.toList()); + } /** * 获取会议室状态枚举接口 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java index c555a10d..9906ecc9 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPlanServiceImpl.java @@ -183,15 +183,17 @@ public class InspectionPlanServiceImpl implements IInspectionPlanService { */ private void validEntityBeforebo(Long id,InspectionPlanBo bo) { //TODO 做一些数据校验,如唯一约束 - Assert.isTrue(CollUtil.isNotEmpty(bo.getInspectionPlanStaffBoList()), "巡检人员不存在"); - QueryWrapper staffLambdaQueryWrapper = new QueryWrapper<>(); - staffLambdaQueryWrapper.eq("inspection_plan_id", id); - inspectionPlanStaffMapper.delete(staffLambdaQueryWrapper); - List inspectionPlanStaffBoList = bo.getInspectionPlanStaffBoList(); - inspectionPlanStaffBoList.stream().forEach(s->{ - s.setInspectionPlanId(id); - }); - inspectionPlanStaffMapper.insertBatch(BeanUtil.copyToList(inspectionPlanStaffBoList, InspectionPlanStaff.class)); + if(CollUtil.isNotEmpty(bo.getInspectionPlanStaffBoList())){ + QueryWrapper staffLambdaQueryWrapper = new QueryWrapper<>(); + staffLambdaQueryWrapper.eq("inspection_plan_id", id); + inspectionPlanStaffMapper.delete(staffLambdaQueryWrapper); + List inspectionPlanStaffBoList = bo.getInspectionPlanStaffBoList(); + inspectionPlanStaffBoList.stream().forEach(s->{ + s.setInspectionPlanId(id); + }); + inspectionPlanStaffMapper.insertBatch(BeanUtil.copyToList(inspectionPlanStaffBoList, InspectionPlanStaff.class)); + } + } /** diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java index a7501f6f..ad4b399b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/InspectionPointServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.property.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -12,8 +13,10 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.dromara.property.domain.InspectionPoint; import org.dromara.property.domain.bo.InspectionPointBo; +import org.dromara.property.domain.vo.InspectionItemVo; import org.dromara.property.domain.vo.InspectionPlanVo; import org.dromara.property.domain.vo.InspectionPointVo; +import org.dromara.property.mapper.InspectionItemMapper; import org.dromara.property.mapper.InspectionPlanMapper; import org.dromara.property.mapper.InspectionPointMapper; import org.dromara.property.service.IInspectionPointService; @@ -39,6 +42,7 @@ public class InspectionPointServiceImpl implements IInspectionPointService { private final InspectionPointMapper baseMapper; private final InspectionPlanMapper inspectionPlanMapper; + private final InspectionItemMapper inspectionItemMapper; /** * 查询巡检点 @@ -62,6 +66,8 @@ public class InspectionPointServiceImpl implements IInspectionPointService { public TableDataInfo queryPageList(InspectionPointBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + //收集巡检项目id + if (CollectionUtil.isEmpty(result.getRecords())) { return TableDataInfo.build(result); } @@ -69,8 +75,11 @@ public class InspectionPointServiceImpl implements IInspectionPointService { .map(vo -> vo.getItemId()) .distinct() .collect(Collectors.toList()); - List inspectionPlanVos = inspectionPlanMapper.selectVoByIds(itemIdList); - + List inspectionItemVos = inspectionItemMapper.selectVoByIds(itemIdList); + result.getRecords().stream().forEach(s->{ + InspectionItemVo inspectionItemVo = inspectionItemVos.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getItemId())).findFirst().orElse(null); + s.setItemName(ObjectUtil.isNotEmpty(inspectionItemVo)?inspectionItemVo.getItemName():null); + }); return TableDataInfo.build(result); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java index 6ab9c33e..39f4e93b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetBookingServiceImpl.java @@ -65,9 +65,10 @@ public class MeetBookingServiceImpl implements IMeetBookingService { MeetVo meetVo = meetMapper.selectVoById(meetBookingDetailVo.getMeetId()); String locationName = roomMapper.queryRoomName(Long.valueOf(meetVo.getLocation())); meetBookingDetailVo.setLocationName(ObjectUtil.isNotEmpty(locationName) ? locationName : null); - RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetBookingVo.getPerson())); - meetBookingDetailVo.setPersonName(ObjectUtil.isNotEmpty(userInfo) ? userInfo.getNickName() : null); - meetBookingDetailVo.setPhone(ObjectUtil.isNotEmpty(userInfo) ? userInfo.getPhonenumber() : null); + //RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(meetBookingVo.getPerson())); + ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(Long.valueOf(meetBookingVo.getPerson())); + meetBookingDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); + meetBookingDetailVo.setPhone(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getPhone(): null); ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(Long.valueOf(meetBookingVo.getUnit())); meetBookingDetailVo.setUnitName(ObjectUtil.isNotNull(residentUnitVo) ? residentUnitVo.getName() : null); return meetBookingDetailVo; @@ -84,10 +85,13 @@ public class MeetBookingServiceImpl implements IMeetBookingService { public TableDataInfo queryPageList(MeetBookingBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + List meetBookingVoList = new ArrayList<>(); + if(CollUtil.isNotEmpty(result.getRecords())){ List residentUnitVolist = residentUnitMapper.selectVoList(); List userId = result.getRecords().stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList()); - List remoteUserVos = remoteUserService.selectListByIds(userId); - List meetBookingVoList = new ArrayList<>(); + List remoteUserVos = residentPersonMapper.selectVoByIds(userId); + // List remoteUserVos = remoteUserService.selectListByIds(userId); + result.getRecords().stream().forEach(s -> { if (CollUtil.isNotEmpty(residentUnitVolist)) { ResidentUnitVo residentUnitVo = residentUnitVolist.stream() @@ -95,13 +99,14 @@ public class MeetBookingServiceImpl implements IMeetBookingService { s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null); } if (CollUtil.isNotEmpty(remoteUserVos)) { - RemoteUserVo remoteUserVo = remoteUserVos.stream() + ResidentPersonVo residentPersonVo = remoteUserVos.stream() .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null); - s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null); - s.setPhone(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getPhonenumber() : null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); + s.setPhone(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getPhone() : null); } meetBookingVoList.add(s); }); + } return TableDataInfo.build(new Page().setRecords(meetBookingVoList).setTotal(result.getTotal())); } @@ -118,6 +123,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService { LocalDateTime startOfDay = date.atStartOfDay(); LocalDateTime endOfDay = date.atTime(LocalTime.MAX); meetBookingLambdaQueryWrapper + .eq(MeetBooking::getState,2) .le(MeetBooking::getScheduledStarttime, endOfDay) .ge(MeetBooking::getScheduledEndtime, startOfDay); List meetBookings = baseMapper.selectList(meetBookingLambdaQueryWrapper); @@ -128,19 +134,20 @@ public class MeetBookingServiceImpl implements IMeetBookingService { SimpleDateFormat df = new SimpleDateFormat("HH"); List residentUnitVolist = residentUnitMapper.selectVoList(); List userId = meetBookingAppointmentVoList.stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList()); - List remoteUserVos = remoteUserService.selectListByIds(userId); + // List remoteUserVos = remoteUserService.selectListByIds(userId); + List remoteUserVos = residentPersonMapper.selectVoByIds(userId); meetBookingAppointmentVoList.stream().forEach( s -> { if (CollUtil.isNotEmpty(residentUnitVolist)) { ResidentUnitVo residentUnitVo = residentUnitVolist.stream() .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null); - s.setUnitName(residentUnitVo.getName()); + s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo) ?residentUnitVo.getName():null); } if (CollUtil.isNotEmpty(remoteUserVos)) { - RemoteUserVo remoteUserVo = remoteUserVos.stream() - .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null); - s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null); - s.setPhone(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getPhonenumber() : null); + ResidentPersonVo residentPersonVo = remoteUserVos.stream() + .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); + s.setPhone(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getPhone() : null); } String str = df.format(s.getScheduledStarttime()); int a = Integer.parseInt(str); @@ -176,6 +183,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService { // 构建查询条件 LambdaQueryWrapper bookingLambdaQueryWrapper = new LambdaQueryWrapper<>(); bookingLambdaQueryWrapper.eq(MeetBooking::getMeetId, meetId) + .eq(MeetBooking::getState,2) .ge(MeetBooking::getScheduledStarttime, startOfWeek) .le(MeetBooking::getScheduledEndtime, endOfWeek); List meetBookingVoList = baseMapper.selectVoList(bookingLambdaQueryWrapper); @@ -188,17 +196,18 @@ public class MeetBookingServiceImpl implements IMeetBookingService { SimpleDateFormat df = new SimpleDateFormat("HH"); List residentUnitVolist = residentUnitMapper.selectVoList(); List userId = meetBookingWeekVoList.stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList()); - List remoteUserVos = remoteUserService.selectListByIds(userId); + // List remoteUserVos = remoteUserService.selectListByIds(userId); + List remoteUserVos = residentPersonMapper.selectVoByIds(userId); meetBookingWeekVoList.stream().forEach(s -> { if (CollUtil.isNotEmpty(residentUnitVolist)) { ResidentUnitVo residentUnitVo = residentUnitVolist.stream() .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null); - s.setUnitName(residentUnitVo.getName()); + s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo)? residentUnitVo.getName():null); } if (CollUtil.isNotEmpty(remoteUserVos)) { - RemoteUserVo remoteUserVo = remoteUserVos.stream() + ResidentPersonVo residentPersonVo = remoteUserVos.stream() .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null); - s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null); + s.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); } //设置指定的Date对象不设置默认返回当天的星期 calendar.setTime(s.getScheduledStarttime()); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java index 26bcdef0..56a6e119 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MeetServiceImpl.java @@ -1,8 +1,10 @@ package org.dromara.property.service.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; import org.apache.dubbo.config.annotation.DubboReference; +import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -12,11 +14,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.MeetAttach; import org.dromara.property.domain.MeetBooking; +import org.dromara.property.domain.vo.MeetAttachVo; import org.dromara.property.domain.vo.ResidentPersonVo; -import org.dromara.property.mapper.MeetBookingMapper; -import org.dromara.property.mapper.ResidentPersonMapper; -import org.dromara.property.mapper.TbRoomMapper; +import org.dromara.property.mapper.*; import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.vo.RemoteUserVo; import org.springframework.stereotype.Service; @@ -24,7 +26,6 @@ import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.MeetBo; import org.dromara.property.domain.vo.MeetVo; import org.dromara.property.domain.Meet; -import org.dromara.property.mapper.MeetMapper; import org.dromara.property.service.IMeetService; import org.springframework.transaction.annotation.Transactional; @@ -48,6 +49,7 @@ import java.util.stream.Collectors; public class MeetServiceImpl implements IMeetService { private final MeetMapper baseMapper; + private final MeetAttachMapper meetAttachMapper; private final ResidentPersonMapper residentPersonMapper; private final TbRoomMapper roomMapper; private final MeetBookingMapper meetbookMapper; @@ -63,7 +65,7 @@ public class MeetServiceImpl implements IMeetService { @Override public MeetVo queryById(Long id) { MeetVo meetVo = baseMapper.selectVoById(id); -// ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); + // ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(meetVo.getPrincipals()); // if(ObjectUtil.isNotEmpty(residentPersonVo)){ // meetVo.setPrincipalsName(residentPersonVo.getUserName()); // meetVo.setPhoneNo(residentPersonVo.getPhone()); @@ -172,6 +174,7 @@ public class MeetServiceImpl implements IMeetService { @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(MeetBo bo) { Meet add = MapstructUtils.convert(bo, Meet.class); + bo.setStatus(0); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { @@ -215,6 +218,10 @@ public class MeetServiceImpl implements IMeetService { public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 + boolean exists = meetAttachMapper.exists(new LambdaQueryWrapper().in(MeetAttach::getMeetId, ids)); + Assert.isTrue(!exists, "会议室具有增值服务,不允许单独删除"); + boolean meetbookExists = meetbookMapper.exists(new LambdaQueryWrapper().in(MeetBooking::getMeetId, ids)); + Assert.isTrue(!meetbookExists, "会议室具有预约记录,不允许单独删除"); } return baseMapper.deleteByIds(ids) > 0; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java index 0ea6d4bd..1d6f5474 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsPlanProductServiceImpl.java @@ -159,6 +159,7 @@ public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService { /** * 查询租赁方案植物数据 + * * @param planId * @return */ @@ -166,4 +167,17 @@ public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService { public List queryPlanProductsInfo(Long planId) { return baseMapper.queryProductsInfo(planId); } + + /** + * 根据方案id删除方案产品 + * + * @param ids 方案id + * @return + */ + @Override + public void deleteByPlanIds(List ids) { + if (CollectionUtils.isNotEmpty(ids)) { + baseMapper.deleteByPlanIds(ids); + } + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java index d63c6278..a4947964 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/PlantsRentalPlanServiceImpl.java @@ -25,6 +25,7 @@ import org.dromara.property.domain.vo.PlantsRentalPlanVo; import org.dromara.property.domain.PlantsRentalPlan; import org.dromara.property.mapper.PlantsRentalPlanMapper; import org.dromara.property.service.IPlantsRentalPlanService; +import org.springframework.transaction.annotation.Transactional; import java.util.*; @@ -166,6 +167,7 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { * @return 是否删除成功 */ @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if(isValid){ PlantsRentalOrderBo plantsRentalOrderBo = new PlantsRentalOrderBo(); @@ -174,6 +176,8 @@ public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService { if(CollectionUtils.isNotEmpty(plantsRentalOrderVos)){ throw new ServiceException("当前选中租赁方案不可删除"); } + //删除方案产品数据 + planProductService.deleteByPlanIds(ids.stream().toList()); } return baseMapper.deleteByIds(ids) > 0; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java index eea0eb33..7130b2de 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ResidentUnitServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import cn.hutool.core.collection.CollUtil; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -18,9 +19,11 @@ import org.dromara.property.domain.ResidentUnit; import org.dromara.property.mapper.ResidentUnitMapper; import org.dromara.property.service.IResidentUnitService; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 入驻单位Service业务层处理 @@ -50,8 +53,18 @@ public class ResidentUnitServiceImpl implements IResidentUnitService { ResidentUnitVo residentUnitVo = baseMapper.selectVoById(id); //获取入驻位置详情 if(StringUtils.isNotBlank(residentUnitVo.getLocation())){ - String roomName = roomService.queryRoomName(Long.valueOf(residentUnitVo.getLocation())); - residentUnitVo.setLocationDetail(roomName); + // 修改后的代码 + List idList = Arrays.stream(residentUnitVo.getLocation().split(",")) + .map(String::trim) + .map(Long::parseLong) + .collect(Collectors.toList()); + + List roomNames = roomService.queryRoomNameList(idList); + // 元素用,拼接成字符串 + if(CollUtil.isNotEmpty(roomNames)){ + String locationDetail = String.join(",", roomNames); + residentUnitVo.setLocationDetail(locationDetail); + } } Long num = personService.queryPersonCount(residentUnitVo.getId()); residentUnitVo.setNumber(num); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java index 77d4175a..543061ac 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java @@ -2,6 +2,7 @@ package org.dromara.property.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; @@ -16,15 +17,22 @@ import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.property.domain.*; import org.dromara.property.domain.bo.ServiceWorkOrdersBo; import org.dromara.property.domain.bo.mobile.MServiceWorkOrdersBo; +import org.dromara.property.domain.enums.OrderReportingTypeEnum; +import org.dromara.property.domain.enums.OrderTypeOperationEnum; +import org.dromara.property.domain.enums.WorkOrderStatusEnum; import org.dromara.property.domain.vo.*; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersRecordVo; +import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo; import org.dromara.property.mapper.ResidentPersonMapper; import org.dromara.property.mapper.ServiceWorkOrdersMapper; import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper; import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper; +import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper; import org.dromara.property.service.IServiceWorkOrdersService; import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.vo.RemoteUserVo; @@ -54,6 +62,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { private final ServiceWorkOrdersRecordMapper workOrdersRecordMapper; @DubboReference private RemoteUserService remoteUserService; + private final AttendanceUserGroupMapper attendanceUserGroupMapper; /** * 查询【工单处理】 @@ -71,10 +80,12 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = typesMapper.selectVoById(serviceWorkOrdersVo.getType()); if (Objects.nonNull(serviceWorkOrdersTypeVo)) { serviceWorkOrdersInfoVo.setTypeName(serviceWorkOrdersTypeVo.getOrderTypeName()); + serviceWorkOrdersInfoVo.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null); + } //ResidentPersonVo residentPersonHandler = residentPersonMapper.selectVoById(Long.valueOf(serviceWorkOrdersVo.getHandler())); - RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(serviceWorkOrdersVo.getHandler())); + RemoteUserVo userInfo = remoteUserService.getUserInfoById(Long.valueOf(serviceWorkOrdersVo.getHandler())); if (ObjectUtil.isNotEmpty(userInfo)) { serviceWorkOrdersInfoVo.setHandlerText(userInfo.getNickName()); serviceWorkOrdersInfoVo.setHandlerPhone(userInfo.getPhonenumber()); @@ -89,7 +100,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { serviceWorkOrdersRecordInfoVos.stream().forEach(workOrdersRecordVo -> { RemoteUserVo remoteUserVo = remoteUserVos.stream().filter(vo -> vo.getUserId() != null && vo.getUserId().equals(serviceWorkOrdersVo.getHandler())).findFirst().orElse(null); workOrdersRecordVo.setHandlerName(Objects.nonNull(remoteUserVo) ? remoteUserVo.getNickName() : null); - workOrdersRecordVo.setInitiatorPeople(Objects.nonNull(serviceWorkOrdersTypeVo)?serviceWorkOrdersVo.getInitiatorPeople():null); + workOrdersRecordVo.setInitiatorPeople(Objects.nonNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersVo.getInitiatorPeople() : null); if (workOrdersRecordVo.getStatus().equals("1") || workOrdersRecordVo.getStatus().equals("2")) { serviceWorkOrdersInfoVo.setDispatchTime(workOrdersRecordVo.getCreateTime()); } @@ -108,30 +119,22 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { */ @Override public TableDataInfo queryPageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) { - - //当前登录用户 - LoginUser loginUser = LoginHelper.getLoginUser(); - if (!LoginHelper.isSuperAdmin(loginUser.getUserId())) { - bo.setHandler(loginUser.getUserId()); - } LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - if (ObjectUtil.isEmpty(result.getRecords())) { - return TableDataInfo.build(result); + if (ObjectUtil.isNotEmpty(result.getRecords())) { + List typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList()); + List serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList); + if (ObjectUtil.isNotEmpty(serviceWorkOrdersTypeVoList)) { + List serviceWorkOrdersVoList = new ArrayList<>(); + result.getRecords().stream().forEach(s -> { + ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = serviceWorkOrdersTypeVoList.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getType())).findFirst().orElse(null); + s.setTypeName(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOrderTypeName() : null); + s.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null); + serviceWorkOrdersVoList.add(s); + }); + } } - List typeList = result.getRecords().stream().map(vo -> vo.getType()).distinct().collect(Collectors.toList()); - List serviceWorkOrdersTypeVoList = typesMapper.selectVoByIds(typeList); - if (ObjectUtil.isEmpty(serviceWorkOrdersTypeVoList)) { - return TableDataInfo.build(result); - } - List serviceWorkOrdersVoList = new ArrayList<>(); - result.getRecords().stream().forEach(s -> { - ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = serviceWorkOrdersTypeVoList.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getType())).findFirst().orElse(null); - - s.setTypeName(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOrderTypeName() : null); - serviceWorkOrdersVoList.add(s); - }); - return TableDataInfo.build(new Page().setRecords(serviceWorkOrdersVoList).setTotal(result.getTotal())); + return TableDataInfo.build(result); } /** @@ -157,6 +160,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo = serviceWorkOrdersTypeVoList.stream().filter(vo -> vo.getId() != null && vo.getId().equals(s.getType())).findFirst().orElse(null); s.setTypeName(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOrderTypeName() : null); + s.setOperationMode(ObjectUtil.isNotNull(serviceWorkOrdersTypeVo) ? serviceWorkOrdersTypeVo.getOperationMode() : null); serviceWorkOrdersVoList.add(s); }); return serviceWorkOrdersVoList; @@ -165,15 +169,15 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { private LambdaQueryWrapper buildQueryWrapper(ServiceWorkOrdersBo bo) { //查询类型下子类型id LambdaQueryWrapper OrdersTypeWrapper = new LambdaQueryWrapper<>(); - OrdersTypeWrapper.eq(ServiceWorkOrdersType::getParentId,bo.getType()); + OrdersTypeWrapper.eq(ServiceWorkOrdersType::getParentId, bo.getType()); List serviceWorkOrdersTypes = typesMapper.selectList(OrdersTypeWrapper); List typeIds = serviceWorkOrdersTypes.stream() .map(ServiceWorkOrdersType::getId) .collect(Collectors.toList()); typeIds.add(bo.getType()); List statusList = new ArrayList<>(); - if(StringUtils.isNotBlank(bo.getStatus())){ - statusList = Arrays.asList(bo.getStatus().split(",")); + if (StringUtils.isNotBlank(bo.getStatus())) { + statusList = Arrays.asList(bo.getStatus().split(",")); } Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); @@ -203,11 +207,14 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { @Override @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(ServiceWorkOrdersBo bo) { + //查询工单类型 + ServiceWorkOrdersType serviceWorkOrdersType = typesMapper.selectById(bo.getType()); ServiceWorkOrders add = MapstructUtils.convert(bo, ServiceWorkOrders.class); LoginUser user = LoginHelper.getLoginUser(); add.setOrderNo("GD" + IdUtil.getSnowflakeNextIdStr()); - add.setStatus("0"); + add.setStatus(WorkOrderStatusEnum.CREATE_ORDER.getValue()); add.setInitiatorPeople(user.getNickname()); + add.setProcessingWeight(serviceWorkOrdersType.getProcessingWeight()); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { @@ -216,11 +223,67 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { serviceWorkOrdersRecord.setOrderId(add.getId()); serviceWorkOrdersRecord.setStatus(add.getStatus()); //serviceWorkOrdersRecord.setHandler(add.getHandler()); - workOrdersRecordMapper.insert(serviceWorkOrdersRecord); + boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; + if (flags) { + if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { + handleServiceWorkOrder(add); + } + } } return flag; } + //自动派单 + private void handleServiceWorkOrder(ServiceWorkOrders serviceWorkOrders) { + LocalDate today = LocalDate.now(); + // 1. 获取今日排班人员(优先查缓存,未命中则查询数据库并缓存) + List attendanceUserGroups = RedisUtils.getCacheList(DateUtil.today()); + if (CollUtil.isEmpty(attendanceUserGroups)) { + attendanceUserGroups = attendanceUserGroupMapper.selectList( + new LambdaQueryWrapper() + .le(AttendanceUserGroup::getStartDate, today) + .ge(AttendanceUserGroup::getEndDate, today) + .orderByAsc(AttendanceUserGroup::getCreateTime) + ); + Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups), "暂无排班人员"); + // 缓存当天排班数据(假设当天不会变) + RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups); + } + + // 2. 获取并更新轮询索引(原子性很重要) + int currentIndex; + Integer lastScheduleId = RedisUtils.getCacheObject(DateUtil.today() + "LastScheduleId"); + if (lastScheduleId == null || lastScheduleId < 0 || lastScheduleId >= attendanceUserGroups.size()) { + currentIndex = 0; // 越界或未设置,重置为0 + } else { + currentIndex = lastScheduleId + 1; + if (currentIndex >= attendanceUserGroups.size()) { + currentIndex = 0; // 循环轮询 + } + } + RedisUtils.setCacheObject(DateUtil.today() + "LastScheduleId", currentIndex); + + // 3. 分配处理人 + AttendanceUserGroup assignedGroup = attendanceUserGroups.get(currentIndex); + Long employeeId = assignedGroup.getEmployeeId(); + + serviceWorkOrders.setHandler(employeeId); + serviceWorkOrders.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); + + // 4. 插入记录 + ServiceWorkOrdersRecord record = new ServiceWorkOrdersRecord(); + record.setOrderId(serviceWorkOrders.getId()); + record.setHandler(employeeId); + record.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); + workOrdersRecordMapper.insert(record); + + // 5. 更新工单 + serviceWorkOrders.setDispatchTime(new Date()); + baseMapper.updateById(serviceWorkOrders); + + log.info("成功派单,工单号:{}", serviceWorkOrders.getOrderNo()); + } + /** * 修改【工单处理】 * @@ -248,17 +311,17 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { * 修改前的数据校验 */ private void validEntityBeforeUpdate(ServiceWorkOrders entity) { - Assert.isTrue(ObjectUtil.isNotEmpty(entity.getStatus()),"状态不能为空!"); + Assert.isTrue(ObjectUtil.isNotEmpty(entity.getStatus()), "状态不能为空!"); LambdaQueryWrapper ordersLambdaQueryWrapper = new LambdaQueryWrapper<>(); ordersLambdaQueryWrapper.eq(ServiceWorkOrdersRecord::getOrderId, entity.getId()); ordersLambdaQueryWrapper.eq(ServiceWorkOrdersRecord::getStatus, entity.getStatus()); boolean exists = workOrdersRecordMapper.exists(ordersLambdaQueryWrapper); //TODO 做一些数据校验,如唯一约束 - ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); - serviceWorkOrdersRecord.setOrderId(entity.getId()); - serviceWorkOrdersRecord.setStatus(entity.getStatus()); - serviceWorkOrdersRecord.setHandler(entity.getHandler()); - workOrdersRecordMapper.insert(serviceWorkOrdersRecord); + ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); + serviceWorkOrdersRecord.setOrderId(entity.getId()); + serviceWorkOrdersRecord.setStatus(entity.getStatus()); + serviceWorkOrdersRecord.setHandler(entity.getHandler()); + workOrdersRecordMapper.insert(serviceWorkOrdersRecord); } /** @@ -503,15 +566,17 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { } - - //小程序端新增 @Override public Boolean insertMServiceWorkOrdersBo(MServiceWorkOrdersBo bo) { + //查询工单类型 + ServiceWorkOrdersType serviceWorkOrdersType = typesMapper.selectById(bo.getType()); ServiceWorkOrders add = MapstructUtils.convert(bo, ServiceWorkOrders.class); LoginUser user = LoginHelper.getLoginUser(); add.setOrderNo("GD" + IdUtil.getSnowflakeNextIdStr()); - add.setStatus("0"); + add.setOrderName("工单名称"); + add.setStatus(WorkOrderStatusEnum.CREATE_ORDER.getValue()); + add.setReportingType(OrderReportingTypeEnum.PHONE_REPORT.getValue()); add.setInitiatorPeople(user.getNickname()); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; @@ -520,15 +585,22 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); serviceWorkOrdersRecord.setOrderId(add.getId()); serviceWorkOrdersRecord.setStatus(add.getStatus()); - workOrdersRecordMapper.insert(serviceWorkOrdersRecord); + boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; + if (flags) { + if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { + handleServiceWorkOrder(add); + } + } } return flag; } + public List getList() { LambdaQueryWrapper serviceWorkOrdersWrapper = new LambdaQueryWrapper<>(); return baseMapper.selectList(serviceWorkOrdersWrapper); } + @Override public List> getServiceWorkOrdersHandler(String type) { return switch (type) { @@ -550,5 +622,74 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { }; } + /** + * 分页查询【工单处理】列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 【工单处理】分页列表 + */ + @Override + public TableDataInfo queryMobilePageList(ServiceWorkOrdersBo bo, PageQuery pageQuery) { + // 当前登录用户 + LoginUser loginUser = LoginHelper.getLoginUser(); + if (!LoginHelper.isSuperAdmin(loginUser.getUserId())) { + bo.setHandler(loginUser.getUserId()); + } + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + // 转换 VO 类型 + List mServiceWorkOrdersVos = new ArrayList<>(); + if (CollUtil.isNotEmpty(result.getRecords())) { + List typeList = result.getRecords().stream() + .map(ServiceWorkOrdersVo::getType) + .distinct() + .collect(Collectors.toList()); + + List typeVoList = typesMapper.selectVoByIds(typeList); + Map typeMap = typeVoList.stream() + .collect(Collectors.toMap(ServiceWorkOrdersTypeVo::getId, ServiceWorkOrdersTypeVo::getOrderTypeName, (a, b) -> a)); + //收集处理人转化成list + List handlerIdList = result.getRecords().stream().map(ServiceWorkOrdersVo::getHandler) + .distinct() + .collect(Collectors.toList()); + List remoteUserVos = remoteUserService.selectListByIds(handlerIdList); + // 转换并设置 typeName + mServiceWorkOrdersVos = result.getRecords().stream().map(vo -> { + MServiceWorkOrdersVo mVo = BeanUtil.copyProperties(vo, MServiceWorkOrdersVo.class); + dataProcessing(mVo, typeMap, remoteUserVos); + return mVo; + }).collect(Collectors.toList()); + } + // 构建分页结果 + Page pageResult = new Page<>(); + pageResult.setRecords(mServiceWorkOrdersVos); + pageResult.setTotal(result.getTotal()); + pageResult.setCurrent(result.getCurrent()); + pageResult.setSize(result.getSize()); + return TableDataInfo.build(pageResult); + } + + /** + * 处理数据 + * + * @param mServiceWorkOrdersVo + */ + private void dataProcessing(MServiceWorkOrdersVo mServiceWorkOrdersVo, Map typeMap, List remoteUserVos) { + mServiceWorkOrdersVo.setTypeName(typeMap.getOrDefault(mServiceWorkOrdersVo.getType(), null)); + //通过处理人id查询处理人信息 + RemoteUserVo remoteUserVo = remoteUserVos.stream().filter(user -> user.getUserId().equals(mServiceWorkOrdersVo.getHandler())).findFirst().orElse(null); + mServiceWorkOrdersVo.setHandlerPhone(remoteUserVo != null ? remoteUserVo.getPhonenumber() : null); + mServiceWorkOrdersVo.setHandlerText(remoteUserVo != null ? remoteUserVo.getNickName() : null); + //查询工单处理记录 + List serviceWorkOrdersRecordVoList = workOrdersRecordMapper.selectVoList(new LambdaQueryWrapper().eq(ServiceWorkOrdersRecord::getOrderId, mServiceWorkOrdersVo.getId())); + if (CollUtil.isNotEmpty(serviceWorkOrdersRecordVoList)) { + List mServiceWorkOrdersRecordVos = BeanUtil.copyToList(serviceWorkOrdersRecordVoList, MServiceWorkOrdersRecordVo.class); + mServiceWorkOrdersRecordVos.stream().forEach(workOrdersRecordVo -> { + workOrdersRecordVo.setHandlerName(Objects.nonNull(remoteUserVo) ? remoteUserVo.getNickName() : null); + }); + mServiceWorkOrdersVo.setRecordVoList(mServiceWorkOrdersRecordVos); + } + } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java index 201661fa..305f579e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbRoomServiceImpl.java @@ -158,5 +158,13 @@ public class TbRoomServiceImpl implements ITbRoomService { @Override public String queryRoomName(Long roomId) { return baseMapper.queryRoomName(roomId); + } /** + * 获取房间名称 + * @param + * @return 房间名称 + */ + @Override + public List queryRoomNameList(List ids) { + return baseMapper.queryRoomNameList(ids); } } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java index 8b806766..81bfedfc 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/TbVisitorManagementServiceImpl.java @@ -159,6 +159,37 @@ public class TbVisitorManagementServiceImpl implements ITbVisitorManagementServi } + /** + * H5端新增访客管理 + * + * @param bo 访客管理 + * @return 是否新增成功 + */ + @Override + public Boolean insertH5ByBo(TbVisitorManagementBo bo) { + QrCodeInfo info = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + "Qrcode" + bo.getQrCodeId()); + RedisUtils.deleteKeys(GlobalConstants.CAPTCHA_CODE_KEY + "Qrcode" + bo.getQrCodeId()); + TbVisitorManagement add = MapstructUtils.convert(bo, TbVisitorManagement.class); + validEntityBeforeSave(add); + assert add != null; + add.setCreateById(info.getUserid()); + RemoteUserVo userInfoById = remoteUserService.getUserInfoById(info.getUserid()); + add.setTenantId(userInfoById.getTenantId()); + add.setCreateBy(userInfoById.getUserId()); + add.setUpdateById(userInfoById.getUserId()); + add.setUpdateBy(userInfoById.getUserId()); + add.setCreateDept(userInfoById.getDeptId()); + boolean flag = baseMapper.insert(add) > 0; + + if (flag){ + bo.setId(add.getId()); + Long e8Id = syncE8PlatVisitor(bo); + add.setEEightId(e8Id); + baseMapper.updateById(add); + } + return flag; + } + /** * pc端新增访客管理 * diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java index 96edb815..6b7e2831 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/cleanOrderImpl/CleanOrderServiceImpl.java @@ -10,12 +10,10 @@ import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.property.domain.Clean; -import org.dromara.property.domain.CleanOrder; -import org.dromara.property.domain.CleanRelation; -import org.dromara.property.domain.CleanserverOrder; +import org.dromara.property.domain.*; import org.dromara.property.domain.bo.cleanOrderBo.CleanOrderBo; import org.dromara.property.domain.vo.cleanOrderVo.CleanOrderVo; +import org.dromara.property.mapper.TbRoomMapper; import org.dromara.property.mapper.cleanOrderMapper.CleanMapper; import org.dromara.property.mapper.cleanOrderMapper.CleanOrderMapper; import org.dromara.property.mapper.cleanOrderMapper.CleanRelationMapper; @@ -47,6 +45,7 @@ public class CleanOrderServiceImpl implements ICleanOrderService { private final CleanMapper cleanMapper; private final CleanRelationMapper cleanRelationMapper; + private final TbRoomMapper roomMapper; //NOTUNBOOKING:未退订 BOOKING:已退订 private final Integer NOTUNBOOKING = 0; @@ -97,6 +96,13 @@ public class CleanOrderServiceImpl implements ICleanOrderService { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw, CleanOrderVo.class); // Page result = baseMapper.selectForPage(pageQuery.build(), lqw); + //List locationIdList = result.getRecords().stream().map(CleanOrderVo::getLocation).collect(Collectors.toList()); +// Map longStringMap = roomMapper.queryRoomName(item.getLocation()); + //找出符合条件的房间名称 + result.getRecords().forEach(item -> { + String localName = roomMapper.queryRoomName(item.getLocation()); + item.setLocationName(localName != null ? localName : "未知房间"); + }); return TableDataInfo.build(result); } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java index dfc34603..12ccb6cc 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbLightInfoServiceImpl.java @@ -10,12 +10,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.bo.TbFloorBo; import org.dromara.property.domain.vo.TbFloorVo; import org.dromara.property.service.ITbFloorService; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbLightInfoBo; import org.dromara.property.domain.vo.smartDevicesVo.TbLightInfoVo; -import org.dromara.property.domain.TbLightInfo; +import org.dromara.property.domain.entity.smartDevices.TbLightInfo; import org.dromara.property.mapper.smartDevicesMapper.TbLightInfoMapper; import org.dromara.property.service.smartDevicesService.ITbLightInfoService; import org.springframework.transaction.annotation.Transactional; @@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 灯控开关信息Service业务层处理 @@ -60,7 +62,19 @@ public class TbLightInfoServiceImpl implements ITbLightInfoService { public TableDataInfo queryPageList(TbLightInfoBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - result.getRecords().forEach(r -> r.setFloorName(floorService.queryById(r.getFloorId()).getFloorName())); + + // 创建楼层ID到楼层名称的映射,避免重复查询 + List floorVo = floorService.queryList(new TbFloorBo()); + Map floorMap = floorVo.stream() + .collect(Collectors.toMap(TbFloorVo::getId, TbFloorVo::getFloorName, (key1, key2) -> key1)); + + // 为每个灯控信息设置楼层名称 + result.getRecords().forEach(record -> { + String floorName = floorMap.get(record.getFloorId()); + if (floorName != null) { + record.setFloorName(floorName); + } + }); return TableDataInfo.build(result); } @@ -151,7 +165,7 @@ public class TbLightInfoServiceImpl implements ITbLightInfoService { */ @Override @Transactional(rollbackFor = Exception.class) - public Boolean switchSingleLight(TbLightInfoBo bo){ + public Boolean switchSingleLight(TbLightInfoBo bo) { TbLightInfo update = MapstructUtils.convert(bo, TbLightInfo.class); boolean flag = baseMapper.updateById(update) > 0; Assert.isTrue(flag, "修改灯开关失败"); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java index 79cb1773..97e8c93d 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterConfigServiceImpl.java @@ -11,7 +11,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterConfigBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterConfigVo; -import org.dromara.property.domain.TbMeterConfig; +import org.dromara.property.domain.entity.smartDevices.TbMeterConfig; import org.dromara.property.mapper.smartDevicesMapper.TbMeterConfigMapper; import org.dromara.property.service.smartDevicesService.ITbMeterConfigService; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java index 2ee24780..35ebee2e 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterInfoServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl.smartDevicesImpl; +import cn.hutool.core.lang.Assert; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -9,16 +10,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.property.domain.bo.TbFloorBo; +import org.dromara.property.domain.vo.TbFloorVo; +import org.dromara.property.service.ITbFloorService; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterInfoVo; -import org.dromara.property.domain.TbMeterInfo; +import org.dromara.property.domain.entity.smartDevices.TbMeterInfo; import org.dromara.property.mapper.smartDevicesMapper.TbMeterInfoMapper; import org.dromara.property.service.smartDevicesService.ITbMeterInfoService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; import java.util.Collection; +import java.util.stream.Collectors; /** * 水电气Service业务层处理 @@ -27,11 +33,12 @@ import java.util.Collection; * @since 2025-07-19 */ @Slf4j -@RequiredArgsConstructor @Service +@RequiredArgsConstructor public class TbMeterInfoServiceImpl implements ITbMeterInfoService { private final TbMeterInfoMapper baseMapper; + private final ITbFloorService floorService; /** * 查询水电气 @@ -40,7 +47,7 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService { * @return 水电气 */ @Override - public TbMeterInfoVo queryById(Long id){ + public TbMeterInfoVo queryById(Long id) { return baseMapper.selectVoById(id); } @@ -55,6 +62,19 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService { public TableDataInfo queryPageList(TbMeterInfoBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + // 创建楼层ID到楼层名称的映射,避免重复查询 + List floorList = floorService.queryList(new TbFloorBo()); + Map floorMap = floorList.stream() + .collect(Collectors.toMap(TbFloorVo::getId, TbFloorVo::getFloorName, (key1, key2) -> key1)); + + // 为每个灯控信息设置楼层名称 + result.getRecords().forEach(record -> { + String floorName = floorMap.get(record.getFloorId()); + if (floorName != null) { + record.setFloorName(floorName); + } + }); + return TableDataInfo.build(result); } @@ -94,13 +114,15 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService { * @return 是否新增成功 */ @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(TbMeterInfoBo bo) { TbMeterInfo add = MapstructUtils.convert(bo, TbMeterInfo.class); - validEntityBeforeSave(add); + assert add != null; + TbFloorVo floor = floorService.queryById(add.getFloorId()); + add.setBuildingId(floor.getBuildingId()); + add.setCommunityId(floor.getCommunityId()); boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setId(add.getId()); - } + Assert.isTrue(flag, "新增水电气信息失败"); return flag; } @@ -120,7 +142,7 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService { /** * 保存前的数据校验 */ - private void validEntityBeforeSave(TbMeterInfo entity){ + private void validEntityBeforeSave(TbMeterInfo entity) { //TODO 做一些数据校验,如唯一约束 } @@ -133,7 +155,7 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService { */ @Override public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { - if(isValid){ + if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 } return baseMapper.deleteByIds(ids) > 0; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java index de4d9fd7..cd225632 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java @@ -12,7 +12,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRecordBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRecordVo; -import org.dromara.property.domain.TbMeterRecord; +import org.dromara.property.domain.entity.smartDevices.TbMeterRecord; import org.dromara.property.mapper.smartDevicesMapper.TbMeterRecordMapper; import org.dromara.property.service.smartDevicesService.ITbMeterRecordService; @@ -75,13 +75,13 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByAsc(TbMeterRecord::getId); lqw.eq(StringUtils.isNotBlank(bo.getMeterId()), TbMeterRecord::getMeterId, bo.getMeterId()); + lqw.eq(bo.getMeterType() != null, TbMeterRecord::getMeterType, bo.getMeterType()); lqw.eq(bo.getReaderId() != null, TbMeterRecord::getReaderId, bo.getReaderId()); lqw.eq(bo.getReadingTime() != null, TbMeterRecord::getReadingTime, bo.getReadingTime()); lqw.eq(bo.getCurrentReading() != null, TbMeterRecord::getCurrentReading, bo.getCurrentReading()); lqw.eq(bo.getPreviousReading() != null, TbMeterRecord::getPreviousReading, bo.getPreviousReading()); - lqw.eq(bo.getConsumption() != null, TbMeterRecord::getConsumption, bo.getConsumption()); lqw.eq(bo.getReadingMethod() != null, TbMeterRecord::getReadingMethod, bo.getReadingMethod()); - lqw.eq(bo.getImgOssid() != null, TbMeterRecord::getImgOssid, bo.getImgOssid()); + lqw.eq(bo.getImgOssId() != null, TbMeterRecord::getImgOssId, bo.getImgOssId()); return lqw; } diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java index 2c4ebdda..026720d9 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRoomServiceImpl.java @@ -11,7 +11,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.dromara.property.domain.bo.smartDevicesBo.TbMeterRoomBo; import org.dromara.property.domain.vo.smartDevicesVo.TbMeterRoomVo; -import org.dromara.property.domain.TbMeterRoom; +import org.dromara.property.domain.entity.smartDevices.TbMeterRoom; import org.dromara.property.mapper.smartDevicesMapper.TbMeterRoomMapper; import org.dromara.property.service.smartDevicesService.ITbMeterRoomService; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java index 206a798c..5d331c19 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/tasks/ServiceWorkOrderTasks.java @@ -9,10 +9,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.dromara.common.redis.utils.RedisUtils; import org.dromara.property.domain.AttendanceUserGroup; import org.dromara.property.domain.ServiceWorkOrders; import org.dromara.property.domain.ServiceWorkOrdersRecord; +import org.dromara.property.domain.ServiceWorkOrdersType; +import org.dromara.property.domain.enums.OrderTypeOperationEnum; import org.dromara.property.domain.enums.WorkOrderStatusEnum; +import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper; import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper; import org.dromara.property.mapper.ServiceWorkOrdersMapper; import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper; @@ -40,48 +44,81 @@ import org.springframework.web.bind.annotation.RestController; //@RestController //@RequestMapping("/serviceWorkOrderTasks") public class ServiceWorkOrderTasks { - private ServiceWorkOrdersMapper workOrdersMapper; - private ServiceWorkOrdersRecordMapper workOrdersRecordMapper; - private AttendanceUserGroupMapper attendanceUserGroupMapper; + private final ServiceWorkOrdersMapper workOrdersMapper; + private final ServiceWorkOrdersTypeMapper workOrdersTypeMapper; + private final ServiceWorkOrdersRecordMapper workOrdersRecordMapper; + private final AttendanceUserGroupMapper attendanceUserGroupMapper; /** * 查询状态为创建工单的工单,查询当天排班人员,为工单自动派单 */ @Transactional(rollbackFor = Exception.class) - @Scheduled(cron = "0 0 */1 * * ?") + @Scheduled(cron = "0 0,30 * * * ?") //@GetMapping("/serviceWorkOrderTaskId") private void handleServiceWorkOrder() { - List serviceWorkOrderList = workOrdersMapper.selectList( - new LambdaQueryWrapper() - .eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.CREATE_ORDER.getValue())); - if(CollUtil.isNotEmpty(serviceWorkOrderList)){ - LocalDate today = LocalDate.now(); - List attendanceUserGroups = attendanceUserGroupMapper.selectList( - new LambdaQueryWrapper() - //查询今天上班的人员 - .le(AttendanceUserGroup::getStartDate, today) - .ge(AttendanceUserGroup::getEndDate, today) + LocalDate today = LocalDate.now(); + List attendanceUserGroups = attendanceUserGroupMapper.selectList( + new LambdaQueryWrapper() + //查询今天上班的人员 + .le(AttendanceUserGroup::getStartDate, today) + .ge(AttendanceUserGroup::getEndDate, today) + ); + if (CollUtil.isEmpty(attendanceUserGroups)) { + if (!RedisUtils.isExistsObject("today")) { + //缓存今天排班人员 + RedisUtils.setCacheList("today", attendanceUserGroups); + } + //查询工单类型 + List serviceWorkOrdersTypes = workOrdersTypeMapper.selectList( + new LambdaQueryWrapper() + .eq(ServiceWorkOrdersType::getOperationMode, OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue()) ); - serviceWorkOrderList.stream().forEach(s->{ - if(CollUtil.isNotEmpty(attendanceUserGroups)){ - attendanceUserGroups.stream().forEach(s1->{ + if (CollUtil.isEmpty(serviceWorkOrdersTypes)) { + //收集工单类型id + List typeIds = serviceWorkOrdersTypes.stream().map(ServiceWorkOrdersType::getId).toList(); + List serviceWorkOrderList = workOrdersMapper.selectList( + new LambdaQueryWrapper() + .eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.CREATE_ORDER.getValue()) + .in(ServiceWorkOrders::getType, typeIds) + ); + if (CollUtil.isNotEmpty(serviceWorkOrderList)) { + serviceWorkOrderList.stream().forEach(s -> { + //获取处理人 + List attendanceUserGroupList = RedisUtils.getCacheList("today"); ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); + //获取上次排班人员序号 + if (!RedisUtils.isExistsObject("LastScheduleId")) { + RedisUtils.setCacheObject("LastScheduleId", 0); + serviceWorkOrdersRecord.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + s.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + } else { + Integer lastScheduleId = RedisUtils.getCacheObject("LastScheduleId"); + int lastScheduleIdUpdate = lastScheduleId + 1; + AttendanceUserGroup attendanceUserGroup = attendanceUserGroupList.get(lastScheduleIdUpdate); + if (ObjectUtil.isNotEmpty(attendanceUserGroup)) { + serviceWorkOrdersRecord.setHandler(attendanceUserGroup.getEmployeeId()); + s.setHandler(attendanceUserGroup.getEmployeeId()); + RedisUtils.setCacheObject("LastScheduleId", lastScheduleIdUpdate); + } else { + serviceWorkOrdersRecord.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + s.setHandler(attendanceUserGroupList.get(0).getEmployeeId()); + RedisUtils.setCacheObject("LastScheduleId", 0); + } + } + serviceWorkOrdersRecord.setOrderId(s.getId()); serviceWorkOrdersRecord.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); - serviceWorkOrdersRecord.setHandler(s1.getEmployeeId()); + workOrdersRecordMapper.insert(serviceWorkOrdersRecord); s.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); - s.setHandler(s1.getEmployeeId()); + workOrdersMapper.updateById(s); - log.info("派单工单号为:{}",s.getOrderNo()); - log.info("处理人为:{}",s1.getEmployeeId()); + log.info("派单工单号为:{}", s.getOrderNo()); }); - }else { - log.info("当天无排班人员"); + } else { + log.info("派单工单为:{}", serviceWorkOrderList.size()); } - }); - }else { - log.info("派单工单为:{}",serviceWorkOrderList.size()); + } } } @@ -134,10 +171,10 @@ public class ServiceWorkOrderTasks { for (AttendanceUserGroup group : attendanceUserGroups) { Long employeeId = group.getEmployeeId(); // 可选:避免重新派给原处理人 - if (employeeId.equals(latestRecord.getHandler())) { - log.debug("跳过原处理人:{}", employeeId); - continue; - } + if (employeeId.equals(latestRecord.getHandler())) { + log.debug("跳过原处理人:{}", employeeId); + continue; + } // 创建新的派单记录 ServiceWorkOrdersRecord newRecord = new ServiceWorkOrdersRecord(); newRecord.setOrderId(workOrder.getId()); @@ -147,9 +184,9 @@ public class ServiceWorkOrderTasks { workOrdersRecordMapper.insert(newRecord); log.info("工单号:{} 已重新派发给员工ID:{}", workOrder.getOrderNo(), employeeId); // 6. 更新主工单状态(可选:若只保留最新记录状态,也可不更新主表) - workOrder.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); // 仍为已派单 - workOrder.setHandler(employeeId); // 可清空,或设为最后一个人(根据业务) - workOrdersMapper.updateById(workOrder); + workOrder.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); // 仍为已派单 + workOrder.setHandler(employeeId); // 可清空,或设为最后一个人(根据业务) + workOrdersMapper.updateById(workOrder); } }); } diff --git a/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml b/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml index f46532f8..d07caa86 100644 --- a/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml +++ b/ruoyi-modules/Property/src/main/resources/mapper/Property/PlantsPlanProductMapper.xml @@ -26,6 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from plants_plan_product p where p.plan_id=#{planId} + + delete from plants_plan_product p where p.plan_id in + + #{planId} + + + SELECT - concat(c.community_name, b.building_name, u.unit_name, f.floor_name, r.room_number) + concat(c.community_name, b.building_name, f.floor_name, r.room_number) FROM tb_room r INNER JOIN tb_floor f ON r.floor_id = f.id - INNER JOIN tb_unit u ON f.unit_id = u.id - INNER JOIN tb_building b ON u.building_id = b.id + INNER JOIN tb_building b ON f.building_id = b.id INNER JOIN tb_community c ON b.community_id = c.id where r.id=#{roomId} - SELECT - concat(c.community_name, b.building_name, u.unit_name, f.floor_name, r.room_number) + concat(c.community_name, b.building_name, f.floor_name, r.room_number) AS room_name FROM tb_room r INNER JOIN tb_floor f ON r.floor_id = f.id - INNER JOIN tb_unit u ON f.unit_id = u.id - INNER JOIN tb_building b ON u.building_id = b.id + INNER JOIN tb_building b ON f.building_id = b.id INNER JOIN tb_community c ON b.community_id = c.id - where r.id IN + WHERE r.id IN #{id} diff --git a/ruoyi-modules/Sis/pom.xml b/ruoyi-modules/Sis/pom.xml index 9cdc13cc..32ca6297 100644 --- a/ruoyi-modules/Sis/pom.xml +++ b/ruoyi-modules/Sis/pom.xml @@ -140,6 +140,12 @@ 3.0.0 + + com.drewnoakes + metadata-extractor + 2.18.0 + + net.java.dev.jna jna diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/config/RocketMQClusterConfig.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/config/RocketMQClusterConfig.java new file mode 100644 index 00000000..8096dfc1 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/config/RocketMQClusterConfig.java @@ -0,0 +1,75 @@ +package org.dromara.sis.config; + +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author lsm + * @apiNote RocketMQClusterConfig + * @since 2025/8/26 + */ +@Configuration +public class RocketMQClusterConfig { + + // 从配置文件中读取 cluster 的配置 + @Value("${rocketmq.cluster1.name-server}") + private String nameServer1; + + @Value("${rocketmq.cluster1.producer.group}") + private String producerGroup1; + + // 为第一个集群创建生产者实例 + @Bean({"clusterProducerOne"}) + public DefaultMQProducer clusterProducerOne() throws Exception { + DefaultMQProducer producer = new DefaultMQProducer(producerGroup1); + producer.setNamesrvAddr(nameServer1); + // 设置发送超时时间 + producer.setSendMsgTimeout(5000); + // 设置重试次数 + producer.setRetryTimesWhenSendFailed(2); + producer.setRetryTimesWhenSendAsyncFailed(2); + return producer; + } + + // 使用上面的生产者实例创建 RocketMQTemplate + @Bean("rocketMQTemplateClusterOne") + public RocketMQTemplate rocketMQTemplateClusterOne(@Qualifier("clusterProducerOne") DefaultMQProducer producer) { + RocketMQTemplate template = new RocketMQTemplate(); + template.setProducer(producer); + return template; + } + + + // 从配置文件中读取 cluster 的配置 +// @Value("${rocketmq.cluster2.name-server}") +// private String nameServer2; +// +// @Value("${rocketmq.cluster2.producer.group}") +// private String producerGroup2; +// +// // 为第二个集群创建生产者实例 +// @Bean({"clusterProducerTwo"}) +// public DefaultMQProducer clusterProducerTwo() throws Exception { +// DefaultMQProducer producer = new DefaultMQProducer(producerGroup2); +// producer.setNamesrvAddr(nameServer2); +// // 设置发送超时时间 +// producer.setSendMsgTimeout(5000); +// // 设置重试次数 +// producer.setRetryTimesWhenSendFailed(2); +// producer.setRetryTimesWhenSendAsyncFailed(2); +// return producer; +// } +// +// // 使用上面的生产者实例创建 RocketMQTemplate +// @Bean("rocketMQTemplateClusterTwo") +// public RocketMQTemplate rocketMQTemplateClusterTwo(@Qualifier("clusterProducerTwo") DefaultMQProducer producer) { +// RocketMQTemplate template = new RocketMQTemplate(); +// template.setProducer(producer); +// return template; +// } + +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/controller/SisVisitorController.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/controller/SisVisitorController.java new file mode 100644 index 00000000..6b7168a7 --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/controller/SisVisitorController.java @@ -0,0 +1,85 @@ +package org.dromara.sis.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.date.DateField; +import cn.hutool.core.date.DateUtil; +import lombok.RequiredArgsConstructor; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.sis.domain.bo.SisPersonLibImgBo; +import org.dromara.sis.domain.vo.SisPersonLibImgVo; +import org.dromara.sis.sdk.e8.E8PlatformApi; +import org.dromara.sis.sdk.e8.domain.QueryDto; +import org.dromara.sis.sdk.e8.domain.accessControl.req.AccessRecordFindReq; +import org.dromara.sis.sdk.e8.domain.accessControl.res.AccessRecordFindRes; +import org.dromara.sis.service.ISisPersonLibImgService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author yuyongle + * @version 1.0 + * @description: + * @date 2025/8/27 15:57 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/visitor") +public class SisVisitorController { + private final E8PlatformApi e8PlatformApi; + + /** + * 查询人员通行记录 + */ + @GetMapping("/list") + public TableDataInfo list(QueryDto dto) { + + TableDataInfo tableDataInfo = new TableDataInfo(); + List accessRecordFindResList = new ArrayList<>(); + AccessRecordFindRes accessRecordFindRes = new AccessRecordFindRes(); + accessRecordFindRes.setDeviceName("4#岗亭09"); + accessRecordFindRes.setDoorName("4#岗亭09"); + accessRecordFindRes.setDeviceType(1102); + accessRecordFindRes.setReaderName(""); + accessRecordFindRes.setGatewayType(1); + accessRecordFindRes.setCustomerName("德隆吴鹏"); + accessRecordFindRes.setOrganFullPath("主楼11楼"); + accessRecordFindRes.setPictureUrl("https://bpic.588ku.com/back_list_pic/23/04/21/ef5e2a3dd5cfc336fdcf2fd000474f0f.jpg"); + accessRecordFindRes.setCardType(34); + accessRecordFindRes.setRecordType(2); + accessRecordFindRes.setActionTime(new Date()); + accessRecordFindResList.add(accessRecordFindRes); + tableDataInfo.setRows(accessRecordFindResList); + tableDataInfo.setTotal(1); + tableDataInfo.setCode(200); + return tableDataInfo; + +// dto.setPageIndex(1); +// dto.setMaxResultCount(20); +// +// // 10秒内 +// String starTime = DateUtil.format(DateUtil.offset(new Date(), DateField.SECOND, -10), "yyyy-MM-dd HH:mm:ss"); +// String endTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); +// +// AccessRecordFindReq lift = new AccessRecordFindReq(); +// lift.setStartTime(starTime); +// lift.setEndTime(endTime); +// lift.setRecordType(2); +// // 9号电梯 +// lift.setDeviceId(550757939925061L); +// dto.setQueryDto(lift); +//// TableDataInfo nineLiftList = e8PlatformApi.getPageAccessRecordList(dto); +// TableDataInfo pageAccessRecordList = new TableDataInfo(); +// +// return e8PlatformApi.getPageAccessRecordList(dto); + //如果pageAccessRecordList报错就捕获并封装 + } +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/consumer/MeterRecordConsumer.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/consumer/MeterRecordConsumer.java new file mode 100644 index 00000000..8360613a --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/consumer/MeterRecordConsumer.java @@ -0,0 +1,44 @@ +package org.dromara.sis.rocketmq.consumer; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.dromara.sis.rocketmq.RocketMqConstants; +import org.dromara.sis.rocketmq.producer.ProducerService; +import org.springframework.stereotype.Component; + +/** + * @author lsm + * @apiNote MeterRecordConsumer + * @since 2025/8/25 + */ +@Slf4j +@Component +@RequiredArgsConstructor +@RocketMQMessageListener( + topic = RocketMqConstants.TOPIC, + consumerGroup = RocketMqConstants.METER_GROUP, + selectorExpression = RocketMqConstants.METER_RECORD, + nameServer = "${rocketmq.cluster1.name-server}" +) +public class MeterRecordConsumer implements RocketMQListener { + + private final ProducerService producerService; + + @Override + public void onMessage(MessageExt ext) { + try { + if (ext.getBody() == null) { + log.info("仪表上报消息数据,不转发!"); + } else { + producerService.defaultSend(RocketMqConstants.TOPIC, RocketMqConstants.METER_RECORD, new String(ext.getBody())); + log.info("转发仪表上报数据处理成功"); + } + } catch (Exception e) { + log.error("转发仪表上报数据处理失败,", e); + } + + } +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/producer/ProducerService.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/producer/ProducerService.java new file mode 100644 index 00000000..7c40a8de --- /dev/null +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/rocketmq/producer/ProducerService.java @@ -0,0 +1,65 @@ +package org.dromara.sis.rocketmq.producer; + +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +/** + * @author lsm + * @apiNote ProducerService + * @since 2025/8/26 + */ +@Slf4j +@Component +public class ProducerService { + + @Autowired + @Qualifier("rocketMQTemplateClusterOne") + private RocketMQTemplate rocketMQTemplateClusterOne; + +// @Autowired +// @Qualifier("rocketMQTemplateClusterTwo") +// private RocketMQTemplate rocketMQTemplateClusterTwo; + + /** + * 向mq写入消息 + * + * @param topic 消息topic + * @param tag 消息tag + * @param msg 消息 + */ + public void defaultSend(String topic, String tag, String msg) { + try { + String destination = topic + ":" + tag; + // 使用 RocketMQTemplate 的同步发送方法 + rocketMQTemplateClusterOne.syncSend(destination, msg); + + log.info("发送RocketMQOne消息成功, nameServer:{}", rocketMQTemplateClusterOne.getProducer().getNamesrvAddr()); + } catch (Exception e) { + log.error("发送RocketMQOne消息失败", e); + } + } + + + /** + * 向mq写入消息 + * + * @param topic 消息topic + * @param tag 消息tag + * @param msg 消息 + */ +// public void clusterSend(String topic, String tag, String msg) { +// try { +// String destination = topic + ":" + tag; +// // 使用 RocketMQTemplate 的同步发送方法 +// rocketMQTemplateClusterTwo.syncSend(destination, msg); +// +// log.info("发送RocketMQTwo消息成功, nameServer:{}", rocketMQTemplateClusterTwo.getProducer().getNamesrvAddr()); +// } catch (Exception e) { +// log.error("发送RocketMQTwo消息失败", e); +// } +// } +} diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java index 4efff0a4..a209bd81 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/sdk/e8/utils/ImageUtil.java @@ -1,17 +1,21 @@ package org.dromara.sis.sdk.e8.utils; +import com.drew.imaging.ImageMetadataReader; +import com.drew.imaging.ImageProcessingException; +import com.drew.metadata.Metadata; +import com.drew.metadata.MetadataException; +import com.drew.metadata.exif.ExifIFD0Directory; import org.springframework.stereotype.Component; -import javax.imageio.IIOImage; -import javax.imageio.ImageIO; -import javax.imageio.ImageWriteParam; -import javax.imageio.ImageWriter; +import javax.imageio.*; +import javax.imageio.stream.ImageInputStream; import javax.imageio.stream.MemoryCacheImageOutputStream; import java.awt.*; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Iterator; /** * @author lsm @@ -22,7 +26,8 @@ import java.io.IOException; public class ImageUtil { public byte[] compressImageToRequirements(byte[] imageData) throws IOException { - BufferedImage image = ImageIO.read(new ByteArrayInputStream(imageData)); + // 读取图片并处理方向 + BufferedImage image = readAndFixOrientation(imageData); // 第一步:调整分辨率(不超过1000x1000) if (image.getWidth() > 1000 || image.getHeight() > 1000) { @@ -91,6 +96,124 @@ public class ImageUtil { return resizedImage; } + /** + * 读取图片并处理 EXIF 方向信息 + */ + private BufferedImage readAndFixOrientation(byte[] imageData) throws IOException { + try { + // 使用 metadata-extractor 读取 EXIF 方向信息 + Metadata metadata = ImageMetadataReader.readMetadata(new ByteArrayInputStream(imageData)); + ExifIFD0Directory directory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class); + + int orientation = 1; // 默认正常方向 + if (directory != null && directory.containsTag(ExifIFD0Directory.TAG_ORIENTATION)) { + orientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION); + } + + // 读取图片 + ImageInputStream input = ImageIO.createImageInputStream(new ByteArrayInputStream(imageData)); + Iterator readers = ImageIO.getImageReaders(input); + + if (!readers.hasNext()) { + throw new IOException("No ImageReader found for image data"); + } + + ImageReader reader = readers.next(); + reader.setInput(input); + BufferedImage image = reader.read(0); + reader.dispose(); + + // 根据方向信息旋转图片 + return rotateImageAccordingToOrientation(image, orientation); + } catch (ImageProcessingException e) { + throw new IOException("Failed to process image metadata", e); + } catch (MetadataException e) { + throw new RuntimeException(e); + } + } + + /** + * 根据方向信息旋转图片 + */ + private BufferedImage rotateImageAccordingToOrientation(BufferedImage image, int orientation) { + int width = image.getWidth(); + int height = image.getHeight(); + + return switch (orientation) { + case 1 -> // 正常 + image; + case 2 -> // 水平翻转 + flipImage(image, true, false); + case 3 -> // 旋转180度 + rotateImage(image, 180); + case 4 -> // 垂直翻转 + flipImage(image, false, true); + case 5 -> { + image = flipImage(image, true, false); + yield rotateImage(image, 270); + } + case 6 -> // 旋转90度 + rotateImage(image, 90); + case 7 -> { + image = flipImage(image, true, false); + yield rotateImage(image, 90); + } + case 8 -> // 旋转270度 + rotateImage(image, 270); + default -> image; + }; + } + + /** + * 旋转图片 + */ + private BufferedImage rotateImage(BufferedImage image, double degrees) { + double radians = Math.toRadians(degrees); + double sin = Math.abs(Math.sin(radians)); + double cos = Math.abs(Math.cos(radians)); + + int width = image.getWidth(); + int height = image.getHeight(); + + int newWidth = (int) Math.floor(width * cos + height * sin); + int newHeight = (int) Math.floor(height * cos + width * sin); + + BufferedImage rotated = new BufferedImage(newWidth, newHeight, image.getType()); + Graphics2D g = rotated.createGraphics(); + + g.translate((newWidth - width) / 2, (newHeight - height) / 2); + g.rotate(Math.toRadians(degrees), width / 2.0, height / 2.0); + g.drawRenderedImage(image, null); + g.dispose(); + + return rotated; + } + + /** + * 翻转图片 + */ + private BufferedImage flipImage(BufferedImage image, boolean horizontal, boolean vertical) { + int width = image.getWidth(); + int height = image.getHeight(); + + BufferedImage flipped = new BufferedImage(width, height, image.getType()); + Graphics2D g = flipped.createGraphics(); + + if (horizontal && vertical) { + g.drawImage(image, width, height, -width, -height, null); + } else if (horizontal) { + g.drawImage(image, width, 0, -width, height, null); + } else if (vertical) { + g.drawImage(image, 0, height, width, -height, null); + } else { + g.drawImage(image, 0, 0, null); + } + + g.dispose(); + return flipped; + } + + private byte[] compressWithQuality(BufferedImage image, float quality) throws IOException { // 获取JPEG编码器 ImageWriter writer = ImageIO.getImageWritersByFormatName("jpeg").next(); diff --git a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java index cdcc13eb..a6eeb1c5 100644 --- a/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java +++ b/ruoyi-modules/Sis/src/main/java/org/dromara/sis/service/impl/SisAlarmEventProcessServiceImpl.java @@ -153,7 +153,7 @@ public class SisAlarmEventProcessServiceImpl implements ISisAlarmEventProcessSer return null; } // 加载附件列表 - List sisAlarmEventAttachmentsVos = sisAlarmEventAttachmentsService.queryListByAlarmId(alarmId); + List sisAlarmEventAttachmentsVos = sisAlarmEventAttachmentsService.queryListByAlarmId(sisAlarmEventProcessVo.getId()); sisAlarmEventProcessVo.setAttachments(sisAlarmEventAttachmentsVos); return sisAlarmEventProcessVo; } diff --git a/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties b/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties index ef3ece6a..4385908f 100644 --- a/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties +++ b/ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties @@ -40,9 +40,9 @@ spring.sql.init.platform=mysql db.num=1 ### Connect URL of DB: -db.url.0=jdbc:mysql://10.20.1.65:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true +db.url.0=jdbc:mysql://113.249.101.254:18000/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true db.user.0=root -db.password.0=By@2025! +db.password.0=by@2025?? ### the maximum retry times for push nacos.config.push.maxRetryTime=50