Commit ae501680 by jiang'yun

修改问题

parent da067a6b
package com.qianhe.system.controller; package com.qianhe.system.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.system.domain.CCBNotifyInfo; import com.qianhe.system.domain.CCBNotifyInfo;
import com.qianhe.system.domain.WaterOrderLog; import com.qianhe.system.domain.WaterOrderLog;
import com.qianhe.system.mapper.WaterOrderLogMapper; import com.qianhe.system.mapper.WaterOrderLogMapper;
...@@ -8,6 +9,7 @@ import com.qianhe.system.mapper.WaterOrderMapper; ...@@ -8,6 +9,7 @@ import com.qianhe.system.mapper.WaterOrderMapper;
import com.qianhe.system.vo.WaterOrderVo; import com.qianhe.system.vo.WaterOrderVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -41,16 +43,20 @@ public class CCBBackController { ...@@ -41,16 +43,20 @@ public class CCBBackController {
"&PAYMENT=" + notifyInfo.getPAYMENT() + "&CURCODE=" + notifyInfo.getCURCODE() + "&REMARK1=" + notifyInfo.getREMARK1() + "&REMARK2=" + notifyInfo.getREMARK2() + "&ACC_TYPE=" + notifyInfo.getACC_TYPE() + "&PAYMENT=" + notifyInfo.getPAYMENT() + "&CURCODE=" + notifyInfo.getCURCODE() + "&REMARK1=" + notifyInfo.getREMARK1() + "&REMARK2=" + notifyInfo.getREMARK2() + "&ACC_TYPE=" + notifyInfo.getACC_TYPE() +
"&SUCCESS=" + notifyInfo.getSUCCESS() + "&TYPE=" + notifyInfo.getTYPE() + "&REFERER=" + notifyInfo.getREFERER() + "&CLIENTIP=" + notifyInfo.getCLIENTIP(); "&SUCCESS=" + notifyInfo.getSUCCESS() + "&TYPE=" + notifyInfo.getTYPE() + "&REFERER=" + notifyInfo.getREFERER() + "&CLIENTIP=" + notifyInfo.getCLIENTIP();
if (notifyInfo.getSUCCESS().equals("Y")) { if (notifyInfo.getSUCCESS().equals("Y")) {
//验签
// 这里需要调用建行龙支付提供的查询订单接口以保证订单确实支付成功 // 这里需要调用建行龙支付提供的查询订单接口以保证订单确实支付成功
/* SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); /* SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");
Date date = sdf.parse(successTime);*/ Date date = sdf.parse(successTime);*/
WaterOrderLog orderLog = new WaterOrderLog(); WaterOrderLog orderLog = new WaterOrderLog();
orderLog.setPayNum(notifyInfo.getORDERID()); orderLog.setPayNum(notifyInfo.getORDERID());
//orderLog.setPayTime(date); orderLog.setPayTime(DateUtils.getNowDate());
orderLog.setPayMoney(new BigDecimal(notifyInfo.getPAYMENT())); orderLog.setPayMoney(new BigDecimal(notifyInfo.getPAYMENT()));
orderLog.setBz(JSON.toJSONString(notifyInfo));
int iLog = orderLogMapper.insertWaterOrderLog(orderLog); int iLog = orderLogMapper.insertWaterOrderLog(orderLog);
WaterOrderVo orderVo = new WaterOrderVo(); WaterOrderVo orderVo = new WaterOrderVo();
orderVo.setOrderNum(notifyInfo.getORDERID()); orderVo.setOrderNum(notifyInfo.getORDERID());
orderVo.setZfsj(DateUtils.parseDateToStr("yyyy-MM-dd hh:mm:ss",DateUtils.getNowDate()));
int orderI = orderMapper.updateByOrderNum(orderVo); int orderI = orderMapper.updateByOrderNum(orderVo);
log.info("验签通过"); log.info("验签通过");
return "SUCCESS"; return "SUCCESS";
......
...@@ -151,6 +151,7 @@ public class CCBPayController { ...@@ -151,6 +151,7 @@ public class CCBPayController {
map = gson.fromJson(payResult, map.getClass()); map = gson.fromJson(payResult, map.getClass());
String ERRCODE =(String) map.get("ERRCODE"); String ERRCODE =(String) map.get("ERRCODE");
System.out.println("ERRCODE的值为:"+ERRCODE); System.out.println("ERRCODE的值为:"+ERRCODE);
System.out.println(payResult);
if(ERRCODE.equals("000000")){ if(ERRCODE.equals("000000")){
String appId = (String) map.get("appId"); String appId = (String) map.get("appId");
String timeStamp = (String) map.get("timeStamp"); String timeStamp = (String) map.get("timeStamp");
......
...@@ -23,6 +23,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -23,6 +23,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -215,9 +216,11 @@ public class WaterGoodsController extends BaseController ...@@ -215,9 +216,11 @@ public class WaterGoodsController extends BaseController
waterGoodsVoList.add(waterGoodsVo); waterGoodsVoList.add(waterGoodsVo);
} }
} }
map.put("goodsTypeName",waterGoodsType.getTypeName()); if(waterGoodsVoList.size()>0){
map.put("waterGoodsVoList",waterGoodsVoList); map.put("goodsTypeName",waterGoodsType.getTypeName());
mapList.add(map); map.put("waterGoodsVoList",waterGoodsVoList);
mapList.add(map);
}
} }
} }
return getDataTable(mapList); return getDataTable(mapList);
...@@ -249,7 +252,7 @@ public class WaterGoodsController extends BaseController ...@@ -249,7 +252,7 @@ public class WaterGoodsController extends BaseController
*/ */
@Log(title = "商品", businessType = BusinessType.INSERT) @Log(title = "商品", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WaterGoodsVo waterGoodsVo) public AjaxResult add(@RequestBody WaterGoodsVo waterGoodsVo) throws IOException
{ {
return toAjax(waterGoodsService.insertWaterGoods(waterGoodsVo)); return toAjax(waterGoodsService.insertWaterGoods(waterGoodsVo));
} }
...@@ -259,7 +262,7 @@ public class WaterGoodsController extends BaseController ...@@ -259,7 +262,7 @@ public class WaterGoodsController extends BaseController
*/ */
@Log(title = "商品", businessType = BusinessType.UPDATE) @Log(title = "商品", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody WaterGoodsVo waterGoodsVo) public AjaxResult edit(@RequestBody WaterGoodsVo waterGoodsVo) throws IOException
{ {
return toAjax(waterGoodsService.updateWaterGoods(waterGoodsVo)); return toAjax(waterGoodsService.updateWaterGoods(waterGoodsVo));
} }
...@@ -291,4 +294,18 @@ public class WaterGoodsController extends BaseController ...@@ -291,4 +294,18 @@ public class WaterGoodsController extends BaseController
public AjaxResult getGoodsXq(@RequestBody WaterGoodsVo waterGoodsVo){ public AjaxResult getGoodsXq(@RequestBody WaterGoodsVo waterGoodsVo){
return success(waterGoodsService.getGoodsXq(waterGoodsVo)); return success(waterGoodsService.getGoodsXq(waterGoodsVo));
} }
/**
* 保存轮播图
*/
@Log(title = "保存轮播图", businessType = BusinessType.INSERT)
@PostMapping("/savelbt")
public AjaxResult savelbt(@RequestBody WaterGoodsImg waterGoodsImg) throws IOException
{
return toAjax(waterGoodsService.savelbt(waterGoodsImg));
}
} }
...@@ -150,6 +150,15 @@ public class SsWxLogin { ...@@ -150,6 +150,15 @@ public class SsWxLogin {
map.put("stationName",waterUser.getStationName()); map.put("stationName",waterUser.getStationName());
map.put("userType",waterUser.getUserType()); map.put("userType",waterUser.getUserType());
map.put("userGender",waterUser.getUserGender()); map.put("userGender",waterUser.getUserGender());
AsyncManager.me().execute(AsyncFactory.recordLogininfor(waterUser.getNickName(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
//存在
MpLoginUser loginUser = new MpLoginUser();
loginUser.setOpenId(openId);
loginUser.setUserId(waterUser.getId());
loginUser.setNickName(waterUser.getNickName());
loginUser.setIsNewUser("0");
String token = mpTokenService.createToken(loginUser);
map.put(Constants.TOKEN, token);
//查询送水工站点信息 //查询送水工站点信息
WaterStationUserVo waterStationUser = waterStationUserService.selectWaterStationUserByPhone(waterUser.getPhoneNum()); WaterStationUserVo waterStationUser = waterStationUserService.selectWaterStationUserByPhone(waterUser.getPhoneNum());
if (StringUtils.isNull(waterStationUser)){ if (StringUtils.isNull(waterStationUser)){
......
...@@ -116,6 +116,15 @@ public class WxLogin { ...@@ -116,6 +116,15 @@ public class WxLogin {
map.put("stationName",waterUser.getStationName()); map.put("stationName",waterUser.getStationName());
map.put("userType",waterUser.getUserType()); map.put("userType",waterUser.getUserType());
map.put("userGender",waterUser.getUserGender()); map.put("userGender",waterUser.getUserGender());
AsyncManager.me().execute(AsyncFactory.recordLogininfor(waterUser.getNickName(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
//存在
MpLoginUser loginUser = new MpLoginUser();
loginUser.setOpenId(openId);
loginUser.setUserId(waterUser.getId());
loginUser.setNickName(waterUser.getNickName());
loginUser.setIsNewUser("0");
String token = mpTokenService.createToken(loginUser);
map.put(Constants.TOKEN, token);
return AjaxResult.success(map); return AjaxResult.success(map);
} }
......
...@@ -3,6 +3,7 @@ package com.qianhe.system.domain; ...@@ -3,6 +3,7 @@ package com.qianhe.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.qianhe.common.annotation.Excel; import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity; import com.qianhe.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
...@@ -15,6 +16,7 @@ import java.util.Date; ...@@ -15,6 +16,7 @@ import java.util.Date;
* @author qianhe * @author qianhe
* @date 2023-11-23 * @date 2023-11-23
*/ */
@Data
public class WaterOrderLog extends BaseEntity public class WaterOrderLog extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -48,6 +50,8 @@ public class WaterOrderLog extends BaseEntity ...@@ -48,6 +50,8 @@ public class WaterOrderLog extends BaseEntity
@Excel(name = "订单id") @Excel(name = "订单id")
private Long orderId; private Long orderId;
private String bz;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
......
package com.qianhe.system.service; package com.qianhe.system.service;
import com.qianhe.system.domain.WaterGoods; import com.qianhe.system.domain.WaterGoods;
import com.qianhe.system.domain.WaterGoodsImg;
import com.qianhe.system.vo.WaterGoodsVo; import com.qianhe.system.vo.WaterGoodsVo;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
...@@ -38,7 +40,7 @@ public interface IWaterGoodsService ...@@ -38,7 +40,7 @@ public interface IWaterGoodsService
* @param waterGoodsVo 商品 * @param waterGoodsVo 商品
* @return 结果 * @return 结果
*/ */
public int insertWaterGoods(WaterGoodsVo waterGoodsVo); public int insertWaterGoods(WaterGoodsVo waterGoodsVo) throws IOException;
/** /**
* 修改商品 * 修改商品
...@@ -46,7 +48,7 @@ public interface IWaterGoodsService ...@@ -46,7 +48,7 @@ public interface IWaterGoodsService
* @param waterGoodsVo 商品 * @param waterGoodsVo 商品
* @return 结果 * @return 结果
*/ */
public int updateWaterGoods(WaterGoodsVo waterGoodsVo); public int updateWaterGoods(WaterGoodsVo waterGoodsVo) throws IOException ;
/** /**
* 批量删除商品 * 批量删除商品
...@@ -76,4 +78,7 @@ public interface IWaterGoodsService ...@@ -76,4 +78,7 @@ public interface IWaterGoodsService
* @return * @return
*/ */
WaterGoodsVo getGoodsXq(WaterGoodsVo waterGoodsVo); WaterGoodsVo getGoodsXq(WaterGoodsVo waterGoodsVo);
int savelbt(WaterGoodsImg waterGoodsImg);
} }
package com.qianhe.system.service.impl; package com.qianhe.system.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.img.Img;
import cn.hutool.core.img.ImgUtil;
import cn.hutool.core.io.FileUtil;
import com.qianhe.common.config.RuoYiConfig;
import com.qianhe.common.utils.DateUtils; import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils; import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils; import com.qianhe.common.utils.StringUtils;
...@@ -10,12 +14,17 @@ import com.qianhe.system.service.IWaterGoodsService; ...@@ -10,12 +14,17 @@ import com.qianhe.system.service.IWaterGoodsService;
import com.qianhe.system.utils.ImageThumbnailsUtil; import com.qianhe.system.utils.ImageThumbnailsUtil;
import com.qianhe.system.vo.WaterGoodsSpeVo; import com.qianhe.system.vo.WaterGoodsSpeVo;
import com.qianhe.system.vo.WaterGoodsVo; import com.qianhe.system.vo.WaterGoodsVo;
import net.coobird.thumbnailator.Thumbnails;
import net.coobird.thumbnailator.name.Rename;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -29,6 +38,8 @@ import java.util.List; ...@@ -29,6 +38,8 @@ import java.util.List;
@Service @Service
public class WaterGoodsServiceImpl implements IWaterGoodsService public class WaterGoodsServiceImpl implements IWaterGoodsService
{ {
@Value("${ruoyi.profile}")
private String profile;
@Autowired @Autowired
private WaterGoodsMapper waterGoodsMapper; private WaterGoodsMapper waterGoodsMapper;
@Autowired @Autowired
...@@ -176,8 +187,7 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService ...@@ -176,8 +187,7 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
*/ */
@Override @Override
@Transactional @Transactional
public int insertWaterGoods(WaterGoodsVo waterGoodsVo) public int insertWaterGoods(WaterGoodsVo waterGoodsVo) throws IOException {
{
waterGoodsVo.setCreateUser(SecurityUtils.getLoginUser().getUsername()); waterGoodsVo.setCreateUser(SecurityUtils.getLoginUser().getUsername());
waterGoodsVo.setCreateTime(DateUtils.getNowDate()); waterGoodsVo.setCreateTime(DateUtils.getNowDate());
int i = waterGoodsMapper.insertWaterGoods(waterGoodsVo); int i = waterGoodsMapper.insertWaterGoods(waterGoodsVo);
...@@ -196,8 +206,7 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService ...@@ -196,8 +206,7 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateWaterGoods(WaterGoodsVo waterGoodsVo) public int updateWaterGoods(WaterGoodsVo waterGoodsVo) throws IOException {
{
//删除商品图片 //删除商品图片
waterGoodsMapper.deleteWaterGoodsImgByGoodsId(waterGoodsVo.getId()); waterGoodsMapper.deleteWaterGoodsImgByGoodsId(waterGoodsVo.getId());
//删除商品关联规格 //删除商品关联规格
...@@ -253,29 +262,35 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService ...@@ -253,29 +262,35 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
* 新增详情图 * 新增详情图
* @param waterGoodsVo * @param waterGoodsVo
*/ */
private void insertGoodsDetailsImgs(WaterGoodsVo waterGoodsVo) { private void insertGoodsDetailsImgs(WaterGoodsVo waterGoodsVo) throws IOException {
List<WaterGoodsImg> detailsImgs = waterGoodsVo.getDetailsImgs(); List<WaterGoodsImg> detailsImgs = waterGoodsVo.getDetailsImgs();
//图片压缩 //图片压缩
if (StringUtils.isNotNull(detailsImgs)){ if (StringUtils.isNotNull(detailsImgs)){
for (WaterGoodsImg detailsImg : detailsImgs) { for (WaterGoodsImg detailsImg : detailsImgs) {
String inputImage = detailsImg.getUrl(); // String inputImage = detailsImg.getUrl();
String outputImage = detailsImg.getUrl(); // String outputImage = detailsImg.getUrl();
//判断图片是否是jpg或jpeg String inputImage =profile + detailsImg.getUrl().replace("/profile","");
String hz = detailsImg.getUrl().substring(detailsImg.getUrl().lastIndexOf(".") + 1); String outputImageDz = inputImage.substring(0,inputImage.lastIndexOf("/"));
if (hz.equals("jpg") || hz.equals("jpeg")){ Thumbnails.of(inputImage)
try { // 图片缩放率,不能和size()一起使用
imageThumbnailsUtil.compressImage(inputImage,outputImage); .scale(0.7d)// 缩略图保存目录,该目录需存在,否则报错
} catch (IOException e) { .toFiles(new File(outputImageDz), Rename.NO_CHANGE);
e.printStackTrace(); // //判断图片是否是jpg或jpeg
} // String hz = detailsImg.getUrl().substring(detailsImg.getUrl().lastIndexOf(".") + 1);
}else { // if (hz.equals("jpg") || hz.equals("jpeg")){
try { // try {
imageThumbnailsUtil.compressImagePNG(inputImage,outputImage); // imageThumbnailsUtil.compressImage(inputImage,outputImage);
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }else {
// try {
// imageThumbnailsUtil.compressImagePNG(inputImage,outputImage);
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
} }
} }
List<WaterGoodsImg> detailsImgList = new ArrayList<>(); List<WaterGoodsImg> detailsImgList = new ArrayList<>();
...@@ -294,33 +309,51 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService ...@@ -294,33 +309,51 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
} }
} }
public static void main(String[] args) throws IOException {
// String path = "D:\\workspace\\idea\\individual\\springboot-learn\\springboot-thumbnail\\image";
// String[] files = new String[]{
// "image/1.jpg",
// "image/2.jpg"
// };
// List<String> list = ImageUtil.generateThumbnail2Directory(path, files);
// System.out.println(list);
}
/** /**
* 新增封面图 * 新增封面图
* @param waterGoodsVo * @param waterGoodsVo
*/ */
private void insertGoodsCoverImgs(WaterGoodsVo waterGoodsVo) { private void insertGoodsCoverImgs(WaterGoodsVo waterGoodsVo) throws IOException {
List<WaterGoodsImg> coverImgs = waterGoodsVo.getCoverImgs(); List<WaterGoodsImg> coverImgs = waterGoodsVo.getCoverImgs();
//图片压缩 //图片压缩
if (StringUtils.isNotNull(coverImgs)){ if (StringUtils.isNotNull(coverImgs)){
for (WaterGoodsImg coverImg : coverImgs) { for (WaterGoodsImg coverImg : coverImgs) {
String inputImage = coverImg.getUrl(); String inputImage =profile + coverImg.getUrl().replace("/profile","");
String outputImage = coverImg.getUrl(); String outputImageDz = inputImage.substring(0,inputImage.lastIndexOf("/"));
Thumbnails.of(inputImage)
// 图片缩放率,不能和size()一起使用
.scale(0.7d)// 缩略图保存目录,该目录需存在,否则报错
.toFiles(new File(outputImageDz), Rename.NO_CHANGE);
//旋转图片
// 旋转180度
// ImgUtil.rotate(ImageIO.read(FileUtil.file(outputImageDz)), 180);
//判断图片是否是jpg或jpeg //判断图片是否是jpg或jpeg
String hz = coverImg.getUrl().substring(coverImg.getUrl().lastIndexOf(".") + 1); // String hz = coverImg.getUrl().substring(coverImg.getUrl().lastIndexOf(".") + 1);
if (hz.equals("jpg") || hz.equals("jpeg")){ // if (hz.equals("jpg") || hz.equals("jpeg")){
try { // try {
imageThumbnailsUtil.compressImage(inputImage,outputImage); // imageThumbnailsUtil.compressImage(inputImage,outputImage);
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
}else { // }else {
try { // try {
imageThumbnailsUtil.compressImagePNG(inputImage,outputImage); // imageThumbnailsUtil.compressImagePNG(inputImage,outputImage);
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
} }
} }
...@@ -510,4 +543,11 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService ...@@ -510,4 +543,11 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
waterGoodsVo1.setOrderGoodsType(1); waterGoodsVo1.setOrderGoodsType(1);
return waterGoodsVo1; return waterGoodsVo1;
} }
@Override
public int savelbt(WaterGoodsImg waterGoodsImg) {
//分类为轮播图
waterGoodsImg.setImgType(3);
return waterGoodsImgMapper.insertWaterGoodsImg(waterGoodsImg);
}
} }
...@@ -267,10 +267,13 @@ public class WaterStationServiceImpl implements IWaterStationService ...@@ -267,10 +267,13 @@ public class WaterStationServiceImpl implements IWaterStationService
System.out.println(lon+"-------------"+lat); System.out.println(lon+"-------------"+lat);
//查询所有站点信息 //查询所有站点信息
List<WaterStation> waterStations = waterStationMapper.selectWaterStationList(new WaterStation()); WaterStation waterStation1 = new WaterStation();
waterStation1.setIsOpen("1");
List<WaterStation> waterStations = waterStationMapper.selectWaterStationList(waterStation1);
List<WaterStationVo> waterStationVoList = new ArrayList<>(); List<WaterStationVo> waterStationVoList = new ArrayList<>();
//循环站点,计算符合距离的站点 //循环站点,计算符合距离的站点
for (WaterStation waterStation : waterStations) { for (WaterStation waterStation : waterStations) {
//计算距离 //计算距离
double distance = PositionUtil.getDistance1(lon, lat, waterStation.getStationLonTen(), waterStation.getStationLatTen()); double distance = PositionUtil.getDistance1(lon, lat, waterStation.getStationLonTen(), waterStation.getStationLatTen());
System.out.println("dis---------------"+distance); System.out.println("dis---------------"+distance);
......
...@@ -63,4 +63,7 @@ public class ImageThumbnailsUtil { ...@@ -63,4 +63,7 @@ public class ImageThumbnailsUtil {
File outfile = new File(outputImagePath); // 目标输出文件,可与源文件一致,一致会覆盖 File outfile = new File(outputImagePath); // 目标输出文件,可与源文件一致,一致会覆盖
PngCompressor.compress(file, outfile); PngCompressor.compress(file, outfile);
} }
} }
...@@ -176,4 +176,7 @@ public class WaterOrderVo { ...@@ -176,4 +176,7 @@ public class WaterOrderVo {
/** 触底请求参数 */ /** 触底请求参数 */
private Integer pageNum; private Integer pageNum;
private String zfsj;
} }
...@@ -38,8 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -38,8 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWaterGoodsList" parameterType="WaterGoods" resultMap="WaterGoodsResult"> <select id="selectWaterGoodsList" parameterType="WaterGoods" resultMap="WaterGoodsResult">
<include refid="selectWaterGoodsVo"/> <include refid="selectWaterGoodsVo"/>
<where> <where>
a.status = '1'
and
a.del_flag = '0' a.del_flag = '0'
and and
b.del_flag ='0' b.del_flag ='0'
...@@ -59,10 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -59,10 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWaterGoodsList1" resultMap="WaterGoodsResult"> <select id="selectWaterGoodsList1" resultMap="WaterGoodsResult">
-- select url cover_img from water_goods_img where img_type = 1 and goods_id = (select id from water_goods where title = '主页轮播图') select replace(url,'/prod-api','') cover_img from water_goods_img where del_flag = '0'
select replace(url,'/prod-api','') cover_img from water_goods_img where del_flag = '0' and img_type=3
and goods_id in (SELECT id from water_goods WHERE del_flag = '0'
AND goods_type_id in (select id from water_goods_type where del_flag = '0' and type_name = '主页轮播图'))
</select> </select>
<select id="selectWaterGoodsById" parameterType="Long" resultMap="WaterGoodsResult"> <select id="selectWaterGoodsById" parameterType="Long" resultMap="WaterGoodsResult">
...@@ -83,8 +80,6 @@ select replace(url,'/prod-api','') cover_img from water_goods_img where del_fla ...@@ -83,8 +80,6 @@ select replace(url,'/prod-api','') cover_img from water_goods_img where del_fla
select * select *
from water_goods from water_goods
where id = #{id} where id = #{id}
and status = '1'
and del_flag = '0'
</select> </select>
......
...@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="payBackMoney != null">pay_back_money,</if> <if test="payBackMoney != null">pay_back_money,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="orderId != null">order_id,</if> <if test="orderId != null">order_id,</if>
<if test="bz != null">bz,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="payTime != null">#{payTime},</if> <if test="payTime != null">#{payTime},</if>
...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="payBackMoney != null">#{payBackMoney},</if> <if test="payBackMoney != null">#{payBackMoney},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="orderId != null">#{orderId},</if> <if test="orderId != null">#{orderId},</if>
<if test="bz != null">#{bz},</if>
</trim> </trim>
</insert> </insert>
......
...@@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' "> and create_time BETWEEN #{startTime} AND #{endTime}</if> <if test="startTime != null and startTime != '' and endTime != null and endTime != '' "> and create_time BETWEEN #{startTime} AND #{endTime}</if>
</where> </where>
order by create_time DESC order by create_time DESC
<if test="pageNum != null"> limit #{pageNum}</if>
</select> </select>
<select id="getWaterOrderListByStationId" parameterType="com.qianhe.system.vo.WaterOrderVo" resultType="com.qianhe.system.vo.WaterOrderVo"> <select id="getWaterOrderListByStationId" parameterType="com.qianhe.system.vo.WaterOrderVo" resultType="com.qianhe.system.vo.WaterOrderVo">
...@@ -267,7 +267,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -267,7 +267,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateByOrderNum" parameterType="com.qianhe.system.vo.WaterOrderVo"> <update id="updateByOrderNum" parameterType="com.qianhe.system.vo.WaterOrderVo">
update water_order set pay_state = '1' ,order_state = '2' where order_num = #{orderNum} update water_order set pay_state = '1' ,order_state = '2',zfsj=#{zfsj} where order_num = #{orderNum}
</update> </update>
<update id="deleteWaterOrderById" parameterType="Long"> <update id="deleteWaterOrderById" parameterType="Long">
......
...@@ -116,9 +116,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -116,9 +116,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// .antMatchers("/wx/getWxLoginInfo/**", "/wx/login/**", "/wx/getPhoneNumber/**","/wx/updateUser").permitAll() // .antMatchers("/wx/getWxLoginInfo/**", "/wx/login/**", "/wx/getPhoneNumber/**","/wx/updateUser").permitAll()
.antMatchers("/wx/**").permitAll() .antMatchers("/wx/**").permitAll()
//放行送水小程序登录相关接口 //放行送水小程序登录相关接口
.antMatchers("/ssWx/getWxLoginInfo/**", "/ssWx/login/**", "/ssWx/getPhoneNumber/**","/ssWx/updateUser").permitAll() .antMatchers("/ssWx/getWxLoginInfo/**", "/ssWx/getUserInfo", "/ssWx/login/**", "/ssWx/getPhoneNumber/**","/ssWx/updateUser").permitAll()
//微信回调 //微信回调
.antMatchers("/callback/payNotify/").permitAll() .antMatchers("/callback/payNotify/").permitAll()
//银行回调
.antMatchers("/ccbback/payNotify/").permitAll()
//通用接口放行 //通用接口放行
.antMatchers("/common/**").permitAll() .antMatchers("/common/**").permitAll()
//测试放行所有接口 //测试放行所有接口
......
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