main
Dayu 12 months ago
parent 26573975fc
commit ccab9a4fe3
  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. 10
      src/main/java/org/energy/modules/inspection/mapper/InspectionPlanMapper.xml
  4. 10
      src/main/java/org/energy/modules/inspection/mapper/InspectionRouteMapper.xml

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

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

@ -36,16 +36,16 @@
LEFT JOIN sys_dict dic2 ON dic2.code = 'istatus' AND dic2.dict_key = a.plan_status AND dic2.is_deleted = '0' LEFT JOIN sys_dict dic2 ON dic2.code = 'istatus' AND dic2.dict_key = a.plan_status AND dic2.is_deleted = '0'
WHERE a.is_deleted = 0 WHERE a.is_deleted = 0
<if test="entity.planNo != null and entity.planNo != ''"> <if test="entity.planNo != null and entity.planNo != ''">
AND a.plan_no LIKE #{entity.planNo} AND a.plan_no LIKE CONCAT('%', #{entity.planNo}, '%')
</if> </if>
<if test="entity.planName != null and entity.planName != ''"> <if test="entity.planName != null and entity.planName != ''">
AND a.plan_name LIKE #{entity.planName} AND a.plan_name LIKE CONCAT('%', #{entity.planName}, '%')
</if> </if>
<if test="entity.station != null and entity.station != ''"> <if test="entity.station != null and entity.station != ''">
AND a.station = #{entity.station} AND a.station = #{entity.station}
</if> </if>
<if test="entity.periodType != null and entity.periodType != ''"> <if test="entity.periodType != null and entity.periodType != ''">
AND a.period_type LIKE #{entity.periodType} AND a.period_type LIKE CONCAT('%', #{entity.periodType}, '%')
</if> </if>
<if test="entity.planStatus != null and entity.planStatus != ''"> <if test="entity.planStatus != null and entity.planStatus != ''">
AND a.plan_status = #{entity.planStatus} AND a.plan_status = #{entity.planStatus}
@ -58,11 +58,11 @@
<select id="getMaxNo" resultType="java.lang.String"> <select id="getMaxNo" resultType="java.lang.String">
SELECT max(plan_no) SELECT max(plan_no)
FROM i_inspection_plan where plan_no like ${date} FROM i_inspection_plan where plan_no like CONCAT('%', #{date}, '%')
</select> </select>
<select id="getDetail" resultMap="inspectionPlanResultMap"> <select id="getDetail" resultMap="inspectionPlanResultMap">
select plan_name, plan_type from i_inspection_plan where plan_no = ${plan_no} select plan_name, plan_type from i_inspection_plan where plan_no = #{plan_no}
</select> </select>
</mapper> </mapper>

@ -33,16 +33,16 @@
LEFT JOIN sys_dict dic2 ON dic2.code = 'istatus' AND dic2.dict_key = a.istatus AND dic2.is_deleted = '0' LEFT JOIN sys_dict dic2 ON dic2.code = 'istatus' AND dic2.dict_key = a.istatus AND dic2.is_deleted = '0'
WHERE a.is_deleted = 0 WHERE a.is_deleted = 0
<if test="entity.routeNo != null and entity.routeNo != ''"> <if test="entity.routeNo != null and entity.routeNo != ''">
AND a.route_no LIKE #{entity.routeNo} AND a.route_no LIKE CONCAT('%', #{entity.routeNo}, '%')
</if> </if>
<if test="entity.routeName != null and entity.routeName != ''"> <if test="entity.routeName != null and entity.routeName != ''">
AND a.route_name LIKE #{entity.routeName} AND a.route_name LIKE CONCAT('%', #{entity.routeName}, '%')
</if> </if>
<if test="entity.stations != null and entity.stations != ''"> <if test="entity.stations != null and entity.stations != ''">
AND a.stations = #{entity.stations} AND a.stations = #{entity.stations}
</if> </if>
<if test="entity.type != null and entity.type != ''"> <if test="entity.type != null and entity.type != ''">
AND a.type LIKE #{entity.type} AND a.type LIKE CONCAT('%', #{entity.type}, '%')
</if> </if>
<if test="entity.istatus != null and entity.istatus != ''"> <if test="entity.istatus != null and entity.istatus != ''">
AND a.istatus = #{entity.istatus} AND a.istatus = #{entity.istatus}
@ -55,11 +55,11 @@
<select id="getMaxNo" resultType="java.lang.String"> <select id="getMaxNo" resultType="java.lang.String">
SELECT max(route_no) SELECT max(route_no)
FROM i_inspection_route where route_no like ${date} FROM i_inspection_route where route_no like CONCAT('%', #{date}, '%')
</select> </select>
<select id="getDetailList" resultMap="inspectionRouteResultMap"> <select id="getDetailList" resultMap="inspectionRouteResultMap">
select route_name, type from i_inspection_route where route_no = ${route_no} select route_name, type from i_inspection_route where route_no = #{route_no}
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save