|
|
|
@@ -24,7 +24,9 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
import java.io.OutputStream; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@@ -247,4 +249,42 @@ public class WxProfitSharingReceiverApplyController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping(value = "/getYwsqh_v2") |
|
|
|
@ApiOperation("获取图片") |
|
|
|
public void getYwsqh_v2(@RequestBody Map<String, String> param, HttpServletResponse response) { |
|
|
|
logger.info("[" + getIpAddr() + "] WxMerchantMediaUploadController::getYwsqh_v2"); |
|
|
|
|
|
|
|
logger.info("getYwsqh---"+JSON.toJSONString(param)); |
|
|
|
TenantEntity tenantEntity = getTenantInfo(); |
|
|
|
|
|
|
|
String contact_name = param.get("contact_name"); |
|
|
|
String contact_id_number = param.get("contact_id_number"); |
|
|
|
String contact_department = param.get("contact_department"); |
|
|
|
String contact_job = param.get("contact_job"); |
|
|
|
String legal_person = param.get("legal_person"); |
|
|
|
String id_card_number = param.get("id_card_number"); |
|
|
|
String card_period_begin = param.get("card_period_begin"); |
|
|
|
String card_period_end = param.get("card_period_end"); |
|
|
|
Boolean isSeal = "true".equals(param.get("is_seal"))?true:false; |
|
|
|
String merchant_name = param.get("merchant_name"); |
|
|
|
|
|
|
|
byte[] bytes = ImgYwsqhUtil.imgCeate(contact_name, contact_id_number, contact_department, contact_job, |
|
|
|
legal_person, id_card_number, card_period_begin, card_period_end, isSeal, merchant_name); |
|
|
|
try{ |
|
|
|
if(bytes == null){ |
|
|
|
response.setCharacterEncoding("UTF-8"); |
|
|
|
response.setContentType("application/json"); |
|
|
|
ResultData resultData = new ResultData(ResultData.UNLOGIN,"用户未登录"); |
|
|
|
response.getWriter().write(JSON.toJSONString(resultData)); |
|
|
|
}else{ |
|
|
|
response.setContentType("image/jpeg"); |
|
|
|
OutputStream os=response.getOutputStream(); |
|
|
|
os.write(bytes); |
|
|
|
} |
|
|
|
}catch(Exception e){ |
|
|
|
logger.error("返回授权函异常"+e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |