Commit ffe1e3d0 authored by 谢希宇's avatar 谢希宇

Merge branch 'master' of http://106.14.62.141:8081/sa_aidea/aidea

parents 5fb19f0c b891a6a3
......@@ -56,5 +56,5 @@ public interface CouponrecordMapper extends GenericDao<Couponrecord> {
* @param facilityNo
* @return
*/
Long getHospitalIdByfaNo(String facilityNo);
Map<String,Object> getHospitalIdByfaNo(String facilityNo);
}
\ No newline at end of file
......@@ -313,7 +313,7 @@
FROM t_aidea_coupon_record
where number = #{number}
</select>
<select id="getHospitalIdByfaNo" resultType="java.lang.Long">
<select id="getHospitalIdByfaNo" resultType="map">
SELECT id
FROM t_aidea_hospital t
WHERE t.facility_no = #{facilityNo}
......
......@@ -45,7 +45,9 @@ public class PdaCouponrecordServiceImpl implements PdaCouponrecordService {
Couponrecord info = couponrecordMapper.isWriteOff(number);
if(info!=null){
if(info.getStatus().equals("1")){
long hospitalId = couponrecordMapper.getHospitalIdByfaNo(facilityNo);
Map<String,Object> map1= couponrecordMapper.getHospitalIdByfaNo(facilityNo);
if(map1!=null&&map1.size()>0){
long hospitalId = Long.valueOf(map1.get("id")+"");
info.setStatus("2");
info.setVerifDate(new Date());
info.setFacilityNo(facilityNo);
......@@ -57,6 +59,15 @@ public class PdaCouponrecordServiceImpl implements PdaCouponrecordService {
map.put("id",logId);
map.put("resultJson",rtnJson.toString());
map.put("status",2);
}else{
rtnJson.put("code", 500);
rtnJson.put("msg", "未找到设备号对应的医院!");
map = new HashMap<String,Object>();
map.put("id",logId);
map.put("resultJson",rtnJson.toString());
map.put("status",1);
couponrecordMapper.updatePdaLog(map);
}
}else if(info.getStatus().equals("0")){
rtnJson.put("code", 500);
rtnJson.put("msg", "检测券未激活!");
......@@ -65,7 +76,7 @@ public class PdaCouponrecordServiceImpl implements PdaCouponrecordService {
map.put("resultJson",rtnJson.toString());
map.put("status",1);
}else if(info.getStatus().equals("2")){
rtnJson.put("code", 500);
rtnJson.put("code", 201);
rtnJson.put("msg", "检测券已使用!");
map = new HashMap<String,Object>();
map.put("id",logId);
......
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