main
Dayu 12 months ago
parent 1f4d2ed521
commit 06df1d313c
  1. 10
      src/main/java/org/energy/modules/inspection/controller/InspectionPlanController.java
  2. 10
      src/main/java/org/energy/modules/inspection/controller/InspectionRouteController.java
  3. 8
      src/main/java/org/energy/modules/inspection/controller/InspectionTasksController.java
  4. 12
      src/main/java/org/energy/modules/inspection/mapper/InspectionTasksMapper.xml

@ -141,7 +141,7 @@ public class InspectionPlanController extends DafController {
public R submit(@Valid @RequestBody InspectionPlan inspectionPlan) {
inspectionPlan.setPlanStatus(1);
String date = LocalDate.now().toString().replace("-","");
String maxNo = inspectionPlanService.getMaxNo("'%" + date + "%'");
String maxNo = inspectionPlanService.getMaxNo(date);
int number;
if (StringUtil.isNotEmpty(maxNo)){
number = Integer.parseInt(maxNo.substring(9));
@ -213,12 +213,6 @@ public class InspectionPlanController extends DafController {
@ApiLog
public void exportInspectionRoute(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) {
entity.remove("daf-auth");
entity.forEach((key, value) -> {
if (!"planStatus".equals(key))
{
entity.put(key, "%" + value + "%");
}
});
InspectionPlan vo = DataUtils.mapToEntity(entity, InspectionPlan::new);
List<InspectionPlanExcel> list = inspectionPlanService.export(vo);
response.setContentType("application/vnd.ms-excel");
@ -246,7 +240,7 @@ public class InspectionPlanController extends DafController {
@ApiOperationSupport(order = 12)
@ApiOperation(value = "获取路线信息", notes = "获取路线信息")
public R<InspectionPlan> getDetail(String planNo) {
InspectionPlan detail = inspectionPlanService.getDetail("'" + planNo + "'");
InspectionPlan detail = inspectionPlanService.getDetail(planNo);
return R.data(detail);
}
}

@ -141,7 +141,7 @@ public class InspectionRouteController extends DafController {
public R submit(@Valid @RequestBody InspectionRoute inspectionRoute) {
inspectionRoute.setIstatus(1);
String date = LocalDate.now().toString().replace("-","");
String maxNo = inspectionRouteService.getMaxNo("'%" + date + "%'");
String maxNo = inspectionRouteService.getMaxNo(date);
int number;
if (StringUtil.isNotEmpty(maxNo)){
number = Integer.parseInt(maxNo.substring(9));
@ -214,12 +214,6 @@ public class InspectionRouteController extends DafController {
@ApiLog
public void exportInspectionRoute(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) {
entity.remove("daf-auth");
entity.forEach((key, value) -> {
if (!"istatus".equals(key))
{
entity.put(key, "%" + value + "%");
}
});
InspectionRoute vo = DataUtils.mapToEntity(entity, InspectionRoute::new);
List<InspectionRouteExcel> list = inspectionRouteService.export(vo);
response.setContentType("application/vnd.ms-excel");
@ -247,7 +241,7 @@ public class InspectionRouteController extends DafController {
@ApiOperationSupport(order = 12)
@ApiOperation(value = "获取路线信息", notes = "获取路线信息")
public R<InspectionRoute> getDetailList(String routeNo) {
InspectionRoute DetailList = inspectionRouteService.getDetailList("'" + routeNo + "'");
InspectionRoute DetailList = inspectionRouteService.getDetailList(routeNo);
return R.data(DetailList);
}

@ -162,7 +162,7 @@ public class InspectionTasksController extends DafController {
public R submit(@Valid @RequestBody InspectionTasks inspectionTasks) {
inspectionTasks.setTaskStatus(1L);
String date = LocalDate.now().toString().replace("-","");
String maxTaskNo = inspectionTasksService.getMaxTaskNo("'%" + date + "%'");
String maxTaskNo = inspectionTasksService.getMaxTaskNo(date);
int number;
if (StringUtil.isNotEmpty(maxTaskNo)){
number = Integer.parseInt(maxTaskNo.substring(9));
@ -232,12 +232,6 @@ public class InspectionTasksController extends DafController {
@ApiLog
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) {
entity.remove("daf-auth");
entity.forEach((key, value) -> {
if (!"station".equals(key) && !"taskStatus".equals(key))
{
entity.put(key, "%" + value + "%");
}
});
InspectionTasks vo = DataUtils.mapToEntity(entity, InspectionTasks::new);
List<InspectionTasksExcel> list = inspectionTasksService.export(vo);
response.setContentType("application/vnd.ms-excel");

@ -44,22 +44,22 @@
LEFT JOIN sys_dict dic2 ON dic2.code = 'task_status' AND dic2.dict_key = a.task_status AND dic2.is_deleted = '0'
WHERE a.is_deleted = 0
<if test="entity.taskNo != null and entity.taskNo != ''">
AND a.task_no LIKE #{entity.taskNo}
AND a.task_no LIKE CONCAT('%', #{entity.taskNo}, '%')
</if>
<if test="entity.taskName != null and entity.taskName != ''">
AND a.task_name LIKE #{entity.taskName}
AND a.task_name LIKE CONCAT('%', #{entity.taskName}, '%')
</if>
<if test="entity.station != null and entity.station != ''">
AND a.station = #{entity.station}
</if>
<if test="entity.taskStartDate != null and entity.taskStartDate != ''">
AND a.task_start_date LIKE #{entity.taskStartDate}
AND a.task_start_date LIKE CONCAT('%', #{entity.taskStartDate}, '%')
</if>
<if test="entity.taskEndDate != null and entity.taskEndDate != ''">
AND a.task_end_date LIKE #{entity.taskEndDate}
AND a.task_end_date LIKE CONCAT('%', #{entity.taskEndDate}, '%')
</if>
<if test="entity.responsiblePerson != null and entity.responsiblePerson != ''">
AND a.responsible_person LIKE #{entity.responsiblePerson}
AND a.responsible_person LIKE CONCAT('%', #{entity.responsiblePerson}, '%')
</if>
<if test="entity.taskStatus != null and entity.taskStatus != ''">
AND a.task_status = #{entity.taskStatus}
@ -68,7 +68,7 @@
<select id="getMaxTaskNO" resultType="java.lang.String">
SELECT max(task_no)
FROM i_inspection_tasks where task_no like ${date}
FROM i_inspection_tasks where task_no like CONCAT('%', #{date}, '%')
</select>
<select id="getListByToolsCodeId" resultMap="inspectionTasksResultMap">

Loading…
Cancel
Save