|
@@ -28,7 +28,6 @@ import org.springframework.web.bind.WebDataBinder;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -481,167 +480,35 @@ public class DisplaceController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 判断是否支付过保证金
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @GetMapping("/getDisplaceDeposit")
|
|
|
+ public Map<String, Boolean> getDisplaceDeposit(@RequestParam(required = false) String displaceId){
|
|
|
+ Map<String,Boolean> map = new HashMap();
|
|
|
+ Boolean flag=false;
|
|
|
+ if (StringUtils.isBlank(displaceId)) {
|
|
|
+ LOG.info("displaceId为空");
|
|
|
+ map.put("flag",flag);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
|
|
|
-// @RequestMapping("/appAddInfo2")
|
|
|
-// public void appAddInfo2(String displaceId){
|
|
|
-//
|
|
|
-// try {
|
|
|
-// //获取置换信息
|
|
|
-// DisplaceAudit displaceAuditBean=displaceAuditService.selectDisplaceAuditByDisplaceId(displaceId);
|
|
|
-//
|
|
|
-// LOG.info("更新为已审核待上架");
|
|
|
-//
|
|
|
-// // 记录id
|
|
|
-// String id = displaceAuditBean.getId();
|
|
|
-// // 车商ID
|
|
|
-// String ids = displaceAuditBean.getIds();
|
|
|
-// if(StringUtils.isEmpty(ids)) {
|
|
|
-// LOG.info("addInfo error!=没有推送车商信息");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 销售员ID
|
|
|
-// String saleId = displaceAuditBean.getSaleId();
|
|
|
-// //取出带过来的置换ID
|
|
|
-// DisplaceAuditBean displace = displaceAuditService.queryAuditPageByDisplaceId(displaceId);
|
|
|
-// //设备名称
|
|
|
-// String sbmc = displace.getAttrContent().get("sbpp") + " " + displace.getAttrContent().get("sbxh") + " " + displace.getAttrContent().get("sblx");
|
|
|
-// // 发布时间
|
|
|
-// String pubTimeStr = "";
|
|
|
-// Date pubTime = displaceAuditBean.getPubTime();
|
|
|
-// try {
|
|
|
-// pubTimeStr = DateUtil.format(pubTime, "yyyy年MM月dd日 HH:mm");
|
|
|
-// } catch (Exception e) {
|
|
|
-// pubTimeStr = "";
|
|
|
-// }
|
|
|
-//
|
|
|
-// //存储被推送人 ids
|
|
|
-// displaceAuditBean.setIds(ids);
|
|
|
-// PushRecordBean pushRecord = null;
|
|
|
-// List<PushRecordBean> list = new ArrayList<PushRecordBean>();
|
|
|
-// String agentId=displaceAuditBean.getAgentId();
|
|
|
-// AgentBean agentBean = agentBeanService.getAgentBeanByAgentId(agentId);
|
|
|
-// if(agentBean == null) {
|
|
|
-// resultBean = new PageResultBean(PageResultBean.FAIL_CODE, "未查询到代理商信息!");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// String agentName = agentBean.getAgentName();
|
|
|
-// String appId =agentBean.getPubAppId();
|
|
|
-// String appSecret = agentBean.getPubAppSecret();
|
|
|
-// Date startTime = displaceAuditBean.getStartTime();
|
|
|
-// Date endTime = displaceAuditBean.getEndTime();
|
|
|
-//
|
|
|
-// // 反馈内容
|
|
|
-// // String diggerUrl = TemplateConstants.ZHSH_DIGGER_URL + "?agentId=" + agentId + "&id=" + id;
|
|
|
-// String diggerUrl = "https://www.weigongcheng.net/wjj-api/index.html#/join" + "?agentId=" + agentId + "&displaceId=" + displaceId + "&status=" + displaceAuditBean.getAuditStatus() + "&id=" + id;
|
|
|
-// String sms = TemplateConstants.ZHSH_DIGGER_UP_SMS;
|
|
|
-// sms = sms.replaceAll("agentName", agentName);
|
|
|
-// sms = sms.replaceAll("displaceId", displaceId);
|
|
|
-// sms = sms.replaceAll("sbmc", sbmc);
|
|
|
-//
|
|
|
-// String wxsms = TemplateConstants.ZHSH_DIGGER_TEMPLATE_CONTENT;
|
|
|
-// wxsms = wxsms.replaceAll("first", "有一台设备正在寻找买家");
|
|
|
-// wxsms = wxsms.replaceAll("keyword1", sbmc + "");
|
|
|
-// if ("3".equals(displaceAuditBean.getUpType())) {
|
|
|
-// wxsms = wxsms.replaceAll("keyword2", "最低价:" + displaceAuditBean.getMinPrice() + "万元-最高价:" + displaceAuditBean.getMaxPrice() + "万元");
|
|
|
-// } else {
|
|
|
-// wxsms = wxsms.replaceAll("keyword2", displaceAuditBean.getMinMoney() + "万元");
|
|
|
-// }
|
|
|
-// wxsms = wxsms.replaceAll("keyword3", displaceAuditBean.getMoneyRange() + "万元");
|
|
|
-// wxsms = wxsms.replaceAll("keyword4", DateUtil.format(startTime, "yyyy年MM月dd日 HH:mm"));
|
|
|
-// wxsms = wxsms.replaceAll("keyword5", displaceAuditBean.getBail() + "万元");
|
|
|
-// wxsms = wxsms.replaceAll("remark", "点击【详情】前往查看!");
|
|
|
-//
|
|
|
-// // 发送车商信息
|
|
|
-// String[] diggers = ids.substring(0, ids.lastIndexOf(",")).split(",");
|
|
|
-// for (int i = 0; i < diggers.length; i++) {
|
|
|
-// //获取车商bean,并获取车商微信openid和其他信息
|
|
|
-// DiggerBean digger = diggerBeanService.queryDiggerByID(diggers[i]);
|
|
|
-// if (digger == null) {
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// String openId = digger.getWxOpenID();
|
|
|
-// String wxnc = digger.getDaWxnc();
|
|
|
-// String wxh = digger.getDaWxh();
|
|
|
-// String name = digger.getDaName();
|
|
|
-// String phone = digger.getDaPhone();
|
|
|
-//
|
|
|
-// // 组装车商微信内容
|
|
|
-// Map<String, TemplateData> param1 = new HashMap<String, TemplateData>();
|
|
|
-// param1.put("first", new TemplateData("有一台设备正在寻找买家", "#696969"));
|
|
|
-// param1.put("keyword1", new TemplateData(sbmc + "", "#696969"));
|
|
|
-// if ("3".equals(displaceAuditBean.getUpType())) {
|
|
|
-// param1.put("keyword2", new TemplateData("最低价:" + displaceAuditBean.getMinPrice() + "万元-最高价:" + displaceAuditBean.getMaxPrice() + "万元", "#696969"));
|
|
|
-// } else {
|
|
|
-// param1.put("keyword2", new TemplateData(displaceAuditBean.getMinMoney() + "万元", "#696969"));
|
|
|
-// }
|
|
|
-// param1.put("keyword3", new TemplateData(displaceAuditBean.getMoneyRange() + "万元", "#696969"));
|
|
|
-// param1.put("keyword4", new TemplateData(DateUtil.format(startTime, "yyyy年MM月dd日 HH:mm"), "#696969"));
|
|
|
-// param1.put("keyword5", new TemplateData(displaceAuditBean.getBail() + "万元", "#696969"));
|
|
|
-// param1.put("remark", new TemplateData("点击【详情】前往查看!", "#696969"));
|
|
|
-//
|
|
|
-// wxsms = wxsms.replaceAll("keyword1", wxnc);
|
|
|
-// /* pushRecord = displaceAuditService.pushSms(displaceId, id, sbmc, ConfigConstants.CDMC_ZHSH, agentId, agentName, openId, wxnc, wxh, name, phone, "2",ConfigConstants.XXLB_SBSJ,
|
|
|
-// appId, appSecret, sms, wxsms, param1, diggerUrl, "拍品上架通知");
|
|
|
-// list.add(pushRecord);*/
|
|
|
-// pushRecord = displaceAuditService.pushSms(displaceId, id, sbmc, ConfigConstants.CDMC_ZHSH, agentId, agentName, openId, wxnc, wxh, name, phone, "1", ConfigConstants.XXLB_SBSJ,
|
|
|
-// appId, appSecret, sms, wxsms, param1, diggerUrl, "拍品上架通知");
|
|
|
-// list.add(pushRecord);
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 发送销售员信息
|
|
|
-// if (StringUtils.isNotBlank(saleId)) {
|
|
|
-// SalesBean salesBean = saleBeanService.getSaleBeanBySaleId(saleId);
|
|
|
-// if (salesBean != null) {
|
|
|
-// String openId = salesBean.getWxOpenid();
|
|
|
-// String wxnc = salesBean.getSaleWxnc();
|
|
|
-// String wxh = salesBean.getSaleWxh();
|
|
|
-// String name = salesBean.getSaleName();
|
|
|
-// String phone = salesBean.getSalePhone();
|
|
|
-// String xqurl = "https://www.xxinjiyuan.com/wjj-api/index.html#/join?agentId=GZZSNJ&displaceId=GZZSNJ-ZH0044&status=finished&id=5c8adc199c7f44a8ac398d9edbcd4914";
|
|
|
-// // String saleUrl = TemplateConstants.ZHSH_SALE_URL + "?agentId=" + agentId + "&id=" + id;
|
|
|
-// String saleUrl = "https://www.weigongcheng.net/wjj-api/index.html#/join" + "?agentId=" + agentId + "&displaceId=" + displaceId + "&status=" + displaceAuditBean + "&id=" + id;
|
|
|
-// // 组装销售员微信内容
|
|
|
-// Map<String, TemplateData> param2 = new HashMap<String, TemplateData>();
|
|
|
-// param2.put("first", new TemplateData("您上传的设备已上架成功,等待买家出价", "#696969"));
|
|
|
-// param2.put("keyword1", new TemplateData(wxnc, "#696969"));
|
|
|
-// param2.put("keyword2", new TemplateData(sbmc, "#696969"));
|
|
|
-// param2.put("keyword3", new TemplateData(pubTimeStr, "#696969"));
|
|
|
-// param2.put("keyword4", new TemplateData("上架成功", "#696969"));
|
|
|
-//
|
|
|
-// String upsms = TemplateConstants.ZHSH_SALE_UP_SMS;
|
|
|
-// upsms = upsms.replace("sbmc", sbmc);
|
|
|
-//
|
|
|
-// String wxsms1 = TemplateConstants.ZHSH_SALE_TEMPLATE_CONTENT;
|
|
|
-// wxsms1 = wxsms1.replaceAll("first", "您上传的设备已上架成功,等待买家出价");
|
|
|
-// wxsms1 = wxsms1.replaceAll("keyword1", wxnc);
|
|
|
-// wxsms1 = wxsms1.replaceAll("keyword2", sbmc);
|
|
|
-// wxsms1 = wxsms1.replaceAll("keyword3", pubTimeStr);
|
|
|
-// wxsms1 = wxsms1.replaceAll("keyword4", "上架成功");
|
|
|
-// wxsms1 = wxsms1.replaceAll("remark", "赶快点击“详情”分享给大家吧!");
|
|
|
-//
|
|
|
-// /*pushRecord = displaceAuditService.pushSms(displaceId, id, sbmc, ConfigConstants.CDMC_ZHSH, agentId, agentName, openId, wxnc, wxh, name, phone, "2",ConfigConstants.XXLB_SBSJ,
|
|
|
-// appId, appSecret, upsms, wxsms1, param2, saleUrl, "审核结果通知");
|
|
|
-// list.add(pushRecord);*/
|
|
|
-// pushRecord = displaceAuditService.pushSms(displaceId, id, sbmc, ConfigConstants.CDMC_ZHSH, agentId, agentName, openId, wxnc, wxh, name, phone, "1", ConfigConstants.XXLB_SBSJ,
|
|
|
-// appId, appSecret, upsms, wxsms1, param2, saleUrl, "审核结果通知");
|
|
|
-// list.add(pushRecord);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// // 保存推送消息
|
|
|
-// pushRecordBeanService.saveRecords(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// resultBean= new PageResultBean(PageResultBean.FAIL_CODE,"系统繁忙,请稍后再来!");
|
|
|
-// log.error("addInfo error!",e);
|
|
|
-// }finally{
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ try {
|
|
|
+ DisplaceAudit displaceAudit = displaceAuditService.getDisplaceDeposit(displaceId);
|
|
|
+ if(displaceAudit!=null){
|
|
|
+ if("2".equals(displaceAudit.getIfDeposit())){
|
|
|
+ flag=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("flag",flag);
|
|
|
+ LOG.info("判断是否支付过保证金接口成功{}",map);
|
|
|
+ return map;
|
|
|
+ } catch (Exception e) {
|
|
|
+ LOG.error("根据置换id用户报价与保留价比较(/displace/judge)接口异常", e);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|