Commit dacbb98e authored by 韩桐桐's avatar 韩桐桐

feat(cyl):资质附件,轮播图用

parent e2c12ab5
...@@ -111,7 +111,9 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> { ...@@ -111,7 +111,9 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
List<CylinderInfoDto> queryCylinderOfInspectionOverdue(); List<CylinderInfoDto> queryCylinderOfInspectionOverdue();
List<CylinderInfoDto> queryCylinderOfUnqualifiedQuestion(); List<CylinderInfoDto> queryCylinderOfUnqualifiedQuestion();
List<Map<String, Object>> countFillingTimesAndQuantityByCity(); List<Map<String, Object>> countFillingTimesAndQuantityByCity();
String getAttachmentByUnitCode (@Param("appId") String appId);
} }
...@@ -414,6 +414,16 @@ ...@@ -414,6 +414,16 @@
GROUP BY regionCode GROUP BY regionCode
</select> </select>
<select id="getAttachmentByUnitCode" resultType="java.lang.String">
select qualification_certificate_attachment as qualificationCertificateAttachment
FROM view_cylinder_unit_info
<where>
<if test="appId != null and appId != ''">
"app_id" = #{appId}
</if>
</where>
</select>
<select id="countNumber" resultType="java.lang.Integer"> <select id="countNumber" resultType="java.lang.Integer">
SELECT count(DISTINCT(onlyCode)) SELECT count(DISTINCT(onlyCode))
FROM( FROM(
......
package com.yeejoin.amos.boot.module.cylinder.flc.biz.controller; package com.yeejoin.amos.boot.module.cylinder.flc.biz.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -51,6 +52,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -51,6 +52,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 气瓶基本信息 * 气瓶基本信息
...@@ -1364,4 +1366,25 @@ public class CylinderInfoController extends BaseController { ...@@ -1364,4 +1366,25 @@ public class CylinderInfoController extends BaseController {
public ResponseModel<Map<String, Object>> countFillingTimesAndQuantityByCity() { public ResponseModel<Map<String, Object>> countFillingTimesAndQuantityByCity() {
return ResponseHelper.buildResponse(cylinderInfoServiceImpl.countFillingTimesAndQuantityByCity()); return ResponseHelper.buildResponse(cylinderInfoServiceImpl.countFillingTimesAndQuantityByCity());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "资质附件,轮播图用")
@GetMapping(value = "/getAttachmentByUnitCode")
public ResponseModel<List<String>> getAttachmentByUnitCode(String unitCode) {
List<String> result = new ArrayList<>();
String attachmentByUnitCode = cylinderInfoServiceImpl.getBaseMapper().getAttachmentByUnitCode(unitCode);
if (attachmentByUnitCode != null && !attachmentByUnitCode.isEmpty()) {
JSONArray jsonArray = JSON.parseArray(attachmentByUnitCode);
if (jsonArray != null) {
jsonArray.stream()
.filter(JSONObject.class::isInstance)
.map(JSONObject.class::cast)
.map(obj -> obj.getString("url"))
.filter(Objects::nonNull)
.forEach(result::add);
}
}
return ResponseHelper.buildResponse(result);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment