|
@@ -14,6 +14,7 @@ import com.jd.zfjyjgfwpt.configer.TrialConfigs;
|
|
|
import com.jd.zfjyjgfwpt.entity.ApiResponse;
|
|
|
import com.jd.zfjyjgfwpt.entity.PagingInfo;
|
|
|
import com.jd.zfjyjgfwpt.entity.PagingResponse;
|
|
|
+import com.jd.zfjyjgfwpt.entity.TradeRecord;
|
|
|
import com.jd.zfjyjgfwpt.entity.ykb.TrialSession;
|
|
|
import com.jd.zfjyjgfwpt.service.CaptchaService;
|
|
|
import com.jd.zfjyjgfwpt.service.FrontServiceI;
|
|
@@ -815,4 +816,66 @@ public class FrontController extends BaseController {
|
|
|
final PagingResponse<Object> pagingResponse = service.getCompanyStoreInfoListById(params);
|
|
|
writeJson(pagingResponse);
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("appraise")
|
|
|
+ public void appraise(TradeRecord tradeRec, String phone, String verifyCode, Integer satisfaction, String content) {
|
|
|
+ if (Blank.isEmpty(phone, verifyCode, satisfaction, content) || tradeRec.isEmpty()) {
|
|
|
+ sendJson(false, ConstString.REQUEST_WRONGPARAMS, null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 校验验证码
|
|
|
+ String storeCode = Convert.toStr(redisTemplate.opsForValue().get(projectConfig.getRedisSavePhoneNumPrefix() + phone));
|
|
|
+ if (!verifyCode.equals(storeCode)) {
|
|
|
+ sendJson(false, "输入的验证码不正确!", null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("phone", phone);
|
|
|
+ map.put("satisfaction", satisfaction);
|
|
|
+ map.put("content", content);
|
|
|
+
|
|
|
+ sendJson(service.appraise(map, tradeRec), "", null);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param tradeRec type=2时,id=tradeRec.id,name=tradeRec.address(非必须)
|
|
|
+ * @param phone
|
|
|
+ * @param verifyCode
|
|
|
+ * @param content
|
|
|
+ * @param type 投诉类型(0:公司,1:经纪人,2:交易记录)
|
|
|
+ * @param id 被投诉方ID(type=0:社会统一信用代码;type=1:从业人员编号)
|
|
|
+ * @param name 被投诉方名称(type=0:公司名称;type=1:经纪人名称)
|
|
|
+ */
|
|
|
+ @PostMapping("complaint")
|
|
|
+ public void complaint(TradeRecord tradeRec, String phone, String verifyCode, String content, Integer type, String respondentId, String respondentName) {
|
|
|
+ if (Blank.isEmpty(phone, verifyCode, content, type)) {
|
|
|
+ sendJson(false, ConstString.REQUEST_WRONGPARAMS, null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((type == 2 && tradeRec.isEmpty()) || (type != 2 && Blank.isEmpty(respondentId, respondentName))) {
|
|
|
+ sendJson(false, ConstString.REQUEST_WRONGPARAMS, null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 校验验证码
|
|
|
+ String storeCode = Convert.toStr(redisTemplate.opsForValue().get(projectConfig.getRedisSavePhoneNumPrefix() + phone));
|
|
|
+ if (!verifyCode.equals(storeCode)) {
|
|
|
+ sendJson(false, "输入的验证码不正确!", null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("phone", phone);
|
|
|
+ map.put("content", content);
|
|
|
+ map.put("type", type);
|
|
|
+ map.put("id", respondentId);
|
|
|
+ map.put("name", respondentName);
|
|
|
+
|
|
|
+ sendJson(service.complaint(map, tradeRec), "", null);
|
|
|
+
|
|
|
+ }
|
|
|
}
|