Commit 495f5e66 by jiang'yun

修改问题

parent f229b46a
......@@ -127,11 +127,11 @@
<version>0.2.12</version>
</dependency>-->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.httpcomponents</groupId>-->
<!-- <artifactId>httpclient</artifactId>-->
<!-- <version>4.5.6</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
......@@ -180,7 +180,7 @@
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.8.3</version>
<version>3.10.2</version>
</dependency>
<dependency>
......
......@@ -17,6 +17,7 @@ import com.qianhe.system.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -96,4 +97,31 @@ public class CCBRefundController {
return AjaxResult.error(misApiResponse.getRetErrMsg());
}
}
@GetMapping("/testKey")
public void getKey(){
CcbKey ccbKey=new CcbKey();
ccbKey.setSfgq("1");
CcbKey ccbKey1 = ccbKeyMapper.selectCcbKeyList(ccbKey).stream().findFirst().orElse(null);
String key = "";
if(ccbKey1!=null){
key=ccbKey1.getCcbkey();
System.out.println("old:"+key);
key= MisApiUtil.getAu012Key(key);//密钥更新
MisApiUtil.confirmKey(key);;//密钥确认
System.out.println("new:"+key);
}else {
//第一次根据授权码下载密钥
key=MisApiUtil.getAu011( Config.authCode);
System.out.println("First:"+key);
}
//先把已有的key改为过期状态
ccbKeyMapper.updateCcbKeySfgq();
//把最新的保存
ccbKey.setCcbkey(key);
System.out.println(ccbKey);
ccbKeyMapper.insertCcbKey(ccbKey);
}
}
......@@ -128,6 +128,87 @@ public class WaterGoodsController extends BaseController
return tableDataInfo;
}
/**
* 查询商品列表
*/
@GetMapping("/listBytype")
public TableDataInfo listBytype(WaterGoods waterGoods)
{
startPage();
waterGoods.setStatus(1);
List<WaterGoods> list = waterGoodsService.selectWaterGoodsList(waterGoods);
//查询所有商品图片
List<WaterGoodsImg> waterGoodsImgs = waterGoodsImgService.selectWaterGoodsImgList(new WaterGoodsImg());
//查询所有站点
List<WaterStation> waterStations = waterStationService.selectWaterStationList(new WaterStation());
//查询所有商品分类
List<WaterGoodsType> waterGoodsTypes = waterGoodsTypeService.selectWaterGoodsTypeList(new WaterGoodsType());
List<WaterGoodsVo> waterGoodsVos = new ArrayList<>();
if (list.size() > 0){
for (WaterGoods goods : list) {
//转vo
WaterGoodsVo waterGoodsVo = new WaterGoodsVo();
BeanUtils.copyProperties(goods,waterGoodsVo);
List<WaterGoodsImg> coverImgs = new ArrayList<>();
List<WaterGoodsImg> detailsImgs = new ArrayList<>();
for (WaterGoodsImg waterGoodsImg : waterGoodsImgs) {
if (goods.getId().equals(waterGoodsImg.getGoodsId()) && waterGoodsImg.getImgType() == 1){
//商品封面图
coverImgs.add(waterGoodsImg);
}
if (goods.getId().equals(waterGoodsImg.getGoodsId()) && waterGoodsImg.getImgType() == 2){
//商品详情图
detailsImgs.add(waterGoodsImg);
}
}
if (coverImgs.size() > 0){
waterGoodsVo.setCoverImgs(coverImgs);
}
if (detailsImgs.size() > 0){
waterGoodsVo.setDetailsImgs(detailsImgs);
}
//设置站点名称
if (StringUtils.isNotEmpty(goods.getBelongStationId())){
String[] split = goods.getBelongStationId().split(",");
String stationName = "";
if (split.length > 1){
for (int i = 0; i < split.length; i++) {
for (WaterStation waterStation : waterStations) {
if (split[i].equals(waterStation.getId().toString())){
if (i == split.length - 1){
stationName += waterStation.getStationName();
}else {
stationName += waterStation.getStationName() + ",";
}
}
}
}
}else {
for (WaterStation waterStation : waterStations) {
if (split[0].equals(waterStation.getId().toString())){
stationName = waterStation.getStationName();
}
}
}
waterGoodsVo.setBelongStationNames(stationName);
}
//设置商品分类名称
if (StringUtils.isNotNull(goods.getGoodsTypeId())){
for (WaterGoodsType waterGoodsType : waterGoodsTypes) {
if (goods.getGoodsTypeId().equals(waterGoodsType.getId())){
waterGoodsVo.setGoodsTypeName(waterGoodsType.getTypeName());
}
}
}
waterGoodsVos.add(waterGoodsVo);
}
}
TableDataInfo tableDataInfo = getDataTable(waterGoodsVos);
tableDataInfo.setTotal(new PageInfo(list).getTotal());
return tableDataInfo;
}
@GetMapping("/zyImgList")
public List imgList(){
return waterGoodsService.selectWaterGoodsList1();
......@@ -139,6 +220,8 @@ public class WaterGoodsController extends BaseController
@GetMapping("/syList")
public TableDataInfo syList(WaterGoods waterGoods)
{
//只看上架的商品
waterGoods.setStatus(1);
List<WaterGoods> list = waterGoodsService.selectWaterGoodsList(waterGoods);
//查询所有商品图片
List<WaterGoodsImg> waterGoodsImgs = waterGoodsImgService.selectWaterGoodsImgList(new WaterGoodsImg());
......
......@@ -64,6 +64,7 @@ public class WaterGoods
/** 状态(1上架0下架) */
@Excel(name = "状态", readConverterExp = "1=上架0下架")
private Integer status;
private String zt;
private String openId;
......
......@@ -354,6 +354,7 @@ public class WaterOrderServiceImpl implements IWaterOrderService
if (waterOrder.getPayType() == 2 || waterOrder.getPayType() == 3){
//为水票支付,该订单状态改为已取消
waterOrderVo.setOrderState(5);
}else {
//银行支付,涉及线上退款
if (waterOrder.getOrderState() == 2){
......@@ -381,6 +382,9 @@ public class WaterOrderServiceImpl implements IWaterOrderService
waterOrder.setTkbh(tkbh);
//执行退款操作
i = ccbRefund(waterOrder);
if(i==4){
return i;
}
//不相等说明下单时间的晚上0点
waterOrderVo.setOrderState(6);//已退款
}else {
......@@ -457,6 +461,7 @@ public class WaterOrderServiceImpl implements IWaterOrderService
if(StringUtils.isEmpty(key)){
return 4;
}
System.out.println("key======"+key);
String mchtNo=Config.merchantCode;//建行15位商户编号(固定)
String termNo=Config.terminalId;//建行8位终端编号(固定)
//参数
......@@ -726,7 +731,15 @@ public class WaterOrderServiceImpl implements IWaterOrderService
JSONObject json=new JSONObject();
json.set("thing27",new JSONObject().set("value",spmc));//商品名称
System.out.println(waterOrder.getGoodsVal());
json.set("amount24",new JSONObject().set("value", payType==1?String.format("%.2f", waterOrder.getGoodsVal().setScale(2, BigDecimal.ROUND_DOWN).doubleValue()):"水票"));//金额
String format = "";
if(payType==1){
format=String.format("%.2f", waterOrder.getGoodsVal().setScale(2, BigDecimal.ROUND_DOWN).doubleValue());
}else if(payType==2){
format="水票";
}else if(payType==3){
format="记账";
}
json.set("amount24",new JSONObject().set("value", format));//金额
json.set("time4",new JSONObject().set("value",DateUtils.parseDateToStr("yyyy-MM-dd hh:mm:ss",waterOrder.getCreateTime())));//下单时间
json.set("phone_number8",new JSONObject().set("value", waterOrder.getUserPhone()));//用户手机号
body.set("data",json);
......
......@@ -40,7 +40,7 @@ public class OSSUtil {
String fileUrl = urlPrefix+ (dateStr + "/" + fileName);
// 上传到阿里云
try {
System.out.println("ossClient"+ossClient);
ossClient.putObject(bucketName, fileUrl, new
ByteArrayInputStream(uploadFile.getBytes()));
} catch (Exception e) {
......
......@@ -132,7 +132,7 @@ public class Constants
/**
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
*/
public static final String[] JOB_WHITELIST_STR = { "com.qianhe" };
public static final String[] JOB_WHITELIST_STR = { "CCBTask.ccbKeyTask()" };
/**
* 定时任务违规的字符
......
......@@ -120,7 +120,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
//微信回调
.antMatchers("/callback/payNotify/").permitAll()
//银行回调
.antMatchers("/ccbback/payNotify/").permitAll()
.antMatchers("/ccbback/payNotify/","/ccbRefund/**").permitAll()
.antMatchers("/msg/**").permitAll()
.antMatchers("/system/order/gzhSend").permitAll()
.antMatchers("/ccbRefund/refund").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