123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648 |
- package com.demo.wjj.controller;
- import com.demo.wjj.bo.DisplaceDetailBo;
- import com.demo.wjj.bo.DisplaceListBo;
- import com.demo.wjj.bo.ImgListBo;
- import com.demo.wjj.bo.SaveDisplaceBo;
- import com.demo.wjj.converter.SaveDisplaceConverter;
- import com.demo.wjj.po.DisplaceAudit;
- import com.demo.wjj.po.TbImgItem;
- import com.demo.wjj.qo.SaveDisplaceQo;
- import com.demo.wjj.service.*;
- import com.demo.wjj.utils.ApiResult;
- import com.demo.wjj.utils.ExecuteResult;
- import com.demo.wjj.utils.PageBean;
- import com.demo.wjj.utils.Result;
- import com.demo.wjj.validator.SaveDisplaceQoValidator;
- import com.github.pagehelper.PageInfo;
- import com.qiniu.processing.OperationStatus;
- import org.apache.commons.collections4.CollectionUtils;
- import org.apache.commons.lang3.ArrayUtils;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.validation.BindingResult;
- 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.*;
- /**
- * 置换
- *
- * @author wangqing
- * @date 2018.11.13
- */
- @RequestMapping("/displace")
- @RestController
- public class DisplaceController {
- private final Logger LOG = LoggerFactory.getLogger(getClass());
- @Autowired
- private SaveDisplaceQoValidator saveDisplaceQoValidator;
- @Autowired
- private SaveDisplaceConverter saveDisplaceConverter;
- @Autowired
- private DisplaceManage displaceManage;
- @Autowired
- private DisplaceAuditService displaceAuditService;
- @Autowired
- private TbImgItemService tbImgItemService;
- @Autowired
- private TbImgListService tbImgListService;
- @Autowired
- QiNiuService qiNiuService;
- /**
- * 精品机账号
- */
- @Value("ZHXTCS")
- private String excellentAccount;
- @InitBinder
- protected void initBinder(WebDataBinder binder) {
- Object target = binder.getTarget();
- if (target == null) {
- return;
- }
- if (saveDisplaceQoValidator.supports(target.getClass())) {
- binder.addValidators(saveDisplaceQoValidator);
- }
- }
- /**
- * 保存置换
- *
- * @param saveDisplaceQo 置换参数
- * private String is_good;//1-普通2-精品
- * private String storage;//1-完成;2-暂存
- * @return apiResult
- */
- @PostMapping("/save")
- public ApiResult save(@Valid SaveDisplaceQo saveDisplaceQo, BindingResult bindingResult) {
- LOG.info("调用保存置换(/displace/save)接口, saveDisplaceQo:{}", saveDisplaceQo);
- if(saveDisplaceQo.getAgentId().equals(excellentAccount)){
- saveDisplaceQo.setIs_good("2");
- }else{
- saveDisplaceQo.setIs_good("1");
- }
- if(StringUtils.isBlank(saveDisplaceQo.getStorage())){
- saveDisplaceQo.setStorage("1");
- }
- if (CollectionUtils.isNotEmpty(bindingResult.getAllErrors())) {
- LOG.warn("请求参数错误");
- return ApiResult.createFailure();
- }
- final String[] pictureSubfixs = {".BMP", ".JPG", ".JPEG", ".PNG", ".GIF", ".bmp", ".jpg", ".jpeg", ".png", ".gif"};
- try {
- SaveDisplaceBo convert = saveDisplaceConverter.convert(saveDisplaceQo);
- //获取图片列表
- List<SaveDisplaceBo.DisplaceImageList> displaceImageLists = convert.getPicture();
- //便利图片数组 给予分类存储
- for (SaveDisplaceBo.DisplaceImageList displaceImage : displaceImageLists) {
- List<String> picList = new ArrayList<>();
- //转码
- for(String key:displaceImage.getPic()){
- String keyModel=key;
- String subfix = key.substring(key.lastIndexOf("."));
- if (!ArrayUtils.contains(pictureSubfixs, subfix)){
- OperationStatus operationStatus=qiNiuService.persisted(key);
- LOG.info("operationStatus======"+operationStatus);
- LOG.info("operationStatus======"+operationStatus.inputKey);
- keyModel="weigongcheng_"+key;
- LOG.info("keyModel======"+keyModel);
- }
- picList.add(keyModel);
- LOG.info("picList======"+picList);
- }
- displaceImage.setPic(null);
- displaceImage.setPic(picList);
- //获取细节分类id
- Integer detailId = displaceImage.getDetailId();
- //detail袭击目录不等于空
- if (detailId != null) {
- //通过细节分类id查询二级分类
- TbImgItem tbImgItem = tbImgItemService.findOne(detailId);
- //查询二级目录
- List<ImgListBo> imgListBos = tbImgListService.findAll();
- //细节分类
- if (tbImgItem != null) {
- //从数据库中获取二级分类id
- Integer imgBqId = tbImgItem.getImgBqId();
- //组装二级识别码
- String imgBqIdStr = "IMG_"+imgBqId;
- //遍历每个二级分类 查询当前图片分类是否有匹配的
- for (ImgListBo imgListBo : imgListBos) {
- //查看图片分类是否属于二级分类
- if (imgListBo.getListCode().equals(imgBqIdStr)) {
- displaceImage.setCode(imgListBo.getListCode());
- }
- }
- /* switch (imgBqId){
- case 1 : displaceImage.setCode("IMG_1"); break;
- case 2 : displaceImage.setCode("IMG_2"); break;
- case 3 : displaceImage.setCode("IMG_3"); break;
- case 4 : displaceImage.setCode("IMG_4"); break;
- case 5 : displaceImage.setCode("IMG_5"); break;
- case 6 : displaceImage.setCode("IMG_6"); break;
- case 7 : displaceImage.setCode("IMG_7"); break;
- default: displaceImage.setCode(""); break;
- }*/
- }
- }
- }
- LOG.info("gg组装的图片集合 displaceImageLists{}",displaceImageLists);
- //把修改好的图片放入集合中
- convert.setPicture(displaceImageLists);
- ExecuteResult<Boolean> executeResult = displaceManage.save(convert);
- ApiResult apiResult;
- if (executeResult.isExecuteResult()) {
- apiResult = executeResult.getData() ? ApiResult.createSuccess(null) : ApiResult.createFailure();
- } else {
- Result result = executeResult.getResult();
- if (result != null) {
- apiResult = new ApiResult(result);
- } else {
- apiResult = ApiResult.createFailure();
- }
- }
- LOG.info("调用保存置换(/displaceManage/save)接口成功, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("调用保存置换(/displaceManage/save)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 获取未审核置换列表
- *
- * @param agentId 商家id
- * @param openId 微信openId
- * @param request request
- * @return apiResult
- */
- @GetMapping("/queryUndoList")
- public ApiResult queryUndoList(@RequestParam(required = false) String agentId, @RequestParam(required = false) String openId, HttpServletRequest request) {
- LOG.info("调用获取未审核置换列表(/displace/queryUndoList)接口, agentId:{}, openId:{}", agentId, openId);
- String is_good="1";
- if(agentId.equals(excellentAccount)){
- is_good="2";
- }
- if (StringUtils.isBlank(agentId)) {
- LOG.info("agentId为空");
- return ApiResult.createFailure();
- }
- if (StringUtils.isBlank(openId)) {
- LOG.info("微信openId为空");
- return ApiResult.createFailure();
- }
- try {
- PageInfo<DisplaceListBo> pageInfo = displaceAuditService.queryUndoDisplaceList(agentId, openId, PageBean.create(request),is_good);
- ApiResult<PageInfo<DisplaceListBo>> apiResult = ApiResult.createSuccess(pageInfo);
- LOG.info("调用获取未审核置换列表(/displace/queryUndoList)接口成功");
- LOG.debug("未审核置换列表, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("调用获取未审核置换列表(/displace/queryUndoList)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 获取已审核置换列表
- *
- * @param agentId 商家id
- * @param openId 微信openId
- * @param request request
- * @return apiResult
- */
- @GetMapping("/queryDoneList")
- public ApiResult queryDoneList(@RequestParam(required = false) String agentId, @RequestParam(required = false) String openId, HttpServletRequest request) {
- LOG.info("调用获取已审核置换列表(/displace/queryDoneList)接口, agentId:{}, openId:{}", agentId, openId);
- if (StringUtils.isBlank(agentId)) {
- LOG.info("agentId为空");
- return ApiResult.createFailure();
- }
- if (StringUtils.isBlank(openId)) {
- LOG.info("微信openId为空");
- return ApiResult.createFailure();
- }
- String is_good="1";
- if(agentId.equals(excellentAccount)){
- is_good="2";
- }
- try {
- PageInfo<DisplaceListBo> pageInfo = displaceAuditService.queryDoneDisplaceList(agentId, openId, PageBean.create(request),is_good);
- ApiResult<PageInfo<DisplaceListBo>> apiResult = ApiResult.createSuccess(pageInfo);
- LOG.info("调用获取已审核置换列表(/displace/queryDoneList)接口成功");
- LOG.debug("未审核置换列表, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("调用获取已审核置换列表(/displace/queryDoneList)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 查询被驳回的置换设备数量
- *
- * @param agentId
- * @param openId
- * @return
- */
- @GetMapping("/queryRejectedCount")
- public ApiResult queryRejectedCount(@RequestParam(required = false) String agentId, @RequestParam(required = false) String openId) {
- LOG.info("调用查询被驳回的置换设备数量(/displace/queryRejectedCount)接口, agentId:{}, openId:{}", agentId, openId);
- if (StringUtils.isBlank(agentId)) {
- LOG.info("agentId为空");
- return ApiResult.createFailure();
- }
- if (StringUtils.isBlank(openId)) {
- LOG.info("openId为空");
- return ApiResult.createFailure();
- }
- try {
- final int rejectedDisplaceCount = displaceAuditService.getRejectedDisplaceCount(agentId, openId);
- Map<String, Integer> data = new HashMap<>();
- data.put("count", rejectedDisplaceCount);
- final ApiResult<Map<String, Integer>> apiResult = ApiResult.createSuccess(data);
- LOG.info("调用查询被驳回的置换设备数量(/displace/queryRejectedCount)接口成功, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("调用查询被驳回的置换设备数量(/displace/queryRejectedCount)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 获取置换详情
- *
- * @param id 置换id
- * @return apiResult
- */
- @GetMapping("/getDetails")
- public ApiResult getDetails(@RequestParam(required = false) String id) {
- LOG.info("调用获取置换详情(/displace/getDetails)接口, id:{}", id);
- if (StringUtils.isBlank(id)) {
- LOG.info("id为空");
- return ApiResult.createFailure();
- }
- try {
- DisplaceDetailBo displaceDetail = displaceAuditService.getDisplaceDetail(id);
- ApiResult<DisplaceDetailBo> apiResult = ApiResult.createSuccess(displaceDetail);
- LOG.info("调用获取置换详情(/displace/getDetails)接口成功, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("调用获取置换详情(/displace/getDetails)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 根据类型查询精品设备
- *
- * @param type 1-在售设备”、“2停售设备”、“3成交设备”、“4我的秒杀
- * @return apiResult
- */
- @GetMapping("/getDisplaceGoodBuyList")
- public ApiResult getDisplaceGoodBuyList(@RequestParam(required = false) String type,@RequestParam(required = false) String agentId, @RequestParam(required = false) String openId, HttpServletRequest request){
- LOG.info("根据类型查询设备列表(/displace/getDisplaceList)接口, agentId:{}, openId:{}, type:{}", agentId, openId, type);
- if (StringUtils.isBlank(agentId)) {
- LOG.info("agentId为空");
- return ApiResult.createFailure();
- }
- if (StringUtils.isBlank(openId)) {
- LOG.info("微信openId为空");
- return ApiResult.createFailure();
- }
- try {
- PageInfo<DisplaceListBo> pageInfo = displaceAuditService.queryTypeDisplaceList(agentId, openId, type, PageBean.create(request));
- ApiResult<PageInfo<DisplaceListBo>> apiResult = ApiResult.createSuccess(pageInfo);
- LOG.info("根据类型查询设备列表(/displace/getDisplaceList)接口成功");
- LOG.debug("置换列表, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("根据类型查询设备列表(/displace/getDisplaceList)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 根据类型查询我要卖精品设备
- *
- *
- * @return apiResult
- */
- @GetMapping("/getDisplaceGoodSaleList")
- public ApiResult getDisplaceGoodSaleList(@RequestParam(required = false) String agentId,
- @RequestParam(required = false) String openId,
- HttpServletRequest request){
- LOG.info("根据类型查询设备列表(/displace/getDisplaceList)接口, agentId:{}, openId:{}", agentId, openId);
- if (StringUtils.isBlank(agentId)) {
- LOG.info("agentId为空");
- return ApiResult.createFailure();
- }
- if (StringUtils.isBlank(openId)) {
- LOG.info("微信openId为空");
- return ApiResult.createFailure();
- }
- try {
- PageInfo<DisplaceListBo> pageInfo = displaceAuditService.getDisplaceGoodSaleList(agentId, openId, PageBean.create(request));
- ApiResult<PageInfo<DisplaceListBo>> apiResult = ApiResult.createSuccess(pageInfo);
- LOG.info("根据类型查询设备列表(/displace/getDisplaceList)接口成功");
- LOG.debug("置换列表, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("根据类型查询设备列表(/displace/getDisplaceList)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 用户报价与保留价比较
- */
- @GetMapping("/judge")
- public ApiResult judge(@RequestParam(required = false) String displaceId){
- if (StringUtils.isBlank(displaceId)) {
- LOG.info("displaceId为空");
- return ApiResult.createFailure();
- }
- try {
- DisplaceAudit displaceAudit = displaceAuditService.getDisplaceAudit(displaceId);
- ApiResult<DisplaceAudit> apiResult = ApiResult.createSuccess(displaceAudit);
- LOG.info("根据置换id用户报价与保留价比较(/displace/judge)接口成功");
- LOG.debug("置换列表, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("根据置换id用户报价与保留价比较(/displace/judge)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 查询暂存列表
- *
- *
- * @return apiResult
- */
- @GetMapping("/getDisplaceStorageList")
- public ApiResult getDisplaceStorageList(@RequestParam(required = false) String storageStatus,
- @RequestParam(required = false) String agentId,
- @RequestParam(required = false) String openId,
- HttpServletRequest request){
- LOG.info("查询暂存列表(/displace/getDisplaceStorageList)接口, agentId:{}, openId:{}", agentId, openId);
- if (StringUtils.isBlank(agentId)) {
- LOG.info("agentId为空");
- return ApiResult.createFailure();
- }
- if (StringUtils.isBlank(openId)) {
- LOG.info("微信openId为空");
- return ApiResult.createFailure();
- }
- try {
- PageInfo<DisplaceListBo> pageInfo = displaceAuditService.getDisplaceStorageList(agentId, openId,storageStatus, PageBean.create(request));
- ApiResult<PageInfo<DisplaceListBo>> apiResult = ApiResult.createSuccess(pageInfo);
- LOG.info("查询暂存列表(/displace/getDisplaceStorageList)接口成功");
- LOG.debug("置换列表, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("查询暂存列表(/displace/getDisplaceStorageList)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 查询待确认置换列表
- *
- */
- @GetMapping("/getDisplaceConfirmList")
- public ApiResult getDisplaceConfirmList(@RequestParam(required = false) String agentId,
- @RequestParam(required = false) String openId,
- HttpServletRequest request){
- LOG.info("查询暂存列表(/displace/getDisplaceStorageList)接口, agentId:{}, openId:{}", agentId, openId);
- if (StringUtils.isBlank(agentId)) {
- LOG.info("agentId为空");
- return ApiResult.createFailure();
- }
- if (StringUtils.isBlank(openId)) {
- LOG.info("微信openId为空");
- return ApiResult.createFailure();
- }
- try {
- PageInfo<DisplaceListBo> pageInfo = displaceAuditService.getDisplaceConfirmList(agentId, openId, PageBean.create(request));
- ApiResult<PageInfo<DisplaceListBo>> apiResult = ApiResult.createSuccess(pageInfo);
- LOG.info("查询暂存列表(/displace/getDisplaceStorageList)接口成功");
- LOG.debug("置换列表, apiResult:{}", apiResult);
- return apiResult;
- } catch (Exception e) {
- LOG.error("查询暂存列表(/displace/getDisplaceStorageList)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- // @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{
- //
- // }
- //
- // }
- }
|