package com.wechat.controller; import java.io.IOException; import java.math.BigDecimal; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.alibaba.fastjson.JSON; import com.wechat.common.Constants; import com.wechat.common.utils.MvcUtil; import com.wechat.common.utils.StringsUtils; import com.wechat.global.base.BaseController; import com.wechat.global.message.InfoMsg; import com.wechat.model.dbEntity.TdtgGoodsRejected; import com.wechat.model.responseDto.JsonResp; import com.wechat.service.WeiXinService; /** * FAQ问答 * */ @Controller @RequestMapping("refund") public class RefundController extends BaseController { //域名 @Value("#{configProperties['url.base']}") private String baseUrl; //图片根目录 @Value("#{configProperties['url.img.base']}") private String imgUrl; //退款图片路径 @Value("#{configProperties['upload.refund.path']}") private String refoundUrl; @Resource private WeiXinService wxService; /** * 获取下载图片信息(jpg) * * @param mediaId 文件的id * @throws Exception */ @RequestMapping(value = "saveGoodsRejected", method = RequestMethod.POST) public void saveGoodsRejected(@RequestParam String orderNo, @RequestParam String refundReason,@RequestParam BigDecimal refundAmount,@RequestParam String mobile,@RequestParam String imgList, @RequestParam String oldImgList, HttpServletRequest request, HttpServletResponse response) throws Exception { TdtgGoodsRejected rejected = new TdtgGoodsRejected(); JsonResp ret = new JsonResp(); int imgLength = 0; if(StringsUtils.isEmpty(orderNo)) { ret.setMsg(InfoMsg.ERROR_SAVE_FIELD); } else { //mediaid 获取微信服务器图片 if(!StringsUtils.isEmpty(imgList)) { String[] imgArray = StringsUtils.split(imgList, ";"); imgLength = imgArray.length; for(int i=0; i