| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "提交内容", name = "remark", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "提交图片", name = "image", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "1=中文,2=英文,3=法语", name = "language", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil addReportLoss(Integer orderType, Integer orderId, String remark, String image){ |
| | | public ResultUtil addReportLoss(Integer orderType, Integer orderId, String remark, String image, Integer language){ |
| | | try { |
| | | reportLossService.addReportLoss(orderType, orderId, remark, image); |
| | | reportLossService.addReportLoss(orderType, orderId, remark, image, language); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | * @param image |
| | | * @throws Exception |
| | | */ |
| | | void addReportLoss(Integer orderType, Integer orderId, String remark, String image) throws Exception; |
| | | void addReportLoss(Integer orderType, Integer orderId, String remark, String image, Integer language) throws Exception; |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public void addReportLoss(Integer orderType, Integer orderId, String remark, String image) throws Exception { |
| | | public void addReportLoss(Integer orderType, Integer orderId, String remark, String image, Integer language) throws Exception { |
| | | ReportLoss reportLoss = new ReportLoss(); |
| | | reportLoss.setImage(image); |
| | | reportLoss.setInsertTime(new Date()); |
| | |
| | | if(ToolUtil.isNotEmpty(userInfo.getEmail())){ |
| | | String path = templatePath + "user/reportLoss.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo.getNickName() + ","); |
| | | EmailUtil.send(userInfo.getEmail(), "Report loss of goods", document.html()); |
| | | if(language == 1){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | Element english_user = document.getElementById("chinese_user"); |
| | | english_user.text("您好 " + userInfo.getNickName() + ","); |
| | | EmailUtil.send(userInfo.getEmail(), "物品报失", document.html()); |
| | | } |
| | | if(language == 2){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo.getNickName() + ","); |
| | | EmailUtil.send(userInfo.getEmail(), "Report loss of goods", document.html()); |
| | | } |
| | | if(language == 3){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | Element english_user = document.getElementById("french_user"); |
| | | english_user.text("Bonjour! " + userInfo.getNickName() + ","); |
| | | EmailUtil.send(userInfo.getEmail(), "Signaler une perte de marchandises", document.html()); |
| | | } |
| | | |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @Override |
| | | public ResultUtil delMyCoupon(Integer id, Integer uid, Integer language) throws Exception { |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(id); |
| | | if(userCouponRecord.getUserId() != uid){ |
| | | if(userCouponRecord.getUserId().compareTo(uid) != 0){ |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | return ResultUtil.error(language == 1 ? "您不能删除此优惠券" : language == 2 ? "You cannot delete this coupon" : "Vous ne pouvez pas supprimer ce coupon"); |
| | | } |
| | |
| | | public ResultUtil handselCoupon(Integer id, Integer uid, Integer userId, Integer language) throws Exception { |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(id); |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | if(userCouponRecord.getUserId() != uid){ |
| | | if(userCouponRecord.getUserId().compareTo(uid) != 0){ |
| | | return ResultUtil.error(language == 1 ? "您不能赠送此优惠券" : language == 2 ? "You cannot gift this coupon" : "Vous ne pouvez pas offrir ce coupon"); |
| | | } |
| | | if(userCouponRecord.getState() != 1){ |