Commit d427e04a authored by fanjr's avatar fanjr

检测结果接口

parent fabbc708
......@@ -17,5 +17,5 @@ public interface CheckresultMapper extends GenericDao<Checkresult> {
List<Map<String,Object>> checkResultsList(CheckresultVo vo);
Checkresult fetchById(Long id);
Checkresult checkCouponByNumber(String number);
}
\ No newline at end of file
......@@ -274,4 +274,10 @@
limit #{page}, #{pageSize}
</if>
</select>
<select id="checkCouponByNumber" parameterType="java.lang.String" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_check_result t
WHERE t.number=#{number}
</select>
</mapper>
\ No newline at end of file
......@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.cftech.checkresult.model.Checkresult;
import com.cftech.checkresult.model.CheckresultVo;
import com.cftech.core.generic.GenericService;
import com.cftech.couponrecord.model.CouponrecordVo;
/**
* 检测结果管理Service
*
......@@ -28,4 +30,13 @@ public interface CheckresultService extends GenericService<Checkresult> {
* @return
**/
JSONObject fetchById(CheckresultVo vo);
/**
* @Author Fanjr
* @Description 检测详情
* @Date 2021年1月29日
* @Param
* @return
**/
JSONObject checkCouponByNumber(CouponrecordVo vo);
}
......@@ -10,6 +10,7 @@ import com.cftech.checkresult.service.CheckresultService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.cftech.couponrecord.model.CouponrecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
......@@ -42,7 +43,7 @@ return checkresultMapper;
JSONObject rtnJson = new JSONObject();
try {
List<Map<String,Object>> consultResult = checkresultMapper.checkResultsList(vo);
if (consultResult != null) {
if (consultResult != null&&consultResult.size()>0) {
rtnJson.put("errorNo", 0);
rtnJson.put("data", consultResult);
} else {
......@@ -75,4 +76,23 @@ return checkresultMapper;
return rtnJson;
}
public JSONObject checkCouponByNumber(CouponrecordVo vo){
JSONObject rtnJson = new JSONObject();
try {
com.cftech.checkresult.model.Checkresult info =checkresultMapper.checkCouponByNumber(vo.getNumber());
if (info != null) {
rtnJson.put("errorCode", 0);
rtnJson.put("data", info);
} else {
rtnJson.put("errorCode", 1);
rtnJson.put("errorMsg", "暂无数据");
}
} catch (Exception e) {
e.printStackTrace();
rtnJson.put("errorCode", 1);
rtnJson.put("errorMsg", "检测结果详情" + e.getMessage());
}
return rtnJson;
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.cftech.checkresult.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.checkresult.service.CheckresultService;
import com.cftech.couponrecord.model.CouponrecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -47,4 +48,19 @@ public class MobileCheckresultController {
return checkresultService.fetchById(vo);
}
/**
* @Author Fanjr
* @Description 检测结果详情
* @Date 2021年1月29日
* @Param
* @return
**/
@RequestMapping(value = "/checkCouponByNumber",
method = {RequestMethod.GET, RequestMethod.POST},
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject checkCouponByNumber(CouponrecordVo vo) {
return checkresultService.checkCouponByNumber(vo);
}
}
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