Commit f43dbd08226735630192771eb42c69a768129db0
1 parent
7229a917
app巡查计划明细提交
Showing
6 changed files
with
203 additions
and
1 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/AppInspectionPlanCommitController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.inspectionplan; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | ||
| 5 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitRespVO; | ||
| 6 | +import com.zteits.urbanops.module.garden.service.inspectionplan.InspectionPlanCommitService; | ||
| 7 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 9 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 10 | +import jakarta.annotation.Resource; | ||
| 11 | +import jakarta.validation.constraints.NotBlank; | ||
| 12 | +import org.springframework.validation.annotation.Validated; | ||
| 13 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 14 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 15 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 16 | +import org.springframework.web.bind.annotation.RestController; | ||
| 17 | + | ||
| 18 | +import java.util.List; | ||
| 19 | + | ||
| 20 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | ||
| 21 | + | ||
| 22 | +@Tag(name = "APP管理 - 巡检计划提交明细") | ||
| 23 | +@RestController | ||
| 24 | +@RequestMapping("/app/garden/inspection-plan-commit/") | ||
| 25 | +@Validated | ||
| 26 | +public class AppInspectionPlanCommitController { | ||
| 27 | + | ||
| 28 | + @Resource | ||
| 29 | + private InspectionPlanCommitService inspectionPlanCommitService; | ||
| 30 | + | ||
| 31 | + @GetMapping("/get/by/plan_no") | ||
| 32 | + @Operation(summary = "获得巡检计划提交明细") | ||
| 33 | + @Parameter(name = "plan_no", description = "计划编号", required = true, example = "1024") | ||
| 34 | + //@PreAuthorize("@ss.hasPermission('garden:inspection-plan-commit:query')") | ||
| 35 | + public CommonResult<List<AppInspectionPlanCommitRespVO>> appInspectionPlanCommitListByPlanNo(@RequestParam("plan_no") @NotBlank String planNo) { | ||
| 36 | + List<AppInspectionPlanCommitRespVO> list = inspectionPlanCommitService.appInspectionPlanCommitListByPlanNo(planNo); | ||
| 37 | + return success(list); | ||
| 38 | + } | ||
| 39 | +} |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanCommitRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo; | ||
| 2 | + | ||
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 8 | + | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 12 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 13 | + | ||
| 14 | +@Schema(description = "管理后台 - 巡检计划提交明细 Response VO") | ||
| 15 | +@Data | ||
| 16 | +@ExcelIgnoreUnannotated | ||
| 17 | +public class AppInspectionPlanCommitRespVO { | ||
| 18 | + | ||
| 19 | + @Schema(description = "计划编码") | ||
| 20 | + @ExcelProperty("计划编码") | ||
| 21 | + private String planNo; | ||
| 22 | + | ||
| 23 | + @Schema(description = "计划名称") | ||
| 24 | + @ExcelProperty("计划名称") | ||
| 25 | + private String planName; | ||
| 26 | + | ||
| 27 | + @Schema(description = "排序号:第n次计划", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 28 | + private Integer sortNum; | ||
| 29 | + | ||
| 30 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政") | ||
| 31 | + private String busiLine; | ||
| 32 | + | ||
| 33 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | ||
| 34 | + private Long roadId; | ||
| 35 | + | ||
| 36 | + @Schema(description = "道路", requiredMode = Schema.RequiredMode.REQUIRED, example = "32704") | ||
| 37 | + private String roadName; | ||
| 38 | + | ||
| 39 | + @Schema(description = "计划属性:1:标准计划;2:临时计划", example = "1") | ||
| 40 | + private Integer planAttr; | ||
| 41 | + | ||
| 42 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", example = "24742") | ||
| 43 | + private Integer planTypeId; | ||
| 44 | + | ||
| 45 | + @Schema(description = "计划次数") | ||
| 46 | + private Integer planNum; | ||
| 47 | + | ||
| 48 | + @Schema(description = "完成次数") | ||
| 49 | + private Integer planFinishNum; | ||
| 50 | + | ||
| 51 | + @Schema(description = "完成状态 1:未完成;2:已完成;", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 52 | + private Integer finishState; | ||
| 53 | + | ||
| 54 | + @Schema(description = "图片地址host") | ||
| 55 | + private String imgHost; | ||
| 56 | + | ||
| 57 | + @Schema(description = "巡检照片") | ||
| 58 | + private String img; | ||
| 59 | + | ||
| 60 | + @Schema(description = "巡检照片") | ||
| 61 | + private List<String> imgList; | ||
| 62 | + | ||
| 63 | + @Schema(description = "巡检结果: 1:正常;2:异常") | ||
| 64 | + private Integer inspectionState; | ||
| 65 | + | ||
| 66 | + @Schema(description = "转交状态: 1:未转交;2:已转交") | ||
| 67 | + private Integer transState; | ||
| 68 | + | ||
| 69 | + @Schema(description = "转交问题单编码") | ||
| 70 | + private String transWorkNo; | ||
| 71 | + | ||
| 72 | + @Schema(description = "完成时间") | ||
| 73 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 74 | + private LocalDateTime finishTime; | ||
| 75 | + | ||
| 76 | + @Schema(description = "提交人用户ID", example = "32294") | ||
| 77 | + private Long userId; | ||
| 78 | + | ||
| 79 | + @Schema(description = "提交人", example = "芋艿") | ||
| 80 | + private String userName; | ||
| 81 | + | ||
| 82 | + @Schema(description = "备注", example = "你猜") | ||
| 83 | + private String remark; | ||
| 84 | + | ||
| 85 | + | ||
| 86 | + | ||
| 87 | +} | ||
| 0 | \ No newline at end of file | 88 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanCommitMapper.java
| @@ -4,6 +4,7 @@ import java.util.*; | @@ -4,6 +4,7 @@ import java.util.*; | ||
| 4 | 4 | ||
| 5 | import com.baomidou.mybatisplus.core.metadata.IPage; | 5 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 6 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | 6 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 7 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitRespVO; | ||
| 7 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; | 8 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; |
| 8 | import org.apache.ibatis.annotations.Mapper; | 9 | import org.apache.ibatis.annotations.Mapper; |
| 9 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; | 10 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; |
| @@ -24,5 +25,9 @@ public interface InspectionPlanCommitMapper extends BaseMapperX<InspectionPlanCo | @@ -24,5 +25,9 @@ public interface InspectionPlanCommitMapper extends BaseMapperX<InspectionPlanCo | ||
| 24 | */ | 25 | */ |
| 25 | IPage<InspectionPlanCommitRespVO> selectForPage(@Param("page") IPage<InspectionPlanCommitRespVO> page, @Param("req") InspectionPlanCommitPageReqVO reqDTO); | 26 | IPage<InspectionPlanCommitRespVO> selectForPage(@Param("page") IPage<InspectionPlanCommitRespVO> page, @Param("req") InspectionPlanCommitPageReqVO reqDTO); |
| 26 | 27 | ||
| 27 | - | 28 | + /* |
| 29 | + * app 通过计划编码查询list | ||
| 30 | + * @return 列表 | ||
| 31 | + */ | ||
| 32 | + List<AppInspectionPlanCommitRespVO> appInspectionPlanCommitListByPlanNo(@Param("planNo") String planNo, @Param("busiLineList") List<String> busiLineList); | ||
| 28 | } | 33 | } |
| 29 | \ No newline at end of file | 34 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitService.java
| 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; | 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; |
| 2 | 2 | ||
| 3 | import java.util.*; | 3 | import java.util.*; |
| 4 | + | ||
| 5 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitRespVO; | ||
| 4 | import jakarta.validation.*; | 6 | import jakarta.validation.*; |
| 5 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; | 7 | import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; |
| 6 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; | 8 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; |
| @@ -58,4 +60,12 @@ public interface InspectionPlanCommitService { | @@ -58,4 +60,12 @@ public interface InspectionPlanCommitService { | ||
| 58 | */ | 60 | */ |
| 59 | PageResult<InspectionPlanCommitRespVO> getInspectionPlanCommitPage(InspectionPlanCommitPageReqVO pageReqVO); | 61 | PageResult<InspectionPlanCommitRespVO> getInspectionPlanCommitPage(InspectionPlanCommitPageReqVO pageReqVO); |
| 60 | 62 | ||
| 63 | + /** | ||
| 64 | + * app获得巡检计划提交明细 | ||
| 65 | + * | ||
| 66 | + * @param planNo 编号 | ||
| 67 | + * @return 巡检计划提交明细 | ||
| 68 | + */ | ||
| 69 | + List<AppInspectionPlanCommitRespVO> appInspectionPlanCommitListByPlanNo(String planNo); | ||
| 70 | + | ||
| 61 | } | 71 | } |
| 62 | \ No newline at end of file | 72 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitServiceImpl.java
| @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 4 | import com.zteits.urbanops.framework.common.util.string.StrUtils; | 4 | import com.zteits.urbanops.framework.common.util.string.StrUtils; |
| 5 | import com.zteits.urbanops.framework.mybatis.core.util.MyBatisUtils; | 5 | import com.zteits.urbanops.framework.mybatis.core.util.MyBatisUtils; |
| 6 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | 6 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 7 | +import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitRespVO; | ||
| 7 | import com.zteits.urbanops.module.system.api.dept.DeptApi; | 8 | import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 8 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; | 9 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 9 | import org.apache.commons.lang3.StringUtils; | 10 | import org.apache.commons.lang3.StringUtils; |
| @@ -103,6 +104,21 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ | @@ -103,6 +104,21 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ | ||
| 103 | return new PageResult<>(imgProcess(page.getRecords()), page.getTotal()); | 104 | return new PageResult<>(imgProcess(page.getRecords()), page.getTotal()); |
| 104 | } | 105 | } |
| 105 | 106 | ||
| 107 | + @Override | ||
| 108 | + public List<AppInspectionPlanCommitRespVO> appInspectionPlanCommitListByPlanNo(String planNo) { | ||
| 109 | + String busiLine = SecurityFrameworkUtils.getBusiLine(); | ||
| 110 | + List<String> busiLineList = new ArrayList<>(); | ||
| 111 | + if (StringUtils.isNotEmpty(busiLine)) { | ||
| 112 | + busiLineList = Arrays.asList(busiLine.split(",")); | ||
| 113 | + } | ||
| 114 | + List<AppInspectionPlanCommitRespVO> list = inspectionPlanCommitMapper.appInspectionPlanCommitListByPlanNo(planNo, busiLineList); | ||
| 115 | + | ||
| 116 | + list.forEach(e -> { | ||
| 117 | + e.setImgList(StrUtils.imgProcess(e.getImg(), e.getImgHost())); | ||
| 118 | + }); | ||
| 119 | + return list; | ||
| 120 | + } | ||
| 121 | + | ||
| 106 | /** | 122 | /** |
| 107 | * 回填部门/公司/角色 | 123 | * 回填部门/公司/角色 |
| 108 | * @param list 分页对象 | 124 | * @param list 分页对象 |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanCommitMapper.xml
| @@ -87,4 +87,49 @@ | @@ -87,4 +87,49 @@ | ||
| 87 | 87 | ||
| 88 | order by a.id desc | 88 | order by a.id desc |
| 89 | </select> | 89 | </select> |
| 90 | + | ||
| 91 | + <select id="appInspectionPlanCommitListByPlanNo" resultType="com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanCommitRespVO"> | ||
| 92 | + SELECT | ||
| 93 | + a.batch_no, | ||
| 94 | + b.plan_no, | ||
| 95 | + a.plan_name, | ||
| 96 | + a.busi_line, | ||
| 97 | + b.sort_num, | ||
| 98 | + a.road_id, | ||
| 99 | + a.road_name, | ||
| 100 | + a.plan_attr, | ||
| 101 | + a.plan_type_id, | ||
| 102 | + a.rate, | ||
| 103 | + a.cycle_id, | ||
| 104 | + b.plan_num, | ||
| 105 | + b.plan_finish_num, | ||
| 106 | + b.finish_state, | ||
| 107 | + c.img_host, | ||
| 108 | + c.img, | ||
| 109 | + c.inspection_state, | ||
| 110 | + c.trans_state, | ||
| 111 | + c.trans_work_no, | ||
| 112 | + b.begin_time, | ||
| 113 | + b.end_time, | ||
| 114 | + c.user_id, | ||
| 115 | + c.user_name, | ||
| 116 | + c.finish_time, | ||
| 117 | + c.remark | ||
| 118 | + FROM | ||
| 119 | + garden_inspection_plan a, | ||
| 120 | + garden_inspection_plan_detail b, | ||
| 121 | + garden_inspection_plan_commit c | ||
| 122 | + WHERE a.batch_no = b.batch_no | ||
| 123 | + AND b.plan_no=c.plan_no | ||
| 124 | + AND a.dept_id =b.dept_id | ||
| 125 | + AND a.deleted = b.deleted | ||
| 126 | + AND a.deleted = 0 | ||
| 127 | + AND b.plan_no = #{planNo} | ||
| 128 | + <if test="busiLineList != null and busiLineList.size() > 0"> | ||
| 129 | + AND a.busi_line IN | ||
| 130 | + <foreach collection="busiLineList" item="id" open="(" separator="," close=")"> | ||
| 131 | + #{id} | ||
| 132 | + </foreach> | ||
| 133 | + </if> | ||
| 134 | + </select> | ||
| 90 | </mapper> | 135 | </mapper> |
| 91 | \ No newline at end of file | 136 | \ No newline at end of file |