From a812cd83d702b77f685e7211c00bb12403ccd8ae Mon Sep 17 00:00:00 2001 From: linfso Date: Fri, 7 Jun 2024 14:30:33 +0800 Subject: [PATCH] md --- .../erp/web/emis/EmisWaybillController.java | 80 +++++----- .../resources/mapper/EmisWaybillMapper.xml | 149 +++++++++--------- 2 files changed, 111 insertions(+), 118 deletions(-) diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillController.java index 174b2cb19..131a8ad47 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillController.java @@ -554,56 +554,56 @@ public class EmisWaybillController extends EmisBaseController JSONArray jArr = new JSONArray(); String printManCode=getLoginUser().getUser().getEmpCode(); - String strArry=PrintUtils.getPdfByBillCode(billCode,printType,printManCode); + // 先检查运单是否存在 + String tplCodeStr=WaybillHelper.formatQueryValue(printType); + String strArry=PrintUtils.getPdfByBillCode(billCode,tplCodeStr,printManCode); JSONArray fileArr = JSONArray.parseArray(strArry); for(Object objFile:fileArr) { - JSONObject jObjFileItem=(JSONObject)objFile; - String result=jObjFileItem.getString("result"); - String billCodeItem=jObjFileItem.getString("billCodeItem"); + JSONObject jObjFileItem = (JSONObject) objFile; + String result = jObjFileItem.getString("result"); + String billCodeItem = jObjFileItem.getString("billCodeItem"); JSONObject printItem = new JSONObject(); - printItem.put("billCode",billCodeItem); - if("success".equals(result)){ - String pdfbase64=jObjFileItem.getString("file"); - try - { - String fileId = UUID.fastUUID().toString(); - String fileUploadDir = PayConfig.getUploadPath()+File.separator+DateUtils.datePath(); + printItem.put("billCode", billCodeItem); + if (!"success".equals(result)) { + continue; + } - File saveDir = new File(fileUploadDir); - if(!saveDir.exists()){ - saveDir.mkdirs(); - } + String pdfbase64 = jObjFileItem.getString("file"); + try { + String fileId = UUID.fastUUID().toString(); + String fileUploadDir = PayConfig.getUploadPath() + File.separator + DateUtils.datePath(); - String saveFileName = fileUploadDir+File.separator+fileId+".jpg"; - - FileOutputStream os = new FileOutputStream(saveFileName);//输出流 - IXddTplPrint tplPrint = new TanexTplPrintImpl(); - PrintUtils.genImage(pdfbase64, os); - - JSONObject jObjRemark = new JSONObject(); - jObjRemark.put("billCode",billCodeItem); - jObjRemark.put("billCodeRange",billCodeRange); - jObjRemark.put("lang",lang); - jObjRemark.put("printType",printType); - - SysFileInfo sysFileInfo=sysFileInfoService.ossUploadLocalFile(saveFileName,billCodeItem,jObjRemark.toJSONString()); - String imageUrl = sysFileInfo.getFileRemoteUrl(); - printItem.put("imageUrl", imageUrl); - printItem.put("result","success"); - printItem.put("message","success"); + File saveDir = new File(fileUploadDir); + if (!saveDir.exists()) { + saveDir.mkdirs(); } - catch (Exception e) - { - e.printStackTrace(); - printItem.put("imageUrl", ""); - printItem.put("result","fail"); - printItem.put("message","生成图片异常"); - } + String saveFileName = fileUploadDir + File.separator + fileId + ".jpg"; + + FileOutputStream os = new FileOutputStream(saveFileName);//输出流 + IXddTplPrint tplPrint = new TanexTplPrintImpl(); + PrintUtils.genImage(pdfbase64, os); + + JSONObject jObjRemark = new JSONObject(); + jObjRemark.put("billCode", billCodeItem); + jObjRemark.put("billCodeRange", billCodeRange); + jObjRemark.put("lang", lang); + jObjRemark.put("printType", printType); + + SysFileInfo sysFileInfo = sysFileInfoService.ossUploadLocalFile(saveFileName, billCodeItem, jObjRemark.toJSONString()); + String imageUrl = sysFileInfo.getFileRemoteUrl(); + printItem.put("imageUrl", imageUrl); + printItem.put("result", "success"); + printItem.put("message", "success"); + } catch (Exception e) { + e.printStackTrace(); + printItem.put("imageUrl", ""); + printItem.put("result", "fail"); + printItem.put("message", "生成图片异常"); + } jArr.add(printItem); - } // JSONArray jArr = new JSONArray(); diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index 13c6cad92..ab9c24f78 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -287,23 +287,23 @@ and cust_order_id=#{custOrderId} and bill_code_sub like concat('%', #{billCodeSub}, '%') - and order_status like concat('%', #{orderStatus}, '%') - and waybill_status like concat('%', #{waybillStatus}, '%') + and order_status=#{orderStatus} + and waybill_status=#{waybillStatus} and order_type like concat('%', #{orderType}, '%') and order_date = #{orderDate} and user_id = #{userId} - and customer_code like concat('%', #{customerCode}, '%') + and customer_code=#{customerCode} and customer_name like concat('%', #{customerName}, '%') and open_id like concat('%', #{openId}, '%') and receive_name like concat('%', #{receiveName}, '%') and receive_company like concat('%', #{receiveCompany}, '%') and receive_mobile like concat('%', #{receiveMobile}, '%') and receive_tel like concat('%', #{receiveTel}, '%') - and receive_country like concat('%', #{receiveCountry}, '%') - and receive_province like concat('%', #{receiveProvince}, '%') - and receive_city like concat('%', #{receiveCity}, '%') - and receive_county like concat('%', #{receiveCounty}, '%') - and receive_town like concat('%', #{receiveTown}, '%') + and receive_country=#{receiveCountry} + and receive_province=#{receiveProvince} + and receive_city=#{receiveCity} + and receive_county=#{receiveCounty} + and receive_town=#{receiveTown} and receive_address like concat('%', #{receiveAddress}, '%') and receive_postcode like concat('%', #{receivePostcode}, '%') and receive_pcd like concat('%', #{receivePcd}, '%') @@ -311,29 +311,28 @@ and send_company like concat('%', #{sendCompany}, '%') and send_mobile like concat('%', #{sendMobile}, '%') and send_tel like concat('%', #{sendTel}, '%') - and send_country like concat('%', #{sendCountry}, '%') - and send_province like concat('%', #{sendProvince}, '%') - and send_city like concat('%', #{sendCity}, '%') - and send_county like concat('%', #{sendCounty}, '%') - and send_town like concat('%', #{sendTown}, '%') + and send_country=#{sendCountry} + and send_province=#{sendProvince} + and send_city=#{sendCity} + and send_county=#{sendCounty} + and send_town=#{sendTown} and send_address like concat('%', #{sendAddress}, '%') and send_postcode like concat('%', #{sendPostcode}, '%') - and send_pcd like concat('%', #{sendPcd}, '%') - and payment_type like concat('%', #{paymentType}, '%') - and calc_fee_type like concat('%', #{calcFeeType}, '%') + and payment_type=#{paymentType} + and calc_fee_type=#{calcFeeType} and cust_no like concat('%', #{custNo}, '%') and cust_name like concat('%', #{custName}, '%') - and trans_line_type like concat('%', #{transLineType}, '%') - and product_type like concat('%', #{productType}, '%') + and trans_line_type=#{transLineType} + and product_type=#{productType} and time_type like concat('%', #{timeType}, '%') and meter_type like concat('%', #{meterType}, '%') and carry_type like concat('%', #{carryType}, '%') - and customs_clear like concat('%', #{customsClear}, '%') - and customs_eclaration like concat('%', #{customsEclaration}, '%') + and customs_clear=#{customsClear} + and customs_eclaration=#{customsEclaration} and estimate_date = #{estimateDate} - and pack_type like concat('%', #{packType}, '%') - and dispatch_method like concat('%', #{dispatchMethod}, '%') - and pickup_method like concat('%', #{pickupMethod}, '%') + and FIND_IN_SET(#{packType},pack_type) + and dispatch_method=#{dispatchMethod} + and pickup_method= #{pickupMethod} and pick_start_date = #{pickStartDate} and pick_finish_date = #{pickFinishDate} and pick_fail_reason like concat('%', #{pickFailReason}, '%') @@ -346,10 +345,8 @@ and warehouse_in_no like concat('%', #{warehouseInNo}, '%') and customer_delivery_begin_time like concat('%', #{customerDeliveryBeginTime}, '%') and customer_delivery_end_time like concat('%', #{customerDeliveryEndTime}, '%') - and goods_type like concat('%', #{goodsType}, '%') and goods_info like concat('%', #{goodsInfo}, '%') - and goods_pics like concat('%', #{goodsPics}, '%') - and bl_prepare_in_freight like concat('%', #{blPrepareInFreight}, '%') + and bl_prepare_in_freight=#{blPrepareInFreight} and prepare_in_est_fee = #{prepareInEstFee} and prepare_in_real_fee = #{prepareInRealFee} and prepare_in_express like concat('%', #{prepareInExpress}, '%') @@ -361,92 +358,84 @@ and parcel_qty = #{parcelQty} and bill_weight = #{billWeight} and volume_weight = #{volumeWeight} - and currency like concat('%', #{currency}, '%') + and currency= #{currency} and settlement_weight = #{settlementWeight} and scan_weight = #{scanWeight} and fee_weight = #{feeWeight} and freight = #{freight} - and real_payment_type like concat('%', #{realPaymentType}, '%') + and real_payment_type=#{realPaymentType} and real_fee = #{realFee} - and bl_special_quote like concat('%', #{blSpecialQuote}, '%') - and bl_over_long like concat('%', #{blOverLong}, '%') - and bl_bill like concat('%', #{blBill}, '%') + and bl_special_quote=#{blSpecialQuote} + and bl_over_long=#{blOverLong} + and bl_bill=#{blBill} + and bl_sign=#{blSign} and bl_bill_text like concat('%', #{blBillText}, '%') and bl_over_weight like concat('%', #{blOverWeight}, '%') and over_weight_number like concat('%', #{overWeightNumber}, '%') and fee_remaker like concat('%', #{feeRemaker}, '%') and third_code like concat('%', #{thirdCode}, '%') and real_value like concat('%', #{realValue}, '%') - and bl_insure like concat('%', #{blInsure}, '%') + and bl_insure= #{blInsure} and insure_value like concat('%', #{insureValue}, '%') and insure_value_currency like concat('%', #{insureValueCurrency}, '%') and insure_fee_currency like concat('%', #{insureFeeCurrency}, '%') and insure_fee = #{insureFee} and insure_remark like concat('%', #{insureRemark}, '%') - and insure_site_code like concat('%', #{insureSiteCode}, '%') - and insure_date like concat('%', #{insureDate}, '%') - and bl_print like concat('%', #{blPrint}, '%') + and insure_site_code=#{insureSiteCode} + and bl_print=#{blPrint} and print_man_code like concat('%', #{printManCode}, '%') - and print_site like concat('%', #{printSite}, '%') + and print_site=#{printSite}, and print_date like concat('%', #{printDate}, '%') - and print_count like concat('%', #{printCount}, '%') - and bl_disp_fd like concat('%', #{blDispFd}, '%') + and bl_disp_fd=#{blDispFd} and transfer_code like concat('%', #{transferCode}, '%') and transfer_billcode like concat('%', #{transferBillcode}, '%') and disp_fd_date = #{dispFdDate} and disp_fd_reason like concat('%', #{dispFdReason}, '%') - and current_site_code like concat('%', #{currentSiteCode}, '%') - and next_site_code like concat('%', #{nextSiteCode}, '%') - and last_site_code like concat('%', #{lastSiteCode}, '%') - and register_site_code like concat('%', #{registerSiteCode}, '%') + and current_site_code=#{currentSiteCode} + and next_site_code= #{nextSiteCode} + and last_site_code=#{lastSiteCode} + and register_site_code=#{registerSiteCode} and register_date = #{registerDate} - and register_man_code like concat('%', #{registerManCode}, '%') - and take_piece_employee_code like concat('%', #{takePieceEmployeeCode}, '%') + and register_man_code= #{registerManCode} + and take_piece_employee_code=#{takePieceEmployeeCode} and send_site_code=#{sendSiteCode} and send_date = #{sendDate} - and dispatch_man_code like concat('%', #{dispatchManCode}, '%') - and dispatch_date like concat('%', #{dispatchDate}, '%') - and dispatch_site_code like concat('%', #{dispatchSiteCode}, '%') + and dispatch_man_code=#{dispatchManCode} + and dispatch_site_code=#{dispatchSiteCode} and produce_bill_date = #{produceBillDate} - and produce_bill_site_code like concat('%', #{produceBillSiteCode}, '%') - and produce_bill_man_code like concat('%', #{produceBillManCode}, '%') - and destination_code like concat('%', #{destinationCode}, '%') - and destination_province like concat('%', #{destinationProvince}, '%') - and destination_city like concat('%', #{destinationCity}, '%') - and destination_county like concat('%', #{destinationCounty}, '%') - and dispatch_underling_site_code like concat('%', #{dispatchUnderlingSiteCode}, '%') - and destination_center_code like concat('%', #{destinationCenterCode}, '%') - and market_man_code like concat('%', #{marketManCode}, '%') - and payee like concat('%', #{payee}, '%') + and produce_bill_site_code=#{produceBillSiteCode} + and produce_bill_man_code=#{produceBillManCode} + and destination_code =#{destinationCode} + and destination_province=#{destinationProvince} + and destination_city=#{destinationCity} + and destination_county=#{destinationCounty} + and dispatch_underling_site_code=#{dispatchUnderlingSiteCode} + and destination_center_code=#{destinationCenterCode} + and market_man_code = #{marketManCode} + and payee=#{payee} and salesmen like concat('%', #{salesmen}, '%') - and operate_employee_code like concat('%', #{operateEmployeeCode}, '%') - and bl_is_question like concat('%', #{blIsQuestion}, '%') - and problem_type like concat('%', #{problemType}, '%') + and operate_employee_code=#{operateEmployeeCode} + and bl_is_question=#{blIsQuestion} + and problem_type=#{problemType} and problem_cause like concat('%', #{problemCause}, '%') and problem_delay_days = #{problemDelayDays} - and bl_message like concat('%', #{blMessage}, '%') - and bl_accept_message like concat('%', #{blAcceptMessage}, '%') - and bl_gen_subbill like concat('%', #{blGenSubbill}, '%') + and bl_message=#{blMessage} + and bl_accept_message=#{blAcceptMessage} + and bl_gen_subbill=#{blGenSubbill} and sign_man like concat('%', #{signMan}, '%') - and sign_man_code like concat('%', #{signManCode}, '%') - and sign_site_code like concat('%', #{signSiteCode}, '%') - and sign_date like concat('%', #{signDate}, '%') - and bill_pic_send_rmk like concat('%', #{billPicSendRmk}, '%') - and bill_pic_dispatch_rmk like concat('%', #{billPicDispatchRmk}, '%') - and timezone_offset like concat('%', #{timezoneOffset}, '%') - and payment_status like concat('%', #{paymentStatus}, '%') + and sign_man_code=#{signManCode} + and sign_site_code=#{signSiteCode} + and payment_status =#{paymentStatus} and payment_date = #{paymentDate} and payment_remark like concat('%', #{paymentRemark}, '%') and order_remark like concat('%', #{orderRemark}, '%') - and data_from like concat('%', #{dataFrom}, '%') and remark like concat('%', #{remark}, '%') - and del_flag like concat('%', #{delFlag}, '%') - and create_by like concat('%', #{createBy}, '%') - and create_time = #{createTime} - and update_by like concat('%', #{updateBy}, '%') - and update_time = #{updateTime} - and create_site like concat('%', #{createSite}, '%') - and update_site like concat('%', #{updateSite}, '%') + and create_by= #{createBy} + and update_by=#{updateBy} + and create_site=#{createSite} + and update_site=#{updateSite} + + and send_date = ]]> #{params.beginSendDate} @@ -467,10 +456,14 @@ + + and bl_print=#{params.printFlag} + + and bill_code not in( select bill_code from emis_tms_pack_dtl where del_flag='0' )