From c253b555c7905c5136d47cd615ef545fa50cc6ad Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Sun, 20 Feb 2022 21:24:16 +0800 Subject: [PATCH] Merge branch 'api_score_meger' --- zq-erp/src/main/java/com/matrix/system/common/dao/BusParameterSettingsDao.java | 102 zq-erp/src/main/java/com/matrix/system/common/interceptor/HostInterceptor.java | 94 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopRevenueFlowDao.java | 18 zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-list.html | 1 zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java | 44 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalemanSettlementDao.java | 13 zq-erp/src/main/resources/config/test/application.properties | 33 zq-erp/src/main/resources/templates/views/admin/hive/statistics/store-inout-list.html | 33 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java | 26 zq-erp/src/main/java/com/matrix/system/activity/vo/AddLuckyDrawSetVo.java | 34 zq-erp/src/main/resources/static/js/plugin/moment.mini.js | 2 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLevel.java | 8 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawInfoVo.java | 44 zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java | 32 zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUseFlow.java | 18 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanGradeDao.java | 25 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListVo.java | 170 zq-erp/src/main/java/com/matrix/system/score/entity/BaseEntity.java | 69 zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html | 177 zq-erp/src/main/resources/static/images/pay/zhifubao.png | 0 zq-erp/src/main/resources/templates/views/admin/hive/statistics/vip-arrears-list.html | 79 zq-erp/src/main/resources/config/xcshop/application.properties | 75 zq-erp/src/main/resources/config/prd/config.json | 8 zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml | 802 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml | 2 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java | 17 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysBeauticianStateServiceImpl.java | 8 zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveRuleDao.java | 11 zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopCouponQuartz.java | 14 zq-erp/src/main/resources/static/images/luckyDraw/sAward.png | 0 zq-erp/src/main/java/com/matrix/system/hive/service/SysBeauticianStateService.java | 2 zq-erp/src/main/resources/templates/views/admin/hive/store/outStore-form.html | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java | 124 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml | 53 zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html | 27 zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java | 321 zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java | 183 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java | 13 zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java | 47 zq-erp/src/main/java/com/matrix/system/hive/service/SysProjServicesService.java | 23 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/MoneyCardUseFlowDto.java | 34 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryDetail.java | 2 zq-erp/src/main/java/com/matrix/system/common/bean/SysFunction.java | 50 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpOrderListDto.java | 78 zq-erp/src/main/resources/templates/views/common/login.html | 305 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopProductDao.java | 2 zq-erp/src/main/java/com/matrix/system/hive/service/imp/MoneyCardUseServiceImpl.java | 81 zq-erp/src/main/resources/static/images/luckyDraw/line.png | 0 zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoDetailVo.java | 116 zq-erp/src/main/java/com/matrix/system/common/bean/SysFnBtnRel.java | 50 zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java | 5 zq-erp/src/main/java/com/matrix/system/hive/action/ArticleController.java | 8 zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java | 23 zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java | 123 zq-erp/src/main/java/com/matrix/system/activity/vo/LogisticsVo.java | 18 zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html | 151 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml | 188 zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsAssembleDao.xml | 13 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopActivitiesAction.java | 40 zq-erp/src/main/resources/static/images/luckyDraw/zhuanpanchoujian.png | 0 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/TemplateMsgTask.java | 22 zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff.html | 299 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrderItem.java | 54 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form-bak.html | 348 zq-erp/src/main/java/com/matrix/system/hive/action/SysVipLabelController.java | 119 zq-erp/src/main/java/com/matrix/system/score/constant/ScoreSettingConstant.java | 66 zq-erp/src/main/java/com/matrix/system/app/utils/Sms106Send.java | 65 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml | 25 zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java | 286 zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java | 2 zq-erp/src/main/java/com/matrix/system/constance/Dictionary.java | 26 zq-erp/src/main/resources/templates/views/admin/hive/operate/trainingMaterialsManage-form.html | 71 zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java | 281 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java | 676 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java | 247 zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml | 22 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderDingDingNoticeTask.java | 93 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java | 80 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java | 6 zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-update.html | 1055 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java | 52 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/FwwcTemplateMessageBulder.java | 109 zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/CalculatePostagePOJO.java | 6 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YycgTemplateMessageBulder.java | 113 zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java | 18 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-summary.html | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java | 6 zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java | 385 zq-erp/src/main/java/com/matrix/system/hive/dao/QuestionDao.java | 2 zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java | 137 zq-erp/src/main/java/com/matrix/system/hive/action/util/QueryUtil.java | 17 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java | 17 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java | 21 zq-erp/src/main/java/com/matrix/system/hive/pojo/CzXkVo.java | 14 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-summary.html | 49 zq-erp/src/main/java/com/matrix/system/app/action/ApiServiceOrderAction.java | 291 zq-erp/src/main/java/com/matrix/config/CrossOriginConfig.java | 33 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderItemDao.xml | 33 zq-erp/src/main/java/com/matrix/system/activity/vo/ActivitiesListVo.java | 107 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java | 66 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanAppliingDto.java | 20 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html | 337 zq-erp/src/main/java/com/matrix/system/app/dto/BusinessesDto.java | 45 zq-erp/src/main/java/com/matrix/system/activity/dto/AddSignAwardSetDto.java | 28 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/templateMsg/AppointmentSuccess.java | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java | 119 zq-erp/src/main/resources/templates/views/admin/hive/store/projService-list.html | 5 zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-receive.html | 294 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopWxtemplateMsgAction.java | 18 zq-erp/src/main/resources/config/lhx/config.json | 8 zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java | 10 zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java | 49 zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java | 33 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java | 28 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java | 22 zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java | 61 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProductListVo.java | 58 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html | 360 zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java | 131 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java | 141 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ClickSignDTO.java | 17 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponDao.xml | 6 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java | 111 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java | 23 zq-erp/src/main/resources/templates/views/admin/hive/orgment/shopInfo-form.html | 2 zq-erp/src/main/resources/static/images/sign/shalonghuodong.png | 0 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/paramProtocol/BrandWCPayRequestData.java | 6 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml | 69 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java | 103 zq-xcx/app.js | 2 zq-erp/src/main/java/com/matrix/system/hiveErp/action/DataAnalysisCustomer.java | 76 zq-erp/src/main/resources/config/db/increment/美度业绩升级.sql | 15 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java | 25 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopPageDao.java | 2 zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml | 697 zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanApplyCondition.java | 35 zq-erp/src/main/java/com/matrix/system/constance/SystemConstance.java | 9 zq-erp/src/test/java/com/matrix/SourceFlowTests.java | 115 zq-erp/src/main/resources/templates/views/admin/hive-erp/score/score-setting.html | 339 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java | 69 zq-erp/src/test/java/com/matrix/BizUserToVipInfoTool.java | 93 zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffListVo.java | 77 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java | 72 zq-erp/src/main/java/com/matrix/system/hive/statistics/StatisticsBusinessDataJob.java | 12 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java | 54 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java | 82 zq-xcx/utils/util.js | 12 zq-erp/src/main/java/com/matrix/component/redis/RedisClient.java | 2 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html | 306 zq-erp/src/main/resources/mybatis/mapper/common/SysRolePwoerFnDao.xml | 19 zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoDetailVo.java | 195 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java | 188 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form.html | 678 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java | 309 zq-erp/src/main/java/com/matrix/system/hive/service/CodeService.java | 11 zq-erp/src/main/java/com/matrix/config/SwaggerConfig.java | 108 zq-erp/src/main/resources/config/xcx/config.json | 8 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml | 62 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml | 421 zq-erp/src/main/java/com/matrix/component/websoket/WebSoketScanQrCodeLoginObserver.java | 66 zq-erp/src/main/java/com/matrix/system/hive/dto/AchieveNewStatisticsDto.java | 41 zq-erp/src/main/resources/config/db/increment/推广员.sql | 243 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java | 109 zq-erp/src/main/java/com/matrix/system/app/vo/BeauticianVo.java | 61 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java | 68 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoVo.java | 46 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java | 97 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SeeAwardTextVo.java | 76 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html | 1104 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java | 66 zq-erp/src/main/java/com/matrix/system/oa/actions/OaFixedAssetsAction.java | 273 zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-taiyan.html | 197 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-item.html | 44 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelFyfaApplyDto.java | 17 zq-erp/src/main/java/com/matrix/system/app/dto/UsersQueryDto.java | 23 zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html | 37 zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java | 322 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java | 375 zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignAwardSetDao.java | 26 zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml | 777 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form-bak.html | 159 zq-erp/src/main/java/com/matrix/system/hive/statistics/moneyCardUseStatisticsAction.java | 40 zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java | 247 zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java | 230 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java | 10 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailItemVo.java | 63 zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java | 96 zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml | 51 zq-erp/src/main/java/com/matrix/system/common/actions/BusParameterSettingsAction.java | 1 zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDiagnoseItemVo.java | 31 zq-erp/src/main/resources/static/images/luckyDraw/xiexiecanyu.png | 0 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html | 35 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak.html | 140 zq-erp/src/main/java/com/matrix/component/rabbitmq/RabiitMqTemplate.java | 1 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-item.html | 49 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/TemplateMessageBulder.java | 19 zq-erp/src/main/java/com/matrix/system/common/service/impl/SysFunctionServiceImpl.java | 12 zq-erp/src/main/java/com/matrix/component/websoket/ScanQrCodeLoginDto.java | 57 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java | 6 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabelRelate.java | 41 zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml | 38 zq-erp/src/main/resources/static/js/systools/AjaxProxyVue.js | 15 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/business/JsApiPayBusiness.java | 6 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/projUseFlow-list.html | 128 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java | 88 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java | 12 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java | 164 zq-erp/src/main/java/com/matrix/system/hive/service/AchieveRuleService.java | 33 zq-erp/src/main/resources/templates/views/super/sysCompany-list.html | 1 zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawAwardCodeListVo.java | 57 zq-erp/src/main/resources/templates/views/admin/hive-erp/products/achieverule-list.html | 402 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopDeliveryDetailDao.java | 2 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service-hk.html | 10 zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java | 60 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java | 87 zq-erp/src/main/java/com/matrix/system/shopXcx/vo/LogisticsImportVo.java | 20 zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander2.java | 45 zq-erp/src/main/resources/templates/views/admin/index.html | 10 zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html | 18 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java | 59 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml | 6 zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawForUpdateDto.java | 17 zq-erp/src/main/resources/static/images/pay/wechat.png | 0 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak2.html | 170 zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java | 41 zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml | 46 zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityPayTimeOutQuartz.java | 11 zq-erp/src/main/java/com/matrix/system/activity/vo/SignReceiveListVo.java | 44 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartBillVo.java | 12 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java | 54 zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignWriteoffDao.xml | 113 zq-erp/src/main/resources/static/templates/logisticsImport.xls | 0 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java | 25 zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list.html | 3 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java | 44 zq-erp/src/main/java/com/matrix/system/hive/bean/AppVersion.java | 71 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ScoreUseRecordVo.java | 56 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopWxtemplateMsg.java | 89 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java | 82 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java | 96 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java | 281 zq-erp/src/main/java/com/matrix/system/score/dto/SocreRuleDto.java | 5 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopProductAction.java | 26 zq-erp/src/main/java/com/matrix/component/websoket/WebSocketPushHandler.java | 4 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderListVo.java | 45 zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/map.html | 2 zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html | 311 zq-erp/src/test/java/com/matrix/四月份家居产品业绩恢复.java | 61 zq-erp/src/main/resources/config/test/config.json | 8 zq-erp/src/main/java/com/matrix/system/app/action/AppOccupancyController.java | 60 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListProjVo.java | 45 zq-erp/src/main/java/com/matrix/component/tools/WxTempLateMsgUtil.java | 108 zq-erp/src/main/resources/config/lhx/application.properties | 3 zq-erp/src/main/resources/config/xcshop/config.json | 94 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopAdvertis.java | 13 zq-erp/src/main/resources/config/test/system.properties | 136 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html | 156 zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java | 314 zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java | 55 zq-erp/src/main/java/com/matrix/system/common/actions/CustomerDictionaryAction.java | 4 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenXiaoSettingVo.java | 139 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html | 1172 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java | 252 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopPage.java | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java | 20 zq-erp/src/main/resources/static/js/systools/MBase.js | 13 zq-erp/src/main/java/com/matrix/system/app/vo/QuestionVo.java | 88 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java | 20 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml | 8 zq-erp/src/main/resources/readme-jyy | 11 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java | 28 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java | 6 zq-erp/src/main/java/com/matrix/system/hive/pojo/ShoppingCarItemsVo.java | 12 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateOrderTime.html | 14 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardAssembleDao.xml | 20 zq-erp/src/main/java/com/matrix/system/activity/dto/GoodsDto.java | 19 zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java | 109 zq-erp/src/main/java/com/matrix/system/common/actions/SysCompanyAction.java | 11 zq-erp/src/main/java/com/matrix/system/common/init/InitWebContainer.java | 35 zq-erp/src/main/resources/mybatis/mapper/hive/AchieveRuleDao.xml | 7 zq-erp/src/main/java/com/matrix/component/rabbitmq/MqTask.java | 8 zq-erp/src/main/java/com/matrix/system/hive/service/MoneyCardUseService.java | 6 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-sumary.html | 33 zq-erp/src/main/java/com/matrix/system/app/vo/VipAchieveDataShowVo.java | 147 zq-erp/src/main/java/com/matrix/system/hive/action/OccupancyController.java | 21 zq-erp/src/main/resources/templates/views/admin/hive/vip/tc-form.html | 33 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignAwardSetVo.java | 174 zq-erp/src/main/java/com/matrix/system/activity/dto/SignForUpdateDto.java | 17 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderItemService.java | 20 zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java | 34 zq-erp/src/main/resources/static/images/pay/cash.png | 0 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java | 335 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalemanSettlementService.java | 20 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderFlowServiceImpl.java | 71 zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html | 73 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderItemServiceImpl.java | 4 zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffDto.java | 17 zq-erp/src/main/java/com/matrix/system/score/vo/ScoreRuleSettingsVo.java | 139 zq-erp/src/main/java/com/matrix/system/hive/service/QuestionSerivce.java | 2 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java | 17 zq-erp/src/main/resources/config/prd/application.properties | 23 zq-erp/src/main/resources/templates/views/admin/hive-erp/shop/shopInfo-form.html | 2 zq-erp/src/main/java/com/matrix/system/activity/vo/ZjrVo.java | 18 zq-erp/src/main/java/com/matrix/system/common/init/UserCacheManager.java | 120 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/BizUser.java | 188 zq-erp/src/main/resources/static/images/pc.png | 0 zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsCategoryDao.xml | 16 zq-erp/src/main/resources/static/images/sign/meiriqiandao.png | 0 zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml | 268 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceTcVo.java | 165 zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander.java | 46 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java | 122 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopRevenueFlowService.java | 20 zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java | 51 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml | 74 zq-erp/src/main/java/com/matrix/system/app/dto/FollowupListDto.java | 135 zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java | 159 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java | 700 zq-erp/src/main/java/com/matrix/TestClass.java | 4 zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java | 184 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml | 300 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-sumary.html | 33 zq-erp/pom.xml | 96 zq-erp/src/main/resources/static/images/pay/yinlian.png | 0 zq-erp/src/main/resources/config/xcx/system.properties | 51 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml | 6 zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderDto.java | 100 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml | 8 zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java | 60 zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java | 31 zq-erp/src/main/java/com/matrix/system/fenxiao/constant/FenxiaoSettingConstant.java | 61 zq-erp/src/main/java/com/matrix/system/app/dto/SettingDto.java | 13 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderItemDao.java | 13 zq-erp/src/main/java/com/matrix/system/hive/bean/SysStoreInfo.java | 11 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SeeAwardTextDto.java | 24 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopAdvertisDao.xml | 20 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceCommentDto.java | 41 zq-erp/src/main/java/com/matrix/system/hive/plugin/util/ImageUtil.java | 86 zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderService.java | 19 zq-erp/src/main/java/com/matrix/system/app/vo/StoreListVo.java | 67 zq-erp/src/main/java/com/matrix/system/activity/dto/AddLuckyDrawSetDto.java | 28 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java | 427 zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java | 164 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java | 71 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java | 12 zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java | 33 zq-erp/src/main/java/com/matrix/core/pojo/VerificationResult.java | 47 zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-form.html | 13 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/WxMoneyCardUseVO.java | 56 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml | 102 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new-bak.html | 229 zq-erp/src/main/java/fileMove.java | 158 zq-erp/src/main/resources/config/application.properties | 47 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-sumary.html | 32 zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignRecordDao.java | 27 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml | 8 zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/ShopOrderDto.java | 58 zq-erp/src/main/java/com/matrix/system/hive/service/TaiYanAliyunSmsService.java | 126 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductAttributeAction.java | 4 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Util.java | 2 zq-erp/src/main/java/com/matrix/system/app/authority/AppAuthorityManager.java | 248 zq-erp/src/main/resources/static/demoPage/soketTest.html | 2 zq-erp/src/main/java/com/matrix/system/app/dto/IdSubmitDto.java | 26 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java | 29 zq-erp/src/main/resources/config/xcshop/system.properties | 98 zq-erp/src/main/java/com/matrix/system/activity/dto/BeReadyDto.java | 17 zq-erp/src/main/java/com/matrix/system/hive/action/CustomerController.java | 3 zq-erp/src/main/java/com/matrix/core/pojo/PaginationVO.java | 2 zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java | 390 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopQrcordVisitorDao.java | 2 zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ApplyToBeAnSalesmanDto.java | 16 zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffVo.java | 62 zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignRecordAction.java | 22 zq-erp/src/main/java/com/matrix/system/common/tag/MatrixProcessorDialect.java | 1 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java | 108 zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignReceiveRecordDao.java | 41 zq-erp/src/main/java/com/matrix/system/app/action/ApiSettingAction.java | 54 zq-erp/src/main/resources/static/images/pay/card.png | 0 zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderItemService.java | 5 zq-erp/src/main/resources/static/images/qrcodeBack.png | 0 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java | 84 zq-erp/src/main/java/com/matrix/system/shopXcx/dto/DiscountExplain.java | 50 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTimeV2.html | 126 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java | 17 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html | 26 zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailAchieveItemVo.java | 36 zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml | 50 zq-erp/src/main/java/com/matrix/system/shopXcx/pojo/ShopOrderQueryPOJO.java | 4 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanDetailVo.java | 5 zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java | 5 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java | 8 zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java | 82 zq-erp/src/test/java/com/matrix/LocalCacheTest.java | 35 zq-erp/src/main/java/com/matrix/system/hive/dao/SysBeauticianStateDao.java | 4 zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/show.html | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivities.java | 31 zq-erp/src/main/resources/static/images/pay/tuan.png | 0 zq-erp/src/main/java/com/matrix/config/WebSocketConfig.java | 1 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java | 6 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/GmcgTemplateMessageBulder.java | 106 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml | 11 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/sysOrder-list.html | 25 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLevelDao.xml | 16 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java | 210 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailFlowVo.java | 37 zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjServiceMapper.java | 22 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopCouponAction.java | 3 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java | 20 zq-erp/src/main/resources/static/images/pay/qian.png | 0 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopLogisticsQueryServiceImpl.java | 153 zq-erp/src/main/resources/templates/views/admin/hive/vip/projUse-form.html | 29 zq-erp/src/main/java/com/matrix/system/app/dto/SmsCodeDto.java | 26 zq-erp/src/main/java/com/matrix/system/app/dto/LabelDto.java | 36 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/OrderCouponGroupService.java | 282 zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html | 29 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml | 28 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceOrderListDto.java | 50 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopCustomDetailVo.java | 27 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopOrderAction.java | 243 zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignAwardSetAction.java | 571 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java | 20 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/ScanPayQueryReqData.java | 6 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalemanSettlement.java | 93 zq-erp/src/main/resources/static/images/luckyDraw/tAward.png | 0 zq-erp/src/main/resources/templates/views/admin/hive-erp/store/store-list.html | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WXShopOrderService.java | 17 zq-erp/src/main/java/com/matrix/system/hive/dto/OrderFlowListDto.java | 126 zq-erp/src/main/java/com/matrix/system/activity/dto/SignReceiveListDto.java | 29 zq-erp/src/main/java/com/matrix/system/common/init/LocalCache.java | 215 zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawBasicJsonVo.java | 51 zq-xcx/project.config.json | 442 zq-erp/src/main/java/com/matrix/system/activity/dto/WriteoffCodeSubmitDto.java | 20 zq-erp/src/main/java/com/matrix/system/hive/pojo/StoreInOutRecordVO.java | 9 zq-erp/src/main/java/com/matrix/core/tools/MdcUtil.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java | 66 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java | 7 zq-erp/src/main/resources/config/system.properties | 34 zq-erp/src/main/java/com/matrix/core/tools/SmsUtils.java | 6 zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java | 92 zq-erp/src/main/java/com/matrix/system/activity/vo/SignSetBasicJsonVo.java | 29 zq-erp/src/test/java/com/matrix/TaiYanAliyunSmsServiceTest.java | 39 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoJsonVo.java | 31 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopActivitiesDao.java | 16 zq-erp/src/main/resources/权限 | 24 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java | 99 zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignReceiveRecordService.java | 22 zq-erp/src/main/java/com/matrix/config/MybatisPlusConfig.java | 22 zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml | 175 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysInstoreInfoServiceImpl.java | 3 zq-erp/src/main/resources/config/config.json | 8 zq-erp/src/main/java/com/matrix/system/hive/action/DepartInfoController.java | 5 zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw.html | 1027 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html | 37 zq-erp/src/main/java/com/matrix/system/app/mapper/MoneyCardUseMapper.java | 21 zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java | 68 zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/index.html | 2 zq-erp/src/main/java/com/matrix/system/common/service/impl/InitShopProductCateService.java | 6 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/SalesmanBasicDetailVo.java | 45 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java | 41 zq-erp/src/main/resources/static/images/dui.png | 0 zq-erp/src/main/resources/templates/views/admin/hive/operate/label-form.html | 59 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignRecordVo.java | 39 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java | 78 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java | 1470 zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java | 7 zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateSecKillDTO.java | 68 zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUse-form.html | 14 zq-erp/src/main/java/com/matrix/system/app/action/ApiShopInfoAction.java | 43 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxMoneyCardUseAction.java | 171 zq-erp/src/main/resources/config/db/increment/20210109.sql | 5 zq-erp/src/main/java/com/matrix/system/common/authority/strategy/ScanQrCodeLogin.java | 82 zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java | 7 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml | 8 zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardAssembleDao.java | 6 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/BizUserDao.java | 14 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml | 245 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SignAwardDto.java | 20 zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/StatisticsParamVo.java | 35 zq-erp/src/main/resources/static/images/luckyDraw/oAward.png | 0 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignSuccessVo.java | 151 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProductComment.java | 28 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-sumary.html | 32 zq-erp/src/main/java/com/matrix/system/hive/dto/ScoreChangeDto.java | 26 zq-erp/src/main/java/com/matrix/system/hive/vo/DailyBeautyListVo.java | 50 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderOutSotoreTask.java | 18 zq-erp/src/main/resources/mybatis/mapper/hive/QuestionDao.xml | 5 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListVo.java | 147 zq-erp/src/main/java/com/matrix/core/pojo/AjaxResult.java | 36 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailVo.java | 158 zq-erp/src/main/java/com/matrix/system/hive/action/GoodsTypeController.java | 5 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml | 13 zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java | 201 zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityGroupJoinTimeOutQuartz.java | 11 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java | 59 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopWxtemplateMsgDao.xml | 45 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-item.html | 15 zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpVipInfoController.java | 113 zq-erp/src/main/java/com/matrix/system/app/mapper/SysUsersMapper.java | 53 zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/MoneyCardUseMapperImpl.java | 52 zq-erp/src/main/java/com/matrix/system/score/dto/ScoreRuleSettingDto.java | 8 zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list-pl.html | 182 zq-erp/src/main/java/com/matrix/system/activity/vo/GoodsVo.java | 29 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopOrderDetailVo.java | 48 zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-form.html | 4 zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java | 9 zq-erp/src/main/java/com/matrix/system/hive/vo/AchieveNewStatisticsVo.java | 42 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailItemVo.java | 107 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseV2Dao.xml | 7 zq-erp/src/main/java/com/matrix/system/hive/bean/Article.java | 14 zq-erp/src/main/resources/mybatis/mapper/hive/SysStoreInfoDao.xml | 17 zq-erp/src/main/resources/static/images/luckyDraw/zhuanpan.png | 0 zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseV2Dao.java | 12 zq-erp/src/main/java/com/matrix/system/app/dto/LoginDto.java | 48 zq-erp/src/main/java/com/matrix/system/hive/bean/SysSkinCheckRecord.java | 38 zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml | 438 zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java | 78 zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java | 82 zq-erp/src/main/resources/static/images/luckyDraw/start.png | 0 zq-erp/.gitignore | 4 zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/index.html | 2 zq-erp/src/main/java/com/matrix/system/common/dao/SysCompanyDao.java | 1 zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java | 5 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java | 153 zq-erp/src/main/resources/config/db/increment/2021-04-20bug.sql | 5 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderFlowDao.xml | 195 zq-erp/src/main/java/com/matrix/component/asyncmessage/AsyncMessageManager.java | 117 zq-erp/src/main/java/com/matrix/system/app/dto/OrderListDto.java | 84 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java | 22 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesLuckydrawAction.java | 542 zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java | 23 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanGradeVo.java | 17 zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/taiyan.html | 219 zq-erp/src/test/java/com/matrix/JyyTests.java | 114 zq-erp/src/main/java/com/matrix/system/hive/service/imp/QuestionServiceImpl.java | 4 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html | 672 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html | 19 zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java | 103 zq-erp/src/main/java/com/matrix/system/activity/vo/AddSignAwardSetVo.java | 34 zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java | 144 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopLogisticsQueryAction.java | 2 zq-erp/src/main/java/com/matrix/system/hive/vo/BjOrderVo.java | 13 zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveRule.java | 33 zq-erp/src/main/resources/templates/views/admin/hive/statistics/custom-consume-list.html | 161 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java | 29 zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml | 18 zq-erp/src/main/java/com/matrix/system/common/bean/SysUsers.java | 23 zq-erp/src/main/java/com/matrix/system/job/ServiceOvertimeNoticeJob.java | 59 zq-erp/src/main/resources/templates/views/admin/sys/customerDataDictionary-list.html | 4 zq-erp/src/main/java/com/matrix/system/app/dto/UploadPhotoDto.java | 26 zq-erp/src/main/java/com/matrix/system/hive/service/SysProjUseService.java | 25 zq-erp/src/main/java/com/matrix/system/app/dto/ServiceVipProjDto.java | 48 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java | 31 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListProjVo.java | 47 zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffListDto.java | 21 zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignAwardSet.java | 199 zq-erp/src/test/java/com/matrix/TcProjTest.java | 67 zq-erp/src/main/java/com/matrix/system/app/mapper/SysBeauticianStateMapper.java | 34 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java | 22 zq-erp/src/main/java/com/matrix/system/activity/vo/CouponVo.java | 30 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopPageAction.java | 31 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopAdvertisTypeAction.java | 4 zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml | 31 zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html | 249 zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderItemDto.java | 41 zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java | 102 zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java | 10 zq-erp/src/main/resources/mybatis/mapper/common/SysRoleDao.xml | 14 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java | 15 zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignRecordService.java | 22 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/GzhTemplateMessagePojo.java | 134 zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderFlowService.java | 17 zq-erp/src/main/resources/static/demoPage/soketLoginTest.html | 138 zq-erp/src/main/java/com/matrix/system/app/dto/CreateOderItemDto.java | 67 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanGrade.java | 75 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java | 545 zq-erp/src/main/java/com/matrix/system/common/actions/SysRoleAction.java | 6 zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerDto.java | 38 zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml | 405 zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java | 93 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip_bak.html | 284 zq-erp/src/main/java/com/matrix/system/app/dto/RankingDto.java | 44 zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml | 299 zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html | 53 zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoVo.java | 135 zq-erp/src/main/java/com/matrix/system/hive/action/TaocanController.java | 66 zq-erp/src/main/resources/templates/views/super/sysCompany-form.html | 368 zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateSignAwardSetDto.java | 34 zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java | 21 zq-erp/src/main/resources/static/images/sign/signHead.png | 0 zq-erp/src/main/java/com/matrix/component/tools/WxacodeUtil.java | 38 zq-erp/src/main/java/com/matrix/system/app/dto/UrlDto.java | 12 zq-erp/src/main/java/com/matrix/system/app/mapper/SysWorkBeatuistaffMapper.java | 25 zq-erp/src/main/resources/mybatis/mybatis-config.xml | 1 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderListDto.java | 41 zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw-update.html | 1116 zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java | 42 zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java | 405 zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java | 308 zq-erp/src/main/resources/templates/views/common/showprojException.html | 51 zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignWriteoffAction.java | 85 zq-erp/src/main/java/com/matrix/system/activity/dto/CouponDto.java | 19 zq-erp/src/main/resources/config/xcx/application.properties | 40 zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckListVo.java | 69 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html | 876 zq-erp/src/main/resources/templates/views/admin/sys/sysRole-form.html | 8 zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpOrderController.java | 29 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductAttributeDao.xml | 4 zq-erp/src/main/resources/templates/views/admin/hive/operate/label-list.html | 146 zq-erp/src/main/resources/templates/views/admin/shop/logisticsImport-form.html | 125 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderBasicDto.java | 14 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysWorktimeServiceImpl.java | 31 zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderCouponGroup.java | 43 zq-erp/src/main/java/com/matrix/ZqErpApplication.java | 4 zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java | 16 zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml | 149 zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderFlowDao.java | 27 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-order.html | 215 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java | 101 zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java | 96 zq-erp/src/main/java/com/matrix/system/hive/service/imp/ArticleServiceImpl.java | 7 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form-bak.html | 498 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/CzcgTemplateMessageBulder.java | 110 zq-erp/src/main/resources/templates/views/admin/activity/activity-market.html | 216 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payProtocol/JsApiPayReqData.java | 23 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadSetOrderListDtoDto.java | 27 zq-erp/src/main/java/com/matrix/system/hive/statistics/ProjUseStatisticsAction.java | 43 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java | 27 zq-erp/src/main/resources/static/images/qrcode.png | 0 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/index.html | 2 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html | 150 zq-erp/src/main/resources/templates/views/admin/activity/activity-luckdraw-receive.html | 279 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html | 651 zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java | 9 zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawBasicJsonDto.java | 53 zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignAwardSetService.java | 272 zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderItem.java | 70 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopWxtemplateMsgDao.java | 2 zq-erp/src/main/resources/templates/views/admin/activity/activity-sign.html | 983 zq-erp/src/main/java/com/matrix/system/hive/action/ProjTypeController.java | 5 zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUseFlow-list.html | 71 zq-erp/src/main/java/com/matrix/system/app/dto/CreateOrderDto.java | 39 zq-erp/src/main/java/com/matrix/core/tools/rr/GlueFactory.java | 23 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java | 6 zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html | 8 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/WechatConfigure.java | 19 zq-erp/src/main/java/com/matrix/core/exception/GlobalExceptionHandler.java | 34 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java | 105 zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java | 20 zq-erp/src/main/java/com/matrix/system/app/dto/StoreListDto.java | 23 zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-form.html | 30 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateSetOrderDoneDto.java | 32 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-setting.html | 567 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/custom-consume-list.html | 155 zq-erp/src/main/resources/templates/views/admin/hive/vip/question-list.html | 2 zq-erp/src/main/java/com/matrix/system/activity/dto/DelRowDto.java | 17 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java | 71 zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-logistics-info.html | 340 zq-erp/src/main/java/com/matrix/system/app/dto/PwdResetDto.java | 51 zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsDetailVo.java | 77 zq-erp/src/test/java/com/matrix/JyyTests2.java | 241 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanGradeDao.xml | 68 zq-erp/src/main/java/com/matrix/system/common/service/BusParameterSettingService.java | 40 zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDetailVo.java | 80 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/BaseService.java | 4 zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsCategoryService.java | 2 zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/Caculate.java | 4 zq-erp/src/main/resources/templates/views/admin/hive/instore/instoreinfo-list.html | 2 zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoListVo.java | 101 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DdqxTemplateMessageBulder.java | 110 zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanCenterInfo.java | 45 zq-erp/src/main/java/com/matrix/system/common/actions/DeveloperAction.java | 7 zq-erp/src/main/java/com/matrix/system/score/mapper/ScoreRuleSettingMapper.java | 8 zq-erp/src/main/java/com/matrix/system/activity/dto/SignSetBasicJsonDto.java | 33 zq-erp/src/main/resources/static/images/sign/tiantianpingtuan.png | 0 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java | 46 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignAwardListVo.java | 37 zq-erp/src/main/java/com/matrix/system/app/dto/ServiceOrderListDto.java | 104 zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java | 93 zq-erp/src/main/java/com/matrix/system/activity/constant/ActivitySignConstant.java | 5 zq-erp/src/main/resources/config/lhx/system.properties | 3 zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderItemDto.java | 47 zq-erp/src/main/java/com/matrix/system/app/dto/ModifyUserDto.java | 116 zq-erp/src/main/java/com/matrix/system/hive/statistics/ServiceStatisticsAction.java | 44 zq-erp/src/main/java/com/matrix/system/hive/service/imp/CodeServiceImpl.java | 30 zq-erp/src/main/java/com/matrix/system/hive/action/BaseController.java | 11 zq-erp/src/main/java/com/matrix/component/rabbitmq/DeliverCallbackAdapter.java | 2 zq-erp/src/main/java/com/matrix/core/pojo/BasePageQueryDto.java | 44 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java | 407 zq-erp/src/main/java/com/matrix/system/common/actions/ProjExceptionAction.java | 21 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShareQrcord.java | 69 zq-erp/src/main/java/com/matrix/config/TaskScheduleConfig.java | 16 zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java | 12 zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignWriteoffDao.java | 30 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form-bak.html | 239 zq-erp/src/main/java/com/matrix/system/hive/statistics/DailySaleVo.java | 412 zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java | 102 zq-erp/src/main/java/com/matrix/system/app/dto/AddVipDto.java | 167 zq-erp/src/main/resources/templates/views/admin/shop/shopDeliveryInfo-list.html | 2 zq-erp/src/main/java/com/matrix/system/app/vo/RankingVo.java | 69 zq-erp/src/main/resources/static/images/sign/signButton.png | 0 zq-erp/src/main/java/com/matrix/core/tools/DateUtil.java | 135 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopRevenueFlowDao.xml | 49 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html | 518 zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsCategoryController.java | 17 zq-erp/src/main/resources/mybatis/mapper/hive/SysWorkBeatuistaffDao.xml | 28 zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java | 227 zq-erp/src/main/java/com/matrix/system/app/action/TestAction.java | 24 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponDao.java | 5 zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/map.html | 2 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html | 39 zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoVo.java | 67 zq-erp/src/main/resources/static/templates/vipInfoImport.xls | 0 zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java | 66 zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java | 33 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml | 59 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java | 21 zq-erp/src/main/java/com/matrix/system/hive/dao/ArticleDao.java | 5 zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatGzhApiTools.java | 134 zq-erp/src/main/java/com/matrix/core/tools/StringUtils.java | 59 zq-erp/src/main/resources/mybatis/mapper/fenxiao/BizUserDao.xml | 7 zq-erp/src/main/java/com/matrix/system/activity/dto/BeCloseDto.java | 17 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/achieveNewStatiostics.html | 366 zq-erp/src/main/resources/templates/views/admin/oa/assets/fixeAssets-list.html | 7 zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderDao.java | 27 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html | 704 zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsCategoryDao.java | 2 zq-erp/src/main/resources/static/css/styleOne/style.min.css | 8 zq-erp/src/main/java/com/matrix/component/tools/ImageUtil.java | 46 zq-erp/src/main/java/com/matrix/system/app/dto/VipStatisticsParamDto.java | 100 zq-erp/src/main/java/com/matrix/system/app/vo/ParameterSettingVo.java | 39 zq-erp/src/main/java/com/matrix/system/common/dao/SysRolePwoerFnDao.java | 1 zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html | 127 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java | 13 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalemanSettlementDao.xml | 41 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgPojo.java | 32 zq-erp/src/main/java/filecopy.java | 80 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml | 241 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTime.html | 13 zq-erp/src/main/java/com/matrix/component/asyncmessage/MessageHandler.java | 41 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadSetOrderListDtoVo.java | 35 zq-erp/src/main/java/com/matrix/system/common/bean/SysCompany.java | 14 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java | 14 zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/map.html | 2 zq-erp/src/main/java/com/matrix/system/app/mapper/QuestionMapper.java | 31 zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsService.java | 12 zq-erp/src/main/resources/static/templates/vipProjUse.xls | 0 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/FenXiaoSettingDao.java | 7 zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml | 48 zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignReceiveRecordAction.java | 21 zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java | 180 zq-erp/src/main/java/com/matrix/system/hive/action/SupplierInfoController.java | 10 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgParam.java | 49 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Signature.java | 20 zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java | 11 zq-erp/src/main/resources/static/js/plugin/qrcode.js | 614 zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java | 30 zq-erp/src/main/resources/config/mdprd/system.properties | 105 zq-erp/src/main/java/com/matrix/system/app/vo/UserAchieveVo.java | 91 zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailVo.java | 184 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html | 156 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-item.html | 38 zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java | 54 zq-erp/src/main/java/com/matrix/core/tools/DingDingRobotUtil.java | 1 zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsListVo.java | 118 zq-erp/src/test/java/com/matrix/FenxiaoSoreInitTest.java | 728 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/FenXiaoSettingEntity.java | 18 zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java | 174 zq-erp/src/main/resources/config/dev/system.properties | 10 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShareQrcordDao.java | 2 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html | 146 zq-erp/src/main/java/com/matrix/core/pojo/PaginationDto.java | 75 zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java | 42 zq-erp/src/main/java/com/matrix/system/hive/bean/SysInstoreInfo.java | 1 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java | 401 zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java | 206 zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml | 228 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateFyfaDto.java | 32 zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html | 560 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-summary.html | 49 zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java | 161 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html | 528 zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderFlow.java | 74 zq-erp/src/main/java/com/matrix/system/hiveErp/action/AchieveRuleAction.java | 129 zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsCategoryServiceImpl.java | 7 zq-erp/src/main/resources/log4j.properties | 50 zq-erp/src/main/java/com/matrix/system/common/interceptor/UserLoginInterceptor.java | 3 zq-erp/src/main/java/com/matrix/system/app/dto/ModifyVipDto.java | 181 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/serviceOrderDetail.html | 493 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartVo.java | 94 zq-erp/src/main/resources/config/db/increment/签到活动.sql | 214 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java | 26 zq-erp/src/main/resources/config/prd/system.properties | 7 zq-erp/src/main/java/com/matrix/system/common/actions/FileUploadAction.java | 8 zq-erp/src/main/java/com/matrix/system/common/actions/MultipleFileUploadAction.java | 169 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java | 444 zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java | 62 zq-erp/src/main/java/com/matrix/system/hive/dto/ServiceOrderTimeDto.java | 34 zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java | 90 zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java | 159 zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html | 177 zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java | 105 zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java | 12 zq-erp/src/main/resources/templates/views/admin/shop/shopProductComment-list.html | 81 zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html | 160 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailVo.java | 140 zq-erp/src/main/java/com/matrix/system/hiveErp/pojo/AchieveRuleItem.java | 56 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java | 18 zq-erp/src/main/resources/static/js/function/vip.js | 27 zq-erp/src/main/java/com/matrix/system/common/dto/WebLoginDto.java | 32 zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjServicesDao.java | 46 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java | 96 zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignWriteoff.java | 120 zq-erp/src/main/java/com/matrix/system/app/dto/VipInfoListDto.java | 122 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartGroupVo.java | 46 zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list-bak.html | 105 zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrder.java | 136 zq-erp/src/main/resources/templates/views/admin/shop/shopCoupon-form.html | 11 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java | 15 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-item.html | 39 zq-erp/src/test/java/com/matrix/TesatAsyncMessage.java | 42 zq-erp/src/main/java/com/matrix/system/app/dto/BeauticianDto.java | 41 zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUse.java | 99 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html | 219 zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignWriteoffService.java | 255 zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java | 112 zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java | 200 zq-erp/src/main/resources/templates/views/admin/hive/vip/question-form.html | 2 zq-erp/src/main/java/com/matrix/system/hive/service/ArticleService.java | 1 zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java | 287 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-service.html | 191 zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java | 30 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java | 66 zq-erp/src/main/resources/mybatis/mapper/hive/SysSkinCheckRecordDao.xml | 15 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html | 36 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-beauty-list.html | 223 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java | 80 zq-erp/src/main/java/com/matrix/system/score/scheduledJob/ScoreScheduledJob.java | 64 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java | 20 zq-erp/src/main/java/com/matrix/core/exception/GlobleException.java | 4 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html | 13 zq-erp/src/main/java/com/matrix/system/app/dto/BasePageDto.java | 38 zq-erp/src/main/java/com/matrix/system/common/bean/SysRole.java | 13 zq-erp/src/main/resources/templates/views/admin/hive/vip/sysSkinCheckRecord-form.html | 8 zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignAwardSetDao.xml | 42 zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjUseMapper.java | 37 zq-erp/src/main/java/com/matrix/system/hive/vo/ServiceOrderInfoVo.java | 69 zq-erp/src/main/java/com/matrix/core/tools/rr/GroovyDome.java | 34 zq-erp/src/main/java/com/matrix/system/common/actions/AdminAction.java | 58 zq-erp/src/main/java/com/matrix/system/app/dto/ArticleListDto.java | 26 zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsAssembleDao.java | 3 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml | 77 zq-erp/src/main/java/com/matrix/system/app/dto/SkinCheckListDto.java | 22 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html | 1734 + zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml | 240 zq-erp/src/main/java/com/matrix/system/app/dto/PwdModifyDto.java | 38 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-summary.html | 14 zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java | 10 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java | 19 zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java | 138 zq-erp/src/main/java/com/matrix/system/activity/dto/LogisticsSubmitDto.java | 28 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopDeliveryInfoAction.java | 27 zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java | 101 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java | 17 zq-erp/src/main/java/com/matrix/system/hive/service/imp/DataAnalysisCustomerServiceImpl.java | 192 zq-erp/src/main/java/com/matrix/system/fenxiao/service/FenXiaoSettingService.java | 53 zq-erp/src/main/java/com/matrix/system/app/mapper/SysSkinCheckRecordMapper.java | 38 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java | 6 zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html | 308 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml | 28 zq-erp/src/main/resources/config/mdprd/config.json | 94 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawSuccessVo.java | 150 zq-erp/src/main/java/com/matrix/component/tools/HttpClientUtil.java | 55 zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/meidu.html | 201 zq-erp/src/main/resources/config/mdprd/application.properties | 72 zq-erp/src/main/resources/config/dev/config.json | 8 zq-erp/src/main/java/com/matrix/system/common/actions/CommonAction.java | 111 zq-erp/src/main/java/com/matrix/system/app/vo/VipCardListVo.java | 78 zq-erp/src/main/resources/templates/views/admin/sys/admin-form.html | 2 zq-erp/src/main/java/com/matrix/system/app/action/ApiSkinCheckAction.java | 92 zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailItemVo.java | 125 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanGradeService.java | 20 zq-erp/src/main/resources/static/images/sign/jisumiaosha.png | 0 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawBasicInfoJsonVo.java | 60 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-item.html | 12 zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java | 133 zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff-info.html | 197 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html | 770 zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java | 63 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java | 40 zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerItemDto.java | 56 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/WithdrawalCashDto.java | 20 zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopAutomaticReceiveQuartz.java | 11 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java | 310 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YydsTemplateMessageBulder.java | 116 zq-erp/src/main/java/com/matrix/component/redis/RedisUserLoginUtils.java | 13 zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java | 186 zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckAnalysisItems.java | 77 zq-erp/src/main/java/findC.java | 50 zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateLuckyDrawSetDto.java | 34 /dev/null | 251 zq-erp/src/main/java/com/matrix/system/activity/dto/ActivitiesListDto.java | 22 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FyfaManageVo.java | 32 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/AsyncMessageRouting.java | 32 zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java | 38 zq-erp/src/main/java/com/matrix/system/score/dao/ScoreUseRecordDao.java | 25 910 files changed, 73,164 insertions(+), 11,426 deletions(-) diff --git a/zq-erp/.gitignore b/zq-erp/.gitignore index 2742ce7..31966d8 100644 --- a/zq-erp/.gitignore +++ b/zq-erp/.gitignore @@ -25,6 +25,7 @@ .idea/sqlDataSources.xml .idea/dynamic.xml .idea/uiDesigner.xml +*/resources/generated-sources/* # Gradle: .idea/gradle.xml .idea/ @@ -75,4 +76,5 @@ .project .classpath .settings -.metadata \ No newline at end of file +.metadata +.gitignore \ No newline at end of file diff --git a/zq-erp/pom.xml b/zq-erp/pom.xml index 9dba746..4049589 100644 --- a/zq-erp/pom.xml +++ b/zq-erp/pom.xml @@ -48,6 +48,12 @@ </properties> </profile> <profile> + <id>mdprd</id> + <properties> + <env>mdprd</env> + </properties> + </profile> + <profile> <id>xcx</id> <properties> <env>xcx</env> @@ -57,6 +63,12 @@ <id>lhx</id> <properties> <env>lhx</env> + </properties> + </profile> + <profile> + <id>xcshop</id> + <properties> + <env>xcshop</env> </properties> </profile> </profiles> @@ -341,7 +353,52 @@ <artifactId>alibaba-dingtalk-service-sdk</artifactId> <version>1.0.1</version> </dependency> - </dependencies> + + <!-- swagger2 start --> + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger2</artifactId> + <version>2.9.2</version> + </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-annotations</artifactId> + <version>1.5.23</version> + </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-models</artifactId> + <version>1.5.23</version> + </dependency> + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger-ui</artifactId> + <version>2.9.2</version> + </dependency> + <!-- swagger2 end --> + + <!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct --> + <dependency> + <groupId>org.mapstruct</groupId> + <artifactId>mapstruct</artifactId> + <version>1.3.0.Final</version> + </dependency> + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-boot-starter</artifactId> + <version>3.2.0</version> + </dependency> + <dependency> + <groupId>cn.hutool</groupId> + <artifactId>hutool-all</artifactId> + <version>5.3.1</version> + </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>26.0-jre</version> + </dependency> + </dependencies> <build> <resources> <resource> @@ -351,16 +408,15 @@ <exclude>config/dev/*</exclude> <exclude>config/prd/*</exclude> + <exclude>config/mdprd/*</exclude> <exclude>config/test/*</exclude> <exclude>config/xcx/*</exclude> + <exclude>config/xcshop/*</exclude> - <!-- - - <exclude>config/config.json</exclude> - <exclude>config/application.properties</exclude> - <exclude>config/system.properties</exclude> - --> - + <!-- --> + <exclude>config/config.json</exclude> + <exclude>config/application.properties</exclude> + <exclude>config/system.properties</exclude> <exclude>**/*.woff</exclude> <exclude>**/*.woff2</exclude> @@ -375,6 +431,7 @@ <include>**/*.woff2</include> <include>**/*.ttf</include> <include>**/*.xls</include> + <include>**/*.xml</include> </includes> </resource> <resource> @@ -394,6 +451,23 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> + <version>3.5.1</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + <annotationProcessorPaths> + <path> + <groupId>org.mapstruct</groupId> + <artifactId>mapstruct-processor</artifactId> + <version>1.3.0.Final</version> + </path> + <path> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.18.12</version> + </path> + </annotationProcessorPaths> + </configuration> </plugin> <!-- 热部署插件 --> @@ -426,11 +500,7 @@ </repository> - <repository> - <id>repository.jboss.org-public</id> - <name>JBoss.org Maven repository</name> - <url>https://repository.jboss.org/nexus/content/groups/public</url> - </repository> + </repositories> diff --git a/zq-erp/src/main/java/com/matrix/TestClass.java b/zq-erp/src/main/java/com/matrix/TestClass.java index 5ba006f..61d3a91 100644 --- a/zq-erp/src/main/java/com/matrix/TestClass.java +++ b/zq-erp/src/main/java/com/matrix/TestClass.java @@ -1,9 +1,7 @@ package com.matrix; -import java.io.FileWriter; import java.io.IOException; -import java.math.BigDecimal; public class TestClass { public static void main(String[] args) throws IOException { @@ -19,7 +17,7 @@ // printer.printRecord(cells); // } // printer.flush(); -// printer.close(); +// printer.close(); long t2 = System.currentTimeMillis(); System.out.println("CSV: " + (t2 - t1)); } diff --git a/zq-erp/src/main/java/com/matrix/ZqErpApplication.java b/zq-erp/src/main/java/com/matrix/ZqErpApplication.java index 2941bcc..2cc27eb 100644 --- a/zq-erp/src/main/java/com/matrix/ZqErpApplication.java +++ b/zq-erp/src/main/java/com/matrix/ZqErpApplication.java @@ -3,6 +3,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableAsync; /** * spring boot入口 @@ -10,9 +11,8 @@ * @author jiangyouyao */ @SpringBootApplication - @ComponentScan(basePackages = {"com.matrix.**"}) - +@EnableAsync public class ZqErpApplication { public static void main(String[] args) { diff --git a/zq-erp/src/main/java/com/matrix/biz/action/1.sql b/zq-erp/src/main/java/com/matrix/biz/action/1.sql deleted file mode 100644 index 9f5ebb3..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/1.sql +++ /dev/null @@ -1,129 +0,0 @@ -INSERT INTO `sys_data_dictionary` (`ID`,value, `type_NAME` ) -VALUES - (4, '优惠券', '礼遇类型 '), - (5, '是否', '礼遇类型 '), - (6, '会员转介', '到店途径'), - (7, '瑜珈转介', '到店途径'), - (8, '员工转介', '到店途径'), - (9, '赠送', '业务类型'), - (10, '购买', '业务类型'), - (11, '消耗', '业务类型'), - (12, '充值', '业务类型'), - (13, '补交', '业务类型'), - (14, '办卡', '业务类型'), - (15, '咨询', '业务类型'), - (17, '白羊座', '星座'), - (18, '金牛座', '星座'), - (19, '双子座', '星座'), - (20, '巨蟹座', '星座'), - (21, '狮子座', '星座'), - (22, '处女座', '星座'), - (23, '天秤座', '星座'), - (24, '天蝎座', '星座'), - (25, '射手座', '星座'), - (26, '摩羯座', '星座'), - (27, '水瓶座', '星座'), - (28, '双鱼座', '星座'), - (29, '鼠', '生肖'), - (30, '牛', '生肖'), - (31, '虎', '生肖'), - (32, '兔', '生肖'), - (33, '龙', '生肖'), - (34, '蛇', '生肖'), - (35, '马', '生肖'), - (36, '羊', '生肖'), - (37, '猴', '生肖'), - (38, '鸡', '生肖'), - (39, '狗', '生肖'), - (40, '猪', '生肖'), - (41, '活跃', '会员状态'), - (42, '不活跃', '会员状态'), - (43, '休眠', '会员状态'), - (44, '死客', '会员状态'), - (45, '有卡会员', '会员类型'), - (46, '无卡会员', '会员类型'), - (47, '线上会员', '会员类型'), - (49, '活跃', '会员活跃度'), - (50, '不活跃', '会员活跃度'), - (51, '休眠', '会员活跃度'), - (53, '消耗产品', '产品用途'), - (54, '家居产品', '产品用途'), - (55, '家居产品或消耗产品', '产品用途'), - (58, '上架', '产品状态'), - (59, '下架', '产品状态'), - (60, '张', '存货单位'), - (61, '套', '存货单位'), - (62, '瓶', '存货单位'), - (63, '盒', '存货单位'), - (64, '失败', '商机处理结果'), - (65, '成功', '商机处理结果'), - (66, '待处理', '商机处理结果'), - (67, '上架', '套餐状态'), - (68, '下架', '套餐状态'), - (69, '上架', '项目状态'), - (70, '下架', '项目状态'), - (71, '未审核', '审核状态'), - (72, '通过', '审核状态'), - (73, '未通过', '审核状态'), - (74, 'ml', '计量单位'), - (75, 'g', '计量单位'), - (77, '自然进店', '到店途径'), - (79, '花茶', '粥品名称'), - (80, '面膜', '易耗品名称'), - (81, '升', '存货单位'), - (82, '次', '计量单位'), - (83, '瓶', '计量单位'), - (84, '套', '计量单位'), - (86, '片', '计量单位'), - (87, '片', '存货单位'), - (88, '支', '存货单位'), - (89, '包', '存货单位'), - (90, '支', '计量单位'), - (91, '包', '计量单位'), - (92, '1', '积分签到赠送额'), - (94, '美肤', '微信项目分类'), - (95, '抗衰', '微信项目分类'), - (96, '微整', '微信项目分类'), - (97, '纤体', '微信项目分类'), - (98, '祛痘', '微信项目分类'), - (99, '祛斑', '微信项目分类'), - (100, '眉眼', '微信项目分类'), - (101, '美胸', '微信项目分类'), - (102, '舒缓', '微信项目分类'), - (103, '脱毛', '微信项目分类'), - (104, '私密', '微信项目分类'), - (105, '测试', '会员卡等级大类'), - (106, '折扣', '礼遇类型 '), - (109, '肌肤年轻化检测', '问卷分类'), - (110, '全面健康化检测', '问卷分类'), - (113, 'fdsfs', '粥品名称'), - (115, '户外广告', '到店途径'), - (116, '网络团购', '到店途径'), - (117, '市场-友阿体验', '到店途径'), - (118, '市场-艾特花嫁', '到店途径'), - (119, '市场-云水润心', '到店途径'), - (120, '市场-其它', '到店途径'), - (121, '2019年4月精选长沙', '到店途径'), - (122, '公司赠送-云水润心', '到店途径'), - (123, '市场-通联支付', '到店途径'), - (124, '市场-平安银行', '到店途径'), - (125, '单选', '问卷类型'), - (126, '多选', '问卷类型'), - (127, '文本', '问卷类型'), - (128, '长文本', '问卷类型'), - (131, '奈嘉洛眼龄健康管理', '问卷分类'), - (132, '标题', '问卷类型'), - (133, '台', '计量单位'), - (134, '台', '存货单位'), - (135, '只', '存货单位'), - (136, '只', '计量单位'), - (137, '盒', '计量单位'), - (138, '2018步步高母亲节活动卡', '到店途径'), - (139, '2018珠江物业母亲节活动', '到店途径'), - (140, '2018学乐教育母亲节活动', '到店途径'), - (141, '2019第一季度邮政银行客户', '到店途径'), - (142, '2019年3月商家联盟拓客活动', '到店途径'), - (143, '201903珠江花园画册拓客', '到店途径'), - (144, '沉睡', '会员活跃度'), - (145, '2019年4月精选长沙', '礼遇类型 '), - (146, '广发银行线上商城合作', '到店途径'); diff --git a/zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java b/zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java deleted file mode 100644 index daa4513..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.matrix.biz.action; - - -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.StringUtils; -import com.matrix.system.hive.action.util.QueryUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.List; - -/** - * @description 会员查询 - * @author pengliang - * @date 2019-06-19 - */ - -@Controller -@RequestMapping(value = "/admin/bizUser") -public class BizUserAction { - - @Autowired - private BizUserDao bizUserDao; - - /** - * 列表显示 - */ - @RequestMapping(value = "/showList") - public @ResponseBody - AjaxResult showList(BizUser bizUser, PaginationVO pageVo) { - - pageVo.setSort("createTime"); - pageVo.setOrder("desc"); - QueryUtil.setQueryLimitCom(bizUser); - List<BizUser> dataList = bizUserDao.selectInPage(bizUser, pageVo); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, - bizUserDao.selectTotalRecord(bizUser)); - return result; - } - - - /** - * 批量设置为销售员 - * @param ids - * @param status 1=销售员,0=普通用户 - * @return - */ - @RequestMapping(value = "/setUserSales") - @ResponseBody - public AjaxResult setUserSales(String ids,Integer status){ - List<String> userIds = StringUtils.strToCollToString(ids, ","); - bizUserDao.updateSalesByIds(userIds,status); - return new AjaxResult(AjaxResult.STATUS_SUCCESS,"修改成功"); - } - -} diff --git a/zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java b/zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java deleted file mode 100644 index 9107992..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.matrix.biz.action; - -import com.alibaba.fastjson.JSONObject; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.StringUtils; -import com.matrix.core.tools.UUIDUtil; -import com.matrix.system.common.constance.AppConstance; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.log4j.Logger; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * 多文件上传控制器 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年2月25日 - */ -@Controller -@RequestMapping(value = "admin/multipleUploadFile") -public class MultipleFileUploadAction { - Logger log = Logger.getLogger(MultipleFileUploadAction.class); - - @Value("${file_storage_path}") - private String fileStoragePath; - @Value("${static_resource_url}") - private String nginxUrl; - - /** - * 最大值 - */ - private Long maxSize = 1024*1024*100L; - - /** - * 多文件上传方法 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年2月25日 - * @param response - * @param request - * @return - * @throws IOException - * @throws FileUploadException - */ - @RequestMapping(value = "/doUpload") - public @ResponseBody JSONObject doFileUpload(HttpServletResponse response, MultipartHttpServletRequest request, Integer data) - throws IOException, FileUploadException { - // 文件保存目录路径 - String savePath = fileStoragePath; - // 文件保存目录URL - String saveUrl = nginxUrl; - // String msgPag = "common/fileUploadResult"; - JSONObject object = new JSONObject(); - response.setContentType("text/html; charset=UTF-8"); - request.setCharacterEncoding("UTF-8"); - - // 保存和访问路径检查 - if (StringUtils.isBlank(saveUrl) || StringUtils.isBlank(savePath)) { - object.put("status", "err"); - object.put("msg", "文件上传失败错误代码:001"); - return object; - } - // 检查目录 - File uploadDir = new File(savePath); - if (!uploadDir.isDirectory()) { - uploadDir.mkdir(); - } - // 检查目录写权限 -// if (!uploadDir.canWrite()) { -// object.put("status", "err"); -// object.put("msg", "上传目录没有写权限"); -// return object; -// } - - Map<String, MultipartFile> fileMaps = request.getFileMap(); - for (String key : fileMaps.keySet()) { - MultipartFile file = fileMaps.get(key); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - String ymd = sdf.format(new Date()); - savePath += ymd + "/"; - saveUrl += ymd + "/"; - File dirFile = new File(savePath); - if (!dirFile.exists()) { - dirFile.mkdirs(); - } - log.info("上传文件名:" + file.getOriginalFilename()); - log.info("上传文件大小:" + file.getBytes().length); - log.info("上传文件大小限制:" + maxSize); - log.info("上传文件大小是否超过限制:" + (file.getBytes().length > maxSize)); - if (file.getBytes().length > maxSize) { - object.put("status", "err"); - object.put("msg", "上传文件大小超过限制"); - return object; - } - String fileName = file.getOriginalFilename(); - String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(); - - fileName = fileName.replace("." + fileExt, ""); - fileName = getSensitive(fileName); - String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + "." + fileExt; - File uploadedFile = new File(savePath, newFileName); - try { - FileCopyUtils.copy(file.getBytes(), uploadedFile); - } catch (Exception e) { - object.put("status", "err"); - object.put("msg", "上传文件失败 "+e.getMessage()); - return object; - } - log.info("saveUrl:" + saveUrl); - String visitPath = saveUrl + newFileName; - log.info("上传一个文件:" + newFileName); - log.info("访问路径:" + visitPath); - // 获取回调函数 - /* - * String callBack = request.getParameter("callBack"); String inputId = - * request.getParameter("inputId"); request.setAttribute("status", "200"); - * request.setAttribute("callBack", callBack); request.setAttribute("inputId", - * inputId); request.setAttribute("url", visitPath); - */ - object.put("path", visitPath); - object.put("fileName", fileName); - object.put("status", 200); - if (data != null) { - object.put("index", data); - } - } - return object; - } - - /** - * 检查文件名,过滤特殊字符 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年2月25日 - * @param globWords - * @return - */ - public String getSensitive(String globWords) { - - String sensitive = ""; - Pattern pattern = Pattern.compile(AppConstance.SPECIAL_CHARACTERS); - Matcher matcher = pattern.matcher(globWords); - while (matcher.find()) { - sensitive += matcher.group(); - } - /* - * if(sensitive=="" || sensitive.length()<3 ){ - * sensitive=StringUtils.getRandomString(8); } - */ - return sensitive; - } -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java b/zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java deleted file mode 100644 index 6178cb5..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.matrix.biz.action; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.HashMap; -import java.util.Map; - - -/** - * 实时查询请求Demo - * @author Administrator - * - */ -public class SynQueryDemo { - - public static void main(String[] args) { - String key = "RFGYfbVI747"; //贵司的授权key - String customer = "244D09E91F5500D0AB888299959835A2"; //贵司的查询公司编号 - String com = "shunfeng"; //快递公司编码 - String num = "232581179302"; //快递单号 - String phone = ""; //手机号码后四位 - String from = ""; //出发地 - String to = ""; //目的地 - int resultv2 = 0; //开启行政规划解析 - - SynQueryDemo demo = new SynQueryDemo(key, customer); - String result = demo.synQueryData(com, num, phone, from, to, resultv2); - System.out.println(result); - } - - /** - * 实时查询请求地址 - */ - private static final String SYNQUERY_URL = "http://poll.kuaidi100.com/poll/query.do"; - - private String key; //授权key - private String customer; //实时查询公司编号 - - public SynQueryDemo(String key, String customer) { - this.key = key; - this.customer = customer; - } - - /** - * 实时查询快递单号 - * @param com 快递公司编码 - * @param num 快递单号 - * @param phone 手机号 - * @param from 出发地城市 - * @param to 目的地城市 - * @param resultv2 开通区域解析功能:0-关闭;1-开通 - * @return - */ - public String synQueryData(String com, String num, String phone, String from, String to, int resultv2) { - - StringBuilder param = new StringBuilder("{"); - param.append("\"com\":\"").append(com).append("\""); - param.append(",\"num\":\"").append(num).append("\""); - param.append(",\"phone\":\"").append(phone).append("\""); - param.append(",\"from\":\"").append(from).append("\""); - param.append(",\"to\":\"").append(to).append("\""); - if(1 == resultv2) { - param.append(",\"resultv2\":1"); - } else { - param.append(",\"resultv2\":0"); - } - param.append("}"); - - Map<String, String> params = new HashMap<String, String>(); - params.put("customer", this.customer); - String sign = MD5Utils.encode(param + this.key + this.customer); - params.put("sign", sign); - params.put("param", param.toString()); - - return this.post(params); - } - - /** - * 发送post请求 - */ - public String post(Map<String, String> params) { - StringBuffer response = new StringBuffer(""); - - BufferedReader reader = null; - try { - StringBuilder builder = new StringBuilder(); - for (Map.Entry<String, String> param : params.entrySet()) { - if (builder.length() > 0) { - builder.append('&'); - } - builder.append(URLEncoder.encode(param.getKey(), "UTF-8")); - builder.append('='); - builder.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8")); - } - byte[] bytes = builder.toString().getBytes("UTF-8"); - - URL url = new URL(SYNQUERY_URL); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setConnectTimeout(3000); - conn.setReadTimeout(3000); - conn.setRequestMethod("POST"); - conn.setRequestProperty("accept", "*/*"); - conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - conn.setRequestProperty("Content-Length", String.valueOf(bytes.length)); - conn.setDoOutput(true); - conn.getOutputStream().write(bytes); - - reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); - - String line = ""; - while ((line = reader.readLine()) != null) { - response.append(line); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - if (null != reader) { - reader.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - return response.toString(); - } -} - -/** - * md5加密 - */ -class MD5Utils { - private static MessageDigest mdigest = null; - private static char digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; - - private static MessageDigest getMdInst() { - if (null == mdigest) { - try { - mdigest = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } - } - return mdigest; - } - - public static String encode(String s) { - if(null == s) { - return ""; - } - - try { - byte[] bytes = s.getBytes(); - getMdInst().update(bytes); - byte[] md = getMdInst().digest(); - int j = md.length; - char str[] = new char[j * 2]; - int k = 0; - for (int i = 0; i < j; i++) { - byte byte0 = md[i]; - str[k++] = digits[byte0 >>> 4 & 0xf]; - str[k++] = digits[byte0 & 0xf]; - } - return new String(str); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } -} diff --git a/zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java b/zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java deleted file mode 100644 index 92049f8..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java +++ /dev/null @@ -1,479 +0,0 @@ -package com.matrix.biz.bean; - -import com.matrix.core.anotations.Extend; -import com.matrix.core.pojo.EntityDTO; - -import java.util.Date; - -/** - * @description 用户表 - * @author jyy - */ -public class BizUser extends EntityDTO{ - @Extend - private static final long serialVersionUID = 1L; - - - /** - * 主键 - */ - private String userId; - - - /** - * 真实姓名 - */ - private String userName; - - - /** - * 密码 - */ - private String userPassword; - - - /** - * 用户昵称 - */ - private String nickName; - - - /** - * 头像 - */ - private String avatarUrl; - - - /** - * 微信openid用户唯一标识 - */ - private String openId; - - - /** - * 用户在开发平台的唯一标识符 - */ - private String unionId; - - - /** - * 性别 1、男 2、女 0、未知 - */ - private String gender; - - - /** - * 手机号码 - */ - private String phoneNumber; - - - /** - * 用户所在地 - */ - private String area; - - - /** - * 用户所在城市 - */ - private String city; - - - /** - * 用户所在省份 - */ - private String province; - - - /** - * 用户所在国家 - */ - private String country; - - - /** - * 会话密匙 - */ - private String sessionKey; - - - /** - * 最后登录时间 - */ - private Date lastLoginTime; - - - /** - * 用户状态 - */ - private Integer userStatus; - - - /** - * vip等级 - */ - private Integer userVip; - - - /** - * 到期时间 - */ - private Date userExpiryTime; - - - /** - * 认证信息 - */ - private String userAuthentication; - - - /** - * 用户是否授权 1、是 2、否 - */ - private Integer userIsAuthorize; - - - /** - * 用户临时名称 - */ - private String userTempName; - - - /** - * 用户临时头像 - */ - private String userTempAvatarUrl; - - - /** - * 用户类型 1、普通用户 2、会员 3、游客 - */ - private Integer userType; - - - /** - * 用户总积分 - */ - private Integer totalScore; - - - /** - * 用户当前积分 - */ - private Integer currentScore; - - - /** - * 上级用户openId - */ - private String parentOpenId; - - - /** - * 绑定上级用户时间 - */ - private Date bindingParentTime; - - - /** - * 是否是销售员(1=是,0=否) - */ - private Integer isSales; - - - /** - * 开始时间 - */ - @Extend - private String startTime; - - /** - * 结束时间 - */ - @Extend - private String endTime; - /** - * token - */ - @Extend - private String token; - public String getToken() { - return token; - } - - private Long companyId; - public Long getCompanyId() { - return companyId; - } - - public void setCompanyId(Long companyId) { - this.companyId = companyId; - } - - public void setToken(String token) { - this.token=userId; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId=userId; - } - - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName=userName; - } - - - public String getUserPassword() { - return userPassword; - } - - public void setUserPassword(String userPassword) { - this.userPassword=userPassword; - } - - - public String getNickName() { - return nickName; - } - - public void setNickName(String nickName) { - this.nickName=nickName; - } - - - public String getAvatarUrl() { - return avatarUrl; - } - - public void setAvatarUrl(String avatarUrl) { - this.avatarUrl=avatarUrl; - } - - - public String getOpenId() { - return openId; - } - - public void setOpenId(String openId) { - this.openId=openId; - } - - - public String getUnionId() { - return unionId; - } - - public void setUnionId(String unionId) { - this.unionId=unionId; - } - - - public String getGender() { - return gender; - } - - public void setGender(String gender) { - this.gender=gender; - } - - - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber=phoneNumber; - } - - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area=area; - } - - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city=city; - } - - - public String getProvince() { - return province; - } - - public void setProvince(String province) { - this.province=province; - } - - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country=country; - } - - - public String getSessionKey() { - return sessionKey; - } - - public void setSessionKey(String sessionKey) { - this.sessionKey=sessionKey; - } - - - public Date getLastLoginTime() { - return lastLoginTime; - } - - public void setLastLoginTime(Date lastLoginTime) { - this.lastLoginTime=lastLoginTime; - } - - - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus=userStatus; - } - - - public Integer getUserVip() { - return userVip; - } - - public void setUserVip(Integer userVip) { - this.userVip=userVip; - } - - - public Date getUserExpiryTime() { - return userExpiryTime; - } - - public void setUserExpiryTime(Date userExpiryTime) { - this.userExpiryTime=userExpiryTime; - } - - - public String getUserAuthentication() { - return userAuthentication; - } - - public void setUserAuthentication(String userAuthentication) { - this.userAuthentication=userAuthentication; - } - - - public Integer getUserIsAuthorize() { - return userIsAuthorize; - } - - public void setUserIsAuthorize(Integer userIsAuthorize) { - this.userIsAuthorize=userIsAuthorize; - } - - - public String getUserTempName() { - return userTempName; - } - - public void setUserTempName(String userTempName) { - this.userTempName=userTempName; - } - - - public String getUserTempAvatarUrl() { - return userTempAvatarUrl; - } - - public void setUserTempAvatarUrl(String userTempAvatarUrl) { - this.userTempAvatarUrl=userTempAvatarUrl; - } - - - public Integer getUserType() { - return userType; - } - - public void setUserType(Integer userType) { - this.userType=userType; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public Integer getTotalScore() { - return totalScore; - } - - public void setTotalScore(Integer totalScore) { - this.totalScore = totalScore; - } - - public Integer getCurrentScore() { - return currentScore; - } - - public void setCurrentScore(Integer currentScore) { - this.currentScore = currentScore; - } - - public String getParentOpenId() { - return parentOpenId; - } - - public void setParentOpenId(String parentOpenId) { - this.parentOpenId = parentOpenId; - } - - public Date getBindingParentTime() { - return bindingParentTime; - } - - public void setBindingParentTime(Date bindingParentTime) { - this.bindingParentTime = bindingParentTime; - } - - public Integer getIsSales() { - return isSales; - } - - public void setIsSales(Integer isSales) { - this.isSales = isSales; - } -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java b/zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java deleted file mode 100644 index b87fbc8..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.matrix.biz.dao; - -import com.matrix.biz.bean.BizUser; -import com.matrix.core.pojo.PaginationVO; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - -/** - * @description 用户表 - * @author jyy - * @date 2019-05-31 10:03 - */ -public interface BizUserDao { - - public int insert(@Param("item") BizUser bizUser); - - public int batchInsert(@Param("list") List<BizUser> bizUserList); - - public int updateByMap(Map<String, Object> modifyMap); - - public int updateByModel(@Param("record") BizUser bizUser); - - public int deleteByIds(@Param("list") List<String> list); - - public int deleteById(String userId); - - public int deleteByModel(@Param("record") BizUser bizUser); - - public List<BizUser> selectInPage(@Param("record") BizUser bizUser, @Param("pageVo") PaginationVO pageVo); - - public List<BizUser> selectByModel(@Param("record") BizUser bizUser); - - public int selectTotalRecord(@Param("record") BizUser bizUser); - - public BizUser selectById(String userId); - - public BizUser selectForUpdate(String userId); - - public BizUser findByOpenId(@Param("openId") String openId); - - /** - * 批量设置销售员 - * @param list - * @param status - * @return - */ - int updateSalesByIds(@Param("list") List<String> list, @Param("status") Integer status); - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java b/zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java deleted file mode 100644 index 77ae0fe..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.matrix.biz.service; - -import com.matrix.biz.bean.BizUser; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.web.BaseServices; - -import java.util.List; - -/** - * @description service接口类 (用户表) - * @author jyy - * @date 2019-05-31 10:03 - */ -public interface BizUserService extends BaseServices<BizUser> { - - /** - * 新增 - */ - public int add(BizUser bizUser); - - /** - * 批量新增 - */ - public int batchAdd(List<BizUser> bizUserList); - - /** - * 根据map键值对 更新 - */ - public int modifyByMap(BizUser oldBizUser, BizUser newBizUser); - - /** - * 根据对象 更新 - */ - public int modifyByModel(BizUser bizUser); - - /** - * 批量删除 - */ - public int remove(List<String> list); - - /** - * 根据id删除 - */ - public int removeById(String userId); - - /** - * 根据对象删除 - */ - public int removeByModel(BizUser bizUser); - - /** - * 分页查询 - */ - public List<BizUser> findInPage(BizUser bizUser, PaginationVO pageVo); - - /** - * 根据对象查询 - */ - public List<BizUser> findByModel(BizUser bizUser); - - /** - * 统计记录数 - */ - public int findTotal(BizUser bizUser); - - /** - * 根据id查询 - */ - public BizUser findById(String userId); - - - /** - * 根据openId更新 - */ - - public BizUser findByOpenId(String openId); - - /** - * 保存用户信息 - */ - public int saveUserInfo(BizUser bizUser); -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java b/zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java deleted file mode 100644 index 415389b..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.matrix.biz.service.impl; - -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.biz.service.BizUserService; -import com.matrix.core.constance.MatrixConstance; -import com.matrix.core.constance.SystemErrorCode; -import com.matrix.core.exception.GlobleException; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.ModelUtils; -import com.matrix.core.tools.UUIDUtil; -import com.matrix.system.common.constance.AppConstance; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -/** - * @description service接口实现类(用户表) - * @author jyy - * @date 2019-05-31 10:03 - */ -@Service -public class BizUserServiceImpl implements BizUserService { - - - @Autowired - private BizUserDao bizUserDao; - - - @Override - public int add(BizUser bizUser){ - // 设置基本字段信息,临时字段 - bizUser.setUserIsAuthorize(AppConstance.IS_NOT_AUTHORIZE); - bizUser.setCreateBy(AppConstance.USER_TYPE_ADMIN); - bizUser.setUpdateBy(AppConstance.USER_TYPE_ADMIN); - bizUser.setUserId(UUIDUtil.getRandomID()); - return bizUserDao.insert(bizUser); - - } - - @Override - public int batchAdd(List<BizUser> bizUserList) { - //这里没有做基本字段的设置,如有需要请自己实现 - int num = 0; - int c = 10000; - int size = bizUserList.size()/c + 1; - for(int i=0; i<size; i++) { - int begin = i*c; - int end = (i+1)*c; - end = end >= bizUserList.size() ? bizUserList.size() : end; - List<BizUser> insertList = bizUserList.subList(begin, end); - num += bizUserDao.batchInsert(insertList); - } - return num; - - } - - - - @Override - public int modifyByMap(BizUser oldBizUser - ,BizUser newBizUser){ - - Map<String, Object> modifyMap = null; - try { - if (!ModelUtils.isModified(oldBizUser, newBizUser)) { - return MatrixConstance.DML_SUCCESSS; - } - modifyMap = ModelUtils.comparePojo2Map(oldBizUser, newBizUser); - } catch (Exception e) { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newBizUser); - } - if (modifyMap.size() > 0) { - modifyMap.put("userId", oldBizUser.getUserId()); - bizUserDao.updateByMap(modifyMap); - } - return MatrixConstance.DML_SUCCESSS; - } - - @Override - public int modifyByModel(BizUser bizUser){ - - return bizUserDao.updateByModel(bizUser); - - } - - - - @Override - public int remove(List<String> list){ - - return bizUserDao.deleteByIds(list); - - } - - @Override - public int removeById(String userId){ - - return bizUserDao.deleteById(userId); - - } - - @Override - public int removeByModel(BizUser bizUser){ - - return bizUserDao.deleteByModel(bizUser); - - } - - - @Override - public List<BizUser> findInPage(BizUser bizUser, PaginationVO pageVo){ - - return bizUserDao.selectInPage(bizUser , pageVo); - - } - - @Override - public List<BizUser> findByModel(BizUser bizUser){ - - return bizUserDao.selectByModel(bizUser); - - } - - @Override - public int findTotal(BizUser bizUser){ - - return bizUserDao.selectTotalRecord(bizUser); - - } - - @Override - public BizUser findById(String userId){ - - return bizUserDao.selectById(userId); - - } - - - @Override - public BizUser findByOpenId(String openId) { - return bizUserDao.findByOpenId(openId); - } - - /** - * 保存用户信息 - */ - @Override - public int saveUserInfo(BizUser bizUser) { - - return bizUserDao.updateByModel(bizUser); - } - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/component/asyncmessage/AsyncMessageManager.java b/zq-erp/src/main/java/com/matrix/component/asyncmessage/AsyncMessageManager.java new file mode 100644 index 0000000..a27cf0a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/component/asyncmessage/AsyncMessageManager.java @@ -0,0 +1,117 @@ +/** + * projectName: zq-erp + * fileName: MessageManager.java + * packageName: com.matrix.component.asyncmessage + * date: 2021-10-18 14:01 + * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. + */ +package com.matrix.component.asyncmessage; + +import cn.hutool.core.collection.CollectionUtil; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.locks.ReentrantLock; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * @version: V1.0 + * @author: JiangYouYao + * @className: AsyncMessageManager + * @packageName: com.matrix.component.asyncmessage + * @description: 异步消息管理者 + * @data: 2021-10-18 14:01 + **/ +@Component +@Order(Ordered.HIGHEST_PRECEDENCE) +public class AsyncMessageManager implements ApplicationRunner { + + @Autowired + private List<MessageHandler> obs; + + private Map<String, List<MessageHandler>> routes; + + + @Override + public void run(ApplicationArguments args) throws Exception { + if (CollectionUtil.isNotEmpty(obs)) { + routes = obs.stream().collect(Collectors.groupingBy(MessageHandler::getRouteKey)); + LogUtil.info("异步消息绑定成功,检测到{} 个消费者,共计{}组", obs.size(), routes.size()); + } else { + LogUtil.info("未检测到异步消息处理类"); + } + } + + + + + /** + * map 参数的字符串表示,方便快速拼装消息参数 + * @param routeKey + * @param mapStr + */ + public void sendMsg(String routeKey, String mapStr,Object... args){ + + if(StringUtils.isBlank(mapStr)){ + throw new IllegalArgumentException("mapStr格式错误:例如:\\\"orderId=123,price=88\\\",mapStr="+mapStr); + } + mapStr=String.format(mapStr,args); + + Map<String, Object> param =new HashMap<>(); + String[] paramStr = mapStr.split(","); + Arrays.asList(paramStr).forEach(item->{ + String[] keyValueArr = item.split("="); + param.put(keyValueArr[0],keyValueArr[1]); + }); + sendMsg(routeKey,param); + } + + /** + * 根据route 发送消息到对应的消费者 + * 这个方法本质上还是同步执行,没有完成效率上的异步解耦,这里做观察者模式主要是为了扩展业务,减少对第三方消息组件的依赖 + * 而不是解决性能问题,如果后续需要解决性能问题,在加一个消息队列,然后启动线程从队列中进行消息的消费。 + * @param routeKey + * @param param + */ + public void sendMsg(String routeKey, Map<String, Object> param) { + + if(StringUtils.isBlank(routeKey)){ + LogUtil.warn("发送异步消息失败:routeKey为空"); + return; + } + + //匹配观察者 + List<MessageHandler> lisener = new ArrayList<>(); + for (Map.Entry<String, List<MessageHandler>> routesEntry : routes.entrySet()) { + if (Pattern.matches(routesEntry.getKey(), routeKey)) { + lisener.addAll(routesEntry.getValue()); + } + } + + //通知观察者 + if (CollectionUtil.isNotEmpty(lisener)) { + LogUtil.info("发送异步消息,routeKey={},匹配观察者{}个",routeKey,lisener.size()); + for (MessageHandler messageHandler : lisener) { + try{ + messageHandler.handle(param); + }catch (Throwable t){ + LogUtil.error("{},处理类执行异常:routeKey={},message={}", messageHandler.getName(),routeKey,t.getMessage()); + } + } + }else{ + LogUtil.warn("未匹配到routeKey={},的消费者",routeKey); + } + + } + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/component/asyncmessage/MessageHandler.java b/zq-erp/src/main/java/com/matrix/component/asyncmessage/MessageHandler.java new file mode 100644 index 0000000..bc4d9e1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/component/asyncmessage/MessageHandler.java @@ -0,0 +1,41 @@ +/** + * projectName: zq-erp + * fileName: MessageHandler.java + * packageName: com.matrix.component.asyncmessage + * date: 2021-10-18 13:59 + * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. + */ +package com.matrix.component.asyncmessage; + +import java.util.Map; + +/** + * @version: V1.0 + * @author: JiangYouYao + * @className: MessageHandler + * @packageName: com.matrix.component.asyncmessage + * @description: 异步消息处理接口 + * @data: 2021-10-18 13:59 + **/ +public interface MessageHandler { + + /** + * 处理类的名字 + * @return + */ + String getName(); + + /** + * 返回任务的路由key,当有对应key的事件发生时,消息管理器会触发handle方法。 + * key 支持正则表达式 + * @return + */ + String getRouteKey(); + + /** + * 实际任务处理方法 + * @param param + */ + void handle(Map<String,Object> param); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander.java b/zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander.java new file mode 100644 index 0000000..cecbcd5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander.java @@ -0,0 +1,46 @@ +/** + * projectName: zq-erp + * fileName: TestMessageHander.java + * packageName: com.matrix.component.asyncmessage + * date: 2021-10-18 16:05 + * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. + */ +package com.matrix.component.asyncmessage; + +import com.matrix.core.tools.LogUtil; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @version: V1.0 + * @author: JiangYouYao + * @className: TestMessageHander + * @packageName: com.matrix.component.asyncmessage + * @description: 测试观察者 + * @data: 2021-10-18 16:05 + **/ +@Component +public class TestMessageHander implements MessageHandler{ + + @Override + public String getName() { + return "测试观察者"; + } + + @Override + public String getRouteKey() { + return "testkey"; + } + + @Override + public void handle(Map<String, Object> param) { + try { + Thread.sleep(1000*5); + } catch (InterruptedException e) { + e.printStackTrace(); + } + LogUtil.debug(param.toString()); + } +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander2.java b/zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander2.java new file mode 100644 index 0000000..53364b9 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/component/asyncmessage/TestMessageHander2.java @@ -0,0 +1,45 @@ +/** + * projectName: zq-erp + * fileName: TestMessageHander.java + * packageName: com.matrix.component.asyncmessage + * date: 2021-10-18 16:05 + * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. + */ +package com.matrix.component.asyncmessage; + +import com.matrix.core.tools.LogUtil; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @version: V1.0 + * @author: JiangYouYao + * @className: TestMessageHander + * @packageName: com.matrix.component.asyncmessage + * @description: 测试观察者 + * @data: 2021-10-18 16:05 + **/ +@Component +public class TestMessageHander2 implements MessageHandler{ + + @Override + public String getName() { + return "测试观察者"; + } + + @Override + public String getRouteKey() { + return "55y"; + } + + @Override + public void handle(Map<String, Object> param) { + try { + Thread.sleep(1000*5); + } catch (InterruptedException e) { + e.printStackTrace(); + } + LogUtil.debug(param.toString()); + } +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/component/rabbitmq/DeliverCallbackAdapter.java b/zq-erp/src/main/java/com/matrix/component/rabbitmq/DeliverCallbackAdapter.java index 887b2b2..d477acc 100644 --- a/zq-erp/src/main/java/com/matrix/component/rabbitmq/DeliverCallbackAdapter.java +++ b/zq-erp/src/main/java/com/matrix/component/rabbitmq/DeliverCallbackAdapter.java @@ -1,4 +1,4 @@ -package com.matrix.core.rabbitmq; +package com.matrix.component.rabbitmq; import com.matrix.core.exception.GlobleExceptionResolver; import com.matrix.core.tools.LogUtil; diff --git a/zq-erp/src/main/java/com/matrix/component/rabbitmq/MqTask.java b/zq-erp/src/main/java/com/matrix/component/rabbitmq/MqTask.java index 2745b5e..eafb7c2 100644 --- a/zq-erp/src/main/java/com/matrix/component/rabbitmq/MqTask.java +++ b/zq-erp/src/main/java/com/matrix/component/rabbitmq/MqTask.java @@ -26,7 +26,7 @@ /** * 处理类在spring中的bean名称 */ - private com.matrix.core.rabbitmq.DeliverCallbackAdapter handerAdapter; + private DeliverCallbackAdapter handerAdapter; /** * 自动确认 默认为true @@ -39,7 +39,7 @@ this.queue = queue; this.routingKey = routingKey; if(hander!=null){ - this.handerAdapter = new com.matrix.core.rabbitmq.DeliverCallbackAdapter(hander,routingKey); + this.handerAdapter = new DeliverCallbackAdapter(hander,routingKey); } } @@ -48,7 +48,7 @@ this.queue = queue; this.routingKey = routingKey; if(hander!=null){ - this.handerAdapter = new com.matrix.core.rabbitmq.DeliverCallbackAdapter(hander,routingKey); + this.handerAdapter = new DeliverCallbackAdapter(hander,routingKey); } this.autoAck=autoAck; @@ -95,7 +95,7 @@ return handerAdapter; } - public void setHander(com.matrix.core.rabbitmq.DeliverCallbackAdapter hander) { + public void setHander(DeliverCallbackAdapter hander) { this.handerAdapter = hander; } } diff --git a/zq-erp/src/main/java/com/matrix/component/rabbitmq/RabiitMqTemplate.java b/zq-erp/src/main/java/com/matrix/component/rabbitmq/RabiitMqTemplate.java index 89fea6d..bf51909 100644 --- a/zq-erp/src/main/java/com/matrix/component/rabbitmq/RabiitMqTemplate.java +++ b/zq-erp/src/main/java/com/matrix/component/rabbitmq/RabiitMqTemplate.java @@ -84,6 +84,7 @@ if (task != null) { // 消息内容 if (StringUtils.isNotBlank(content)) { + LogUtil.info("本次发送消息task.getExchange()="+task.getExchange()+";routingKey="+routingKey+";content="+content); channel.basicPublish(task.getExchange(), routingKey, false, null, content.getBytes()); } else { LogUtil.info("本次发送空消息"); diff --git a/zq-erp/src/main/java/com/matrix/component/redis/RedisClient.java b/zq-erp/src/main/java/com/matrix/component/redis/RedisClient.java index 76ccafa..8304e44 100644 --- a/zq-erp/src/main/java/com/matrix/component/redis/RedisClient.java +++ b/zq-erp/src/main/java/com/matrix/component/redis/RedisClient.java @@ -9,7 +9,6 @@ import net.sf.json.JSONObject; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Component; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; @@ -26,7 +25,6 @@ * @date 2019年2月25日 */ -@Component public class RedisClient implements CommandLineRunner { /** diff --git a/zq-erp/src/main/java/com/matrix/component/redis/RedisUserLoginUtils.java b/zq-erp/src/main/java/com/matrix/component/redis/RedisUserLoginUtils.java index 9eb6eb0..9d904da 100644 --- a/zq-erp/src/main/java/com/matrix/component/redis/RedisUserLoginUtils.java +++ b/zq-erp/src/main/java/com/matrix/component/redis/RedisUserLoginUtils.java @@ -7,10 +7,8 @@ import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.UUIDUtil; import com.matrix.core.tools.WebUtil; -import com.matrix.system.hive.plugin.message.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; /** @@ -20,7 +18,6 @@ * @email 935090232@qq.com * @date 2018年1月19日 */ -@Component public class RedisUserLoginUtils { @Autowired @@ -120,10 +117,14 @@ * @date:2018年1月19日下午3:17:14 */ public void loginOut() { - String toke = getUserToken(); - redisClient.removeObject(toke); + String token = getUserToken(); + redisClient.removeObject(token); } - + public void updateUserInfo(Object obj) { + String token = getUserToken(); + redisClient.saveValue(token, obj); + LogUtil.debug("更新redis用户"); + } } diff --git a/zq-erp/src/main/java/com/matrix/component/tools/HttpClientUtil.java b/zq-erp/src/main/java/com/matrix/component/tools/HttpClientUtil.java new file mode 100644 index 0000000..cbc64d4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/component/tools/HttpClientUtil.java @@ -0,0 +1,55 @@ +package com.matrix.component.tools; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.LogUtil; +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.BasicResponseHandler; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; + +import java.io.IOException; + +/** + * POST 请求工具 + */ +public class HttpClientUtil { + + public static JSONObject sendPostWithJson(String url, String json) { + + CloseableHttpClient httpClient = HttpClients.createDefault(); + ResponseHandler<String> responseHandler = new BasicResponseHandler(); + try { + //第一步:创建HttpClient对象 + httpClient = HttpClients.createDefault(); + + //第二步:创建httpPost对象 + HttpPost httpPost = new HttpPost(url); + + //第三步:给httpPost设置JSON格式的参数 + StringEntity requestEntity = new StringEntity(json, "utf-8"); + requestEntity.setContentEncoding("UTF-8"); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setEntity(requestEntity); + //第四步:发送HttpPost请求,获取返回值 + String returnValue = httpClient.execute(httpPost, responseHandler); //调接口获取返回值时,必须用此方法 + return JSON.parseObject(returnValue); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + httpClient.close(); + } catch (IOException e) { + LogUtil.error("http请求发送失败", e); + throw new GlobleException(e.getMessage()); + } + } + //第五步:处理返回值 + return null; + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/component/tools/ImageUtil.java b/zq-erp/src/main/java/com/matrix/component/tools/ImageUtil.java index c7fdbdb..d6966a2 100644 --- a/zq-erp/src/main/java/com/matrix/component/tools/ImageUtil.java +++ b/zq-erp/src/main/java/com/matrix/component/tools/ImageUtil.java @@ -2,8 +2,10 @@ import java.awt.*; import java.awt.image.BufferedImage; -import java.io.FileNotFoundException; -import java.io.IOException; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -91,4 +93,44 @@ System.out.println("系统字体数:" + fontCount); } + + public static void downloadPicture(String imgUrl,String savePath) { + URL url = null; + int imageNumber = 0; + try { + + InputStream inputStream = null; + HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(imgUrl).openConnection(); + httpURLConnection.setRequestMethod("GET"); + httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"); + httpURLConnection.setRequestProperty("Accept-Encoding", "gzip"); + httpURLConnection.setRequestProperty("Referer","no-referrer"); + httpURLConnection.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); + httpURLConnection.setConnectTimeout(15000); + httpURLConnection.setReadTimeout(20000); + inputStream = httpURLConnection.getInputStream(); + + + + FileOutputStream fileOutputStream = new FileOutputStream(new File(savePath)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int length; + while ((length = inputStream.read(buffer)) > 0) { + output.write(buffer, 0, length); + } + byte[] context=output.toByteArray(); + fileOutputStream.write(output.toByteArray()); + inputStream.close(); + fileOutputStream.close(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + + } diff --git a/zq-erp/src/main/java/com/matrix/component/tools/WxTempLateMsgUtil.java b/zq-erp/src/main/java/com/matrix/component/tools/WxTempLateMsgUtil.java index 35f2685..160f8b4 100644 --- a/zq-erp/src/main/java/com/matrix/component/tools/WxTempLateMsgUtil.java +++ b/zq-erp/src/main/java/com/matrix/component/tools/WxTempLateMsgUtil.java @@ -1,15 +1,7 @@ package com.matrix.component.tools; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.StringUtils; -import com.matrix.system.shopXcx.api.WeChatApiTools; -import net.sf.json.JSONObject; - -import java.io.IOException; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * 小程序消息模板 @@ -141,87 +133,7 @@ public static int sendWxTemplateMsg(List<String> valueList, String openId, String page, String tempId, String formId) { - if (StringUtils.isBlank(openId)) { - return 0; - } - String access_token = ""; - try { - access_token = WeChatApiTools.getAccessToken(); - } catch (IOException e1) { - LogUtil.error("获取accesstoken失败", e1.getMessage()); - } - // 发送模板URL - String url = WxApiConstants.XCX_TEMPLATEMSG_SEN.replace("ACCESS_TOKEN", access_token); - WxTemplate temp = new WxTemplate(); - // 跳转地址 - if (StringUtils.isNotBlank(page)) { - temp.setPage(page); - } - temp.setTouser(openId); - // 消息模版ID - temp.setTemplateId(tempId); - - Map<String, Object> tempLateMsgMap = new HashMap<String, Object>(); - // 设置模板消息的值 - for (int i = 0; i < valueList.size(); i++) { - TemplateData keyword = new TemplateData(); - keyword.setValue(valueList.get(i)); - tempLateMsgMap.put(TEMP_KEYWORD + (i + 1), keyword); - } - temp.setData(tempLateMsgMap); - String jsonString = JSONObject.fromObject(temp).toString(); - - LogUtil.info("组装模板消息={}", jsonString); - HttpRequest reqObj = new HttpRequest(); - HttpResponse result = null; - try { - result = reqObj.sendHttpsPost(url, null, jsonString); - } catch (IOException e) { - LogUtil.error("发送模板通知出错了", e); - } - JSONObject json = JSONObject.fromObject(result.getDataString()); - LogUtil.info("发送模板消息结果={}", json); - int res = 0; - if (json == null) { - return res; - } else { - res = json.getInt(ERRCODE); - if (res == Integer.parseInt(SEND_ERROR_40001)) { - String new_access_token = ""; - try { - new_access_token = WeChatApiTools.getAccessToken(); - } catch (IOException e1) { - LogUtil.error("获取new_access_token失败", e1.getMessage()); - } - url = WxApiConstants.XCX_TEMPLATEMSG_SEN.replace("ACCESS_TOKEN", new_access_token); - try { - result = reqObj.sendHttpsPost(url, null, jsonString); - } catch (IOException e) { - LogUtil.error("发送new_access_token模板通知出错了", e); - } - json = JSONObject.fromObject(result.getDataString()); - if (json == null) { - return res; - } else { - res = json.getInt(ERRCODE); - if (res != 0) { - // 添加发送失败 信息 - LogUtil.info("发送new_access_token模板消息错误错误 errcode:{} errmsg:{}" + "," + json.getInt("errcode") - + "," + json.getString("errmsg")); - } else { - return 1; - } - } - } else if (res != 0) { - // 添加发送失败 信息 - LogUtil.info("发送模板消息错误错误 errcode:{} errmsg:{}" + "," + json.getInt("errcode") + "," - + json.getString("errmsg")); - } else { - return 1; - } - } - LogUtil.info("模板消息发送结果:" + res); return 0; } @@ -231,25 +143,7 @@ * @param temp {temp} */ public static void sendSubscribeMsg(WxSubscribeDto temp) { - String access_token = ""; - try { - access_token = WeChatApiTools.getAccessToken(); - } catch (IOException e1) { - LogUtil.error("获取accesstoken失败", e1.getMessage()); - } - // 发送模板URL - String url = WxApiConstants.XCX_TEMPLATEMSG_SEN.replace("ACCESS_TOKEN", access_token); - String jsonString = JSONObject.fromObject(temp).toString(); - LogUtil.info("组装模板消息={}", jsonString); - HttpRequest reqObj = new HttpRequest(); - HttpResponse result = null; - try { - result = reqObj.sendHttpsPost(url, null, jsonString); - } catch (IOException e) { - LogUtil.error("发送模板通知出错了", e); - } - JSONObject json = JSONObject.fromObject(result.getDataString()); - LogUtil.info("发送模板消息结果={}", json); + } diff --git a/zq-erp/src/main/java/com/matrix/component/tools/WxacodeUtil.java b/zq-erp/src/main/java/com/matrix/component/tools/WxacodeUtil.java index 7b0c2a4..1bd3bc1 100644 --- a/zq-erp/src/main/java/com/matrix/component/tools/WxacodeUtil.java +++ b/zq-erp/src/main/java/com/matrix/component/tools/WxacodeUtil.java @@ -19,14 +19,9 @@ import java.util.Map; public class WxacodeUtil { - /** - * 小程序秘钥 - */ - private static final String XCX_SECRET = "xcx_secret"; - /** - * 小程序appid - */ - private static final String XCX_APPID = "xcx_appid"; + + + /** * token获取地址 */ @@ -37,11 +32,9 @@ */ private static final String GET_WXACODE ="https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="; - public static String getWxacode(String scene,String page,String fileName) throws Exception { + public static String getWxacode(String scene,String page,String fileName,String appid,String secret) throws Exception { LogUtil.debug("scene={},page={},fileName={}",scene,page,fileName); //获取token - String appid = PropertiesUtil.getString(XCX_APPID); - String secret = PropertiesUtil.getString(XCX_SECRET); String result1 = get(TOKEN_URL.replace("APPID", appid).replace("SECRET", secret)); String access_token = JSONObject.parseObject(result1).getString("access_token"); if(StringUtils.isNotBlank(access_token)) { @@ -61,12 +54,6 @@ HttpResponse response; response = httpClient.execute(httpPost); InputStream inputStream = response.getEntity().getContent(); - /*Object inputObj= response.getEntity().getContent(); - if(inputObj instanceof InputStream){ - String strError = streamToString(inputStream,"GBK"); - LogUtil.info("-------------二维码生成------"+strError); - return "error:" + strError; - }*/ // 图片保存目录路径 String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); @@ -74,11 +61,6 @@ if(!targetFile.exists()){ targetFile.mkdirs(); } - - /*String inputstreamtofile = inputstreamtofile(inputStream, targetFile); - if(null != inputstreamtofile){ - return inputstreamtofile; - }*/ // 创建图片文件夹 baseSavePath += "wxacode" + File.separatorChar; @@ -89,23 +71,15 @@ String qrcodePath = baseSavePath + fileName + ".png"; FileOutputStream out = new FileOutputStream(qrcodePath); LogUtil.debug("qrcodePath:{}",qrcodePath); - //本地调试创建(不用删) - /*String filePath = "e:/test.png"; - File file = new File(filePath); - if (!file.exists()) { - file.mkdir(); - } - FileOutputStream outs = new FileOutputStream(file);*/ + byte[] buffer = new byte[1024]; int bytesRead = 0; while((bytesRead = inputStream.read(buffer, 0, 1024)) != -1) { out.write(buffer, 0, bytesRead); - //outs.write(buffer, 0, bytesRead); + } out.flush(); out.close(); - //outs.flush(); - //outs.close(); return qrcodePath; } else { diff --git a/zq-erp/src/main/java/com/matrix/component/websoket/ScanQrCodeLoginDto.java b/zq-erp/src/main/java/com/matrix/component/websoket/ScanQrCodeLoginDto.java new file mode 100644 index 0000000..2eb5086 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/component/websoket/ScanQrCodeLoginDto.java @@ -0,0 +1,57 @@ +package com.matrix.component.websoket; + +import lombok.Data; + +/** + * 扫码登录接收参数 + */ +@Data +public class ScanQrCodeLoginDto { + + /** + * 登录操作 1.登录 + */ + public static final Integer LOGIN_OPERATION_LOGIN=1; + + /** + * 登录操作 2取消登录 + */ + public static final Integer LOGIN_OPERATION_CANCEL=2; + /** + * 指令类型 1,已扫码 + */ + public static final Integer MSG_TYPE_SCAN=1; + /** + * 指令类型 2登录确认 + */ + public static final Integer MSG_TYPE_LOGIN=2; + + + + /** + * 网页客户端id,浏览器生成 + */ + String webClientId; + + /** + * 二维码登录key + */ + String loginQrCodeKey; + + /** + * app登录用户ID + */ + Long appUserId; + + /** + * 登录操作 1.登录,2取消登录 + */ + Integer loginOperation; + + /** + * 指令类型 1,已扫码,2登录确认, + */ + Integer msgType; + + +} diff --git a/zq-erp/src/main/java/com/matrix/component/websoket/WebSocketPushHandler.java b/zq-erp/src/main/java/com/matrix/component/websoket/WebSocketPushHandler.java index aa53291..5344831 100644 --- a/zq-erp/src/main/java/com/matrix/component/websoket/WebSocketPushHandler.java +++ b/zq-erp/src/main/java/com/matrix/component/websoket/WebSocketPushHandler.java @@ -27,10 +27,12 @@ private static final List<WebSoketMessageObserver> observerList=new ArrayList<>(); + public WebSocketPushHandler(){ LogUtil.info("WebSocketPushHandler初始化"); //注册观察者 - addObserver(new WebSoketMessageRabbitObserver()); + //addObserver(new WebSoketMessageRabbitObserver()); + addObserver(new WebSoketScanQrCodeLoginObserver()); } /** * 用户进入系统监听 diff --git a/zq-erp/src/main/java/com/matrix/component/websoket/WebSoketScanQrCodeLoginObserver.java b/zq-erp/src/main/java/com/matrix/component/websoket/WebSoketScanQrCodeLoginObserver.java new file mode 100644 index 0000000..634493a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/component/websoket/WebSoketScanQrCodeLoginObserver.java @@ -0,0 +1,66 @@ +package com.matrix.component.websoket; + +import cn.hutool.crypto.SecureUtil; +import net.sf.json.JSONObject; +import org.springframework.web.socket.CloseStatus; +import org.springframework.web.socket.TextMessage; +import org.springframework.web.socket.WebSocketSession; + +import java.util.HashMap; +import java.util.Map; + +/** + * 扫码登录soket处理类 + * @author jyy + */ +public class WebSoketScanQrCodeLoginObserver implements WebSoketMessageObserver { + + + private static Map<String,Long> scanCash=new HashMap<>(); + + + @Override + public void userConnection(WebSocketSession session) { + + } + + @Override + public void handleTextMessage(WebSocketSession session, TextMessage message) { + + + ScanQrCodeLoginDto commonMessage = (ScanQrCodeLoginDto) JSONObject.toBean(JSONObject.fromObject(message.getPayload()), ScanQrCodeLoginDto.class); + + if(ScanQrCodeLoginDto.MSG_TYPE_LOGIN.equals(commonMessage.getMsgType())){ + //todo 添加安全校验代码 + scanCash.put(SecureUtil.md5(commonMessage.getLoginQrCodeKey()),commonMessage.getAppUserId()); + JSONObject jsonObject=new JSONObject(); + jsonObject.put("loginOperation",commonMessage.getLoginOperation()); + jsonObject.put("msgType",commonMessage.getMsgType()); + WebSocketPushHandler.sendMessageToUser(commonMessage.getWebClientId(), new TextMessage(jsonObject.toString())); + }else if(ScanQrCodeLoginDto.MSG_TYPE_SCAN.equals(commonMessage.getMsgType())){ + JSONObject jsonObject=new JSONObject(); + jsonObject.put("msgType",commonMessage.getMsgType()); + WebSocketPushHandler.sendMessageToUser(commonMessage.getWebClientId(), new TextMessage(jsonObject.toString())); + } + + + } + + @Override + public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { + + } + + /** + * 获取扫码的用户id + * @param webClientId + * @return + */ + public static Long getScanCashValue(String webClientId){ + return scanCash.remove(SecureUtil.md5(webClientId)); + } + +} + + + diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/business/JsApiPayBusiness.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/business/JsApiPayBusiness.java index 9eab399..37b94c2 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/business/JsApiPayBusiness.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/business/JsApiPayBusiness.java @@ -14,6 +14,7 @@ import com.matrix.component.wechat.externalInterface.service.RefundService; import com.matrix.component.wechat.externalInterface.service.ScanPayQueryService; import org.apache.log4j.Logger; +import org.springframework.beans.BeanUtils; /** * User: rizenguo Date: 2014/12/1 Time: 17:05 @@ -55,9 +56,10 @@ log.info("------------------request createPrapareOrder taking :" + totalTimeCost + "ms"+"--response="+payServiceResponseString); // 将从API返回的XML数据映射到Java对象 - JsApiPayResData jsApiPayResData = (JsApiPayResData) Util.getObjectFromXML(payServiceResponseString, + Object data = Util.getObjectFromXML(payServiceResponseString, JsApiPayResData.class); - + JsApiPayResData jsApiPayResData=new JsApiPayResData(); + BeanUtils.copyProperties(data,jsApiPayResData); return jsApiPayResData; } diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java index 12856ec..6e4594f 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java @@ -1,5 +1,9 @@ package com.matrix.component.wechat.externalInterface.common; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; import com.thoughtworks.xstream.io.xml.XmlFriendlyNameCoder; @@ -41,7 +45,7 @@ } Logger log=Logger.getLogger(HttpRequest.class); - + //表示请求器是否已经做了初始化工作 private boolean hasInit = false; @@ -56,17 +60,21 @@ //HTTP请求器 private CloseableHttpClient httpClient; + //证书地址 + private String certLocalPath; + //商户号 + private String mchId; public HttpsRequest2() throws UnrecoverableKeyException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, IOException { - init(); + } private void init() throws IOException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyManagementException { - KeyStore keyStore = KeyStore.getInstance("PKCS12"); - FileInputStream instream = new FileInputStream(new File(WechatConfigure.certLocalPath));//加载本地的证书进行https加密传输 + KeyStore keyStore = KeyStore.getInstance("PKCS12"); + FileInputStream instream = new FileInputStream(new File(certLocalPath));//加载本地的证书进行https加密传输 try { - keyStore.load(instream,WechatConfigure.certPassword.toCharArray());//设置证书密码 + keyStore.load(instream, mchId.toCharArray());//设置证书密码 } catch (CertificateException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { @@ -76,7 +84,7 @@ } // Trust own CA and all self-signed certs SSLContext sslcontext = SSLContexts.custom() - .loadKeyMaterial(keyStore, WechatConfigure.certPassword.toCharArray()) + .loadKeyMaterial(keyStore, mchId.toCharArray()) .build(); // Allow TLSv1 protocol only SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory( @@ -85,11 +93,11 @@ null, SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); - - httpClient = HttpClients.custom() + + httpClient = HttpClients.custom() .setSSLSocketFactory(sslsf) .build(); - // httpClient = HttpClients.custom().build(); + // httpClient = HttpClients.custom().build(); //根据默认超时限制初始化requestConfig requestConfig = RequestConfig.custom().setSocketTimeout(socketTimeout).setConnectTimeout(connectTimeout).build(); hasInit = true; @@ -135,17 +143,17 @@ httpPost.setConfig(requestConfig); log.info("executing request" + httpPost.getRequestLine()); - + try { HttpResponse response = httpClient.execute(httpPost); HttpEntity entity = response.getEntity(); result = EntityUtils.toString(entity, "UTF-8"); - + log.info("POST back date:" + httpPost.getRequestLine()); - - + + } catch (ConnectionPoolTimeoutException e) { // log.e("http get throw ConnectionPoolTimeoutException(wait time out)"); @@ -157,7 +165,7 @@ // log.e("http get throw SocketTimeoutException"); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(); // log.e("http get throw Exception"); } finally { @@ -173,7 +181,7 @@ * @param socketTimeout 连接时长,默认10秒 */ public void setSocketTimeout(int socketTimeout) { - this.socketTimeout = socketTimeout; + this.socketTimeout = socketTimeout; resetRequestConfig(); } @@ -183,7 +191,7 @@ * @param connectTimeout 传输时长,默认30秒 */ public void setConnectTimeout(int connectTimeout) { - this.connectTimeout = connectTimeout; + this.connectTimeout = connectTimeout; resetRequestConfig(); } @@ -197,6 +205,23 @@ * @param requestConfig 设置HttpsRequest的请求器配置 */ public void setRequestConfig(RequestConfig requestConfig) { - this.requestConfig = requestConfig; + this.requestConfig = requestConfig; + } + + + public String getMchId() { + return mchId; + } + + public void setMchId(String mchId) { + this.mchId = mchId; + } + + public String getCertLocalPath() { + return certLocalPath; + } + + public void setCertLocalPath(String certLocalPath) { + this.certLocalPath = certLocalPath; } } diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Signature.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Signature.java index 40300d5..c764cff 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Signature.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Signature.java @@ -22,7 +22,7 @@ * @return 签名 * @throws IllegalAccessException */ - public static String getSign(Object o) throws IllegalAccessException { + public static String getSign(Object o,String paySecret) throws IllegalAccessException { ArrayList<String> list = new ArrayList<String>(); Class<? extends Object> cls = o.getClass(); Field[] fields = cls.getDeclaredFields(); @@ -40,14 +40,14 @@ sb.append(arrayToSort[i]); } String result = sb.toString(); - result += "key=" + WechatConfigure.key; + result += "key=" +paySecret; Util.log("Sign Before MD5:" + result); result = MD5.MD5Encode(result).toUpperCase(); Util.log("Sign Result:" + result); return result; } - public static String getSign(Map<String, Object> map) { + public static String getSign(Map<String, Object> map,String paySecret) { ArrayList<String> list = new ArrayList<String>(); for (Map.Entry<String, Object> entry : map.entrySet()) { if (entry.getValue() != "") { @@ -62,7 +62,7 @@ sb.append(arrayToSort[i]); } String result = sb.toString(); - result += "key=" + WechatConfigure.key; + result += "key=" + paySecret; Util.log("Sign Before MD5:" + result); result = MD5.MD5Encode(result).toUpperCase(); Util.log("Sign Result:" + result); @@ -79,13 +79,13 @@ * @throws IOException * @throws SAXException */ - public static String getSignFromResponseString(String responseString) + public static String getSignFromResponseString(String responseString,String paySecret) throws IOException, SAXException, ParserConfigurationException { Map<String, Object> map = XMLParser.getMapFromXML(responseString); // 清掉返回数据对象里面的Sign数据(不能把这个数据也加进去进行签名),然后用签名算法进行签名 map.put("sign", ""); // 将API返回的数据根据用签名算法进行计算新的签名,用来跟API返回的签名进行比较 - return Signature.getSign(map); + return Signature.getSign(map,paySecret); } /** @@ -98,7 +98,7 @@ * @throws IOException * @throws SAXException */ - public static boolean checkIsSignValidFromResponseString(String responseString) + public static boolean checkIsSignValidFromResponseString(String responseString,String paySecret) throws ParserConfigurationException, IOException, SAXException { Map<String, Object> map = XMLParser.getMapFromXML(responseString); @@ -113,7 +113,7 @@ // 清掉返回数据对象里面的Sign数据(不能把这个数据也加进去进行签名),然后用签名算法进行签名 map.put("sign", ""); // 将API返回的数据根据用签名算法进行计算新的签名,用来跟API返回的签名进行比较 - String signForAPIResponse = Signature.getSign(map); + String signForAPIResponse = Signature.getSign(map,paySecret); if (!signForAPIResponse.equals(signFromAPIResponse)) { // 签名验不过,表示这个API返回的数据有可能已经被篡改了 @@ -124,9 +124,7 @@ return true; } - public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException { - System.out.println(checkIsSignValidFromResponseString("<xml><appid><![CDATA[wx13515a9204ea669d]]></appid><attach><![CDATA[35f7170585ad4f09b5109cc985b1eec0]]></attach><bank_type><![CDATA[CFT]]></bank_type><cash_fee><![CDATA[1]]></cash_fee><fee_type><![CDATA[CNY]]></fee_type><is_subscribe><![CDATA[N]]></is_subscribe><mch_id><![CDATA[1486409192]]></mch_id><nonce_str><![CDATA[elqhnr10vzaq0wgalf9njjyqwyd7gyr7]]></nonce_str><openid><![CDATA[o8x8E5lqmD9c5rdsjTQ9KWN4-H40]]></openid><out_trade_no><![CDATA[2018090610284198419]]></out_trade_no><result_code><![CDATA[SUCCESS]]></result_code><return_code><![CDATA[SUCCESS]]></return_code><sign><![CDATA[DD04172CDAA60F834163AF3F5B63BE3F]]></sign><time_end><![CDATA[20180906102853]]></time_end><total_fee>1</total_fee><trade_type><![CDATA[JSAPI]]></trade_type><transaction_id><![CDATA[4200000169201809067369627940]]></transaction_id></xml>")); - } + /** * diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Util.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Util.java index 4c0692a..393f57b 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Util.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/Util.java @@ -67,6 +67,8 @@ public static Object getObjectFromXML(String xml, Class<?> tClass) { //将从API返回的XML数据映射到Java对象 XStream xStreamForResponseData = new XStream(); + XStream.setupDefaultSecurity(xStreamForResponseData); + xStreamForResponseData.allowTypes(new Class[]{tClass}); xStreamForResponseData.alias("xml", tClass); xStreamForResponseData.ignoreUnknownElements();//暂时忽略掉一些新增的字段 return xStreamForResponseData.fromXML(xml); diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/WechatConfigure.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/WechatConfigure.java index 30d2a22..0a37ebc 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/WechatConfigure.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/WechatConfigure.java @@ -9,7 +9,7 @@ // 这个就是自己要保管好的私有Key了(切记只能放在自己的后台代码里,不能放在任何可能被看到源代码的客户端程序中) // 每次自己Post数据给API的时候都要用这个key来对所有字段进行签名,生成的签名会放在Sign这个字段,API收到Post数据的时候也会用同样的签名算法对Post过来的数据进行签名和验证 // 收到API的返回的时候也要用这个key来对返回的数据算下签名,跟API的Sign数据进行比较,如果值不一致,有可能数据被第三方给篡改 - public static final String PAY_NOTIFY_URL="https://xcxhive2.jyymatrix.cc/wxCommon/wxpayCallback"; + // 交易类型 public static final String TRADE_TYPE_JSAPI = "JSAPI"; public static final String TRADE_TYPE_NATIVE = "NATIVE"; @@ -17,28 +17,15 @@ public static final String SIGN_MD5 = "MD5"; //域名 - - // 微信支付秘钥 - public static String key = "3hbNHPOSXx85rC0QEqvGgIHu1wduT4Qc"; - - // 微信分配的公众号ID(开通公众号之后可以获取到) - public static String appID = "wx3836ab3c1490ff29"; - - - // 微信支付分配的商户号ID(开通公众号的微信支付功能之后可以获取到) - public static String mchID = "1573208361"; - - - public static String web_appID = "1486409192"; + // 受理模式下给子商户分配的子商户号 public static String subMchID = ""; // HTTPS证书的本地路径 public static String certLocalPath = "/home/cert/apiclient_cert.p12"; - // HTTPS证书密码,默认密码等于商户号MCHID - public static String certPassword = "1573208361"; + // 是否使用异步线程的方式来上报API测速,默认为异步模式 public static boolean useThreadToDoReport = true; diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/paramProtocol/BrandWCPayRequestData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/paramProtocol/BrandWCPayRequestData.java index c367bf3..c5961d9 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/paramProtocol/BrandWCPayRequestData.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/paramProtocol/BrandWCPayRequestData.java @@ -25,16 +25,16 @@ private String signType = ""; private String paySign = ""; - public BrandWCPayRequestData(String prepay_id){ + public BrandWCPayRequestData(String prepay_id, String appID, String paySecret){ //默认必须设置 - setAppId(WechatConfigure.appID); + setAppId(appID); //随机字符串,不长于32 位 setNonceStr(RandomStringGenerator.getRandomStringByLength(32)); setTimeStamp(Long.toString(System.currentTimeMillis() / 1000L)); setPrepay_id("prepay_id="+prepay_id); //根据API给的签名规则进行签名 【 必须要放在本方法的最后】 setSignType(WechatConfigure.SIGN_MD5); - String sign = Signature.getSign(toMap()); + String sign = Signature.getSign(toMap(),paySecret); setPaySign(sign);//把签名数据设置到Sign这个属性中 } diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java index 7313595..45b726d 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java @@ -3,7 +3,6 @@ import com.matrix.component.wechat.externalInterface.common.RandomStringGenerator; import com.matrix.component.wechat.externalInterface.common.Signature; -import com.matrix.component.wechat.externalInterface.common.WechatConfigure; import java.lang.reflect.Field; import java.util.HashMap; @@ -21,31 +20,29 @@ /** * 商户号 */ - private String mch_id = ""; + private String mchid = ""; + + private String mch_appid = ""; + /** * 商户企业付款单号 */ private String partner_trade_no = ""; + /** * 随机字符串 */ private String nonce_str = ""; + + + private String check_name = ""; + + /** * 签名 */ private String sign = ""; - /** - * 收款方银行卡号 - */ - private String enc_bank_no = ""; - /** - * 收款方用户名 - */ - private String enc_true_name = ""; - /** - * 收款方开户行 - */ - private String bank_code = ""; + /** * 付款金额 RMB(分) */ @@ -54,6 +51,8 @@ * 备注 */ private String desc = ""; + + private String openid = ""; public JsApiPayComReqData() { @@ -66,58 +65,49 @@ * @param desc 描述 * @param outTradeNo 商户企业付款单号 * @param totalFee 付款金额 - * @param bankNo 银行卡号 - * @param bankTrueName 收款号姓名 * @param bankCode 收款号开户行 */ - public JsApiPayComReqData(String desc, String outTradeNo, int totalFee, String bankNo, String bankTrueName, String bankCode) { + public JsApiPayComReqData(String mchID,String mch_appid,String paySecret ,String desc, String outTradeNo, int totalFee, + String openid, String check_name, String bankCode) { + setMch_appid(mch_appid); //默认必须设置 - setMch_id(WechatConfigure.mchID); + setMchid(mchID); setDesc(desc); setPartner_trade_no(outTradeNo); setAmount(totalFee); + setOpenid(openid); + setCheck_name(check_name); //随机字符串,不长于32 位 setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); //根据API给的签名规则进行签名 【 必须要放在本方法的最后】 - String sign = Signature.getSign(toMap()); + String sign = Signature.getSign(toMap(),paySecret); setSign(sign);//把签名数据设置到Sign这个属性中 -// setEnc_bank_no(); -// setEnc_true_name(); -// setBank_code(); + } - - public String getMch_id() { - return mch_id; + public String getMch_appid() { + return mch_appid; } - public void setMch_id(String mch_id) { - this.mch_id = mch_id; + public void setMch_appid(String mch_appid) { + this.mch_appid = mch_appid; } - public String getEnc_bank_no() { - return enc_bank_no; + public String getCheck_name() { + return check_name; } - public void setEnc_bank_no(String enc_bank_no) { - this.enc_bank_no = enc_bank_no; + public void setCheck_name(String check_name) { + this.check_name = check_name; } - public String getEnc_true_name() { - return enc_true_name; + public String getMchid() { + return mchid; } - public void setEnc_true_name(String enc_true_name) { - this.enc_true_name = enc_true_name; - } - - public String getBank_code() { - return bank_code; - } - - public void setBank_code(String bank_code) { - this.bank_code = bank_code; + public void setMchid(String mchid) { + this.mchid = mchid; } public String getNonce_str() { @@ -144,6 +134,14 @@ this.partner_trade_no = partner_trade_no; } + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + public int getAmount() { return amount; } diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payProtocol/JsApiPayReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payProtocol/JsApiPayReqData.java index 2dc5f1e..819f58a 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payProtocol/JsApiPayReqData.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payProtocol/JsApiPayReqData.java @@ -32,8 +32,8 @@ /** * 接收微信支付异步通知回调地址 */ - private String notify_url = WechatConfigure.PAY_NOTIFY_URL; private String trade_type = WechatConfigure.TRADE_TYPE_JSAPI; + private String notify_url ; private String openid = ""; private String limit_pay = ""; private String spbill_create_ip = ""; @@ -47,7 +47,8 @@ public JsApiPayReqData() { } - /** + /**appID 收款应用id + * mchID 商户号 * @param authCode 这个是扫码终端设备从用户手机上扫取到的支付授权号,这个号是跟用户用来支付的银行卡绑定的,有效期是1分钟 * @param body 要支付的商品的描述信息,用户会在支付成功页面里看到这个信息 * @param attach 支付订单里面可以填的附加数据,API会将提交的这个附加数据原样返回 @@ -59,10 +60,11 @@ * @param timeExpire 订单失效时间,格式同上 * @param goodsTag 商品标记,微信平台配置的商品标记,用于优惠券或者满减使用 */ - public JsApiPayReqData(String body,String outTradeNo,int totalFee,String spBillCreateIP,String openid,String attach){ + public JsApiPayReqData(String appID, String mchID,String paySecret,String notify_url, String body,String outTradeNo,int totalFee,String spBillCreateIP,String openid,String attach){ //默认必须设置 - setAppid(WechatConfigure.appID); - setMch_id(WechatConfigure.mchID); + setAppid(appID); + setMch_id(mchID); + setNotify_url(notify_url); setBody(body); setOut_trade_no(outTradeNo); setTotal_fee(totalFee); @@ -72,16 +74,17 @@ setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); setOpenid(openid); //根据API给的签名规则进行签名 【 必须要放在本方法的最后】 - String sign = Signature.getSign(toMap()); + String sign = Signature.getSign(toMap(),paySecret); setSign(sign);//把签名数据设置到Sign这个属性中 } - public JsApiPayReqData(String body,String outTradeNo,int totalFee,String spBillCreateIP,String attach){ + public JsApiPayReqData(String appID, String mchID,String paySecret,String notify_url,String body,String outTradeNo,int totalFee,String spBillCreateIP,String attach){ //默认必须设置 - setAppid(WechatConfigure.web_appID); - setMch_id(WechatConfigure.mchID); + setAppid(appID); + setMch_id(mchID); setBody(body); + setNotify_url(notify_url); setOut_trade_no(outTradeNo); setTotal_fee(totalFee); setSpbill_create_ip(spBillCreateIP); @@ -89,7 +92,7 @@ //随机字符串,不长于32 位 setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); //根据API给的签名规则进行签名 【 必须要放在本方法的最后】 - String sign = Signature.getSign(toMap()); + String sign = Signature.getSign(toMap(),paySecret); setSign(sign);//把签名数据设置到Sign这个属性中 } diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/JsApiPayReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/JsApiPayReqData.java deleted file mode 100644 index 8784f20..0000000 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/JsApiPayReqData.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.matrix.component.wechat.externalInterface.protocol.queryProtocol; - - -import com.matrix.component.wechat.externalInterface.common.RandomStringGenerator; -import com.matrix.component.wechat.externalInterface.common.Signature; -import com.matrix.component.wechat.externalInterface.common.WechatConfigure; - -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; - -/** - * -* 预付订单请求参数 -* @author:姜友瑶 -* @date 2016年10月14日 - */ -public class JsApiPayReqData { - - //每个字段具体的意思请查看API文档 - private String appid = ""; - private String mch_id = ""; - private String device_info = ""; - private String nonce_str = ""; - private String sign = ""; - private String body = ""; - private String detail = ""; - private String attach = ""; - private String out_trade_no = ""; - private String fee_type = ""; - private int total_fee = 0; - /** - * 接收微信支付异步通知回调地址 - */ - private String notify_url = WechatConfigure.PAY_NOTIFY_URL; - private String trade_type = WechatConfigure.TRADE_TYPE_JSAPI; - private String openid = ""; - private String limit_pay = ""; - private String spbill_create_ip = ""; - private String product_id = ""; - private String time_start = ""; - private String time_expire = ""; - private String goods_tag = ""; - private String auth_code = ""; - - - public JsApiPayReqData() { - } - - /** - * @param authCode 这个是扫码终端设备从用户手机上扫取到的支付授权号,这个号是跟用户用来支付的银行卡绑定的,有效期是1分钟 - * @param body 要支付的商品的描述信息,用户会在支付成功页面里看到这个信息 - * @param attach 支付订单里面可以填的附加数据,API会将提交的这个附加数据原样返回 - * @param outTradeNo 商户系统内部的订单号,32个字符内可包含字母, 确保在商户系统唯一 - * @param totalFee 订单总金额,单位为“分”,只能整数 - * @param deviceInfo 商户自己定义的扫码支付终端设备号,方便追溯这笔交易发生在哪台终端设备上 - * @param spBillCreateIP 订单生成的机器IP - * @param timeStart 订单生成时间, 格式为yyyyMMddHHmmss,如2009年12 月25 日9 点10 分10 秒表示为20091225091010。时区为GMT+8 beijing。该时间取自商户服务器 - * @param timeExpire 订单失效时间,格式同上 - * @param goodsTag 商品标记,微信平台配置的商品标记,用于优惠券或者满减使用 - */ - public JsApiPayReqData(String body,String outTradeNo,int totalFee,String spBillCreateIP,String openid,String attach){ - //默认必须设置 - setAppid(WechatConfigure.appID); - setMch_id(WechatConfigure.mchID); - setBody(body); - setOut_trade_no(outTradeNo); - setTotal_fee(totalFee); - setSpbill_create_ip(spBillCreateIP); - setAttach(attach); - //随机字符串,不长于32 位 - setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); - setOpenid(openid); - //根据API给的签名规则进行签名 【 必须要放在本方法的最后】 - String sign = Signature.getSign(toMap()); - setSign(sign);//把签名数据设置到Sign这个属性中 - - } - - public JsApiPayReqData(String body,String outTradeNo,int totalFee,String spBillCreateIP,String attach){ - //默认必须设置 - setAppid(WechatConfigure.web_appID); - setMch_id(WechatConfigure.mchID); - setBody(body); - setOut_trade_no(outTradeNo); - setTotal_fee(totalFee); - setSpbill_create_ip(spBillCreateIP); - setAttach(attach); - //随机字符串,不长于32 位 - setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); - //根据API给的签名规则进行签名 【 必须要放在本方法的最后】 - String sign = Signature.getSign(toMap()); - setSign(sign);//把签名数据设置到Sign这个属性中 - } - - public String getDetail() { - return detail; - } - - public void setDetail(String detail) { - this.detail = detail; - } - - public String getFee_type() { - return fee_type; - } - - public void setFee_type(String fee_type) { - this.fee_type = fee_type; - } - - public String getNotify_url() { - return notify_url; - } - - public void setNotify_url(String notify_url) { - this.notify_url = notify_url; - } - - public String getTrade_type() { - return trade_type; - } - - public void setTrade_type(String trade_type) { - this.trade_type = trade_type; - } - - public String getOpenid() { - return openid; - } - - public void setOpenid(String openid) { - this.openid = openid; - } - - public String getLimit_pay() { - return limit_pay; - } - - public void setLimit_pay(String limit_pay) { - this.limit_pay = limit_pay; - } - - public String getProduct_id() { - return product_id; - } - - public void setProduct_id(String product_id) { - this.product_id = product_id; - } - - public String getAppid() { - return appid; - } - - public void setAppid(String appid) { - this.appid = appid; - } - - public String getMch_id() { - return mch_id; - } - - public void setMch_id(String mch_id) { - this.mch_id = mch_id; - } - - public String getDevice_info() { - return device_info; - } - - public void setDevice_info(String device_info) { - this.device_info = device_info; - } - - public String getNonce_str() { - return nonce_str; - } - - public void setNonce_str(String nonce_str) { - this.nonce_str = nonce_str; - } - - public String getSign() { - return sign; - } - - public void setSign(String sign) { - this.sign = sign; - } - - public String getBody() { - return body; - } - - /** - * - * body最大长度128 - * @author:姜友瑶 - * @param body - * 返回类型 void - * @date 2016年10月13日 - */ - public void setBody(String body) { - - if(body.length()>128){ - body=body.substring(0, 128); - } - this.body = body; - } - - public String getAttach() { - return attach; - } - - public void setAttach(String attach) { - this.attach = attach; - } - - public String getOut_trade_no() { - return out_trade_no; - } - - public void setOut_trade_no(String out_trade_no) { - this.out_trade_no = out_trade_no; - } - - public int getTotal_fee() { - return total_fee; - } - - public void setTotal_fee(int total_fee) { - this.total_fee = total_fee; - } - - public String getSpbill_create_ip() { - return spbill_create_ip; - } - - public void setSpbill_create_ip(String spbill_create_ip) { - this.spbill_create_ip = spbill_create_ip; - } - - public String getTime_start() { - return time_start; - } - - public void setTime_start(String time_start) { - this.time_start = time_start; - } - - public String getTime_expire() { - return time_expire; - } - - public void setTime_expire(String time_expire) { - this.time_expire = time_expire; - } - - public String getGoods_tag() { - return goods_tag; - } - - public void setGoods_tag(String goods_tag) { - this.goods_tag = goods_tag; - } - - public String getAuth_code() { - return auth_code; - } - - public void setAuth_code(String auth_code) { - this.auth_code = auth_code; - } - - public Map<String,Object> toMap(){ - Map<String,Object> map = new HashMap<String, Object>(); - Field[] fields = this.getClass().getDeclaredFields(); - for (Field field : fields) { - Object obj; - try { - obj = field.get(this); - if(obj!=null){ - map.put(field.getName(), obj); - } - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - return map; - } - -} diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/ScanPayQueryReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/ScanPayQueryReqData.java index 42cc0c9..37855ba 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/ScanPayQueryReqData.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/ScanPayQueryReqData.java @@ -37,10 +37,10 @@ //-------------------------------------------------------------------- //微信分配的公众号ID(开通公众号之后可以获取到) - setAppid(WechatConfigure.appID); + //setAppid(WechatConfigure.appID); //微信支付分配的商户号ID(开通公众号的微信支付功能之后可以获取到) - setMch_id(WechatConfigure.mchID); + // setMch_id(WechatConfigure.mchID); //transaction_id是微信系统为每一笔支付交易分配的订单号,通过这个订单号可以标识这笔交易,它由支付订单API支付成功时返回的数据里面获取到。 setTransaction_id(transactionID); @@ -52,7 +52,7 @@ setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); //根据API给的签名规则进行签名 - String sign = Signature.getSign(toMap()); + //String sign = Signature.getSign(toMap()); setSign(sign);//把签名数据设置到Sign这个属性中 diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java index 6aa739c..9cac6cf 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java @@ -40,13 +40,13 @@ * @param opUserID 操作员帐号, 默认为商户号 * @param refundFeeType 货币类型,符合ISO 4217标准的三位字母代码,默认为CNY(人民币) */ - public RefundReqData(String outTradeNo,String outRefundNo,int totalFee,int refundFee,String opUserID){ + public RefundReqData(String mchID,String appID,String paySecret ,String outTradeNo,String outRefundNo,int totalFee,int refundFee,String opUserID){ //微信分配的公众号ID(开通公众号之后可以获取到) - setAppid(WechatConfigure.appID); + setAppid(appID); //微信支付分配的商户号ID(开通公众号的微信支付功能之后可以获取到) - setMch_id(WechatConfigure.mchID); + setMch_id(mchID); //transaction_id是微信系统为每一笔支付交易分配的订单号,通过这个订单号可以标识这笔交易,它由支付订单API支付成功时返回的数据里面获取到。 //setTransaction_id(transactionID); @@ -69,7 +69,7 @@ setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); //根据API给的签名规则进行签名 - String sign = Signature.getSign(toMap()); + String sign = Signature.getSign(toMap(),paySecret); setSign(sign);//把签名数据设置到Sign这个属性中 } diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/rsaProtocal/JsApiRSAReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/rsaProtocal/JsApiRSAReqData.java deleted file mode 100644 index e694b90..0000000 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/rsaProtocal/JsApiRSAReqData.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.matrix.component.wechat.externalInterface.protocol.rsaProtocal; - - -import com.matrix.component.wechat.externalInterface.common.RandomStringGenerator; -import com.matrix.component.wechat.externalInterface.common.Signature; -import com.matrix.component.wechat.externalInterface.common.WechatConfigure; - -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; - -/** - * 公钥请求类 - * - * @author wzy - */ -public class JsApiRSAReqData { - - private String mch_id; - private String nonce_str; - private String sign; - private String sign_type; - - - public JsApiRSAReqData() { - this.mch_id = WechatConfigure.mchID; - this.nonce_str = RandomStringGenerator.getRandomStringByLength(32); - this.sign = Signature.getSign(toMap()); - this.sign_type = "MD5"; - } - - public Map<String, Object> toMap() { - Map<String, Object> map = new HashMap<String, Object>(); - Field[] fields = this.getClass().getDeclaredFields(); - for (Field field : fields) { - Object obj; - try { - obj = field.get(this); - if (obj != null) { - map.put(field.getName(), obj); - } - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - return map; - } -} diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/BaseService.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/BaseService.java index 1b9620d..8f9a680 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/BaseService.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/BaseService.java @@ -38,4 +38,8 @@ public void setServiceRequest(IServiceRequest request){ serviceRequest = request; } + + public IServiceRequest getServiceRequest() { + return serviceRequest; + } } diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/JsApiGetPublicKeyService.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/JsApiGetPublicKeyService.java deleted file mode 100644 index 173f31f..0000000 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/service/JsApiGetPublicKeyService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.matrix.component.wechat.externalInterface.service; - -import com.matrix.component.wechat.externalInterface.common.WechatConfigure; -import com.matrix.component.wechat.externalInterface.protocol.payComProtocol.JsApiPayComReqData; -import com.matrix.component.wechat.externalInterface.protocol.rsaProtocal.JsApiRSAReqData; - -public class JsApiGetPublicKeyService extends BaseService { - - public JsApiGetPublicKeyService() throws ClassNotFoundException, IllegalAccessException, InstantiationException { - super(WechatConfigure.PUBLIC_KEY_GET_API, WechatConfigure.HttpsRequestClassName2); - } - - public String request(JsApiRSAReqData jsApiRSAReqData) throws Exception { - - String responseString = sendPost(jsApiRSAReqData); - - return responseString; - } -} diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java index 771333f..82d2c05 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java @@ -1,5 +1,6 @@ package com.matrix.component.wechat.externalInterface.weixinUtil; +import com.matrix.component.wechat.externalInterface.common.HttpsRequest2; import com.matrix.core.exception.GlobleException; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; @@ -18,7 +19,10 @@ import com.matrix.component.wechat.externalInterface.service.JsApiPayComService; import com.matrix.component.wechat.externalInterface.service.RefundService; import com.matrix.component.wechat.externalInterface.service.ScanPayQueryService; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -43,6 +47,13 @@ @Autowired private WxShopOrderUtil wxShopOrderUtil; + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + + + /** * 支付"175.9.82.254" @@ -58,11 +69,41 @@ * @return 预支付订单返回的结果对象(该结果对象已封装),在H5页面使用该对象信息 * @throws Exception */ - public BrandWCPayRequestData createOrder(String desc,String outTradeNo, int price, String openId,String attach) throws Exception { + public BrandWCPayRequestData createOrder(String desc, String outTradeNo, int price, String openId, String attach) throws Exception { + Long companyId=HostInterceptor.getCompanyId(); + BusParameterSettings notifyUrl = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_NOTIFYURL, companyId); + return buildBrandWCPayRequestData(desc, outTradeNo, price, openId, attach, notifyUrl); + } + + /** + * 创建充值订单 + */ + public BrandWCPayRequestData createRechargeOrder(String desc, String outTradeNo, int price, String openId, String attach) throws Exception { + Long companyId=HostInterceptor.getCompanyId(); + BusParameterSettings notifyUrl = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_RECHARGE_NOTIFYURL, companyId); + return buildBrandWCPayRequestData(desc, outTradeNo, price, openId, attach, notifyUrl); + } + + + + private BrandWCPayRequestData buildBrandWCPayRequestData(String desc, String outTradeNo, int price, String openId, String attach, BusParameterSettings notifyUrl) throws Exception { // 创建微信支付预付接口 JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); String idAddr = getIpAddr(WebUtil.getRequest()); - JsApiPayReqData jsApiPayReqData = new JsApiPayReqData(desc, outTradeNo, price, idAddr, openId, attach); + + Long companyId=HostInterceptor.getCompanyId(); + + BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId); + BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); + + + BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); + + JsApiPayReqData jsApiPayReqData = new JsApiPayReqData(appId.getParamValue(),mchID.getParamValue(), + paySecret.getParamValue(), + notifyUrl.getParamValue(), + desc, outTradeNo, price, idAddr, openId, attach); + // 创建预付订单并返回请求结果 JsApiPayResData result = jsApiPayBusiness.createPrapareOrder(jsApiPayReqData); // 把预付订单的信息存放在request域中 @@ -71,17 +112,16 @@ LogUtil.info("#---签名信息:return_msg = {}" , result.getReturn_msg()); if (result.getReturn_code().equals("SUCCESS")) { // 请求成功, 构建BrandWCPayRequest发起支付需要的参数 - BrandWCPayRequestData payData = new BrandWCPayRequestData(result.getPrepay_id()); + BrandWCPayRequestData payData = new BrandWCPayRequestData(result.getPrepay_id(),appId.getParamValue(),paySecret.getParamValue()); WebUtil.getRequest().setAttribute("payData", payData); return payData; }else{ LogUtil.error("创建微信支付订单失败msg={}",result.getReturn_msg()); throw new GlobleException("创建微信支付订单失败,请检查程序配置"); } - } - - + + /**@Description 支付后,向微信发送请求、查询订单,看订单是否真的支付成功了 @date 2017年6月27日 @atuhor jiangyouyao @@ -115,19 +155,34 @@ * @param desc 描述 * @param outTradeNo 提现申请编号 * @param totalFee 提现金额(分) - * @param spBillCreateIP 调用接口的IP * @param openid * @return */ - public JsApiPayComResData comPay(String desc, String outTradeNo,int totalFee, String openid){ + public JsApiPayComResData comPay(String desc, String outTradeNo,int totalFee, String openid,Long companyId){ JsApiPayComResData result=null; - //boolean flag=false; try { JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); // TODO 企业付款 - JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData("","",0,"","",""); + + BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId); + BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); + BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); + + BusParameterSettings certLocalPath = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_CERTLOCAL_PATH, companyId); + + JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData(mchID.getParamValue(), + appId.getParamValue(), + paySecret.getParamValue(), + desc,outTradeNo,totalFee,openid,"NO_CHECK",""); JsApiPayComService jsApiPayComService=new JsApiPayComService(); + + HttpsRequest2 request2= (HttpsRequest2) jsApiPayComService.getServiceRequest(); + request2.setCertLocalPath(certLocalPath.getParamValue()); + request2.setMchId(mchID.getParamValue()); + + result = jsApiPayBusiness.payComOrder(jsApiPayComService, jsApiPayComReqData); + LogUtil.info("#提现,企业付款到个人---result:{}",result); if (result.getResult_code().equals("SUCCESS")) { return result; @@ -155,15 +210,25 @@ int refundFee, String opUserID){ LogUtil.info("#---outTradeNo:{}#---outRefundNo:{}#---totalFee:{}#---refundFee:{}", outTradeNo,outRefundNo,totalFee,refundFee); + BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, HostInterceptor.getCompanyId()); if(opUserID==null){ - opUserID=WechatConfigure.mchID; + opUserID=mchID.getParamValue(); } RefundResData result=null; boolean flag=false; try { JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); - RefundReqData refundReqData=new RefundReqData(outTradeNo, outRefundNo, totalFee, refundFee,opUserID); + Long companyId=HostInterceptor.getCompanyId(); + BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); + BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); + BusParameterSettings certLocalPath = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_CERTLOCAL_PATH, companyId); + + RefundReqData refundReqData=new RefundReqData(mchID.getParamValue(),appId.getParamValue(),paySecret.getParamValue(), outTradeNo, outRefundNo, totalFee, refundFee,opUserID); RefundService refundService=new RefundService(); + HttpsRequest2 request2= (HttpsRequest2) refundService.getServiceRequest(); + request2.setCertLocalPath(certLocalPath.getParamValue()); + request2.setMchId(mchID.getParamValue()); + result = jsApiPayBusiness.refundComOrder(refundService, refundReqData); LogUtil.info("#退款,企业付款到个人---result:{}",result); //如果返回余额不足时 @@ -191,12 +256,12 @@ * @return */ public String getIpAddr(HttpServletRequest request) { - String ip = request.getHeader("x-forwarded-for"); - /* if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getHeader("Proxy-Client-IP"); - } - if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { - ip = request.getHeader("WL-Proxy-Client-IP"); + String ip = request.getHeader("x-forwarded-for"); + /* if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); } */ if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); diff --git a/zq-erp/src/main/java/com/matrix/config/CrossOriginConfig.java b/zq-erp/src/main/java/com/matrix/config/CrossOriginConfig.java new file mode 100644 index 0000000..f389e3f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/config/CrossOriginConfig.java @@ -0,0 +1,33 @@ +package com.matrix.config; + + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +/** + * @author JIANGYOUYAO + * @date 2021/5/29 0029 + */ +@Configuration +public class CrossOriginConfig { + + private CorsConfiguration buildConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + corsConfiguration.addAllowedOrigin("*"); + corsConfiguration.addAllowedHeader("*"); + corsConfiguration.addAllowedMethod("*"); + corsConfiguration.setAllowCredentials(true); + return corsConfiguration; + } + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", buildConfig()); + return new CorsFilter(source); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java b/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java index 989b5cc..c3067f7 100644 --- a/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java +++ b/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java @@ -3,6 +3,7 @@ import com.matrix.core.interceptor.WbeCommonInterceptor; +import com.matrix.system.common.interceptor.ApiUserLoginInterceptor; import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.common.interceptor.SuAuthorityInterceptor; import com.matrix.system.common.interceptor.UserLoginInterceptor; @@ -19,7 +20,7 @@ * @description 容器添加组件 * @date 2019-06-14 15:50 */ -@Configuration +@Configuration() @PropertySource("classpath:config/system.properties") public class MvcCoreConfig implements WebMvcConfigurer { @@ -36,6 +37,9 @@ @Autowired private WbeCommonInterceptor wbeCommonInterceptor; + @Autowired + private ApiUserLoginInterceptor apiUserLoginInterceptor; + /** * 添加拦截器 @@ -46,19 +50,33 @@ */ @Override public void addInterceptors(InterceptorRegistry registry) { + // 手机端拦截 + registry.addInterceptor(apiUserLoginInterceptor) + .addPathPatterns("/api/**") + .excludePathPatterns("/api/common/**"); + // 公共拦截 registry.addInterceptor(wbeCommonInterceptor) .addPathPatterns("/**") .excludePathPatterns("/css/**") .excludePathPatterns("/js/**") .excludePathPatterns("/images/**") - .excludePathPatterns("/plugin/**"); + .excludePathPatterns("/plugin/**") + .excludePathPatterns("/swagger**/**") + .excludePathPatterns("/webjars/**"); + // 用户认证拦截 - registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/common/**").excludePathPatterns("/resource/**"); - // url权限拦截 - registry.addInterceptor(suAuthorityInterceptor).addPathPatterns("/**/su/**"); + registry.addInterceptor(userLoginInterceptor) + .addPathPatterns("/admin/**"); + + //小程序公司与域名对应关系拦截 - registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**"); + registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**") + .addPathPatterns("/api/common/wxLogin/**") + .addPathPatterns("/api/common/bindUser") + .addPathPatterns("/api/user/xcxloginOut/**") + .excludePathPatterns("/wxCommon/wxapi/wxpayCallback") + .excludePathPatterns("/wxCommon/wxapi/rechargeCallBack"); } diff --git a/zq-erp/src/main/java/com/matrix/config/MybatisPlusConfig.java b/zq-erp/src/main/java/com/matrix/config/MybatisPlusConfig.java new file mode 100644 index 0000000..e08b37d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/config/MybatisPlusConfig.java @@ -0,0 +1,22 @@ +package com.matrix.config; + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author wzy + * @date 2021-02-22 + **/ +@Configuration +@MapperScan("com.matrix.system.*.dao") +public class MybatisPlusConfig { + + @Bean + public PaginationInterceptor paginationInterceptor(){ + return new PaginationInterceptor(); + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java b/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java index 6ff44d6..b1b4a19 100644 --- a/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java +++ b/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java @@ -1,10 +1,16 @@ +/* package com.matrix.config; import com.matrix.component.rabbitmq.MqTask; import com.matrix.component.rabbitmq.RabiitMqTemplate; import com.matrix.component.rabbitmq.RabiitMqTemplateFactory; -import com.matrix.system.shopXcx.mqTask.*; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.shopXcx.mqTask.OrderOutSotoreTask; +import com.matrix.system.shopXcx.mqTask.SalesOrderRefundTask; +import com.matrix.system.shopXcx.mqTask.SalesOrderTask; +import com.matrix.system.shopXcx.mqTask.TemplateMsgTask; +import com.matrix.system.wechart.templateMsg.Task.UniformMsgSentTask; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -13,7 +19,12 @@ import java.util.ArrayList; import java.util.List; -@Configuration +*/ +/** + * 小型应用弃用rabbitmq,直接通过观察者模式对消息进行同步消费 参考 AsyncMessageManager + *//* + +//@Configuration public class RabbitMqConfig { @Value("${rabbitmq.host}") @@ -33,19 +44,30 @@ public static final String MQ_EXCHANGE_A = "hive_exchange_A"; - @Bean - VipCreateTask VipCreateTask() { - return new VipCreateTask(); - } + //订阅模式 + public static final String MQ_EXCHANGE_TOPIC = "hive_exchange_fanout"; + + + + @Bean - OrderTask OrderrCreateTask() { - return new OrderTask(); + SalesOrderTask SalesOrderTask() { + return new SalesOrderTask(); + } + @Bean + SalesOrderRefundTask SalesOrderRefundTask() { + return new SalesOrderRefundTask(); } @Bean TemplateMsgTask TemplateMsgTask(){ return new TemplateMsgTask(); + } + + @Bean + UniformMsgSentTask UniformMsgSentTask(){ + return new UniformMsgSentTask(); } @Bean @@ -56,21 +78,18 @@ @Bean public RabiitMqTemplate rabiitMqTemplate() throws IOException { - + LogUtil.info("rabbitmq: {}, {}, {}, {}", host, port, username, password); RabiitMqTemplate rabiitMqTemplate = RabiitMqTemplateFactory.buildTemplate(host, port, username, password); //声明一个交换机 rabiitMqTemplate.exchangeDeclare(MQ_EXCHANGE_A+evn, "direct"); - rabiitMqTemplate.exchangeDeclare(MQ_EXCHANGE_A+"cf", "direct"); + rabiitMqTemplate.exchangeDeclare(MQ_EXCHANGE_TOPIC +evn, "topic"); List<MqTask> taskList = new ArrayList<>(); //注册RabbitMq任务 - taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.CREATE_VIP + evn, MQTaskRouting.CREATE_VIP + evn, VipCreateTask())); - taskList.add(new MqTask(MQ_EXCHANGE_A + "cf", MQTaskRouting.CREATE_VIP + evn, MQTaskRouting.CREATE_VIP + evn, null)); - taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.CREATE_ORDER + evn,MQTaskRouting.CREATE_ORDER + evn,OrderrCreateTask())); - taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_TEMPLATE_MSG + evn,MQTaskRouting.SEND_TEMPLATE_MSG + evn, TemplateMsgTask())); - taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.ORDER_OUT_SOTORE + evn,MQTaskRouting.ORDER_OUT_SOTORE + evn, OrderOutSotoreTask())); + + rabiitMqTemplate.binding(taskList); @@ -78,4 +97,6 @@ } + } +*/ diff --git a/zq-erp/src/main/java/com/matrix/config/SwaggerConfig.java b/zq-erp/src/main/java/com/matrix/config/SwaggerConfig.java new file mode 100644 index 0000000..6b71b6a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/config/SwaggerConfig.java @@ -0,0 +1,108 @@ +package com.matrix.config; + +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author wzy + * @Date 2020/5/11 + * @email wangdoubleone@gmail.com + * @Version V1.0 + **/ +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + + @Value("${swagger.enable}") + private boolean swaggerEnable; + + @Bean + public Docket createRestApi(){ + // 添加请求参数,我们这里把token作为请求头部参数传入后端 + ParameterBuilder parameterBuilder = new ParameterBuilder(); + List<Parameter> parameters = new ArrayList<Parameter>(); + parameterBuilder.name("Authorization").description("令牌").modelRef(new ModelRef("string")).parameterType("header") + .required(false).build(); + parameters.add(parameterBuilder.build()); + return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).enable(swaggerEnable).select().apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) + .paths(PathSelectors.ant("/api/**")).build().globalOperationParameters(parameters).groupName("HIVE"); +// .ignoredParameterTypes(MemberEntity.class); + } + + private ApiInfo apiInfo(){ + return new ApiInfoBuilder() + .title("Hive") + .description("This is a restful api document of Hive.") + .version("1.0") + .build(); + } + + @Bean + public Docket wxRestApi(){ + // 添加请求参数,我们这里把token作为请求头部参数传入后端 + ParameterBuilder parameterBuilder = new ParameterBuilder(); + List<Parameter> parameters = new ArrayList<Parameter>(); + parameterBuilder.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header") + .required(true).build(); + parameters.add(parameterBuilder.build()); + + ParameterBuilder parameterBuilder2 = new ParameterBuilder(); + parameterBuilder2.name("companyCode").description("公司编码tangqiaqia.jyymatrix.cc").modelRef(new ModelRef("string")).parameterType("header") + .required(true).build(); + parameters.add(parameterBuilder2.build()); + + return new Docket(DocumentationType.SWAGGER_2).apiInfo(wxApiInfo()).enable(swaggerEnable).select().apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) + .paths(PathSelectors.ant("/wxapi/**")).build().globalOperationParameters(parameters).groupName("小程序接口"); +// .ignoredParameterTypes(MemberEntity.class); + } + + private ApiInfo wxApiInfo(){ + return new ApiInfoBuilder() + .title("Hive Wx") + .description("This is a restful api document of Hive Wx.") + .version("1.0") + .build(); + } + + + @Bean + public Docket ERPApi(){ + // 添加请求参数,我们这里把token作为请求头部参数传入后端 + ParameterBuilder parameterBuilder = new ParameterBuilder(); + List<Parameter> parameters = new ArrayList<Parameter>(); + parameterBuilder.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header") + .required(true).build(); + parameters.add(parameterBuilder.build()); + + + return new Docket(DocumentationType.SWAGGER_2).apiInfo(ERPApiInfo()).enable(swaggerEnable).select().apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) + .paths(PathSelectors.ant("/admin/**")).build().globalOperationParameters(parameters).groupName("ERP接口"); + } + + private ApiInfo ERPApiInfo(){ + return new ApiInfoBuilder() + .title("Hive ERP") + .description("This is a restful api document of Hive ERP.") + .version("1.0") + .build(); + } + + + +} diff --git a/zq-erp/src/main/java/com/matrix/config/TaskScheduleConfig.java b/zq-erp/src/main/java/com/matrix/config/TaskScheduleConfig.java new file mode 100644 index 0000000..1d09724 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/config/TaskScheduleConfig.java @@ -0,0 +1,16 @@ +package com.matrix.config; + +import com.matrix.core.tools.LogUtil; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.stereotype.Component; + +@Component +@EnableScheduling +@ConditionalOnProperty(name = "scheduling.enabled", havingValue= "true") +public class TaskScheduleConfig { + + public TaskScheduleConfig(){ + LogUtil.debug("**********定时任务启动**********"); + } +} diff --git a/zq-erp/src/main/java/com/matrix/config/WebSocketConfig.java b/zq-erp/src/main/java/com/matrix/config/WebSocketConfig.java index 56a21a4..aed2a7d 100644 --- a/zq-erp/src/main/java/com/matrix/config/WebSocketConfig.java +++ b/zq-erp/src/main/java/com/matrix/config/WebSocketConfig.java @@ -39,6 +39,7 @@ LogUtil.info("注册WebSocket处理类"); registry.addHandler(createWebSocketPushHandler(), "/webSocketServer") .addInterceptors(createHhandshakeInterceptor()).setAllowedOrigins("*"); + registry.addHandler(createWebSocketPushHandler(), "/sockjs/webSocketServer") .addInterceptors(createHhandshakeInterceptor()).withSockJS(); diff --git a/zq-erp/src/main/java/com/matrix/core/exception/GlobalExceptionHandler.java b/zq-erp/src/main/java/com/matrix/core/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..7602e17 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/core/exception/GlobalExceptionHandler.java @@ -0,0 +1,34 @@ +package com.matrix.core.exception; + +import com.matrix.core.pojo.AjaxResult; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.validation.ValidationException; + +/** + * @author wzy + * @date 2020-05-08 15:40 + **/ +@RestControllerAdvice +public class GlobalExceptionHandler { + + /** + * 方法参数校验 + * + * @param e + * @return + */ + @ExceptionHandler(value = {MethodArgumentNotValidException.class}) + public AjaxResult handleException(MethodArgumentNotValidException e) { + FieldError fieldError = e.getBindingResult().getFieldError(); + if (fieldError != null) { + return AjaxResult.buildFailInstance(fieldError.getDefaultMessage()); + } else { + return AjaxResult.buildFailInstance("参数校验失败"); + } + } + +} diff --git a/zq-erp/src/main/java/com/matrix/core/exception/GlobleException.java b/zq-erp/src/main/java/com/matrix/core/exception/GlobleException.java index 214bb65..2061d5f 100644 --- a/zq-erp/src/main/java/com/matrix/core/exception/GlobleException.java +++ b/zq-erp/src/main/java/com/matrix/core/exception/GlobleException.java @@ -63,6 +63,10 @@ return message; } + public static RuntimeException instance(String msg) { + return new GlobleException(msg); + } + public String getErrorCode() { return errorCode; } diff --git a/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java b/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java index d6ca19c..2ff87a7 100644 --- a/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java +++ b/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java @@ -7,7 +7,6 @@ import com.matrix.system.common.bean.ProjException; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.dao.ProjExceptionDao; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.servlet.HandlerExceptionResolver; import org.springframework.web.servlet.ModelAndView; @@ -28,6 +27,7 @@ private static final String TRUE = "true"; + /** * 忽略一些特定的异常 */ diff --git a/zq-erp/src/main/java/com/matrix/core/pojo/AjaxResult.java b/zq-erp/src/main/java/com/matrix/core/pojo/AjaxResult.java index 4e45714..8582d87 100644 --- a/zq-erp/src/main/java/com/matrix/core/pojo/AjaxResult.java +++ b/zq-erp/src/main/java/com/matrix/core/pojo/AjaxResult.java @@ -4,7 +4,7 @@ import com.matrix.core.tools.InternationaUtil; import com.matrix.core.tools.MdcUtil; import com.matrix.core.tools.StringUtils; -import com.matrix.system.hive.plugin.message.StringUtil; +import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; import java.io.Serializable; import java.util.HashMap; @@ -44,7 +44,14 @@ * info会被国际化工具先处理,找不到国际化资源则显示原始信息 **/ private String info; + + /** + * 单个对象返回参数 + */ + private Object data; + private Map<Object, Object> mapInfo = new HashMap<>(); + private List<?> rows; /** * 总记录数 @@ -53,8 +60,17 @@ private String requestId; + public static AjaxResult buildSuccessInstance(Object data) { + AjaxResult result= new AjaxResult(STATUS_SUCCESS,""); + result.data=data; + return result; + } - + public static AjaxResult buildSuccessInstance(Object data, String info) { + AjaxResult result= new AjaxResult(STATUS_SUCCESS,info); + result.data=data; + return result; + } public static AjaxResult buildSuccessInstance(String info) { @@ -69,6 +85,11 @@ public static AjaxResult buildSuccessInstance(List<?> rows, Integer total) { return new AjaxResult(STATUS_SUCCESS, rows, total); } + + public static AjaxResult buildSuccessInstance(List<?> rows, long total) { + return new AjaxResult(STATUS_SUCCESS, rows, Integer.parseInt(total+"")); + } + public static AjaxResult buildSuccessInstance(List<?> rows) { return new AjaxResult(STATUS_SUCCESS, rows); @@ -93,8 +114,6 @@ * 设置简单信息,这是一个便捷的方法 * * @param status - * @param page - * @param info */ public AjaxResult(String status, List<?> rows) { this.status = status; @@ -109,6 +128,7 @@ } this.requestId= MdcUtil.getMdc(); } + @@ -168,6 +188,14 @@ this.requestId = requestId; } + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + /** * 在map对象中放置信息 * diff --git a/zq-erp/src/main/java/com/matrix/core/pojo/BasePageQueryDto.java b/zq-erp/src/main/java/com/matrix/core/pojo/BasePageQueryDto.java new file mode 100644 index 0000000..a47fd5b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/core/pojo/BasePageQueryDto.java @@ -0,0 +1,44 @@ +package com.matrix.core.pojo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +@Data +@ApiModel(value = "BaseQueryDto", description = "通用分页查询参数接收类") +public class BasePageQueryDto { + + + @NotNull(message = "pageNum参数不能为空") + @ApiModelProperty(value = "第几页", example = "1") + private Integer pageNum; + + @NotNull(message = "pageSize参数不能为空") + @ApiModelProperty(value ="数量", example = "10") + private Integer pageSize; + + @ApiModelProperty(value ="排序方式", example = "desc") + private String order; + + @ApiModelProperty(value ="排序字段", example = "create_time") + private String sort; + + @ApiModelProperty(value ="关键字") + private String keywords; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "开始时间") + private Date beginTime; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "结束时间") + private Date endTime; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/core/pojo/PaginationDto.java b/zq-erp/src/main/java/com/matrix/core/pojo/PaginationDto.java new file mode 100644 index 0000000..90f6c88 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/core/pojo/PaginationDto.java @@ -0,0 +1,75 @@ +package com.matrix.core.pojo; + +/** + * @author 姜友瑶 E-mail:<935090232@qq.com> + * @date 2021年1月15日 + * @description 分页信息类 + */ +public class PaginationDto { + + /** + * 起点 + */ + private Integer offset = 0; + /** + * 查询条数 + */ + private Integer limit =15; + + /** + * 排序方式 + */ + private String order; + /** + * 排序字段 + */ + private String sort; + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getOrder() { + return order; + } + + public void setOrder(String order) { + this.order = order; + } + + public String getSort() { + return propertyToColumn(sort); + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String propertyToColumn(String property) { + if(property==null){ + return null; + } + StringBuffer columnName = new StringBuffer(property); + for (int i = 0; i < columnName.length(); i++) { + if (columnName.charAt(i) >= 'A' && columnName.charAt(i) <= 'Z') { + String upcase = "_" + (columnName.charAt(i) + "").toLowerCase(); + columnName.replace(i, i + 1, upcase); + } + } + return columnName.toString(); + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/core/pojo/PaginationVO.java b/zq-erp/src/main/java/com/matrix/core/pojo/PaginationVO.java index 43bee19..8c11a72 100644 --- a/zq-erp/src/main/java/com/matrix/core/pojo/PaginationVO.java +++ b/zq-erp/src/main/java/com/matrix/core/pojo/PaginationVO.java @@ -5,7 +5,7 @@ * @date 2016年6月24日 * @description 分页信息类 */ -public class PaginationVO extends EntityDTO{ +public class PaginationVO { /** * 起点 diff --git a/zq-erp/src/main/java/com/matrix/core/pojo/VerificationResult.java b/zq-erp/src/main/java/com/matrix/core/pojo/VerificationResult.java new file mode 100644 index 0000000..d4bb932 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/core/pojo/VerificationResult.java @@ -0,0 +1,47 @@ +package com.matrix.core.pojo; + +import lombok.Data; + +/** + * 通用的验证返回参数 + */ +@Data +public class VerificationResult { + + private boolean judgeResult; + + private String msg; + + private Object info; + + private VerificationResult(){ + + } + + public static VerificationResult buildVerificationResult(boolean judgeResult){ + VerificationResult obj=new VerificationResult(); + obj.judgeResult =judgeResult; + return obj ; + } + + + public static VerificationResult buildVerificationResult(boolean judgeResult,String msg){ + VerificationResult obj=new VerificationResult(); + obj.judgeResult =judgeResult; + obj.msg=msg; + return obj ; + } + + + public static VerificationResult buildVerificationResult(boolean judgeResult,Object info){ + VerificationResult obj=new VerificationResult(); + obj.judgeResult =judgeResult; + obj.info=info; + return obj ; + } + + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/core/tools/DateUtil.java b/zq-erp/src/main/java/com/matrix/core/tools/DateUtil.java index bb10294..01df901 100644 --- a/zq-erp/src/main/java/com/matrix/core/tools/DateUtil.java +++ b/zq-erp/src/main/java/com/matrix/core/tools/DateUtil.java @@ -5,6 +5,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; @@ -12,7 +13,7 @@ /** * 日期格式化,转换工具类 - * + * * @author Ron * @createTime 2014.08.30 */ @@ -90,7 +91,7 @@ /** * 返回年份 - * + * * @param date * 日期 * @return 返回年份 @@ -137,7 +138,7 @@ } /** * 返回月份 - * + * * @param date * 日期 * @return 返回月份 @@ -149,14 +150,14 @@ c.setTime(date); return c.get(Calendar.MONTH) + 1; } catch (Exception e) { - + } return 0; } /** * 日期转字符串 - * + * * @param date * @param format * @return @@ -172,7 +173,7 @@ /** * 字符串转日期 - * + * * @param dateStr * @param format * @return @@ -183,7 +184,7 @@ try { return fmt.parse(dateStr); } catch (ParseException e) { - + } return null; } @@ -199,7 +200,7 @@ /** * 判断给定的日期是一周中的第几天,注意:按照中国的习惯,周日是第七天 - * + * * @param date * @return */ @@ -225,7 +226,7 @@ /** * 指定时间的下一天 - * + * * @param date * @return */ @@ -241,7 +242,7 @@ cal.add(Calendar.DATE, 1); return cal.getTime(); } catch (Exception e) { - + } return null; @@ -249,7 +250,7 @@ /** * 指定时间的前一天 - * + * * @param date * @return */ @@ -265,7 +266,7 @@ cal.add(Calendar.DATE, -1); return cal.getTime(); } catch (Exception e) { - + } return null; @@ -273,7 +274,7 @@ /** * 指定时间的下N天 - * + * * @param date * @return */ @@ -289,7 +290,7 @@ cal.add(Calendar.DATE, nDay); return cal.getTime(); } catch (Exception e) { - + } return null; @@ -297,7 +298,7 @@ /** * 指定时间的前N天 - * + * * @param date * @return */ @@ -313,7 +314,7 @@ cal.add(Calendar.DATE, -nDay); return cal.getTime(); } catch (Exception e) { - + } return null; @@ -321,7 +322,7 @@ /** * 获取一天的起始时间 - * + * * @param date * @return */ @@ -338,7 +339,7 @@ try { return fmt.parse(dateStr); } catch (ParseException e) { - + } return date; @@ -346,7 +347,7 @@ /** * 获取一天的结束时间 - * + * * @param date * @return */ @@ -363,7 +364,7 @@ try { return fmt.parse(dateStr); } catch (ParseException e) { - + } return date; @@ -371,7 +372,7 @@ /** * currentDat是否在referenceDate日期之前 - * + * * @param referenceDate * @param currentDat * @return @@ -389,7 +390,7 @@ /** * currentDat是否在referenceDate日期之后 - * + * * @param referenceDate * @param currentDat * @return @@ -436,7 +437,7 @@ } /** * 判断currentDate是否在startDate和endDate之间,不包括startDate和endDate - * + * * @param startDate * @param endDate * @param currentDate @@ -454,11 +455,11 @@ return false; } - + /** * 获取startDate到endDate之间的星期day(中文星期)不包括startDate和endDate - * + * * @param startDate * @param endDate * @param day @@ -483,11 +484,11 @@ return listDate; } - + /** * date转换成Timestamp - * + * * @param date * @param format * @return @@ -507,7 +508,7 @@ /** * 获取早中晚 - * + * * @param time * @return */ @@ -530,7 +531,7 @@ /** * 获取早中晚的开始时间 - * + * * @param date * @param time * @return @@ -554,7 +555,7 @@ /** * 获取早中晚的结束时间 - * + * * @param date * @param time * @return @@ -578,7 +579,7 @@ /** * 得到几天前的时间 - * + * * @param d * @param day * @return @@ -592,7 +593,7 @@ /** * 得到几天后的时间 - * + * * @param d * @param day * @return @@ -606,7 +607,7 @@ /** * 将日期类型格式化成字符串 - * + * * @param date * @return 格式化后日期字符串 * @throws ParseException @@ -622,7 +623,7 @@ /** * 获取时间戳 - * + * * @return */ public static String getTimeMark() { @@ -694,4 +695,70 @@ } return um; } + + /** + * 根据单位计算目标日期 + * + * @param num 距离 + * @param unit 日期单位 Y/M/D + * @return + */ + public static Date calDate(Integer num, String unit) { + Calendar calendar = Calendar.getInstance(); + Date targetDate = null; + switch (unit) { + case "Y": + calendar.add(Calendar.YEAR, num); + targetDate = calendar.getTime(); + break; + case "M": + calendar.add(Calendar.MONTH, num); + targetDate = calendar.getTime(); + break; + case "D": + calendar.add(Calendar.DAY_OF_MONTH, num); + targetDate = calendar.getTime(); + break; + default: + targetDate = stringToDate("2099-12-31", DATE_FORMAT_DD); + + } + + return targetDate; + } + + public static String getAgeForBirthDay(Date birthDay) { + Calendar cal = Calendar.getInstance(); + if (birthDay == null) { + return "-"; + } + // 出生日期晚于当前时间,无法计算 + if (cal.before(birthDay)) { + return "-"; + } + // 当前年份 + int yearNow = cal.get(Calendar.YEAR); + // 当前月份 + int monthNow = cal.get(Calendar.MONTH); + // 当前日期 + int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); + cal.setTime(birthDay); + int yearBirth = cal.get(Calendar.YEAR); + int monthBirth = cal.get(Calendar.MONTH); + int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH); + // 计算整岁数 + Integer age = yearNow - yearBirth; + if (monthNow <= monthBirth) { + if (monthNow == monthBirth) { + if (dayOfMonthNow < dayOfMonthBirth) { + // 当前日期在生日之前,年龄减一 + age--; + } + } else { + age--; + } + } + + return age.toString(); + } } diff --git a/zq-erp/src/main/java/com/matrix/core/tools/DingDingRobotUtil.java b/zq-erp/src/main/java/com/matrix/core/tools/DingDingRobotUtil.java index 894b644..6cab70c 100644 --- a/zq-erp/src/main/java/com/matrix/core/tools/DingDingRobotUtil.java +++ b/zq-erp/src/main/java/com/matrix/core/tools/DingDingRobotUtil.java @@ -70,6 +70,7 @@ response = httpclient.execute(httppost); if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { String result = EntityUtils.toString(response.getEntity(), "utf-8"); + LogUtil.debug("发送钉钉结果"+result); } } catch (IOException e) { e.printStackTrace(); diff --git a/zq-erp/src/main/java/com/matrix/core/tools/MdcUtil.java b/zq-erp/src/main/java/com/matrix/core/tools/MdcUtil.java index 24f6098..c3c0a67 100644 --- a/zq-erp/src/main/java/com/matrix/core/tools/MdcUtil.java +++ b/zq-erp/src/main/java/com/matrix/core/tools/MdcUtil.java @@ -13,12 +13,12 @@ private static final String TR_KEY = "Tr"; public static void setRequestId() { - MDC.clear(); + MDC.remove(TR_KEY); MDC.put(TR_KEY, "TR = " + StringUtils.getRandomString(16) + ""); } public static void clearRequestId() { - MDC.clear(); + MDC.remove(TR_KEY); } public static String getMdc() { diff --git a/zq-erp/src/main/java/com/matrix/core/tools/SmsUtils.java b/zq-erp/src/main/java/com/matrix/core/tools/SmsUtils.java index a39f00c..cb14c28 100644 --- a/zq-erp/src/main/java/com/matrix/core/tools/SmsUtils.java +++ b/zq-erp/src/main/java/com/matrix/core/tools/SmsUtils.java @@ -1,5 +1,6 @@ package com.matrix.core.tools; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.aliyuncs.CommonRequest; @@ -7,7 +8,6 @@ import com.aliyuncs.IAcsClient; import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.http.MethodType; -import com.google.gson.JsonObject; import com.matrix.config.properties.AliSmsProperties; import com.matrix.core.exception.GlobleException; import com.matrix.system.hive.bean.SysSmsTemplate; @@ -15,7 +15,6 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.util.HashMap; import java.util.Map; /** @@ -57,8 +56,7 @@ CommonRequest request = commonRequest(SysSmsTemplate.SMS_ACTION_SEND); request.putQueryParameter("PhoneNumbers", phoneNum); request.putQueryParameter("TemplateCode", templateCode); - String jsonStr = JSONObject.toJSONString(values); - request.putQueryParameter("TemplateParam", jsonStr); + request.putQueryParameter("TemplateParam", JSONUtil.parse(values).toString()); CommonResponse response = null; try { diff --git a/zq-erp/src/main/java/com/matrix/core/tools/StringUtils.java b/zq-erp/src/main/java/com/matrix/core/tools/StringUtils.java index c2fbc63..673efa2 100644 --- a/zq-erp/src/main/java/com/matrix/core/tools/StringUtils.java +++ b/zq-erp/src/main/java/com/matrix/core/tools/StringUtils.java @@ -1,15 +1,5 @@ package com.matrix.core.tools; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import java.util.UUID; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import com.matrix.core.exception.GlobleException; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; @@ -18,6 +8,12 @@ import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; import org.apache.commons.collections.CollectionUtils; +import org.springframework.util.AntPathMatcher; + +import java.io.UnsupportedEncodingException; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * 字符串操作类,转换数据类型,切割字符串,对象比较等操作 @@ -33,6 +29,47 @@ private static final int SAVA_CHAR_LENGTH = 4; private static final String EMPTY = ""; + + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List<String> strs) + { + if (isBlank(str) || CollectionUtils.isEmpty(strs)) + { + return false; + } + for (String pattern : strs) + { + if (isMatch(pattern, str)) + { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + * @return + */ + public static boolean isMatch(String pattern, String url) + { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } + /** * 将字符串中的某些值用指定字符代替 @@ -404,6 +441,8 @@ return sb.toString(); } + + /** * 用逗号分开的存的id是否包含对应的id 如比较 123,123,124 中是否包含12这个主键 比对的方法是 字符串中是否包含"^12$" * "^12,.*" 或者 ".+,12$" 或者 ".+,12,$" 或者 ".+,12,.+" 字符串 diff --git a/zq-erp/src/main/java/com/matrix/core/tools/rr/GlueFactory.java b/zq-erp/src/main/java/com/matrix/core/tools/rr/GlueFactory.java index 5f0f32f..d46fe06 100644 --- a/zq-erp/src/main/java/com/matrix/core/tools/rr/GlueFactory.java +++ b/zq-erp/src/main/java/com/matrix/core/tools/rr/GlueFactory.java @@ -104,4 +104,27 @@ throw new IllegalArgumentException(">>>>>>>>>>> xxl-glue, loadNewInstance error, instance is null"); } + + /** + * 根据字符串获取几个java实例 + * @param codeSource + * @return + * @throws Exception + */ + public Object loadInstance(String codeSource) throws Exception{ + if (codeSource!=null && codeSource.trim().length()>0) { + Class<?> clazz = groovyClassLoader.parseClass(codeSource); + if (clazz != null) { + Object instance = clazz.newInstance(); + if (instance!=null) { + this.injectService(instance); + return instance; + } + } + } + throw new IllegalArgumentException(">>>>>>>>>>> xxl-glue, loadNewInstance error, instance is null"); + } + + + } diff --git a/zq-erp/src/main/java/com/matrix/core/tools/rr/GroovyDome.java b/zq-erp/src/main/java/com/matrix/core/tools/rr/GroovyDome.java index 8b849cb..07d7357 100644 --- a/zq-erp/src/main/java/com/matrix/core/tools/rr/GroovyDome.java +++ b/zq-erp/src/main/java/com/matrix/core/tools/rr/GroovyDome.java @@ -1,12 +1,42 @@ package com.matrix.core.tools.rr; +import com.alibaba.druid.pool.DruidDataSource; +import com.alibaba.fastjson.JSONArray; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcOperations; +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; public class GroovyDome implements GroovyRunable { - @Override + @Autowired + DruidDataSource datasource; public AjaxResult run() { - return new AjaxResult(); + String tables="back_no, back_test, chy_clean_vip_price, code_relation_ks, crm_order_operator_config, customer_test, dept_batch_no, detail, ds_order_record, erp_adjust_price, erp_adjust_price_detail, erp_approva_apply, erp_approval_record, erp_approver_configuration, erp_business_with_product, erp_business_with_store, erp_conservation_detail, erp_conservation_record, erp_cus_update_record, erp_custom_bf0624, erp_customer, erp_customer_copy1, erp_customer0618, erp_data_dictionary, erp_distribution_detail, erp_distribution_info, erp_ent_business_scope, erp_ent_certificate_info, erp_ent_contact_user, erp_ent_first_practice, erp_ent_first_practice_reocrd, erp_ent_prohibit, erp_enterprise_bank, erp_enterprise_info, erp_export_record, erp_field_update_record, erp_file_upload, erp_function_browse, erp_function_collection, erp_inventory_detail, erp_inventory_enter_detail, erp_inventory_enter_info, erp_inventory_plan_info, erp_message_receive, erp_message_send, erp_order_no_record, erp_order_record, erp_outbound_review, erp_overflow_loss_detail, erp_overflow_loss_info, erp_param_configure, erp_picking_detail, erp_picking_info, erp_print_record, erp_pro_certificate, erp_pro_first_practice, erp_pro_first_practice_reocrd, erp_product_img_detail, erp_product_info, erp_product_other_info, erp_product_prohibit, erp_product_quality_attr, erp_product_revise_price, erp_product_sale_attr, erp_product_stock, erp_purchase_back_detail, erp_purchase_backgoods, erp_purchase_backgoods_copy, erp_purchase_order_detail, erp_purchase_order_info, erp_purchase_plan_detail, erp_purchase_plan_info, erp_purchase_receivegoods, erp_purchase_receivegoods_detail, erp_purchase_rejection, erp_purchase_rejection_detail, erp_quality_review_detail, erp_quality_review_record, erp_recharge_record, erp_region, erp_resource_auth_role, erp_resources_auth, erp_resources_auth_value, erp_resources_group, erp_revise_price_detail, erp_revise_price_info, erp_settings, erp_stock_flow_detail, erp_store_info, erp_table_test_price, erp_value_card_flow, erp_vip_integral_flow, erp_vip_integral_record, erp_vip_integral_rule, erp_vip_type, erp_wait_conservation_record, erp_warehouse_area, erp_warehouses, erp_wave_detail, erp_wave_info, his_item_pay_detail, inventory_allocation, inventory_change_record, item, jiagetiaozheng, lingshoujia, menzhen_0927, pandian, pandianxiugai, pos_aaa, pos_activity, pos_activity_gift_info, pos_activity_gifts, pos_activity_integral, pos_activity_package, pos_activity_product, pos_activity_recharge, pos_activity_with_store, pos_approva_apply, pos_approval_record, pos_bill_template_detail, pos_bill_template_store_default, pos_bucket_record, pos_bucket_record_detail, pos_bucket_stock, pos_business_data, pos_business_data_detail, pos_cashier_handover, pos_conservation_detail, pos_conservation_record, pos_destory_loss_mode, pos_enter_invalid_detail, pos_integral_convert_money, pos_inventory_detail, pos_inventory_enter_detail, pos_inventory_enter_info, pos_inventory_plan_info, pos_item_pay_detail, pos_loss_destory, pos_no_qd_damaged_detail, pos_no_qd_damaged_info, pos_no_qd_move_record, pos_order_stock_detail, pos_overflow_loss_detail, pos_overflow_loss_info, pos_package_product, pos_prescription_record, pos_product_destroy, pos_product_info, pos_product_info_copy1, pos_product_sale_detail, pos_product_stock, pos_product_stock_temp, pos_product_update_record, pos_purchase_back_detail, pos_purchase_back_goods, pos_purchase_plan_detail, pos_purchase_plan_info, pos_purchase_rejection, pos_purchase_rejection_detail, pos_quality_review_detail, pos_quality_review_record, pos_receive_detail, pos_receive_goods, pos_refund_order, pos_refund_order_detail, pos_refund_stock_detail, pos_retail_order, pos_retail_order_detail, pos_retail_package_pro, pos_scatter_stock, pos_scattered_record, pos_scattered_stock, pos_special_product_detail, pos_special_product_info, pos_special_tube_record, pos_stock_flow_detail, pos_temperature_humidity, pos_transfer_slip, pos_transfer_slip_detail, pos_transfer_slip_out_stock, pos_wait_conservation, pos_wholesale_goods, pos_wholesale_plan_detail, pos_wholesale_plan_info, product_info, productCode, qrtz_calendars, qrtz_job_details, qrtz_locks, qrtz_paused_trigger_grps, qrtz_scheduler_state, receive_temp, retail_team, Sheet1, stock_init, stock_price, stock_test, sys_api_access_record, sys_app, sys_button, sys_company, sys_department, sys_fn_btn_rel, sys_function, sys_log, sys_role, sys_role_pwoer_fn, sys_role_pwoer_fn_audit, sys_user_login_record, sys_users, tementiaojia, test_jinheyuan, xlyb, xxl_job_group, xxl_job_info, xxl_job_lock, xxl_job_log, xxl_job_logglue, xxl_job_registry, xxl_job_user"; + String tableArry[] = StringUtils.stringToArray(tables,","); + for(String table : tableArry) { + + System.out.println("开始处理====》" + table); + } + AjaxResult r= AjaxResult.buildSuccessInstance("成功"); + return r; + } + + public static void main(String[] args) { + String tables="back_no, back_test, chy_clean_vip_price, code_relation_ks, crm_order_operator_config, customer_test, dept_batch_no, detail, ds_order_record, erp_adjust_price, erp_adjust_price_detail, erp_approva_apply, erp_approval_record, erp_approver_configuration, erp_business_with_product, erp_business_with_store, erp_conservation_detail, erp_conservation_record, erp_cus_update_record, erp_custom_bf0624, erp_customer, erp_customer_copy1, erp_customer0618, erp_data_dictionary, erp_distribution_detail, erp_distribution_info, erp_ent_business_scope, erp_ent_certificate_info, erp_ent_contact_user, erp_ent_first_practice, erp_ent_first_practice_reocrd, erp_ent_prohibit, erp_enterprise_bank, erp_enterprise_info, erp_export_record, erp_field_update_record, erp_file_upload, erp_function_browse, erp_function_collection, erp_inventory_detail, erp_inventory_enter_detail, erp_inventory_enter_info, erp_inventory_plan_info, erp_message_receive, erp_message_send, erp_order_no_record, erp_order_record, erp_outbound_review, erp_overflow_loss_detail, erp_overflow_loss_info, erp_param_configure, erp_picking_detail, erp_picking_info, erp_print_record, erp_pro_certificate, erp_pro_first_practice, erp_pro_first_practice_reocrd, erp_product_img_detail, erp_product_info, erp_product_other_info, erp_product_prohibit, erp_product_quality_attr, erp_product_revise_price, erp_product_sale_attr, erp_product_stock, erp_purchase_back_detail, erp_purchase_backgoods, erp_purchase_backgoods_copy, erp_purchase_order_detail, erp_purchase_order_info, erp_purchase_plan_detail, erp_purchase_plan_info, erp_purchase_receivegoods, erp_purchase_receivegoods_detail, erp_purchase_rejection, erp_purchase_rejection_detail, erp_quality_review_detail, erp_quality_review_record, erp_recharge_record, erp_region, erp_resource_auth_role, erp_resources_auth, erp_resources_auth_value, erp_resources_group, erp_revise_price_detail, erp_revise_price_info, erp_settings, erp_stock_flow_detail, erp_store_info, erp_table_test_price, erp_value_card_flow, erp_vip_integral_flow, erp_vip_integral_record, erp_vip_integral_rule, erp_vip_type, erp_wait_conservation_record, erp_warehouse_area, erp_warehouses, erp_wave_detail, erp_wave_info, his_item_pay_detail, inventory_allocation, inventory_change_record, item, jiagetiaozheng, lingshoujia, menzhen_0927, pandian, pandianxiugai, pos_aaa, pos_activity, pos_activity_gift_info, pos_activity_gifts, pos_activity_integral, pos_activity_package, pos_activity_product, pos_activity_recharge, pos_activity_with_store, pos_approva_apply, pos_approval_record, pos_bill_template_detail, pos_bill_template_store_default, pos_bucket_record, pos_bucket_record_detail, pos_bucket_stock, pos_business_data, pos_business_data_detail, pos_cashier_handover, pos_conservation_detail, pos_conservation_record, pos_destory_loss_mode, pos_enter_invalid_detail, pos_integral_convert_money, pos_inventory_detail, pos_inventory_enter_detail, pos_inventory_enter_info, pos_inventory_plan_info, pos_item_pay_detail, pos_loss_destory, pos_no_qd_damaged_detail, pos_no_qd_damaged_info, pos_no_qd_move_record, pos_order_stock_detail, pos_overflow_loss_detail, pos_overflow_loss_info, pos_package_product, pos_prescription_record, pos_product_destroy, pos_product_info, pos_product_info_copy1, pos_product_sale_detail, pos_product_stock, pos_product_stock_temp, pos_product_update_record, pos_purchase_back_detail, pos_purchase_back_goods, pos_purchase_plan_detail, pos_purchase_plan_info, pos_purchase_rejection, pos_purchase_rejection_detail, pos_quality_review_detail, pos_quality_review_record, pos_receive_detail, pos_receive_goods, pos_refund_order, pos_refund_order_detail, pos_refund_stock_detail, pos_retail_order, pos_retail_order_detail, pos_retail_package_pro, pos_scatter_stock, pos_scattered_record, pos_scattered_stock, pos_special_product_detail, pos_special_product_info, pos_special_tube_record, pos_stock_flow_detail, pos_temperature_humidity, pos_transfer_slip, pos_transfer_slip_detail, pos_transfer_slip_out_stock, pos_wait_conservation, pos_wholesale_goods, pos_wholesale_plan_detail, pos_wholesale_plan_info, product_info, productCode, qrtz_calendars, qrtz_job_details, qrtz_locks, qrtz_paused_trigger_grps, qrtz_scheduler_state, receive_temp, retail_team, Sheet1, stock_init, stock_price, stock_test, sys_api_access_record, sys_app, sys_button, sys_company, sys_department, sys_fn_btn_rel, sys_function, sys_log, sys_role, sys_role_pwoer_fn, sys_role_pwoer_fn_audit, sys_user_login_record, sys_users, tementiaojia, test_jinheyuan, xlyb, xxl_job_group, xxl_job_info, xxl_job_lock, xxl_job_log, xxl_job_logglue, xxl_job_registry, xxl_job_user"; + String tableArry[] = StringUtils.stringToArray(tables,","); + for(String table : tableArry) { + + System.out.println("开始处理====》" + table); + } + } } diff --git a/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignAwardSetAction.java b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignAwardSetAction.java new file mode 100644 index 0000000..6caec1a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignAwardSetAction.java @@ -0,0 +1,571 @@ +package com.matrix.system.activity.action; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.activity.dao.ActivitySignAwardSetDao; +import com.matrix.system.activity.dto.*; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import com.matrix.system.activity.service.ActivitySignAwardSetService; +import com.matrix.system.activity.vo.*; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.shopXcx.bean.ShopActivities; +import com.matrix.system.shopXcx.dao.ShopActivitiesDao; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +/** + * @description 奖品设置表 + * @author yourName + * @date 2021-03-31 16:57 + */ +@RestController +@RequestMapping(value = "admin/activitySignAwardSet") +public class ActivitySignAwardSetAction { + + @Autowired + private ActivitySignAwardSetService activitySignAwardSetService; + @Autowired + private ShopActivitiesDao shopActivitiesDao; + @Autowired + private ActivitySignAwardSetDao activitySignAwardSetDao; + + /** + * 马上创建转盘抽奖 + */ + @PostMapping(value = "/createLuckyDrawSet") + public @ResponseBody + AjaxResult createLuckyDrawSet() { + //获取当前登录人员信息 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + //签到活动的唯一性 + List<ShopActivities> shopActivitiesDone = shopActivitiesDao.selectOneByCompanyIdAndActType(companyId,ShopActivities.ACTIVITIES_TYPE_LUCKYDRAW); + if(CollUtil.isNotEmpty(shopActivitiesDone)){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "转盘抽奖已经创建,请去活动管理菜单查看"); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, ""); + } + + /** + * 新增转盘抽奖 + */ + @PostMapping(value = "/addLuckyDrawSet") + public @ResponseBody + AjaxResult addLuckyDrawSet(@RequestBody AddLuckyDrawSetDto addLuckyDrawSetDto) { + //获取当前登录人员信息 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + //转盘抽奖活动的唯一性 + List<ShopActivities> shopActivitiesDone = shopActivitiesDao.selectOneByCompanyIdAndActType(companyId,ShopActivities.ACTIVITIES_TYPE_LUCKYDRAW); + if(CollUtil.isNotEmpty(shopActivitiesDone)){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "转盘抽奖只能创建一次"); + } + + //新增活动主表信息 + ShopActivities shopActivities = new ShopActivities(); + shopActivities.setActName(addLuckyDrawSetDto.getActName()); + shopActivities.setActCode(addLuckyDrawSetDto.getActCode()); + shopActivities.setIsStart(ShopActivities.ACTIVITIES_STATUS_CLOSE); + shopActivities.setActType(ShopActivities.ACTIVITIES_TYPE_LUCKYDRAW); + shopActivities.setActStatus(ShopActivities.ACTSTATUS_STATUS_RELEASE); + shopActivities.setActBeginTime(addLuckyDrawSetDto.getBeginTime()); + shopActivities.setActEndTime(addLuckyDrawSetDto.getEndTime()); + shopActivities.setCompanyId(companyId); + shopActivities.setCreateBy(user.getSuName()); + shopActivities.setUpdateBy(user.getSuName()); + //将基本信息转换成JSON字符串存储到活动主表的act_content字段 + LuckyDrawBasicJsonDto luckyDrawBasicJsonDto = addLuckyDrawSetDto.getLuckyDrawBasicJsonDto(); + String json= JSON.toJSONString(luckyDrawBasicJsonDto); + shopActivities.setActContent(json); + int insert = shopActivitiesDao.insert(shopActivities); + if(insert > 0){ + //新增活动奖品信息 + List<ActivitySignAwardSet> activitySignAwardSets = addLuckyDrawSetDto.getLuckyDrawAwardSets(); + if(CollUtil.isNotEmpty(activitySignAwardSets)) { + for(ActivitySignAwardSet activitySignAwardSet : activitySignAwardSets) { + activitySignAwardSet.setCreateBy(user.getSuName()); + activitySignAwardSet.setCreateTime(new Date()); + activitySignAwardSet.setUpdateTime(new Date()); + activitySignAwardSet.setUpdateBy(user.getSuName()); + activitySignAwardSet.setCompanyId(companyId); + activitySignAwardSet.setActivityId(shopActivities.getId()); + activitySignAwardSet.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); + activitySignAwardSetDao.insert(activitySignAwardSet); + } + //生成中奖顺序 + + Long actId = shopActivities.getId(); + List<ActivitySignAwardSet> activitySignAwardSetList = activitySignAwardSetDao + .selectActivitySignAwardSetByActIDAndCompanyIdAndAwardType(actId, companyId, ActivitySignAwardSet.AWARDSTATE_WORK,ActivitySignAwardSet.AWARDRULE_CUMULATIVEDAY); + if(CollUtil.isNotEmpty(activitySignAwardSetList)){ + String awrdList = getAwrdList(activitySignAwardSets).toString(); + ShopActivities shopActivitiesAward = shopActivitiesDao.selectById(actId); + String actContent = shopActivitiesAward.getActContent(); + LuckyDrawAwardCodeListVo luckyDrawAwardCodeListVo = JSON.parseObject(actContent, LuckyDrawAwardCodeListVo.class); + luckyDrawAwardCodeListVo.setAwardLine(awrdList); + luckyDrawAwardCodeListVo.setAwrdLineIndex(0); + String awardJson= JSON.toJSONString(luckyDrawAwardCodeListVo); + shopActivitiesAward.setActContent(awardJson); + shopActivitiesDao.updateByModel(shopActivitiesAward); + } + } + }else{ + return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); + } + + //所有奖品ID后的集合 + public List getAwrdList(List<ActivitySignAwardSet> activitySignAwardSets){ + //插入所有奖品ID后的集合 + LinkedList awardIdFinalList = new LinkedList<>(); + if(CollUtil.isNotEmpty(activitySignAwardSets)){ + //总数 + int maxCount = 0; + HashMap<Long, ActivitySignAwardSet> integerStringHashMap = new HashMap<>(); + for(ActivitySignAwardSet activitySignAwardSet : activitySignAwardSets){ + //总共派发数量 + int awardInventoryCnt = activitySignAwardSet.getAwardInventoryCnt(); + integerStringHashMap.put(activitySignAwardSet.getId(),activitySignAwardSet); + maxCount = maxCount + awardInventoryCnt; + } + HashMap<Long, ActivitySignAwardSet> sortHashMap = sortHashMap(integerStringHashMap,2); + HashMap<Long, ActivitySignAwardSet> sortHashMapAec = sortHashMap(integerStringHashMap,1); + //获取奖品最多的ID + Long maxAwardIds = sortHashMap.keySet().stream().findFirst().get(); + Long minAwardIds = sortHashMapAec.keySet().stream().findFirst().get(); + //获取最大长度的奖品集合 + List awardIdList = new LinkedList<Long>(); + for(int i = 0; i< maxCount ; i++){ + awardIdList.add(maxAwardIds); + } + + Iterator<Map.Entry<Long, ActivitySignAwardSet>> entries = sortHashMap.entrySet().iterator(); + //插入奖品 + while (entries.hasNext()) { + Map.Entry<Long, ActivitySignAwardSet> entry = entries.next(); + ActivitySignAwardSet activitySignAwardSetDone = entry.getValue(); + int awardInventoryCnt = activitySignAwardSetDone.getAwardInventoryCnt(); + Long awardIdNew = entry.getKey(); + if(awardIdNew != maxAwardIds){ + //分段之后的List + List splitLists = getSplitList(awardInventoryCnt, awardIdList); + for(int j = 0; j<awardInventoryCnt; j++){ + List splitList = (List) splitLists.get(j); + //中间插入对应的奖品ID,如果和maxAwardIds相同,则索引+1 + List<Long> listInsert = getListInsert(maxAwardIds, awardIdNew, splitList); + if(minAwardIds == awardIdNew){ + awardIdFinalList.addAll(listInsert); + } + } + } + } + } + return awardIdFinalList; + } + + //中间插入对应的奖品ID,如果和maxAwardIds相同,则索引+1 + public static List<Long> getListInsert(Long awardOld,Long awardNew,List splitList){ + //中间位置索引 + LinkedList<Integer> indexs = new LinkedList<>(); + int groupFlag = splitList.size() % 2 == 0 ? (splitList.size() / 2) : (splitList.size() / 2 + 1); + for(int j = groupFlag-1; j < splitList.size();j++){ + if(splitList.get(j) == awardOld){ + indexs.add(j); + } + } + if(CollUtil.isNotEmpty(indexs)){ + splitList.set(indexs.get(0),awardNew); + }else{ + splitList.add(groupFlag,awardNew); + } + return splitList; + } + + //等份平分数组,最后剩余的添加到倒数第二个集合中 + public static List<List<Long>> getSplitList(int splitNum, List<Long> list) { + LinkedList<List<Long>> splitList = new LinkedList<>(); + // groupFlag >= 1 + int groupFlag = list.size() % splitNum == 0 ? (list.size() / splitNum) : (list.size() / splitNum); + if(groupFlag * splitNum < list.size()){ + for (int j = 1; j <= splitNum +1; j++) { + if ((j * groupFlag) <= list.size() ) { + splitList.add(list.subList(j * groupFlag - groupFlag, j * groupFlag)); + } else if ((j * groupFlag) > list.size()) { + splitList.add(list.subList(j * groupFlag - groupFlag, list.size())); + } + } + }else if(groupFlag * splitNum > list.size()){ + for (int j = 1; j < splitNum; j++) { + if ((j * groupFlag) <= list.size() ) { + splitList.add(list.subList(j * groupFlag - groupFlag, j * groupFlag)); + } else if ((j * groupFlag) > list.size()) { + splitList.add(list.subList(j * groupFlag - groupFlag, list.size())); + } + } + }else{ + for (int j = 1; j <= splitNum; j++) { + if ((j * groupFlag) <= list.size() ) { + splitList.add(list.subList(j * groupFlag - groupFlag, j * groupFlag)); + } else if ((j * groupFlag) > list.size()) { + splitList.add(list.subList(j * groupFlag - groupFlag, list.size())); + } + } + } + return splitList; + } + + + //对于奖品排序 1:升序进行排,2是倒序就是o2-o1 + public static HashMap<Long, ActivitySignAwardSet> sortHashMap(HashMap<Long, ActivitySignAwardSet> map,int type) { + // 首先拿到 map 的键值对集合 + Set<Map.Entry<Long, ActivitySignAwardSet>> entrySet = map.entrySet(); + // 将 set 集合转为 List 集合,为什么,为了使用工具类的排序方法 + List<Map.Entry<Long, ActivitySignAwardSet>> list = new ArrayList<Map.Entry<Long, ActivitySignAwardSet>>(entrySet); + // 使用 Collections 集合工具类对 list 进行排序,排序规则使用匿名内部类来实现 + Collections.sort(list, new Comparator<Map.Entry<Long, ActivitySignAwardSet>>() { + @Override + public int compare(Map.Entry<Long, ActivitySignAwardSet> o1, Map.Entry<Long, ActivitySignAwardSet> o2) { + if(type == 2){ + //按照要求根据 升序进行排,如果是倒序就是o2-o1 + return o2.getValue().getAwardInventoryCnt() - o1.getValue().getAwardInventoryCnt(); + } + return o1.getValue().getAwardInventoryCnt() - o2.getValue().getAwardInventoryCnt(); + } + }); + //创建一个新的有序的 HashMap 子类的集合 + LinkedHashMap<Long, ActivitySignAwardSet> linkedHashMap = new LinkedHashMap<Long, ActivitySignAwardSet>(); + //将 List 中的数据存储在 LinkedHashMap 中 + for (Map.Entry<Long, ActivitySignAwardSet> entry : list) { + linkedHashMap.put(entry.getKey(), entry.getValue()); + } + //返回结果 + return linkedHashMap; + } + + /** + *进入修改 + */ + @ApiOperation(value = "进入修改") + @PostMapping(value = "/findLuckyDrawForUpdate") + public @ResponseBody + AjaxResult findLuckyDrawForUpdate(@RequestBody LuckyDrawForUpdateDto luckyDrawForUpdateDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(luckyDrawForUpdateDto); + Long actId = luckyDrawForUpdateDto.getActId(); + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + //获取对应的活动主表信息和对应的奖品设置信息 + AddLuckyDrawSetVo addLuckyDrawSetVo = new AddLuckyDrawSetVo(); + ShopActivities shopActivity = shopActivitiesDao.selectById(actId); + if(ObjectUtil.isNotEmpty(shopActivity)) { + addLuckyDrawSetVo.setId(actId); + addLuckyDrawSetVo.setActName(shopActivity.getActName()); + addLuckyDrawSetVo.setActCode(shopActivity.getActCode()); + addLuckyDrawSetVo.setBeginTime(shopActivity.getActBeginTime()); + addLuckyDrawSetVo.setEndTime(shopActivity.getActEndTime()); + + String actContent = shopActivity.getActContent(); + LuckyDrawBasicJsonVo luckyDrawBasicJsonVo = JSON.parseObject(actContent, LuckyDrawBasicJsonVo.class); + addLuckyDrawSetVo.setLuckyDrawBasicJsonVo(luckyDrawBasicJsonVo); + + Map<String, Object> columnMap = new HashMap<String, Object>(); + columnMap.put("activity_id", actId); + columnMap.put("company_id", luckyDrawForUpdateDto.getCompanyId()); + List<ActivitySignAwardSet> activityAwardSets = activitySignAwardSetDao.selectByMap(columnMap); + addLuckyDrawSetVo.setActivityluckyDrawSets(activityAwardSets); + } + result.putInMap("addLuckyDrawSetVo", addLuckyDrawSetVo); + return result; + } + /** + * 保存 + */ + @PostMapping(value = "/updateLuckyDrawSet") + public @ResponseBody + AjaxResult updateLuckyDrawSet(@RequestBody UpdateLuckyDrawSetDto updateLuckyDrawSetDto) { + //获取当前登录人员信息 + QueryUtil.setQueryLimitCom(updateLuckyDrawSetDto); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long actId = updateLuckyDrawSetDto.getActMainId(); + Long companyId = user.getCompanyId(); + ShopActivities shopActivity = shopActivitiesDao.selectById(actId); + //更新活动主表信息 + shopActivity.setActName(updateLuckyDrawSetDto.getActName()); + shopActivity.setActCode(updateLuckyDrawSetDto.getActCode()); + shopActivity.setActBeginTime(updateLuckyDrawSetDto.getBeginTime()); + shopActivity.setActEndTime(updateLuckyDrawSetDto.getEndTime()); + shopActivity.setCompanyId(companyId); + shopActivity.setCreateBy(user.getSuName()); + shopActivity.setUpdateBy(user.getSuName()); + //将基本信息转换成JSON字符串存储到活动主表的act_content字段 + LuckyDrawBasicJsonDto luckyDrawBasicJsonDto = updateLuckyDrawSetDto.getLuckyDrawBasicJsonDto(); + String json=JSON.toJSONString(luckyDrawBasicJsonDto); + shopActivity.setActContent(json); + shopActivitiesDao.updateByModel(shopActivity); + /** + * 比较两个奖品名单,多的新增,减少的更新为已失效,不变的更新 + */ + //原有的奖品 + ArrayList<Long> arrayListOld = new ArrayList<>(); + Map<String, Object> columnMap = new HashMap<String, Object>(); + columnMap.put("activity_id", actId); + columnMap.put("company_id", updateLuckyDrawSetDto.getCompanyId()); + List<ActivitySignAwardSet> activitySignAwardSetOld = activitySignAwardSetDao.selectByMap(columnMap); + if(CollUtil.isNotEmpty(activitySignAwardSetOld)) { + for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetOld) { + Long actSubid = activitySignAwardSetUpdate.getId(); + arrayListOld.add(actSubid); + } + } + //修改后的奖品 + List<ActivitySignAwardSet> activitySignAwardSetsUpdate = updateLuckyDrawSetDto.getActivityAwardSets(); + ArrayList<Long> arrayListUpdate = new ArrayList<>(); + if(CollUtil.isNotEmpty(activitySignAwardSetsUpdate)) { + for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetsUpdate) { + Long actSubid = activitySignAwardSetUpdate.getId(); + //如果ID为空则新增,不为空则修改 + if(ObjectUtil.isEmpty(actSubid)) { + activitySignAwardSetUpdate.setCreateBy(user.getSuName()); + activitySignAwardSetUpdate.setCreateTime(new Date()); + activitySignAwardSetUpdate.setUpdateTime(new Date()); + activitySignAwardSetUpdate.setUpdateBy(user.getSuName()); + activitySignAwardSetUpdate.setCompanyId(companyId); + activitySignAwardSetUpdate.setActivityId(actId); + activitySignAwardSetUpdate.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); + activitySignAwardSetDao.insert(activitySignAwardSetUpdate); + }else { + activitySignAwardSetUpdate.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); + activitySignAwardSetDao.updateById(activitySignAwardSetUpdate); + arrayListUpdate.add(actSubid); + } + } + } + //比较获取原来的比现在多出来的奖品,修改状态为失效 + boolean removeAll = arrayListOld.removeAll(arrayListUpdate); + if(removeAll && CollUtil.isNotEmpty(arrayListOld)) { + for(long id : arrayListOld) { + ActivitySignAwardSet activitySignAwardSetDel = activitySignAwardSetDao.selectById(id); + activitySignAwardSetDel.setAwardState(ActivitySignAwardSet.AWARDSTATE_UNWORK); + activitySignAwardSetDao.updateById(activitySignAwardSetDel); + } + } + + //生成中奖顺序 + List<ActivitySignAwardSet> activitySignAwardSetList = activitySignAwardSetDao + .selectActivitySignAwardSetByActIDAndCompanyIdAndAwardType(actId, companyId, ActivitySignAwardSet.AWARDSTATE_WORK,ActivitySignAwardSet.AWARDRULE_CUMULATIVEDAY); + if(CollUtil.isNotEmpty(activitySignAwardSetList)){ + String awrdList = getAwrdList(activitySignAwardSetList).toString(); + ShopActivities shopActivitiesAward = shopActivitiesDao.selectById(actId); + String actContent = shopActivitiesAward.getActContent(); + LuckyDrawAwardCodeListVo luckyDrawAwardCodeListVo = JSON.parseObject(actContent, LuckyDrawAwardCodeListVo.class); + luckyDrawAwardCodeListVo.setAwardLine(awrdList); + luckyDrawAwardCodeListVo.setAwrdLineIndex(0); + String awardJson= JSON.toJSONString(luckyDrawAwardCodeListVo); + shopActivitiesAward.setActContent(awardJson); + shopActivitiesDao.updateByModel(shopActivitiesAward); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); + } + + public IPage<ActivitiesListVo> findActivitiesList(Page<ActivitiesListVo> page, + ActivitiesListDto activitiesListDto) { + return shopActivitiesDao.findActivitiesList(page,activitiesListDto); + } + + /** + * 马上创建签到活动 + */ + @PostMapping(value = "/createSignAwardSet") + public @ResponseBody + AjaxResult createSignAwardSet() { + //获取当前登录人员信息 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + //签到活动的唯一性 + List<ShopActivities> shopActivitiesDone = shopActivitiesDao.selectOneByCompanyIdAndActType(companyId,ShopActivities.ACTIVITIES_TYPE_SIGN); + if(CollUtil.isNotEmpty(shopActivitiesDone)){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "签到活动已经创建,请去活动管理菜单查看"); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, ""); + } + + /** + * 新增签到活动 + */ + @PostMapping(value = "/addSignAwardSet") + public @ResponseBody + AjaxResult addSignAwardSet(@RequestBody AddSignAwardSetDto addSignAwardSetDto) { + return activitySignAwardSetService.activitySignAwardSetService(addSignAwardSetDto); + } + + /** + * 查询优惠券 + */ + @ApiOperation(value = "查询优惠券") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = CouponVo.class) + }) + @PostMapping(value = "/selectCouponList") + public @ResponseBody + AjaxResult selectCouponList(@RequestBody CouponDto couponDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(couponDto); + //排序 + if(StringUtils.isBlank(couponDto.getSort())){ + couponDto.setSort("create_time"); + couponDto.setOrder("desc"); + } + Page<CouponVo> page = new Page(couponDto.getPageNum(), couponDto.getPageSize()); + IPage<CouponVo> rows = activitySignAwardSetService.selectCouponList(page,couponDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + * 查询商品 + */ + @ApiOperation(value = "查询商品") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = GoodsVo.class) + }) + @PostMapping(value = "/selectGoodsList") + public @ResponseBody + AjaxResult selectGoodsList(@RequestBody GoodsDto goodsDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(goodsDto); + //排序 + if(StringUtils.isBlank(goodsDto.getSort())){ + goodsDto.setSort("create_time"); + goodsDto.setOrder("desc"); + } + Page<GoodsVo> page = new Page(goodsDto.getPageNum(), goodsDto.getPageSize()); + IPage<GoodsVo> rows = activitySignAwardSetService.selectGoodsList(page,goodsDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + * 查询活动列表 + */ + @ApiOperation(value = "查询活动列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ActivitiesListVo.class) + }) + @PostMapping(value = "/findActivitiesList") + public @ResponseBody + AjaxResult findActivitiesList(@RequestBody ActivitiesListDto activitiesListDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(activitiesListDto); + //排序 + if(StringUtils.isBlank(activitiesListDto.getSort())){ + activitiesListDto.setSort("create_time"); + activitiesListDto.setOrder("desc"); + } + Page<ActivitiesListVo> page = new Page(activitiesListDto.getPageNum(), activitiesListDto.getPageSize()); + IPage<ActivitiesListVo> rows = activitySignAwardSetService.findActivitiesList(page,activitiesListDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + *发布 + */ + @ApiOperation(value = "发布") + @PostMapping(value = "/beReady") + public @ResponseBody + AjaxResult beReady(@RequestBody BeReadyDto beReadyDto) { + return activitySignAwardSetService.beReady(beReadyDto); + } + + /** + *删除 + */ + @ApiOperation(value = "删除") + @PostMapping(value = "/delRow") + public @ResponseBody + AjaxResult delRow(@RequestBody DelRowDto delRowDto) { + return activitySignAwardSetService.delRow(delRowDto); + } + + /** + *关闭 + */ + @ApiOperation(value = "关闭") + @PostMapping(value = "/beClose") + public @ResponseBody + AjaxResult beClose(@RequestBody BeCloseDto beCloseDto) { + return activitySignAwardSetService.beClose(beCloseDto); + } + + /** + * 活动统计 + */ + @ApiOperation(value = "活动统计") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = SignReceiveListVo.class) + }) + @PostMapping(value = "/findSignReceiveList") + public @ResponseBody + AjaxResult findSignReceiveList(@RequestBody SignReceiveListDto signReceiveListDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(signReceiveListDto); + //排序 + if(StringUtils.isBlank(signReceiveListDto.getSort())){ + signReceiveListDto.setSort("create_time"); + signReceiveListDto.setOrder("desc"); + } + Page<SignReceiveListVo> page = new Page(signReceiveListDto.getPageNum(), signReceiveListDto.getPageSize()); + IPage<SignReceiveListVo> rows = activitySignAwardSetService.findSignReceiveList(page,signReceiveListDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + *进入修改 + */ + @ApiOperation(value = "进入修改") + @PostMapping(value = "/findSignForUpdate") + public @ResponseBody + AjaxResult findSignForUpdate(@RequestBody SignForUpdateDto signForUpdateDto) { + return activitySignAwardSetService.findSignForUpdate(signForUpdateDto); + } + + /** + * 保存 + */ + @PostMapping(value = "/updateSignAwardSet") + public @ResponseBody + AjaxResult updateSignAwardSet(@RequestBody UpdateSignAwardSetDto updateSignAwardSetDto) { + return activitySignAwardSetService.updateSignAwardSet(updateSignAwardSetDto); + } + + + + + + + + + + + + + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignReceiveRecordAction.java b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignReceiveRecordAction.java new file mode 100644 index 0000000..ca94f53 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignReceiveRecordAction.java @@ -0,0 +1,21 @@ +package com.matrix.system.activity.action; +import com.matrix.system.activity.service.ActivitySignReceiveRecordService; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @description 领取记录表 + * @author yourName + * @date 2021-03-31 16:57 + */ +@RestController +@RequestMapping(value = "admin/activitySignReceiveRecord") +public class ActivitySignReceiveRecordAction { + + @Autowired + private ActivitySignReceiveRecordService activitySignReceiveRecordService; + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignRecordAction.java b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignRecordAction.java new file mode 100644 index 0000000..4a3b7a6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignRecordAction.java @@ -0,0 +1,22 @@ +package com.matrix.system.activity.action; + +import com.matrix.system.activity.service.ActivitySignRecordService; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @description 签到记录表 + * @author yourName + * @date 2021-03-31 16:57 + */ +@RestController +@RequestMapping(value = "admin/activitySignRecord") +public class ActivitySignRecordAction { + + @Autowired + private ActivitySignRecordService activitySignRecordService; + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignWriteoffAction.java b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignWriteoffAction.java new file mode 100644 index 0000000..7d5db67 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/action/ActivitySignWriteoffAction.java @@ -0,0 +1,85 @@ +package com.matrix.system.activity.action; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.activity.dto.LogisticsSubmitDto; +import com.matrix.system.activity.dto.SignWriteoffDto; +import com.matrix.system.activity.dto.SignWriteoffListDto; +import com.matrix.system.activity.dto.WriteoffCodeSubmitDto; +import com.matrix.system.activity.service.ActivitySignWriteoffService; +import com.matrix.system.activity.vo.SignWriteoffListVo; +import com.matrix.system.hive.action.util.QueryUtil; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +/** + * @description 核销记录 + * @author yourName + * @date 2021-04-08 14:25 + */ +@RestController +@RequestMapping(value = "admin/activitySignWriteoff") +public class ActivitySignWriteoffAction { + + @Autowired + private ActivitySignWriteoffService activitySignWriteoffService; + + /** + * 核销记录 + */ + @ApiOperation(value = "核销记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = SignWriteoffListVo.class) + }) + @PostMapping(value = "/findSignWriteoffList") + public @ResponseBody + AjaxResult findSignWriteoffList(@RequestBody SignWriteoffListDto signWriteoffListDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(signWriteoffListDto); + //排序 + if(StringUtils.isBlank(signWriteoffListDto.getSort())){ + signWriteoffListDto.setSort("create_time"); + signWriteoffListDto.setOrder("desc"); + } + Page<SignWriteoffListVo> page = new Page(signWriteoffListDto.getPageNum(), signWriteoffListDto.getPageSize()); + IPage<SignWriteoffListVo> rows = activitySignWriteoffService.findSignWriteoffList(page,signWriteoffListDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + *中奖信息 + */ + @ApiOperation(value = "中奖信息") + @PostMapping(value = "/findSignWriteoff") + public @ResponseBody + AjaxResult findSignWriteoff(@RequestBody SignWriteoffDto signWriteoffDto) { + return activitySignWriteoffService.findSignWriteoff(signWriteoffDto); + } + + /** + *核销验证 + */ + @ApiOperation(value = "核销验证") + @PostMapping(value = "/writeoffCodeSubmit") + public @ResponseBody + AjaxResult writeoffCodeSubmit(@RequestBody WriteoffCodeSubmitDto writeoffCodeSubmitDto) { + return activitySignWriteoffService.writeoffCodeSubmit(writeoffCodeSubmitDto); + } + + /** + *物流发货 + */ + @ApiOperation(value = "物流发货") + @PostMapping(value = "/logisticsSubmit") + public @ResponseBody + AjaxResult logisticsSubmit(@RequestBody LogisticsSubmitDto logisticsSubmitDto) { + return activitySignWriteoffService.logisticsSubmit(logisticsSubmitDto); + } + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/constant/ActivitySignConstant.java b/zq-erp/src/main/java/com/matrix/system/activity/constant/ActivitySignConstant.java new file mode 100644 index 0000000..9b5c750 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/constant/ActivitySignConstant.java @@ -0,0 +1,5 @@ +package com.matrix.system.activity.constant; + +public class ActivitySignConstant { + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignAwardSetDao.java b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignAwardSetDao.java new file mode 100644 index 0000000..1061314 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignAwardSetDao.java @@ -0,0 +1,26 @@ +package com.matrix.system.activity.dao; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @description 奖品设置表 + * @author yourName + * @date 2021-03-31 16:57 + */ +public interface ActivitySignAwardSetDao extends BaseMapper<ActivitySignAwardSet>{ + + List<ActivitySignAwardSetVo> selectListByActIDAndCompanyId(@Param("actId")Long actId, @Param("companyId")Long companyId,@Param("awardState")int awardstateWork); + + List<ActivitySignAwardSetVo> selectListByActIDAndCompanyIdAndAwardType(@Param("actId")Long actId, @Param("companyId")Long companyId + ,@Param("awardState")int awardstateWork,@Param("awardRule")int awardRule); + + List<ActivitySignAwardSet> selectActivitySignAwardSetByActIDAndCompanyIdAndAwardType(@Param("actId")Long actId, @Param("companyId")Long companyId + ,@Param("awardState")int awardstateWork,@Param("awardRule")int awardRule); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignReceiveRecordDao.java b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignReceiveRecordDao.java new file mode 100644 index 0000000..2c395a8 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignReceiveRecordDao.java @@ -0,0 +1,41 @@ +package com.matrix.system.activity.dao; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.activity.dto.CouponDto; +import com.matrix.system.activity.dto.GoodsDto; +import com.matrix.system.activity.dto.SignReceiveListDto; +import com.matrix.system.activity.entity.ActivitySignReceiveRecord; +import com.matrix.system.activity.vo.CouponVo; +import com.matrix.system.activity.vo.GoodsVo; +import com.matrix.system.activity.vo.SignReceiveListVo; +import com.matrix.system.shopXcx.api.dto.SeeAwardTextDto; +import com.matrix.system.shopXcx.api.dto.SignAwardDto; +import com.matrix.system.shopXcx.api.vo.SeeAwardTextVo; +import com.matrix.system.shopXcx.api.vo.SignAwardListVo; +import com.matrix.system.shopXcx.vo.SalesOrderVo; + +import org.apache.ibatis.annotations.Param; + +/** + * @author yourName + * @date 2021-03-31 16:57 + */ +public interface ActivitySignReceiveRecordDao extends BaseMapper<ActivitySignReceiveRecord>{ + + IPage<SignReceiveListVo> findSignReceiveList(Page<SignReceiveListVo> page, + @Param("record")SignReceiveListDto signReceiveListDto); + + IPage<CouponVo> selectCouponList(Page<CouponVo> page, @Param("record")CouponDto couponDto); + + IPage<GoodsVo> selectGoodsList(Page<GoodsVo> page, @Param("record")GoodsDto goodsDto); + + int getSignAwardReceiveCount(@Param("userId")Long userId, @Param("companyId")Long companyId); + + IPage<SignAwardListVo> selectSignAwardList(Page<SalesOrderVo> page, @Param("record")SignAwardDto signAwardDto); + + SeeAwardTextVo selectSeeAwardTextVOById(@Param("record")SeeAwardTextDto seeAwardTextDto); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignRecordDao.java b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignRecordDao.java new file mode 100644 index 0000000..b7c5eb1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignRecordDao.java @@ -0,0 +1,27 @@ +package com.matrix.system.activity.dao; + + +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.activity.entity.ActivitySignRecord; +import com.matrix.system.shopXcx.api.vo.ActivitySignRecordVo; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @description 签到记录表 + * @author yourName + * @date 2021-03-31 16:57 + */ +public interface ActivitySignRecordDao extends BaseMapper<ActivitySignRecord>{ + + ActivitySignRecord selectOneByActIdAndUserIdLikesignTime(@Param("actId")long actId, + @Param("userId")Long userId, @Param("format")Date format); + + List<ActivitySignRecordVo> selectRecordByMonth(@Param("actId")Long actId, @Param("userId")Long userId, @Param("date") DateTime date); + + List<ActivitySignRecord> selectListByActIdAndUserIdLikesignTime(@Param("actId")long actId, + @Param("userId")Long userId, @Param("format")Date format); +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignWriteoffDao.java b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignWriteoffDao.java new file mode 100644 index 0000000..2e1477b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dao/ActivitySignWriteoffDao.java @@ -0,0 +1,30 @@ +package com.matrix.system.activity.dao; + + +import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; +import org.apache.ibatis.annotations.Param; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.activity.dto.SignWriteoffListDto; +import com.matrix.system.activity.entity.ActivitySignWriteoff; +import com.matrix.system.activity.vo.SignWriteoffListVo; +import com.matrix.system.activity.vo.ZjrVo; + +/** + * @description 核销记录 + * @author yourName + * @date 2021-04-08 14:25 + */ +public interface ActivitySignWriteoffDao extends BaseMapper<ActivitySignWriteoff>{ + + IPage<SignWriteoffListVo> findSignWriteoffList(Page<SignWriteoffListVo> page, + @Param("record")SignWriteoffListDto signWriteoffListDto); + + ZjrVo selectUsernameByUserId(@Param("userId")Long userId, @Param("receiveId")Long receiveId); + + ShopDeliveryInfo selectShopDeliveryInfoByLogisticsId(@Param("logisticsId")Integer logisticsId); + + ActivitySignWriteoff selectActivitySignWriteoffByUserIDAndReceiveId(@Param("userId")Long userId, @Param("receiveId")long receiveId); +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/ActivitiesListDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/ActivitiesListDto.java new file mode 100644 index 0000000..011454f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/ActivitiesListDto.java @@ -0,0 +1,22 @@ +package com.matrix.system.activity.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ActivitiesListDto", description = "查询参数") +public class ActivitiesListDto extends BasePageQueryDto { + + @ApiModelProperty(value ="活动名称") + private String hdmc; + + @ApiModelProperty(value ="活动状态") + private Integer hdzt; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/AddLuckyDrawSetDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/AddLuckyDrawSetDto.java new file mode 100644 index 0000000..b559a2c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/AddLuckyDrawSetDto.java @@ -0,0 +1,28 @@ +package com.matrix.system.activity.dto; + +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "AddLuckyDrawSetDto", description = "查询参数") +public class AddLuckyDrawSetDto { + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + private Date endTime; + + private LuckyDrawBasicJsonDto luckyDrawBasicJsonDto; + + private List<ActivitySignAwardSet> luckyDrawAwardSets; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/AddSignAwardSetDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/AddSignAwardSetDto.java new file mode 100644 index 0000000..ff857c6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/AddSignAwardSetDto.java @@ -0,0 +1,28 @@ +package com.matrix.system.activity.dto; + +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "AddSignAwardSetDto", description = "查询参数") +public class AddSignAwardSetDto { + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + private Date endTime; + + private SignSetBasicJsonDto signSetBasicJsonDto; + + private List<ActivitySignAwardSet> activitySignAwardSets; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/BeCloseDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/BeCloseDto.java new file mode 100644 index 0000000..ccc0919 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/BeCloseDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "BeCloseDto", description = "参数") +public class BeCloseDto { + + @ApiModelProperty(value ="活动主表ID") + private Long actId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/BeReadyDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/BeReadyDto.java new file mode 100644 index 0000000..03b3586 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/BeReadyDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "BeReadyDto", description = "参数") +public class BeReadyDto { + + @ApiModelProperty(value ="活动主表ID") + private Long actId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/CouponDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/CouponDto.java new file mode 100644 index 0000000..b6a9a40 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/CouponDto.java @@ -0,0 +1,19 @@ +package com.matrix.system.activity.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "CouponDto", description = "查询参数") +public class CouponDto extends BasePageQueryDto { + + @ApiModelProperty(value ="活动名称") + private String yhjmc; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/DelRowDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/DelRowDto.java new file mode 100644 index 0000000..6c13eef --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/DelRowDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "DelRowDto", description = "参数") +public class DelRowDto { + + @ApiModelProperty(value ="活动主表ID") + private Long actId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/GoodsDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/GoodsDto.java new file mode 100644 index 0000000..dc72283 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/GoodsDto.java @@ -0,0 +1,19 @@ +package com.matrix.system.activity.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "GoodsDto", description = "查询参数") +public class GoodsDto extends BasePageQueryDto { + + @ApiModelProperty(value ="商品名称") + private String cpmc; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/LogisticsSubmitDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/LogisticsSubmitDto.java new file mode 100644 index 0000000..47d3db1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/LogisticsSubmitDto.java @@ -0,0 +1,28 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LogisticsSubmitDto", description = "查询参数") +public class LogisticsSubmitDto { + + @ApiModelProperty(value ="核销ID") + private long writeoffId; + + @ApiModelProperty(value ="收货人") + private String shr; + @ApiModelProperty(value ="联系电话") + private String lxdh; + @ApiModelProperty(value ="收货地址") + private String shdz; + @ApiModelProperty(value ="快递公司Code") + private String kdgs; + @ApiModelProperty(value ="快递单号") + private String kddh; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawBasicJsonDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawBasicJsonDto.java new file mode 100644 index 0000000..f1ba92d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawBasicJsonDto.java @@ -0,0 +1,53 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LuckyDrawBasicJsonDto", description = "查询参数") +public class LuckyDrawBasicJsonDto { + + @ApiModelProperty(value ="头部图片") + private String imageUrlHead; + @ApiModelProperty(value ="开始按钮") + private String imageUrlTitle; + @ApiModelProperty(value ="转盘背景") + private String imageUrlButton; + @ApiModelProperty(value ="状态图片") + private String imageUrlState; + @ApiModelProperty(value ="奖品划分线") + private String imageLine; + + @ApiModelProperty(value ="规则内容") + private String ruleExplain; + @ApiModelProperty(value ="字体颜色") + private String typographyColor; + @ApiModelProperty(value ="背景颜色") + private String backgroundColor; + @ApiModelProperty(value ="字体大小") + private Integer typographyNum; + @ApiModelProperty(value ="字体透明度") + private Integer typographyLight; + + /** + * 抽奖规则 + */ + //每人每日有10次无门槛抽奖机会 + private Integer wmkcjjh; + //可用积分兑换1次抽奖机会, + private Integer dhycjfs; + // 每日最多兑换 + //10 + //次抽奖机会 + private Integer jfdhcs; + // 每人最多可中奖 + //10 + //次 + private Integer zzjcs; + // 总中奖率 + //10 + //% + private Integer zzjl; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawForUpdateDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawForUpdateDto.java new file mode 100644 index 0000000..1d02334 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/LuckyDrawForUpdateDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LuckyDrawForUpdateDto", description = "参数") +public class LuckyDrawForUpdateDto { + + @ApiModelProperty(value ="活动主表ID") + private Long actId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/SignForUpdateDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignForUpdateDto.java new file mode 100644 index 0000000..ac9680d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignForUpdateDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SignForUpdateDto", description = "参数") +public class SignForUpdateDto { + + @ApiModelProperty(value ="活动主表ID") + private Long actId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/SignReceiveListDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignReceiveListDto.java new file mode 100644 index 0000000..af58abd --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignReceiveListDto.java @@ -0,0 +1,29 @@ +package com.matrix.system.activity.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "SignReceiveListDto", description = "参数") +public class SignReceiveListDto extends BasePageQueryDto { + + @ApiModelProperty(value ="活动编码") + private String yhmc; + + @ApiModelProperty(value ="签到开始时间") + private Date startTime; + + @ApiModelProperty(value ="签到结束时间") + private Date endTime; + + @ApiModelProperty(value ="活动主表ID") + private Long actId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/SignSetBasicJsonDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignSetBasicJsonDto.java new file mode 100644 index 0000000..4d5d4c5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignSetBasicJsonDto.java @@ -0,0 +1,33 @@ +package com.matrix.system.activity.dto; + +import java.util.Date; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SignSetBasicJsonDto", description = "查询参数") +public class SignSetBasicJsonDto { + + @ApiModelProperty(value ="标题图片") + private String imageUrlTitle; + @ApiModelProperty(value ="头部图片") + private String imageUrlHead; + @ApiModelProperty(value ="按钮图片") + private String imageUrlButton; + @ApiModelProperty(value ="状态图片") + private String imageUrlState; + + @ApiModelProperty(value ="规则内容") + private String ruleExplain; + @ApiModelProperty(value ="字体颜色") + private String typographyColor; + @ApiModelProperty(value ="背景颜色") + private String backgroundColor; + @ApiModelProperty(value ="字体大小") + private Integer typographyNum; + @ApiModelProperty(value ="字体透明度") + private Integer typographyLight; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffDto.java new file mode 100644 index 0000000..3c7552a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SignWriteoffDto", description = "查询参数") +public class SignWriteoffDto { + + @ApiModelProperty(value ="核销ID") + private long writeoffId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffListDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffListDto.java new file mode 100644 index 0000000..43b04b2 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/SignWriteoffListDto.java @@ -0,0 +1,21 @@ +package com.matrix.system.activity.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SignWriteoffListDto", description = "查询参数") +public class SignWriteoffListDto extends BasePageQueryDto { + + @ApiModelProperty(value ="中奖者姓名") + private String zjzxm; + + @ApiModelProperty(value ="活动名称/编码") + private String hdmcbm; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateLuckyDrawSetDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateLuckyDrawSetDto.java new file mode 100644 index 0000000..536191a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateLuckyDrawSetDto.java @@ -0,0 +1,34 @@ +package com.matrix.system.activity.dto; + +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "UpdateLuckyDrawSetDto", description = "查询参数") +public class UpdateLuckyDrawSetDto { + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + private Date endTime; + + private LuckyDrawBasicJsonDto luckyDrawBasicJsonDto; + + private List<ActivitySignAwardSet> activityAwardSets; + + @ApiModelProperty(value ="活动主表ID") + private Long actMainId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateSignAwardSetDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateSignAwardSetDto.java new file mode 100644 index 0000000..11ec9f6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateSignAwardSetDto.java @@ -0,0 +1,34 @@ +package com.matrix.system.activity.dto; + +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "UpdateSignAwardSetDto", description = "查询参数") +public class UpdateSignAwardSetDto { + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + private Date endTime; + + private SignSetBasicJsonDto signSetBasicJsonDto; + + private List<ActivitySignAwardSet> activitySignAwardSets; + + @ApiModelProperty(value ="活动主表ID") + private Long actMainId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/dto/WriteoffCodeSubmitDto.java b/zq-erp/src/main/java/com/matrix/system/activity/dto/WriteoffCodeSubmitDto.java new file mode 100644 index 0000000..972be8a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/dto/WriteoffCodeSubmitDto.java @@ -0,0 +1,20 @@ +package com.matrix.system.activity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "WriteoffCodeSubmitDto", description = "查询参数") +public class WriteoffCodeSubmitDto { + + @ApiModelProperty(value ="核销ID") + private long writeoffId; + + @ApiModelProperty(value ="兑奖码") + private String writeOffCode; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignAwardSet.java b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignAwardSet.java new file mode 100644 index 0000000..3d30f87 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignAwardSet.java @@ -0,0 +1,199 @@ +package com.matrix.system.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @description 奖品设置表 + * @author yourName + * @date 2021-03-31 16:57 + */ +@Data +@TableName("activity_sign_award_set") +public class ActivitySignAwardSet extends BaseEntity{ + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) + */ + + @ApiModelProperty(value ="奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)") + private int awardType; + + + public static final int AWARDTYPE_CUSTOMIZE = 1; + public static final int AWARDTYPE_SCORE = 2; + public static final int AWARDTYPE_COUPON = 3; + public static final int AWARDTYPE_GOODS = 4; + + /** + * 奖项规则(1:每日奖励(默认)2:累计签到天数) + */ + + + @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") + private int awardRule; + + public static final int AWARDRULE_NORMAL = 1; + public static final int AWARDRULE_CUMULATIVEDAY = 2; + + /** + * 签到累计天数 + */ + + @ApiModelProperty(value ="签到累计天数") + private int cumulativeDay; + + /** + * 奖项名称 + */ + + @ApiModelProperty(value ="奖项名称") + private String awardName; + + /** + * 图片介绍 + */ + + @ApiModelProperty(value ="图片介绍") + private String introduceImg; + + /** + * 文字介绍 + */ + + + @ApiModelProperty(value ="文字介绍") + private String introduceTip; + + /** + * 奖项库存数量 + */ + + + @ApiModelProperty(value ="奖项库存数量") + private int awardInventoryCnt; + + /** + * 已派发数量 + */ + + + @ApiModelProperty(value ="已派发数量") + private int awardDistributeCnt; + + /** + * 兑奖方式(1:线下兑换2:物流配送3:客服兑换) + */ + + + @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") + private int awardWay; + public static final int AWARDWAY_ONE = 1; + public static final int AWARDWAY_TWO = 2; + public static final int AWARDWAY_THREE = 3; + + /** + * 奖品是否有效(1:有效 2:无效) + */ + @ApiModelProperty(value ="奖品是否有效(1:有效 2:无效)") + private int awardState; + public static final int AWARDSTATE_WORK = 1; + public static final int AWARDSTATE_UNWORK = 2; + + /** + * 操作提示 + */ + + @ApiModelProperty(value ="操作提示") + private String operationTip; + + /** + * 兑奖地址 + */ + + @ApiModelProperty(value ="兑奖地址") + private String prizeAddress; + + /** + * 兑奖期限开始日期 + */ + + + @ApiModelProperty(value ="兑奖期限开始日期") + private Date prizeStartTime; + + /** + * 兑奖期限结束日期 + */ + + @ApiModelProperty(value ="兑奖期限结束日期") + private Date prizeEndTime; + + /** + * 客服微信 + */ + + @ApiModelProperty(value ="客服微信") + private String wechatImg; + @ApiModelProperty(value ="客服电话") + private String customerPhone; + + /** + * 积分数量 + */ + + + @ApiModelProperty(value ="积分数量") + private int scoreCnt; + + /** + * 优惠券ID + */ + + @ApiModelProperty(value ="优惠券") + private String couponName; + + @ApiModelProperty(value ="优惠券ID") + private String couponId; + + /** + * 商品ID + */ + + @ApiModelProperty(value ="商品") + private String goodsName; + + @ApiModelProperty(value ="商品ID") + private String goodsId; + + /** + * 活动主表ID + */ + + + @ApiModelProperty(value ="活动主表ID") + private Long activityId; + + /** + * 公司ID + */ + + + @ApiModelProperty(value ="公司ID") + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java new file mode 100644 index 0000000..07a2563 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java @@ -0,0 +1,103 @@ +package com.matrix.system.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +import java.util.Date; + +/** + * @description 领 + * @author yourName + * @date 2021-03-31 16:57 + */ +@Data +@TableName("activity_sign_receive_record") +public class ActivitySignReceiveRecord extends BaseEntity{ + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * userId + */ + + + private Long userId; + + /** + * 领取时间 + */ + + + private Date receiveTime; + + /** + * 备注 + */ + + + private String remark; + + /** + * 奖品设置表ID + */ + + + private Long awardId; + + /** + * 是否已领取(1:待领取2:已领取 3:待配送 4:待收货 5:已失效) + */ + + + private Integer state; + + public static final int STATE_ING = 1; + public static final int STATE_DONE = 2; + public static final int STATE_THREE = 3; + public static final int STATE_FOUR = 4; + public static final int STATE_FIVE = 5; + + /** + * 核销码 + */ + + + private String writeOffCode; + + /** + * 活动主表ID + */ + + + private Long activityId; + + /** + * 公司ID + */ + + + private Long companyId; + + /** + * 收货人 + */ + private String consignee; + /** + * 联系电话 + */ + private String consigneePhone; + /** + * 收货地址 + */ + private String consigneeAddress; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java new file mode 100644 index 0000000..437d938 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java @@ -0,0 +1,63 @@ +package com.matrix.system.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +import java.util.Date; + +/** + * @description 签到记录表 + * @author yourName + * @date 2021-03-31 16:57 + */ +@Data +@TableName("activity_sign_record") +public class ActivitySignRecord extends BaseEntity{ + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * userId + */ + + + private Long userId; + + /** + * 签到时间 + */ + + + private Date signTime; + + /** + * 累计签到天数 + */ + + + private Integer cumulativeDay; + + /** + * 活动主表ID + */ + + + private Long activityId; + + /** + * 公司ID + */ + + + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignWriteoff.java b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignWriteoff.java new file mode 100644 index 0000000..e4435f5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignWriteoff.java @@ -0,0 +1,120 @@ +package com.matrix.system.activity.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +import java.util.Date; + + +/** + * @description 核销记录 + * @author yourName + * @date 2021-04-08 14:25 + */ +@Data +@TableName("activity_sign_writeoff") +public class ActivitySignWriteoff extends BaseEntity{ + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * 核销时间 + */ + + + private Date writeoffTime; + + /** + * 核销员 + */ + + + private String writeoffUser; + + /** + * 兑奖码 + */ + + + private String writeoffCode; + + /** + * 活动ID + */ + + + private Long actId; + + /** + * 奖品ID + */ + + + private Long awardId; + + /** + * 中奖时间 + */ + + + private Date winTime; + + /** + * 状态(1:待兑换 2:待发货 3:已兑换 4:已失效 ) + */ + private Integer state; + public static final int STATE_ONE = 1; + public static final int STATE_TWO = 2; + public static final int STATE_THREE = 3; + public static final int STATE_FOUR = 4; + + /** + * 中奖者ID + */ + + + private Long userId; + + /** + * 物流ID + */ + + + private Integer logisticsId; + + /** + * 中奖记录ID + */ + + + private Long receiveId; + + /** + * 公司ID + */ + + + private Long companyId; + + /** + * 店铺ID + */ + + + private Long shopId; + + /** + * 核销员ID + */ + + + private Long writeoffUserid; + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignAwardSetService.java b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignAwardSetService.java new file mode 100644 index 0000000..905c4fa --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignAwardSetService.java @@ -0,0 +1,272 @@ +package com.matrix.system.activity.service; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.activity.dao.ActivitySignAwardSetDao; +import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; +import com.matrix.system.activity.dto.*; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import com.matrix.system.activity.vo.ActivitiesListVo; +import com.matrix.system.activity.vo.AddSignAwardSetVo; +import com.matrix.system.activity.vo.CouponVo; +import com.matrix.system.activity.vo.GoodsVo; +import com.matrix.system.activity.vo.SignReceiveListVo; +import com.matrix.system.activity.vo.SignSetBasicJsonVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.shopXcx.bean.ShopActivities; +import com.matrix.system.shopXcx.dao.ShopActivitiesDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @description 奖品设置表 + * @author yourName + * @date 2021-03-31 16:57 + */ +@Service +public class ActivitySignAwardSetService extends ServiceImpl<ActivitySignAwardSetDao, ActivitySignAwardSet>{ + + @Autowired + private ShopActivitiesDao shopActivitiesDao; + @Autowired + private ActivitySignAwardSetDao activitySignAwardSetDao; + @Autowired + private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; + + @Transactional + public AjaxResult activitySignAwardSetService(AddSignAwardSetDto addSignAwardSetDto) { + //获取当前登录人员信息 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + //签到活动的唯一性 + List<ShopActivities> shopActivitiesDone = shopActivitiesDao.selectOneByCompanyIdAndActType(companyId,ShopActivities.ACTIVITIES_TYPE_SIGN); + if(CollUtil.isNotEmpty(shopActivitiesDone)){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "签到活动只能创建一次"); + } + + //新增活动主表信息 + ShopActivities shopActivities = new ShopActivities(); + shopActivities.setActName(addSignAwardSetDto.getActName()); + shopActivities.setActCode(addSignAwardSetDto.getActCode()); + shopActivities.setIsStart(ShopActivities.ACTIVITIES_STATUS_CLOSE); + shopActivities.setActType(ShopActivities.ACTIVITIES_TYPE_SIGN); + shopActivities.setActStatus(ShopActivities.ACTSTATUS_STATUS_RELEASE); + shopActivities.setActBeginTime(addSignAwardSetDto.getBeginTime()); + shopActivities.setActEndTime(addSignAwardSetDto.getEndTime()); + shopActivities.setCompanyId(companyId); + shopActivities.setCreateBy(user.getSuName()); + shopActivities.setUpdateBy(user.getSuName()); + //将基本信息转换成JSON字符串存储到活动主表的act_content字段 + SignSetBasicJsonDto signSetBasicJsonDto = addSignAwardSetDto.getSignSetBasicJsonDto(); + String json=JSON.toJSONString(signSetBasicJsonDto); + shopActivities.setActContent(json); + int insert = shopActivitiesDao.insert(shopActivities); + if(insert > 0){ + //新增活动奖品信息 + List<ActivitySignAwardSet> activitySignAwardSets = addSignAwardSetDto.getActivitySignAwardSets(); + if(CollUtil.isNotEmpty(activitySignAwardSets)) { + for(ActivitySignAwardSet activitySignAwardSet : activitySignAwardSets) { + activitySignAwardSet.setCreateBy(user.getSuName()); + activitySignAwardSet.setCreateTime(new Date()); + activitySignAwardSet.setUpdateTime(new Date()); + activitySignAwardSet.setUpdateBy(user.getSuName()); + activitySignAwardSet.setCompanyId(companyId); + activitySignAwardSet.setActivityId(shopActivities.getId()); + activitySignAwardSet.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); + activitySignAwardSetDao.insert(activitySignAwardSet); + } + } + }else{ + return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); + } + + public IPage<ActivitiesListVo> findActivitiesList(Page<ActivitiesListVo> page, + ActivitiesListDto activitiesListDto) { + return shopActivitiesDao.findActivitiesList(page,activitiesListDto); + } + + @Transactional + public AjaxResult beReady(BeReadyDto beReadyDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(beReadyDto); + Long actId = beReadyDto.getActId(); + ShopActivities shopActivity = shopActivitiesDao.selectById(actId); + if(ObjectUtil.isEmpty(shopActivity)) { + return AjaxResult.buildFailInstance("网络不通畅,请刷新页面"); + } + //未发布状态点击发布,状态变成进行中,且是开启状态 + shopActivity.setActStatus(ShopActivities.ACTSTATUS_STATUS_ING); + shopActivity.setIsStart(ShopActivities.ACTIVITIES_STATUS_OPEN); + shopActivitiesDao.updateByModel(shopActivity); + return AjaxResult.buildSuccessInstance("操作成功"); + } + + public AjaxResult delRow(DelRowDto delRowDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(delRowDto); + Long actId = delRowDto.getActId(); + ShopActivities shopActivity = shopActivitiesDao.selectById(actId); + if(ObjectUtil.isEmpty(shopActivity)) { + return AjaxResult.buildFailInstance("网络不通畅,请刷新页面"); + } + /** + * 删除状态更新状态为已删除,只能查看活动统计 + */ + shopActivity.setActStatus(ShopActivities.ACTSTATUS_STATUS_DEL); + shopActivity.setIsStart(ShopActivities.ACTIVITIES_STATUS_CLOSE); + shopActivitiesDao.updateByModel(shopActivity); + return AjaxResult.buildSuccessInstance("操作成功"); + } + + public AjaxResult beClose(BeCloseDto beCloseDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(beCloseDto); + Long actId = beCloseDto.getActId(); + ShopActivities shopActivity = shopActivitiesDao.selectById(actId); + if(ObjectUtil.isEmpty(shopActivity)) { + return AjaxResult.buildFailInstance("网络不通畅,请刷新页面"); + } + /** + * 关闭状态 + */ + shopActivity.setActStatus(ShopActivities.ACTSTATUS_STATUS_END); + shopActivity.setIsStart(ShopActivities.ACTIVITIES_STATUS_CLOSE); + shopActivitiesDao.updateByModel(shopActivity); + return AjaxResult.buildSuccessInstance("操作成功"); + } + + public IPage<SignReceiveListVo> findSignReceiveList(Page<SignReceiveListVo> page, + SignReceiveListDto signReceiveListDto) { + return activitySignReceiveRecordDao.findSignReceiveList(page,signReceiveListDto); + } + + public AjaxResult findSignForUpdate(SignForUpdateDto signForUpdateDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(signForUpdateDto); + Long actId = signForUpdateDto.getActId(); + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + //获取对应的活动主表信息和对应的奖品设置信息 + AddSignAwardSetVo addSignAwardSetVo = new AddSignAwardSetVo(); + ShopActivities shopActivity = shopActivitiesDao.selectById(actId); + if(ObjectUtil.isNotEmpty(shopActivity)) { + addSignAwardSetVo.setId(actId); + addSignAwardSetVo.setActName(shopActivity.getActName()); + addSignAwardSetVo.setActCode(shopActivity.getActCode()); + addSignAwardSetVo.setBeginTime(shopActivity.getActBeginTime()); + addSignAwardSetVo.setEndTime(shopActivity.getActEndTime()); + + String actContent = shopActivity.getActContent(); + SignSetBasicJsonVo signSetBasicJsonVo = JSON.parseObject(actContent, SignSetBasicJsonVo.class); + addSignAwardSetVo.setSignSetBasicJsonDto(signSetBasicJsonVo); + + Map<String, Object> columnMap = new HashMap<String, Object>(); + columnMap.put("activity_id", actId); + columnMap.put("company_id", signForUpdateDto.getCompanyId()); + List<ActivitySignAwardSet> activitySignAwardSets = activitySignAwardSetDao.selectByMap(columnMap); + addSignAwardSetVo.setActivitySignAwardSets(activitySignAwardSets); + } + result.putInMap("addSignAwardSetVo", addSignAwardSetVo); + return result; + } + + @Transactional + public AjaxResult updateSignAwardSet(UpdateSignAwardSetDto updateSignAwardSetDto) { + //获取当前登录人员信息 + QueryUtil.setQueryLimitCom(updateSignAwardSetDto); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long actId = updateSignAwardSetDto.getActMainId(); + Long companyId = user.getCompanyId(); + ShopActivities shopActivity = shopActivitiesDao.selectById(actId); + //更新活动主表信息 + shopActivity.setActName(updateSignAwardSetDto.getActName()); + shopActivity.setActCode(updateSignAwardSetDto.getActCode()); + shopActivity.setActBeginTime(updateSignAwardSetDto.getBeginTime()); + shopActivity.setActEndTime(updateSignAwardSetDto.getEndTime()); + shopActivity.setCompanyId(companyId); + shopActivity.setCreateBy(user.getSuName()); + shopActivity.setUpdateBy(user.getSuName()); + //将基本信息转换成JSON字符串存储到活动主表的act_content字段 + SignSetBasicJsonDto signSetBasicJsonDto = updateSignAwardSetDto.getSignSetBasicJsonDto(); + String json=JSON.toJSONString(signSetBasicJsonDto); + shopActivity.setActContent(json); + shopActivitiesDao.updateByModel(shopActivity); + /** + * 比较两个奖品名单,多的新增,减少的更新为已失效,不变的更新 + */ + //原有的奖品 + ArrayList<Long> arrayListOld = new ArrayList<>(); + Map<String, Object> columnMap = new HashMap<String, Object>(); + columnMap.put("activity_id", actId); + columnMap.put("company_id", updateSignAwardSetDto.getCompanyId()); + List<ActivitySignAwardSet> activitySignAwardSetOld = activitySignAwardSetDao.selectByMap(columnMap); + if(CollUtil.isNotEmpty(activitySignAwardSetOld)) { + for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetOld) { + Long actSubid = activitySignAwardSetUpdate.getId(); + arrayListOld.add(actSubid); + } + } + //修改后的奖品 + List<ActivitySignAwardSet> activitySignAwardSetsUpdate = updateSignAwardSetDto.getActivitySignAwardSets(); + ArrayList<Long> arrayListUpdate = new ArrayList<>(); + if(CollUtil.isNotEmpty(activitySignAwardSetsUpdate)) { + for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetsUpdate) { + Long actSubid = activitySignAwardSetUpdate.getId(); + //如果ID为空则新增,不为空则修改 + if(ObjectUtil.isEmpty(actSubid)) { + activitySignAwardSetUpdate.setCreateBy(user.getSuName()); + activitySignAwardSetUpdate.setCreateTime(new Date()); + activitySignAwardSetUpdate.setUpdateTime(new Date()); + activitySignAwardSetUpdate.setUpdateBy(user.getSuName()); + activitySignAwardSetUpdate.setCompanyId(companyId); + activitySignAwardSetUpdate.setActivityId(actId); + activitySignAwardSetUpdate.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); + activitySignAwardSetDao.insert(activitySignAwardSetUpdate); + }else { + activitySignAwardSetUpdate.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); + activitySignAwardSetDao.updateById(activitySignAwardSetUpdate); + arrayListUpdate.add(actSubid); + } + } + } + //比较获取原来的比现在多出来的奖品,修改状态为失效 + boolean removeAll = arrayListOld.removeAll(arrayListUpdate); + if(removeAll && CollUtil.isNotEmpty(arrayListOld)) { + for(long id : arrayListOld) { + ActivitySignAwardSet activitySignAwardSetDel = activitySignAwardSetDao.selectById(id); + activitySignAwardSetDel.setAwardState(ActivitySignAwardSet.AWARDSTATE_UNWORK); + activitySignAwardSetDao.updateById(activitySignAwardSetDel); + } + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); + } + + public IPage<CouponVo> selectCouponList(Page<CouponVo> page, CouponDto couponDto) { + return activitySignReceiveRecordDao.selectCouponList(page,couponDto); + } + + public IPage<GoodsVo> selectGoodsList(Page<GoodsVo> page, GoodsDto goodsDto) { + return activitySignReceiveRecordDao.selectGoodsList(page,goodsDto); + } + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignReceiveRecordService.java b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignReceiveRecordService.java new file mode 100644 index 0000000..cb5935c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignReceiveRecordService.java @@ -0,0 +1,22 @@ +package com.matrix.system.activity.service; + + +import org.springframework.stereotype.Service; + +import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; +import com.matrix.system.activity.entity.ActivitySignReceiveRecord; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @description 领 + * @author yourName + * @date 2021-03-31 16:57 + */ +@Service +public class ActivitySignReceiveRecordService extends ServiceImpl<ActivitySignReceiveRecordDao, ActivitySignReceiveRecord>{ + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignRecordService.java b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignRecordService.java new file mode 100644 index 0000000..70c96b1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignRecordService.java @@ -0,0 +1,22 @@ +package com.matrix.system.activity.service; + + +import org.springframework.stereotype.Service; + +import com.matrix.system.activity.dao.ActivitySignRecordDao; +import com.matrix.system.activity.entity.ActivitySignRecord; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @description 签到记录表 + * @author yourName + * @date 2021-03-31 16:57 + */ +@Service +public class ActivitySignRecordService extends ServiceImpl<ActivitySignRecordDao, ActivitySignRecord>{ + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignWriteoffService.java b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignWriteoffService.java new file mode 100644 index 0000000..b6d7560 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignWriteoffService.java @@ -0,0 +1,255 @@ +package com.matrix.system.activity.service; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.activity.dao.ActivitySignAwardSetDao; +import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; +import com.matrix.system.activity.dao.ActivitySignWriteoffDao; +import com.matrix.system.activity.dto.LogisticsSubmitDto; +import com.matrix.system.activity.dto.SignWriteoffDto; +import com.matrix.system.activity.dto.SignWriteoffListDto; +import com.matrix.system.activity.dto.WriteoffCodeSubmitDto; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import com.matrix.system.activity.entity.ActivitySignReceiveRecord; +import com.matrix.system.activity.entity.ActivitySignWriteoff; +import com.matrix.system.activity.vo.LogisticsVo; +import com.matrix.system.activity.vo.SignWriteoffListVo; +import com.matrix.system.activity.vo.SignWriteoffVo; +import com.matrix.system.activity.vo.ZjrVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.bean.SystemDictionary; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.SystemDictionaryDao; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; +import com.matrix.system.shopXcx.bean.ShopActivities; +import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; +import com.matrix.system.shopXcx.bean.ShopLogisticsInfo; +import com.matrix.system.shopXcx.dao.ShopActivitiesDao; +import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; +import com.matrix.system.shopXcx.dao.ShopLogisticsInfoDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @description 核销记录 + * @author yourName + * @date 2021-04-08 14:25 + */ +@Service +public class ActivitySignWriteoffService extends ServiceImpl<ActivitySignWriteoffDao, ActivitySignWriteoff>{ + + @Autowired + ActivitySignWriteoffDao activitySignWriteoffDao; + @Autowired + ShopActivitiesDao shopActivitiesDao; + @Autowired + ActivitySignAwardSetDao activitySignAwardSetDao; + @Autowired + ActivitySignReceiveRecordDao activitySignReceiveRecordDao; + @Autowired + SysVipInfoDao sysVipInfoDao; + @Autowired + SystemDictionaryDao systemDictionaryDao; + @Autowired + ShopDeliveryInfoDao shopDeliveryInfoDao; + @Autowired + ShopLogisticsInfoDao shopLogisticsInfoDao; + @Autowired + private WxShopLogisticsQueryService wxShopLogisticsQueryService; + + public IPage<SignWriteoffListVo> findSignWriteoffList(Page<SignWriteoffListVo> page, + SignWriteoffListDto signWriteoffListDto) { + return activitySignWriteoffDao.findSignWriteoffList(page,signWriteoffListDto); + } + + public AjaxResult findSignWriteoff(SignWriteoffDto signWriteoffDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(signWriteoffDto); + Long writeoffId = signWriteoffDto.getWriteoffId(); + AjaxResult result= AjaxResult.buildSuccessInstance("成功"); + //获取核销信息 + SignWriteoffVo signWriteoffVo = new SignWriteoffVo(); + ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); + if(ObjectUtil.isNotEmpty(activitySignWriteoff)) { + //获取奖品信息 + ActivitySignAwardSet activitySignAwardSet = activitySignAwardSetDao.selectById(activitySignWriteoff.getAwardId()); + signWriteoffVo.setJpmc(activitySignAwardSet.getAwardName()); + signWriteoffVo.setJptp(activitySignAwardSet.getIntroduceImg()); + signWriteoffVo.setSl(1); + signWriteoffVo.setDjfs(activitySignAwardSet.getAwardWay()); + //获取中奖人信息 + ZjrVo zjrVo = activitySignWriteoffDao.selectUsernameByUserId(activitySignWriteoff.getUserId(),activitySignAwardSet.getId()); + signWriteoffVo.setZjr(zjrVo.getZjr()); + signWriteoffVo.setZjsj(zjrVo.getZjsj()); + signWriteoffVo.setDjsj(activitySignWriteoff.getWriteoffTime()); + signWriteoffVo.setState(activitySignWriteoff.getState()); + //获取活动主表信息 + ShopActivities shopActivities = shopActivitiesDao.selectById(activitySignWriteoff.getActId()); + signWriteoffVo.setHdmc(shopActivities.getActName()); + signWriteoffVo.setHdbh(shopActivities.getActCode()); + //获取收货地址信息 + int awardWay = activitySignAwardSet.getAwardWay(); + if(ActivitySignAwardSet.AWARDWAY_TWO == awardWay) { + ActivitySignWriteoff activitySignWriteoffLogistics = activitySignWriteoffDao.selectById(writeoffId); + Long receiveId = activitySignWriteoffLogistics.getReceiveId(); + ActivitySignReceiveRecord activitySignReceiveRecordLogistic = activitySignReceiveRecordDao.selectById(receiveId); + signWriteoffVo.setConsignee(activitySignReceiveRecordLogistic.getConsignee()); + signWriteoffVo.setConsigneePhone(activitySignReceiveRecordLogistic.getConsigneePhone()); + signWriteoffVo.setConsigneeAddress(activitySignReceiveRecordLogistic.getConsigneeAddress()); + + //物流跟踪 + Integer logisticsId = activitySignWriteoffLogistics.getLogisticsId(); + ShopDeliveryInfo shopDeliveryInfo = shopDeliveryInfoDao.selectById(logisticsId); + if(ObjectUtil.isNotEmpty(shopDeliveryInfo)){ + signWriteoffVo.setLogisticsNum(shopDeliveryInfo.getWaybillNo()); + signWriteoffVo.setLogisticsCompany(shopDeliveryInfo.getLogisticsCompany()); + //查看物流信息 + wxShopLogisticsQueryService.selectLogisticsInfo(shopDeliveryInfo); + List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); + if(CollUtil.isNotEmpty(shopLogisticsInfos)) { + ArrayList<LogisticsVo> logisticsVos = new ArrayList<>(); + for(ShopLogisticsInfo shopLogistics : shopLogisticsInfos) { + LogisticsVo logisticsVo = new LogisticsVo(); + logisticsVo.setContent(shopLogistics.getDescribe()); + logisticsVo.setTimestamp(shopLogistics.getLogisticsTime()); + logisticsVos.add(logisticsVo); + } + signWriteoffVo.setActivities(logisticsVos); + } + } + } + } + result.putInMap("signWriteoffVo", signWriteoffVo); + return result; + } + + @Transactional + public AjaxResult writeoffCodeSubmit(WriteoffCodeSubmitDto writeoffCodeSubmitDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(writeoffCodeSubmitDto); + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + Long writeoffId = writeoffCodeSubmitDto.getWriteoffId(); + String writeOffCode = writeoffCodeSubmitDto.getWriteOffCode(); + /** + * 验证核销码是不是匹配 + * 只能核销一次 + * 更新核销记录 + * 更新领取记录 + */ + //验证核销码是不是匹配 + ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); + if(ActivitySignWriteoff.STATE_ONE != activitySignWriteoff.getState()){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "兑奖码已失效"); + } + if(ObjectUtil.isNotEmpty(activitySignWriteoff)) { + String writeoffCodeReal = activitySignWriteoff.getWriteoffCode(); + if(!writeoffCodeReal.equals(writeOffCode)) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "兑奖码无效"); + } + } + //线下兑换失效 + Long awardId = activitySignWriteoff.getAwardId(); + ActivitySignAwardSet activitySignAwardSet = activitySignAwardSetDao.selectById(awardId); + if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSet.getAwardWay() + || ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSet.getAwardWay()){ + Date prizeStartTime = activitySignAwardSet.getPrizeStartTime(); + if(DateUtil.date().getTime() < prizeStartTime.getTime()){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "兑奖还没开始呢!"); + } + Date prizeEndTime = activitySignAwardSet.getPrizeEndTime(); + if(DateUtil.date().getTime() > prizeEndTime.getTime()){ + Long receiveId = activitySignWriteoff.getReceiveId(); + ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(receiveId); + if(ObjectUtil.isNotEmpty(activitySignReceiveRecord)){ + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_FIVE); + } + activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); + + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_FOUR); + activitySignWriteoffDao.updateById(activitySignWriteoff); + return new AjaxResult(AjaxResult.STATUS_FAIL, "已超出兑奖结束时间!"); + } + } + //更新核销记录 + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_THREE); + activitySignWriteoff.setWriteoffTime(new Date()); + activitySignWriteoff.setWriteoffUser(sysUsers.getSuName()); + activitySignWriteoff.setWriteoffUserid(sysUsers.getSuId()); + activitySignWriteoffDao.updateById(activitySignWriteoff); + //更新领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(activitySignWriteoff.getReceiveId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); + + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "核销成功"); + } + + @Transactional + public AjaxResult logisticsSubmit(LogisticsSubmitDto logisticsSubmitDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(logisticsSubmitDto); + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + Long writeoffId = logisticsSubmitDto.getWriteoffId(); + /** + * 更新领取记录表的收货信息和状态 + * 更新核销记录表的状态和物流ID + */ + ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); + //新增一条物流信息 + ShopDeliveryInfo shopDeliveryInfo = new ShopDeliveryInfo(); + Long receiveId = activitySignWriteoff.getReceiveId(); + SystemDictionary systemDictionary = systemDictionaryDao.selectByCode(logisticsSubmitDto.getKdgs()); + if (ObjectUtil.isEmpty(systemDictionary)) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "没有找到物流公司信息!"); + } + shopDeliveryInfo.setUserId(activitySignWriteoff.getUserId()); + shopDeliveryInfo.setReceiveId(receiveId); + shopDeliveryInfo.setReceiveAddress(logisticsSubmitDto.getShdz()); + + shopDeliveryInfo.setLogisticsCompany(systemDictionary.getName()); + shopDeliveryInfo.setLogisticsCompanyCode(systemDictionary.getCode()); + shopDeliveryInfo.setDeliveryWay("物流配送"); + shopDeliveryInfo.setLogisticsStatus(AppConstance.LOGISTICS_STATUS_OF_RECEIVE); + + shopDeliveryInfo.setWaybillNo(logisticsSubmitDto.getKddh()); + shopDeliveryInfo.setUpdateBy(sysUsers.getSuName()); + shopDeliveryInfo.setCreateBy(sysUsers.getSuName()); + + shopDeliveryInfo.setDeliveryTime(new Date()); + shopDeliveryInfoDao.insert(shopDeliveryInfo); + //更新核销记录 + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_THREE); + activitySignWriteoff.setWriteoffTime(new Date()); + activitySignWriteoff.setWriteoffUser(sysUsers.getSuName()); + activitySignWriteoff.setWriteoffUserid(sysUsers.getSuId()); + activitySignWriteoff.setLogisticsId(shopDeliveryInfo.getId()); + activitySignWriteoffDao.updateById(activitySignWriteoff); + //更新领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(receiveId); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_FOUR); + activitySignReceiveRecord.setConsignee(logisticsSubmitDto.getShr()); + activitySignReceiveRecord.setConsigneeAddress(logisticsSubmitDto.getShdz()); + activitySignReceiveRecord.setConsigneePhone(logisticsSubmitDto.getLxdh()); + activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "发货成功"); + } + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/ActivitiesListVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/ActivitiesListVo.java new file mode 100644 index 0000000..822e56e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/ActivitiesListVo.java @@ -0,0 +1,107 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +public class ActivitiesListVo { + + /** + * 活动类型 团购 + */ + public static final int ACTIVITIES_TYPE_GROUP = 1; + + /** + * 活动类型 秒杀 + */ + public static final int ACTIVITIES_TYPE_SECKILL = 2; + + /** + * 活动类型 沙龙 + */ + public static final int ACTIVITIES_TYPE_SALON = 3; + /** + * 活动类型 签到 + */ + public static final int ACTIVITIES_TYPE_SIGN = 4; + + /** + * 活动状态 开启 + */ + public static final int ACTIVITIES_STATUS_OPEN = 1; + + /** + * 活动状态 关闭 + */ + public static final int ACTIVITIES_STATUS_CLOSE = 2; + /** + * 主键 + */ + private Long id; + + + /** + * 活动名称 + */ + @ApiModelProperty(value = "活动名称") + private String actName; + /** + * 活动编码 + */ + @ApiModelProperty(value = "活动编码") + private String actCode; + + + /** + * 活动类型 + */ + @ApiModelProperty(value = "活动类型") + private Integer actType; + + + /** + * 开始时间 + */ + @ApiModelProperty(value = "开始时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date actBeginTime; + + + /** + * 结束时间 + */ + @ApiModelProperty(value = "结束时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date actEndTime; + /** + * 活动状态 + */ + @ApiModelProperty(value = "活动状态") + private Integer actStatus; + + //未发布 + public static final int ACTSTATUS_STATUS_RELEASE = 1; + //未开始 + public static final int ACTSTATUS_STATUS_READY = 2; + //进行中 + public static final int ACTSTATUS_STATUS_ING = 3; + //已结束 + public static final int ACTSTATUS_STATUS_END = 4; + @ApiModelProperty(value = "创建人") + private String createBy; + /** + * 活动说明 + */ + @ApiModelProperty(value = "活动说明") + private String actRemark; + + /** + * 公司ID + */ + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/AddLuckyDrawSetVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/AddLuckyDrawSetVo.java new file mode 100644 index 0000000..f8ff24e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/AddLuckyDrawSetVo.java @@ -0,0 +1,34 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class AddLuckyDrawSetVo { + /** + * 主键 + */ + private Long id; + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date endTime; + + private LuckyDrawBasicJsonVo luckyDrawBasicJsonVo; + + private List<ActivitySignAwardSet> activityluckyDrawSets; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/AddSignAwardSetVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/AddSignAwardSetVo.java new file mode 100644 index 0000000..5421c58 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/AddSignAwardSetVo.java @@ -0,0 +1,34 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class AddSignAwardSetVo { + /** + * 主键 + */ + private Long id; + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date endTime; + + private SignSetBasicJsonVo signSetBasicJsonDto; + + private List<ActivitySignAwardSet> activitySignAwardSets; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/CouponVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/CouponVo.java new file mode 100644 index 0000000..39b64fa --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/CouponVo.java @@ -0,0 +1,30 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +public class CouponVo { + /** + * 主键 + */ + private Integer id; + + + /** + * 优惠券名称 + */ + @ApiModelProperty(value = "优惠券名称") + private String cName; + + /** + * 结束时间 + */ + @ApiModelProperty(value = "结束时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date endTime; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/GoodsVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/GoodsVo.java new file mode 100644 index 0000000..41793ea --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/GoodsVo.java @@ -0,0 +1,29 @@ +package com.matrix.system.activity.vo; + +import lombok.Data; + +@Data +public class GoodsVo { + + private Long id; + /** + * 产品名称 + */ + private String name; + + /** + * 商品分类 组合商品/家居产品/项目/充值卡/综合卡 + */ + private String goodType; + + /** + * 产品编码 + */ + private String code; + + /** + * 售价/本金 + */ + private Double sealPice; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/LogisticsVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/LogisticsVo.java new file mode 100644 index 0000000..6e97798 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/LogisticsVo.java @@ -0,0 +1,18 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class LogisticsVo { + + @ApiModelProperty(value ="内容") + private String content; + + @ApiModelProperty(value ="时间戳") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private String timestamp; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawAwardCodeListVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawAwardCodeListVo.java new file mode 100644 index 0000000..80eb8b6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawAwardCodeListVo.java @@ -0,0 +1,57 @@ +package com.matrix.system.activity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class LuckyDrawAwardCodeListVo { + + @ApiModelProperty(value ="头部图片") + private String imageUrlHead; + @ApiModelProperty(value ="开始按钮") + private String imageUrlTitle; + @ApiModelProperty(value ="转盘背景") + private String imageUrlButton; + @ApiModelProperty(value ="状态图片") + private String imageUrlState; + @ApiModelProperty(value ="奖品划分线") + private String imageLine; + + @ApiModelProperty(value ="规则内容") + private String ruleExplain; + @ApiModelProperty(value ="字体颜色") + private String typographyColor; + @ApiModelProperty(value ="背景颜色") + private String backgroundColor; + @ApiModelProperty(value ="字体大小") + private Integer typographyNum; + @ApiModelProperty(value ="字体透明度") + private Integer typographyLight; + + + //@ApiModelProperty(value ="中奖顺序") + private String awardLine; + //@ApiModelProperty(value ="中奖顺序索引") + private Integer awrdLineIndex; + + /** + * 抽奖规则 + */ + //每人每日有10次无门槛抽奖机会 + private Integer wmkcjjh; + //可用积分兑换1次抽奖机会, + private Integer dhycjfs; + // 每日最多兑换 + //10 + //次抽奖机会 + private Integer jfdhcs; + // 每人最多可中奖 + //10 + //次 + private Integer zzjcs; + // 总中奖率 + //10 + //% + private Integer zzjl; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawBasicJsonVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawBasicJsonVo.java new file mode 100644 index 0000000..f945879 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/LuckyDrawBasicJsonVo.java @@ -0,0 +1,51 @@ +package com.matrix.system.activity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class LuckyDrawBasicJsonVo { + + @ApiModelProperty(value ="头部图片") + private String imageUrlHead; + @ApiModelProperty(value ="开始按钮") + private String imageUrlTitle; + @ApiModelProperty(value ="转盘背景") + private String imageUrlButton; + @ApiModelProperty(value ="状态图片") + private String imageUrlState; + @ApiModelProperty(value ="奖品划分线") + private String imageLine; + + @ApiModelProperty(value ="规则内容") + private String ruleExplain; + @ApiModelProperty(value ="字体颜色") + private String typographyColor; + @ApiModelProperty(value ="背景颜色") + private String backgroundColor; + @ApiModelProperty(value ="字体大小") + private Integer typographyNum; + @ApiModelProperty(value ="字体透明度") + private Integer typographyLight; + + /** + * 抽奖规则 + */ + //每人每日有10次无门槛抽奖机会 + private Integer wmkcjjh; + //可用积分兑换1次抽奖机会, + private Integer dhycjfs; + // 每日最多兑换 + //10 + //次抽奖机会 + private Integer jfdhcs; + // 每人最多可中奖 + //10 + //次 + private Integer zzjcs; + // 总中奖率 + //10 + //% + private Integer zzjl; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/SignReceiveListVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignReceiveListVo.java new file mode 100644 index 0000000..7b7d959 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignReceiveListVo.java @@ -0,0 +1,44 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +public class SignReceiveListVo { + /** + * 主键 + */ + private Long id; + //活动类型 + private int actType; + + @ApiModelProperty(value = "用户") + private String nickName; + + @ApiModelProperty(value = "签到时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date reciveTime; + + @ApiModelProperty(value = "连续签到天数") + private Integer cumulativeDay; + + @ApiModelProperty(value = "数量") + private Integer scoreCnt; + + @ApiModelProperty(value = "奖励类型") + private String awardType; + + @ApiModelProperty(value = "获得奖励") + private String awardName; + @ApiModelProperty(value = "优惠券名") + private String couponName; + + @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") + private int awardRule; + @ApiModelProperty(value ="是否已领取(1:待领取2:已领取)") + private int state; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/SignSetBasicJsonVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignSetBasicJsonVo.java new file mode 100644 index 0000000..c2d0983 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignSetBasicJsonVo.java @@ -0,0 +1,29 @@ +package com.matrix.system.activity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class SignSetBasicJsonVo { + + @ApiModelProperty(value ="标题图片") + private String imageUrlTitle; + @ApiModelProperty(value ="头部图片") + private String imageUrlHead; + @ApiModelProperty(value ="按钮图片") + private String imageUrlButton; + @ApiModelProperty(value ="状态图片") + private String imageUrlState; + + @ApiModelProperty(value ="规则内容") + private String ruleExplain; + @ApiModelProperty(value ="字体颜色") + private String typographyColor; + @ApiModelProperty(value ="背景颜色") + private String backgroundColor; + @ApiModelProperty(value ="字体大小") + private Integer typographyNum; + @ApiModelProperty(value ="字体透明度") + private Integer typographyLight; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffListVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffListVo.java new file mode 100644 index 0000000..5358c7a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffListVo.java @@ -0,0 +1,77 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +public class SignWriteoffListVo { + + + private Long id; + + /** + * 核销时间 + */ + @ApiModelProperty(value ="核销时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date writeoffTime; + + /** + * 核销员 + */ + @ApiModelProperty(value ="核销员") + private String writeoffUser; + + /** + * 兑奖码 + */ + @ApiModelProperty(value ="兑奖码") + private String writeoffCode; + + /** + * 活动名称 + */ + @ApiModelProperty(value ="活动名称") + private String actName; + + /** + * 奖品名称 + */ + @ApiModelProperty(value ="奖品名称") + private String awardName; + + /** + * 中奖时间 + */ + @ApiModelProperty(value ="中奖时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date winTime; + + /** + * 状态 + */ + @ApiModelProperty(value ="状态(1:待兑换 2:待发货 3:已兑换)") + private int state; + + /** + * 兑奖方式 + */ + @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") + private int awardWay; + + /** + * 中奖者 + */ + @ApiModelProperty(value ="中奖者") + private String receiveName; + + /** + * 收货地址 + */ + @ApiModelProperty(value ="收货地址") + private String receiveAddress; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffVo.java new file mode 100644 index 0000000..9dea112 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/SignWriteoffVo.java @@ -0,0 +1,62 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class SignWriteoffVo { + + @ApiModelProperty(value ="奖品名称") + private String jpmc; + + @ApiModelProperty(value ="奖品图片") + private String jptp; + + @ApiModelProperty(value ="数量") + private int sl; + + @ApiModelProperty(value ="中奖人") + private String zjr; + + @ApiModelProperty(value ="中奖时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date zjsj; + + @ApiModelProperty(value ="活动名称") + private String hdmc; + + @ApiModelProperty(value ="活动编号") + private String hdbh; + + @ApiModelProperty(value ="兑奖方式") + private int djfs; + + @ApiModelProperty(value ="兑奖状态") + private int state; + + @ApiModelProperty(value ="兑奖时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date djsj; + + @ApiModelProperty(value ="收货人") + private String consignee; + + @ApiModelProperty(value ="联系电话") + private String consigneePhone; + + @ApiModelProperty(value ="收货地址") + private String consigneeAddress; + + @ApiModelProperty(value ="物流单号") + private String logisticsNum; + + @ApiModelProperty(value ="物流公司") + private String logisticsCompany; + + private List<LogisticsVo> activities; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/activity/vo/ZjrVo.java b/zq-erp/src/main/java/com/matrix/system/activity/vo/ZjrVo.java new file mode 100644 index 0000000..e6d9c7d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/activity/vo/ZjrVo.java @@ -0,0 +1,18 @@ +package com.matrix.system.activity.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +@Data +public class ZjrVo { + + @ApiModelProperty(value ="中奖人") + private String zjr; + + @ApiModelProperty(value ="中奖时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date zjsj; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java new file mode 100644 index 0000000..ed9b2c4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java @@ -0,0 +1,390 @@ +package com.matrix.system.app.action; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.matrix.component.tools.HttpCurlUtil; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.*; +import com.matrix.system.app.authority.AppAuthorityManager; +import com.matrix.system.app.dto.*; +import com.matrix.system.app.utils.Sms106Send; +import com.matrix.system.app.vo.UserInfoVo; +import com.matrix.system.common.authority.strategy.AccountPasswordLogin; +import com.matrix.system.common.authority.strategy.LoginStrategy; +import com.matrix.system.common.bean.SysCompany; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.init.LocalCache; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.common.service.SysCompanyService; +import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.common.tools.PasswordUtil; +import com.matrix.system.common.tools.UploadUtil; +import com.matrix.system.hive.bean.AppVersion; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.hive.plugin.util.ImageUtil; +import com.matrix.system.hive.service.SysShopInfoService; +import com.matrix.system.shopXcx.api.WeChatApiTools; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import net.sf.json.JSONObject; +import org.apache.commons.fileupload.FileUploadException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartHttpServletRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@CrossOrigin(origins = "*") +@Api(value = "CommonAction", tags = "手机端公共请求类(含登陆)") +@RestController +@RequestMapping(value = "/api/common") +public class ApiCommonAction { + + @Autowired + private SysUsersService sysUsersService; + + @Autowired + private SysShopInfoService sysShopInfoService; + + @Autowired + private AppAuthorityManager authorityManager; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + private SysCompanyService sysCompanyService;; + + @Autowired + WeChatApiTools weChatApiTools; + + @Autowired + private UserCacheManager userCacheManager; + + @Value("${file_storage_path}") + private String fileStoragePath; + @Value("${static_resource_url}") + private String nginxUrl; + + @Value("${login_public_key}") + private String publicKey; + + @ApiOperation(value = "登陆接口", notes = "手机端登陆接口") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = UserInfoVo.class) + }) + @PostMapping(value = "/login") + public AjaxResult login(@RequestBody @Validated LoginDto loginDto) throws Exception { + + SysUsers user = new SysUsers(); + user.setSuAccount(loginDto.getUsername()); + user.setSuPassword(loginDto.getPassword()); + LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); + user = authorityManager.login(apLogin); + + UserInfoVo userInfoVo = new UserInfoVo(); + if(user.getShopId()!=null){ + SysShopInfo shopInfo = sysShopInfoService.findById(user.getShopId()); + user.setShopName(shopInfo.getShopName()); + userInfoVo.setShopName(shopInfo.getShopShortName()); + } + user.setSuPassword(null); + + String token = UUIDUtil.getRandomID(); + LocalCache.save(token, user); + + userInfoVo.setId(user.getSuId()); + userInfoVo.setName(user.getSuName()); + userInfoVo.setRoleName(user.getRoleName()); + userInfoVo.setPhoto(user.getSuPhoto()); + + String sb = token + "_1" + "_/api/vip/findVipInfoById/972"; + AjaxResult result = AjaxResult.buildSuccessInstance("登陆成功"); + authorityManager.initUserPower(result,user); + result.putInMap("user", userInfoVo); + result.putInMap("token", token); + result.putInMap("rasToken", RSAUtils.encryptByPublicKey(sb, publicKey)); + return result; + } + + @ApiOperation(value = "图片上传接口", notes = "图片上传接口") + @PostMapping(value = "/uploadPhotoBase64") + public AjaxResult uploadPhotoBase64(@RequestBody @Validated UploadPhotoDto uploadPhotoDto) { + // 文件保存目录路径 + String savePath = fileStoragePath; + String abstractPath= DateUtil.dateFormatStr(new Date(),DateUtil.DATE_FORMAT_NO_SPLITE_DD); + savePath=savePath+File.separator+abstractPath; + + String fileName =UUIDUtil.getRandomID() + ".png"; + + + // 文件保存目录URL + String saveUrl = nginxUrl; + LogUtil.debug("图片保存目录路径={}",fileStoragePath); + LogUtil.debug("图片保存目录URL={}",nginxUrl); + // 保存和访问路径检查 + if (StringUtils.isBlank(saveUrl) || StringUtils.isBlank(savePath)) { + return AjaxResult.buildFailInstance("文件上传失败错误代码:001"); + } + + // 检查目录 + File uploadDir = new File(savePath); + if (!uploadDir.isDirectory()) { + uploadDir.mkdir(); + } + + ImageUtil.base64ToFile(uploadPhotoDto.getBase64(),savePath , fileName); + LogUtil.info("fileName : {}", fileName); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("上传成功"); + ajaxResult.putInMap("file", nginxUrl + abstractPath+"/"+fileName); + return ajaxResult; + } + + + String folderType = "image"; + public final static List<FileType> EXT_LIST = new ArrayList<FileType>(); + static { + EXT_LIST.add(FileType.JPEG); + EXT_LIST.add(FileType.PNG); + } + + @ApiOperation(value = "表单图片上传接口", notes = "表单图片上传接口") + @PostMapping(value = "/uploadImg") + public AjaxResult uploadImg(HttpServletResponse response, MultipartHttpServletRequest request) + throws IOException, FileUploadException, NoSuchAlgorithmException { + Map<String, String> fileMap = UploadUtil.doUpload(request, EXT_LIST, folderType, 1L); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("上传成功"); + ajaxResult.putInMap("file", fileMap.get("visitPath")); + return ajaxResult; + } + + + @ApiOperation(value = "短信验证码发送", notes = "短信验证码发送") + @PostMapping(value = "/sendSmsCode") + public AjaxResult sendSmsCode(@RequestBody @Validated SmsCodeDto smsCodeDto) { + SysUsers user = new SysUsers(); + user.setSuTel(smsCodeDto.getTelphone()); + List<SysUsers> users = sysUsersService.findByModel(user); + if (CollectionUtils.isEmpty(users)) { + return AjaxResult.buildFailInstance("该手机号不存在"); + } + + String codeExist = LocalCache.get(smsCodeDto.getTelphone()); + if (StringUtils.isNotBlank(codeExist)) { + return AjaxResult.buildFailInstance("请勿重复发送验证码"); + } + + Integer code =(int) ((Math.random() * 9 + 1) * 100000); + Sms106Send.sendVerifyCode(smsCodeDto.getTelphone(), code.toString(), 2); + LocalCache.save(smsCodeDto.getTelphone(), code.toString(), 120 * 1000); + return AjaxResult.buildSuccessInstance("发送成功"); + } + + @ApiOperation(value = "重置登陆密码", notes = "重置登陆密码") + @PostMapping(value = "/resetLoginPwd") + public AjaxResult resetLoginPwd(@RequestBody @Validated PwdResetDto pwdResetDto) throws UnsupportedEncodingException, NoSuchAlgorithmException { + SysUsers user = new SysUsers(); + user.setSuTel(pwdResetDto.getTelphone()); + List<SysUsers> users = sysUsersService.findByModel(user); + if (CollectionUtils.isEmpty(users)) { + return AjaxResult.buildFailInstance("该手机号不存在"); + } + + String code = LocalCache.get(pwdResetDto.getTelphone()); + if (StringUtils.isBlank(code)) { + return AjaxResult.buildFailInstance("验证码已失效,请重新发送"); + } + + if (!code.equals(pwdResetDto.getCode())) { + return AjaxResult.buildFailInstance("验证码错误"); + } + + user = users.get(0); + user.setSuPassword(pwdResetDto.getNewPwd()); + String pwd = PasswordUtil.getEncrypUserPwd(user); + + int i = sysUsersService.updateUserPassword(user.getSuId(), pwd); + if (i > 0) { + LocalCache.remove(pwdResetDto.getTelphone()); + return AjaxResult.buildSuccessInstance("修改成功"); + } + return AjaxResult.buildFailInstance("修改失败"); + } + + @ApiOperation(value = "获取app版本", notes = "获取app版本") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AppVersion.class) + }) + @GetMapping(value = "/findAppVersion") + public AjaxResult findAppVersion() { + return AjaxResult.buildSuccessInstance(sysUsersService.findAppVersion()); + } + + + @ApiOperation(value = "获取api接口地址", notes = "获取api接口地址") + @GetMapping(value = "/findApiUrl") + public AjaxResult findApiUrl() { + List<UrlDto> data = new ArrayList<>(); + UrlDto urlDto = new UrlDto(); + urlDto.setUrl("http://myapp.jyymatrix.cc"); + urlDto.setName("正式环境"); + data.add(urlDto); + + urlDto = new UrlDto(); + urlDto.setUrl("http://test.hive.jyymatrix.cc"); + urlDto.setName("测试环境"); + data.add(urlDto); + + urlDto = new UrlDto(); + urlDto.setUrl("http://hive.mydoline.com"); + urlDto.setName("美度专线"); + data.add(urlDto); + + urlDto = new UrlDto(); + urlDto.setUrl("http://localhost:8080"); + urlDto.setName("开发环境"); + data.add(urlDto); + + return AjaxResult.buildSuccessInstance(data); + } + + + @ApiOperation(value = "根据企业编码获取对应的请求地址") + @PostMapping(value = "/getUrlByCompanyCode") + public AjaxResult getUrlByCompanyCode(@RequestBody SettingDto codeDto) { + SysCompany query = new SysCompany(); + query.setComCode(codeDto.getCode()); + List<SysCompany> list = sysCompanyService.findByModel(query); + if (CollUtil.isEmpty(list)) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "企业编码有误"); + } + + AjaxResult ajaxResult = new AjaxResult(); + ajaxResult.setStatus(AjaxResult.STATUS_SUCCESS); + ajaxResult.putInMap("url", list.get(0).getComWebUrl()); + return ajaxResult; + } + + @ApiOperation(value = "管理端小程序登录") + @PostMapping(value = "/wxLogin/{code}") + public AjaxResult wxLogin(@PathVariable("code") String code) throws IOException { + if (StrUtil.isBlank(code)) { + return AjaxResult.buildFailInstance("code不存在"); + } + AjaxResult res = new AjaxResult(); + String requrl = weChatApiTools.getManagerXcxLoginUrl(code); + + String resultData = HttpCurlUtil.sendGetHttp(requrl, null); + JSONObject json = JSONObject.fromObject(resultData); + LogUtil.debug("管理端小程序登录获取到登录信息={}", json); + + if (json.containsKey("errcode")) { + res.setStatus(AjaxResult.STATUS_FAIL); + res.setInfo("自动登录失败"); + LogUtil.info("微信登录获取到异常信息errcode"); + return res; + } + + String openId = json.getString("openid"); + res.setStatus(AjaxResult.STATUS_SUCCESS); + res.putInMap("openId", openId); + SysUsers hasBind = sysUsersService.findByOpenId(openId, HostInterceptor.getCompanyId()); + if (hasBind == null) { + res.setInfo("未绑定用户"); + return res; + } + + String token = userCacheManager.saveUserInfo(hasBind); + LogUtil.info("用户token={}", token); + + authorityManager.initUserPower(res, hasBind); + + UserInfoVo userInfoVo = new UserInfoVo(); + if(hasBind.getShopId()!=null){ + SysShopInfo shopInfo = sysShopInfoService.findById(hasBind.getShopId()); + hasBind.setShopName(shopInfo.getShopName()); + userInfoVo.setShopName(shopInfo.getShopShortName()); + } + + userInfoVo.setId(hasBind.getSuId()); + userInfoVo.setName(hasBind.getSuName()); + userInfoVo.setRoleName(hasBind.getRoleName()); + userInfoVo.setPhoto(hasBind.getSuPhoto()); + + res.putInMap("token", token); + res.putInMap("userInfo", userInfoVo); + return res; + } + + @ApiOperation(value = "绑定用户") + @PostMapping(value = "/bindUser") + public AjaxResult bindUser(@RequestBody @Validated LoginDto loginDto) { + SysUsers user = new SysUsers(); + user.setSuAccount(loginDto.getUsername()); + user.setSuPassword(loginDto.getPassword()); + LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); + user = authorityManager.login(apLogin); + user.setSuPassword(null); + user.setOpenIds(null); + String token = userCacheManager.saveUserInfo(user); + + AjaxResult result = AjaxResult.buildSuccessInstance("登陆成功"); + authorityManager.initUserPower(result, user); + + UserInfoVo userInfoVo = new UserInfoVo(); + if(user.getShopId()!=null){ + SysShopInfo shopInfo = sysShopInfoService.findById(user.getShopId()); + user.setShopName(shopInfo.getShopName()); + userInfoVo.setShopName(shopInfo.getShopShortName()); + } + + userInfoVo.setId(user.getSuId()); + userInfoVo.setName(user.getSuName()); + userInfoVo.setRoleName(user.getRoleName()); + userInfoVo.setPhoto(user.getSuPhoto()); + + result.putInMap("token", token); + result.putInMap("userInfo", userInfoVo); + + synchronized (this) { + SysUsers hasBind = sysUsersService.findByOpenId(loginDto.getOpenId(), HostInterceptor.getCompanyId()); + if (hasBind != null) { + if(StrUtil.isNotBlank(hasBind.getOpenIds())) { + List<String> openIds = StrUtil.split(hasBind.getOpenIds(), ','); + openIds.remove(loginDto.getOpenId()); + + sysUsersService.modifyUserOpenId(CollUtil.join(openIds, ","), hasBind.getSuId()); + } + } + + List<String> openIds = StrUtil.split(user.getOpenIds(), ','); + openIds.add(loginDto.getOpenId()); + user.setOpenIds(CollUtil.join(openIds, ",")); + sysUsersService.modifyByModel(user); + } + + return result; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java new file mode 100644 index 0000000..25fa419 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java @@ -0,0 +1,184 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.*; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.*; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author jyy + * @date 2020-12-21 + **/ +@Api(value = "ApiFollowupAction", tags = "跟进记录接口类") +@RestController +@RequestMapping(value = "/api/followup") +public class ApiFollowupAction { + + @Autowired + private SysFollowupDao followupDao; + + @Autowired + private SysVipAlbumDao vipAlbumDao; + + @Autowired + private SysVipInfoDao vipInfoDao; + + @Autowired + private SysFollowupCommentDao followupCommentDao; + + + + @Autowired + private SysOrderItemDao orderItemDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + + @ApiOperation(value = "新增跟进记录", notes = "新增跟进记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SysFollowup.class) + }) + @PostMapping(value = "/addFollowup") + public AjaxResult addFollowup(@RequestBody @Validated SysFollowup followup) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + followup.setCreateBy(user.getSuName()); + followup.setUpdateBy(user.getSuName()); + followup.setStaffId(user.getSuId()); + followup.setCompanyId(user.getCompanyId()); + followup.setShopId(user.getShopId()); + //处理订单摘要 + if(followup.getOrderId()!=null){ + List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(followup.getOrderId()); + String abs=""; + if(sysOrderItems.size()>1){ + abs= sysOrderItems.get(0).getShoppingGoods().getName()+"等"+sysOrderItems.size()+"件商品"; + }else{ + abs= sysOrderItems.get(0).getShoppingGoods().getName(); + } + followup.setOrderAbstract(abs); + } + //服务单摘要 + if(followup.getServiceId()!=null){ + List<SysBeauticianState> sysBeauticianStates = beauticianStateDao.selectBySerIds(followup.getServiceId()); + String abs=""; + if(sysBeauticianStates.size()>1){ + abs= sysBeauticianStates.get(0).getProjInfo().getName()+"等"+sysBeauticianStates.size()+"项服务"; + }else{ + abs= sysBeauticianStates.get(0).getProjInfo().getName(); + } + followup.setOrderAbstract(abs); + } + + followupDao.insert(followup); + //插入图片 + List<SysVipAlbum> albums=followup.getAlbums(); + if(CollectionUtils.isNotEmpty(albums)){ + for (SysVipAlbum vipAlbum:albums){ + if(StringUtils.isNotBlank(vipAlbum.getImg())){ + vipAlbum.setCreateBy(user.getSuName()); + vipAlbum.setUpdateBy(user.getSuName()); + vipAlbum.setSource(SysVipAlbum.SOURCE_FOLLOW); + vipAlbum.setVipId(followup.getVipId()); + vipAlbum.setSourceId(followup.getId()); + vipAlbumDao.insert(vipAlbum); + } + } + } + + return AjaxResult.buildSuccessInstance("保存成功"); + } + + @ApiOperation(value = "跟进记录点赞或者取消点赞", notes = "跟进记录点赞或者取消点赞") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + @GetMapping(value = "/zanFollowup/{id}") + public AjaxResult zanFollowup(@PathVariable("id")Long id) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysFollowup followup = followupDao.selectById(id); + String zans=followup.getZans(); + if(StringUtils.isNotBlank(zans)){ + List<Long> zanIds = StringUtils.strToCollToLong(zans, ","); + List<Long> zaned = zanIds.stream().filter(zanid -> zanid.equals(user.getSuId())).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(zaned)){ + //取消赞 + List<Long> newZaned = zanIds.stream().filter(zanid -> !zanid.equals(user.getSuId())).collect(Collectors.toList()); + zans=StringUtils.collToStr(newZaned,","); + + }else{ + //点赞 + zanIds.add(user.getSuId()); + zans=StringUtils.collToStr(zanIds,","); + } + }else{ + //直接点赞 + zans=user.getSuId()+""; + } + followupDao.updateZan(id,zans); + return AjaxResult.buildSuccessInstance("修改成功"); + } + + + @ApiOperation(value = "评论跟进", notes = "评论跟进") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + @PostMapping(value = "/addFollowupComment") + public AjaxResult addFollowupComment(@RequestBody @Validated SysFollowupComment followupComment) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + followupComment.setCreateBy(user.getSuName()); + followupComment.setUpdateBy(user.getSuName()); + followupComment.setStaffId(user.getSuId()); + followupCommentDao.insert(followupComment); + return AjaxResult.buildSuccessInstance("评论成功"); + } + + + @ApiOperation(value = "查询跟进记录", notes = "查询跟进记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SysFollowup.class) + }) + @PostMapping(value = "/findFollowup") + public AjaxResult findFollowup(@RequestBody @Validated FollowupListDto followupListDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if(!DataAuthUtil.hasAllShopAuth()){ + followupListDto.setShopId(user.getShopId()); + } + followupListDto.setCompanyId(user.getCompanyId()); + followupListDto.setSelfStaff(user.getSuId()); + //TODO 需要设置跨店数据权限 + List<SysFollowup> rows= followupDao.selectByAppDto(followupListDto); + return AjaxResult.buildSuccessInstance(rows,"查询成功"); + } + + + + + + + + + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java new file mode 100644 index 0000000..5aaab06 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java @@ -0,0 +1,66 @@ +package com.matrix.system.app.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.dto.ArticleListDto; +import com.matrix.system.hive.action.BaseController; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.Article; +import com.matrix.system.hive.bean.ArticleType; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.dao.ArticleDao; +import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.service.ArticleService; +import com.matrix.system.hive.service.ArticleTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@Api(value = "ApiKnowledgeAction", tags = "知识库接口类") +@RestController +@RequestMapping(value = "/api/know") +public class ApiKnowledgeAction extends BaseController { + + @Autowired + private ArticleTypeService articleTypeService; + + + @Autowired + private ArticleService articleService; + + @ApiOperation(value = "获取知识库分类", notes = "获取知识库分类") + @GetMapping(value = "/findKnowledgeType") + public AjaxResult findKnowledgeType() { + ArticleType type = new ArticleType(); + type.setCompanyId(getMe().getCompanyId()); + return AjaxResult.buildSuccessInstance(articleTypeService.findByModel(type)); + } + + @ApiOperation(value = "根据分类获取文章列表", notes = "根据分类获取文章列表") + @PostMapping(value = "/findArticleList") + public AjaxResult findArticleList(@RequestBody ArticleListDto articleListDto) { + PaginationVO pageVo = new PaginationVO(); + pageVo.setOffset((articleListDto.getPageNum() - 1) * articleListDto.getPageSize()); + pageVo.setLimit(articleListDto.getPageSize()); + + Article article = new Article(); + QueryUtil.setQueryLimitCom(article); + article.setTypeId(articleListDto.getTypeId()); + return AjaxResult.buildSuccessInstance(articleService.findApiArticleListInPage(article, pageVo)); + } + + @ApiOperation(value = "获取文章详情页", notes = "获取文章详情页") + @GetMapping(value = "/findArticleDetail/{id}") + public AjaxResult findArticleDetail(@PathVariable("id") Long id) { + Article article = articleService.findById(id); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("article", article); + return ajaxResult; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java new file mode 100644 index 0000000..67a8262 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java @@ -0,0 +1,186 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.CreateOderItemDto; +import com.matrix.system.app.dto.CreateOrderDto; +import com.matrix.system.app.dto.OrderListDto; +import com.matrix.system.app.dto.ShoppingGoodsListDto; +import com.matrix.system.app.vo.OrderDetailVo; +import com.matrix.system.app.vo.ShoppingGoodsDetailVo; +import com.matrix.system.app.vo.ShoppingGoodsListVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.hive.pojo.ShoppingCarItem; +import com.matrix.system.hive.pojo.ShoppingCarItemsVo; +import com.matrix.system.hive.service.ShoppingGoodsCategoryService; +import com.matrix.system.hive.service.ShoppingGoodsService; +import com.matrix.system.hive.service.SysOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@Api(value = "ApiOrderAction", tags = "订单接口类") +@RestController +@RequestMapping(value = "/api/order") +public class ApiOrderAction { + + @Autowired + private ShoppingGoodsCategoryService shoppingGoodsCategoryService; + + @Autowired + private ShoppingGoodsService shoppingGoodsService; + + @Autowired + private SysOrderService sysOrderService; + + @Autowired + private SysShopInfoDao shopInfoDao; + + @ApiOperation(value = "获取商品类型列表", notes = "获取商品类型列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ShoppingGoodsCategory.class) + }) + @GetMapping(value = "/findShoppingGoodsType") + public AjaxResult findShoppingGoodsType() { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + SysShopInfo zbShop = shopInfoDao.selectZbShop(user.getCompanyId()); + ShoppingGoodsCategory category = new ShoppingGoodsCategory(); + category.setShopId(zbShop.getId()); + List<ShoppingGoodsCategory> list = new ArrayList<>(); + List<ShoppingGoodsCategory> byModel = shoppingGoodsCategoryService.findByModel(category); + ShoppingGoodsCategory type = new ShoppingGoodsCategory(); + type.setName("全部"); + type.setParentId(0L); + list.add(type); + list.addAll(byModel); + return AjaxResult.buildSuccessInstance(list); + } + + @ApiOperation(value = "获取商品列表", notes = "获取商品列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ShoppingGoodsListVo.class) + }) + @PostMapping(value = "/findShoppingGoods") + public AjaxResult findShoppingGoods(@RequestBody @Validated ShoppingGoodsListDto shoppingGoodsListDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if (!DataAuthUtil.hasAllShopAuth()) { + shoppingGoodsListDto.setShopId(user.getShopId()); + } + QueryUtil.setQueryLimitCom(shoppingGoodsListDto); + return AjaxResult.buildSuccessInstance(shoppingGoodsService.findShoppingGoodsListForApi(shoppingGoodsListDto), shoppingGoodsService.findShoppingGoodsListTotalForApi(shoppingGoodsListDto)); + } + + + @ApiOperation(value = "获取商品详情", notes = "获取商品详情") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ShoppingGoodsDetailVo.class) + }) + @GetMapping(value = "/findGoodsDetailById/{goodsId}") + public AjaxResult findGoodsDetailById(@PathVariable("goodsId") Long goodsId) { + ShoppingGoodsDetailVo goodsDetail = shoppingGoodsService.findApiShoppingGoodsDetailById(goodsId); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("goods", goodsDetail); + return ajaxResult; + } + + + @ApiOperation(value = "创建订单", notes = "创建订单") + @PostMapping(value = "/createOrder") + public AjaxResult createOrder(@RequestBody @Validated CreateOrderDto createOrderDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + ShoppingCarItemsVo car = new ShoppingCarItemsVo(); + car.setVipId(createOrderDto.getVipId()); + + if (CollectionUtils.isNotEmpty(createOrderDto.getItems())) { + List<ShoppingCarItem> list = new ArrayList<>(); + for (CreateOderItemDto item : createOrderDto.getItems()) { + ShoppingCarItem carItem = new ShoppingCarItem(); + carItem.setCount(item.getCount()); + carItem.setGoodsId(item.getGoodsId()); + carItem.setIsFree(item.getIsFree()); + carItem.setType(item.getGoodsType()); + + carItem.setShoppingGoods(shoppingGoodsService.findById(item.getGoodsId())); + list.add(carItem); + } + car.setCarItems(list); + } + int i = sysOrderService.createOrder(WebUtil.getSession(), car); + if (i > 0) { + return AjaxResult.buildSuccessInstance("下单成功"); + } + + return AjaxResult.buildFailInstance("下单失败"); + } + + @ApiOperation(value = "获取订单列表", notes = "获取订单列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = OrderDetailVo.class) + }) + @PostMapping(value = "/findOrderList") + public AjaxResult findOrderList(@RequestBody @Validated OrderListDto orderListDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + int offset = (orderListDto.getPageNum() - 1) * orderListDto.getPageSize(); + int limit = orderListDto.getPageSize(); + PaginationVO pageVo = new PaginationVO(); + pageVo.setOffset(offset); + pageVo.setLimit(limit); + + if (!DataAuthUtil.hasAllShopAuth()) { + orderListDto.setShopId(user.getShopId()); + } + QueryUtil.setQueryLimitCom(orderListDto); + return AjaxResult.buildSuccessInstance(sysOrderService.findApiOrderListInPage(orderListDto, pageVo), sysOrderService.findApiOrderListTotal(orderListDto)); + } + + @ApiOperation(value = "获取订单详情", notes = "获取订单详情") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = OrderDetailVo.class) + }) + @GetMapping(value = "/findOrderDetail/{orderId}") + public AjaxResult findOrderDetail(@PathVariable("orderId") Long orderId) { + OrderDetailVo orderDetail = sysOrderService.findApiOrderDetailByOrderId(orderId); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("orderDetail", orderDetail); + return ajaxResult; + } + + @ApiOperation(value = "取消订单", notes = "取消订单") + @GetMapping(value = "/cancelOrder/{orderId}") + public AjaxResult cancelOrder(@PathVariable("orderId") Long orderId) { + SysOrder order = sysOrderService.findById(orderId); + if (order == null) { + throw new GlobleException("订单不存在"); + } + + + int i = sysOrderService.cancelOrder(orderId); + if (i > 0) { + return AjaxResult.buildSuccessInstance("取消成功"); + } + return AjaxResult.buildFailInstance("取消失败"); + } + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java new file mode 100644 index 0000000..c6fa5d6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java @@ -0,0 +1,102 @@ +package com.matrix.system.app.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.app.dto.RankingDto; +import com.matrix.system.app.vo.RankingVo; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.bean.SysOrder; +import com.matrix.system.hive.dao.AchieveNewDao; +import com.matrix.system.hive.service.AchieveNewService; +import com.matrix.system.hive.service.SysOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@Api(value = "ApiRankingAction", tags = "排行榜接口类") +@RestController +@RequestMapping(value ="/api/ranking") +public class ApiRankingAction { + + @Autowired + private SysOrderService sysOrderService; + + @Autowired + private AchieveNewDao achieveNewDao; + + @ApiOperation(value = "顾问业绩排行榜", notes = "顾问业绩排行榜") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = RankingVo.class) + }) + @PostMapping(value = "/findStaffAchieveRanking") + public AjaxResult findStaffAchieveRanking(@RequestBody RankingDto rankingDto) { + AchieveNew achieveNew = new AchieveNew(); + QueryUtil.setQueryLimitCom(achieveNew); + achieveNew.setType(rankingDto.getType()); + achieveNew.setDatatime(new Date()); + return AjaxResult.buildSuccessInstance(achieveNewDao.selectStaffSaleAchieveRanking(achieveNew)); + } + + @ApiOperation(value = "门店业绩排行榜", notes = "门店业绩排行榜") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = RankingVo.class) + }) + @PostMapping(value = "/findShopAchieveRanking") + public AjaxResult findShopAchieveRanking(@RequestBody RankingDto rankingDto) { + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + AchieveNew achieveNew = new AchieveNew(); + QueryUtil.setQueryLimitCom(achieveNew); + achieveNew.setT1(rankingDto.getType()); + achieveNew.setDatatime(new Date()); + + if (RankingDto.SALE.equals(rankingDto.getDataType())) { + List<RankingVo> list = achieveNewDao.selectShopSaleAchieveRanking(achieveNew); + ajaxResult.setRows(list); + } else { + List<RankingVo> rankingVos = achieveNewDao.selectShopConsumeAchieveRanking(achieveNew); + ajaxResult.setRows(rankingVos); + } + return ajaxResult; + } + + @ApiOperation(value = "美疗师业绩排行榜", notes = "美疗师业绩排行榜") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = RankingVo.class) + }) + @PostMapping(value = "/findBeauticianAchieveRanking") + public AjaxResult findBeauticianAchieveRanking(@RequestBody RankingDto rankingDto) { + AchieveNew achieveNew = new AchieveNew(); + QueryUtil.setQueryLimitCom(achieveNew); + achieveNew.setDatatime(new Date()); + achieveNew.setT1(rankingDto.getType()); + return AjaxResult.buildSuccessInstance(achieveNewDao.selectBeauticianConsumeAchieveRanking(achieveNew)); + } + + @ApiOperation(value = "人头数排名", notes = "人头数排名") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = RankingVo.class) + }) + @PostMapping(value = "/findNumOfPeopleRanking") + public AjaxResult findNumOfPeopleRanking(@RequestBody RankingDto rankingDto) { + AchieveNew achieveNew = new AchieveNew(); + QueryUtil.setQueryLimitCom(achieveNew); + achieveNew.setDatatime(new Date()); + achieveNew.setT1(rankingDto.getType()); + return AjaxResult.buildSuccessInstance(achieveNewDao.selectNumOfPeopleAchieveRanking(achieveNew)); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiServiceOrderAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiServiceOrderAction.java new file mode 100644 index 0000000..6b1d335 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiServiceOrderAction.java @@ -0,0 +1,291 @@ +package com.matrix.system.app.action; + +import com.matrix.component.asyncmessage.AsyncMessageManager; +import com.matrix.component.rabbitmq.RabiitMqTemplate; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.pojo.VerifyResult; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.CreateServiceOrderDto; +import com.matrix.system.app.dto.IdSubmitDto; +import com.matrix.system.app.dto.ServiceOrderListDto; +import com.matrix.system.app.dto.ServiceVipProjDto; +import com.matrix.system.app.mapper.SysBeauticianStateMapper; +import com.matrix.system.app.mapper.SysProjServiceMapper; +import com.matrix.system.app.mapper.SysProjUseMapper; +import com.matrix.system.app.vo.*; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.constance.Dictionary; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.bean.SysProjUse; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.hive.service.SysBeauticianStateService; +import com.matrix.system.hive.service.SysProjServicesService; +import com.matrix.system.hive.service.SysProjUseService; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import com.matrix.system.wechart.templateMsg.UniformMsgParam; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@Api(value = "ApiServiceOrderAction", tags = "服务单接口类") +@RestController +@RequestMapping(value = "/api/serviceOrder") +public class ApiServiceOrderAction { + + @Autowired + private SysProjUseService projUseService; + + @Autowired + private SysVipInfoService sysVipInfoService; + + @Autowired + private SysProjServicesService projServicesService; + + @Autowired + private SysBeauticianStateService sysBeauticianStateService; + + + @Autowired + private AsyncMessageManager asyncMessageManager; + + @Value("${evn}") + private String evn; + + @ApiOperation(value ="获取用户项目/套餐列表", notes = "获取用户项目/套餐列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ServiceProductListVo.class) + }) + @PostMapping(value = "/findVipProject") + public AjaxResult findVipProject(@RequestBody @Validated ServiceVipProjDto serviceVipProjDto) { + SysVipInfo vipInfo = sysVipInfoService.findById(serviceVipProjDto.getVipId()); + + if (vipInfo == null) { + throw new GlobleException("会员不存在"); + } + + ServiceProductListVo productListVo = new ServiceProductListVo(); + productListVo.setName(vipInfo.getVipName()); + productListVo.setVipId(serviceVipProjDto.getVipId()); + + SysProjUse queryUse = new SysProjUse(); + queryUse.setVipId(serviceVipProjDto.getVipId()); + queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); + queryUse.setTaocanId(-1L); + if (serviceVipProjDto.getType() != null) { + switch (serviceVipProjDto.getType()) { + case "0": + break; + case "1": + queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); +// queryUse.setIsOver(Dictionary.FLAG_NO_N); + break; + case "2": + queryUse.setTargetFailTime(DateUtil.getDateAfterMonth(new Date(), 1)); + queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); +// queryUse.setIsOver(Dictionary.FLAG_NO_N); + break; + case "3": + queryUse.setStatus(Dictionary.TAOCAN_STATUS_WX); +// queryUse.setIsOver(Dictionary.FLAG_YES_Y); + break; + default: + queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); +// queryUse.setIsOver(Dictionary.FLAG_NO_N); + break; + } + } else { + queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); + } + + queryUse.setQueryKey(serviceVipProjDto.getQueryKey()); + List<SysProjUse> projList = projUseService.findInPage(queryUse, null); + List<ServiceProjVo> serviceProjVos = SysProjUseMapper.INSTANCE.entityListToProjVoList(projList); + + queryUse.setTaocanId(null); + queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); +// List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null); + List<SysProjUse> taoCanList = projUseService.findTaocaoProjUseWithProj(queryUse); + List<ServiceTcVo> serviceTcVos = SysProjUseMapper.INSTANCE.entityListToTcVoList(taoCanList); + + if (CollectionUtils.isNotEmpty(serviceTcVos)) { + serviceTcVos.forEach(item -> { +// List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()); + List<ServiceProjVo> taocanProj = SysProjUseMapper.INSTANCE.entityListToProjVoList(item.getTaocanProjUse()); + item.setTaocanProjUse(null); + item.setProj(taocanProj); + }); + } + + productListVo.setProj(serviceProjVos); + productListVo.setComposeProj(serviceTcVos); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("proj", productListVo); + return ajaxResult; + } + + @ApiOperation(value = "提交服务单", notes = "提交服务单") + @PostMapping(value = "/createServiceOrder") + public AjaxResult createServiceOrder(@RequestBody @Validated CreateServiceOrderDto serviceOrderDto) { + if (CollectionUtils.isEmpty(serviceOrderDto.getProjItems())) { + throw new GlobleException("请选择服务"); + } + SysVipInfo vipInfo = sysVipInfoService.findById(serviceOrderDto.getVipId()); + + + if (StringUtils.isNotBlank(vipInfo.getPassWord())) { + if (!vipInfo.getPassWord().equals(serviceOrderDto.getPassword())) { + return AjaxResult.buildFailInstance("资金密码错误"); + } + } + + SysProjServices sysProjServices = new SysProjServices(); + sysProjServices.setVipId(serviceOrderDto.getVipId()); + sysProjServices.setYyTime(serviceOrderDto.getYyTime()); + sysProjServices.setRemark(serviceOrderDto.getRemark()); + + List<SysBeauticianState> sysBeauticianStates = new ArrayList<>(); + serviceOrderDto.getProjItems().forEach(item ->{ + SysBeauticianState sysBeauticianState = SysBeauticianStateMapper.INSTANCE.serviceOrderItemVoToEntity(item); + + sysBeauticianState.setBeginTime(serviceOrderDto.getYyTime()); + sysBeauticianState.setEndTime(DateUtil.getDateAfterMinute(serviceOrderDto.getYyTime(), serviceOrderDto.getTotalTime())); + sysBeauticianState.setStaffId(serviceOrderDto.getBeautyId()); + sysBeauticianStates.add(sysBeauticianState); + }); + + sysProjServices.setServiceItems(sysBeauticianStates); + + //检测欠款 + VerifyResult arrearsVerifyResult = projServicesService.checkArrears(sysProjServices); + if (arrearsVerifyResult.isError()) { + return new AjaxResult(AjaxResult.STATUS_FAIL, arrearsVerifyResult.getMsg()); + } + //检测余次 + VerifyResult balanceverifyResult = projServicesService.checkBalance(sysProjServices); + if (balanceverifyResult.isError()) { + return new AjaxResult(AjaxResult.STATUS_FAIL, balanceverifyResult.getMsg()); + } + + // 设置状态为待预约 + sysProjServices.setState(Dictionary.SERVICE_STATU_DYY); + SysProjServices newSysProjServices = projServicesService.addSysProjServices(sysProjServices); + if (newSysProjServices != null) { + return AjaxResult.buildSuccessInstance("下单成功"); + } else { + return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); + } + } + + @ApiOperation(value = "查询服务单列表", notes = "查询服务单列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ServiceOrderListVo.class) + }) + @PostMapping(value = "/findServiceOrderList") + public AjaxResult findServiceOrderList(@RequestBody @Validated ServiceOrderListDto orderListDto) { + PaginationVO pageVo = new PaginationVO(); + int offset = (orderListDto.getPageNum() - 1) * orderListDto.getPageSize(); + int limit = orderListDto.getPageSize(); + pageVo.setOffset(offset); + pageVo.setLimit(limit); + + if (!DataAuthUtil.hasAllShopAuth()) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + orderListDto.setShopId(user.getShopId()); + } + QueryUtil.setQueryLimitCom(orderListDto); + return AjaxResult.buildSuccessInstance(projServicesService.findApiServiceOrderListInPage(orderListDto, pageVo), projServicesService.findApiServiceOrderListTotal(orderListDto)); + } + + @ApiOperation(value = "获取服务单详情", notes = "获取服务单详情") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ServiceOrderDetailVo.class) + }) + @GetMapping(value = "/findServiceOrderDetail/{id}") + public AjaxResult findServiceOrderDetail(@PathVariable("id") Long id) { + SysProjServices projServices = projServicesService.findById(id); + if (projServices == null) { + return AjaxResult.buildFailInstance("服务单不存在"); + } + + ServiceOrderDetailVo detailVo = SysProjServiceMapper.INSTANCE.projServiceToDetailVo(projServices); + + List<SysBeauticianState> beauticianStates = sysBeauticianStateService.findBySerId(projServices.getId()); + List<ServiceOrderDetailItemVo> items = SysBeauticianStateMapper.INSTANCE.entitiesToDetailItemsVo(beauticianStates); + detailVo.setItems(items); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("detail", detailVo); + return ajaxResult; + } + + @ApiOperation(value = "开始服务", notes = "开始服务") + @GetMapping(value = "/startService/{id}") + public AjaxResult startService(@PathVariable("id") Long id) { + SysProjServices sysProjServices = new SysProjServices(); + sysProjServices.setId(id); + int i = projServicesService.modifyFWKSProjServices(sysProjServices); + if (i > 0) { + return AjaxResult.buildSuccessInstance("开始服务成功"); + } + return AjaxResult.buildFailInstance("开始服务失败"); + } + + @ApiOperation(value = "结束服务", notes = "结束服务") + @GetMapping(value = "/stopService/{id}") + public AjaxResult stopService(@PathVariable("id") Long id) { + SysProjServices projServvices = new SysProjServices(); + projServvices.setId(id); + int result = projServicesService.modifyFWJSrojServices(projServvices); + if (result > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "结束服务成功"); + } else { + return new AjaxResult(AjaxResult.STATUS_FAIL, "结束服务失败"); + } + } + + @ApiOperation(value = "取消服务", notes = "取消服务") + @GetMapping(value = "/cancelService/{id}") + public AjaxResult cancelService(@PathVariable("id") Long id) { + SysProjServices services = new SysProjServices(); + services.setId(id); + int i = projServicesService.modifyCancelProjServices(services); + if (i > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "取消预约成功"); + } else { + return new AjaxResult(AjaxResult.STATUS_FAIL, "取消预约失败"); + } + } + + @ApiOperation(value = "确认服务", notes = "确认服务") + @PostMapping(value = "/confirmServiceOrder") + public AjaxResult confirmServiceOrder(@RequestBody @Validated IdSubmitDto idSubmitDto) { + int i=projServicesService.confirmServiceOrder(idSubmitDto.getId()); + if(i>0){ + return AjaxResult.buildSuccessInstance("确认成功"); + } + return AjaxResult.buildFailInstance("确认失败"); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiSettingAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiSettingAction.java new file mode 100644 index 0000000..47d0e49 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiSettingAction.java @@ -0,0 +1,54 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.SettingDto; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.hive.bean.AppVersion; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @author jyy + * @date 2020-12-21 + **/ +@CrossOrigin(origins = "*") +@Api(value = "ApiSettingAction", tags = "配置查询类") +@RestController +@RequestMapping(value = "/api/setting") +public class ApiSettingAction { + + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + + @ApiOperation(value = "获取app配置", notes = "获取app配置") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AppVersion.class) + }) + @GetMapping(value = "/findAppSettings") + public AjaxResult findAppSettings() { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); + result.putInMap(AppConstance.APP_BANNER_GL, busParameterSettingsDao.selectCompanyParamByCode(AppConstance.APP_BANNER_GL,user.getCompanyId())); + return result; + } + + @ApiOperation(value = "根据code获取配置", notes = "根据code获取配置") + @PostMapping(value = "/findAppSettingsByCode") + public AjaxResult findAppSettingsByCode(@RequestBody SettingDto settingDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); + result.putInMap(settingDto.getCode(), busParameterSettingsDao.selectCompanyParamByCode(settingDto.getCode(),user.getCompanyId())); + return result; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiShopInfoAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiShopInfoAction.java new file mode 100644 index 0000000..afa562a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiShopInfoAction.java @@ -0,0 +1,43 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.service.SysShopInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wzy + * @date 2020-12-30 + **/ +@Api(value = "ApiShopInfoAction", tags = "店铺信息接口类") +@RestController +@RequestMapping(value = "/api/shop") +public class ApiShopInfoAction { + + @Autowired + private SysShopInfoService shopInfoService; + + @ApiOperation(value = "获取门店列表", notes = "获取门店列表") + @GetMapping(value = "/findAllShopList") + public AjaxResult findAllShopList() { + SysShopInfo shopInfo = new SysShopInfo(); + QueryUtil.setQueryLimitCom(shopInfo); + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + if(!DataAuthUtil.hasAllShopAuth()){ + shopInfo.setId(sysUsers.getShopId()); + } + + return AjaxResult.buildSuccessInstance(shopInfoService.findByModel(shopInfo)); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiSkinCheckAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiSkinCheckAction.java new file mode 100644 index 0000000..1763057 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiSkinCheckAction.java @@ -0,0 +1,92 @@ +package com.matrix.system.app.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.app.dto.SkinCheckListDto; +import com.matrix.system.app.mapper.SysSkinCheckRecordMapper; +import com.matrix.system.app.vo.SkinCheckAnalysisItems; +import com.matrix.system.app.vo.SkinCheckDetailVo; +import com.matrix.system.app.vo.SkinCheckDiagnoseItemVo; +import com.matrix.system.app.vo.SkinCheckListVo; +import com.matrix.system.hive.bean.SysSkinCheckRecord; +import com.matrix.system.hive.dao.SysSkinCheckRecordDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.dao.ShopProductDao; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@Api(value = "ApiSkinCheckAction", tags = "皮肤检测接口类") +@RestController +@RequestMapping(value = "/api/skinCheck") +public class ApiSkinCheckAction { + + @Autowired + private SysSkinCheckRecordDao sysSkinCheckRecordDao; + + @Autowired + private ShopProductDao shopProductDao; + + @ApiOperation(value = "获取皮肤检测列表", notes = "获取皮肤检测列表") + @PostMapping(value = "/findSkinCheckList") + public AjaxResult findSkinCheckList(@RequestBody @Validated SkinCheckListDto skinCheckListDto) { + SysSkinCheckRecord sysSkinCheckRecord = new SysSkinCheckRecord(); + sysSkinCheckRecord.setUserId(skinCheckListDto.getVipId()); + + PaginationVO pageVo = new PaginationVO(); + pageVo.setOffset((skinCheckListDto.getPageNum() - 1) * skinCheckListDto.getPageSize()); + pageVo.setLimit(skinCheckListDto.getPageSize()); + pageVo.setSort("t1.create_time"); + pageVo.setOrder("desc"); + + List<SysSkinCheckRecord> dataList = sysSkinCheckRecordDao.selectInPage(sysSkinCheckRecord, pageVo); + List<SkinCheckListVo> list = SysSkinCheckRecordMapper.INSTANCE.entitiesToListVos(dataList); + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, + sysSkinCheckRecordDao.selectTotalRecord(sysSkinCheckRecord)); + return result; + } + + + @ApiOperation(value = "获取皮肤检测详情", notes = "获取皮肤检测详情") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SkinCheckDetailVo.class) + }) + @GetMapping(value = "/findSkinCheckDetail/{id}") + public AjaxResult findSkinCheckDetail(@PathVariable("id") Long id) { + + SysSkinCheckRecord sysSkinCheckRecord = sysSkinCheckRecordDao.selectById(id); + + SysSkinCheckRecordMapper instance = SysSkinCheckRecordMapper.INSTANCE; + SkinCheckDetailVo detail = instance.entityToDetailVo(sysSkinCheckRecord); + detail.setSex(sysSkinCheckRecord.getSex()); + List<SkinCheckDiagnoseItemVo> diagnoseItems = instance.entitiesToDiagnoseItems(sysSkinCheckRecord.getAnalysisDetail()); + List<SkinCheckAnalysisItems> analysisItems = instance.entitiesToAnalysisItems(sysSkinCheckRecord.getSkinDetails()); + + analysisItems.forEach(item -> { + List<Integer> ids = StringUtils.strToCollToInteger(item.getProductIds(), ","); + if(CollectionUtils.isNotEmpty(ids)){ + List<String> shopProducts = shopProductDao.selectProductNameByIds(ids); + item.setProducts(shopProducts); + } + }); + + detail.setDiagnoseItems(diagnoseItems); + detail.setAnalysisItems(analysisItems); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("detail", detail); + return ajaxResult; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java new file mode 100644 index 0000000..3cdc992 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java @@ -0,0 +1,321 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.BusinessesDto; +import com.matrix.system.app.dto.VipStatisticsParamDto; +import com.matrix.system.app.vo.BeauticianVo; +import com.matrix.system.app.vo.BusinessesDataShowVo; +import com.matrix.system.app.vo.VipAchieveDataShowVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.bean.SysBusinessData; +import com.matrix.system.hive.dao.SysBusinessDataDao; +import com.matrix.system.hive.service.imp.DataAnalysisCustomerServiceImpl; +import com.matrix.system.hiveErp.analysUtil.*; +import com.matrix.system.hiveErp.dao.TjVipSumDao; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.jsoup.helper.DataUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.*; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@Api(value = "ApiStatisticsAction", tags = "报表接口类") +@RestController +@RequestMapping(value = "/api/statistics") +public class ApiStatisticsAction { + + @Autowired + TjVipSumDao tjVipSumDao; + + @Autowired + private SysBusinessDataDao sysBusinessDataDao; + + @Autowired + private DataAnalysisCustomerServiceImpl dataAnalysisCustomerService; + + @ApiOperation(value = "公司经营报表/门店经营报表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = BusinessesDataShowVo.class) + }) + @PostMapping(value = "/findShopBusinessesData") + public AjaxResult findShopBusinessesData(@RequestBody BusinessesDto businessesDto) { + String unit = ""; + int calenderUnit; + if (BusinessesDto.DAY.equals(businessesDto.getType())) { + unit = "日"; + calenderUnit = Calendar.DATE; + } else { + unit = "月"; + calenderUnit = Calendar.MONTH; + } + + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + int start = (businessesDto.getPageNum() - 1) * businessesDto.getPageSize(); + int size = businessesDto.getPageSize(); + Calendar calendar = Calendar.getInstance(); + calendar.add(calenderUnit, 1); + calendar.add(calenderUnit, -start); + String endTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + calendar.add(calenderUnit, -size); + String startTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(startTime, endTime, unit); + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + List<StatisticsTimeDaoParam> statisticsTimeDaoParams = timeSpaceParam.subList(0, timeSpaceParam.size() - 2); + List<BusinessesDataShowVo> list = sysBusinessDataDao.selectApiBusinessData(statisticsTimeDaoParams, businessesDto.getShopId(), user.getCompanyId()); + + List<BusinessesDataShowVo> result = new ArrayList<>(); + for (int i = list.size() - 1; i >= 0; i--) { + BusinessesDataShowVo item = list.get(i); + String dataTime = item.getDataTime(); + if (BusinessesDto.DAY.equals(businessesDto.getType())) { + item.setDataTime(DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.DATE_FORMAT_DD), DateUtil.DATE_FORMAT_DD)); + } else { + item.setDataTime(DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.MONTH), DateUtil.MONTH)); + } + result.add(item); + } + return AjaxResult.buildSuccessInstance(result); + } + + public static void main(String[] args) { + int start = 1; + + int end = 10; + + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DATE, start); + Date time = calendar.getTime(); + System.out.println(time); + calendar.add(Calendar.DATE, end); + System.out.println(calendar.getTime()); + + } + + @ApiOperation(value = "专项", notes = "专项") + @PostMapping(value = "/findBusinessInCome") + public AjaxResult findBusinessInCome(@RequestBody @Validated StatisticsParamVo statisticsParam) { + if (statisticsParam.getShopId() != null) { + AjaxResult ajaxResult = dataAnalysisCustomerService.getAnalysisResult(statisticsParam, new Caculate<BigDecimal>() { + @Override + public Map<String, BigDecimal> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { + switch (statisticsParam.getType()) { + case "1" : + return tjVipSumDao.selectBusinessInCome(timeSpaceParam, shopId, null); + case "2" : + return tjVipSumDao.selectCashIncome(timeSpaceParam, shopId, null); + case "3" : + return tjVipSumDao.selectCardUse(timeSpaceParam, shopId, null); + case "4" : + return tjVipSumDao.selectArrears(timeSpaceParam, shopId, null); + case "5" : + return tjVipSumDao.selectCashRefund(timeSpaceParam, shopId, null); + case "6" : + return tjVipSumDao.selectCardRefund(timeSpaceParam, shopId, null); + case "7": + return tjVipSumDao.selectProductAchieve(timeSpaceParam, shopId, null); + case "8": + return tjVipSumDao.selectCardAchieve(timeSpaceParam, shopId, null); + case "9": + return tjVipSumDao.selectRepayment(timeSpaceParam, shopId, null); + case "10": + return tjVipSumDao.selectPerCustomCnt(timeSpaceParam, shopId, null); + case "11": + return tjVipSumDao.selectCustomGoodsCnt(timeSpaceParam, shopId, null); + case "12": + return tjVipSumDao.selectPerCustomPrice(timeSpaceParam, shopId, null); + case "13": + return tjVipSumDao.selectCost(timeSpaceParam, shopId, null); + case "14": + return tjVipSumDao.selectGrossProfit(timeSpaceParam, shopId, null); + case "15": + return tjVipSumDao.selectGrossProfitRate(timeSpaceParam, shopId, null); + case "16" : + return tjVipSumDao.selectHisConsume(timeSpaceParam, shopId, null); + case "17" : + return tjVipSumDao.selectFreeConsume(timeSpaceParam, shopId, null); + case "18" : + return tjVipSumDao.selectPeopleCnt(timeSpaceParam, shopId, null); + case "19" : + return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, shopId, null); + case "20" : + return tjVipSumDao.selectTimeLength(timeSpaceParam, shopId, null); + case "21" : + return tjVipSumDao.selectCardAmount(timeSpaceParam, shopId, null); + case "22" : + return tjVipSumDao.selectFreeAmount(timeSpaceParam, shopId, null); + default : + return tjVipSumDao.selectBusinessInCome(timeSpaceParam, shopId, null); + } + } + }); + return setDataList(ajaxResult); + } else { + AjaxResult ajaxResult = dataAnalysisCustomerService.getCompanyAnalysisResult(statisticsParam, new Caculate<BigDecimal>() { + @Override + public Map<String, BigDecimal> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { + switch (statisticsParam.getType()) { + case "1" : + return tjVipSumDao.selectBusinessInCome(timeSpaceParam, null, companyId); + case "2" : + return tjVipSumDao.selectCashIncome(timeSpaceParam, null, companyId); + case "3" : + return tjVipSumDao.selectCardUse(timeSpaceParam, null, companyId); + case "4" : + return tjVipSumDao.selectArrears(timeSpaceParam, null, companyId); + case "5" : + return tjVipSumDao.selectCashRefund(timeSpaceParam, null, companyId); + case "6" : + return tjVipSumDao.selectCardRefund(timeSpaceParam, null, companyId); + case "7": + return tjVipSumDao.selectProductAchieve(timeSpaceParam, null, companyId); + case "8": + return tjVipSumDao.selectCardAchieve(timeSpaceParam, null, companyId); + case "9": + return tjVipSumDao.selectRepayment(timeSpaceParam, null, companyId); + case "10": + return tjVipSumDao.selectPerCustomCnt(timeSpaceParam, null, companyId); + case "11": + return tjVipSumDao.selectCustomGoodsCnt(timeSpaceParam, null, companyId); + case "12": + return tjVipSumDao.selectPerCustomPrice(timeSpaceParam, null, companyId); + case "13": + return tjVipSumDao.selectCost(timeSpaceParam, null, companyId); + case "14": + return tjVipSumDao.selectCost(timeSpaceParam, null, companyId); + case "15": + return tjVipSumDao.selectCost(timeSpaceParam, null, companyId); + case "16" : + return tjVipSumDao.selectHisConsume(timeSpaceParam, null, companyId); + case "17" : + return tjVipSumDao.selectFreeConsume(timeSpaceParam, null, companyId); + case "18" : + return tjVipSumDao.selectPeopleCnt(timeSpaceParam, null, companyId); + case "19" : + return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, null, companyId); + case "20" : + return tjVipSumDao.selectTimeLength(timeSpaceParam, null, companyId); + case "21" : + return tjVipSumDao.selectCardAmount(timeSpaceParam, null, companyId); + case "22" : + return tjVipSumDao.selectFreeAmount(timeSpaceParam, null, companyId); + default : + return tjVipSumDao.selectBusinessInCome(timeSpaceParam, null, companyId); + } + } + }); + return setDataList(ajaxResult); + } + } + + private AjaxResult setDataList(AjaxResult ajaxResult) { + List<SeriesVo> list = (List<SeriesVo>) ajaxResult.getMapInfo().get("series"); + String[] xAxis = (String[]) ajaxResult.getMapInfo().get("xAxis"); + String [] data = list.get(0).getData(); + if (data != null && data.length != 0) { + List<Map<String, String>> dataList = new ArrayList<>(); + for(int i = data.length - 1; i >= 0; i--) { + Map<String, String> map = new HashMap<>(); + map.put(xAxis[i], data[i]); + dataList.add(map); + } + ajaxResult.setRows(dataList); + } + + return ajaxResult; + } + + + @ApiOperation(value = "查询员工业绩报表", notes = "查询员工业绩报表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = VipAchieveDataShowVo.class) + }) + @PostMapping(value = "/findVipAchieve") + public AjaxResult findVipAchieve(@RequestBody BusinessesDto businessesDto) { + String unit = ""; + int calenderUnit; + if (BusinessesDto.DAY.equals(businessesDto.getType())) { + unit = "日"; + calenderUnit = Calendar.DATE; + } else { + unit = "月"; + calenderUnit = Calendar.MONTH; + } + + int start = (businessesDto.getPageNum() - 1) * businessesDto.getPageSize(); + int size = businessesDto.getPageSize(); + Calendar calendar = Calendar.getInstance(); + calendar.add(calenderUnit, 1); + calendar.add(calenderUnit, -start); + String endTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + calendar.add(calenderUnit, -size); + String startTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(startTime, endTime, unit); + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + List<StatisticsTimeDaoParam> statisticsTimeDaoParams = timeSpaceParam.subList(0, timeSpaceParam.size() - 2); + List<VipAchieveDataShowVo> list = tjVipSumDao.selectVipAchieveInPage(statisticsTimeDaoParams, businessesDto.getStaffId()); + + List<VipAchieveDataShowVo> result = new ArrayList<>(); + for (int i = list.size() - 1; i >= 0; i--) { + VipAchieveDataShowVo item = list.get(i); + String dataTime = item.getTime(); + if (BusinessesDto.DAY.equals(businessesDto.getType())) { + item.setTime(DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.DATE_FORMAT_DD), DateUtil.DATE_FORMAT_DD)); + } else { + item.setTime(DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.MONTH), DateUtil.MONTH)); + } + result.add(item); + } + return AjaxResult.buildSuccessInstance(result); + } + + @ApiOperation(value = "员工专项", notes = "员工专项") + @PostMapping(value = "/findVipBusinessData") + public AjaxResult findVipBusinessData(@RequestBody @Validated VipStatisticsParamDto vipStatisticsParamDto) { + AjaxResult ajaxResult = dataAnalysisCustomerService.getStaffAnalysisResult(vipStatisticsParamDto, new Caculate<BigDecimal>() { + @Override + public Map<String, BigDecimal> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long staffId) { + switch (vipStatisticsParamDto.getType()) { + case "1" : + return tjVipSumDao.selectStaffOrderAchieve(timeSpaceParam, staffId); + case "2" : + return tjVipSumDao.selectStaffCashAchieve(timeSpaceParam, staffId); + case "3" : + return tjVipSumDao.selectStaffCardAchieve(timeSpaceParam, staffId); + case "4" : + return tjVipSumDao.selectStaffGoodsAchieve(timeSpaceParam, staffId); + case "5" : + return tjVipSumDao.selectStaffHisConsumeAchieve(timeSpaceParam, staffId); + case "6" : + return tjVipSumDao.selectStaffFreeConsumeAchieve(timeSpaceParam, staffId); + case "7" : + return tjVipSumDao.selectStaffCommissionAchieve(timeSpaceParam, staffId); + case "8" : + return tjVipSumDao.selectStaffPeopleNum(timeSpaceParam, staffId); + case "9" : + return tjVipSumDao.selectStaffProjNum(timeSpaceParam, staffId); + case "10" : + return tjVipSumDao.selectStaffProjTime(timeSpaceParam, staffId); + default: + return tjVipSumDao.selectStaffOrderAchieve(timeSpaceParam, staffId); + } + } + }); + + return setDataList(ajaxResult); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java new file mode 100644 index 0000000..3be8eb5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java @@ -0,0 +1,82 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.StoreInOutListDto; +import com.matrix.system.app.dto.StoreListDto; +import com.matrix.system.app.mapper.SysStoreInfoMapper; +import com.matrix.system.app.vo.StoreInOutListVo; +import com.matrix.system.app.vo.StoreListVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.bean.SysStoreInfo; +import com.matrix.system.hive.dao.SysStoreInfoDao; +import com.matrix.system.hive.pojo.StoreInOutRecordVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@Api(value = "ApiStoreAction", tags = "库存管理接口类") +@RestController +@RequestMapping(value = "/api/store") +public class ApiStoreAction { + + @Autowired + private SysStoreInfoDao sysStoreInfoDao; + + @ApiOperation(value = "获取库存列表", notes = "获取库存列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = StoreListVo.class) + }) + @PostMapping(value = "/findStoreList") + public AjaxResult findStoreList(@RequestBody @Validated StoreListDto storeListDto) { + SysStoreInfo sysStoreInfo = new SysStoreInfo(); + + SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + sysStoreInfo.setShopId(users.getShopId()); + sysStoreInfo.setCompanyId(users.getCompanyId()); + sysStoreInfo.setQueryKey(storeListDto.getQueryKey()); + PaginationVO pageVo = new PaginationVO(); + pageVo.setOffset((storeListDto.getPageNum() - 1) * storeListDto.getPageSize()); + pageVo.setLimit(storeListDto.getPageSize()); + pageVo.setSort("c.goods_no"); + pageVo.setOrder("asc"); + + List<SysStoreInfo> dataList = sysStoreInfoDao.selectCountInPage(sysStoreInfo, pageVo); + List<StoreListVo> resultList = SysStoreInfoMapper.INSTANCE.entitiesToStoreVos(dataList); + + return new AjaxResult(AjaxResult.STATUS_SUCCESS, resultList, sysStoreInfoDao.selectCountTotalRecord(sysStoreInfo)); + } + + @ApiOperation(value = "获取商品出入库列表", notes = "获取商品出入库列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = StoreInOutListVo.class) + }) + @PostMapping(value = "/findGoodsInOutInfo") + public AjaxResult findGoodsInOutInfo(@RequestBody @Validated StoreInOutListDto storeInOutListDto) { + StoreInOutRecordVO inOutRecordVO = new StoreInOutRecordVO(); + inOutRecordVO.setBeginTime(storeInOutListDto.getStartTime()); + inOutRecordVO.setEndTime(storeInOutListDto.getEndTime()); + inOutRecordVO.setName(storeInOutListDto.getCode()); + + PaginationVO pageVo = new PaginationVO(); + pageVo.setOffset((storeInOutListDto.getPageNum() - 1) * storeInOutListDto.getPageSize()); + pageVo.setLimit(storeInOutListDto.getPageSize()); + List<StoreInOutRecordVO> dataList =sysStoreInfoDao.findStoreInOutRecord(inOutRecordVO,pageVo); + List<StoreInOutListVo> list = SysStoreInfoMapper.INSTANCE.recordVosToInOutListVos(dataList); + return AjaxResult.buildSuccessInstance(list,sysStoreInfoDao.findStoreInOutTotal(inOutRecordVO)); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java new file mode 100644 index 0000000..f0dcbb0 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java @@ -0,0 +1,201 @@ +package com.matrix.system.app.action; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.BeauticianDto; +import com.matrix.system.app.dto.ModifyUserDto; +import com.matrix.system.app.dto.PwdModifyDto; +import com.matrix.system.app.dto.UsersQueryDto; +import com.matrix.system.app.mapper.SysUsersMapper; +import com.matrix.system.app.mapper.SysWorkBeatuistaffMapper; +import com.matrix.system.app.vo.BeauticianVo; +import com.matrix.system.app.vo.UserAchieveVo; +import com.matrix.system.app.vo.UserInfoDetailVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.init.LocalCache; +import com.matrix.system.common.interceptor.ApiUserLoginInterceptor; +import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.common.tools.PasswordUtil; +import com.matrix.system.hive.action.BaseController; +import com.matrix.system.hive.bean.SysWorkBeatuistaff; +import com.matrix.system.hive.service.AchieveNewService; +import com.matrix.system.hive.service.SysWorkBeatuistaffService; +import com.matrix.system.hive.service.SysWorktimeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@Api(value = "ApiUsersAction", tags = "用户中心接口类") +@RestController +@RequestMapping(value = "/api/user") +public class ApiUsersAction extends BaseController { + + @Autowired + private AchieveNewService achieveNewService; + + @Autowired + private SysWorktimeService sysWorkTimeService; + + @Autowired + private SysUsersService sysUsersService; + + @Autowired + private SysWorkBeatuistaffService sysWorkBeatuistaffService; + + @Value("${login_private_key}") + private String privateKey; + + @ApiOperation(value = "个人中心--获取用户业绩接口 type 1-今日 2-昨天 3-本月 4-上月") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = UserAchieveVo.class) + }) + @GetMapping(value = "/findUserAchieve/{type}") + public AjaxResult findUserAchieve(@PathVariable("type") Integer type) { + UserAchieveVo achieveVo = achieveNewService.findUserAchieveByTime(type); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("achieve", achieveVo); + return ajaxResult; + } + + @ApiOperation(value = "获取美疗师列表 - 开始时间结束时间") + @ApiResponses( + @ApiResponse(code = 200, message = "Ok", response = BeauticianVo.class) + ) + @PostMapping(value = "/findBeauticianList") + public AjaxResult findBeauticianList(@RequestBody @Validated BeauticianDto beauticianDto) { +// SysBeauticianState sysBeauticianState = new SysBeauticianState(); +// sysBeauticianState.setBeginTime(beauticianDto.getStartTime()); +// sysBeauticianState.setEndTime(beauticianDto.getEndTime()); +// +// // 根据时间获取一段排班码 +// String panBanCodes = DateUtil.dateToString(sysBeauticianState.getBeginTime(),DateUtil.DATE_FORMAT_NO_SPLITE_DD); +// // 获取登陆的用户 +// SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); +// List<SysUsers> staffs=new ArrayList<>(); +// if(sysWorkTimeService.isInWorkTime(user.getShopId(),sysBeauticianState.getBeginTime(),sysBeauticianState.getEndTime())){ +// staffs= sysUsersService.findByCodeBeaStateShop(user.getShopId(), +// sysBeauticianState, panBanCodes); +// } + + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String panBanCodes = DateUtil.dateToString(beauticianDto.getStartTime(),DateUtil.DATE_FORMAT_NO_SPLITE_DD); + List<SysWorkBeatuistaff> workBeauty = sysWorkBeatuistaffService.findByDateStr(panBanCodes, user.getShopId()); + return new AjaxResult(AjaxResult.STATUS_SUCCESS, SysWorkBeatuistaffMapper.INSTANCE.workBeautysToBeautyVos(workBeauty), 0); + } + + @ApiOperation(value = "退出登陆", notes = "退出登陆") + @GetMapping(value = "/loginOut") + public AjaxResult loginOut(HttpServletRequest request) { + String token=ApiUserLoginInterceptor.resolveToken(request,privateKey); + LocalCache.remove(token); + return AjaxResult.buildSuccessInstance("退出成功"); + } + + @ApiOperation(value = "小程序退出登陆", notes = "小程序退出登陆") + @GetMapping(value = "/xcxloginOut/{code}") + public AjaxResult xcxloginOut(HttpServletRequest request, @PathVariable("code") String code) { + SysUsers hasBind = sysUsersService.findByOpenId(code, HostInterceptor.getCompanyId()); + if (hasBind != null) { + if(StrUtil.isNotBlank(hasBind.getOpenIds())) { + List<String> openIds = StrUtil.split(hasBind.getOpenIds(), ','); + openIds.remove(code); + + sysUsersService.modifyUserOpenId(CollUtil.join(openIds, ","), hasBind.getSuId()); + } + } + String token=ApiUserLoginInterceptor.resolveToken(request,privateKey); + LocalCache.remove(token); + return AjaxResult.buildSuccessInstance("退出成功"); + } + + @ApiOperation(value = "员工列表", notes = "员工列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = BeauticianVo.class) + }) + @PostMapping(value = "/findAllUsers") + public AjaxResult findAllUsers(@RequestBody UsersQueryDto usersQueryDto) { + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + SysUsers query = new SysUsers(); + if (DataAuthUtil.hasAllShopAuth()) { + query.setCompanyId(sysUsers.getCompanyId()); + } else { + query.setCompanyId(sysUsers.getCompanyId()); + query.setShopId(sysUsers.getShopId()); + } + query.setSuUserType("employee"); + query.setSuName(usersQueryDto.getQueryKey()); + List<SysUsers> list = sysUsersService.findByModel(query); + List<BeauticianVo> dataList = SysUsersMapper.INSTANCE.usersListToBeautyList(list); + return AjaxResult.buildSuccessInstance(dataList); + } + + @ApiOperation(value = "修改密码", notes = "修改密码") + @PostMapping(value = "/modifyPwd") + public AjaxResult modifyPwd(@RequestBody @Validated PwdModifyDto pwdModifyDto) throws UnsupportedEncodingException, NoSuchAlgorithmException { + SysUsers me = getMe(); + SysUsers user = sysUsersService.findById(me.getSuId()); + + SysUsers pwdUser = new SysUsers(); + pwdUser.setSuPassword(pwdModifyDto.getOldPwd()); + pwdUser.setSuRegisterTime(user.getSuRegisterTime()); + String pwd = PasswordUtil.getEncrypUserPwd(pwdUser); + if (!pwd.equals(user.getSuPassword())) { + return AjaxResult.buildFailInstance("老密码错误"); + } + + int i = sysUsersService.updateUserPassword(user.getSuId(), pwd); + if (i > 0) { + return AjaxResult.buildSuccessInstance("修改成功"); + } + return AjaxResult.buildFailInstance("修改失败"); + + } + + @ApiOperation(value = "获取当前登陆用户信息", notes = "获取当前登陆用户信息") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = UserInfoDetailVo.class) + }) + @GetMapping(value = "/findUserInfo") + public AjaxResult findUserInfo() { + SysUsers user = sysUsersService.findById(getMe().getSuId()); + + UserInfoDetailVo userInfoDetailVo = SysUsersMapper.INSTANCE.usersToDetailInfoVo(user); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("detail", userInfoDetailVo); + return ajaxResult; + } + + @ApiOperation(value = "编辑当前用户信息", notes = "编辑当前用户信息") + @PostMapping(value = "/modifyUserInfo") + public AjaxResult modifyUserInfo(@RequestBody @Validated ModifyUserDto modifyUserDto) { + SysUsers user = SysUsersMapper.INSTANCE.modifyUserDtoToUsers(modifyUserDto); + user.setSuId(getMe().getSuId()); + int i = sysUsersService.modifyByModel(user); + if (i > 0) { + return AjaxResult.buildSuccessInstance("修改成功"); + } + return AjaxResult.buildFailInstance("修改失败"); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java new file mode 100644 index 0000000..e7e992d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java @@ -0,0 +1,227 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.AddVipDto; +import com.matrix.system.app.dto.ModifyVipDto; +import com.matrix.system.app.dto.QuestionAnswerDto; +import com.matrix.system.app.dto.VipInfoListDto; +import com.matrix.system.app.mapper.MoneyCardUseMapper; +import com.matrix.system.app.mapper.QuestionMapper; +import com.matrix.system.app.vo.*; +import com.matrix.system.common.bean.CustomerDataDictionary; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.CustomerDataDictionaryDao; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.action.BaseController; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.VipAnswerDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.hive.service.MoneyCardUseService; +import com.matrix.system.hive.service.QuestionSerivce; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.hive.service.SysVipLevelService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@Api(value = "ApiVipInfoAction", tags = "会员接口类") +@RestController +@RequestMapping(value = "/api/vip") +public class ApiVipInfoAction extends BaseController { + + @Autowired + private SysVipInfoService sysVipInfoService; + + @Autowired + private SysVipLevelService sysVipLevelService; + + @Autowired + private CustomerDataDictionaryDao customerDataDictionaryDao; + + @Autowired + private MoneyCardUseService moneyCardUseService; + + @Autowired + private QuestionSerivce questionSerivce; + + @Autowired + private VipAnswerDao vipAnswerDao; + + @ApiOperation(value = "获取会员通讯录列表", notes = "获取会员通讯录列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = VipInfoListVo.class) + }) + @PostMapping(value = "/findVipInfoList") + public AjaxResult findVipInfoList(@RequestBody VipInfoListDto vipInfoListDto) { + if (StringUtils.isBlank(vipInfoListDto.getSort())) { + vipInfoListDto.setSort("zjm"); + } + + if (StringUtils.isBlank(vipInfoListDto.getOrder())) { + vipInfoListDto.setOrder("asc"); + } + + + int offset = (vipInfoListDto.getPageNum() - 1) * vipInfoListDto.getPageSize(); + int limit = vipInfoListDto.getPageSize(); + vipInfoListDto.setOffset(offset); + vipInfoListDto.setLimit(limit); + + + + + return AjaxResult.buildSuccessInstance(sysVipInfoService.findVipAddressBook(vipInfoListDto)); + } + + @ApiOperation(value = "根据id查询用户信息(通讯录及个人中心)", notes = "根据id查询用户信息") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = VipInfoVo.class) + }) + @GetMapping(value = "/findVipInfoById/{id}") + public AjaxResult findVipInfoById(@PathVariable("id") Long id) { + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + VipInfoVo vipInfoVo = sysVipInfoService.findApiVipInfoById(id); + ajaxResult.putInMap("vipInfo", vipInfoVo); + return ajaxResult; + } + + @ApiOperation(value = "根据id查询用户详细信息") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = VipInfoDetailVo.class) + }) + @GetMapping(value = "/findVipInfoDetailById/{id}") + public AjaxResult findVipInfoDetailById(@PathVariable("id") Long id) { + VipInfoDetailVo vipInfoDetailVo = sysVipInfoService.findVipInfoDetail(id); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("vipInfo", vipInfoDetailVo); + return ajaxResult; + } + + @ApiOperation(value = "查询会员类型", notes = "查询会员类型") + @ApiResponses( + @ApiResponse(code = 200, message = "ok", response = SysVipLevel.class) + ) + @GetMapping(value = "/findVipType") + public AjaxResult findVipType() { + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysVipLevel sysVipLevel = new SysVipLevel(); + if(!DataAuthUtil.hasAllShopAuth()) { + sysVipLevel.setShopId(sysUsers.getShopId()); + } + + return AjaxResult.buildSuccessInstance(sysVipLevelService.findByModel(sysVipLevel)); + } + + + @ApiOperation(value = "获取到店途径列表", notes = "获取到店途径列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = CustomerDataDictionary.class) + }) + @GetMapping(value = "/findArrivalWayList") + public AjaxResult findArrivalWayList() { + List<CustomerDataDictionary> ddtj = customerDataDictionaryDao.selectByParentCode("DDTJ", getMe().getCompanyId()); + return AjaxResult.buildSuccessInstance(ddtj); + } + + @ApiOperation(value = "添加会员", notes = "添加会员") + @PostMapping(value = "/addVip") + public AjaxResult addVip(@RequestBody @Validated AddVipDto addVipDto) { + int i = sysVipInfoService.apiAddVip(addVipDto); + if (i > 0) { + return AjaxResult.buildSuccessInstance("新增成功"); + } + return AjaxResult.buildFailInstance("新增失败"); + } + + @ApiOperation(value = "编辑会员", notes = "编辑会员") + @PostMapping(value = "/modifyVip") + public AjaxResult modifyVip(@RequestBody ModifyVipDto modifyVipDto) { + int i = sysVipInfoService.apiModifyVip(modifyVipDto); + if (i > 0) { + return AjaxResult.buildSuccessInstance("修改成功"); + } + return AjaxResult.buildFailInstance("修改失败"); + } + + @ApiOperation(value = "获取用户信息列表", notes = "获取用户信息列表") + @GetMapping(value = "/findAllVipInfo") + public AjaxResult findAllVipInfo() { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysVipInfo sysVipInfo = new SysVipInfo(); + if(!DataAuthUtil.hasAllShopAuth()) { + sysVipInfo.setShopId(user.getShopId()); + } + QueryUtil.setQueryLimitCom(sysVipInfo); + return AjaxResult.buildSuccessInstance(sysVipInfoService.findAll(sysVipInfo)); + } + + @ApiOperation(value = "卡项 - 获取会员卡项列表", notes = "卡项 - 获取会员卡项列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = VipCardListVo.class) + }) + @GetMapping(value = "/findVipCardInfo/{vipId}") + public AjaxResult findVipCardInfo(@PathVariable("vipId") Long vipId) { + MoneyCardUse moneyCardUse = new MoneyCardUse(); + moneyCardUse.setVipId(vipId); + List<MoneyCardUse> list = moneyCardUseService.findVipCardUseInPage(moneyCardUse, null); + + List<VipCardListVo> dataList = MoneyCardUseMapper.INSTANCE.entitiesToCardListVos(list); + return AjaxResult.buildSuccessInstance(dataList); + } + + @ApiOperation(value = "会员档案 - 获取客户档案问题", notes = "会员档案 - 获取客户档案问题") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = QuestionVo.class) + }) + @GetMapping(value = "/findVipQuestions/{vipId}") + public AjaxResult findVipQuestions(@PathVariable("vipId") Long vipId) { + // 获取会员所有的答案,分类型 + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + List<Question> questions = questionSerivce.findByVipId(vipId,user.getCompanyId()); + AjaxResult result = AjaxResult.buildSuccessInstance("获取成功"); + List<QuestionVo> list = QuestionMapper.INSTANCE.entitiesToVos(questions); + result.putInMap("questions", list); + return result; + } + + @ApiOperation(value = "会员档案 - 提交会员档案", notes = "会员档案 - 提交会员档案") + @PostMapping(value = "/saveVipQuestionsAnswer") + public AjaxResult saveVipQuestionsAnswer(@RequestBody QuestionAnswerDto questionAnswerDto) { + VipAnswer delAnswer = new VipAnswer(); + delAnswer.setVipId(questionAnswerDto.getVipId()); + vipAnswerDao.deleteByModel(delAnswer); + if (CollectionUtils.isNotEmpty(questionAnswerDto.getItems())) { + List<VipAnswer> vipAnswers = QuestionMapper.INSTANCE.dtosToVipAnswers(questionAnswerDto.getItems()); + vipAnswerDao.batchInsert(vipAnswers); + } + return AjaxResult.buildSuccessInstance("档案更新成功"); + } + + @ApiOperation(value = "用户是否存在资金密码", notes = "用户是否存在资金密码") + @GetMapping(value = "/isExistFundPassword/{vipId}") + public AjaxResult isExistFundPassword(@PathVariable(value = "vipId") Long vipId) { + SysVipInfo vipInfo = sysVipInfoService.findById(vipId); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + if (StringUtils.isNotBlank(vipInfo.getPassWord())) { + ajaxResult.putInMap("isExist", true); + } else { + ajaxResult.putInMap("isExist", false); + } + + return ajaxResult; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java new file mode 100644 index 0000000..3399e91 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java @@ -0,0 +1,82 @@ +package com.matrix.system.app.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.system.app.dto.LabelDto; +import com.matrix.system.hive.action.BaseController; +import com.matrix.system.hive.bean.SysVipLabel; +import com.matrix.system.hive.dao.SysVipLabelDao; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-22 + **/ +@Api(value = "ApiVipLabelAction", tags = "客户标签接口类") +@RestController +@RequestMapping(value = "/api/label") +public class ApiVipLabelAction extends BaseController { + + @Autowired + private SysVipLabelDao sysVipLabelDao; + + @ApiOperation(value = "获取标签列表", notes = "获取标签列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SysVipLabel.class) + }) + @PostMapping(value = "/findLabelList") + public AjaxResult findLabelByVipId(@RequestBody LabelDto labelDto) { + SysVipLabel sysVipLabel = new SysVipLabel(); + sysVipLabel.setCompanyId(getMe().getCompanyId()); + sysVipLabel.setIsAll(1); + sysVipLabel.setLabel(labelDto.getLabel()); + List<SysVipLabel> zbLabel = sysVipLabelDao.selectByModel(sysVipLabel); + + sysVipLabel = new SysVipLabel(); + sysVipLabel.setUserId(getMe().getSuId()); + sysVipLabel.setLabel(labelDto.getLabel()); + List<SysVipLabel> userLabel = sysVipLabelDao.selectByModel(sysVipLabel); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("allLabel", zbLabel); + ajaxResult.putInMap("myLabel", userLabel); + return ajaxResult; + } + + + @ApiOperation(value = "添加标签", notes = "添加标签") + @PostMapping(value = "/addLabel") + public AjaxResult addLabel(@RequestBody LabelDto labelDto) { + SysVipLabel sysVipLabel = new SysVipLabel(); + sysVipLabel.setCreateBy(getMe().getSuName()); + sysVipLabel.setLabel(labelDto.getLabel()); + sysVipLabel.setColor(labelDto.getColor()); + sysVipLabel.setShopId(getMe().getShopId()); + sysVipLabel.setCompanyId(getMe().getCompanyId()); + sysVipLabel.setUserId(getMe().getSuId()); + sysVipLabel.setIsAll(2); + int i = sysVipLabelDao.insert(sysVipLabel); + if (i > 0) { + return AjaxResult.buildSuccessInstance("添加成功"); + } else { + return AjaxResult.buildFailInstance("添加失败"); + } + } + + @ApiOperation(value = "删除标签", notes = "删除标签") + @GetMapping(value = "/delById/{id}") + public AjaxResult delById(@PathVariable("id") Long id) { + int i = sysVipLabelDao.deleteById(id); + if (i > 0) { + return AjaxResult.buildSuccessInstance("删除成功"); + } + return AjaxResult.buildFailInstance("删除失败"); + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/AppOccupancyController.java b/zq-erp/src/main/java/com/matrix/system/app/action/AppOccupancyController.java new file mode 100644 index 0000000..c4a5942 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/AppOccupancyController.java @@ -0,0 +1,60 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.vo.StoreListVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.constance.Dictionary; +import com.matrix.system.hive.action.BaseController; +import com.matrix.system.hive.action.OccupancyController; +import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysWorkBeatuistaff; +import com.matrix.system.hive.dao.SysBeauticianStateDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.hive.service.SysWorkBeatuistaffService; +import com.matrix.system.hive.service.SysWorktimeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * @author jiangyouyao + * @date 2016-12-24 + * @description 占用Controller + */ +@Api(value = "AppOccupancyController", tags = "员工预约情况") +@RestController +@RequestMapping(value = "/api/occupancy") +public class AppOccupancyController extends BaseController { + + @Resource + private OccupancyController occupancyController; + + /** + * 获取员工预约情况 + */ + @ApiOperation(value = "获取员工预约情况", notes = "获取员工预约情况,示例参数:2021-01-06") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = OccupancyController.OccupancySPan.class) + }) + @GetMapping(value = "/getKanban/{timeStr}") + AjaxResult showCwzyList(@PathVariable String timeStr) { + //TODO app的用户获不能在session中,方案要改 + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + return occupancyController.getCwzyList(timeStr,sysUsers.getShopId()); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/TestAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/TestAction.java new file mode 100644 index 0000000..51d2742 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/TestAction.java @@ -0,0 +1,24 @@ +package com.matrix.system.app.action; + +import com.matrix.core.pojo.AjaxResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@Api(value = "TestAction", tags = "测试类") +@RestController +@RequestMapping(value = "/api/test") +public class TestAction { + + @ApiOperation(value = "测试请求", notes = "测试请求") + @GetMapping(value = "/testQuery") + public AjaxResult testQuery() { + return null; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/authority/AppAuthorityManager.java b/zq-erp/src/main/java/com/matrix/system/app/authority/AppAuthorityManager.java new file mode 100644 index 0000000..fb84dee --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/authority/AppAuthorityManager.java @@ -0,0 +1,248 @@ +package com.matrix.system.app.authority; + +import cn.hutool.crypto.SecureUtil; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.authority.AuthorityManager; +import com.matrix.system.common.authority.strategy.LoginStrategy; +import com.matrix.system.common.bean.SysFnBtnRel; +import com.matrix.system.common.bean.SysFunction; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.init.LocalCache; +import com.matrix.system.common.service.SysFunctionService; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.Map.Entry; +import java.util.stream.Collectors; + +/** + * DefaultAuthorityManager 实现了权限控制接口 + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月6日 + */ +@Component +public class AppAuthorityManager implements AuthorityManager { + + private static final int DEFAULT_2 = 2; + + + @Autowired + SysFunctionService sysFunctionService; + + public static final String USER_POWER_REDISKEY_APP = "USER_POWER_APP"; + + public static final String USERFUNCTION = "userFunction"; + /** 用户所有路径权限的记录 **/ + public static final String USER_URL_MAPPING = "userUrlMapping"; + + private AppAuthorityManager() { + } + + public <T> T login(LoginStrategy loginStrategy) { + @SuppressWarnings("unchecked") + T user = (T) loginStrategy.login(); + WebUtil.setSessionAttribute(MatrixConstance.LOGIN_KEY, user); + WebUtil.setSessionAttribute(AppConstance.DEFAULT_AUTHORITYMANAGER, this); + return user; + } + + @Override + public void getLoginOut() { + WebUtil.getSession().removeAttribute(MatrixConstance.LOGIN_KEY); + } + + /** + * 判断用户是否具有按钮功能 + * + * @param matchStr + * @return + * @throws IllegalArgumentException + */ + @Override + public boolean isBtnPermitted(String matchStr) { + throw new UnsupportedOperationException("未实现"); + } + + /** + * 判断用户是否具有功能权限 + * @return + */ + @Override + public boolean isFnPermitted(String fnCode) { + throw new UnsupportedOperationException("未实现"); + } + + /** + * 初始化用户权限 + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月5日 + * @param result + * @param user + */ + public void initUserPower(AjaxResult result, SysUsers user) { + + // 记录用户所有的功能 + Map<String, SysFunction> userFunction = new HashMap<>(MatrixConstance.COLLECTION_SIZE); + // + List<String> userUrlMapping = new ArrayList<>(); + + + String redisKey = USER_POWER_REDISKEY_APP + SecureUtil.md5(user.getSuId()+""); + Map<String, Object> cachePowerMap = LocalCache.get(redisKey); + if (Objects.nonNull(cachePowerMap)) { + + userFunction = (Map<String, SysFunction>) cachePowerMap.get(USERFUNCTION); + + userUrlMapping = (List<String>) cachePowerMap.get(USER_URL_MAPPING); + + } else { + // 获取用户所有权限 + getUserFunction(user,userFunction, userUrlMapping); + + Map<String ,Object> powerMap=new HashMap<>(); + powerMap.put(USERFUNCTION, userFunction); + powerMap.put(USER_URL_MAPPING, userUrlMapping); + LocalCache.save(redisKey,powerMap); + } + + WebUtil.setSessionAttribute(USERFUNCTION, userFunction); + WebUtil.setSessionAttribute(USER_URL_MAPPING, userUrlMapping); + result.putInMap(USERFUNCTION, userFunction); + + } + + /** + * 获取用的功能,包括菜单功能和非菜单功能 + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月5日 + * @param userFunctionMap + * @param userUrlMapping + */ + private void getUserFunction(SysUsers sysUser, Map<String, SysFunction> userFunctionMap, + List<String> userUrlMapping) { + // 判断用户类型 + if (AppConstance.USER_TYPE_ADMIN.equals(sysUser.getSuUserType())) { + // 管理员拥有公司全部权限 + List<SysFunction> tempList = sysFunctionService.findCompanyFunction(sysUser.getCompanyId()); + + // 区分菜单和非菜单功能 + for (SysFunction sysFunction : tempList) { + + userFunctionMap.put(sysFunction.getFnCode(), sysFunction); + // 注册访问路径 + registerUrlMapping(userUrlMapping, sysFunction,true); + } + } else if (AppConstance.USER_TYPE_EMPLOYEE.equals(sysUser.getSuUserType())) { + // 普通员工账号只拥有自己所拥有的权限 + List<SysFunction> userFunctionList = sysFunctionService.findFunctionByRoleIds(sysUser.getRoleIds()); + for (SysFunction sysFunction : userFunctionList) { + + sysFunction.setSysFnBtnRel( + sysFunction.getSysFnBtnRel().stream().filter(item->StringUtils.isContentSet(item.getBtnValue(),sysFunction.getRpfBns())).collect(Collectors.toList()) + ); + + // TODO注册访问路径 + registerUrlMapping(userUrlMapping, sysFunction,false); + if (userFunctionMap.containsKey(sysFunction.getFnCode())) { + // 如果功能已经被添加到集合中则追加权限按钮 + SysFunction oneFunctionInMap = userFunctionMap.get(sysFunction.getFnCode()); + + // 为了方便判断所以用字符串记录一下 + if (StringUtils.isBlank(oneFunctionInMap.getRpfBns())) { + oneFunctionInMap.setRpfBns(sysFunction.getRpfBns()); + } else { + oneFunctionInMap.setRpfBns(oneFunctionInMap.getRpfBns() + "," + sysFunction.getRpfBns()); + } + } else { + // 如果是新功能则直接添加 + userFunctionMap.put(sysFunction.getFnCode(), sysFunction); + } + } + } + } + + /** + * 注册功能和按钮的访问路径 + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月8日 + * @param userUrlMapping + * @param sysFunction + */ + private void registerUrlMapping(List<String> userUrlMapping, SysFunction sysFunction, boolean isAdmin) { + String path = sysFunction.getFnPath(); + if (StringUtils.isNotBlank(path) && !userUrlMapping.contains(path)) { + userUrlMapping.add(path); + } + // 注册按钮路径 + List<SysFnBtnRel> btnRels = sysFunction.getSysFnBtnRel(); + if (CollectionUtils.isNotEmpty(btnRels)) { + for (SysFnBtnRel sysFnBtnRel : btnRels) { + //公司管理员可以添加所有按钮权限否则只能添加员工自己所有拥有的权限 + if(isAdmin ||StringUtils.isContentSet(sysFnBtnRel.getBtnValue(),sysFunction.getRpfBns())){ + String btnPath = sysFnBtnRel.getFbPath(); + if (StringUtils.isNotBlank(btnPath) && !userUrlMapping.contains(btnPath)) { + userUrlMapping.add(btnPath); + } + } + } + } + } + + /** + * 把菜单组装成树形结构 + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月5日 + * @param menuFunction + * @param menuFunctionMap + */ + private void assembleMenu(List<SysFunction> menuFunction, Map<String, SysFunction> menuFunctionMap) { + // 将map.entrySet()转换成list,并按照功能的FnSequence倒序 + List<Entry<String, SysFunction>> list = new ArrayList<>(menuFunctionMap.entrySet()); + Collections.sort(list, new Comparator<Entry<String, SysFunction>>() { + @Override + public int compare(Entry<String, SysFunction> o1, Entry<String, SysFunction> o2) { + Integer a = o1.getValue().getFnSequence() == null ? 0 : o1.getValue().getFnSequence(); + Integer b = o2.getValue().getFnSequence() == null ? 0 : o2.getValue().getFnSequence(); + return Integer.compare(b, a); + } + }); + // 获取菜单权限,思路:如果遍历map如果功能存在父节点,就找到父节点然后把子节点加入进去,这样就只需要遍历一次 + for (Entry<String, SysFunction> entry : list) { + String id = entry.getKey(); + + SysFunction function = menuFunctionMap.get(id); + // 如果是一级节点则直接存入菜单 + if (null == function.getFnParentId() || 0L == function.getFnParentId()) { + menuFunction.add(function); + } else { + // 非一级节点找到父节点后存入 + SysFunction parentFn = menuFunctionMap.get(String.valueOf(function.getFnParentId())); + if(parentFn!=null){ + List<SysFunction> childs = parentFn.getChilds(); + if (childs == null) { + parentFn.setChilds(new ArrayList<SysFunction>()); + } + parentFn.getChilds().add(function); + } + + } + } + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/AddVipDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/AddVipDto.java new file mode 100644 index 0000000..5c090c5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/AddVipDto.java @@ -0,0 +1,167 @@ +package com.matrix.system.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-22 + **/ +@ApiModel(value = "AddVipDto", description = "添加会员接收参数类") +public class AddVipDto { + @ApiModelProperty(value = "头像") + private String photo; + + @ApiModelProperty(value = "会员编号") + private String vipNo; + + @NotBlank(message = "姓名不能为空") + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @NotBlank(message = "手机号不能为空") + @ApiModelProperty(value = "手机号") + private String phone; + + @NotBlank(message = "性别不能为空") + @ApiModelProperty(value = "性别", example = "男/女") + private String sex; + + @NotNull(message = "生日不能为空") + @ApiModelProperty(value = "生日") + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + private Date birthday; + + @ApiModelProperty(value = "资金密码", example = "123456") + private String password; + + @ApiModelProperty(value = "省市区", example = "湖南省,长沙市,岳麓区") + private String areas; + + @ApiModelProperty(value = "详细地址") + private String address; + + @ApiModelProperty(value = "到店途径", example = "网络团购") + private String arrivalWay; + + @ApiModelProperty(value = "推荐人ID") + private Long recommendId; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "标签列表") + private List<String> labels; + + public String getVipNo() { + return vipNo; + } + + public void setVipNo(String vipNo) { + this.vipNo = vipNo; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public String getAreas() { + return areas; + } + + public void setAreas(String areas) { + this.areas = areas; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getArrivalWay() { + return arrivalWay; + } + + public void setArrivalWay(String arrivalWay) { + this.arrivalWay = arrivalWay; + } + + public Long getRecommendId() { + return recommendId; + } + + public void setRecommendId(Long recommendId) { + this.recommendId = recommendId; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public List<String> getLabels() { + return labels; + } + + public void setLabels(List<String> labels) { + this.labels = labels; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/ArticleListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ArticleListDto.java new file mode 100644 index 0000000..fa97fee --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ArticleListDto.java @@ -0,0 +1,26 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author wzy + * @date 2021-01-05 + **/ +@ApiModel(value = "ArticleListDto", description = "文章列表接收参数类") +public class ArticleListDto extends BasePageDto { + + @NotNull + @ApiModelProperty(value = "分类ID") + private Long typeId; + + public Long getTypeId() { + return typeId; + } + + public void setTypeId(Long typeId) { + this.typeId = typeId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/BasePageDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/BasePageDto.java new file mode 100644 index 0000000..971f729 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/BasePageDto.java @@ -0,0 +1,38 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "BasePageDto", description = "基础分页参数接收类") +public class BasePageDto { + + @NotNull(message = "参数不能为空") + @ApiModelProperty(value = "第几页", example = "1") + private Integer pageNum; + + @NotNull(message = "参数不能为空") + @ApiModelProperty(value ="数量", example = "10") + private Integer pageSize; + + public Integer getPageNum() { + return pageNum; + } + + public void setPageNum(Integer pageNum) { + this.pageNum = pageNum; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/BeauticianDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/BeauticianDto.java new file mode 100644 index 0000000..84cd5f1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/BeauticianDto.java @@ -0,0 +1,41 @@ +package com.matrix.system.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@ApiModel(value = "BeauticianDto", description = "获取美疗师列表接收参数类") +public class BeauticianDto { + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "开始时间") + private Date startTime; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "结束时间") + private Date endTime; + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/BusinessesDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/BusinessesDto.java new file mode 100644 index 0000000..0e5cf41 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/BusinessesDto.java @@ -0,0 +1,45 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "BusinessesDto", description = "门店/公司报表参数接受类") +public class BusinessesDto extends BasePageDto{ + + public static final String DAY = "1"; + + public static final String MONTH = "2"; + + @ApiModelProperty(value = "type 1-每日 2-每月", example = "1") + private String type; + + @ApiModelProperty(value = "门店ID", example = "34") + private Long shopId; + + @ApiModelProperty(value = "会员ID") + private Long staffId; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getStaffId() { + return staffId; + } + + public void setStaffId(Long staffId) { + this.staffId = staffId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/CreateOderItemDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateOderItemDto.java new file mode 100644 index 0000000..7dc234e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateOderItemDto.java @@ -0,0 +1,67 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "CreateOderItemDto", description = "提交订单明细接收类") +public class CreateOderItemDto { + + @NotNull(message = "商品ID不能为空") + @ApiModelProperty(value = "商品ID", example = "1234") + private Long goodsId; + + @NotNull(message = "数量不能为空") + @ApiModelProperty(value = "购买数量", example = "1") + private Integer count; + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "是否赠送 是/否", example = "否") + private String isFree; + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "商品类型", example = "家居产品") + private String goodsType; + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public Long getGoodsId() { + return goodsId; + } + + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public String getIsFree() { + if ("1".equals(isFree)) { + return "是"; + } else { + return "否"; + } + } + + public void setIsFree(String isFree) { + this.isFree = isFree; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/CreateOrderDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateOrderDto.java new file mode 100644 index 0000000..4b125c3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateOrderDto.java @@ -0,0 +1,39 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "CreateOrderDto", description = "提交订单接收类") +public class CreateOrderDto { + + @NotNull(message = "会员不能为空") + @ApiModelProperty(value = "会员Id", example = "361") + private Long vipId; + + + @ApiModelProperty(value = "购买商品明细") + private List<CreateOderItemDto> items; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public List<CreateOderItemDto> getItems() { + return items; + } + + public void setItems(List<CreateOderItemDto> items) { + this.items = items; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderDto.java new file mode 100644 index 0000000..30c0cfa --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderDto.java @@ -0,0 +1,100 @@ +package com.matrix.system.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@ApiModel(value = "CreateServiceOrderDto", description = "创建服务单接口接收参数类") +public class CreateServiceOrderDto { + + @NotNull(message = "请选择会员") + @ApiModelProperty(value = "会员ID") + private Long vipId; + +// @NotNull(message = "请选择美疗师") + @ApiModelProperty(value = "美疗师ID") + private Long beautyId; + + @NotNull(message = "请选择预约时间") + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "预约时间") + private Date yyTime; + + @ApiModelProperty(value = "选择的项目") + private List<CreateServiceOrderItemDto> projItems; + + @ApiModelProperty(value = "总时长") + private Integer totalTime; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "资金密码") + private String password; + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public Long getBeautyId() { + return beautyId; + } + + public void setBeautyId(Long beautyId) { + this.beautyId = beautyId; + } + + public Date getYyTime() { + return yyTime; + } + + public void setYyTime(Date yyTime) { + this.yyTime = yyTime; + } + + public List<CreateServiceOrderItemDto> getProjItems() { + return projItems; + } + + public void setProjItems(List<CreateServiceOrderItemDto> projItems) { + this.projItems = projItems; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Integer getTotalTime() { + return totalTime; + } + + public void setTotalTime(Integer totalTime) { + this.totalTime = totalTime; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderItemDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderItemDto.java new file mode 100644 index 0000000..6d886ae --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderItemDto.java @@ -0,0 +1,41 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@ApiModel(value = "CreateServiceOrderItemDto", description = "创建服务单参数接收类") +public class CreateServiceOrderItemDto { + + @NotNull(message = "请选择项目") + @ApiModelProperty(value = "项目ID") + private Long puseId; + + @NotNull(message = "请输入数量") + @Min(1) + @ApiModelProperty(value = "数量") + private Integer count; + + + public Long getPuseId() { + return puseId; + } + + public void setPuseId(Long puseId) { + this.puseId = puseId; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/FollowupListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/FollowupListDto.java new file mode 100644 index 0000000..722859f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/FollowupListDto.java @@ -0,0 +1,135 @@ +package com.matrix.system.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.anotations.Extend; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author jyy + * @date 2020-12-23 + **/ +@ApiModel(value = "FollowupCommonetListDto", description = "跟进记录查询参数") +public class FollowupListDto { + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "查询条数", example = "10") + private Integer limit = 10; + + @NotNull(message = "查询起点") + @ApiModelProperty(value = "第0条开始", example = "0") + private Integer offset = 0; + + @ApiModelProperty(value = "门店ID 后台自动赋值", example = "0") + private Long shopId; + + @ApiModelProperty(value = "公司ID 后台自动赋值", example = "0") + private Long companyId; + + @ApiModelProperty(value = "当前员工ID 后台自动赋值", example = "0") + private Long selfStaff; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "查询参数开始时间", example = "2021-01-10") + private Date startTime; + + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "查询参数结束时间", example = "2021-01-10") + private Date endTime; + + + @ApiModelProperty(value = "查询参数员工ID数组", example = "[1,2]") + private List<Long> staffIds; + + @ApiModelProperty(value = "查询参数客户ID数组", example = "[1,2]") + private List<Long> vipIds; + + @ApiModelProperty(value = "查询参数,查询跟进类型,1=全部,2=我发出的,3=我的团队", example = "1") + private Integer queryType=1; + + public Integer getQueryType() { + return queryType; + } + + public void setQueryType(Integer queryType) { + this.queryType = queryType; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getSelfStaff() { + return selfStaff; + } + + public void setSelfStaff(Long selfStaff) { + this.selfStaff = selfStaff; + } + + public List<Long> getStaffIds() { + return staffIds; + } + + public void setStaffIds(List<Long> staffIds) { + this.staffIds = staffIds; + } + + public List<Long> getVipIds() { + return vipIds; + } + + public void setVipIds(List<Long> vipIds) { + this.vipIds = vipIds; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/IdSubmitDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/IdSubmitDto.java new file mode 100644 index 0000000..5696b13 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/IdSubmitDto.java @@ -0,0 +1,26 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author wzy + * @date 2021-01-14 + **/ +@ApiModel(value = "IdSubmitDto", description = "根据id修改接口参数接收类") +public class IdSubmitDto { + + @NotNull + @ApiModelProperty(value = "id", example = "1") + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/LabelDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/LabelDto.java new file mode 100644 index 0000000..36b64f7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/LabelDto.java @@ -0,0 +1,36 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.hibernate.validator.constraints.Length; + +/** + * @author wzy + * @date 2021-01-22 + **/ +@ApiModel(value = "LabelDto", description = "添加标签接收参数接收类") +public class LabelDto { + + @Length(max = 10, message = "不能超过10") + @ApiModelProperty(value = "标签内容", example = "123") + private String label; + + @ApiModelProperty(value = "颜色", example = "#FFFFFF") + private String color; + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/LoginDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/LoginDto.java new file mode 100644 index 0000000..a919a3e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/LoginDto.java @@ -0,0 +1,48 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@ApiModel(value = "LoginDto", description = "手机端登陆接收类") +public class LoginDto { + + @ApiModelProperty(value = "用户名", example = "1234") + @NotBlank(message = "用户名或密码错误") + private String username; + + @ApiModelProperty(value = "密码", example = "123456") + @NotBlank(message = "用户名或密码错误") + private String password; + + private String openId; + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/ModifyUserDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ModifyUserDto.java new file mode 100644 index 0000000..3728b13 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ModifyUserDto.java @@ -0,0 +1,116 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; +import java.util.Date; + +/** + * @author wzy + * @date 2021-01-06 + **/ +@ApiModel(value = "ModifyUserDto", description = "编辑用户信息接口参数接收类") +public class ModifyUserDto { + + @ApiModelProperty(value = "头像") + private String photo; + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "英文名") + private String engName; + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "手机号") + private String telphone; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "生日") + private Date birthday; + + @ApiModelProperty(value = "邮箱") + private String email; + + @ApiModelProperty(value = "服务签名") + private String serviceSign; + + @ApiModelProperty(value = "地址") + private String address; + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEngName() { + return engName; + } + + public void setEngName(String engName) { + this.engName = engName; + } + + public String getTelphone() { + return telphone; + } + + public void setTelphone(String telphone) { + this.telphone = telphone; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getServiceSign() { + return serviceSign; + } + + public void setServiceSign(String serviceSign) { + this.serviceSign = serviceSign; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/ModifyVipDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ModifyVipDto.java new file mode 100644 index 0000000..85a5de1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ModifyVipDto.java @@ -0,0 +1,181 @@ +package com.matrix.system.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-22 + **/ +@ApiModel(value = "ModifyVipDto", description = "修改会员接收参数类") +public class ModifyVipDto { + + @ApiModelProperty(value = "头像") + private String photo; + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "会员ID") + private Long vipId; + + @ApiModelProperty(value = "会员编号") + private String vipNo; + + @NotBlank(message = "姓名不能为空") + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @NotBlank(message = "手机号不能为空") + @ApiModelProperty(value = "手机号") + private String phone; + + @NotBlank(message = "性别不能为空") + @ApiModelProperty(value = "性别", example = "男/女") + private String sex; + + @NotNull(message = "生日不能为空") + @ApiModelProperty(value = "生日") + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + private Date birthday; + + @Length(max = 6) + @ApiModelProperty(value = "资金密码", example = "123456") + private String password; + + @ApiModelProperty(value = "省市区", example = "湖南省,长沙市,岳麓区") + private String areas; + + @ApiModelProperty(value = "详细地址") + private String address; + + @ApiModelProperty(value = "到店途径", example = "网络团购") + private String arrivalWay; + + @ApiModelProperty(value = "推荐人ID") + private Long recommendId; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "标签列表") + private List<String> labels; + + public String getVipNo() { + return vipNo; + } + + public void setVipNo(String vipNo) { + this.vipNo = vipNo; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public String getAreas() { + return areas; + } + + public void setAreas(String areas) { + this.areas = areas; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getArrivalWay() { + return arrivalWay; + } + + public void setArrivalWay(String arrivalWay) { + this.arrivalWay = arrivalWay; + } + + public Long getRecommendId() { + return recommendId; + } + + public void setRecommendId(Long recommendId) { + this.recommendId = recommendId; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public List<String> getLabels() { + return labels; + } + + public void setLabels(List<String> labels) { + this.labels = labels; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/OrderListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/OrderListDto.java new file mode 100644 index 0000000..f6ba866 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/OrderListDto.java @@ -0,0 +1,84 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "OrderListDto", description = "订单列表接收参数类") +public class OrderListDto extends BasePageDto { + + @ApiModelProperty(value = "订单状态 0-全部 1-待付款 2-已付款 3-欠款 全部默认传空字符串", example = "1") + private Integer orderStatus; + + @ApiModelProperty(hidden = true) + private String status; + + @ApiModelProperty(value = "查询字段") + private String queryKey; + + @ApiModelProperty(hidden = true) + private Long shopId; + + @ApiModelProperty(hidden = true) + private Long companyId; + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public Integer getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(Integer orderStatus) { + this.orderStatus = orderStatus; + switch (orderStatus) { + case 0 : + this.status = ""; + break; + case 1: + this.status = "待付款"; + break; + case 2: + this.status = "已付款"; + break; + case 3: + this.status = "欠款"; + break; + default: + this.status = ""; + break; + } + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/PwdModifyDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/PwdModifyDto.java new file mode 100644 index 0000000..476a22a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/PwdModifyDto.java @@ -0,0 +1,38 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + +/** + * @author wzy + * @date 2021-01-06 + **/ +@ApiModel(value = "PwdModifyDto", description = "修改密码接口参数接收类") +public class PwdModifyDto { + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "老密码", example = "123456") + private String oldPwd; + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "新密码", example = "123456") + private String newPwd; + + public String getOldPwd() { + return oldPwd; + } + + public void setOldPwd(String oldPwd) { + this.oldPwd = oldPwd; + } + + public String getNewPwd() { + return newPwd; + } + + public void setNewPwd(String newPwd) { + this.newPwd = newPwd; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/PwdResetDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/PwdResetDto.java new file mode 100644 index 0000000..a102596 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/PwdResetDto.java @@ -0,0 +1,51 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + +/** + * @author wzy + * @date 2021-01-06 + **/ +@ApiModel(value = "PwdResetDto", description = "密码重置接收类") +public class PwdResetDto { + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "手机号", example = "11") + private String telphone; + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "验证码", example = "123456") + private String code; + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "新密码", example = "123456") + private String newPwd; + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getNewPwd() { + return newPwd; + } + + public void setNewPwd(String newPwd) { + this.newPwd = newPwd; + } + + public String getTelphone() { + return telphone; + } + + public void setTelphone(String telphone) { + this.telphone = telphone; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerDto.java new file mode 100644 index 0000000..37df68b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerDto.java @@ -0,0 +1,38 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@ApiModel(value = "QuestionAnswerDto", description = "提交客户档案接口参数接收类") +public class QuestionAnswerDto { + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "会员ID") + private Long vipId; + + @ApiModelProperty(value = "题目答案列表") + private List<QuestionAnswerItemDto> items; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public List<QuestionAnswerItemDto> getItems() { + return items; + } + + public void setItems(List<QuestionAnswerItemDto> items) { + this.items = items; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerItemDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerItemDto.java new file mode 100644 index 0000000..9d3c49a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerItemDto.java @@ -0,0 +1,56 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@ApiModel(value = "QuestionAnswerItemDto", description = "问题答案接收类") +public class QuestionAnswerItemDto { + + @ApiModelProperty(value = "问题ID") + private Long questionId; + + @ApiModelProperty(value = "会员ID") + private Long vipId; + + @ApiModelProperty(value = "答案Ids,逗号隔开") + private String answerId; + + @ApiModelProperty(value = "文本答案") + private String answerText; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public Long getQuestionId() { + return questionId; + } + + public void setQuestionId(Long questionId) { + this.questionId = questionId; + } + + public String getAnswerId() { + return answerId; + } + + public void setAnswerId(String answerId) { + this.answerId = answerId; + } + + public String getAnswerText() { + return answerText; + } + + public void setAnswerText(String answerText) { + this.answerText = answerText; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/RankingDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/RankingDto.java new file mode 100644 index 0000000..428491e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/RankingDto.java @@ -0,0 +1,44 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@ApiModel(value = "RankingDto", description = "排行榜参数接收类") +public class RankingDto { + + public static final String SALE = "1"; + public static final String CONSUME = "2"; + + public static final String DAY = "1"; + public static final String MONTH = "2"; + public static final String YEAR = "3"; + public static final String WEEK = "4"; + + @ApiModelProperty(value = "数据类型 1-销售 2-消耗", example = "1") + private String dataType; + + @ApiModelProperty(value = "排行榜类型 1-日榜 2-月榜 3-年榜 4-周榜", example = "1") + private String type; + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/ServiceOrderListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ServiceOrderListDto.java new file mode 100644 index 0000000..1b4373e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ServiceOrderListDto.java @@ -0,0 +1,104 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@ApiModel(value = "ServiceOrderListDto", description = "服务单列表参数接收类") +public class ServiceOrderListDto extends BasePageDto{ + + @ApiModelProperty(value = "查询参数") + private String queryKey; + + @ApiModelProperty(value = "状态 0/全部 1/待确认 2/待排班 3/待配料 4/待服务 5/服务中 6/已完成 ") + private String status; + + + @ApiModelProperty(hidden = true) + private Long shopId; + + @ApiModelProperty(hidden = true) + private Long userId; + + @ApiModelProperty(value = "客户ID") + private Long vipId; + + @ApiModelProperty(hidden = true) + private Long companyId; + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + switch (status) { + case "0" : + this.status = ""; + break; + case "1": + this.status = "待确认"; + break; + case "2": + this.status = "待预约"; + break; + case "3" : + this.status = "需配料"; + break; + case "4" : + this.status = "配料完成"; + break; + case "5" : + this.status = "服务中"; + break; + case "6" : + this.status = "服务完成"; + break; + default: + this.status = ""; + break; + } + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/ServiceVipProjDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ServiceVipProjDto.java new file mode 100644 index 0000000..7201321 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ServiceVipProjDto.java @@ -0,0 +1,48 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@ApiModel(value = "ServiceVipProjDto", description = "获取用户套餐/项目接收参数类") +public class ServiceVipProjDto { + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "会员ID") + private Long vipId; + + @ApiModelProperty(value = "查询参数") + private String queryKey; + + @ApiModelProperty(value = "类型 0-全部 1-有效 3-无效 2-一个月内过期") + private String type; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/SettingDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/SettingDto.java new file mode 100644 index 0000000..76865f9 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/SettingDto.java @@ -0,0 +1,13 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SettingDto", description = "根据code获取配置参数接收类") +public class SettingDto { + + @ApiModelProperty(value = "code", example = "1") + private String code; +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java new file mode 100644 index 0000000..b83e7a3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java @@ -0,0 +1,93 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "ShoppingGoodsListDto", description = "商品列表接受类") +public class ShoppingGoodsListDto { + + @ApiModelProperty(value = "商品名称/编号/拼音") + private String queryKey; + + @ApiModelProperty(value = "商品类型") + private String goodType; + + @ApiModelProperty(value = "类型ID", example = "13") + private Long cateId; + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "条数", example = "10") + private Integer pageSize = 10; + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "第几页", example = "1") + private Integer pageNum = 1; + + @ApiModelProperty(hidden = true) + private Long shopId; + + @ApiModelProperty(hidden = true) + private Long companyId; + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getGoodType() { + return goodType; + } + + public void setGoodType(String goodType) { + this.goodType = goodType; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public Long getCateId() { + return cateId; + } + + public void setCateId(Long cateId) { + this.cateId = cateId; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Integer getPageNum() { + return pageNum; + } + + public void setPageNum(Integer pageNum) { + this.pageNum = pageNum; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/SkinCheckListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/SkinCheckListDto.java new file mode 100644 index 0000000..5540113 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/SkinCheckListDto.java @@ -0,0 +1,22 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +@ApiModel(value = "SkinCheckListDto", description = "皮肤检测列表接收参数类") +public class SkinCheckListDto extends BasePageDto{ + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "会员ID", example = "361") + private Long vipId; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/SmsCodeDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/SmsCodeDto.java new file mode 100644 index 0000000..8c18339 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/SmsCodeDto.java @@ -0,0 +1,26 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + +/** + * @author wzy + * @date 2021-01-06 + **/ +@ApiModel(value = "SmsCodeDto", description = "短信发送接收参数类") +public class SmsCodeDto { + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "手机号") + private String telphone; + + public String getTelphone() { + return telphone; + } + + public void setTelphone(String telphone) { + this.telphone = telphone; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java new file mode 100644 index 0000000..c6db79d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java @@ -0,0 +1,54 @@ +package com.matrix.system.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@ApiModel(value = "InOutListDto", description = "商品出入库记录参数接收") +public class StoreInOutListDto extends BasePageDto { + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "开始时间") + private Date startTime; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "结束时间") + private Date endTime; + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "商品编号") + private String code; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/StoreListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/StoreListDto.java new file mode 100644 index 0000000..ee535e4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/StoreListDto.java @@ -0,0 +1,23 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@ApiModel(value = "StoreListDto", description = "库存列表参数接收类") +public class StoreListDto extends BasePageDto { + + @ApiModelProperty(value = "查询参数") + private String queryKey; + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/UploadPhotoDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/UploadPhotoDto.java new file mode 100644 index 0000000..13b7e85 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/UploadPhotoDto.java @@ -0,0 +1,26 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + +/** + * @author wzy + * @date 2021-01-06 + **/ +@ApiModel(value = "UploadPhotoDto", description = "图片上传接口接收参数类") +public class UploadPhotoDto { + + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "图片base64字符串") + private String base64; + + public String getBase64() { + return base64; + } + + public void setBase64(String base64) { + this.base64 = base64; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/UrlDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/UrlDto.java new file mode 100644 index 0000000..5faef85 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/UrlDto.java @@ -0,0 +1,12 @@ +package com.matrix.system.app.dto; + + +import lombok.Data; + +@Data +public class UrlDto { + + private String url; + + private String name; +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/UsersQueryDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/UsersQueryDto.java new file mode 100644 index 0000000..8374880 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/UsersQueryDto.java @@ -0,0 +1,23 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2021-01-05 + **/ +@ApiModel(value = "UsersQueryDto", description = "员工列表接口参数类") +public class UsersQueryDto { + + @ApiModelProperty(value = "查询参数") + private String queryKey; + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/VipInfoListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/VipInfoListDto.java new file mode 100644 index 0000000..1154bf5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/VipInfoListDto.java @@ -0,0 +1,122 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@ApiModel(value = "VipInfoListDto", description = "获取会员列表参数类") +public class VipInfoListDto extends BasePageDto { + + @ApiModelProperty(value = "查询参数(客户姓名/手机/会员编号/拼音)", example = "") + private String queryKey; + + @ApiModelProperty(value = "排序 desc/asc", example = "asc") + private String order = "asc"; + + @ApiModelProperty(value = "排序字段 monthArrived(本月到店次数) yearArrived(本年) used(消费) consume(消耗) vipLevel(会员等级) arriveTime(上次到店)", example = "zjm") + private String sort = "zjm"; + + @ApiModelProperty(value = "生日 1-三天内生日 2-本月生日 3-下月生日") + private String birthType; + + @ApiModelProperty(value = "会员类型ID") + private Long vipType; + + @ApiModelProperty(value = "其他 2-新客户 1-老客户") + private String other; + + @ApiModelProperty(hidden = true) + private Long shopId; + + @ApiModelProperty(hidden = true) + private Long companyId; + + @ApiModelProperty(hidden = true) + private int offset; + + @ApiModelProperty(hidden = true) + private int limit; + + public int getOffset() { + return offset; + } + + public void setOffset(int offset) { + this.offset = offset; + } + + public int getLimit() { + return limit; + } + + public void setLimit(int limit) { + this.limit = limit; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public String getOrder() { + return order; + } + + public void setOrder(String order) { + this.order = order; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public String getBirthType() { + return birthType; + } + + public void setBirthType(String birthType) { + this.birthType = birthType; + } + + public Long getVipType() { + return vipType; + } + + public void setVipType(Long vipType) { + this.vipType = vipType; + } + + public String getOther() { + return other; + } + + public void setOther(String other) { + this.other = other; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/VipStatisticsParamDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/VipStatisticsParamDto.java new file mode 100644 index 0000000..2f58a71 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/VipStatisticsParamDto.java @@ -0,0 +1,100 @@ +package com.matrix.system.app.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + +/** + * 统计查询条件 + * @author jyy + */ +@ApiModel(value = "VipStatisticsParamDto", description = "员工专项统计接收参数类") +public class VipStatisticsParamDto { + + public static final String COMPANY = "1"; + + public static final String SHOP = "2"; + + /** + * 开始时间 + */ + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "开始时间", example = "2020-12-01") + private String beginTime; + + /** + *结束时间 + */ + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "结束时间", example = "2020-12-31") + private String endTime; + /** + *统计单位 + */ + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "统计单位", example = "日") + private String statisticsUnit; + + /** + *对比单位 + */ + @ApiModelProperty(hidden = true) + private String contrastUnit; + /** + * 门店id + */ + @ApiModelProperty(value = "员工, 不传默认当前登陆用户") + private Long staffId; + + @ApiModelProperty(value = "类型 1-订单业绩 2-现金业绩 3-售卡业绩 4-产品业绩 5-划扣业绩 6-本金消耗 7-赠送消耗 8-服务提成 9-人头数 10-项目数 11-服务时长", example = "1") + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getStatisticsUnit() { + return statisticsUnit; + } + + public void setStatisticsUnit(String statisticsUnit) { + this.statisticsUnit = statisticsUnit; + } + + public String getContrastUnit() { + return contrastUnit; + } + + public void setContrastUnit(String contrastUnit) { + this.contrastUnit = contrastUnit; + } + + public Long getStaffId() { + return staffId; + } + + public void setStaffId(Long staffId) { + this.staffId = staffId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/MoneyCardUseMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/MoneyCardUseMapper.java new file mode 100644 index 0000000..8ad6f7d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/MoneyCardUseMapper.java @@ -0,0 +1,21 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.vo.VipCardListVo; +import com.matrix.system.hive.bean.MoneyCardUse; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@Mapper +public abstract class MoneyCardUseMapper { + public static final MoneyCardUseMapper INSTANCE = Mappers.getMapper(MoneyCardUseMapper.class); + + public abstract VipCardListVo entityToCardListVo(MoneyCardUse moneyCardUse); + + public abstract List<VipCardListVo> entitiesToCardListVos(List<MoneyCardUse> list); +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/QuestionMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/QuestionMapper.java new file mode 100644 index 0000000..c16b5d8 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/QuestionMapper.java @@ -0,0 +1,31 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.dto.QuestionAnswerDto; +import com.matrix.system.app.dto.QuestionAnswerItemDto; +import com.matrix.system.app.vo.QuestionVo; +import com.matrix.system.hive.bean.Question; +import com.matrix.system.hive.bean.VipAnswer; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@Mapper +public abstract class QuestionMapper { + public static final QuestionMapper INSTANCE = Mappers.getMapper(QuestionMapper.class); + + public abstract QuestionVo entityToVo(Question question); + + public abstract List<QuestionVo> entitiesToVos(List<Question> list); + + @Mapping(source = "questionId", target = "quesionId") + public abstract VipAnswer dtoToVipAnswer(QuestionAnswerItemDto questionAnswerDto); + + public abstract List<VipAnswer> dtosToVipAnswers(List<QuestionAnswerItemDto> list); + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysBeauticianStateMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysBeauticianStateMapper.java new file mode 100644 index 0000000..fc9f600 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysBeauticianStateMapper.java @@ -0,0 +1,34 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.dto.CreateServiceOrderItemDto; +import com.matrix.system.app.vo.ServiceOrderDetailItemVo; +import com.matrix.system.hive.bean.SysBeauticianState; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@Mapper +public abstract class SysBeauticianStateMapper { + public static final SysBeauticianStateMapper INSTANCE = Mappers.getMapper(SysBeauticianStateMapper.class); + + + public abstract SysBeauticianState serviceOrderItemVoToEntity(CreateServiceOrderItemDto dto); + + public abstract List<SysBeauticianState> orderItmesVoToEntityList(List<CreateServiceOrderItemDto> dtoList); + + @Mapping(source = "projUse.price", target = "price") + @Mapping(source = "projInfo.name", target = "name") + @Mapping(source = "projInfo.timeLength", target = "timeLength") + @Mapping(source = "beautiStaffInfo.suName", target = "beautyName") + @Mapping(source = "extract", target = "commission") + public abstract ServiceOrderDetailItemVo entityToDetailItemVo(SysBeauticianState sysBeauticianState); + + public abstract List<ServiceOrderDetailItemVo> entitiesToDetailItemsVo(List<SysBeauticianState> list); + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjServiceMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjServiceMapper.java new file mode 100644 index 0000000..9e5adc5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjServiceMapper.java @@ -0,0 +1,22 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.vo.ServiceOrderDetailVo; +import com.matrix.system.hive.bean.SysProjServices; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@Mapper +public abstract class SysProjServiceMapper { + public static final SysProjServiceMapper INSTANCE = Mappers.getMapper(SysProjServiceMapper.class); + + @Mapping(source = "state", target = "status") + @Mapping(source = "vipInfo.vipName", target = "vipName") + @Mapping(source = "vipInfo.phone", target = "phone") + @Mapping(source = "createStaffName", target = "staffName") + public abstract ServiceOrderDetailVo projServiceToDetailVo(SysProjServices projServices); +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjUseMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjUseMapper.java new file mode 100644 index 0000000..0bbf9f3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjUseMapper.java @@ -0,0 +1,37 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.vo.ServiceProjVo; +import com.matrix.system.app.vo.ServiceTcVo; +import com.matrix.system.hive.bean.SysProjUse; +import com.matrix.system.hive.bean.SysProjUseFlow; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@Mapper +public abstract class SysProjUseMapper { + public static final SysProjUseMapper INSTANCE = Mappers.getMapper(SysProjUseMapper.class); + + @Mapping(source = "projName", target = "name") + @Mapping(source = "failTime", target = "invalidTime") + @Mapping(source = "surplusCount", target = "count") + public abstract ServiceTcVo entityToServiceTcVo(SysProjUse sysProjUse); + + public abstract List<ServiceTcVo> entityListToTcVoList(List<SysProjUse> list); + + @Mapping(source = "projName", target = "name") + @Mapping(source = "failTime", target = "invalidTime") + @Mapping(source = "surplusCount", target = "count") + public abstract ServiceProjVo entityToServiceProjVo(SysProjUse sysProjUse); + + public abstract List<ServiceProjVo> entityListToProjVoList(List<SysProjUse> list); + + @Mapping(source = "id", target = "projUseId") + public abstract SysProjUseFlow projUseToFlow(SysProjUse sysProjUse); +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysSkinCheckRecordMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysSkinCheckRecordMapper.java new file mode 100644 index 0000000..411a311 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysSkinCheckRecordMapper.java @@ -0,0 +1,38 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.vo.SkinCheckAnalysisItems; +import com.matrix.system.app.vo.SkinCheckDetailVo; +import com.matrix.system.app.vo.SkinCheckDiagnoseItemVo; +import com.matrix.system.app.vo.SkinCheckListVo; +import com.matrix.system.hive.bean.SysSkinCheckRecord; +import com.matrix.system.hive.bean.SysSkinDetail; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +@Mapper +public abstract class SysSkinCheckRecordMapper { + public static final SysSkinCheckRecordMapper INSTANCE = Mappers.getMapper(SysSkinCheckRecordMapper.class); + + public abstract SkinCheckListVo entityToSkinCheckListVo(SysSkinCheckRecord sysSkinCheckRecord); + + public abstract List<SkinCheckListVo> entitiesToListVos(List<SysSkinCheckRecord> list); + + @Mapping(target = "sex", source = "ext2") + @Mapping(target = "vipName", source = "userName") + public abstract SkinCheckDetailVo entityToDetailVo(SysSkinCheckRecord sysSkinCheckRecord); + + @Mapping(target = "title", source = "symptom") + public abstract SkinCheckDiagnoseItemVo entityToDiagnoseItem(SysSkinDetail sysSkinDetail); + + public abstract List<SkinCheckDiagnoseItemVo> entitiesToDiagnoseItems(List<SysSkinDetail> list); + + @Mapping(target = "title", source = "symptom") + public abstract SkinCheckAnalysisItems entityToAnalysisItem(SysSkinDetail sysSkinDetail); + + public abstract List<SkinCheckAnalysisItems> entitiesToAnalysisItems(List<SysSkinDetail> list); + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java new file mode 100644 index 0000000..86e99cf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java @@ -0,0 +1,33 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.vo.StoreInOutListVo; +import com.matrix.system.app.vo.StoreListVo; +import com.matrix.system.hive.bean.SysStoreInfo; +import com.matrix.system.hive.pojo.StoreInOutRecordVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@Mapper +public abstract class SysStoreInfoMapper { + public static final SysStoreInfoMapper INSTANCE = Mappers.getMapper(SysStoreInfoMapper.class); + + @Mapping(target = "goodsName", source = "goods.name") + @Mapping(target = "goodsCode", source = "goods.code") + @Mapping(target = "alarmNum", source = "goods.alarmNum") + @Mapping(target = "img", source = "goods.img") + public abstract StoreListVo entityToStoreVo(SysStoreInfo sysStoreInfo); + + public abstract List<StoreListVo> entitiesToStoreVos(List<SysStoreInfo> list); + + @Mapping(target = "content", source = "orderType") + public abstract StoreInOutListVo recordVoToInOutListVo(StoreInOutRecordVO recordVO); + + public abstract List<StoreInOutListVo> recordVosToInOutListVos(List<StoreInOutRecordVO> list); +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysUsersMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysUsersMapper.java new file mode 100644 index 0000000..4c58e8e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysUsersMapper.java @@ -0,0 +1,53 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.dto.ModifyUserDto; +import com.matrix.system.app.vo.BeauticianVo; +import com.matrix.system.app.vo.UserInfoDetailVo; +import com.matrix.system.common.bean.SysUsers; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@Mapper +public abstract class SysUsersMapper { + public static final SysUsersMapper INSTANCE = Mappers.getMapper(SysUsersMapper.class); + + @Mapping(source = "suId", target = "id") + @Mapping(source = "suName", target = "name") + @Mapping(source = "suPhoto", target = "photo") + @Mapping(source = "suTel", target = "telphone") + public abstract BeauticianVo sysUsersToBeauticianVo(SysUsers sysUsers); + + public abstract List<BeauticianVo> usersListToBeautyList(List<SysUsers> list); + + @Mapping(source = "suPhoto", target = "photo") + @Mapping(source = "suName", target = "name") + @Mapping(source = "suAliases", target = "engName") + @Mapping(source = "suTel", target = "telphone") + @Mapping(source = "suSex", target = "sex") + @Mapping(source = "suBirthday", target = "birthday") + @Mapping(source = "suEmail", target = "email") + @Mapping(source = "serviceSignature", target = "serviceSign") + @Mapping(source = "suAddress", target = "address") + public abstract UserInfoDetailVo usersToDetailInfoVo(SysUsers sysUsers); + + public abstract ModifyUserDto usersToModifyUserDto(SysUsers sysUsers); + + @Mapping(target = "suPhoto", source = "photo") + @Mapping(target = "suName", source = "name") + @Mapping(target = "suAliases", source = "engName") + @Mapping(target = "suTel", source = "telphone") + @Mapping(target = "suSex", source = "sex") + @Mapping(target = "suBirthday", source = "birthday") + @Mapping(target = "suEmail", source = "email") + @Mapping(target = "serviceSignature", source = "serviceSign") + @Mapping(target = "suAddress", source = "address") + public abstract SysUsers modifyUserDtoToUsers(ModifyUserDto modifyUserDto); + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysWorkBeatuistaffMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysWorkBeatuistaffMapper.java new file mode 100644 index 0000000..9759907 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysWorkBeatuistaffMapper.java @@ -0,0 +1,25 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.vo.BeauticianVo; +import com.matrix.system.hive.bean.SysWorkBeatuistaff; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@Mapper +public abstract class SysWorkBeatuistaffMapper { + public static final SysWorkBeatuistaffMapper INSTANCE = Mappers.getMapper(SysWorkBeatuistaffMapper.class); + + @Mapping(source = "staffId", target = "id") + @Mapping(source = "workStaffName", target = "name") + public abstract BeauticianVo workBeautyToBeautyVo(SysWorkBeatuistaff sysWorkBeatuistaff); + + + public abstract List<BeauticianVo> workBeautysToBeautyVos(List<SysWorkBeatuistaff> sysWorkBeatuistaff); +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/utils/Sms106Send.java b/zq-erp/src/main/java/com/matrix/system/app/utils/Sms106Send.java new file mode 100644 index 0000000..4926ebb --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/utils/Sms106Send.java @@ -0,0 +1,65 @@ +package com.matrix.system.app.utils; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.XmlUtil; +import cn.hutool.http.HttpUtil; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.LogUtil; + +import java.util.Date; +import java.util.HashMap; + +/** + * @author wzy + * @date 2020-07-14 + **/ +public class Sms106Send { + + private static final String URL = "http://www.qf106.com/sms.aspx"; + private static final String ID = "16655"; + private static final String ACCOUNT = "taiyan"; + private static final String PASSWORD = "123456"; + + + /** + * @param phone 手机号 + * @param code 验证码 + * @param time 失效时间 + * @return + */ + public static boolean sendVerifyCode(String phone, String code, int time) { + String msg = "您的验证码是{},请在{}分钟内输入,请勿泄露给他人,如非本人操作,请及时修改密码。"; + String content = StrUtil.format(msg, code, time); + return request(phone, content, "验证码"); + } + + private static boolean request(String phone, String content, String tagName) { + HashMap<String, Object> param = new HashMap<>(); + param.put("userid", ID); + param.put("account", ACCOUNT); + param.put("password", PASSWORD); + param.put("mobile", phone); + param.put("content", content); + param.put("sendTime", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN)); + param.put("action", "send"); + param.put("checkcontent", 0); + param.put("taskName", tagName); + param.put("countnumber", 1); + param.put("mobilenumber", 1); + param.put("telephonenumber", 0); + + String response = HttpUtil.post(URL, param); + LogUtil.info("短信发送:{}, {}", tagName, response); + if ("Success".equals(XmlUtil.xmlToMap(response).get("returnstatus"))) { + return true; + } else { + throw new GlobleException((String) XmlUtil.xmlToMap(response).get("message")); + } + } + + public static void main(String[] args) { + System.out.println(sendVerifyCode("15773002834", "123456", 2)); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/BeauticianVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/BeauticianVo.java new file mode 100644 index 0000000..8e25766 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/BeauticianVo.java @@ -0,0 +1,61 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@ApiModel(value = "BeauticianVo", description = "美疗师列表返回参数类") +public class BeauticianVo { + + private Long id; + + private String name; + + private String roleName; + + private String photo; + + private String telphone; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getTelphone() { + return telphone; + } + + public void setTelphone(String telphone) { + this.telphone = telphone; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java new file mode 100644 index 0000000..be5703e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java @@ -0,0 +1,322 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author wzy + * @date 2020-12-29 + **/ +@ApiModel(value = "BusinessDataShowVo", description = "经营报表返回参数类") +public class BusinessesDataShowVo { + + @ApiModelProperty(value = "时间") + private String dataTime; + + @ApiModelProperty(value = "营业收入") + private BigDecimal totalPay; + + @ApiModelProperty(value = "现金收款") + private BigDecimal cashPay; + + @ApiModelProperty(value = "储值卡收款") + private BigDecimal cardPay; + + @ApiModelProperty(value = "欠款") + private BigDecimal arrearsPay; + + @ApiModelProperty(value = "现金退款") + private BigDecimal refundCashPay; + + @ApiModelProperty(value = "卡项退款") + private BigDecimal refundCardPay; + + @ApiModelProperty(value = "产品业绩") + private BigDecimal productAchieve; + + @ApiModelProperty(value = "卡项业绩") + private BigDecimal cardAchieve; + + @ApiModelProperty(value = "储值卡本金扣款") + private BigDecimal cardAmount; + + @ApiModelProperty(value = "储值卡增金扣款") + private BigDecimal cardFreeAmount; + + @ApiModelProperty(value = "退款") + private BigDecimal refund; + + @ApiModelProperty(value = "客单数") + private BigDecimal perCustomCnt; + + @ApiModelProperty(value = "客品数") + private BigDecimal customGoodsCnt; + + @ApiModelProperty(value = "客单价") + private BigDecimal perCustomPrice; + + @ApiModelProperty(value = "成本") + private BigDecimal cost; + + @ApiModelProperty(value = "毛利") + private BigDecimal grossProfit; + + @ApiModelProperty(value = "毛利率") + private BigDecimal grossProfitRate; + + @ApiModelProperty(value = "本金消耗") + private BigDecimal consumePay; + + @ApiModelProperty(value = "赠送消耗") + private BigDecimal freeConsumePay; + + @ApiModelProperty(value = "人头数") + private BigDecimal peopleCnt; + + @ApiModelProperty(value = "项目消耗数") + private BigDecimal projConsumeCnt; + + @ApiModelProperty(value = "服务时长") + private BigDecimal timeLength; + + /** + * 当天销售总数量 + */ + @ApiModelProperty(hidden = true) + private Integer totalSaleCnt; + + /** + * 家居产品成本 + */ + @ApiModelProperty(hidden = true) + private BigDecimal goodsCost; + + /** + * 除家具产品以外成本 + */ + @ApiModelProperty(hidden = true) + private BigDecimal otherCost; + + public Integer getTotalSaleCnt() { + return totalSaleCnt; + } + + public void setTotalSaleCnt(Integer totalSaleCnt) { + this.totalSaleCnt = totalSaleCnt; + } + + public BigDecimal getGoodsCost() { + return goodsCost; + } + + public void setGoodsCost(BigDecimal goodsCost) { + this.goodsCost = goodsCost; + } + + public BigDecimal getOtherCost() { + return otherCost; + } + + public void setOtherCost(BigDecimal otherCost) { + this.otherCost = otherCost; + } + + public String getDataTime() { + return dataTime; + } + + public void setDataTime(String dataTime) { + this.dataTime = dataTime; + } + + public BigDecimal getTotalPay() { + return totalPay; + } + + public void setTotalPay(BigDecimal totalPay) { + this.totalPay = totalPay; + } + + public BigDecimal getCashPay() { + return cashPay; + } + + public void setCashPay(BigDecimal cashPay) { + this.cashPay = cashPay; + } + + public BigDecimal getCardPay() { + return cardPay; + } + + public void setCardPay(BigDecimal cardPay) { + this.cardPay = cardPay; + } + + public BigDecimal getArrearsPay() { + return arrearsPay; + } + + public void setArrearsPay(BigDecimal arrearsPay) { + this.arrearsPay = arrearsPay; + } + + public BigDecimal getFreeConsumePay() { + return freeConsumePay; + } + + public void setFreeConsumePay(BigDecimal freeConsumePay) { + this.freeConsumePay = freeConsumePay; + } + + public BigDecimal getConsumePay() { + return consumePay.setScale(2, BigDecimal.ROUND_HALF_UP); + } + + public void setConsumePay(BigDecimal consumePay) { + this.consumePay = consumePay; + } + + public BigDecimal getRefundCashPay() { + return refundCashPay; + } + + public void setRefundCashPay(BigDecimal refundCashPay) { + this.refundCashPay = refundCashPay; + } + + public BigDecimal getRefundCardPay() { + return refundCardPay; + } + + public void setRefundCardPay(BigDecimal refundCardPay) { + this.refundCardPay = refundCardPay; + } + + public BigDecimal getProductAchieve() { + return productAchieve; + } + + public void setProductAchieve(BigDecimal productAchieve) { + this.productAchieve = productAchieve; + } + + public BigDecimal getCardAchieve() { + return cardAchieve; + } + + public void setCardAchieve(BigDecimal cardAchieve) { + this.cardAchieve = cardAchieve; + } + + public BigDecimal getRefund() { + return refund; + } + + public void setRefund(BigDecimal refund) { + this.refund = refund; + } + + public BigDecimal getPerCustomCnt() { + return perCustomCnt; + } + + public void setPerCustomCnt(BigDecimal perCustomCnt) { + this.perCustomCnt = perCustomCnt; + } + + public BigDecimal getCustomGoodsCnt() { + if (BigDecimal.ZERO.compareTo(perCustomCnt) != 0) { + return new BigDecimal(totalSaleCnt).divide(perCustomCnt, 2, BigDecimal.ROUND_DOWN); + } else { + return BigDecimal.ZERO; + } + } + + public void setCustomGoodsCnt(BigDecimal customGoodsCnt) { + this.customGoodsCnt = customGoodsCnt; + } + + public BigDecimal getPerCustomPrice() { + if (perCustomCnt.compareTo(BigDecimal.ZERO) != 0) { + return totalPay.divide(perCustomCnt, 2, BigDecimal.ROUND_DOWN); + } else { + return BigDecimal.ZERO; + } + } + + public void setPerCustomPrice(BigDecimal perCustomPrice) { + this.perCustomPrice = perCustomPrice; + } + + public BigDecimal getCost() { + return goodsCost.add(otherCost); + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public BigDecimal getGrossProfit() { + return totalPay.subtract(getCost()); + } + + public void setGrossProfit(BigDecimal grossProfit) { + this.grossProfit = grossProfit; + } + + public BigDecimal getGrossProfitRate() { + if (totalPay.compareTo(BigDecimal.ZERO) != 0) { + return getGrossProfit().divide(totalPay, 2, BigDecimal.ROUND_DOWN); + } else { + return BigDecimal.ZERO; + } + } + + public void setGrossProfitRate(BigDecimal grossProfitRate) { + this.grossProfitRate = grossProfitRate; + } + + public BigDecimal getPeopleCnt() { + return peopleCnt == null ? BigDecimal.ZERO : peopleCnt.setScale(2, BigDecimal.ROUND_DOWN); + } + + public void setPeopleCnt(BigDecimal peopleCnt) { + this.peopleCnt = peopleCnt; + } + + public BigDecimal getProjConsumeCnt() { + return projConsumeCnt; + } + + public void setProjConsumeCnt(BigDecimal projConsumeCnt) { + this.projConsumeCnt = projConsumeCnt; + } + + public BigDecimal getTimeLength() { + return timeLength; + } + + public void setTimeLength(BigDecimal timeLength) { + this.timeLength = timeLength; + } + + public BigDecimal getCardAmount() { + return cardAmount; + } + + public void setCardAmount(BigDecimal cardAmount) { + this.cardAmount = cardAmount; + } + + public BigDecimal getCardFreeAmount() { + return cardFreeAmount; + } + + public void setCardFreeAmount(BigDecimal cardFreeAmount) { + this.cardFreeAmount = cardFreeAmount; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailAchieveItemVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailAchieveItemVo.java new file mode 100644 index 0000000..25e67d1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailAchieveItemVo.java @@ -0,0 +1,36 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "OrderDetailAchieveItemVo", description = "订单明细业绩返回参数类") +public class OrderDetailAchieveItemVo { + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "业绩") + private BigDecimal achieve; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getAchieve() { + return achieve; + } + + public void setAchieve(BigDecimal achieve) { + this.achieve = achieve; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailItemVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailItemVo.java new file mode 100644 index 0000000..6fb4768 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailItemVo.java @@ -0,0 +1,125 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "OrderDetailItemVo", description = "订单详情明细表") +public class OrderDetailItemVo { + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "商品名称") + private String goodsName; + + @ApiModelProperty(value = "数量") + private String count; + + @ApiModelProperty(value = "现金支付") + private BigDecimal cashPay; + + @ApiModelProperty(value = "储值卡支付") + private BigDecimal cardPay; + + @ApiModelProperty(value = "欠款") + private BigDecimal arrears; + + @ApiModelProperty(value = "原价") + private BigDecimal price; + + @ApiModelProperty(value = "折扣价格") + private BigDecimal zkPrice; + + @ApiModelProperty(value = "支付状态") + private String status; + + @ApiModelProperty(value = "订单业绩") + private List<OrderDetailAchieveItemVo> achieves; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public List<OrderDetailAchieveItemVo> getAchieves() { + return achieves; + } + + public void setAchieves(List<OrderDetailAchieveItemVo> achieves) { + this.achieves = achieves; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } + + public BigDecimal getCashPay() { + return cashPay; + } + + public void setCashPay(BigDecimal cashPay) { + this.cashPay = cashPay; + } + + public BigDecimal getCardPay() { + return cardPay; + } + + public void setCardPay(BigDecimal cardPay) { + this.cardPay = cardPay; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public BigDecimal getZkPrice() { + return zkPrice; + } + + public void setZkPrice(BigDecimal zkPrice) { + this.zkPrice = zkPrice; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public BigDecimal getArrears() { + return arrears; + } + + public void setArrears(BigDecimal arrears) { + this.arrears = arrears; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailVo.java new file mode 100644 index 0000000..205bcd7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailVo.java @@ -0,0 +1,184 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "OrderDetailVo", description = "订单详情返回参数类") +public class OrderDetailVo { + + @ApiModelProperty(value = "订单ID") + private String orderId; + + @ApiModelProperty(value = "会员ID") + private String vipId; + + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @ApiModelProperty(value = "会员手机号") + private String phone; + + @ApiModelProperty(value = "订单号") + private String orderNo; + + @ApiModelProperty(value = "顾问姓名") + private String staffName; + + @ApiModelProperty(value = "现金支付金额") + private BigDecimal cashPay; + + @ApiModelProperty(value = "储值卡支付金额") + private BigDecimal cardPay; + + @ApiModelProperty(value = "应付金额") + private BigDecimal needPay; + + @ApiModelProperty(value = "实付金额") + private BigDecimal realPay; + + @ApiModelProperty(value = "优惠金额") + private BigDecimal discount; + + @ApiModelProperty(value = "订单明细") + private List<OrderDetailItemVo> items; + + @ApiModelProperty(value = "订单状态") + private String orderStatus; + + @ApiModelProperty(value = "欠款") + private BigDecimal arrears; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_SS, timezone = "GMT+8") + @ApiModelProperty(value = "下单时间") + private Date orderTime; + + public String getVipId() { + return vipId; + } + + public void setVipId(String vipId) { + this.vipId = vipId; + } + + public Date getOrderTime() { + return orderTime; + } + + public void setOrderTime(Date orderTime) { + this.orderTime = orderTime; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public BigDecimal getArrears() { + return arrears; + } + + public void setArrears(BigDecimal arrears) { + this.arrears = arrears; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public List<OrderDetailItemVo> getItems() { + return items; + } + + public void setItems(List<OrderDetailItemVo> items) { + this.items = items; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getStaffName() { + return staffName; + } + + public void setStaffName(String staffName) { + this.staffName = staffName; + } + + public BigDecimal getCashPay() { + return cashPay; + } + + public void setCashPay(BigDecimal cashPay) { + this.cashPay = cashPay; + } + + public BigDecimal getCardPay() { + return cardPay; + } + + public void setCardPay(BigDecimal cardPay) { + this.cardPay = cardPay; + } + + public BigDecimal getNeedPay() { + return needPay; + } + + public void setNeedPay(BigDecimal needPay) { + this.needPay = needPay; + } + + public BigDecimal getRealPay() { + return realPay; + } + + public void setRealPay(BigDecimal realPay) { + this.realPay = realPay; + } + + public BigDecimal getDiscount() { + return discount; + } + + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ParameterSettingVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ParameterSettingVo.java new file mode 100644 index 0000000..b7f82c7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ParameterSettingVo.java @@ -0,0 +1,39 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * jyy + */ +@Data +@ApiModel(value = "ParameterSettingVo", description = "配置返回参数类") +public class ParameterSettingVo { + + @ApiModelProperty(value = "参数编码ID") + private Long paramId; + + + @ApiModelProperty(value = "参数编码") + private String paramCode; + + + + @ApiModelProperty(value = "参数值") + private String paramValue; + + + @ApiModelProperty(value = "值1") + private String paramValue1; + + + @ApiModelProperty(value = "值2") + private String paramValue2; + + + @ApiModelProperty(value = "值3") + private String paramValue3; + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/QuestionVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/QuestionVo.java new file mode 100644 index 0000000..35b08e6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/QuestionVo.java @@ -0,0 +1,88 @@ +package com.matrix.system.app.vo; + +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.Answer; +import com.matrix.system.hive.bean.VipAnswer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@ApiModel(value = "QuestionVo", description = "会员档案返回参数类") +public class QuestionVo { + + @ApiModelProperty(value = "问题ID") + private Long id; + + @ApiModelProperty(value = "问题") + private String question; + + @ApiModelProperty(value = "类型 1-文本 输入框 2-单选 下拉框 3-多选 多选框 4-长文本 文本域 5-标题 只显示即可") + private String type; + + @ApiModelProperty(value = "单选、多选的选项") + private List<Answer> answers; + + @ApiModelProperty(value = "回显答案") + private VipAnswer vipAnswer; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getQuestion() { + return question; + } + + public void setQuestion(String question) { + this.question = question; + } + + public String getType() { + if (StringUtils.isNotBlank(type)) { + switch (type) { + case "文本" : + return "1"; + case "单选" : + return "2"; + case "多选" : + return "3"; + case "长文本" : + return "4"; + case "标题" : + return "5"; + default: + return "6"; + } + } + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List<Answer> getAnswers() { + return answers; + } + + public void setAnswers(List<Answer> answers) { + this.answers = answers; + } + + public VipAnswer getVipAnswer() { + return vipAnswer; + } + + public void setVipAnswer(VipAnswer vipAnswer) { + this.vipAnswer = vipAnswer; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/RankingVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/RankingVo.java new file mode 100644 index 0000000..38ebab8 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/RankingVo.java @@ -0,0 +1,69 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@ApiModel(value = "RankingVo", description = "排行榜返回参数类") +public class RankingVo { + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "头像") + private String photo; + + @ApiModelProperty(value = "金额") + private BigDecimal amount; + + @ApiModelProperty(value = "店铺名称") + private String shopName; + + @ApiModelProperty(value = "员工ID") + private Long id; + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public BigDecimal getAmount() { + return amount == null ? amount : amount.setScale(BigDecimal.ROUND_DOWN, 2); + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailItemVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailItemVo.java new file mode 100644 index 0000000..18220b4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailItemVo.java @@ -0,0 +1,107 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@ApiModel(value = "ServiceOrderDetailItemVo", description = "服务单详情接口参数返回类") +public class ServiceOrderDetailItemVo { + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "数量") + private Integer count; + + @ApiModelProperty(value = "价格") + private BigDecimal price; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "服务开始时间") + private Date beginTime; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "服务结束时间") + private Date endTime; + + @ApiModelProperty(value = "时长") + private Integer timeLength; + + @ApiModelProperty(value = "美疗师") + private String beautyName; + + @ApiModelProperty(value = "提成") + private BigDecimal commission; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Integer getTimeLength() { + return timeLength; + } + + public void setTimeLength(Integer timeLength) { + this.timeLength = timeLength; + } + + public String getBeautyName() { + return beautyName; + } + + public void setBeautyName(String beautyName) { + this.beautyName = beautyName; + } + + public BigDecimal getCommission() { + return commission; + } + + public void setCommission(BigDecimal commission) { + this.commission = commission; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailVo.java new file mode 100644 index 0000000..1fc5a89 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailVo.java @@ -0,0 +1,140 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-25 + **/ +@ApiModel(value = "ServiceOrderDetailVo", description = "服务单详情返回参数类") +public class ServiceOrderDetailVo { + + @ApiModelProperty(value = "服务单号") + private String serviceNo; + + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @ApiModelProperty(value = "手机号") + private String phone; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "预约时间") + private Date yyTime; + + @ApiModelProperty(value = "床位") + private String bedName; + + @ApiModelProperty(value = "配料师傅") + private String plsName; + + @ApiModelProperty(value = "服务总时长") + private Integer totalTime; + + @ApiModelProperty(value = "下单顾问") + private String staffName; + + @ApiModelProperty(value = "服务单状态") + private String status; + + @ApiModelProperty(value = "服务单评论") + private String comment; + + + @ApiModelProperty(value = "服务明细") + private List<ServiceOrderDetailItemVo> items; + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getServiceNo() { + return serviceNo; + } + + public void setServiceNo(String serviceNo) { + this.serviceNo = serviceNo; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public Date getYyTime() { + return yyTime; + } + + public void setYyTime(Date yyTime) { + this.yyTime = yyTime; + } + + public String getBedName() { + return bedName; + } + + public void setBedName(String bedName) { + this.bedName = bedName; + } + + public String getPlsName() { + return plsName; + } + + public void setPlsName(String plsName) { + this.plsName = plsName; + } + + public Integer getTotalTime() { + return totalTime; + } + + public void setTotalTime(Integer totalTime) { + this.totalTime = totalTime; + } + + public String getStaffName() { + return staffName; + } + + public void setStaffName(String staffName) { + this.staffName = staffName; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public List<ServiceOrderDetailItemVo> getItems() { + return items; + } + + public void setItems(List<ServiceOrderDetailItemVo> items) { + this.items = items; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListProjVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListProjVo.java new file mode 100644 index 0000000..beb6247 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListProjVo.java @@ -0,0 +1,47 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@ApiModel(value = "ServiceOrderListProjVo", description = "服务单列表项目返回参数类") +public class ServiceOrderListProjVo { + + @ApiModelProperty(value = "美疗师ID") + private Long id; + + @ApiModelProperty(value = "项目名称") + private String projName; + + @ApiModelProperty(value = "美疗师") + private String beautyName; + + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getProjName() { + return projName; + } + + public void setProjName(String projName) { + this.projName = projName; + } + + public String getBeautyName() { + return beautyName; + } + + public void setBeautyName(String beautyName) { + this.beautyName = beautyName; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListVo.java new file mode 100644 index 0000000..59561f0 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListVo.java @@ -0,0 +1,170 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@ApiModel(value = "ServiceOrderListVo", description = "服务单列表返回参数类") +public class ServiceOrderListVo { + + @ApiModelProperty(value = "服务单Id") + private Long id; + + @ApiModelProperty(value = "会员ID") + private Long vipId; + + @ApiModelProperty(value = "下单顾问ID") + private Long createStaffId; + + @ApiModelProperty(value = "服务单编号") + private String serviceNo; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "预约时间") + private Date time; + + @ApiModelProperty(value = "会员名称") + private String vipName; + + @ApiModelProperty(value = "门店名称") + private String shopName; + + @ApiModelProperty(value = "服务时长") + private Integer timeLength; + + @ApiModelProperty(value = "床位") + private String bed; + + @ApiModelProperty(value = "状态 1-待预约 2-待派单 3-待配料 4-待服务 5-服务中 6-服务完成 7-服务单结束") + private String status; + + @ApiModelProperty(value = "服务项目信息") + private List<ServiceOrderListProjVo> projs; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public Long getCreateStaffId() { + return createStaffId; + } + + public void setCreateStaffId(Long createStaffId) { + this.createStaffId = createStaffId; + } + + public List<ServiceOrderListProjVo> getProjs() { + return projs; + } + + public void setProjs(List<ServiceOrderListProjVo> projs) { + this.projs = projs; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getServiceNo() { + return serviceNo; + } + + public void setServiceNo(String serviceNo) { + this.serviceNo = serviceNo; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public Integer getTimeLength() { + return timeLength; + } + + public void setTimeLength(Integer timeLength) { + this.timeLength = timeLength; + } + + public String getBed() { + return bed; + } + + public void setBed(String bed) { + this.bed = bed; + } + + public String getStatus() { + return status; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public void setStatus(String status) { + switch (status) { + case "待预约" : + this.status = "1"; + break; + case "预约成功待处理" : + this.status = "2"; + break; + case "需配料" : + this.status = "3"; + break; + case "配料完成" : + this.status = "4"; + break; + case "服务中" : + this.status = "5"; + break; + case "服务完成" : + this.status = "6"; + break; + case "服务单结束" : + this.status = "7"; + break; + case "预约取消" : + this.status = "8"; + break; + case "待确认" : + this.status = "9"; + break; + default: + this.status = "0"; + break; + } + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProductListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProductListVo.java new file mode 100644 index 0000000..467fd32 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProductListVo.java @@ -0,0 +1,58 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@ApiModel(value = "ServiceProjListVo", description = "用户产品列表") +public class ServiceProductListVo { + + @ApiModelProperty(value = "会员ID") + private Long vipId; + + @ApiModelProperty(value = "会员名称") + private String name; + + @ApiModelProperty(value = "项目列表") + private List<ServiceProjVo> proj; + + @ApiModelProperty(value = "套餐列表") + private List<ServiceTcVo> composeProj; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public List<ServiceProjVo> getProj() { + return proj; + } + + public void setProj(List<ServiceProjVo> proj) { + this.proj = proj; + } + + public List<ServiceTcVo> getComposeProj() { + return composeProj; + } + + public void setComposeProj(List<ServiceTcVo> composeProj) { + this.composeProj = composeProj; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java new file mode 100644 index 0000000..6fb3473 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java @@ -0,0 +1,164 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@ApiModel(value = "ServiceProjVo", description = "用户项目返回参数类") +public class ServiceProjVo { + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "订单ID") + private Long projId; + + @ApiModelProperty(value = "商品名称") + private String name; + + @ApiModelProperty(value = "套餐来源,转让,购买") + private String source; + + @ApiModelProperty(value = "划扣金额") + private BigDecimal price; + + @ApiModelProperty(value = "时长") + private Integer timeLength; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "有效期") + private Date invalidTime; + + @ApiModelProperty(value = "剩余数量") + private Integer count; + + @ApiModelProperty(value = "图片") + private String img; + + @ApiModelProperty(value = "快过期 1-是 2-否") + private String isInvalid; + + @ApiModelProperty(value = " 使用情况余额") + private Double balance; + + @ApiModelProperty(value = "项目状态 有效/无效") + private String status; + + public String getIsInvalid() { + Date date = DateUtil.getDateAfterMonth(new Date(), 1); + if (invalidTime != null) { + if (new Date().after(invalidTime)) { + return "3"; + } + + if (date.after(invalidTime)) { + return "1"; + } + } + return "2"; + } + + public void setIsInvalid(String isInvalid) { + this.isInvalid = isInvalid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getTimeLength() { + return timeLength; + } + + public void setTimeLength(Integer timeLength) { + this.timeLength = timeLength; + } + + public Long getProjId() { + return projId; + } + + public void setProjId(Long projId) { + this.projId = projId; + } + + public Date getInvalidTime() { + return invalidTime; + } + + public void setInvalidTime(Date invalidTime) { + this.invalidTime = invalidTime; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStatus() { + if ("有效".equals(status)) { + return "1"; + } else { + return "2"; + } + } + + public void setStatus(String status) { + this.status = status; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public Double getBalance() { + return balance; + } + + public void setBalance(Double balance) { + this.balance = balance; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceTcVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceTcVo.java new file mode 100644 index 0000000..fb43859 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceTcVo.java @@ -0,0 +1,165 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.hive.bean.SysProjUse; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@ApiModel(value = "ServiceTcVo", description = "用户套餐返回参数类") +public class ServiceTcVo { + @ApiModelProperty(hidden = true) + private Long id; + + @ApiModelProperty(value = "商品ID") + private Long projId; + + @ApiModelProperty(value = "套餐名称") + private String name; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "有效期") + private Date invalidTime; + + @ApiModelProperty(value = "剩余数量") + private String count; + + @ApiModelProperty(value = "固定/任选套餐 Y-任选 N-固定") + private String isCourse; + + @ApiModelProperty(value = "若套餐为任选套餐 则判断是否无限次 Y是 N否") + private String isInfinite; + + @ApiModelProperty(value = "来源") + private String source; + + @ApiModelProperty(value = "套餐内产品") + List<ServiceProjVo> proj; + + @ApiModelProperty(value = "快过期 1-是 2-否") + private String isInvalid; + + @ApiModelProperty(value = "状态 有效/无效") + private String status; + + @ApiModelProperty(hidden = true) + private List<SysProjUse> taocanProjUse; + + public List<SysProjUse> getTaocanProjUse() { + return taocanProjUse; + } + + public void setTaocanProjUse(List<SysProjUse> taocanProjUse) { + this.taocanProjUse = taocanProjUse; + } + + public String getIsInvalid() { + Date date = DateUtil.getDateAfterMonth(new Date(), 1); + if (invalidTime != null) { + if (new Date().after(invalidTime)) { + return "3"; + } + + if (date.after(invalidTime)) { + return "1"; + } + } + return "2"; + } + + public void setIsInvalid(String isInvalid) { + this.isInvalid = isInvalid; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getProjId() { + return projId; + } + + public void setProjId(Long projId) { + this.projId = projId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Date getInvalidTime() { + return invalidTime; + } + + public void setInvalidTime(Date invalidTime) { + this.invalidTime = invalidTime; + } + + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } + + public String getIsCourse() { + return isCourse; + } + + public void setIsCourse(String isCourse) { + this.isCourse = isCourse; + } + + public String getIsInfinite() { + return isInfinite; + } + + public void setIsInfinite(String isInfinite) { + this.isInfinite = isInfinite; + } + + public List<ServiceProjVo> getProj() { + return proj; + } + + public void setProj(List<ServiceProjVo> proj) { + this.proj = proj; + } + + public String getStatus() { + if ("有效".equals(status)) { + return "1"; + } else { + return "2"; + } + } + + public void setStatus(String status) { + this.status = status; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsDetailVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsDetailVo.java new file mode 100644 index 0000000..567c6b9 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsDetailVo.java @@ -0,0 +1,77 @@ +package com.matrix.system.app.vo; + +import com.matrix.system.hive.bean.ShoppingGoodsCategory; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@Data +@ApiModel(value = "ShoppingGoodsDetailVo", description = "商品详情返回参数类") +public class ShoppingGoodsDetailVo { + + @ApiModelProperty(value = "商品编号") + private String goodsNo; + + @ApiModelProperty(value = "商品名称") + private String goodsName; + + @ApiModelProperty(value = "销售价格") + private BigDecimal salePrice; + + @ApiModelProperty(value = "销量") + private Integer saleCnt; + + @ApiModelProperty(value = "主图") + private String img; + + @ApiModelProperty(value = "详情") + private String desc; + + @ApiModelProperty(value = "商品类型") + private String goodsType; + + @ApiModelProperty(value = "容积") + private Integer volume; + + @ApiModelProperty(value = "规格") + private String measure; + + @ApiModelProperty(value = "最大销售数量") + private Integer maxSaleCnt; + + @ApiModelProperty(value = "每人限购次数") + private Integer limitBuyCnt; + + @ApiModelProperty(value = "充值卡使用范围 是-所有产品 否-部分产品") + private String carIsAll; + + @ApiModelProperty(value = "赠送金额") + private BigDecimal giftPrice; + + @ApiModelProperty(value = "固定/任选套餐 Y-任选 N-固定") + private String isCourse; + + @ApiModelProperty(value = "最大使用次数") + private Integer maxUseCnt; + + @ApiModelProperty(value = "项目关联产品--配料表、卡项可消费产品") + List<ShoppingGoodsDetailVo> assembleProj; + + @ApiModelProperty(value = "套餐项目权益") + List<ShoppingGoodsDetailVo> assembleTaocanProj; + + @ApiModelProperty(value = "套餐产品权益") + List<ShoppingGoodsDetailVo> assembleTaocanProduct; + + @ApiModelProperty(value = "卡项产品可消费类型") + List<ShoppingGoodsCategory> cardCategory; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsListVo.java new file mode 100644 index 0000000..ae87478 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsListVo.java @@ -0,0 +1,118 @@ +package com.matrix.system.app.vo; + +import com.matrix.system.hive.bean.ShoppingGoods; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author wzy + * @date 2020-12-23 + **/ +@ApiModel(value = "ShoppingGoodsListVo", description = "商品列表返回类") +public class ShoppingGoodsListVo { + + @ApiModelProperty(value = "商品ID") + private Long id; + + @ApiModelProperty(value = "商品编号") + private String goodsCode; + + @ApiModelProperty(value = "商品名称") + private String name; + + @ApiModelProperty(value = "商品价格") + private BigDecimal price; + + @ApiModelProperty(value = "是否赠送") + private String isPresent; + + @ApiModelProperty(value = "商品规格") + private String unit; + + @ApiModelProperty(value = "计量单位") + private String measure; + + @ApiModelProperty(value = "商品图片") + private String img; + + @ApiModelProperty(value = "商品类型") + private String goodsType; + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getGoodsCode() { + return goodsCode; + } + + public void setGoodsCode(String goodsCode) { + this.goodsCode = goodsCode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public String getIsPresent() { + return isPresent; + } + + public void setIsPresent(String isPresent) { + if ("是".equals(isPresent)) { + this.isPresent = "1"; + } else { + this.isPresent = "0"; + } + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getMeasure() { + return measure; + } + + public void setMeasure(String measure) { + this.measure = measure; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckAnalysisItems.java b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckAnalysisItems.java new file mode 100644 index 0000000..2f1806f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckAnalysisItems.java @@ -0,0 +1,77 @@ +package com.matrix.system.app.vo; + +import com.matrix.system.shopXcx.bean.ShopProduct; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +@ApiModel(value = "SkinCheckAnalysisItems", description = "问题分析返回接口类") +public class SkinCheckAnalysisItems { + + @ApiModelProperty(value = "图片") + private String img; + + @ApiModelProperty(value = "标题") + private String title; + + @ApiModelProperty(value = "问题分析") + private String analysis; + + @ApiModelProperty(value = "解决办法") + private String solution; + + @ApiModelProperty(hidden = true) + private String productIds; + + @ApiModelProperty(value = "产品列表") + private List<String> products; + + public String getProductIds() { + return productIds; + } + + public void setProductIds(String productIds) { + this.productIds = productIds; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAnalysis() { + return analysis; + } + + public void setAnalysis(String analysis) { + this.analysis = analysis; + } + + public String getSolution() { + return solution; + } + + public void setSolution(String solution) { + this.solution = solution; + } + + public List<String> getProducts() { + return products; + } + + public void setProducts(List<String> products) { + this.products = products; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDetailVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDetailVo.java new file mode 100644 index 0000000..cec1053 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDetailVo.java @@ -0,0 +1,80 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; +import java.util.List; + +@ApiModel(value = "SkinCheckDetailVo", description = "皮肤检测详情返回接口类") +public class SkinCheckDetailVo { + + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @ApiModelProperty(value = "头像") + private String photo; + + @ApiModelProperty(value = "性别") + private String sex; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "检测时间") + private Date checkTime; + + @ApiModelProperty(value = "诊断结果") + List<SkinCheckDiagnoseItemVo> diagnoseItems; + + @ApiModelProperty(value = "问题分析") + List<SkinCheckAnalysisItems> analysisItems; + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Date getCheckTime() { + return checkTime; + } + + public void setCheckTime(Date checkTime) { + this.checkTime = checkTime; + } + + public List<SkinCheckDiagnoseItemVo> getDiagnoseItems() { + return diagnoseItems; + } + + public void setDiagnoseItems(List<SkinCheckDiagnoseItemVo> diagnoseItems) { + this.diagnoseItems = diagnoseItems; + } + + public List<SkinCheckAnalysisItems> getAnalysisItems() { + return analysisItems; + } + + public void setAnalysisItems(List<SkinCheckAnalysisItems> analysisItems) { + this.analysisItems = analysisItems; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDiagnoseItemVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDiagnoseItemVo.java new file mode 100644 index 0000000..1f5cbcc --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDiagnoseItemVo.java @@ -0,0 +1,31 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "SkinCheckDiagnoseItemVo", description = "诊断结果返回参数类") +public class SkinCheckDiagnoseItemVo { + + @ApiModelProperty(value = "标题") + private String title; + + @ApiModelProperty(value = "百分比") + private Double percentage; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + + public Double getPercentage() { + return percentage; + } + + public void setPercentage(Double percentage) { + this.percentage = percentage; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckListVo.java new file mode 100644 index 0000000..7e3e292 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckListVo.java @@ -0,0 +1,69 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +@ApiModel(value = "SkinCheckListVo", description = "皮肤检测列表返回参数类") +public class SkinCheckListVo { + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "标题") + private String title; + + @ApiModelProperty(value = "检测人员") + private String checkUserName; + + @ApiModelProperty(value = "检测门店") + private String shopName; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "检测时间") + private Date checkTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public String getCheckUserName() { + return checkUserName; + } + + public void setCheckUserName(String checkUserName) { + this.checkUserName = checkUserName; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public Date getCheckTime() { + return checkTime; + } + + public void setCheckTime(Date checkTime) { + this.checkTime = checkTime; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java new file mode 100644 index 0000000..5790656 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java @@ -0,0 +1,62 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@ApiModel(value = "StoreInOutListVo", description = "商品出入库返回参数类") +public class StoreInOutListVo { + + @ApiModelProperty(value = "详情") + private String content; + + @ApiModelProperty(value = "单号") + private String orderNo; + + @ApiModelProperty(value = "数量") + private BigDecimal amount; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "出入库时间") + private Date createTime; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/StoreListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/StoreListVo.java new file mode 100644 index 0000000..954964b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/StoreListVo.java @@ -0,0 +1,67 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-27 + **/ +@ApiModel(value = "StoreListVo", description = "库存列表返回参数类") +public class StoreListVo { + + @ApiModelProperty(value = "商品名称") + private String goodsName; + + @ApiModelProperty(value = "商品编号") + private String goodsCode; + + @ApiModelProperty(value = "在库数量") + private Integer storeTotal; + + @ApiModelProperty(value = "警戒值") + private Integer alarmNum; + + @ApiModelProperty(value = "图片") + private String img; + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGoodsCode() { + return goodsCode; + } + + public void setGoodsCode(String goodsCode) { + this.goodsCode = goodsCode; + } + + public Integer getStoreTotal() { + return storeTotal; + } + + public void setStoreTotal(Integer storeTotal) { + this.storeTotal = storeTotal; + } + + public Integer getAlarmNum() { + return alarmNum; + } + + public void setAlarmNum(Integer alarmNum) { + this.alarmNum = alarmNum; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/UserAchieveVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/UserAchieveVo.java new file mode 100644 index 0000000..216c609 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/UserAchieveVo.java @@ -0,0 +1,91 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@ApiModel(value = "UserAchieveVo", description = "员工业绩返回类") +public class UserAchieveVo { + + @ApiModelProperty(value = "用户ID") + private Long id; + + @ApiModelProperty(value = "现金业绩") + private BigDecimal orderCash; + + @ApiModelProperty(value = "划扣业绩") + private BigDecimal cash; + + @ApiModelProperty(value = "业绩提成") + private BigDecimal cardUse; + + @ApiModelProperty(value = "本金消耗") + private BigDecimal hisConsume; + + @ApiModelProperty(value = "赠送消耗") + private BigDecimal freeConsume; + + @ApiModelProperty(value = "服务提成") + private BigDecimal projCommission; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getOrderCash() { + return orderCash; + } + + public void setOrderCash(BigDecimal orderCash) { + this.orderCash = orderCash; + } + + public BigDecimal getCash() { + return cash; + } + + public void setCash(BigDecimal cash) { + this.cash = cash; + } + + public BigDecimal getHisConsume() { + return hisConsume; + } + + public void setHisConsume(BigDecimal hisConsume) { + this.hisConsume = hisConsume; + } + + public BigDecimal getFreeConsume() { + return freeConsume; + } + + public void setFreeConsume(BigDecimal freeConsume) { + this.freeConsume = freeConsume; + } + + public BigDecimal getCardUse() { + return cardUse; + } + + public void setCardUse(BigDecimal cardUse) { + this.cardUse = cardUse; + } + + public BigDecimal getProjCommission() { + return projCommission; + } + + public void setProjCommission(BigDecimal projCommission) { + this.projCommission = projCommission; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoDetailVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoDetailVo.java new file mode 100644 index 0000000..e7b1b39 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoDetailVo.java @@ -0,0 +1,116 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @author wzy + * @date 2021-01-06 + **/ +@ApiModel(value = "UserInfoDetailVo", description = "获取当前登陆用户详情接口返回参数类") +public class UserInfoDetailVo { + + @ApiModelProperty(value = "头像") + private String photo; + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "英文名") + private String engName; + + @ApiModelProperty(value = "手机号") + private String telphone; + + @ApiModelProperty(value = "性别") + private String sex; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "生日") + private Date birthday; + + @ApiModelProperty(value = "邮箱") + private String email; + + @ApiModelProperty(value = "服务签名") + private String serviceSign; + + @ApiModelProperty(value = "地址") + private String address; + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEngName() { + return engName; + } + + public void setEngName(String engName) { + this.engName = engName; + } + + public String getTelphone() { + return telphone; + } + + public void setTelphone(String telphone) { + this.telphone = telphone; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getServiceSign() { + return serviceSign; + } + + public void setServiceSign(String serviceSign) { + this.serviceSign = serviceSign; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoVo.java new file mode 100644 index 0000000..105bd58 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoVo.java @@ -0,0 +1,67 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@ApiModel(value = "UserInfoVo", description = "用户信息返回类") +public class UserInfoVo { + + @ApiModelProperty(value = "用户ID", example = "1") + private Long id; + + @ApiModelProperty(value = "用户名称", example = "呵呵") + private String name; + + @ApiModelProperty(value = "职位", example = "店长") + private String roleName; + + @ApiModelProperty(value = "头像", example = "--") + private String photo; + + @ApiModelProperty(value = "门店名称") + private String shopName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/VipAchieveDataShowVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/VipAchieveDataShowVo.java new file mode 100644 index 0000000..a2abe3a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/VipAchieveDataShowVo.java @@ -0,0 +1,147 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author wzy + * @date 2020-12-31 + **/ +@ApiModel(value = "VipAchieveDataShowVo", description = "员工业绩返回参数类") +public class VipAchieveDataShowVo { + + @ApiModelProperty(value = "时间") + private String time; + + @ApiModelProperty(value = "订单业绩") + private BigDecimal orderAmount; + + @ApiModelProperty(value = "现金业绩") + private BigDecimal cashAmount; + + @ApiModelProperty(hidden = true) + private BigDecimal cardAmount; + + @ApiModelProperty(value = "订单提成") + private BigDecimal goodsAmount; + + @ApiModelProperty(value = "划扣业绩") + private BigDecimal cardUseAmount; + + @ApiModelProperty(value = "本金消耗") + private BigDecimal hisConsume; + + @ApiModelProperty(value = "赠送消耗") + private BigDecimal freeConsume; + + @ApiModelProperty(value = "服务提成") + private BigDecimal commission; + + @ApiModelProperty(value = "人头数") + private BigDecimal peopleNum; + + @ApiModelProperty(value = "项目数") + private Integer projNum; + + @ApiModelProperty(value = "服务时长") + private Integer serviceTime; + + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public BigDecimal getOrderAmount() { + return orderAmount; + } + + public void setOrderAmount(BigDecimal orderAmount) { + this.orderAmount = orderAmount; + } + + public BigDecimal getCashAmount() { + return cashAmount; + } + + public void setCashAmount(BigDecimal cashAmount) { + this.cashAmount = cashAmount; + } + + public BigDecimal getCardAmount() { + return cardAmount; + } + + public void setCardAmount(BigDecimal cardAmount) { + this.cardAmount = cardAmount; + } + + public BigDecimal getGoodsAmount() { + return goodsAmount; + } + + public void setGoodsAmount(BigDecimal goodsAmount) { + this.goodsAmount = goodsAmount; + } + + public BigDecimal getCardUseAmount() { + return cardUseAmount; + } + + public void setCardUseAmount(BigDecimal cardUseAmount) { + this.cardUseAmount = cardUseAmount; + } + + public BigDecimal getHisConsume() { + return hisConsume; + } + + public void setHisConsume(BigDecimal hisConsume) { + this.hisConsume = hisConsume; + } + + public BigDecimal getFreeConsume() { + return freeConsume; + } + + public void setFreeConsume(BigDecimal freeConsume) { + this.freeConsume = freeConsume; + } + + public BigDecimal getCommission() { + return commission; + } + + public void setCommission(BigDecimal commission) { + this.commission = commission; + } + + public BigDecimal getPeopleNum() { + return peopleNum == null ? peopleNum : peopleNum.setScale(2, BigDecimal.ROUND_DOWN); + } + + public void setPeopleNum(BigDecimal peopleNum) { + this.peopleNum = peopleNum; + } + + public Integer getProjNum() { + return projNum; + } + + public void setProjNum(Integer projNum) { + this.projNum = projNum; + } + + public Integer getServiceTime() { + return serviceTime; + } + + public void setServiceTime(Integer serviceTime) { + this.serviceTime = serviceTime; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/VipCardListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/VipCardListVo.java new file mode 100644 index 0000000..1098de9 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/VipCardListVo.java @@ -0,0 +1,78 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.constance.Dictionary; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-28 + **/ +@ApiModel(value = "VipCardListVo", description = "会员卡项列表") +public class VipCardListVo { + + @ApiModelProperty(value = "卡项名称") + private String cardName; + + @ApiModelProperty(value = "现有金额") + private BigDecimal realMoney; + + @ApiModelProperty(value = "赠送金额") + private BigDecimal giftMoney; + + @ApiModelProperty(value = "状态 1-有效 2-无效") + private String status; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "有效时间") + private Date failTime; + + public String getCardName() { + return cardName; + } + + public void setCardName(String cardName) { + this.cardName = cardName; + } + + public BigDecimal getRealMoney() { + return realMoney; + } + + public void setRealMoney(BigDecimal realMoney) { + this.realMoney = realMoney; + } + + public BigDecimal getGiftMoney() { + return giftMoney; + } + + public void setGiftMoney(BigDecimal giftMoney) { + this.giftMoney = giftMoney; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + if (Dictionary.MONEYCARD_STATUS_YX.equals(status)) { + this.status = "1"; + } else { + this.status = "2"; + } + } + + public Date getFailTime() { + return failTime; + } + + public void setFailTime(Date failTime) { + this.failTime = failTime; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoDetailVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoDetailVo.java new file mode 100644 index 0000000..ea25f93 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoDetailVo.java @@ -0,0 +1,195 @@ +package com.matrix.system.app.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.hive.bean.SysVipLabel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-22 + **/ +@ApiModel(value = "VipInfoDetailVo", description = "客户详细信息接口返回类") +public class VipInfoDetailVo { + + @ApiModelProperty(value = "头像") + private String photo; + + @ApiModelProperty(value = "资金密码") + private String password; + + @ApiModelProperty(value = "会员ID") + private Long id; + + @ApiModelProperty(value = "会员编号") + private String vipNo; + + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @ApiModelProperty(value = "手机号") + private String phone; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "生日") + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + private Date birthday; + + @ApiModelProperty(value = "省") + private String province; + + @ApiModelProperty(value = "市") + private String city; + + @ApiModelProperty(value = "区") + private String area; + + @ApiModelProperty(value = "详细地址") + private String address; + + @ApiModelProperty(value = "到店途径") + private String arrivalWay; + + @ApiModelProperty(value = "推荐人ID") + private Long recommendId; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "标签") + private List<SysVipLabel> labels; + + public List<SysVipLabel> getLabels() { + return labels; + } + + public void setLabels(List<SysVipLabel> labels) { + this.labels = labels; + } + + public String getVipNo() { + return vipNo; + } + + public void setVipNo(String vipNo) { + this.vipNo = vipNo; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getArrivalWay() { + return arrivalWay; + } + + public void setArrivalWay(String arrivalWay) { + this.arrivalWay = arrivalWay; + } + + public Long getRecommendId() { + return recommendId; + } + + public void setRecommendId(Long recommendId) { + this.recommendId = recommendId; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoListVo.java new file mode 100644 index 0000000..1f0baaf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoListVo.java @@ -0,0 +1,101 @@ +package com.matrix.system.app.vo; + +import com.matrix.system.hive.bean.SysVipLevel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author wzy + * @date 2020-12-22 + **/ +@ApiModel(value = "VipInfoListVo", description = "会员列表返回类") +public class VipInfoListVo { + + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @ApiModelProperty(value = "会员编号") + private String vipNo; + + @ApiModelProperty(value = "会员手机号") + private String phone; + + @ApiModelProperty(value = "到店次数") + private Integer arriveCnt; + + @ApiModelProperty(value = "头像") + private String photo; + + @ApiModelProperty(value = "会员ID") + private Long id; + + @ApiModelProperty(value = "门店简称") + private String shopName; + + @ApiModelProperty(value = "会员等级对象") + private String vipLevel; + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public Integer getArriveCnt() { + return arriveCnt; + } + + public void setArriveCnt(Integer arriveCnt) { + this.arriveCnt = arriveCnt; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public String getVipLevel() { + return vipLevel; + } + + public void setVipLevel(String vipLevel) { + this.vipLevel = vipLevel; + } + + public String getVipNo() { + return vipNo; + } + + public void setVipNo(String vipNo) { + this.vipNo = vipNo; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoVo.java new file mode 100644 index 0000000..1934aaf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoVo.java @@ -0,0 +1,135 @@ +package com.matrix.system.app.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author wzy + * @date 2020-12-22 + **/ +@ApiModel(value = "VipInfoVo", description = "客户信息返回类") +public class VipInfoVo { + + @ApiModelProperty(value = "头像") + private String photo; + + @ApiModelProperty(value = "会员名称") + private String vipName; + + @ApiModelProperty(value = "手机号") + private String phone; + + @ApiModelProperty(value = "会员级别") + private String vipLevel; + + @ApiModelProperty(value = "会员编号") + private String vipNo; + + @ApiModelProperty(value = "总余额") + private BigDecimal totalBalance; + + @ApiModelProperty(value = "赠送余额") + private BigDecimal giftBalance; + + @ApiModelProperty(value = "积分") + private Integer integral; + + @ApiModelProperty(value = "门店名称") + private String shopName; + + @ApiModelProperty(value = "累计消费") + private BigDecimal totalShopping; + + @ApiModelProperty(value = "欠款") + private BigDecimal arrears; + + public BigDecimal getArrears() { + return arrears; + } + + public void setArrears(BigDecimal arrears) { + this.arrears = arrears; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getVipLevel() { + return vipLevel; + } + + public void setVipLevel(String vipLevel) { + this.vipLevel = vipLevel; + } + + public String getVipNo() { + return vipNo; + } + + public void setVipNo(String vipNo) { + this.vipNo = vipNo; + } + + public BigDecimal getTotalBalance() { + return totalBalance.setScale(2, BigDecimal.ROUND_DOWN); + } + + public void setTotalBalance(BigDecimal totalBalance) { + this.totalBalance = totalBalance; + } + + public BigDecimal getGiftBalance() { + return giftBalance.setScale(2, BigDecimal.ROUND_DOWN); + } + + public void setGiftBalance(BigDecimal giftBalance) { + this.giftBalance = giftBalance; + } + + public Integer getIntegral() { + return integral; + } + + public void setIntegral(Integer integral) { + this.integral = integral; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public BigDecimal getTotalShopping() { + return totalShopping; + } + + public void setTotalShopping(BigDecimal totalShopping) { + this.totalShopping = totalShopping; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/AdminAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/AdminAction.java index f1b1260..4cdafd3 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/AdminAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/AdminAction.java @@ -25,9 +25,7 @@ import com.matrix.system.common.service.SysUsersService; import com.matrix.system.common.tools.PasswordUtil; import com.matrix.system.common.tools.ResponseHeadUtil; -import com.matrix.system.constance.SystemConstance; import com.matrix.system.hive.action.util.QueryUtil; -import com.matrix.system.hive.bean.SysVipInfo; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -45,11 +43,8 @@ import java.net.URLEncoder; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; -import java.util.LinkedList; import java.util.List; import java.util.Objects; - -import static com.matrix.system.common.constance.AppConstance.SAFEPATH; /** * @author 姜ø友瑶 @@ -139,15 +134,34 @@ SysUsers loginUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); loginUser.setCreateBy(loginUser.getSuName()); sysUsers.setCompanyId(loginUser.getCompanyId()); - sysUsers.setShopId(loginUser.getShopId()); int i = sysUsersService.addAdmin(sysUsers); - if (i > 0) { return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, AppVocabularyCode.ADMIN); } else { throw new GlobleException(SystemErrorCode.DATA_ADD_FAIL); } } + + /** + * 新增门店管理员 + */ + @RemoveRequestToken + @PostMapping(value = "/addShopAdmin") + public @ResponseBody + AjaxResult addShopAdmin(SysUsers sysUsers) { + + SysUsers loginUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + loginUser.setCreateBy(loginUser.getSuName()); + sysUsers.setCompanyId(loginUser.getCompanyId()); + sysUsers.setShopId(loginUser.getShopId()); + int i = sysUsersService.addAdmin(sysUsers); + if (i > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, AppVocabularyCode.ADMIN); + } else { + throw new GlobleException(SystemErrorCode.DATA_ADD_FAIL); + } + } + /** * 修改公司管理员 @@ -177,6 +191,8 @@ throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL); } } + + @RequestMapping(value = "/goStaffEditForm") @@ -414,6 +430,15 @@ return result; } + @RequestMapping(value = "/getUserById") + public @ResponseBody + AjaxResult getUserById(Long id) { + AjaxResult result = AjaxResult.buildSuccessInstance(""); + SysUsers user = sysUsersService.findById(id); + result.putInMap("user", user); + return result; + } + /** * 条件查询所有员工,不分页 @@ -425,6 +450,7 @@ AjaxResult all() { SysUsers sysUsers = new SysUsers(); QueryUtil.setQueryLimit(sysUsers); + sysUsers.setSuValid(AppConstance.RECORD_VALID); return new AjaxResult(AjaxResult.STATUS_SUCCESS, sysUsersService.findInPage(sysUsers, null)); } @@ -456,23 +482,6 @@ } - /** - * 查询历史搜索人数 - * - * @return - * @author luoyuanhong - */ - @SuppressWarnings("unchecked") - @RequestMapping(value = "/showHistoryUser") - public @ResponseBody - AjaxResult showHistoryUser() { - if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) != null) { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, - (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER), 0); - } else { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, null, 0); - } - } /** @@ -491,6 +500,7 @@ orderSheet.setHeaders(header); SysUsers loginUser = getSessionUser(); shopStaffInfo.setShopId(loginUser.getShopId()); + shopStaffInfo.setSuValid(AppConstance.RECORD_VALID); List<SysUsers> dataList = sysUsersService.findInPage(shopStaffInfo, null); List<List<Object>> list = new ArrayList<>(); if (dataList.size() > 0) { diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/BusParameterSettingsAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/BusParameterSettingsAction.java index 95d9d4b..485c148 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/BusParameterSettingsAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/BusParameterSettingsAction.java @@ -11,7 +11,6 @@ import com.matrix.system.hive.bean.ParameterSettings; import com.matrix.system.hive.dao.ParameterSettingsDao; import org.apache.ibatis.annotations.Param; -import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/CommonAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/CommonAction.java index 36b217c..18bbb30 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/CommonAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/CommonAction.java @@ -5,29 +5,29 @@ import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.RSAUtils; -import com.matrix.core.tools.StringUtils; -import com.matrix.core.tools.WebUtil; +import com.matrix.core.tools.*; import com.matrix.core.web.BaseAction; import com.matrix.system.common.authority.DefaultAuthorityManager; import com.matrix.system.common.authority.strategy.AccountPasswordLogin; import com.matrix.system.common.authority.strategy.LoginStrategy; +import com.matrix.system.common.authority.strategy.ScanQrCodeLogin; +import com.matrix.system.common.bean.SysCompany; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.ProjExceptionDao; +import com.matrix.system.common.dao.SysCompanyDao; +import com.matrix.system.common.dto.WebLoginDto; +import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.common.service.SysUsersService; import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.system.hive.statistics.StatisticsBusinessDataJob; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import java.security.Key; import java.util.Map; +import java.util.Objects; /** * @description 通用控制器,本action未经session过验证器 @@ -37,6 +37,7 @@ */ @RequestMapping(value = "/common") @Controller +@CrossOrigin(origins = "*", maxAge = 3600) public class CommonAction extends BaseAction { @Autowired @@ -54,7 +55,7 @@ StatisticsBusinessDataJob sjobp; @RequestMapping(value = "/job") public @ResponseBody String job() { - sjobp.executeExt2(); + //sjobp.executeExt2(); return "1"; } @@ -66,6 +67,9 @@ @Autowired SysShopInfoDao sysShopInfoDao; + + @Autowired + SysCompanyDao sysCompanyDao; /** * 页面定向方法,每个权限模块公用一个,每个模块共享一个一级路径,已便于进行权限过滤 @@ -97,17 +101,22 @@ * * 登录验证 * @author:姜友瑶 - * @param user * @return 返回类型 AjaxResult * @date 2016年8月30日 */ @RequestMapping(value = "/dologin") - public @ResponseBody AjaxResult dologin(SysUsers user) { - long sqlStart = System.currentTimeMillis(); - decryptAccountAndPassword(user); - LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); + public @ResponseBody AjaxResult dologin(WebLoginDto webLoginDto) { - user = authorityManager.login(apLogin); + long sqlStart = System.currentTimeMillis(); + SysUsers user=null; + if(WebLoginDto.ACCOUNT_LOGIN.equals(webLoginDto.getLoginType())){ + user= decryptAccountAndPassword(webLoginDto); + LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); + user = authorityManager.login(apLogin); + }else { + ScanQrCodeLogin apLogin = new ScanQrCodeLogin( sysUsersService,webLoginDto.getLoginQrCodeKey()); + user = authorityManager.login(apLogin); + } if(user.getShopId()!=null){ @@ -116,6 +125,8 @@ AjaxResult result = new AjaxResult(); authorityManager.initUserPower(result); + SysCompany sysCompany = sysCompanyDao.selectById(user.getCompanyId()); + WebUtil.setSessionAttribute(HostInterceptor.ATTR_COMPANY, sysCompany); result.putInMap("user",user); result.setStatus(AjaxResult.STATUS_SUCCESS); @@ -155,28 +166,27 @@ * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2017年12月11日 - * @param user */ - private void decryptAccountAndPassword(SysUsers user) { + private SysUsers decryptAccountAndPassword(WebLoginDto webLoginDto) { String privateKey = WebUtil.getSessionAttribute(MatrixConstance.PRIVATE_KEY); if (StringUtils.isBlank(privateKey)) { throw new GlobleException(SystemErrorCode.REQUEST_INVALID); } - + SysUsers user=new SysUsers(); try { // 账号解密 - byte[] acccountData = RSAUtils.decryptByPrivateKey(user.getSuAccount(), privateKey); + byte[] acccountData = RSAUtils.decryptByPrivateKey(webLoginDto.getSuAccount(), privateKey); user.setSuAccount(new String(acccountData)); // 密码解密 - byte[] passWordData = RSAUtils.decryptByPrivateKey(user.getSuPassword(), privateKey); + byte[] passWordData = RSAUtils.decryptByPrivateKey(webLoginDto.getSuPassword(), privateKey); user.setSuPassword(new String(passWordData)); } catch (Exception e) { LogUtil.error("用户账号密码解密失败", e); throw new GlobleException(SystemErrorCode.LOGIN_FAIL); } - + return user; } @@ -248,44 +258,6 @@ } - - /** - * 移动端登录 - * @param user - * @return - */ - @RequestMapping(value = "/doHiveMobilelogin") - public @ResponseBody AjaxResult doHiveMobilelogin(SysUsers user) { - long sqlStart = System.currentTimeMillis(); - decryptAccountAndPassword(user); - LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); - user = authorityManager.login(apLogin); - // 获取该账户的岗位信息,并判断是否为店长 - if(user.getShopId()!=null){ - user.setShopName(sysShopInfoDao.selectById(user.getShopId()).getShopName()); - } - - AjaxResult result = new AjaxResult(); - authorityManager.initUserPower(result); - result.setStatus(AjaxResult.STATUS_SUCCESS); - LogUtil.info("#用户登录成功 账号={}#", user.getSuAccount()); - switch (user.getSuUserType()) { - // 企业管理员 - case AppConstance.USER_TYPE_ADMIN: - result.setPage(HIVE_MOBILE_REDIRECT_INDEX); - break; - // 企业用户 - case AppConstance.USER_TYPE_EMPLOYEE: - result.setPage(HIVE_MOBILE_REDIRECT_INDEX); - break; - default:// 不能识别的用户 - result.setPage("common/redirect/404"); - } - long endStart = System.currentTimeMillis(); - LogUtil.info("本次登录耗时#{}毫秒", (endStart-sqlStart)+""); - return result; - } - @GetMapping(value = "/hiveMobileLoginOut") public String hiveMobileLoginOut() { authorityManager.getLoginOut(); @@ -294,4 +266,25 @@ + + + /** + * 官网联系我们通知 + */ + @RequestMapping(value = "/gwLinkUs") + public @ResponseBody + AjaxResult gwLinkUs(@RequestBody Map<String , Object> param) { + + String title = "hive新客户在官网提交联系请求"; + if(Objects.nonNull(param.get("name"))){ + String content = "hive=>name:" + param.get("name") + " tel:" + param.get("tel") ; + DingDingRobotUtil.sendLink("https://oapi.dingtalk.com/robot/send?access_token=62bb902f0e3945f0ece31306b99abae043fc69a66da0ef04d89fd20bf58d88d8", content, title, "", "www.baidu.com"); + + } + + return AjaxResult.buildSuccessInstance("提交成功"); + } + + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/CustomerDictionaryAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/CustomerDictionaryAction.java index f41b1b5..6052076 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/CustomerDictionaryAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/CustomerDictionaryAction.java @@ -111,6 +111,10 @@ @RequestMapping(value = "/modifyDataDictionary") public @ResponseBody AjaxResult modifyDataDictionary(CustomerDataDictionary newDataDictionary) { + // 自己不能是自己的父节点 + if (newDataDictionary.getParentId() != null && newDataDictionary.getParentId().equals(newDataDictionary.getId())) { + throw new GlobleException("父级不能是自己"); + } dataDictionaryDao.updateByModel(newDataDictionary); return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.UPDATE_SUCCES, "数据字典"); diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/DeveloperAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/DeveloperAction.java index 90acb1a..29981ca 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/DeveloperAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/DeveloperAction.java @@ -3,6 +3,7 @@ import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.web.BaseAction; +import com.matrix.system.common.init.LocalCache; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -73,4 +74,10 @@ return new AjaxResult(AjaxResult.STATUS_SUCCESS, "debug模式开启"); } + @RequestMapping("/getLocalCache") + public @ResponseBody AjaxResult getLocalCache(String key) { + return AjaxResult.buildSuccessInstance(LocalCache.getValues(key)); + } + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/FileUploadAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/FileUploadAction.java index 2613e92..5dc9eda 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/FileUploadAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/FileUploadAction.java @@ -1,8 +1,12 @@ package com.matrix.system.common.actions; +import com.matrix.core.constance.MatrixConstance; import com.matrix.core.tools.FileType; +import com.matrix.core.tools.WebUtil; import com.matrix.core.web.BaseAction; +import com.matrix.system.common.bean.SysCompany; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.common.tools.UploadUtil; import org.apache.commons.fileupload.FileUploadException; import org.springframework.stereotype.Controller; @@ -41,7 +45,9 @@ public String doImageUpload(HttpServletResponse response, MultipartHttpServletRequest request) throws IOException, FileUploadException, NoSuchAlgorithmException { SysUsers user = getSessionUser(); - Map<String, String> fileMap = UploadUtil.doUpload(request, EXT_LIST, folderType, user.getSuId()); + + SysCompany company = WebUtil.getSessionAttribute(HostInterceptor.ATTR_COMPANY); + Map<String, String> fileMap = UploadUtil.doUpload(request, EXT_LIST, folderType, company.getComId()); String callBack = request.getParameter("callBack"); String inputId = request.getParameter("inputId"); request.setAttribute("callBack", callBack); diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/MultipleFileUploadAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/MultipleFileUploadAction.java new file mode 100644 index 0000000..9c4f419 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/MultipleFileUploadAction.java @@ -0,0 +1,169 @@ +package com.matrix.system.common.actions; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.UUIDUtil; +import com.matrix.system.common.constance.AppConstance; +import org.apache.commons.fileupload.FileUploadException; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.util.FileCopyUtils; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 多文件上传控制器 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@Controller +@RequestMapping(value = "admin/multipleUploadFile") +public class MultipleFileUploadAction { + Logger log = Logger.getLogger(MultipleFileUploadAction.class); + + @Value("${file_storage_path}") + private String fileStoragePath; + @Value("${static_resource_url}") + private String nginxUrl; + + /** + * 最大值 + */ + private Long maxSize = 1024*1024*100L; + + /** + * 多文件上传方法 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + * @param response + * @param request + * @return + * @throws IOException + * @throws FileUploadException + */ + @RequestMapping(value = "/doUpload") + public @ResponseBody JSONObject doFileUpload(HttpServletResponse response, MultipartHttpServletRequest request, Integer data) + throws IOException, FileUploadException { + // 文件保存目录路径 + String savePath = fileStoragePath; + // 文件保存目录URL + String saveUrl = nginxUrl; + // String msgPag = "common/fileUploadResult"; + JSONObject object = new JSONObject(); + response.setContentType("text/html; charset=UTF-8"); + request.setCharacterEncoding("UTF-8"); + + // 保存和访问路径检查 + if (StringUtils.isBlank(saveUrl) || StringUtils.isBlank(savePath)) { + object.put("status", "err"); + object.put("msg", "文件上传失败错误代码:001"); + return object; + } + // 检查目录 + File uploadDir = new File(savePath); + if (!uploadDir.isDirectory()) { + uploadDir.mkdir(); + } + // 检查目录写权限 +// if (!uploadDir.canWrite()) { +// object.put("status", "err"); +// object.put("msg", "上传目录没有写权限"); +// return object; +// } + + Map<String, MultipartFile> fileMaps = request.getFileMap(); + for (String key : fileMaps.keySet()) { + MultipartFile file = fileMaps.get(key); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + String ymd = sdf.format(new Date()); + savePath += ymd + "/"; + saveUrl += ymd + "/"; + File dirFile = new File(savePath); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } + log.info("上传文件名:" + file.getOriginalFilename()); + log.info("上传文件大小:" + file.getBytes().length); + log.info("上传文件大小限制:" + maxSize); + log.info("上传文件大小是否超过限制:" + (file.getBytes().length > maxSize)); + if (file.getBytes().length > maxSize) { + object.put("status", "err"); + object.put("msg", "上传文件大小超过限制"); + return object; + } + String fileName = file.getOriginalFilename(); + String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(); + + fileName = fileName.replace("." + fileExt, ""); + fileName = getSensitive(fileName); + String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + "." + fileExt; + File uploadedFile = new File(savePath, newFileName); + try { + FileCopyUtils.copy(file.getBytes(), uploadedFile); + } catch (Exception e) { + object.put("status", "err"); + object.put("msg", "上传文件失败 "+e.getMessage()); + return object; + } + log.info("saveUrl:" + saveUrl); + String visitPath = saveUrl + newFileName; + log.info("上传一个文件:" + newFileName); + log.info("访问路径:" + visitPath); + // 获取回调函数 + /* + * String callBack = request.getParameter("callBack"); String inputId = + * request.getParameter("inputId"); request.setAttribute("status", "200"); + * request.setAttribute("callBack", callBack); request.setAttribute("inputId", + * inputId); request.setAttribute("url", visitPath); + */ + object.put("path", visitPath); + object.put("fileName", fileName); + object.put("status", 200); + if (data != null) { + object.put("index", data); + } + } + return object; + } + + /** + * 检查文件名,过滤特殊字符 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + * @param globWords + * @return + */ + public String getSensitive(String globWords) { + + String sensitive = ""; + Pattern pattern = Pattern.compile(AppConstance.SPECIAL_CHARACTERS); + Matcher matcher = pattern.matcher(globWords); + while (matcher.find()) { + sensitive += matcher.group(); + } + /* + * if(sensitive=="" || sensitive.length()<3 ){ + * sensitive=StringUtils.getRandomString(8); } + */ + return sensitive; + } +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/ProjExceptionAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/ProjExceptionAction.java index 7229a15..19ed8a3 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/ProjExceptionAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/ProjExceptionAction.java @@ -1,22 +1,16 @@ package com.matrix.system.common.actions; -import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.ProjException; -import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.ProjExceptionDao; -import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; import java.util.Arrays; -import java.util.List; /** * @author 姜友瑶 @@ -31,12 +25,19 @@ ProjExceptionDao projExceptionDao; @RequestMapping(value = "/showException") - public @ResponseBody - AjaxResult showException(Long id) { + public + ModelAndView showException(Long id) { ProjException projException = projExceptionDao.selectById(id); - return AjaxResult.buildSuccessInstance(Arrays.asList(projException)); + ModelAndView mv = new ModelAndView("common/showprojException"); + mv.addObject("obj", projException); + return mv; + } + + + + @RequestMapping(value = "/projException/del") public @ResponseBody AjaxResult del(@RequestBody ProjException projException) { diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/SysCompanyAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/SysCompanyAction.java index c21a034..c5c9d91 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/SysCompanyAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/SysCompanyAction.java @@ -2,16 +2,13 @@ import com.matrix.core.anotations.RemoveRequestToken; import com.matrix.core.anotations.SaveRequestToken; -import com.matrix.core.constance.SystemErrorCode; -import com.matrix.core.constance.SystemMessageCode; -import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.InternationaUtil; import com.matrix.core.tools.WebUtil; import com.matrix.core.web.BaseAction; import com.matrix.system.common.bean.SysCompany; import com.matrix.system.common.constance.AppVocabularyCode; +import com.matrix.system.common.init.InitWebContainer; import com.matrix.system.common.service.SysCompanyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -35,6 +32,10 @@ private SysCompanyService sysCompanyService; public static final String BEV = "SYSCOMPANY_BEV"; + + + @Autowired + InitWebContainer initWebContainer; /** * 列表显示 @@ -80,6 +81,7 @@ public @ResponseBody AjaxResult addCompany(SysCompany sysCompany) { int i = sysCompanyService.add(sysCompany); + initWebContainer.initParams(); if (i > 0) { return AjaxResult.buildSuccessInstance("创建成功"); } else { @@ -103,6 +105,7 @@ AjaxResult modifyCompany(SysCompany sysCompany) { AjaxResult result = modify(sysCompanyService, WebUtil.getSessionAttribute(BEV), sysCompany, AppVocabularyCode.COMPANY); + initWebContainer.initParams(); WebUtil.removeSessionAttribute(BEV); return result; } diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/SysRoleAction.java b/zq-erp/src/main/java/com/matrix/system/common/actions/SysRoleAction.java index 3920353..84fc03c 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/actions/SysRoleAction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/SysRoleAction.java @@ -9,14 +9,15 @@ import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; import com.matrix.core.web.BaseAction; +import com.matrix.system.common.authority.DefaultAuthorityManager; import com.matrix.system.common.bean.SysFnBtnRel; import com.matrix.system.common.bean.SysFunction; import com.matrix.system.common.bean.SysRole; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppVocabularyCode; +import com.matrix.system.common.init.LocalCache; import com.matrix.system.common.service.SysFunctionService; import com.matrix.system.common.service.SysRoleService; -import com.matrix.system.constance.Dictionary; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @@ -49,7 +50,6 @@ private SysFunctionService sysFunctionService; public static final String BEV = "SYSROLE_BEV"; - /** * 列表显示 * @@ -230,9 +230,11 @@ } AjaxResult result = modify(sysRoleService, WebUtil.getSessionAttribute(BEV), sysRole, AppVocabularyCode.ROLE); WebUtil.removeSessionAttribute(BEV); + LocalCache.batchRemove(DefaultAuthorityManager.USER_POWER_REDISKEY+"*"); return result; } + /** * 进入修改界面 * diff --git a/zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java b/zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java new file mode 100644 index 0000000..b4b02ed --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/actions/TestActionBB.java @@ -0,0 +1,33 @@ +package com.matrix.system.common.actions; + +import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.web.BaseAction; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * 测试一下 + */ +@RequestMapping(value = "/testb") +@Controller +public class TestActionBB extends BaseAction { + + @Autowired + WeixinServiceUtil weixinServiceUtil; + + + @GetMapping(value = "/testPay/{no}") + @ResponseBody + public AjaxResult hiveMobileLoginOut(@PathVariable String no) { + weixinServiceUtil.comPay("提现", no,1,"oJkRK4yelehsY4S7I6Ee1ydWtQMI",36L); + return AjaxResult.buildSuccessInstance(""); + } + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java b/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java index ce8ae52..381b643 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java +++ b/zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java @@ -1,8 +1,8 @@ package com.matrix.system.common.authority; +import cn.hutool.crypto.SecureUtil; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.authority.strategy.LoginStrategy; @@ -10,6 +10,7 @@ import com.matrix.system.common.bean.SysFunction; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.init.LocalCache; import com.matrix.system.common.service.SysFunctionService; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -17,7 +18,6 @@ import java.util.*; import java.util.Map.Entry; -import java.util.logging.Logger; /** * DefaultAuthorityManager 实现了权限控制接口 @@ -31,13 +31,19 @@ private static final int DEFAULT_2 = 2; + public static final String USER_POWER_REDISKEY = "USER_POWER_"; + public static final String USER_POWER_REDISKEY_PC = "USER_POWER_PC"; + @Autowired SysFunctionService sysFunctionService; public static final String USERFUNCTION = "userFunction"; public static final String MENUSFUNCTION = "menusFunction"; - /** 用户所有路径权限的记录 **/ + /** + * 用户所有路径权限的记录 + **/ public static final String USER_URL_MAPPING = "userUrlMapping"; + private DefaultAuthorityManager() { } @@ -68,28 +74,38 @@ SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); Map<String, SysFunction> userFunction = WebUtil.getSessionAttribute(USERFUNCTION); + + // 企业管理员不校验按钮权限 if (AppConstance.USER_TYPE_DEVELOPER.equals(user.getSuUserType()) || AppConstance.USER_TYPE_SUPER.equals(user.getSuUserType()) || AppConstance.USER_TYPE_ADMIN.equals(user.getSuUserType())) { return true; } - String[] strs = matchStr.split("-"); - if (strs.length != DEFAULT_2) { - throw new IllegalArgumentException("权限matchStr格式错误,需要fnCode:btnValue"); - } - SysFunction fn = userFunction.get(strs[0].trim()); - // 功能是否存在 - if (fn == null) { + if (userFunction == null) { return false; } else { - return StringUtils.isContentSet(strs[1].trim(), fn.getRpfBns()); + + String[] strs = matchStr.split("-"); + if (strs.length != DEFAULT_2) { + throw new IllegalArgumentException("权限matchStr格式错误,需要fnCode:btnValue"); + } + + SysFunction fn = userFunction.get(strs[0].trim()); + // 功能是否存在 + if (fn == null) { + return false; + } else { + return StringUtils.isContentSet(strs[1].trim(), fn.getRpfBns()); + } } + } /** * 判断用户是否具有功能权限 + * * @return */ @Override @@ -101,17 +117,22 @@ return true; } Map<String, SysFunction> userFunction = WebUtil.getSessionAttribute(USERFUNCTION); - SysFunction fn = userFunction.get(fnCode); - return fn == null ? false : true; + if (userFunction == null) { + return false; + } else { + SysFunction fn = userFunction.get(fnCode); + return fn == null ? false : true; + } + } /** * 初始化用户权限 * + * @param result * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2017年12月5日 - * @param result */ public void initUserPower(AjaxResult result) { @@ -127,11 +148,34 @@ // 用户的所有功能权限用id记录,方便后面查询菜单树形结构 Map<String, SysFunction> menuFunctionMap = new TreeMap<>(); - // 获取用户所有权限 - getUserFunction(userFunction, menuFunctionMap, userUrlMapping); + SysUsers sysUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - // 组装菜单 - assembleMenu(menuFunction, menuFunctionMap); + String redisKey = USER_POWER_REDISKEY_PC + SecureUtil.md5(sysUser.getSuId() + ""); + Map<String, Object> cachePowerMap = LocalCache.get(redisKey); + + if (Objects.nonNull(cachePowerMap)) { + + userFunction = (Map<String, SysFunction>) cachePowerMap.get(USERFUNCTION); + + menuFunction = (List<SysFunction>) cachePowerMap.get(MENUSFUNCTION); + + userUrlMapping = (List<String>) cachePowerMap.get(USER_URL_MAPPING); + + } else { + // 获取用户所有权限 + getUserFunction(userFunction, menuFunctionMap, userUrlMapping); + + // 组装菜单 + assembleMenu(menuFunction, menuFunctionMap); + + Map<String, Object> powerMap = new HashMap<>(); + powerMap.put(USERFUNCTION, userFunction); + powerMap.put(MENUSFUNCTION, menuFunction); + powerMap.put(USER_URL_MAPPING, userUrlMapping); + //权限信息加入缓存中 + LocalCache.save(redisKey,powerMap); + } + // 把用户菜单和用户的功能都存在session中。 WebUtil.setSessionAttribute(USERFUNCTION, userFunction); @@ -145,12 +189,12 @@ /** * 获取用的功能,包括菜单功能和非菜单功能 * - * @author JIANGYOUYAO - * @email 935090232@qq.com - * @date 2017年12月5日 * @param userFunctionMap * @param menuFunctionMap * @param userUrlMapping + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月5日 */ private void getUserFunction(Map<String, SysFunction> userFunctionMap, Map<String, SysFunction> menuFunctionMap, List<String> userUrlMapping) { @@ -165,7 +209,7 @@ userFunctionMap.put(sysFunction.getFnCode(), sysFunction); // 注册访问路径 - registerUrlMapping(userUrlMapping, sysFunction,true); + registerUrlMapping(userUrlMapping, sysFunction, true); // 如果是菜单功能单独记录 if (AppConstance.IS_Y.equals(sysFunction.getFnShowMenu())) { @@ -177,7 +221,7 @@ List<SysFunction> userFunctionList = sysFunctionService.findFunctionByRoleIds(sysUser.getRoleIds()); for (SysFunction sysFunction : userFunctionList) { // TODO注册访问路径 - registerUrlMapping(userUrlMapping, sysFunction,false); + registerUrlMapping(userUrlMapping, sysFunction, false); if (userFunctionMap.containsKey(sysFunction.getFnCode())) { @@ -204,11 +248,11 @@ /** * 注册功能和按钮的访问路径 * + * @param userUrlMapping + * @param sysFunction * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2017年12月8日 - * @param userUrlMapping - * @param sysFunction */ private void registerUrlMapping(List<String> userUrlMapping, SysFunction sysFunction, boolean isAdmin) { String path = sysFunction.getFnPath(); @@ -220,7 +264,7 @@ if (CollectionUtils.isNotEmpty(btnRels)) { for (SysFnBtnRel sysFnBtnRel : btnRels) { //公司管理员可以添加所有按钮权限否则只能添加员工自己所有拥有的权限 - if(isAdmin ||StringUtils.isContentSet(sysFnBtnRel.getBtnValue(),sysFunction.getRpfBns())){ + if (isAdmin || StringUtils.isContentSet(sysFnBtnRel.getBtnValue(), sysFunction.getRpfBns())) { String btnPath = sysFnBtnRel.getFbPath(); if (StringUtils.isNotBlank(btnPath) && !userUrlMapping.contains(btnPath)) { userUrlMapping.add(btnPath); @@ -233,11 +277,11 @@ /** * 把菜单组装成树形结构 * + * @param menuFunction + * @param menuFunctionMap * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2017年12月5日 - * @param menuFunction - * @param menuFunctionMap */ private void assembleMenu(List<SysFunction> menuFunction, Map<String, SysFunction> menuFunctionMap) { // 将map.entrySet()转换成list,并按照功能的FnSequence倒序 @@ -261,7 +305,7 @@ } else { // 非一级节点找到父节点后存入 SysFunction parentFn = menuFunctionMap.get(String.valueOf(function.getFnParentId())); - if(parentFn!=null){ + if (parentFn != null) { List<SysFunction> childs = parentFn.getChilds(); if (childs == null) { parentFn.setChilds(new ArrayList<SysFunction>()); diff --git a/zq-erp/src/main/java/com/matrix/system/common/authority/strategy/ScanQrCodeLogin.java b/zq-erp/src/main/java/com/matrix/system/common/authority/strategy/ScanQrCodeLogin.java new file mode 100644 index 0000000..b9cd2ac --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/authority/strategy/ScanQrCodeLogin.java @@ -0,0 +1,82 @@ +package com.matrix.system.common.authority.strategy; + +import com.matrix.component.websoket.WebSoketScanQrCodeLoginObserver; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUserLoginRecord; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.constance.AppMessageCode; +import com.matrix.system.common.service.SysUsersService; + +import java.util.Date; + +/** + * 账号密码登录策略 + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月9日 + */ +public class ScanQrCodeLogin implements LoginStrategy { + + private SysUsersService sysUsersService; + + + private String loginQrCodeKey; + + public ScanQrCodeLogin(SysUsersService sysUsersService, String loginQrCodeKey) { + + this.sysUsersService = sysUsersService; + this.loginQrCodeKey = loginQrCodeKey; + } + + @Override + public Object login() { + + Long loginUserId = WebSoketScanQrCodeLoginObserver.getScanCashValue(loginQrCodeKey); + + if (loginUserId != null) { + SysUsers loginUser = sysUsersService.findById(loginUserId); + if (loginUser != null) { + addErrorLoginRecord(loginUser,AppConstance.LOGIN_SUCCESS); + return loginUser; + } else { + LogUtil.error("登录失败"); + throw new GlobleException(AppMessageCode.User.ACCOUNT_NOT_EXIST); + } + } + + LogUtil.error("登录失败"); + throw new GlobleException(AppMessageCode.User.ACCOUNT_NOT_EXIST); + } + + + /** + * 添加登录记录 + * + * @param loginUser + * @param loginResult + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月12日 + */ + private void addErrorLoginRecord(SysUsers loginUser, int loginResult) { + + if (AppConstance.LOGIN_SUCCESS.equals(loginResult)) { + sysUsersService.cleanUserTodayErrorLoginTime(loginUser.getSuAccount()); + } + SysUserLoginRecord loginRecord = new SysUserLoginRecord(); + loginRecord.setCreateBy(MatrixConstance.SYSTEM_USER); + loginRecord.setUpdateBy(MatrixConstance.SYSTEM_USER); + loginRecord.setLrLoginTime(new Date()); + loginRecord.setLrId(null); + loginRecord.setUserAccount(loginUser.getSuAccount()); + loginRecord.setLrResult(loginResult); + loginRecord.setLrIp(WebUtil.getCustomerIp()); + loginRecord.setLrValid(AppConstance.RECORD_VALID); + sysUsersService.addUserLoginRecord(loginRecord); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/bean/SysCompany.java b/zq-erp/src/main/java/com/matrix/system/common/bean/SysCompany.java index 875c420..4b9e6703 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/bean/SysCompany.java +++ b/zq-erp/src/main/java/com/matrix/system/common/bean/SysCompany.java @@ -134,8 +134,16 @@ private String comPlats; - - + + private String comCode; + + public String getComCode() { + return comCode; + } + + public void setComCode(String comCode) { + this.comCode = comCode; + } public Long getComId() { return comId; @@ -333,7 +341,7 @@ public void setComPlats(String comPlats) { this.comPlats=comPlats; } - + @Override public String toString() { diff --git a/zq-erp/src/main/java/com/matrix/system/common/bean/SysFnBtnRel.java b/zq-erp/src/main/java/com/matrix/system/common/bean/SysFnBtnRel.java index 2c67c60..7e81a99 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/bean/SysFnBtnRel.java +++ b/zq-erp/src/main/java/com/matrix/system/common/bean/SysFnBtnRel.java @@ -1,7 +1,9 @@ package com.matrix.system.common.bean; +import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.anotations.Extend; -import com.matrix.core.pojo.EntityDTO; + +import java.util.Date; /** * 功能按钮关系表 @@ -9,11 +11,21 @@ * @email 935090232@qq.com * @date 2017年12月3日 */ -public class SysFnBtnRel extends EntityDTO { +public class SysFnBtnRel { @Extend private static final long serialVersionUID = 1L; - + + private String createBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8") + private Date createTime; + + private String updateBy; + + private Date updateTime; + + /** 主键:这个关系表物理主键在修改比较中不参与比较 **/ @Extend private Long fbId; @@ -80,4 +92,36 @@ public void setBtnKey(String btnKey) { this.btnKey = btnKey; } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } } diff --git a/zq-erp/src/main/java/com/matrix/system/common/bean/SysFunction.java b/zq-erp/src/main/java/com/matrix/system/common/bean/SysFunction.java index 318325b..2f03b79 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/bean/SysFunction.java +++ b/zq-erp/src/main/java/com/matrix/system/common/bean/SysFunction.java @@ -1,9 +1,9 @@ package com.matrix.system.common.bean; +import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.anotations.Extend; -import com.matrix.core.pojo.EntityDTO; -import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -12,10 +12,19 @@ * @email 935090232@qq.com * @date 2017年12月3日 */ -public class SysFunction extends EntityDTO { +public class SysFunction { @Extend private static final long serialVersionUID = 1L; + + private String createBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8") + private Date createTime; + + private String updateBy; + + private Date updateTime; private Long fnId; @@ -203,4 +212,39 @@ this.fnCode = fnCode; } + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public boolean isHasThisFn() { + return hasThisFn; + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/bean/SysRole.java b/zq-erp/src/main/java/com/matrix/system/common/bean/SysRole.java index 0e2d574..8c19909 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/bean/SysRole.java +++ b/zq-erp/src/main/java/com/matrix/system/common/bean/SysRole.java @@ -59,6 +59,11 @@ private String plates; /** + * 所有客户权限 + */ + private String customer; + + /** * 功能集合 */ @Extend @@ -76,6 +81,14 @@ @Extend private String menuKeys; + public String getCustomer() { + return customer; + } + + public void setCustomer(String customer) { + this.customer = customer; + } + public Integer getIsDefault() { return isDefault; } diff --git a/zq-erp/src/main/java/com/matrix/system/common/bean/SysUsers.java b/zq-erp/src/main/java/com/matrix/system/common/bean/SysUsers.java index 19aee94..a68a8d5 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/bean/SysUsers.java +++ b/zq-erp/src/main/java/com/matrix/system/common/bean/SysUsers.java @@ -19,8 +19,11 @@ private static final long serialVersionUID = 1L; /** 有效*/ + @Extend public static final String VALID_Y="Y"; + /** 无效*/ + @Extend public static final String VALID_N="N"; private Long suId; @@ -241,6 +244,7 @@ private String shopName; + private String allCustomer; private String roleName; @@ -269,6 +273,7 @@ private String departName; + /** * 入职时间区域查询 **/ @@ -283,6 +288,24 @@ @Extend private SysCompany company; + private String openIds; + + public String getOpenIds() { + return openIds; + } + + public void setOpenIds(String openIds) { + this.openIds = openIds; + } + + public String getAllCustomer() { + return allCustomer; + } + + public void setAllCustomer(String allCustomer) { + this.allCustomer = allCustomer; + } + public Long getSuId() { return suId; } diff --git a/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java b/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java index b971f6b..87a5736 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java +++ b/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java @@ -12,6 +12,8 @@ public static final String WX_ORDER_FLAG = "微商城同步订单"; public static final String ZONGDIAN = "总店"; + + private AppConstance() { } @@ -262,41 +264,11 @@ // =====================================订单包裹相关 - /** - * 省内包裹 - */ - public static final String IN_PROVINCE_PACKAGE = "IN_PROVINCE_PACKAGE"; - /** - * 外省包裹 - */ - public static final String OUT_PROVINCE_PACKAGE = "OUT_PROVINCE_PACKAGE"; - /** - * 省内免邮费包裹 - */ - public static final String PROVINCE_OVER_FREE_PACKAGE = "PROVINCE_OVER_FREE_PACKAGE"; // =====================================订单短信提醒相关 - /** - * 短信提醒 - */ - public static final String MSG_ALERT = "MSG_ALERT"; - /** - * 短信提醒号码(多个以",分割") - */ - public static final String MSG_ALERT_MOBILE = "MSG_ALERT_MOBILE"; - - /** - * 短信提醒内容 - */ - public static final String MSG_ALERT_CONTENT = "MSG_ALERT_CONTENT"; - - /** - * 商户余额不足短信提醒内容 - */ - public static final String MSG_ALERT_NSF = "MSG_ALERT_NSF"; /** * 待开票 @@ -542,51 +514,108 @@ public static final String REFUND_FAIL_NOTENOUGH = "NOTENOUGH"; - // =====================================分销相关 /** - * 成为分销商最低额度(查询数据字典时使用) + * 运费 */ - public static final String BECOMING_DISTRIBUTOR_CONDITION = "BECOMING_DISTRIBUTOR_CONDITION"; - + public static final String PACKAGE_PRICE = "PACKAGE_PRICE"; /** - * 用户等级-分销商 + * 免免邮金额 */ - public static final Integer USER_VIP_DISTRIBUTOR = 1; - - /** - * 积分业务类型-获得 - */ - public static final Integer SCORE_BUSINESS_TYPE_GET = 1; - - /** - * 积分业务类型-兑换 - */ - public static final Integer SCORE_BUSINESS_TYPE_EXCHANGE = 2; - - /** - * 免费配送距离 - */ - public static final String DELIVERY_DISTANCE = "delivery_distance"; - /** - * 支持学校列表 - */ - public static final String SCHOOL = "SCHOOL"; + public static final String FREE_PACKAGE_PRICE = "FREE_PACKAGE_PRICE"; /** - * 省运费关系 + * 小程序APPID */ - public static final String IN_PROVINCE_PACKAGE_PRICE = "IN_PROVINCE_PACKAGE_PRICE"; - public static final String FIRST_OUT_PROVINCE_PACKAGE_PRICE = "FIRST_OUT_PROVINCE_PACKAGE_PRICE"; - public static final String SECOND_OUT_PROVINCE_PACKAGE_PRICE = "SECOND_OUT_PROVINCE_PACKAGE_PRICE"; - - public static final String IN_PROVINCE_PACKAGE_LIST = "IN_PROVINCE_PACKAGE_LIST"; - public static final String FIRST_PROVINCE_PACKAGE_LIST = "FIRST_PROVINCE_PACKAGE_LIST"; - public static final String SECOND_PROVINCE_PACKAGE_LIST = "SECOND_PROVINCE_PACKAGE_LIST"; + public static final String MINIPROGRAM_APPID = "miniprogramAppid"; /** - * 起送费 + * 小程序Secret */ - public static final String QSFY = "QSFY"; + public static final String MINIPROGRAM_SECRET = "miniprogramSecret"; + /** + * 公众号APPID + */ + public static final String GZH_APPID = "gzhAppId"; + + /** + * 微信商户号 + */ + public static final String WECHARPAY_MCHID = "wecharPayMchId"; + /** + * 支付秘钥 + */ + public static final String WECHARPAY_SECRET = "wecharPaySecret"; + + /** + * 支付通知地址 + */ + public static final String WECHARPAY_NOTIFYURL = "wecharPaynotifyUrl"; + /** + * 充值支付通知地址 + */ + public static final String WECHARPAY_RECHARGE_NOTIFYURL = "wecharpayRechargeNotifyurl"; + + + /** + * 支付证书地址 + */ + public static final String WECHARPAY_CERTLOCAL_PATH = "certLocalPath"; + + /** + * APP管理模块Banner + */ + public static final String APP_BANNER_GL = "APP_BANNER_GL"; + + + /** + * 是否管理产品库存 + */ + public static final String WAREHOUSE_MANAGE_STOCK = "WAREHOUSE_MANAGE_STOCK"; + + + /** + * 家居产品销售是否生成消耗业绩 + */ + public static final String SHOP_MANAGE_JJCPAS_CONSUME = "shopManageJjcpasConsume"; + + /** + * 门店是否只能取消待付款订单,服务单 + */ + public static final String SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER = "shopManageAbleCancelDfkOrder"; + /** + * 服务记录跟进模板 + */ + public static final String SERVICE_FLOW_TEMPLATE = "SERVICE_FLOW_TEMPLATE"; + /** + * 开启短信提醒 + */ + public static final String OPEN_SMS_NOTICE = "OPEN_SMS_NOTICE"; + + /** + * 服务单自动配料 + */ + public static final String OPEN_SERVICE_ORDER_AUTO_BATCHING = "OPEN_SERVICE_ORDER_AUTO_BATCHING"; + + /** + * 赠送金额购买产品算赠送购买 + */ + public static final String SHOP_MANAGE_GIFTISFREE = "shopManageGiftisfree"; + + /** + * 钉钉通知token + */ + public static final String WX_ORDER_NOTICE_DINGDING_TOKEN = "wxOrderNoticeDingdingToken"; + + /** + * 管理端小程序appid + */ + public static final String MINI_PROGRAM_MANAGER_APP_ID = "xcx_manager_appid"; + /** + * 管理端小程序secret + */ + public static final String MINI_PROGRAM_MANAGER_SECRET = "xcx_manager_secret"; + + } diff --git a/zq-erp/src/main/java/com/matrix/system/common/dao/BusParameterSettingsDao.java b/zq-erp/src/main/java/com/matrix/system/common/dao/BusParameterSettingsDao.java index 9b7b29a..22a7752 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/dao/BusParameterSettingsDao.java +++ b/zq-erp/src/main/java/com/matrix/system/common/dao/BusParameterSettingsDao.java @@ -1,52 +1,52 @@ -package com.matrix.system.common.dao; - -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.common.bean.BusParameterSettings; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - - -/** - * This field was generated by Zking.software.Codegen. - * @date 2016-11-28 16:55 - */ - - -public interface BusParameterSettingsDao { - - public int insert(BusParameterSettings busParameterSettings); - - public int batchInsert(@Param("list") List<BusParameterSettings> busParameterSettingsList); - - public int updateByMap(Map<String, Object> modifyMap); - - public int updateByModel(BusParameterSettings busParameterSettings); - - public int deleteByIds(@Param("list") List<Long> list); - - public int deleteById(Long paramId); - - public int deleteByModel(@Param("record") BusParameterSettings busParameterSettings); - - public List<BusParameterSettings> selectInPage(@Param("record") BusParameterSettings busParameterSettings, @Param("pageVo") PaginationVO pageVo); - - public List<BusParameterSettings> selectByModel(@Param("record") BusParameterSettings busParameterSettings); - - public int selectTotalRecord(@Param("record") BusParameterSettings busParameterSettings); - - public BusParameterSettings selectById(Long paramId); - - public BusParameterSettings selectForUpdate(Long paramId); - - List<BusParameterSettings> selectByCodes(@Param("list")List<String> codeList, @Param("companyId")Long companyId,@Param("shopId")Long shopId); - - - - BusParameterSettings selectByCode(@Param("code")String code, @Param("companyId")Long companyId,@Param("shopId")Long shopId); - - BusParameterSettings selectCompanyParamByCode(@Param("code")String code, @Param("companyId")Long companyId); - - int updateParams(@Param("list")List<BusParameterSettings> parameterSettings, @Param("companyId")Long companyId); +package com.matrix.system.common.dao; + +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.common.bean.BusParameterSettings; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + + +/** + * This field was generated by Zking.software.Codegen. + * @date 2016-11-28 16:55 + */ + + +public interface BusParameterSettingsDao { + + public int insert(BusParameterSettings busParameterSettings); + + public int batchInsert(@Param("list") List<BusParameterSettings> busParameterSettingsList); + + public int updateByMap(Map<String, Object> modifyMap); + + public int updateByModel(BusParameterSettings busParameterSettings); + + public int deleteByIds(@Param("list") List<Long> list); + + public int deleteById(Long paramId); + + public int deleteByModel(@Param("record") BusParameterSettings busParameterSettings); + + public List<BusParameterSettings> selectInPage(@Param("record") BusParameterSettings busParameterSettings, @Param("pageVo") PaginationVO pageVo); + + public List<BusParameterSettings> selectByModel(@Param("record") BusParameterSettings busParameterSettings); + + public int selectTotalRecord(@Param("record") BusParameterSettings busParameterSettings); + + public BusParameterSettings selectById(Long paramId); + + public BusParameterSettings selectForUpdate(Long paramId); + + List<BusParameterSettings> selectByCodes(@Param("list")List<String> codeList, @Param("companyId")Long companyId,@Param("shopId")Long shopId); + + List<BusParameterSettings> selectByCodesAndCompanyId(@Param("list")List<String> codeList, @Param("companyId")Long companyId); + + BusParameterSettings selectByCode(@Param("code")String code, @Param("companyId")Long companyId,@Param("shopId")Long shopId); + + BusParameterSettings selectCompanyParamByCode(@Param("code")String code, @Param("companyId")Long companyId); + + int updateParams(@Param("list")List<BusParameterSettings> parameterSettings, @Param("companyId")Long companyId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/dao/SysCompanyDao.java b/zq-erp/src/main/java/com/matrix/system/common/dao/SysCompanyDao.java index 69d5c4a..47e5de8 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/dao/SysCompanyDao.java +++ b/zq-erp/src/main/java/com/matrix/system/common/dao/SysCompanyDao.java @@ -40,4 +40,5 @@ public SysCompany selectForUpdate(Long comId); + List<SysCompany> selectAll(); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/dao/SysRolePwoerFnDao.java b/zq-erp/src/main/java/com/matrix/system/common/dao/SysRolePwoerFnDao.java index 0d9a4cb..c72524b 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/dao/SysRolePwoerFnDao.java +++ b/zq-erp/src/main/java/com/matrix/system/common/dao/SysRolePwoerFnDao.java @@ -41,4 +41,5 @@ public SysRolePwoerFn selectForUpdate(Long rpfId); + int deleteByFns(@Param("companyId") Long comId, @Param("list") List<String> deletedFn); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java b/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java index d8a8cfd..7d3181a 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java +++ b/zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java @@ -3,6 +3,7 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.system.common.bean.SysUserLoginRecord; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.hive.bean.AppVersion; import com.matrix.system.hive.bean.SysBeauticianState; import com.matrix.system.hive.bean.SysProjServices; import org.apache.ibatis.annotations.Param; @@ -122,5 +123,9 @@ */ public int emptySignInfoById(Long id); + public List<AppVersion> selectAppVersion(); + SysUsers selectUserByOpenId(@Param("openId") String openId, @Param("companyId") Long companyId); + + int updateUserOpenId(@Param("openId") String openId, @Param("suId") Long suId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/dto/WebLoginDto.java b/zq-erp/src/main/java/com/matrix/system/common/dto/WebLoginDto.java new file mode 100644 index 0000000..73561e3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/dto/WebLoginDto.java @@ -0,0 +1,32 @@ +package com.matrix.system.common.dto; + +import lombok.Data; + +@Data +public class WebLoginDto { + + public static final Integer ACCOUNT_LOGIN=1; + + public static final Integer SCANQRCORD_LOGIN=2; + + + /** + * 账号 + */ + private String suAccount; + + /** + * 密码 + */ + private String suPassword; + + /** + * 登录方式1,账号密码,2扫码 + */ + private Integer loginType; + /** + * 终端标识 + */ + private String loginQrCodeKey; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/init/InitWebContainer.java b/zq-erp/src/main/java/com/matrix/system/common/init/InitWebContainer.java index a9f0527..3749554 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/init/InitWebContainer.java +++ b/zq-erp/src/main/java/com/matrix/system/common/init/InitWebContainer.java @@ -4,33 +4,41 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import javax.servlet.ServletContext; import com.matrix.core.exception.GlobleException; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysCompany; import com.matrix.system.common.service.SysCompanyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; import org.springframework.stereotype.Controller; import org.springframework.web.context.ServletContextAware; import com.matrix.core.constance.MatrixConstance; /** - * + * * 初始化web容器的类 一些网站启动需要加载的数据和方法在这里配置和执行 * @author:姜友瑶 * @date 2016年10月18日 */ -@Controller -public class InitWebContainer implements ServletContextAware{ +@Component +@Order(Ordered.HIGHEST_PRECEDENCE) +public class InitWebContainer implements ApplicationRunner { + private static final String TRUE = "true"; - - private ServletContext servletContext; static private final String LANGUAGE_ZH = "zh"; @@ -53,15 +61,13 @@ private String systemLanguage; /** - * + * * 容器启动后加载数据 * @author:姜友瑶 - * @param sc * @date 2016年10月18日 */ @Override - public void setServletContext(ServletContext sc) { - this.servletContext = sc; + public void run(ApplicationArguments args) { // 初始化调试模式 initDebug(); @@ -70,10 +76,10 @@ //初始化公司 initParams(); LogUtil.info("\r\n\r\n**********************************************\r\n" - + "* =========== Matrix启动成功 ===========\r\n" + + "* =========== 成功 ===========\r\n" + "* DEBUG模式:" + debug+"*\r\n" + "* 语言环境:" + Locale.getDefault().getLanguage()+"\r\n" - + + "**********************************************\r\n"); } @@ -87,7 +93,7 @@ /** * 初始化语言环境,默认为中文 - * + * * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2017年11月30日 @@ -116,12 +122,13 @@ List<SysCompany> company=sysCompanyService.findByModel(null); Map<String, SysCompany> companyMap=new HashMap<>(); for (SysCompany sysCompany : company) { - companyMap.put(sysCompany.getComWebUrl(), sysCompany); + companyMap.put(sysCompany.getComCode(), sysCompany); } - servletContext.setAttribute("companyMap", companyMap); + LocalCache.save("companyMap", companyMap); } + } diff --git a/zq-erp/src/main/java/com/matrix/system/common/init/LocalCache.java b/zq-erp/src/main/java/com/matrix/system/common/init/LocalCache.java new file mode 100644 index 0000000..ed624c2 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/init/LocalCache.java @@ -0,0 +1,215 @@ +package com.matrix.system.common.init; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import lombok.Data; + +import java.util.Iterator; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; + +public class LocalCache { + + /* + * 清理线程运行状态 0 未启动,1 已启动 + */ + private static int CLEAR_THREAD_STATUS = 0; + + private static ConcurrentMap<String, Value> localCache = new ConcurrentHashMap(60); + + /** + * 根据key匹配多个缓存值 + * + * @param key + * @param <T> + * @return + */ + public static <T> Map<String, T> getValues(String key) { + return localCache.entrySet().stream() + .filter(item -> StringUtils.isMatch(key, item.getKey())) + .map(Map.Entry::getValue) + .filter(item -> Objects.nonNull(item.value)) + .collect(Collectors.toMap(Value::getKey, item -> (T) item.value)); + } + + /** + * 获取本地缓存 + * + * @param key + * @param <T> + * @return + */ + public static <T> T get(String key) { + Value value = localCache.get(key); + if (Objects.nonNull(value)) { + return (T) value.value; + } + return null; + } + + /** + * 删除缓存 + * + * @param key + * @param <T> + * @return + */ + public static <T> T remove(String key) { + Value value = localCache.remove(key); + if (Objects.nonNull(value)) { + return (T) value.value; + } + return null; + } + + /** + * 批量删除缓存 + * + * @param key + * @return + */ + public static int batchRemove(String key) { + int count = 0; + Set<Map.Entry<String, Value>> entries = localCache.entrySet(); + Iterator<Map.Entry<String, Value>> iterator = entries.iterator(); + while (iterator.hasNext()) { + Map.Entry<String, Value> next = iterator.next(); + if (StringUtils.isMatch(key, next.getKey())) { + remove(next.getKey()); + count++; + } + } + return count; + } + + /** + * 保存一个本地缓存 + * + * @param key + * @param value + */ + public static void save(String key, Object value) { + if (null != localCache.put(key, buildValue(key, value))) { + LogUtil.debug("覆盖原有缓存{}", key); + } + } + + /** + * 设置含过期时间的缓存 + * + * @param key + * @param value + * @param timeOut 毫秒 + */ + public static void save(String key, Object value, long timeOut) { + if (null != localCache.put(key, buildValue(key, value, timeOut))) { + LogUtil.debug("覆盖原有缓存{}", key); + } + startClearThread(); + } + + /** + * 重置缓存失效时间 + * @param key + */ + public static void resetExpire(String key) { + Objects.requireNonNull(key); + Value value = localCache.get(key); + if(Objects.nonNull(value)){ + value.getCreateTime().set(System.currentTimeMillis()); + } + } + + /** + * 清理过期对象 + */ + private synchronized static void startClearThread() { + if (CLEAR_THREAD_STATUS == 0) { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("demo-pool-%d").build(); + ExecutorService singleThreadPool = new ThreadPoolExecutor(1, 1, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue<Runnable>(1), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + singleThreadPool.execute(() -> { + CLEAR_THREAD_STATUS = 1; + while (true) { + try { + Set<Map.Entry<String, Value>> entries = localCache.entrySet(); + Iterator<Map.Entry<String, Value>> iterator = entries.iterator(); + while (iterator.hasNext()) { + Map.Entry<String, Value> next = iterator.next(); + + if (next.getValue().timeOut == 0) { + continue; + } + + boolean isTimeOut = (System.currentTimeMillis() - next.getValue().getCreateTime().longValue()) > next.getValue().timeOut; + if (isTimeOut) { + Value removed = localCache.remove(next.getKey()); + LogUtil.debug("清除过期对象:{}", removed.value); + } + } + Thread.sleep(1000); + } catch (InterruptedException e) { + LogUtil.error("清理缓存线程异常停止", e); + CLEAR_THREAD_STATUS = 0; + } + } + }); + + + } + } + + + private static Value buildValue(String key, Object value) { + return buildValue(key, value, 0); + } + + + private static Value buildValue(String key, Object value, long timeOut) { + Value instances = new Value(); + instances.createTime = new AtomicLong(System.currentTimeMillis()); + instances.key = key; + instances.value = value; + instances.timeOut = timeOut; + return instances; + } + + + + + /** + * 缓存对象 + */ + @Data + static class Value { + + /** + * 过期时间,0 表示不过期,单位毫秒 + */ + private long timeOut = 0; + /** + * 缓存key + */ + private String key; + /** + * 缓存值 + */ + private Object value; + + /** + * 缓存创建时间 + */ + private AtomicLong createTime; + + + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/init/UserCacheManager.java b/zq-erp/src/main/java/com/matrix/system/common/init/UserCacheManager.java new file mode 100644 index 0000000..4db415f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/init/UserCacheManager.java @@ -0,0 +1,120 @@ +/** + * projectName: zq-erp + * fileName: UserCacheManager.java + * packageName: com.matrix.system.common.init + * date: 2021-10-25 16:58 + * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. + */ +package com.matrix.system.common.init; + +import com.matrix.core.constance.SystemErrorCode; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.UUIDUtil; +import com.matrix.core.tools.WebUtil; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.util.Objects; + +/** + * @version: V1.0 + * @author: JiangYouYao + * @className: UserCacheManager + * @packageName: com.matrix.system.common.init + * @description: 用户缓存管理 + * @data: 2021-10-25 16:58 + **/ +@Component +public class UserCacheManager { + + @Value("${debug}") + private String isDebug; + + + /** + * 判断用户是否已经登录过 + * + * @return + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2018年1月19日 + * 会从http请求投中获取token进行验证 + */ + public boolean isUserLogin() { + String token = getUserToken(); + if (StringUtils.isNotBlank(token)) { + return LocalCache.get(token) != null; + } else { + return false; + } + } + + /** + * 在本地缓存中保存用户信息,并且返回保存的token + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2018年1月19日 + * @return 返回保存用户信息的token + */ + public String saveUserInfo(Object obj) { + String token = UUIDUtil.getRandomID(); + LocalCache.save(token, obj); + return token; + } + + /** + * 用户退出 + * + * @author:吕敬瑛 + * @date:2018年1月19日下午3:17:14 + */ + public void loginOut() { + LocalCache.remove(getUserToken()); + } + + /** + * 更新用户缓存 + */ + public void updateUserInfo(Object user) { + LocalCache.save(getUserToken(),user); + } + + /** + * 获取登录用户信息,如果 获取失败将会抛出异常 + * + * @return + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2018年1月19日 + */ + public <T> T getLoginUser() { + String userToken = getUserToken(); + if (userToken != null) { + T user = LocalCache.get(userToken); + if (Objects.nonNull(user)) { + //重新设置key过期时间 + LocalCache.resetExpire(userToken); + return user; + } else { + throw new GlobleException(SystemErrorCode.REQUEST_INVALID); + } + } else { + throw new GlobleException(SystemErrorCode.REQUEST_INVALID); + } + } + + public String getUserToken() { + String token = WebUtil.getRequest().getHeader("token"); + // debug模式可以从url参数中获取token + if (StringUtils.isBlank(token) && "true".equals(isDebug)) { + if (token == null) { + token = WebUtil.getRequest().getParameter("token"); + } + } + return token; + } + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java b/zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java new file mode 100644 index 0000000..cb284a7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java @@ -0,0 +1,123 @@ +package com.matrix.system.common.interceptor; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.RSAUtils; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.SysUsersDao; +import com.matrix.system.common.init.LocalCache; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Objects; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@Component +public class ApiUserLoginInterceptor implements HandlerInterceptor { + + + @Value("${login_private_key}") + private String privateKey; + + @Value("${evn}") + private String evn; + + @Autowired + private SysUsersDao sysUsersDao; + + private static final String TOKEN_HEADER = "Authorization"; + private static final String TOKEN_START_WITH = "Bearer "; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { +// if ("dev".equals(evn)) { +// SysUsers sysUsers = sysUsersDao.selectById(1022L); +// request.getSession().setAttribute(MatrixConstance.LOGIN_KEY, sysUsers); +// return true; +// } + + String token = resolveToken(request,privateKey); + AjaxResult ajaxResult = new AjaxResult(); + ajaxResult.setStatus(AjaxResult.STATUS_LOGIN_INVALID); + + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/json; charset=utf-8"); + if (StringUtils.isBlank(token)) { + ajaxResult.setInfo("login time out"); + response.getWriter().write(new ObjectMapper().writeValueAsString(ajaxResult)); + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + return false; + } + + SysUsers sysUsers = LocalCache.get(token); + if (Objects.isNull(sysUsers)) { + ajaxResult.setInfo("login time out"); + response.getWriter().write(new ObjectMapper().writeValueAsString(ajaxResult)); + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + return false; + } + + request.getSession().setAttribute(MatrixConstance.LOGIN_KEY, sysUsers); + return true; + } + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { + request.getSession().removeAttribute(MatrixConstance.LOGIN_KEY); + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { + + } + + /** + * 解析token token_timestamp_url + * + * @param request + * @return + */ + public static String resolveToken(HttpServletRequest request,String privateKey) { + String headToken = request.getHeader(TOKEN_HEADER); + String sb = request.getRequestURI(); + + if (StringUtils.isNotBlank(headToken) && headToken.startsWith(TOKEN_START_WITH)) { + // 去掉令牌前缀 + String rsaToken = headToken.replace(TOKEN_START_WITH, ""); + + try { + String decryptToken = new String(RSAUtils.decryptByPrivateKey(rsaToken, privateKey)); + + String[] s = decryptToken.split("_"); + if (s == null || s.length != 3) { + return ""; + } + + LogUtil.info("请求路径:{} -- {}", sb, s[2]); + if (!sb.equals(s[2])) { + return ""; + } + + return s[0]; + } catch (Exception e) { + LogUtil.info("#token解析错误:{}#", e); + return ""; + } + + } + + return ""; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/interceptor/HostInterceptor.java b/zq-erp/src/main/java/com/matrix/system/common/interceptor/HostInterceptor.java index 505c871..7effc67 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/interceptor/HostInterceptor.java +++ b/zq-erp/src/main/java/com/matrix/system/common/interceptor/HostInterceptor.java @@ -1,13 +1,12 @@ package com.matrix.system.common.interceptor; -import com.matrix.core.constance.MatrixConstance; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; - import com.matrix.system.common.bean.SysCompany; +import com.matrix.system.common.init.InitWebContainer; +import com.matrix.system.common.init.LocalCache; import org.springframework.stereotype.Component; -import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; @@ -19,6 +18,7 @@ /** * 域名与公司对应绑定拦截 + * * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2017年11月29日 @@ -27,64 +27,48 @@ public class HostInterceptor extends HandlerInterceptorAdapter { - public static final String ATTR_COMPANY = "company"; + public static final String ATTR_COMPANY = "company"; - @Override - public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3) - throws Exception { - } + @Override + public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3) + throws Exception { + } - /** - * 通用拦截器 - */ - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception { - SysCompany company= WebUtil.getSessionAttribute(ATTR_COMPANY); + /** + * 通用拦截器 + */ + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception { - if (company != null) { - LogUtil.debug("匹配到公司{}", company.getComName()); - return true; - } else { - // 获得请求的域名 - String host = WebUtil.getRequest().getServerName(); - //判断是否为debug模式 - if(MatrixConstance.DEBUG){ - String debugHost=request.getHeader("debugHost"); - if(StringUtils.isNotBlank(debugHost)){ - host=debugHost; - WebUtil.getSession().removeAttribute(ATTR_COMPANY); - LogUtil.debug("debugHost={}",host); - } - } - LogUtil.debug("当前请求域名{}", host); - @SuppressWarnings("unchecked") - Map<String, SysCompany> companyMap = (Map<String, SysCompany>) WebUtil.getServletContext() - .getAttribute("companyMap"); - if(Objects.nonNull(companyMap)){ - Set<String> hostSet = companyMap.keySet(); - for (String key : hostSet) { - LogUtil.debug("-- 匹配公司key={},host={} 匹配结果={}", key , host, key.contains(host)); - if (key.contains(host)) { - // 查到公司后存到sesssion中 - WebUtil.setSessionAttribute(ATTR_COMPANY, companyMap.get(key)); - return true; - } - } - } - } - LogUtil.debug("没有匹配到对应的公司"); - return false; - } + // 获得请求的域名--由小程序直接传过来companyCode参数对应公司的网址 + String host = request.getHeader("companyCode"); + LogUtil.debug("当前请求域名{}", host); + if (StringUtils.isBlank(host)) { + return false; + } + + Map<String, SysCompany> companyMap = LocalCache.get("companyMap"); + SysCompany company=companyMap.get(host); + if(Objects.nonNull(company)){ + // 查到公司后存到sesssion中 + LogUtil.debug("匹配到公司{}", company.getComName()); + WebUtil.setSessionAttribute(ATTR_COMPANY, company); + return true; + } + LogUtil.debug("没有匹配到对应的公司"); + return false; + } - /** - * 获取当前域名对于的公司ID - * @return - */ - public static Long getCompanyId() { - return ((SysCompany) WebUtil.getSessionAttribute(ATTR_COMPANY)).getComId(); - } + /** + * 获取当前域名对于的公司ID + * + * @return + */ + public static Long getCompanyId() { + return ((SysCompany) WebUtil.getSessionAttribute(ATTR_COMPANY)).getComId(); + } } diff --git a/zq-erp/src/main/java/com/matrix/system/common/interceptor/UserLoginInterceptor.java b/zq-erp/src/main/java/com/matrix/system/common/interceptor/UserLoginInterceptor.java index e1e5bb3..9603548 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/interceptor/UserLoginInterceptor.java +++ b/zq-erp/src/main/java/com/matrix/system/common/interceptor/UserLoginInterceptor.java @@ -33,10 +33,11 @@ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception { - String requestUrl = request.getRequestURI(); + String requestUrl = request.getRequestURI(); // 如果访问特殊的路径需要验证管理员的登录权限 if (requestUrl.indexOf(ADMIN) != -1 || requestUrl.indexOf(SUPER) != -1 || requestUrl.indexOf(DEVELOPER) != -1 || requestUrl.indexOf(CUSTOMER) != -1) { + if (WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY) == null) { // 判断是否为异步请求 String requestType = request.getHeader(X_REQUESTED_WITH); diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/BusParameterSettingService.java b/zq-erp/src/main/java/com/matrix/system/common/service/BusParameterSettingService.java new file mode 100644 index 0000000..e98dd93 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/service/BusParameterSettingService.java @@ -0,0 +1,40 @@ +package com.matrix.system.common.service; + +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysCompany; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.score.constant.ScoreSettingConstant; +import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@Service +@AllArgsConstructor +public class BusParameterSettingService { + + private BusParameterSettingsDao busParameterSettingsDao; + + /** + * 判断某个设置是否是开启状态 + * 未配置,或者无效settingkey都返回false + */ + public boolean isSettingOpen(String settingKey,Long companyId) { + BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(settingKey, companyId); + return ( + Objects.nonNull(busParameterSettings) + && StringUtils.isNotBlank(busParameterSettings.getParamValue()) + && AppConstance.IS_Y.equals(busParameterSettings.getParamValue()) + ); + } + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java b/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java index 17e6205..ec9d7c5 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java +++ b/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java @@ -3,6 +3,7 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.system.common.bean.SysUserLoginRecord; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.hive.bean.AppVersion; import com.matrix.system.hive.bean.SysBeauticianState; import com.matrix.system.hive.bean.SysProjServices; @@ -170,5 +171,9 @@ public int findByCodeBeaStateShopCount(Long shopId, SysProjServices sysProjServices, List<String> panBanCodes); + public List<AppVersion> findAppVersion(); + SysUsers findByOpenId(String openId, Long companyId); + + int modifyUserOpenId(String openId, Long suId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java b/zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java new file mode 100644 index 0000000..b7f5673 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java @@ -0,0 +1,68 @@ +package com.matrix.system.common.service.impl; + +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysCompany; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.score.constant.ScoreSettingConstant; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class InitBusParameterSettingService { + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + /** + * 初始化默认积分规则设置 + */ + public void initBusParameterSetting(SysCompany sysCompany) { + long companyId = sysCompany.getComId(); + List<BusParameterSettings> ruleSettings=new ArrayList<>(); + + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CREDIT_POINTS_CASH, companyId)); + + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.GIVE_CONSUMPTION, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.REFERRALS_CONSUMPTION, companyId)); + + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, companyId)); + ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, companyId)); + + busParameterSettingsDao.batchInsert(ruleSettings); + } + + /** + * 初始化默认分销规则设置 + */ + public void initBusParameterFenxiaoSetting(SysCompany sysCompany) { + long companyId = sysCompany.getComId(); + List<BusParameterSettings> ruleSettings=new ArrayList<>(); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_SWITCH, companyId)); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_MODEL, companyId)); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_WAY, companyId)); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_AUDIT_METHOD, companyId)); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId)); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_PLAN, companyId)); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_POSTER, companyId)); + ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_ZGFY, companyId)); + busParameterSettingsDao.batchInsert(ruleSettings); + } + + private BusParameterSettings addScoreRuleSetting(String code,long companyId) { + BusParameterSettings busParameterSetting = new BusParameterSettings(); + busParameterSetting.setParamCode(code); + busParameterSetting.setCompanyId(companyId); + return busParameterSetting; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/impl/InitShopProductCateService.java b/zq-erp/src/main/java/com/matrix/system/common/service/impl/InitShopProductCateService.java index d84991c..f6850fe 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/service/impl/InitShopProductCateService.java +++ b/zq-erp/src/main/java/com/matrix/system/common/service/impl/InitShopProductCateService.java @@ -2,9 +2,6 @@ import com.matrix.core.constance.MatrixConstance; import com.matrix.system.common.bean.SysCompany; -import com.matrix.system.common.bean.SysRole; -import com.matrix.system.common.dao.SysRoleDao; -import com.matrix.system.constance.Dictionary; import com.matrix.system.shopXcx.bean.ShopProductAttribute; import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; import org.springframework.beans.BeanUtils; @@ -40,7 +37,8 @@ ShopProductAttribute service=new ShopProductAttribute(); BeanUtils.copyProperties(cpfl,service); - service.setAttrName("服务"); + service.setAttrName("属性"); + service.setAttrCode("service"); shopProductAttributeDao.batchInsert(Arrays.asList(cpfl,service)); diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java index 1521bd2..bb496c6 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java @@ -1,32 +1,43 @@ package com.matrix.system.common.service.impl; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.json.JSONUtil; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; -import com.matrix.system.common.bean.*; +import com.matrix.system.app.authority.AppAuthorityManager; +import com.matrix.system.common.authority.DefaultAuthorityManager; +import com.matrix.system.common.bean.SysCompany; +import com.matrix.system.common.bean.SysRole; +import com.matrix.system.common.bean.SysRolePwoerFn; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.SysCompanyDao; import com.matrix.system.common.dao.SysRoleDao; import com.matrix.system.common.dao.SysRolePwoerFnDao; +import com.matrix.system.common.init.LocalCache; import com.matrix.system.common.service.SysCompanyService; +import com.matrix.system.common.service.SysUsersService; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.bean.Warehouse; import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.system.hive.dao.WarehouseDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 公司管理 - * + * * @author JIANGYOUYAO * @email 935090232@qq.com * @date Dec 11, 2017 @@ -34,212 +45,256 @@ @Service public class SysCompanyServiceImpl implements SysCompanyService { - @Autowired - private SysCompanyDao sysCompanyDao; - @Autowired - private SysRoleDao sysRoleDao; - @Autowired - private SysRolePwoerFnDao rolePwoerFnDao; + @Autowired + private SysCompanyDao sysCompanyDao; + @Autowired + private SysRoleDao sysRoleDao; + @Autowired + private SysRolePwoerFnDao rolePwoerFnDao; - @Autowired - private SysShopInfoDao shopInfoDao; + @Autowired + private SysShopInfoDao shopInfoDao; - @Autowired - private InitCustomerDataDictionaryService initCustomerDataDictionaryService; + @Autowired + private InitCustomerDataDictionaryService initCustomerDataDictionaryService; - @Autowired - private InitShoppingGoodsCategoryService initShoppingGoodsCategoryService; + @Autowired + private InitShoppingGoodsCategoryService initShoppingGoodsCategoryService; - @Autowired - private InitRolePowerService initRolePowerService; + @Autowired + private InitRolePowerService initRolePowerService; - @Autowired - private InitGoodsTypeService initGoodsTypeService; + @Autowired + private InitGoodsTypeService initGoodsTypeService; - @Autowired - private InitShopProductCateService initShopProductCateService; + @Autowired + private InitShopProductCateService initShopProductCateService; + + @Autowired + private InitBusParameterSettingService initBusParameterSettingService; - @Transactional - @Override - public int add(SysCompany sysCompany) { - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - sysCompany.setCreateBy(user.getSuName()); - sysCompany.setUpdateBy(user.getSuName()); - int i= sysCompanyDao.insert(sysCompany); - SysShopInfo zbShop= addZbShop(sysCompany); - initCustomerDataDictionaryService.initCustomerDataDictionary(sysCompany); - initShoppingGoodsCategoryService.initShoppingGoodsCategory(sysCompany,zbShop); - initRolePowerService.initRolePower(sysCompany); - initGoodsTypeService.initRolePower(sysCompany); - initShopProductCateService.initShopProductCate(sysCompany); + @Transactional + @Override + public int add(SysCompany sysCompany) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + sysCompany.setCreateBy(user.getSuName()); + sysCompany.setUpdateBy(user.getSuName()); + int i = sysCompanyDao.insert(sysCompany); + SysShopInfo zbShop = addZbShop(sysCompany); + initCustomerDataDictionaryService.initCustomerDataDictionary(sysCompany); + initShoppingGoodsCategoryService.initShoppingGoodsCategory(sysCompany, zbShop); + initRolePowerService.initRolePower(sysCompany); + initGoodsTypeService.initRolePower(sysCompany); + initShopProductCateService.initShopProductCate(sysCompany); + initBusParameterSettingService.initBusParameterSetting(sysCompany); + initBusParameterSettingService.initBusParameterFenxiaoSetting(sysCompany); - return i; + return i; - } + } - @Autowired - private WarehouseDao warehouseDao; - /** - * 为新公司创建一个总部 - * @param sysCompany - */ - private SysShopInfo addZbShop(SysCompany sysCompany) { - SysShopInfo zbShopInfo=new SysShopInfo(); - zbShopInfo.setShopType(SysShopInfo.SHOP_TYPE_ZONGBU); - zbShopInfo.setShopName(sysCompany.getComName()+"(总部)"); - zbShopInfo.setCompanyId(sysCompany.getComId()); - zbShopInfo.setShopTel(sysCompany.getComTel()); - zbShopInfo.setShopShortName("总部"); - zbShopInfo.setIsOpenNet(SysShopInfo.CLOSE_NET); - zbShopInfo.setShopNo(StringUtils.getRandomString(10)); - shopInfoDao.insert(zbShopInfo); + @Autowired + private WarehouseDao warehouseDao; - //新增一个总部仓库 - Warehouse warehouse=new Warehouse(); - warehouse.setCompanyId(sysCompany.getComId()); - warehouse.setName("总部仓库"); - warehouse.setShopId(zbShopInfo.getId()); - warehouse.setSort("1"); - warehouseDao.insert(warehouse); - return zbShopInfo; - } + /** + * 为新公司创建一个总部 + * + * @param sysCompany + */ + private SysShopInfo addZbShop(SysCompany sysCompany) { + SysShopInfo zbShopInfo = new SysShopInfo(); + zbShopInfo.setShopType(SysShopInfo.SHOP_TYPE_ZONGBU); + zbShopInfo.setShopName(sysCompany.getComName() + "(总部)"); + zbShopInfo.setCompanyId(sysCompany.getComId()); + zbShopInfo.setShopTel(sysCompany.getComTel()); + zbShopInfo.setShopShortName("总部"); + zbShopInfo.setIsOpenNet(SysShopInfo.CLOSE_NET); + zbShopInfo.setShopNo(StringUtils.getRandomString(10)); + shopInfoDao.insert(zbShopInfo); - @Transactional(rollbackFor = Exception.class) - @Override - public int modifyByMap(SysCompany oldSysCompany, SysCompany newSysCompany) { - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - newSysCompany.setUpdateBy(user.getSuName()); + //新增一个总部仓库 + Warehouse warehouse = new Warehouse(); + warehouse.setCompanyId(sysCompany.getComId()); + warehouse.setName("总部仓库"); + warehouse.setShopId(zbShopInfo.getId()); + warehouse.setSort("1"); + warehouseDao.insert(warehouse); + return zbShopInfo; + } - updatePower(newSysCompany); - Map<String, Object> modifyMap = null; - try { - if (!ModelUtils.isModified(oldSysCompany, newSysCompany)) { - return MatrixConstance.DML_SUCCESSS; - } + @Transactional(rollbackFor = Exception.class) + @Override + public int modifyByMap(SysCompany oldSysCompany, SysCompany newSysCompany) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + newSysCompany.setUpdateBy(user.getSuName()); - modifyMap = ModelUtils.comparePojo2Map(oldSysCompany, newSysCompany); - } catch (Exception e) { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newSysCompany.getComName()); - } - if (modifyMap.size() > 0) { - modifyMap.put("comId", oldSysCompany.getComId()); - return sysCompanyDao.updateByMap(modifyMap); - } - return MatrixConstance.DML_SUCCESSS; - } + updatePower(newSysCompany); + Map<String, Object> modifyMap = null; + try { + if (!ModelUtils.isModified(oldSysCompany, newSysCompany)) { + return MatrixConstance.DML_SUCCESSS; + } - /** - * 更新公司员工权限 - * - * @author JIANGYOUYAO - * @email 935090232@qq.com - * @date 2017年12月5日 - * @param newSysCompany - */ - private void updatePower(SysCompany newSysCompany) { - List<String> oldFunctions = null; - String functions = sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions(); - if (functions == null || functions.equals("")) { - oldFunctions = new ArrayList<>(); - } else { - oldFunctions = StringUtils - .strToCollToString(sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions(), ","); - } - List<String> newFunctions = new ArrayList<>(); - if (StringUtils.isNotBlank(newSysCompany.getComFunctions())) { - newFunctions = StringUtils.strToCollToString(newSysCompany.getComFunctions(), ","); - } + modifyMap = ModelUtils.comparePojo2Map(oldSysCompany, newSysCompany); + } catch (Exception e) { + throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newSysCompany.getComName()); + } + if (modifyMap.size() > 0) { + modifyMap.put("comId", oldSysCompany.getComId()); + return sysCompanyDao.updateByMap(modifyMap); + } + return MatrixConstance.DML_SUCCESSS; + } - for (String old : oldFunctions) { - // 如果新权限中不包含这个老的功能,则要更新改企业下所有的角色权限 - if (!newFunctions.contains(old)) { - SysRole role = new SysRole(); - role.setCompanyId(newSysCompany.getComId()); - List<SysRole> roles = sysRoleDao.selectByModel(role); - // 获取该公司下所有的权限信息 - List<SysRolePwoerFn> compalyRolePwoer = new ArrayList<>(); - for (SysRole tempRole : roles) { - SysRolePwoerFn r = new SysRolePwoerFn(); - r.setRoleId(tempRole.getRoleId()); - compalyRolePwoer.addAll(rolePwoerFnDao.selectByModel(r)); - } - // 记录要删除的id - List<String> delRolePwoer = new ArrayList<>(); - for (SysRolePwoerFn rolePwoer : compalyRolePwoer) { - // 如果有一个老权限则删除这个权限 - if (rolePwoer.getFnId() != null && rolePwoer.getFnId().equals(old)) { - delRolePwoer.add(rolePwoer.getRpfId()+""); - } - } - // 如果获取到了就删除 - if (!delRolePwoer.isEmpty()) { - rolePwoerFnDao.deleteByIds(delRolePwoer); - } - } - } - } + /** + * 更新公司员工权限 + * + * @param newSysCompany + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2017年12月5日 + */ + private void updatePower(SysCompany newSysCompany) { + List<String> oldFunctions = null; + String functions = sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions(); + if (functions == null || functions.equals("")) { + oldFunctions = new ArrayList<>(); + } else { + oldFunctions = StringUtils + .strToCollToString(sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions(), ","); + } + List<String> newFunctions = new ArrayList<>(); + if (StringUtils.isNotBlank(newSysCompany.getComFunctions())) { + newFunctions = StringUtils.strToCollToString(newSysCompany.getComFunctions(), ","); + } - @Override - public int modifyByModel(SysCompany sysCompany) { + Collections.sort(newFunctions); + Collections.sort(oldFunctions); + if (Objects.equals(JSONUtil.toJsonStr(newFunctions), JSONUtil.toJsonStr(oldFunctions))) { + //没有更新的权限 + return; + } - return sysCompanyDao.updateByModel(sysCompany); + List<String> finalNewFunctions = newFunctions; + List<String> deletedFn = oldFunctions.stream().map(old -> { + if (finalNewFunctions.stream().noneMatch(newFn -> Objects.equals(newFn, old))) { + return old; + } else { + return ""; + } + }).filter(item->StringUtils.isNotBlank(item)).collect(Collectors.toList()); - } + if(CollectionUtils.isNotEmpty(deletedFn)){ + rolePwoerFnDao.deleteByFns(newSysCompany.getComId(),deletedFn); + //有更新权限清空缓存 + SysUsers sysUsers = new SysUsers(); + sysUsers.setCompanyId(newSysCompany.getComId()); + sysUsers.setSuValid(AppConstance.RECORD_VALID); + List<SysUsers> users = sysUsersService.findByModel(sysUsers); + users.forEach(user -> { + String userKey = SecureUtil.md5(user.getSuId() + ""); + LocalCache.remove(DefaultAuthorityManager.USER_POWER_REDISKEY_PC + userKey); + LocalCache.remove(AppAuthorityManager.USER_POWER_REDISKEY_APP + userKey); + }); + } - @Override - public int remove(List<String> list) { - return sysCompanyDao.deleteByIds(list); - } +/* for (String old : oldFunctions) { + // 如果新权限中不包含这个老的功能,则要更新改企业下所有的角色权限 + if (!newFunctions.contains(old)) { + SysRole role = new SysRole(); + role.setCompanyId(newSysCompany.getComId()); + List<SysRole> roles = sysRoleDao.selectByModel(role); + // 获取该公司下所有的权限信息 + List<SysRolePwoerFn> compalyRolePwoer = new ArrayList<>(); + for (SysRole tempRole : roles) { + SysRolePwoerFn r = new SysRolePwoerFn(); + r.setRoleId(tempRole.getRoleId()); + compalyRolePwoer.addAll(rolePwoerFnDao.selectByModel(r)); + } + // 记录要删除的id + List<String> delRolePwoer = new ArrayList<>(); + for (SysRolePwoerFn rolePwoer : compalyRolePwoer) { + // 如果有一个老权限则删除这个权限 + if (rolePwoer.getFnId() != null && rolePwoer.getFnId().equals(old)) { + delRolePwoer.add(rolePwoer.getRpfId() + ""); + } + } + // 如果获取到了就删除 + if (!delRolePwoer.isEmpty()) { + rolePwoerFnDao.deleteByIds(delRolePwoer); + } + } + }*/ - @Override - public int removeById(String comId) { - return sysCompanyDao.deleteById(Long.parseLong(comId)); - } + } - @Override - public int removeByModel(SysCompany sysCompany) { + @Autowired + SysUsersService sysUsersService; - return sysCompanyDao.deleteByModel(sysCompany); + @Override + public int modifyByModel(SysCompany sysCompany) { - } + return sysCompanyDao.updateByModel(sysCompany); - @Override - public List<SysCompany> findInPage(SysCompany sysCompany, PaginationVO pageVo) { + } - return sysCompanyDao.selectInPage(sysCompany, pageVo); + @Override + public int remove(List<String> list) { - } + return sysCompanyDao.deleteByIds(list); - @Override - public List<SysCompany> findByModel(SysCompany sysCompany) { + } - return sysCompanyDao.selectByModel(sysCompany); + @Override + public int removeById(String comId) { - } + return sysCompanyDao.deleteById(Long.parseLong(comId)); - @Override - public int findTotal(SysCompany sysCompany) { + } - return sysCompanyDao.selectTotalRecord(sysCompany); + @Override + public int removeByModel(SysCompany sysCompany) { - } + return sysCompanyDao.deleteByModel(sysCompany); - @Override - public SysCompany findById(String comId) { + } - return sysCompanyDao.selectById(Long.parseLong(comId)); + @Override + public List<SysCompany> findInPage(SysCompany sysCompany, PaginationVO pageVo) { - } + return sysCompanyDao.selectInPage(sysCompany, pageVo); + } + + @Override + public List<SysCompany> findByModel(SysCompany sysCompany) { + + return sysCompanyDao.selectByModel(sysCompany); + + } + + @Override + public int findTotal(SysCompany sysCompany) { + + return sysCompanyDao.selectTotalRecord(sysCompany); + + } + + @Override + public SysCompany findById(String comId) { + + return sysCompanyDao.selectById(Long.parseLong(comId)); + + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysFunctionServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysFunctionServiceImpl.java index 9137ed9..19194e9 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysFunctionServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysFunctionServiceImpl.java @@ -4,6 +4,7 @@ import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.authority.DefaultAuthorityManager; @@ -365,11 +366,14 @@ } else { // 非一级节点找到父节点后存入 SysFunction parentFn = allFnMap.get(String.valueOf(function.getFnParentId())); - List<SysFunction> childs = parentFn.getChilds(); - if (childs == null) { - parentFn.setChilds(new ArrayList<SysFunction>()); + if(parentFn!=null){ + List<SysFunction> childs = parentFn.getChilds(); + if (childs == null) { + parentFn.setChilds(new ArrayList<SysFunction>()); + } + parentFn.getChilds().add(function); } - parentFn.getChilds().add(function); + } } diff --git a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java index ef4e4a3..2d14f86 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java @@ -1,26 +1,29 @@ package com.matrix.system.common.service.impl; +import cn.hutool.crypto.SecureUtil; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.authority.DefaultAuthorityManager; import com.matrix.system.common.bean.SysUserLoginRecord; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.constance.AppMessageCode; import com.matrix.system.common.dao.SysUsersDao; +import com.matrix.system.common.init.LocalCache; import com.matrix.system.common.service.SysUsersService; import com.matrix.system.common.tools.PasswordUtil; import com.matrix.system.common.tools.ServiceUtil; +import com.matrix.system.hive.bean.AppVersion; import com.matrix.system.hive.bean.SysBeauticianState; import com.matrix.system.hive.bean.SysProjServices; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.dao.SysShopInfoDao; -import com.matrix.system.hive.plugin.util.CollectionUtils; -import com.matrix.core.tools.DateUtil; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -44,7 +47,6 @@ private static final String SU_ID = "su_id"; private static final String SU_ACCOUNT = "su_account"; - @Autowired private SysUsersDao sysUsersDao; @@ -127,8 +129,14 @@ } if (modifyMap.size() > 0) { modifyMap.put("suId", oldSysUsers.getSuId()); - return sysUsersDao.updateByMap(modifyMap); + sysUsersDao.updateByMap(modifyMap); } + //删除用户权限缓存 + String redisKey=DefaultAuthorityManager.USER_POWER_REDISKEY+ SecureUtil.md5(oldSysUsers.getSuId()+""); + String redisKeyPc=DefaultAuthorityManager.USER_POWER_REDISKEY_PC+ SecureUtil.md5(oldSysUsers.getSuId()+""); + LocalCache.remove(redisKey); + LocalCache.remove(redisKeyPc); + return MatrixConstance.DML_SUCCESSS; } @@ -258,4 +266,18 @@ } + @Override + public List<AppVersion> findAppVersion() { + return sysUsersDao.selectAppVersion(); + } + + @Override + public SysUsers findByOpenId(String openId, Long companyId) { + return sysUsersDao.selectUserByOpenId(openId, companyId); + } + + @Override + public int modifyUserOpenId(String openId, Long suId) { + return sysUsersDao.updateUserOpenId(openId, suId); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/common/tag/ButtonRoleJsTagProcessor.java b/zq-erp/src/main/java/com/matrix/system/common/tag/ButtonRoleJsTagProcessor.java deleted file mode 100644 index b7c86af..0000000 --- a/zq-erp/src/main/java/com/matrix/system/common/tag/ButtonRoleJsTagProcessor.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.matrix.system.common.tag; - -import com.matrix.core.tools.WebUtil; - -import com.matrix.system.common.authority.AuthorityManager; -import com.matrix.system.common.authority.DefaultAuthorityManager; -import com.matrix.system.common.constance.AppConstance; -import org.thymeleaf.IEngineConfiguration; -import org.thymeleaf.context.ITemplateContext; -import org.thymeleaf.engine.AttributeName; -import org.thymeleaf.model.IProcessableElementTag; -import org.thymeleaf.processor.element.AbstractAttributeTagProcessor; -import org.thymeleaf.processor.element.IElementTagStructureHandler; -import org.thymeleaf.standard.expression.IStandardExpression; -import org.thymeleaf.standard.expression.IStandardExpressionParser; -import org.thymeleaf.standard.expression.StandardExpressions; -import org.thymeleaf.templatemode.TemplateMode; - -/** - * 页面按钮权限类 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年2月25日 - */ -public class ButtonRoleJsTagProcessor extends AbstractAttributeTagProcessor { - - /** - * 标签名 - */ - private static final String ATTR_NAME = "bt"; - - /** - * 优先级 - */ - private static final int PRECEDENCE = 10000; - - public ButtonRoleJsTagProcessor(final String dialectPrefix) { - super( // This processor will apply only to HTML mode - TemplateMode.HTML, - // Prefix to be applied to name for matching - dialectPrefix, - // No tag name: match any tag name - null, - // No prefix to be applied to tag name - false, - // Name of the attribute that will be matched - ATTR_NAME, - // Apply dialect prefix to attribute name - true, - // Precedence (inside dialect's own precedence) - PRECEDENCE, - // Remove the matched attribute afterwards - true); - } - - /** - * 自定义标签主方法 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年1月12日 - * @param context - * @param tag - * @param attributeName - * @param attributeValue - * @param structureHandler - */ - @Override - protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName, - String attributeValue, IElementTagStructureHandler structureHandler) { - final IEngineConfiguration configuration = context.getConfiguration(); - - // Obtain the Thymeleaf Standard Expression parser - final IStandardExpressionParser parser = StandardExpressions.getExpressionParser(configuration); - - // Parse the attribute value as a Thymeleaf Standard Expression - final IStandardExpression expression = parser.parseExpression(context, attributeValue); - - // 标签的值 功能code-add 这种类型 - final String attrValue = expression.execute(context).toString(); - - // 此时根据当前登录用户判断是否有该权限 - AuthorityManager authority = (DefaultAuthorityManager) WebUtil.getBean(AppConstance.DEFAULT_AUTHORITYMANAGER); - - if (!authority.isBtnPermitted(attrValue)) { - // 如果没有该按钮权限,则直接移除该模块 - structureHandler.removeElement(); - } - - } - -} diff --git a/zq-erp/src/main/java/com/matrix/system/common/tag/MatrixProcessorDialect.java b/zq-erp/src/main/java/com/matrix/system/common/tag/MatrixProcessorDialect.java index 69099cc..64fb884 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/tag/MatrixProcessorDialect.java +++ b/zq-erp/src/main/java/com/matrix/system/common/tag/MatrixProcessorDialect.java @@ -47,7 +47,6 @@ public Set<IProcessor> getProcessors(final String dialectPrefix) { final Set<IProcessor> processors = new HashSet<IProcessor>(); processors.add(new ButtonRoleAttributeTagProcessor(dialectPrefix)); - processors.add(new ButtonRoleJsTagProcessor(dialectPrefix)); processors.add(new ButtonRoleFnTagProcessor(dialectPrefix)); // This will remove the xmlns:matrix attributes we might add for IDE validation processors.add(new StandardXmlNsTagProcessor(TemplateMode.HTML, dialectPrefix)); diff --git a/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java b/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java index 96be8be..60dd23f 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java +++ b/zq-erp/src/main/java/com/matrix/system/common/tools/DataAuthUtil.java @@ -20,9 +20,18 @@ */ public static boolean hasAllShopAuth() { SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - return user.getShopRole().equals(Dictionary.FLAG_YES_Y) || user.getSuUserType().equals(AppConstance.USER_TYPE_ADMIN); + return Dictionary.FLAG_YES_Y.equals(user.getShopRole()) || AppConstance.USER_TYPE_ADMIN.equals(user.getSuUserType()); } + /** + * 可以查询所有会员 + * @return + */ + public static boolean hasAllCustomerAuth() { + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + return Dictionary.FLAG_YES_Y.equals(user.getShopRole()) || AppConstance.USER_TYPE_ADMIN.equals(user.getSuUserType()); + + } } diff --git a/zq-erp/src/main/java/com/matrix/system/constance/Dictionary.java b/zq-erp/src/main/java/com/matrix/system/constance/Dictionary.java index 782fd14..37951a2 100644 --- a/zq-erp/src/main/java/com/matrix/system/constance/Dictionary.java +++ b/zq-erp/src/main/java/com/matrix/system/constance/Dictionary.java @@ -55,14 +55,17 @@ * 支付方式-现金支付 */ String PAY_TYPE_MOENY = "现金"; - /** - * 支付方式-现金支付 - */ - String PAY_TYPE_MOENY_CARD = "会员卡"; + /** * 支付方式-卡支付 */ String PAY_TYPE_CARD = "划扣"; + + + /** + * 服务单状态-待确认 + */ + String SERVICE_STATU_DQR = "待确认"; /** * 服务单状态-待预约 */ @@ -549,7 +552,7 @@ // 服务器文件上传配置 String SAVE_PATH = "/mnt/hive/static/uploadeFile/"; - String SAVE_URL = "http://resource.hive.jyymatrix.cc/uploadeFile/"; + String SAVE_URL = "http://filehive2.jyymatrix.cc/uploadeFile/"; // 积分规则编号 @@ -558,5 +561,16 @@ String ORDER_TYPE_SEAL="订单"; String ORDER_TYPE_SERVICE="服务单"; - + + String ACHIEVE_TYPE_CASH = "现金业绩"; + String ACHIEVE_TYPE_CARD = "划扣业绩"; + + String SEX_MAN ="男"; + String SEX_WOMAN ="女"; + + String[] COLORS = { "#57c5d2", "#e3565e", "#2f343a", "#4d98db", "#4fbc9d", "#be9d4c"}; + + String SERVICE_OVER_BEGIN_END = "SERVICE_OVER_BEGIN_END"; + String SALE_MAN_IS_CONSUME_ACHIEVE = "SALE_MAN_IS_CONSUME_ACHIEVE"; + String ZS_CONSUME_ACHIEVE = "ZS_CONSUME_ACHIEVE"; } diff --git a/zq-erp/src/main/java/com/matrix/system/constance/SystemConstance.java b/zq-erp/src/main/java/com/matrix/system/constance/SystemConstance.java index 39616d4..1ce0092 100644 --- a/zq-erp/src/main/java/com/matrix/system/constance/SystemConstance.java +++ b/zq-erp/src/main/java/com/matrix/system/constance/SystemConstance.java @@ -3,10 +3,6 @@ public class SystemConstance { - /** - * 当前进行操作的用户 - */ - public static final String CURRENT_CUSTOMER = "CURRENT_CUSTOMER"; /** @@ -14,10 +10,7 @@ */ public static final String SYSTEM_USER = "SYSTEM"; - /** - * 查询历史记录 - */ - public static final String HISTORY_CUSTOMER = "HISTORY_CUSTOMER"; + /** * 登陆前要访问的地址 */ diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java new file mode 100644 index 0000000..8c147d5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java @@ -0,0 +1,144 @@ +package com.matrix.system.fenxiao.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.excl.ExcelSheetPO; +import com.matrix.core.tools.excl.ExcelUtil; +import com.matrix.core.tools.excl.ExcelVersion; +import com.matrix.system.common.tools.ResponseHeadUtil; +import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto; +import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; +import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; +import com.matrix.system.fenxiao.dto.UpdateSetOrderDoneDto; +import com.matrix.system.fenxiao.service.ShopSalesmanOrderService; +import com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo; +import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; +import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; +import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; +import com.matrix.system.hive.bean.SysProjServices; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping(value = "/fenXiao/fenXiaoOrder") +public class FenXiaoOrderAction { + + @Autowired + private ShopSalesmanOrderService shopSalesmanOrderService; + + /** + * 分销订单基本信息 + */ + @ApiOperation(value = "分销订单基本信息") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = LoadFenxiaoOrderBasicVo.class) + }) + @PostMapping(value = "/loadFenxiaoOrderBasic") + public @ResponseBody + AjaxResult loadFenxiaoOrderBasic(@RequestBody LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) { + return shopSalesmanOrderService.loadFenxiaoOrderBasic(loadFenxiaoOrderBasicDto); + } + + /** + * 分销订单 + */ + @ApiOperation(value = "分销订单") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = LoadFenxiaoOrderListVo.class) + }) + @PostMapping(value = "/loadFenxiaoOrderList") + public @ResponseBody + AjaxResult loadFenxiaoOrderList(@RequestBody LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) { + return shopSalesmanOrderService.loadFenxiaoOrderList(loadFenxiaoOrderListDto); + } + + /** + *批量结算分销订单 + */ + @ApiOperation(value = "批量结算分销订单") + @PostMapping(value = "/updateSetOrderDone") + public @ResponseBody + AjaxResult updateSetOrderDone(@RequestBody UpdateSetOrderDoneDto updateSetOrderDoneDto) { + return shopSalesmanOrderService.updateSetOrderDone(updateSetOrderDoneDto); + } + + /** + * 结算记录 + */ + @ApiOperation(value = "结算记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = LoadSetOrderListDtoVo.class) + }) + @PostMapping(value = "/loadSetOrderList") + public @ResponseBody + AjaxResult loadSetOrderList(@RequestBody LoadSetOrderListDtoDto loadSetOrderListDto) { + return shopSalesmanOrderService.loadSetOrderList(loadSetOrderListDto); + } + + @RequestMapping(value = "/exportExcel") + public void exportExcel(HttpServletResponse response, LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) throws IOException { + List<ExcelSheetPO> res = new ArrayList<>(); + ExcelSheetPO orderSheet = new ExcelSheetPO(); + String title = "分销订单明细"; + orderSheet.setSheetName(title); + orderSheet.setTitle(title); + String[] header = {"订单编号","实付金额(元)", "订单状态", "下单门店","客户", "推广员","收益类型","收益金额", "结算状态", "结算编号", "结算时间", "结算人"}; + orderSheet.setHeaders(header); + + List<FenxiaoOrderListExportVo> dataList = shopSalesmanOrderService.findFenxiaoOrderList(loadFenxiaoOrderListDto); + List<List<Object>> list = new ArrayList<>(); + if (dataList.size() > 0) { + for (FenxiaoOrderListExportVo item : dataList) { + List<Object> temp = new ArrayList<>(); + temp.add(item.getOrderNo()); + temp.add(item.getActualBalance()); + temp.add(item.getOrderState()); + temp.add(item.getAddress()); + temp.add(item.getCustom()); + temp.add(item.getParentSale()); + temp.add(item.getProfitType()); + temp.add(item.getProfitBalance()); + temp.add(item.getSettleType()); + temp.add(item.getSettleNo()); + temp.add(DateUtil.dateToString(item.getSettleTime(), DateUtil.DATE_FORMAT_MM)); + temp.add(item.getSettler()); + list.add(temp); + } + } + orderSheet.setDataList(list); + res.add(orderSheet); + response = ResponseHeadUtil.setExcelHead(response); + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8")); + OutputStream os = response.getOutputStream(); + ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); + } + + + + + + + + + + + + + + + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java new file mode 100644 index 0000000..1b2bc12 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java @@ -0,0 +1,164 @@ +package com.matrix.system.fenxiao.action; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.service.FenXiaoSettingService; +import com.matrix.system.fenxiao.vo.FenXiaoSettingVo; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.dao.ShoppingGoodsDao; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.dao.ShopProductDao; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@RestController +@RequestMapping(value = "/fenXiao/ruleSetting") +public class FenXiaoSettingAction { + + @Autowired + private FenXiaoSettingService fenXiaoSettingService; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + private ShoppingGoodsDao shoppingGoodsDao; + + @Autowired + private SysVipInfoDao sysVipInfoDao; + + @Autowired + private ShopProductDao shopProductDao; + + /** + *查询分销配置 + */ + @RequestMapping(value = "/selectFenXiaoSetting") + public AjaxResult selectFenXiaoSetting() { + + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + + //分销开关 + String[] FXKGCode={FenxiaoSettingConstant.FX_SWITCH}; + String[] FXKGName={"分销开关"}; + List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); + result.putInMap("fxkg", fxkgRuleSettingsVo); + //自购返佣 + String[] ZGFYCode={FenxiaoSettingConstant.FX_ZGFY}; + String[] ZGFYName={"自购返佣"}; + List<FenXiaoSettingVo> zgfyRuleSettingsVo = getRuleSettingsVo(ZGFYCode,ZGFYName,companyId); + result.putInMap("zgfy", zgfyRuleSettingsVo); + + //分销模式 + String[] FXMSCode={FenxiaoSettingConstant.FX_MODEL}; + String[] FXMSName={"分销模式"}; + List<FenXiaoSettingVo> fxmsRuleSettingsVo = getRuleSettingsVo(FXMSCode,FXMSName,companyId); + result.putInMap("fxms", fxmsRuleSettingsVo); + //申请方式 + String[] sqfsCode={FenxiaoSettingConstant.FX_APPLY_WAY}; + String[] sqfsName={"申请方式"}; + List<FenXiaoSettingVo> sqfsRuleSettingsVo = getRuleSettingsVo(sqfsCode,sqfsName,companyId); + result.putInMap("sqfs", sqfsRuleSettingsVo); + //审核方式 + String[] shfsCode={FenxiaoSettingConstant.FX_AUDIT_METHOD}; + String[] shfsName={"审核方式"}; + List<FenXiaoSettingVo> shfsRuleSettingsVo = getRuleSettingsVo(shfsCode,shfsName,companyId); + result.putInMap("shfs", shfsRuleSettingsVo); + //申请条件 + String[] sqtjCode={FenxiaoSettingConstant.FX_APPLY_CONDITION}; + String[] sqtjName={"申请条件"}; + List<FenXiaoSettingVo> sqtjRuleSettingsVo = getRuleSettingsVo(sqtjCode,sqtjName,companyId); + result.putInMap("sqtj", sqtjRuleSettingsVo); + if(CollUtil.isNotEmpty(sqtjRuleSettingsVo)){ + for(FenXiaoSettingVo fenXiaoSettingVo : sqtjRuleSettingsVo) { + //选择申请条件条件3时,获得选中产品集合 + if(FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP.equals(fenXiaoSettingVo.getParamValue())) { + String paramValue1 = fenXiaoSettingVo.getParamValue1(); + if(StrUtil.isNotEmpty(paramValue1)) { + List<Integer> idsList = new ArrayList<>(); + List<String> idsStringList = Arrays.asList(paramValue1.split(",")); + if(CollUtil.isNotEmpty(idsStringList)){ + for(String string : idsStringList) { + Integer parseInt = Integer.parseInt(string); + idsList.add(parseInt); + } + } + //List<ShoppingGoods> list = shoppingGoodsDao.selectByIds(idsList); + List<ShopProduct> shopProducts = shopProductDao.selectByIds(idsList); + result.putInMap("order", shopProducts); + } + }else{ + List<ShopProduct> shopProducts = new ArrayList<>(); + result.putInMap("order", shopProducts); + } + } + } + return result; + } + + /** + * 列表显示 + */ + @RequestMapping(value = "/selectProduct") + public @ResponseBody + AjaxResult selectProduct(ShopProduct shopProduct, PaginationVO pageVo) { + QueryUtil.setQueryLimitCom(shopProduct); + pageVo.setSort("createTime"); + pageVo.setOrder("desc"); + shopProduct.setDelFlag(AppConstance.DATA_USEABLE); + shopProduct.setCompanyId(shopProduct.getCompanyId()); + List<ShopProduct> dataList = shopProductDao.selectInPage(shopProduct, pageVo); + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, + shopProductDao.selectTotalRecord(shopProduct)); + return result; + + } + + /** + *获取对应的规则设置数据 + * @param ArrayCode + * @param ArrayName + * @param companyId + * @return + */ + private List<FenXiaoSettingVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ + List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); + List<FenXiaoSettingVo> scoreRuleSettingsVos=new ArrayList<FenXiaoSettingVo>(); + int index=0; + for (BusParameterSettings item:dataList){ + FenXiaoSettingVo paramVo=new FenXiaoSettingVo(); + BeanUtils.copyProperties(item,paramVo); + paramVo.setParamName(ArrayName[index]); + scoreRuleSettingsVos.add(paramVo); + index++; + } + return scoreRuleSettingsVos; + } + + /** + * 修改公司维度的分销规则 + */ + @PostMapping(value = "/updateFenXiaoSetting") + public @ResponseBody + AjaxResult updateFenXiaoSetting(@RequestBody List<BusParameterSettings> busParameterSettings) { + return fenXiaoSettingService.updateFenXiaoSettingByCompanyId(busParameterSettings); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java new file mode 100644 index 0000000..1bff040 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java @@ -0,0 +1,405 @@ +package com.matrix.system.fenxiao.action; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.dto.*; +import com.matrix.system.fenxiao.entity.ShopSalesmanApply; +import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; +import com.matrix.system.fenxiao.vo.*; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@RestController +@RequestMapping(value = "/fenXiao/fenXiaoUser") +public class FenXiaoUserAction { + + @Autowired + private ShopSalesmanApplyService shopSalesmanApplyService; + @Autowired + private ShopSalesmanApplyDao shopSalesmanApplyDao; + @Autowired + private SysVipInfoDao sysVipInfoDao; + @Autowired + private ShopSalesmanGradeDao shopSalesmanGradeDao; + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + /** + * 分销员详情页面信息 + */ + @ApiOperation(value = "分销员详情页面信息") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ShopSalesmanDetailVo.class) + }) + @PostMapping(value = "/loadParamSettingBasic") + public @ResponseBody + AjaxResult findShopSalesmanDetail(@RequestBody LoadParamSettingBasicDto loadParamSettingBasicDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(loadParamSettingBasicDto); + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SalesmanBasicDetailVo salesmanBasicDetailVo = shopSalesmanApplyService.selectShopSalesmanDetailByOpenId(loadParamSettingBasicDto.getUserId(),loadParamSettingBasicDto.getApplyId()); + result.putInMap("basicdetail", salesmanBasicDetailVo); + return result; + } + + /** + * 分销员详情页面绑定客户 + */ + @ApiOperation(value = "分销员详情页面绑定客户") + @PostMapping(value = "/loadParamSetting") + public @ResponseBody + AjaxResult loadParamSetting(@RequestBody LoadParamSettingDto loadParamSettingDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(loadParamSettingDto); + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + //排序 + if(StringUtils.isBlank(loadParamSettingDto.getSort())){ + loadParamSettingDto.setSort("create_time"); + loadParamSettingDto.setOrder("desc"); + } + //查询绑定客户信息 + Page<ShopCustomDetailVo> page = new Page(loadParamSettingDto.getPageNum(), loadParamSettingDto.getPageSize()); + IPage<ShopCustomDetailVo> customDetailRows = shopSalesmanApplyService.findCustomDetail(page,loadParamSettingDto); + result.putInMap("customDetailRecords", customDetailRows.getRecords()); + result.putInMap("customDetailTotal", customDetailRows.getTotal()); + return result; + } + + /** + * 分销员详情页面邀请下级 + */ + @ApiOperation(value = "分销员详情页面邀请下级") + @PostMapping(value = "/loadParamSettinglow") + public @ResponseBody + AjaxResult loadParamSettinglow(@RequestBody ShopSalesmanDetailDto shopSalesmanDetailDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(shopSalesmanDetailDto); + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + //排序 + if(StringUtils.isBlank(shopSalesmanDetailDto.getSort())){ + shopSalesmanDetailDto.setSort("create_time"); + shopSalesmanDetailDto.setOrder("desc"); + } + //查询邀请下级信息 + Page<ShopCustomDetailVo> pageLow = new Page(shopSalesmanDetailDto.getPageNum(), shopSalesmanDetailDto.getPageSize()); + IPage<ShopCustomDetailVo> customLowRows = shopSalesmanApplyService.findCustomLow(pageLow,shopSalesmanDetailDto); + result.putInMap("customLowRecords", customLowRows.getRecords()); + result.putInMap("customLowTotal", customLowRows.getTotal()); + return result; + } + + /** + * 分销员详情页面收益订单 + */ + @ApiOperation(value = "分销员详情页面收益订单") + @PostMapping(value = "/loadParamSettingOrder") + public @ResponseBody + AjaxResult loadParamSettingOrder(@RequestBody ShopSalesmanDetailDto shopSalesmanDetailDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(shopSalesmanDetailDto); + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + //排序 + if(StringUtils.isBlank(shopSalesmanDetailDto.getSort())){ + shopSalesmanDetailDto.setSort("create_time"); + shopSalesmanDetailDto.setOrder("desc"); + } + //查询收益订单 + Page<ShopOrderDetailVo> pageOrder = new Page(shopSalesmanDetailDto.getPageNum(), shopSalesmanDetailDto.getPageSize()); + IPage<ShopOrderDetailVo> orderRows = shopSalesmanApplyService.findShopOrderDetail(pageOrder,shopSalesmanDetailDto); + result.putInMap("orderRecords", orderRows.getRecords()); + result.putInMap("orderTotal", orderRows.getTotal()); + return result; + } + + /** + *修改等级 + */ + @ApiOperation(value = "修改等级") + @PostMapping(value = "/changeSaleManGrade") + public @ResponseBody + AjaxResult changeSaleManGrade(@RequestBody ChangeSaleManGradeDto changeSaleManGradeDto) { + return shopSalesmanApplyService.changeSaleManGrade(changeSaleManGradeDto); + } + + /** + *解绑 + */ + @ApiOperation(value = "解绑") + @PostMapping(value = "/unbundlingSaleMan") + public @ResponseBody + AjaxResult unbundlingSaleMan(@RequestBody UnbundlingSaleManDto unbundlingSaleManDto) { + return shopSalesmanApplyService.unbundlingSaleMan(unbundlingSaleManDto); + } + + /** + *推广图片 + */ + @ApiOperation(value = "推广图片") + @PostMapping(value = "/updateTgtp") + public @ResponseBody + AjaxResult updateTgtp(@RequestBody UpdateTgtpDto updateTgtpDto) { + return shopSalesmanApplyService.updateTgtp(updateTgtpDto); + } + + /** + *推广图片 + */ + @RequestMapping(value = "/loadTgtpSetting") + public AjaxResult loadTgtpSetting() { + + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + + //推广文案 + String[] FXKGCode={FenxiaoSettingConstant.FX_TG_POSTER}; + String[] FXKGName={"推广图片"}; + List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); + result.putInMap("tgtp", fxkgRuleSettingsVo.get(0)); + return result; + } + + /** + *推广计划更新 + */ + @ApiOperation(value = "推广计划更新") + @PostMapping(value = "/updateTgjh") + public @ResponseBody + AjaxResult updateTgjh(@RequestBody UpdateTgjhDto updateTgjhDto) { + return shopSalesmanApplyService.updateTgjh(updateTgjhDto); + } + /** + *查询推广计划 + */ + @RequestMapping(value = "/loadTgwaSetting") + public AjaxResult loadTgwaSetting() { + + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + + //推广文案 + String[] FXKGCode={FenxiaoSettingConstant.FX_TG_PLAN}; + String[] FXKGName={"推广文案"}; + List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); + result.putInMap("tgwa", fxkgRuleSettingsVo.get(0)); + return result; + } + + /** + *获取对应的规则设置数据 + * @param ArrayCode + * @param ArrayName + * @param companyId + * @return + */ + private List<FenXiaoSettingVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ + List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); + List<FenXiaoSettingVo> scoreRuleSettingsVos=new ArrayList<FenXiaoSettingVo>(); + int index=0; + for (BusParameterSettings item:dataList){ + FenXiaoSettingVo paramVo=new FenXiaoSettingVo(); + BeanUtils.copyProperties(item,paramVo); + paramVo.setParamName(ArrayName[index]); + scoreRuleSettingsVos.add(paramVo); + index++; + } + return scoreRuleSettingsVos; + } + + /** + * 分佣方案 + */ + @ApiOperation(value = "查询分佣方案") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = FyfaManageVo.class) + }) + @PostMapping(value = "/findFyfaManageList") + public @ResponseBody + AjaxResult findFyfaManageList(@RequestBody FyfaManageDto fyfaManageDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(fyfaManageDto); + //排序 + if(StringUtils.isBlank(fyfaManageDto.getSort())){ + fyfaManageDto.setSort("create_time"); + fyfaManageDto.setOrder("asc"); + } + Page<FyfaManageVo> page = new Page(fyfaManageDto.getPageNum(), fyfaManageDto.getPageSize()); + IPage<FyfaManageVo> rows = shopSalesmanApplyService.findFyfaManageList(page,fyfaManageDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + *新增分佣方案 + */ + @ApiOperation(value = "新增分佣方案") + @RequestMapping(value = "/addFyfa") + private @ResponseBody AjaxResult addFyfa(){ + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + shopSalesmanApplyService.addFyfa(user); + return AjaxResult.buildSuccessInstance("新增成功"); + } + + /** + *修改分佣方案 + */ + @ApiOperation(value = "修改分佣方案") + @PostMapping(value = "/updateFyfa") + public @ResponseBody + AjaxResult updateFyfa(@RequestBody UpdateFyfaDto updateFyfaDto) { + return shopSalesmanApplyService.updateFyfa(updateFyfaDto); + } + + /** + *删除分佣方案 + */ + @ApiOperation(value = "删除分佣方案") + @PostMapping(value = "/delFyfaApply") + public @ResponseBody + AjaxResult delFyfaApply(@RequestBody DelFyfaApplyDto delFyfaApplyDto) { + return shopSalesmanApplyService.delFyfaApply(delFyfaApplyDto); + } + + /** + * 查询分销员审核记录 + */ + @ApiOperation(value = "查询分销员审核记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ShopSalesmanApplyVo.class) + }) + @PostMapping(value = "/findShopSalesmanApplyList") + public @ResponseBody + AjaxResult findShopSalesmanApplyList(@RequestBody ShopSalesmanApplyDto shopSalesmanApplyDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(shopSalesmanApplyDto); + //排序 + if(StringUtils.isBlank(shopSalesmanApplyDto.getSort())){ + shopSalesmanApplyDto.setSort("create_time"); + shopSalesmanApplyDto.setOrder("desc"); + } + Page<ShopSalesmanApplyVo> page = new Page(shopSalesmanApplyDto.getPageNum(), shopSalesmanApplyDto.getPageSize()); + IPage<ShopSalesmanApplyVo> rows = shopSalesmanApplyService.findShopSalesmanApplyList(page,shopSalesmanApplyDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + + return result; + } + + /** + *获取分销员待审核记录 + */ + @ApiOperation(value = "获取分销员待审核记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ShopSalesmanAppliingVo.class) + }) + @PostMapping(value = "/findShopSalesmanAppliingList") + public @ResponseBody + AjaxResult findShopSalesmanAppliingList(@RequestBody ShopSalesmanAppliingDto shopSalesmanAppliingDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(shopSalesmanAppliingDto); + //排序 + if(StringUtils.isBlank(shopSalesmanAppliingDto.getSort())){ + shopSalesmanAppliingDto.setSort("create_time"); + shopSalesmanAppliingDto.setOrder("desc"); + } + + Page<ShopSalesmanAppliingVo> page = new Page(shopSalesmanAppliingDto.getPageNum(), shopSalesmanAppliingDto.getPageSize()); + IPage<ShopSalesmanAppliingVo> rows = shopSalesmanApplyService.selectBizUserApplyList(page,shopSalesmanAppliingDto); + + //IPage<ShopSalesmanAppliingVo> rows = shopSalesmanApplyService.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + + /** + *新增分销员 + */ + @ApiOperation(value = "新增分销员") + @PostMapping(value = "/addSaleManApply") + public @ResponseBody + AjaxResult addSaleManApply(@RequestBody AddSaleManApplyDto addSaleManApplyDto) { + + if(addSaleManApplyDto.getGradeId()==null) { + return AjaxResult.buildFailInstance("请选择分销等级"); + } + + shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getUserId(), addSaleManApplyDto.getGradeId()); + return AjaxResult.buildSuccessInstance("设置成功"); + } + + /** + *删除---设置成不是分销员 + */ + @ApiOperation(value = "删除---设置成不是分销员") + @PostMapping(value = "/delSaleManGradeApply") + public @ResponseBody + AjaxResult delSaleManGradeApply(@RequestBody DelSaleManGradeApplyDto delSaleManGradeApplyDto) { + return shopSalesmanApplyService.delSaleManGradeApply(delSaleManGradeApplyDto); + } + + /** + *审核分销员 + */ + @ApiOperation(value = "审核分销员") + @PostMapping(value = "/examineSaleManApply") + public @ResponseBody + AjaxResult examineSaleManApply(@RequestBody ExamineSaleManApplyDto examineSaleManApplyDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(examineSaleManApplyDto); + //待审核状态才允许提交 + ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectById(examineSaleManApplyDto.getApplyId()); + if(ObjectUtil.isEmpty(shopSalesmanApply)) { + return AjaxResult.buildFailInstance("当前记录有误"); + } + + SysVipInfo sysVipInfo = sysVipInfoDao.selectById(examineSaleManApplyDto.getUserId()); + if(ObjectUtil.isEmpty(sysVipInfo)) { + return AjaxResult.buildFailInstance("当前记录有误"); + } + + Integer applyStatus = shopSalesmanApply.getApplyStatus(); + if(ObjectUtil.isNotEmpty(applyStatus) && ShopSalesmanApply.APPLY_STATUS_DSH == applyStatus) { + Integer applyState = examineSaleManApplyDto.getApplyState(); + shopSalesmanApplyService.examineSaleManApply(shopSalesmanApply,applyState); + return AjaxResult.buildSuccessInstance("审核成功"); + }else{ + return AjaxResult.buildFailInstance("当前记录不是待审核状态"); + } + } + + /** + *获取对应的分销员等级 + */ + @RequestMapping(value = "/getShopSalesmanGrade") + private @ResponseBody AjaxResult getShopSalesmanGradeVo(){ + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + List<ShopSalesmanGradeVo> dataList = shopSalesmanApplyService.getShopSalesmanGradeVo(user.getCompanyId()); + result.putInMap("salesGrade", dataList); + return result; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/constant/FenxiaoSettingConstant.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/constant/FenxiaoSettingConstant.java new file mode 100644 index 0000000..3153b35 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/constant/FenxiaoSettingConstant.java @@ -0,0 +1,61 @@ +package com.matrix.system.fenxiao.constant; + +public class FenxiaoSettingConstant { + /** + * 分销开关 + */ + public final static String FX_SWITCH = "FX_SWITCH"; + /** + * 分销模式 + */ + public final static String FX_MODEL = "FX_MODEL"; + /** + * 自购返佣 1:是 2:否 + */ + public final static String FX_ZGFY = "FX_ZGFY"; + + public final static String FX_ZGFY_YES = "1"; + public final static String FX_ZGFY_NO = "2"; + /** + * 申请方式 + */ + public final static String FX_APPLY_WAY = "FX_APPLY_WAY"; + /** + * 申请方式 1自动申请通过 + */ + public final static String FX_APPLY_WAY_AUTO = "1"; + /** + * 申请方式 2需要主动申请 + */ + public final static String FX_APPLY_WAY_CUSTOMER = "2"; + /** + * 审核方式 1系统自动审核,2人工审核 + */ + public final static String FX_AUDIT_METHOD = "FX_AUDIT_METHOD"; + /** + * 申请条件 + */ + public final static String FX_APPLY_CONDITION = "FX_APPLY_CONDITION"; + /** + * 申请条件 1 无条件 + */ + public final static String FX_APPLY_CONDITION_WTJ = "1"; + /** + * 申请条件 2 消费任意产品 + */ + public final static String FX_APPLY_CONDITION_XFRYCP = "2"; + /** + * 申请条件 3 消费指定产品 + */ + public final static String FX_APPLY_CONDITION_XFZDCP = "3"; + /** + * 申请条件 4 消费指定金额 + */ + public final static String FX_APPLY_CONDITION_XCZDJE = "4"; + /** + * 推广计划 + */ + public final static String FX_TG_PLAN = "FX_TG_PLAN"; + + public static final String FX_TG_POSTER ="FX_TG_POSTER"; +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/BizUserDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/BizUserDao.java new file mode 100644 index 0000000..b4f2471 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/BizUserDao.java @@ -0,0 +1,14 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.fenxiao.entity.BizUser; + +/** + * @description 推广员申请记录 + * @author jyy + * @date 2021-03-10 15:22 + */ +public interface BizUserDao extends BaseMapper<BizUser> { + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/FenXiaoSettingDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/FenXiaoSettingDao.java new file mode 100644 index 0000000..0bf3029 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/FenXiaoSettingDao.java @@ -0,0 +1,7 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.fenxiao.entity.FenXiaoSettingEntity; + +public interface FenXiaoSettingDao extends BaseMapper<FenXiaoSettingEntity> { +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopRevenueFlowDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopRevenueFlowDao.java new file mode 100644 index 0000000..d409465 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopRevenueFlowDao.java @@ -0,0 +1,18 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.fenxiao.entity.ShopRevenueFlow; +import com.matrix.system.shopXcx.api.dto.RevenueFlowDto; +import org.apache.ibatis.annotations.Param; + +/** + * @description 收益流水 + * @author jyy + * @date 2021-03-10 15:22 + */ +public interface ShopRevenueFlowDao extends BaseMapper<ShopRevenueFlow> { + + IPage<ShopRevenueFlow> selectRevenuFlowList(Page<ShopRevenueFlow> page, @Param("record") RevenueFlowDto revenueFlowDto); +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalemanSettlementDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalemanSettlementDao.java new file mode 100644 index 0000000..d032047 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalemanSettlementDao.java @@ -0,0 +1,13 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.fenxiao.entity.ShopSalemanSettlement; + +/** + * @description 订单结算记录 + * @author jyy + * @date 2021-03-10 15:22 + */ +public interface ShopSalemanSettlementDao extends BaseMapper<ShopSalemanSettlement> { + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java new file mode 100644 index 0000000..52b6c4f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java @@ -0,0 +1,54 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.fenxiao.dto.LoadParamSettingDto; +import com.matrix.system.fenxiao.dto.ShopSalesmanAppliingDto; +import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto; +import com.matrix.system.fenxiao.dto.ShopSalesmanDetailDto; +import com.matrix.system.fenxiao.entity.ShopSalesmanApply; +import com.matrix.system.fenxiao.vo.SalesmanBasicDetailVo; +import com.matrix.system.fenxiao.vo.ShopCustomDetailVo; +import com.matrix.system.fenxiao.vo.ShopOrderDetailVo; +import com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo; +import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; +import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; +import com.matrix.system.shopXcx.vo.SalesmanVo; +import org.apache.ibatis.annotations.Param; + +/** + * @description 推广员申请记录 + * @author jyy + * @date 2021-03-10 15:22 + */ +public interface ShopSalesmanApplyDao extends BaseMapper<ShopSalesmanApply> { + + IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId, @Param("isSales")String isSales); + + IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId); + + IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page, + @Param("record")ShopSalesmanApplyDto shopSalesmanApplyDto); + //根据公司ID、审核状态、会员昵称查询对应的记录 + IPage<ShopSalesmanAppliingVo> findShopSalesmanAppliingList(Page<ShopSalesmanAppliingVo> page, + @Param("record")ShopSalesmanAppliingDto shopSalesmanAppliingDto); + + IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page, + @Param("record")ShopSalesmanAppliingDto shopSalesmanAppliingDto); + + SalesmanCenterInfo selectSalesmanCenterInfo(Long id); + + SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(@Param("userId")Long userId, + @Param("companyId")Long companyId,@Param("applyId")long applyId); + + IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page, + @Param("record")LoadParamSettingDto loadParamSettingDto); + + IPage<ShopCustomDetailVo> findCustomLow(Page<ShopCustomDetailVo> pageLow, + @Param("record")ShopSalesmanDetailDto shopSalesmanDetailDto); + + IPage<ShopOrderDetailVo> findShopOrderDetail(Page<ShopOrderDetailVo> pageOrder, + @Param("record")ShopSalesmanDetailDto shopSalesmanDetailDto); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanGradeDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanGradeDao.java new file mode 100644 index 0000000..e51ec22 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanGradeDao.java @@ -0,0 +1,25 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.fenxiao.dto.FyfaManageDto; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.fenxiao.vo.FyfaManageVo; +import com.matrix.system.fenxiao.vo.ShopSalesmanGradeVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @description 推广员等级 + * @author jyy + * @date 2021-03-10 15:22 + */ +public interface ShopSalesmanGradeDao extends BaseMapper<ShopSalesmanGrade> { + + List<ShopSalesmanGradeVo> getShopSalesmanGradeVo(@Param("companyId")Long companyId); + + IPage<FyfaManageVo> findFyfaManageList(Page<FyfaManageVo> page,@Param("record")FyfaManageDto fyfaManageDto); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java new file mode 100644 index 0000000..7adcc35 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java @@ -0,0 +1,44 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; +import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; +import com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo; +import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; +import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; +import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; +import com.matrix.system.shopXcx.api.dto.SaleOrderDto; +import com.matrix.system.shopXcx.vo.SalesOrderVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @description 分销订单 + * @author jyy + * @date 2021-03-10 15:22 + */ +public interface ShopSalesmanOrderDao extends BaseMapper<ShopSalesmanOrder> { + + /** + * 查询推广订单 + * @param page + * @param saleOrderDto + * @return + */ + IPage<SalesOrderVo> selectSalesManOrder(Page<SalesOrderVo> page, @Param("record") SaleOrderDto saleOrderDto); + + LoadFenxiaoOrderBasicVo selectFenxiaoOrderBasicByCompanyId(@Param("companyId")Long companyId); + + IPage<LoadFenxiaoOrderListVo> findFenxiaoOrderList(Page<LoadFenxiaoOrderListVo> page, + @Param("record")LoadFenxiaoOrderListDto loadFenxiaoOrderListDto); + + IPage<LoadSetOrderListDtoVo> findSetOrderList(Page<LoadSetOrderListDtoVo> page, + @Param("record")LoadSetOrderListDtoDto loadSetOrderListDto); + + List<FenxiaoOrderListExportVo> selectFenxiaoOrderListNoPage(@Param("record")LoadFenxiaoOrderListDto loadFenxiaoOrderListDto); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderItemDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderItemDao.java new file mode 100644 index 0000000..8c4e87e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderItemDao.java @@ -0,0 +1,13 @@ +package com.matrix.system.fenxiao.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrderItem; + +/** + * @description 分销单明细 + * @author yourName + * @date 2021-03-12 13:17 + */ +public interface ShopSalesmanOrderItemDao extends BaseMapper<ShopSalesmanOrderItem> { + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java new file mode 100644 index 0000000..ad76f7f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java @@ -0,0 +1,21 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "AddSaleManApplyDto", description = "查询参数") +public class AddSaleManApplyDto { + + @ApiModelProperty(value ="会员ID") + private Long userId; + + + @ApiModelProperty(value ="等级ID") + private Long gradeId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java new file mode 100644 index 0000000..92c66de --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ChangeSaleManGradeDto", description = "查询参数") +public class ChangeSaleManGradeDto { + + @ApiModelProperty(value ="会员id") + private Long userId; + + @ApiModelProperty(value ="等级ID") + private Long gradeId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelFyfaApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelFyfaApplyDto.java new file mode 100644 index 0000000..4e32d24 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelFyfaApplyDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "DelFyfaApplyDto", description = "参数") +public class DelFyfaApplyDto { + + @ApiModelProperty(value ="申请记录ID") + private Long gradeId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java new file mode 100644 index 0000000..2fb799c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java @@ -0,0 +1,20 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "DelSaleManGradeApplyDto", description = "查询参数") +public class DelSaleManGradeApplyDto { + + @ApiModelProperty(value ="会员id") + private Long userId; + + @ApiModelProperty(value ="申请记录ID") + private Long applyId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java new file mode 100644 index 0000000..e389f85 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java @@ -0,0 +1,26 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(value = "ExamineSaleManApplyDto", description = "查询参数") +public class ExamineSaleManApplyDto { + + @NotNull + @ApiModelProperty(value ="会员ID") + private Long userId; + + @ApiModelProperty(value = "申请记录ID") + private Long applyId; + + @ApiModelProperty(value ="审核状态 2:同意 3:不同意") + private Integer applyState; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java new file mode 100644 index 0000000..73c6ff9 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java @@ -0,0 +1,22 @@ +package com.matrix.system.fenxiao.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "FyfaManageDto", description = "查询参数") +public class FyfaManageDto extends BasePageQueryDto { + + @ApiModelProperty(hidden = true) + private Long companyId; + + @ApiModelProperty(value ="会员ID") + private Long userId; + + @ApiModelProperty(value ="申请记录ID") + private Long applyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderBasicDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderBasicDto.java new file mode 100644 index 0000000..80a80fd --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderBasicDto.java @@ -0,0 +1,14 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LoadFenxiaoOrderBasicDto", description = "查询参数") +public class LoadFenxiaoOrderBasicDto { + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderListDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderListDto.java new file mode 100644 index 0000000..006e414 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadFenxiaoOrderListDto.java @@ -0,0 +1,41 @@ +package com.matrix.system.fenxiao.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "LoadFenxiaoOrderListDto", description = "查询参数") +public class LoadFenxiaoOrderListDto extends BasePageQueryDto { + + @ApiModelProperty(hidden = true) + private Long companyId; + + @ApiModelProperty(value ="订单状态") + private Integer ddType; + + @ApiModelProperty(value ="结算状态") + private Integer orderType; + + @ApiModelProperty(value ="客户名称") + private String userName; + + @ApiModelProperty(value ="推广员名称") + private String tgy; + + @ApiModelProperty(value ="开始时间") + private Date startTime; + + @ApiModelProperty(value ="结束时间") + private Date endTime; + + @ApiModelProperty(value ="结算编号") + private String jsbh; + + @ApiModelProperty(value ="订单号") + private String ddh; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java new file mode 100644 index 0000000..ecbb93e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java @@ -0,0 +1,20 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LoadParamSettingBasicDto", description = "查询参数") +public class LoadParamSettingBasicDto { + + @ApiModelProperty(value ="会员ID") + private Long userId; + + @ApiModelProperty(value ="申请记录ID") + private Long applyId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java new file mode 100644 index 0000000..50cfac5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java @@ -0,0 +1,25 @@ +package com.matrix.system.fenxiao.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LoadParamSettingDto", description = "查询参数") +public class LoadParamSettingDto extends BasePageQueryDto { + + @ApiModelProperty(value ="会员姓名") + private String userName; + + @ApiModelProperty(value ="会员ID") + private Long userId; + + @ApiModelProperty(value ="申请记录ID") + private Long applyId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadSetOrderListDtoDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadSetOrderListDtoDto.java new file mode 100644 index 0000000..b23b183 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadSetOrderListDtoDto.java @@ -0,0 +1,27 @@ +package com.matrix.system.fenxiao.dto; + +import java.util.Date; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LoadSetOrderListDtoDto", description = "查询参数") +public class LoadSetOrderListDtoDto extends BasePageQueryDto { + + @ApiModelProperty(hidden = true) + private Long companyId; + + @ApiModelProperty(value ="会员姓名") + private String userName; + + @ApiModelProperty(value ="开始时间") + private Date startTime; + + @ApiModelProperty(value ="结束时间") + private Date endTime; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanAppliingDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanAppliingDto.java new file mode 100644 index 0000000..3672483 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanAppliingDto.java @@ -0,0 +1,20 @@ +package com.matrix.system.fenxiao.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ShopSalesmanAppliingDto", description = "查询参数") +public class ShopSalesmanAppliingDto extends BasePageQueryDto { + + @ApiModelProperty(value ="会员名称") + private String nickName; + + @ApiModelProperty(hidden = true) + private Long companyId; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java new file mode 100644 index 0000000..39387a6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java @@ -0,0 +1,25 @@ +package com.matrix.system.fenxiao.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ShopSalesmanApplyDto", description = "查询参数") +public class ShopSalesmanApplyDto extends BasePageQueryDto { + + @ApiModelProperty(value ="审核状态") + private Integer shenheState; + @ApiModelProperty(value ="分销员等级") + private Long salemanGrade; + @ApiModelProperty(value ="会员姓名") + private String userName; + + + @ApiModelProperty(hidden = true) + private Long companyId; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java new file mode 100644 index 0000000..4fda140 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java @@ -0,0 +1,29 @@ +package com.matrix.system.fenxiao.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ShopSalesmanDetailDto", description = "查询参数") +public class ShopSalesmanDetailDto extends BasePageQueryDto { + + @ApiModelProperty(value ="会员姓名") + private String userName; + + @ApiModelProperty(value ="会员ID") + private Long userId; + + @ApiModelProperty(value ="申请记录ID") + private Long applyId; + + @ApiModelProperty(value = " 结算状态1,待结算,2,已结算,3已退款") + private Integer orderType; + + @ApiModelProperty(hidden = true) + private Long companyId; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java new file mode 100644 index 0000000..6ab0ba2 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "UnbundlingSaleManDto", description = "查询参数") +public class UnbundlingSaleManDto { + + @ApiModelProperty(value ="会员ID") + private Long userId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateFyfaDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateFyfaDto.java new file mode 100644 index 0000000..31dcf80 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateFyfaDto.java @@ -0,0 +1,32 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "UpdateFyfaDto", description = "参数") +public class UpdateFyfaDto { + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "方案名称") + private String name; + + @ApiModelProperty(value = "自购返佣%") + private Double selfCommission; + + @ApiModelProperty(value = "推广提成%") + private Double sealesCommission; + + @ApiModelProperty(value = "邀请提成 %") + private Double invitationCommission; + + @ApiModelProperty(value = "等级条件(推广金额)") + private Double gradeCondition; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateSetOrderDoneDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateSetOrderDoneDto.java new file mode 100644 index 0000000..dd4c723 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateSetOrderDoneDto.java @@ -0,0 +1,32 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "UpdateSetOrderDoneDto", description = "查询参数") +public class UpdateSetOrderDoneDto { + + @ApiModelProperty(hidden = true) + private Long companyId; + + @ApiModelProperty(value ="需要处理的IDs(字符串逗号隔开)") + private String orderIds; + + @ApiModelProperty(value ="结算方式1,线下结算,2余额结算") + private Integer setType; + + @ApiModelProperty(value ="结算人数") + private Integer manCount; + + @ApiModelProperty(value ="结算单数") + private Integer orderCount; + + @ApiModelProperty(value ="结算金额") + private Double amount; + + @ApiModelProperty(value ="备注") + private String remark; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java new file mode 100644 index 0000000..bfb530c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgjhDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "UpdateTgjhDto", description = "参数") +public class UpdateTgjhDto { + + @ApiModelProperty(value = "方案名称") + private String tgfa; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java new file mode 100644 index 0000000..45c168d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UpdateTgtpDto.java @@ -0,0 +1,17 @@ +package com.matrix.system.fenxiao.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "UpdateTgjhDto", description = "参数") +public class UpdateTgtpDto { + + @ApiModelProperty(value = "方案名称") + private String imageUrl; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/BizUser.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/BizUser.java new file mode 100644 index 0000000..6abef80 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/BizUser.java @@ -0,0 +1,188 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import lombok.Data; + +import java.util.Date; + +/** + * @description 用户表 + * @author jyy + */ +@Data +@TableName("biz_user") +public class BizUser { + @Extend + private static final long serialVersionUID = 1L; + + + /** + * 主键 + */ + private String userId; + + + /** + * 真实姓名 + */ + private String userName; + + + /** + * 密码 + */ + private String userPassword; + + + /** + * 用户昵称 + */ + private String nickName; + + + /** + * 头像 + */ + private String avatarUrl; + + + /** + * 微信openid用户唯一标识 + */ + private String openId; + + + /** + * 用户在开发平台的唯一标识符 + */ + private String unionId; + + + /** + * 性别 1、男 2、女 0、未知 + */ + private String gender; + + + /** + * 手机号码 + */ + private String phoneNumber; + + + /** + * 用户所在地 + */ + private String area; + + + /** + * 用户所在城市 + */ + private String city; + + + /** + * 用户所在省份 + */ + private String province; + + + /** + * 用户所在国家 + */ + private String country; + + + /** + * 会话密匙 + */ + private String sessionKey; + + + /** + * 最后登录时间 + */ + private Date lastLoginTime; + + + /** + * 用户状态 + */ + private Integer userStatus; + + + /** + * vip等级 + */ + private Integer userVip; + + + /** + * 到期时间 + */ + private Date userExpiryTime; + + + /** + * 认证信息 + */ + private String userAuthentication; + + + /** + * 用户是否授权 1、是 2、否 + */ + private Integer userIsAuthorize; + + + /** + * 用户临时名称 + */ + private String userTempName; + + + /** + * 用户临时头像 + */ + private String userTempAvatarUrl; + + + /** + * 用户类型 1、普通用户 2、会员 3、游客 + */ + private Integer userType; + + + /** + * 用户总积分 + */ + private Integer totalScore; + + + /** + * 用户当前积分 + */ + private Integer currentScore; + + + /** + * 上级用户openId + */ + private String parentOpenId; + + + /** + * 绑定上级用户时间 + */ + private Date bindingParentTime; + + + /** + * 是否是销售员(1=是,0=否) + */ + private Integer isSales; + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/FenXiaoSettingEntity.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/FenXiaoSettingEntity.java new file mode 100644 index 0000000..7ed7815 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/FenXiaoSettingEntity.java @@ -0,0 +1,18 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.system.score.entity.BaseEntity; + +@TableName("score_order") +public class FenXiaoSettingEntity extends BaseEntity { + + private String orderNo; + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java new file mode 100644 index 0000000..2a2130b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java @@ -0,0 +1,69 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description 收益流水 + * @author yourName + * @date 2021-03-10 17:34 + */ +@Data +@TableName("shop_revenue_flow") +public class ShopRevenueFlow extends BaseEntity { + @Extend + private static final long serialVersionUID = 1L; + + /** + * 推广收益类型 推广收益 + */ + public static final String TYPE_TGSY = "推广收益"; + /** + * 推广收益类型 邀请收益 + */ + + public static final String TYPE_YQSY = "邀请收益"; + + + + /** + * 用户id + */ + @ApiModelProperty(hidden = true) + private Long userId; + + /** + * 收益说明 + */ + + @ApiModelProperty(value = "收益说明") + private String revenueContent; + + /** + * 收益金额 + */ + + @ApiModelProperty(value = "收益金额") + private Double amount; + + /** + * 原始订单ID + */ + + @ApiModelProperty(value = "原始订单ID") + private Long businessId; + + /** + * 公司ID + */ + + @ApiModelProperty(hidden = true) + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalemanSettlement.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalemanSettlement.java new file mode 100644 index 0000000..66a9dc1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalemanSettlement.java @@ -0,0 +1,93 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +/** + * @description 订单结算记录 + * @author yourName + * @date 2021-03-10 17:34 + */ +@Data +@TableName("shop_saleman_settlement") +public class ShopSalemanSettlement extends BaseEntity { + @Extend + private static final long serialVersionUID = 1L; + /** + * 结算编号头部编码 + */ + public static final String ORDERNO_START = "J"; + + /** + * 结算方式 1 线下结算 + */ + public static final Integer SETTLEMENTWAY_XXJS = 1; + + /** + * 结算方式 2 微信余额结算 + */ + public static final Integer SETTLEMENTWAY_YEJS = 2; + + + /** + * 结算编号 + */ + + + private String orderNo; + + /** + * 结算方式1,线下结算,2余额结算 + */ + + + private Integer settlementWay; + + /** + * 结算人数 + */ + + + private Integer manCount; + + /** + * 结算单数 + */ + + + private Integer orderCount; + + /** + * 结算金额 + */ + + + private Double amount; + + /** + * 结算人 + */ + + + private Integer userId; + + /** + * 备注 + */ + + + private String remark; + + /** + * 公司ID + */ + + + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java new file mode 100644 index 0000000..80bb8a8 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java @@ -0,0 +1,82 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.system.score.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description 推广员申请记录 + * @author yourName + * @date 2021-03-10 17:34 + */ +@Data +@TableName("shop_salesman_apply") +public class ShopSalesmanApply extends BaseEntity { + /** + * 审核状态-1、待审核 + */ + public static final int APPLY_STATUS_DSH = 1; + /** + * 审核状态-2通过 + */ + public static final int APPLY_STATUS_TG= 2; + /** + * 审核状态-3未通过 + */ + public static final int APPLY_STATUS_WTG = 3; + /** + * 审核状态-4系统删除 + */ + public static final int APPLY_STATUS_XTQX = 4; + + + /** + * 申请方式1、自主申请 + */ + public static final int APPLY_WAY_SELF=1; + /** + * 申请方式2、自动添加 + */ + public static final int APPLY_WAY_AUTO_ADD=2; + /** + * 申请方式3上级邀请 + */ + public static final int APPLY_WAY_INVITATION=3; + /** + * 申请方式 4、手动添加 + */ + public static final int APPLY_WAY_HAND_ADD=4; + + + + @ApiModelProperty(value = "申请方式1、自主申请,2、自动添加,3上级邀请,4、手动添加") + private Integer applyWay; + + @ApiModelProperty(value = "申请用户id") + private Long userId; + + + @ApiModelProperty(value = "邀请用户ID") + private Long parentUserId; + + + @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过") + private Integer applyStatus; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "等级ID") + private long gradeId; + + /** + * 公司ID + */ + @ApiModelProperty(hidden = true) + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanGrade.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanGrade.java new file mode 100644 index 0000000..999b02c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanGrade.java @@ -0,0 +1,75 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +/** + * @description 推广员等级 + * @author yourName + * @date 2021-03-10 17:34 + */ +@Data +@TableName("shop_salesman_grade") +public class ShopSalesmanGrade extends BaseEntity { + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * 等级名称 + */ + + + private String name; + + /** + * 推广提成% + */ + + + private Double sealesCommission; + + /** + * 自购返佣比例% + */ + + private Double selfCommission; + + + /** + * 邀请提成 % + */ + + + private Double invitationCommission; + + /** + * 等级条件(推广金额额) + */ + + + private Double gradeCondition; + + /** + * 默认等级1是,2不是 + */ + + + private Integer isDefault; + + /** + * 公司ID + */ + + + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java new file mode 100644 index 0000000..1e19521 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java @@ -0,0 +1,103 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +/** + * @description 分销订单 + * @author yourName + * @date 2021-03-10 17:34 + */ +@Data +@TableName("shop_salesman_order") +public class ShopSalesmanOrder extends BaseEntity { + /** + * 推广收益类型1推广收益 + */ + public static final Integer REVENUE_TYPE_SALES = 1; + + /** + * 推广收益类型2邀请收益 + */ + public static final Integer REVENUE_TYPE_INVITATION = 2; + /** + * 分销单状态1待结算 + */ + public static final Integer STATUS_DJS = 1; + /** + * 分销单状态2已结算 + */ + public static final Integer STATUS_YJS = 2; + /** + * 分销单状态3已退款 + */ + public static final Integer STATUS_YTK = 3; + + + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * 订单id + */ + + + private Long orderId ; + + /** + * 用户id + */ + + + private Long userId; + + /** + * 收益人id + */ + + + private Long salesUserId; + + /** + * 收益类型1,推广收益,2邀请收益 + */ + + + private Integer revenueType; + + /** + * 收益金额 + */ + + + private Double amount; + + /** + * 结算状态 1,待结算,2,已结算,3已退款 + */ + private Integer orderStatus; + + /** + * 结算单ID + */ + + + private Long settlementId; + + /** + * 公司ID + */ + + + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrderItem.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrderItem.java new file mode 100644 index 0000000..a400637 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrderItem.java @@ -0,0 +1,54 @@ +package com.matrix.system.fenxiao.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.core.anotations.Extend; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +/** + * @description 分销单明细 + * @author yourName + * @date 2021-03-12 13:17 + */ +@Data +@TableName("shop_salesman_order_item") +public class ShopSalesmanOrderItem extends BaseEntity { + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * 订单id + */ + + + private Long orderId ; + + /** + * 分销订单id + */ + + + private Long salesmanOrderId; + + /** + * 订单明细id + */ + + + private Long orderItemId; + + /** + * 收益金额 + */ + + + private Double amount; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/FenXiaoSettingService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/FenXiaoSettingService.java new file mode 100644 index 0000000..270cc56 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/FenXiaoSettingService.java @@ -0,0 +1,53 @@ +package com.matrix.system.fenxiao.service; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.dao.FenXiaoSettingDao; +import com.matrix.system.fenxiao.entity.FenXiaoSettingEntity; +import com.matrix.system.hive.bean.ShoppingGoods; + +@Service +public class FenXiaoSettingService extends ServiceImpl<FenXiaoSettingDao, FenXiaoSettingEntity> { + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + public AjaxResult updateFenXiaoSettingByCompanyId(List<BusParameterSettings> busParameterSettings) { + //获取当前登录人员信息 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + for (BusParameterSettings busParameterSetting:busParameterSettings ) { + String paramCode = busParameterSetting.getParamCode(); + if(StringUtils.isNotBlank(paramCode)){ + //删除原有code + BusParameterSettings delParanm=new BusParameterSettings(); + delParanm.setCompanyId(user.getCompanyId()); + delParanm.setParamCode(paramCode); + busParameterSettingsDao.deleteByModel(delParanm); + //添加新的code + BusParameterSettings newParam=new BusParameterSettings(); + newParam.setParamCode(paramCode); + newParam.setCompanyId(user.getCompanyId()); + newParam.setParamValue(busParameterSetting.getParamValue()); + newParam.setParamValue1(busParameterSetting.getParamValue1()); + newParam.setParamValue2(busParameterSetting.getParamValue2()); + busParameterSettingsDao.insert(newParam); + }else{ + return AjaxResult.buildFailInstance("code不能为空"); + } + } + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "更新成功"); + return result; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopRevenueFlowService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopRevenueFlowService.java new file mode 100644 index 0000000..ef3e100 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopRevenueFlowService.java @@ -0,0 +1,20 @@ +package com.matrix.system.fenxiao.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; +import com.matrix.system.fenxiao.entity.ShopRevenueFlow; +import org.springframework.stereotype.Service; + +/** + * @description 收益流水 + * @author jyy + * @date 2021-03-10 15:22 + */ +@Service +public class ShopRevenueFlowService extends ServiceImpl<ShopRevenueFlowDao, ShopRevenueFlow>{ + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalemanSettlementService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalemanSettlementService.java new file mode 100644 index 0000000..b49178e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalemanSettlementService.java @@ -0,0 +1,20 @@ +package com.matrix.system.fenxiao.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.system.fenxiao.dao.ShopSalemanSettlementDao; +import com.matrix.system.fenxiao.entity.ShopSalemanSettlement; +import org.springframework.stereotype.Service; + +/** + * @description 订单结算记录 + * @author jyy + * @date 2021-03-10 15:22 + */ +@Service +public class ShopSalemanSettlementService extends ServiceImpl<ShopSalemanSettlementDao, ShopSalemanSettlement>{ + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java new file mode 100644 index 0000000..617db32 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java @@ -0,0 +1,444 @@ +package com.matrix.system.fenxiao.service; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.VerificationResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.dto.*; +import com.matrix.system.fenxiao.entity.ShopSalesmanApply; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.fenxiao.vo.*; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * @description 推广员申请记录 + * @author jyy + * @date 2021-03-10 15:22 + */ +@Service +public class ShopSalesmanApplyService extends ServiceImpl<ShopSalesmanApplyDao, ShopSalesmanApply>{ + + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + ShopSalesmanApplyDao shopSalesmanApplyDao; + + @Autowired + ShopSalesmanGradeDao shopSalesmanGradeDao; + + @Autowired + SysVipInfoDao sysVipInfoDao; + + @Autowired + SysVipInfoService sysVipInfoService; + + @Autowired + ShopOrderV2Dao shopOrderV2Dao; + + /** + * 申请成为推广员 + * @param userId + * @param invitationId + * @return + */ + public ShopSalesmanApply applyToBeAnSalesman(Long userId,Long gradeId,Long invitationId,int applyWay) { + + SysVipInfo loginUser=sysVipInfoDao.selectById(userId); + //验证申请条件 + VerificationResult verificationResult = isAbleToBeAnSalesman(userId,loginUser.getCompanyId()); + if(verificationResult.isJudgeResult()){ + //校验审核状态,和是否重复发起 + QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_id",loginUser.getId()); + queryWrapper.in("apply_status",Arrays.asList("1,2".split(","))); + ShopSalesmanApply checkApply = shopSalesmanApplyDao.selectOne(queryWrapper); + if(checkApply==null|| + checkApply.getApplyStatus()==ShopSalesmanApply.APPLY_STATUS_WTG){ + + ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply(); + shopSalesmanApply.setUserId(userId); + + shopSalesmanApply.setCreateBy(MatrixConstance.SYSTEM_USER); + shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF); + + shopSalesmanApply.setCompanyId(loginUser.getCompanyId()); + shopSalesmanApply.setUpdateBy(MatrixConstance.SYSTEM_USER); + Date date = new Date(); + shopSalesmanApply.setCreateTime(date); + shopSalesmanApply.setUpdateTime(date); + + if(invitationId!=null){ + shopSalesmanApply.setParentUserId(invitationId); + }else if(loginUser.getRecommendId()!=null){ + //如果曾经是被邀请进来的则自动绑定为之前邀请人的下级 + shopSalesmanApply.setParentUserId(loginUser.getRecommendId()); + } + if(gradeId!=null){ + shopSalesmanApply.setGradeId(gradeId); + }else{ + //获取初始等级ID(公司id,是否为初始等级) + QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); + queryWrapperOrepool.eq("company_id", loginUser.getCompanyId()); + queryWrapperOrepool.eq("is_default", 1); + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); + shopSalesmanApply.setGradeId(shopSalesmanGrade.getId()); + } + shopSalesmanApply.setApplyWay(applyWay); + + BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_AUDIT_METHOD, loginUser.getCompanyId()); + if(busParameterSettings!=null + &&busParameterSettings.getParamValue().equals("1")){ + //自动审核 + //初始等级ID(公司id,是否为初始等级) + QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); + queryWrapperOrepool.eq("company_id", loginUser.getCompanyId()); + queryWrapperOrepool.eq("is_default", 1); + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); + shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); + sysVipInfoService.setToBeAnSalesman(loginUser.getId(),invitationId,shopSalesmanGrade.getId()); + + }else{ + shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH); + } + shopSalesmanApplyDao.insert(shopSalesmanApply); + return shopSalesmanApply; + }else{ + throw new GlobleException("不能重复申请"); + } + }else{ + throw new GlobleException(verificationResult.getMsg()); + } + } + + + /** + * 判断是否满足申请成为分销员的条件 + */ + public VerificationResult isAbleToBeAnSalesman(Long userId,Long companyId) { + + VerificationResult verificationResult=null; + + //申请模式 + BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, companyId); + if (FenxiaoSettingConstant.FX_APPLY_WAY_AUTO.equals(applyWay.getParamValue())) { + verificationResult= VerificationResult.buildVerificationResult(true); + }else{ + //申请条件 + BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId); + switch (applyCondition.getParamValue()){ + case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: + verificationResult= VerificationResult.buildVerificationResult(true); + break; + case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: + int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(userId,applyCondition.getParamValue1()); + if(buyZdcpCount>0){ + verificationResult= VerificationResult.buildVerificationResult(true); + }else{ + verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费指定产品后再申请!"); + } + break; + case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: + //判断用户是否有确认收货的产品 + int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(userId); + if(receivedOrderCount>0){ + verificationResult= VerificationResult.buildVerificationResult(true); + }else{ + verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费任意产品后再申请!"); + } + break; + case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: + Double zdje=Double.parseDouble(applyCondition.getParamValue2()); + Double yxfje=shopOrderV2Dao.countOrderAmount(userId); + if(zdje<yxfje){ + verificationResult=VerificationResult.buildVerificationResult(true); + }else{ + verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费满"+zdje+"元后再申请!"); + } + break; + default: + verificationResult= VerificationResult.buildVerificationResult(true); + } + } + return verificationResult; + } + + + public IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page, ShopSalesmanApplyDto shopSalesmanApplyDto) { + return shopSalesmanApplyDao.findShopSalesmanApplyList(page,shopSalesmanApplyDto); + } + + public IPage<ShopSalesmanAppliingVo> findShopSalesmanAppliingList(Page<ShopSalesmanAppliingVo> page, + ShopSalesmanAppliingDto shopSalesmanAppliingDto) { + return shopSalesmanApplyDao.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto); + } + + public IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page, ShopSalesmanAppliingDto shopSalesmanAppliingDto) { + return shopSalesmanApplyDao.selectBizUserApplyList(page,shopSalesmanAppliingDto); + } + + public List<ShopSalesmanGradeVo> getShopSalesmanGradeVo(Long companyId) { + return shopSalesmanGradeDao.getShopSalesmanGradeVo(companyId); + } + + @Transactional(rollbackFor = Exception.class) + public void addSaleManApply(Long userId,Long gradeId) { + SysVipInfo user = sysVipInfoDao.selectById(userId); + applyToBeAnSalesman(user.getId(),gradeId, null,ShopSalesmanApply.APPLY_WAY_HAND_ADD); + } + + @Transactional(rollbackFor = Exception.class) + public void examineSaleManApply(ShopSalesmanApply shopSalesmanApply, Integer applyState) { + Long userId = shopSalesmanApply.getUserId(); + Long parentUserId = shopSalesmanApply.getParentUserId(); + SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId); + //修改审核记录 + if(ShopSalesmanApply.APPLY_STATUS_TG == applyState) { + shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); + sysVipInfo.setIsSales(SysVipInfo.IS_SALES); + }else { + shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_WTG); + sysVipInfo.setIsSales(SysVipInfo.NOT_SALES); + } + shopSalesmanApplyDao.updateById(shopSalesmanApply); + //修改USER的状态 + sysVipInfo.setRecommendId(parentUserId); + sysVipInfo.setBindingParentTime(new Date()); + sysVipInfo.setSalesmanGrade(shopSalesmanApply.getGradeId()); + sysVipInfoDao.update(sysVipInfo); + } + + public IPage<ShopSalesmanApplyVo> findShopSalesmanDetail(Page<ShopSalesmanApplyVo> page, + ShopSalesmanDetailDto shopSalesmanDetailDto) { + // TODO Auto-generated method stub + return null; + } + + public SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(Long userId, long applyId) { + //获取个人信息 + SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId); + Long companyId = sysVipInfo.getCompanyId(); + return shopSalesmanApplyDao.selectShopSalesmanDetailByOpenId(sysVipInfo.getId(),companyId,applyId); + } + + public IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,LoadParamSettingDto loadParamSettingDto) { + return shopSalesmanApplyDao.findCustomDetail(page,loadParamSettingDto); + } + + public IPage<ShopCustomDetailVo> findCustomLow(Page<ShopCustomDetailVo> pageLow, + ShopSalesmanDetailDto shopSalesmanDetailDto) { + return shopSalesmanApplyDao.findCustomLow(pageLow,shopSalesmanDetailDto); + } + + public IPage<ShopOrderDetailVo> findShopOrderDetail(Page<ShopOrderDetailVo> pageOrder, + ShopSalesmanDetailDto shopSalesmanDetailDto) { + return shopSalesmanApplyDao.findShopOrderDetail(pageOrder,shopSalesmanDetailDto); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult changeSaleManGrade(ChangeSaleManGradeDto changeSaleManGradeDto) { + + SysVipInfo vipInfo = sysVipInfoDao.selectById(changeSaleManGradeDto.getUserId()); + + //获取对应的公司的等级 + QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); + queryWrapperOrepool.eq("is_default", 1); + queryWrapperOrepool.eq("company_id", vipInfo.getCompanyId()); + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); + + //不是分销员不允许修改 + Integer isSales = vipInfo.getIsSales(); + if(SysVipInfo.IS_SALES != isSales) { + return AjaxResult.buildFailInstance("当前用户未通过审核,不允许修改"); + } + + //修改申请记录的等级 + QueryWrapper<ShopSalesmanApply> queryShopSalesmanApply = new QueryWrapper<>(); + queryShopSalesmanApply.eq("apply_status", 2); + queryShopSalesmanApply.eq("user_id", vipInfo.getId()); + queryShopSalesmanApply.eq("company_id", vipInfo.getCompanyId()); + ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectOne(queryShopSalesmanApply); + Long gradeId = changeSaleManGradeDto.getGradeId(); + if(ObjectUtil.isEmpty(gradeId)) { + vipInfo.setSalesmanGrade(shopSalesmanGrade.getId()); + shopSalesmanApply.setGradeId(shopSalesmanGrade.getId()); + }else { + vipInfo.setSalesmanGrade(gradeId); + shopSalesmanApply.setGradeId(gradeId); + } + sysVipInfoDao.update(vipInfo); + shopSalesmanApplyDao.updateById(shopSalesmanApply); + + return AjaxResult.buildSuccessInstance("修改等级成功"); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult unbundlingSaleMan(UnbundlingSaleManDto unbundlingSaleManDto) { + + Long userId = unbundlingSaleManDto.getUserId(); + sysVipInfoDao.unbundlingSaleMan(userId); + return AjaxResult.buildSuccessInstance("解绑成功"); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult delSaleManGradeApply(DelSaleManGradeApplyDto delSaleManGradeApplyDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(delSaleManGradeApplyDto); + + + //将biz_user的is_sale设置成否 + SysVipInfo vipInfo = sysVipInfoDao.selectById(delSaleManGradeApplyDto.getUserId()); + if(ObjectUtil.isEmpty(vipInfo)) { + return AjaxResult.buildFailInstance("当前用户已不存在"); + } + vipInfo.setIsSales(SysVipInfo.NOT_SALES); + sysVipInfoDao.update(vipInfo); + //将记录设置成系统取消 + ShopSalesmanApply selectById = shopSalesmanApplyDao.selectById(delSaleManGradeApplyDto.getApplyId()); + selectById.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_XTQX); + shopSalesmanApplyDao.updateById(selectById); + return AjaxResult.buildSuccessInstance("操作成功"); + } + + public IPage<FyfaManageVo> findFyfaManageList(Page<FyfaManageVo> page, FyfaManageDto fyfaManageDto) { + return shopSalesmanGradeDao.findFyfaManageList(page,fyfaManageDto); + } + + @Transactional(rollbackFor = Exception.class) + public void addFyfa(SysUsers user) { + ShopSalesmanGrade shopSalesmanGrade = new ShopSalesmanGrade(); + shopSalesmanGrade.setIsDefault(2); + shopSalesmanGrade.setCreateBy(user.getSuName()); + shopSalesmanGrade.setUpdateBy(user.getSuName()); + shopSalesmanGrade.setCreateTime(new Date()); + shopSalesmanGrade.setUpdateTime(new Date()); + shopSalesmanGrade.setCompanyId(user.getCompanyId()); + shopSalesmanGradeDao.insert(shopSalesmanGrade); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult delFyfaApply(DelFyfaApplyDto delFyfaApplyDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(delFyfaApplyDto); + Long gradeId = delFyfaApplyDto.getGradeId(); + ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(gradeId); + if(ObjectUtil.isEmpty(selectById)) { + return AjaxResult.buildFailInstance("当前行数据不存在,请刷新页面"); + } + shopSalesmanGradeDao.deleteById(gradeId); + return AjaxResult.buildSuccessInstance("操作成功"); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult updateFyfa(UpdateFyfaDto updateFyfaDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(updateFyfaDto); + ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(updateFyfaDto.getId()); + String name = updateFyfaDto.getName(); + if(StrUtil.isEmpty(name)) { + return AjaxResult.buildFailInstance("请输入方案名称"); + } + Double selfCommission = updateFyfaDto.getSelfCommission(); + if(ObjectUtil.isEmpty(selfCommission)) { + return AjaxResult.buildFailInstance("请输入正确的自购返佣"); + } + Double sealesCommission = updateFyfaDto.getSealesCommission(); + if(ObjectUtil.isEmpty(sealesCommission)) { + return AjaxResult.buildFailInstance("请输入正确的推广提成"); + } + Double invitationCommission = updateFyfaDto.getInvitationCommission(); + if(ObjectUtil.isEmpty(invitationCommission)) { + return AjaxResult.buildFailInstance("请输入正确的邀请提成"); + } + if(ObjectUtil.isEmpty(selectById)) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + ShopSalesmanGrade shopSalesmanGrade = new ShopSalesmanGrade(); + shopSalesmanGrade.setCompanyId(updateFyfaDto.getCompanyId()); + shopSalesmanGrade.setName(updateFyfaDto.getName()); + shopSalesmanGrade.setSelfCommission(selfCommission); + shopSalesmanGrade.setSealesCommission(sealesCommission); + shopSalesmanGrade.setInvitationCommission(invitationCommission); + shopSalesmanGrade.setGradeCondition(updateFyfaDto.getGradeCondition()); + shopSalesmanGrade.setIsDefault(2); + shopSalesmanGrade.setCreateBy(user.getSuName()); + shopSalesmanGrade.setUpdateBy(user.getSuName()); + shopSalesmanGrade.setCreateTime(new Date()); + shopSalesmanGrade.setUpdateTime(new Date()); + shopSalesmanGrade.setCompanyId(user.getCompanyId()); + shopSalesmanGradeDao.insert(shopSalesmanGrade); + return AjaxResult.buildSuccessInstance("操作成功"); + } + selectById.setCompanyId(updateFyfaDto.getCompanyId()); + selectById.setName(updateFyfaDto.getName()); + selectById.setSelfCommission(selfCommission); + selectById.setSealesCommission(sealesCommission); + selectById.setInvitationCommission(invitationCommission); + selectById.setGradeCondition(updateFyfaDto.getGradeCondition()); + shopSalesmanGradeDao.updateById(selectById); + return AjaxResult.buildSuccessInstance("操作成功"); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult updateTgjh(UpdateTgjhDto updateTgjhDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(updateTgjhDto); + //获取推广计划的Param + Long companyId = updateTgjhDto.getCompanyId(); + BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, companyId); + busParameterSettings.setParamValue3(updateTgjhDto.getTgfa()); + busParameterSettingsDao.updateByModel(busParameterSettings); + return AjaxResult.buildSuccessInstance("保存成功"); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult updateTgtp(UpdateTgtpDto updateTgtpDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(updateTgtpDto); + //获取推广计划的Param + Long companyId = updateTgtpDto.getCompanyId(); + BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, companyId); + busParameterSettings.setParamValue(updateTgtpDto.getImageUrl()); + busParameterSettingsDao.updateByModel(busParameterSettings); + return AjaxResult.buildSuccessInstance("保存成功"); + } + + + + + + + + + + + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanGradeService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanGradeService.java new file mode 100644 index 0000000..663bc50 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanGradeService.java @@ -0,0 +1,20 @@ +package com.matrix.system.fenxiao.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import org.springframework.stereotype.Service; + +/** + * @description 推广员等级 + * @author jyy + * @date 2021-03-10 15:22 + */ +@Service +public class ShopSalesmanGradeService extends ServiceImpl<ShopSalesmanGradeDao, ShopSalesmanGrade>{ + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderItemService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderItemService.java new file mode 100644 index 0000000..fcfb554 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderItemService.java @@ -0,0 +1,20 @@ +package com.matrix.system.fenxiao.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderItemDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrderItem; +import org.springframework.stereotype.Service; + +/** + * @description 分销单明细 + * @author yourName + * @date 2021-03-12 13:17 + */ +@Service +public class ShopSalesmanOrderItemService extends ServiceImpl<ShopSalesmanOrderItemDao, ShopSalesmanOrderItem>{ + + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java new file mode 100644 index 0000000..39a251d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java @@ -0,0 +1,188 @@ +package com.matrix.system.fenxiao.service; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; +import com.matrix.system.fenxiao.dao.ShopSalemanSettlementDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; +import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto; +import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; +import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; +import com.matrix.system.fenxiao.dto.UpdateSetOrderDoneDto; +import com.matrix.system.fenxiao.entity.ShopRevenueFlow; +import com.matrix.system.fenxiao.entity.ShopSalemanSettlement; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; +import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; +import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; +import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.dao.ShopOrderDao; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * @description 分销订单 + * @author jyy + * @date 2021-03-10 15:22 + */ +@Service +public class ShopSalesmanOrderService extends ServiceImpl<ShopSalesmanOrderDao, ShopSalesmanOrder>{ + + @Autowired + ShopSalesmanOrderDao shopSalesmanOrderDao; + @Autowired + CodeService codeService; + @Autowired + ShopSalemanSettlementDao shopSalemanSettlementDao; + @Autowired + ShopRevenueFlowDao shopRevenueFlowDao; + @Autowired + ShopOrderDao shopOrderDao; + @Autowired + SysVipInfoDao sysVipInfoDao; + + public AjaxResult loadFenxiaoOrderBasic(LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(loadFenxiaoOrderBasicDto); + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + //根据OPENID查询基础信息 + Long companyId = loadFenxiaoOrderBasicDto.getCompanyId(); + LoadFenxiaoOrderBasicVo loadFenxiaoOrderBasicVo = shopSalesmanOrderDao.selectFenxiaoOrderBasicByCompanyId(companyId); + result.putInMap("basicdetail", loadFenxiaoOrderBasicVo); + return result; + } + + public AjaxResult loadFenxiaoOrderList(LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(loadFenxiaoOrderListDto); + //排序 + if(StringUtils.isBlank(loadFenxiaoOrderListDto.getSort())){ + loadFenxiaoOrderListDto.setSort("create_time"); + loadFenxiaoOrderListDto.setOrder("desc"); + } + Page<LoadFenxiaoOrderListVo> page = new Page(loadFenxiaoOrderListDto.getPageNum(), loadFenxiaoOrderListDto.getPageSize()); + IPage<LoadFenxiaoOrderListVo> loadFenxiaoOrderListVos = shopSalesmanOrderDao.findFenxiaoOrderList(page,loadFenxiaoOrderListDto); + return AjaxResult.buildSuccessInstance(loadFenxiaoOrderListVos.getRecords(),loadFenxiaoOrderListVos.getTotal()); + } + + public AjaxResult loadSetOrderList(LoadSetOrderListDtoDto loadSetOrderListDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(loadSetOrderListDto); + //排序 + if(StringUtils.isBlank(loadSetOrderListDto.getSort())){ + loadSetOrderListDto.setSort("create_time"); + loadSetOrderListDto.setOrder("desc"); + } + Page<LoadSetOrderListDtoVo> page = new Page(loadSetOrderListDto.getPageNum(), loadSetOrderListDto.getPageSize()); + IPage<LoadSetOrderListDtoVo> loadFenxiaoOrderListVos = shopSalesmanOrderDao.findSetOrderList(page,loadSetOrderListDto); + return AjaxResult.buildSuccessInstance(loadFenxiaoOrderListVos.getRecords(),loadFenxiaoOrderListVos.getTotal()); + } + + @Transactional(rollbackFor = Exception.class) + public AjaxResult updateSetOrderDone(UpdateSetOrderDoneDto updateSetOrderDoneDto) { + //设置用户公司ID + QueryUtil.setQueryLimitCom(updateSetOrderDoneDto); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = updateSetOrderDoneDto.getCompanyId(); + Integer setType = updateSetOrderDoneDto.getSetType(); + + String orderIds = updateSetOrderDoneDto.getOrderIds(); + if(StrUtil.isNotEmpty(orderIds)){ + List<String> idsStringList = Arrays.asList(orderIds.split(",")); + if(CollUtil.isEmpty(idsStringList)) { + return AjaxResult.buildFailInstance("请至少选择一条记录"); + } + //产生订单结算记录 + ShopSalemanSettlement shopSalemanSettlement = new ShopSalemanSettlement(); + shopSalemanSettlement.setCompanyId(companyId); + shopSalemanSettlement.setCreateBy(MatrixConstance.SYSTEM_USER); + shopSalemanSettlement.setUpdateBy(MatrixConstance.SYSTEM_USER); + shopSalemanSettlement.setCreateTime(new Date()); + shopSalemanSettlement.setUpdateTime(new Date()); + shopSalemanSettlement.setOrderNo(codeService.getCodeByTyle(ShopSalemanSettlement.ORDERNO_START)); + shopSalemanSettlement.setSettlementWay(setType); + shopSalemanSettlement.setManCount(updateSetOrderDoneDto.getManCount()); + shopSalemanSettlement.setOrderCount(updateSetOrderDoneDto.getOrderCount()); + shopSalemanSettlement.setUserId(user.getSuId().intValue()); + shopSalemanSettlement.setAmount(updateSetOrderDoneDto.getAmount()); + shopSalemanSettlement.setRemark(updateSetOrderDoneDto.getRemark()); + shopSalemanSettlement.setCompanyId(companyId); + shopSalemanSettlementDao.insert(shopSalemanSettlement); + + for(String idString : idsStringList) { + long id = Long.parseLong(idString); + //更新分销订单 + ShopSalesmanOrder shopSalesmanOrder = shopSalesmanOrderDao.selectById(id); + if(!ShopSalesmanOrder.STATUS_DJS.equals(shopSalesmanOrder.getOrderStatus())) { + return AjaxResult.buildFailInstance("选中记录中存在【已结算】的记录"); + } + //判断原始订单的状态【4=待评价, 5=已评价】才能结算 + ShopOrder shopOrder = shopOrderDao.selectById(shopSalesmanOrder.getOrderId().intValue()); + if(ShopOrder.ORDER_STATUS_WAIT_REMARK != shopOrder.getOrderStatus() && + ShopOrder.ORDER_STATUS_ALREADY_REMARK != shopOrder.getOrderStatus()) { + return AjaxResult.buildFailInstance("未收货订单不允许结算"); + } + shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YJS); + shopSalesmanOrder.setSettlementId(shopSalemanSettlement.getId()); + shopSalesmanOrderDao.updateById(shopSalesmanOrder); + //记录流水 + ShopRevenueFlow salesRevenueFlow=new ShopRevenueFlow(); + salesRevenueFlow.setCompanyId(companyId); + salesRevenueFlow.setCreateBy(MatrixConstance.SYSTEM_USER); + salesRevenueFlow.setUpdateBy(MatrixConstance.SYSTEM_USER); + salesRevenueFlow.setCreateTime(new Date()); + salesRevenueFlow.setUpdateTime(new Date()); + salesRevenueFlow.setAmount(shopSalesmanOrder.getAmount()); + salesRevenueFlow.setUserId(shopSalesmanOrder.getSalesUserId()); + if(ShopSalesmanOrder.REVENUE_TYPE_SALES.equals(shopSalesmanOrder.getRevenueType())) { + salesRevenueFlow.setRevenueContent(ShopRevenueFlow.TYPE_TGSY); + } + if(ShopSalesmanOrder.REVENUE_TYPE_INVITATION.equals(shopSalesmanOrder.getRevenueType())) { + salesRevenueFlow.setRevenueContent(ShopRevenueFlow.TYPE_YQSY); + } + salesRevenueFlow.setBusinessId(shopSalesmanOrder.getId()); + shopRevenueFlowDao.insert(salesRevenueFlow); + //选择微信余额支付,更新用户的金额 + if(ShopSalemanSettlement.SETTLEMENTWAY_YEJS == updateSetOrderDoneDto.getSetType()) { + SysVipInfo vipInfo = sysVipInfoDao.selectById(shopSalesmanOrder.getSalesUserId()); + if(ObjectUtil.isEmpty(vipInfo)) { + return AjaxResult.buildFailInstance("收益人信息不存在"); + } + Double withdrawalCash = vipInfo.getWithdrawalCash(); + Double amount = shopSalesmanOrder.getAmount(); + withdrawalCash = (withdrawalCash == null?0:withdrawalCash)+(amount== null?0:amount); + vipInfo.setWithdrawalCash(withdrawalCash); + sysVipInfoDao.update(vipInfo); + } + } + } + return AjaxResult.buildSuccessInstance("操作成功"); + } + + + public List<FenxiaoOrderListExportVo> findFenxiaoOrderList(LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) { + QueryUtil.setQueryLimitCom(loadFenxiaoOrderListDto); + return shopSalesmanOrderDao.selectFenxiaoOrderListNoPage(loadFenxiaoOrderListDto); + } + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenXiaoSettingVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenXiaoSettingVo.java new file mode 100644 index 0000000..838a131 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenXiaoSettingVo.java @@ -0,0 +1,139 @@ +package com.matrix.system.fenxiao.vo; + +import com.matrix.core.anotations.Extend; + +public class FenXiaoSettingVo { + @Extend + private static final long serialVersionUID = 1L; + + + private Long paramId; + /** + * 参数名称 + */ + private String paramName; + /** + * 参数编码 + */ + private String paramCode; + + /** + * switch按钮 + */ + private Boolean paramSwitch; + + + /** + * 参数值 + */ + private String paramValue; + + + /** + * 值1 + */ + private String paramValue1; + + + /** + * 值2 + */ + private String paramValue2; + + + /** + * 值3 + */ + private String paramValue3; + + private Long companyId; + + private Long shopId; + + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getParamId() { + return paramId; + } + + public void setParamId(Long paramId) { + this.paramId = paramId; + } + + + public String getParamCode() { + return paramCode; + } + + public void setParamCode(String paramCode) { + this.paramCode = paramCode; + } + + + public String getParamValue() { + return paramValue; + } + + public void setParamValue(String paramValue) { + this.paramValue = paramValue; + } + + + public String getParamValue1() { + return paramValue1; + } + + public void setParamValue1(String paramValue1) { + this.paramValue1 = paramValue1; + } + + + public String getParamValue2() { + return paramValue2; + } + + public void setParamValue2(String paramValue2) { + this.paramValue2 = paramValue2; + } + + + public String getParamValue3() { + return paramValue3; + } + + public void setParamValue3(String paramValue3) { + this.paramValue3 = paramValue3; + } + + public String getParamName() { + return paramName; + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } + + public Boolean getParamSwitch() { + return paramSwitch; + } + + public void setParamSwitch(Boolean paramSwitch) { + this.paramSwitch = paramSwitch; + } + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java new file mode 100644 index 0000000..a72bc01 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java @@ -0,0 +1,40 @@ +package com.matrix.system.fenxiao.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class FenxiaoOrderListExportVo { + + @ApiModelProperty(value = "订单编号") + private String orderNo; + @ApiModelProperty(value = "订单状态") + private String orderState; + @ApiModelProperty(value = "实付金额(元)") + private BigDecimal actualBalance; + @ApiModelProperty(value = "下单门店") + private String address; + @ApiModelProperty(value = "客户") + private String custom; + @ApiModelProperty(value = "客户openId") + private String customUserId; + @ApiModelProperty(value = "推广员") + private String parentSale; + @ApiModelProperty(value = "收益类型") + private String profitType; + @ApiModelProperty(value = "收益金额") + private BigDecimal profitBalance; + @ApiModelProperty(value = "结算状态") + private String settleType; + @ApiModelProperty(value = "结算编号") + private String settleNo; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + @ApiModelProperty(value = "结算时间") + private Date settleTime; + @ApiModelProperty(value = "结算人") + private String settler; +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FyfaManageVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FyfaManageVo.java new file mode 100644 index 0000000..6ce68e6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FyfaManageVo.java @@ -0,0 +1,32 @@ +package com.matrix.system.fenxiao.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "FyfaManageVo", description = "分佣方案信息返回类") +public class FyfaManageVo { + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "方案名称") + private String name; + + @ApiModelProperty(value = "自购返佣%") + private Double selfCommission; + + @ApiModelProperty(value = "推广提成%") + private Double sealesCommission; + + @ApiModelProperty(value = "邀请提成 %") + private Double invitationCommission; + + @ApiModelProperty(value = "等级条件(推广金额)") + private Double gradeCondition; + + @ApiModelProperty(value = "默认等级1是,2不是") + private Integer isDefault; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java new file mode 100644 index 0000000..596c689 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java @@ -0,0 +1,23 @@ +package com.matrix.system.fenxiao.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@ApiModel(value = "LoadFenxiaoOrderBasicVo", description = "返回类") +public class LoadFenxiaoOrderBasicVo { + + @ApiModelProperty(value = "待计算金额") + private BigDecimal balance; + @ApiModelProperty(value = "待结算人数") + private Integer waitNum; + @ApiModelProperty(value = "待结算订单") + private Integer waitOrderNum; + + @ApiModelProperty(value = "订单金额") + private BigDecimal orderBalance; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderListVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderListVo.java new file mode 100644 index 0000000..b0e5aef --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderListVo.java @@ -0,0 +1,45 @@ +package com.matrix.system.fenxiao.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ApiModel(value = "LoadFenxiaoOrderListVo", description = "返回类") +public class LoadFenxiaoOrderListVo { + + @ApiModelProperty(value = "订单ID") + private Long id; + @ApiModelProperty(value = "订单编号") + private String orderNo; + @ApiModelProperty(value = "订单状态") + private Integer orderState; + @ApiModelProperty(value = "实付金额(元)") + private BigDecimal actualBalance; + @ApiModelProperty(value = "下单门店") + private String address; + @ApiModelProperty(value = "客户") + private String custom; + @ApiModelProperty(value = "客户openId") + private String customUserId; + @ApiModelProperty(value = "推广员") + private String parentSale; + @ApiModelProperty(value = "收益类型") + private Integer profitType; + @ApiModelProperty(value = "收益金额") + private BigDecimal profitBalance; + @ApiModelProperty(value = "结算状态") + private Integer settleType; + @ApiModelProperty(value = "结算编号") + private String settleNo; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + @ApiModelProperty(value = "结算时间") + private Date settleTime; + @ApiModelProperty(value = "结算人") + private String settler; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadSetOrderListDtoVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadSetOrderListDtoVo.java new file mode 100644 index 0000000..b769ec7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadSetOrderListDtoVo.java @@ -0,0 +1,35 @@ +package com.matrix.system.fenxiao.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ApiModel(value = "LoadSetOrderListDtoVo", description = "返回类") +public class LoadSetOrderListDtoVo { + + @ApiModelProperty(value = "ID") + private Long id; + @ApiModelProperty(value = "结算编号") + private String orderNo; + @ApiModelProperty(value = "结算金额") + private BigDecimal actualBalance; + @ApiModelProperty(value = "结算订单数") + private String setNum; + @ApiModelProperty(value = "结算人数") + private String setManNum; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + @ApiModelProperty(value = "结算时间") + private Date setTime; + @ApiModelProperty(value = "结算人") + private String setMan; + @ApiModelProperty(value = "结算方式") + private BigDecimal settlementWay; + @ApiModelProperty(value = "备注") + private String remark; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/SalesmanBasicDetailVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/SalesmanBasicDetailVo.java new file mode 100644 index 0000000..8efa56c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/SalesmanBasicDetailVo.java @@ -0,0 +1,45 @@ +package com.matrix.system.fenxiao.vo; + +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SalesmanBasicDetailVo", description = "分销员基本信息的返参") +public class SalesmanBasicDetailVo { + + @ApiModelProperty(value = "申请用户id") + private String userId; + @ApiModelProperty(value = "头像") + private String avatarUrl; + @ApiModelProperty(value = "分销员") + private String nickname; + @ApiModelProperty(value = "等级") + private String grade; + @ApiModelProperty(value = "手机号码") + private String phone; + @ApiModelProperty(value = "加入时间") + @JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone="GMT+8") + private Date createTime; + @ApiModelProperty(value = "邀请人") + private String parentUser; + @ApiModelProperty(value = "申请方式1、自主申请,2、自动添加,3上级邀请,4、手动添加(来源)") + private Integer applyWay; + @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过") + private Integer applyStatus; + + @ApiModelProperty(value = "绑定客户") + private Integer lowerLevelNum; + @ApiModelProperty(value = "邀请下级") + private Integer invitedNum; + @ApiModelProperty(value = "累计收益") + private BigDecimal totalRevenue; + @ApiModelProperty(value = "待结算") + private BigDecimal balance; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopCustomDetailVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopCustomDetailVo.java new file mode 100644 index 0000000..2b5a752 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopCustomDetailVo.java @@ -0,0 +1,27 @@ +package com.matrix.system.fenxiao.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "ShopCustomDetailVo", description = "分销员客户基本信息的返参") +public class ShopCustomDetailVo { + @ApiModelProperty(value = "申请用户id") + private String userId; + @ApiModelProperty(value = "头像") + private String avatarUrl; + @ApiModelProperty(value = "分销员") + private String nickname; + @ApiModelProperty(value = "绑定时间") + @JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone="GMT+8") + private Date createTime; + @ApiModelProperty(value = "绑定方式1、自主申请,2、自动添加,3上级邀请,4、手动添加(来源)") + private Integer applyWay; + @ApiModelProperty(value = "待成交次数") + private Integer doneNum; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopOrderDetailVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopOrderDetailVo.java new file mode 100644 index 0000000..6d04291 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopOrderDetailVo.java @@ -0,0 +1,48 @@ +package com.matrix.system.fenxiao.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "ShopOrderDetailVo", description = "订单收益信息返回类") +public class ShopOrderDetailVo { + + @ApiModelProperty(value = "订单id") + private Long orderId ; + + @ApiModelProperty(value = "订单编号") + private String orderNo; + + @ApiModelProperty(value = "实付金额") + private Double orderMoney; + + @ApiModelProperty(value = "订单状态") + private Integer orderState; + + @ApiModelProperty(value = "下单门店") + private String storeName; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date createTime; + + @ApiModelProperty(value = "头像") + private String avatarUrl; + + @ApiModelProperty(value = "昵称") + private String nickName; + + @ApiModelProperty(value = " 收益类型1,推广收益,2邀请收益") + private Integer revenueType; + + @ApiModelProperty(value = "收益金额") + private Double amount; + + @ApiModelProperty(value = " 结算状态1,待结算,2,已结算,3已退款") + private Integer orderStatus; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java new file mode 100644 index 0000000..c2ebdf0 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java @@ -0,0 +1,31 @@ +package com.matrix.system.fenxiao.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "ShopSalesmanAppliingVo", description = "获取分销员待审核记录的返参") +public class ShopSalesmanAppliingVo { + + @ApiModelProperty(value = "申请用户id") + private String userId; + + + @ApiModelProperty(value = "分销员") + private String nickname; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date createTime; + + @ApiModelProperty(value = "头像") + private String avatarUrl; + + @ApiModelProperty(value = "手机号码") + private String phone; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java new file mode 100644 index 0000000..79acde3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java @@ -0,0 +1,97 @@ +package com.matrix.system.fenxiao.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class ShopSalesmanApplyVo { + + /** + * 审核状态-1、待审核 + */ + public static final int APPLY_STATUS_DSH = 1; + /** + * 审核状态-2通过 + */ + public static final int APPLY_STATUS_TG= 2; + /** + * 审核状态-3未通过 + */ + public static final int APPLY_STATUS_WTG = 3; + /** + * 审核状态-4系统删除 + */ + public static final int APPLY_STATUS_XTQX = 4; + + + /** + * 申请方式1、自主申请 + */ + public static final int APPLY_WAY_SELF=1; + /** + * 申请方式2、自动添加 + */ + public static final int APPLY_WAY_AUTO_ADD=2; + /** + * 申请方式3上级邀请 + */ + public static final int APPLY_WAY_INVITATION=3; + /** + * 申请方式 4、手动添加 + */ + public static final int APPLY_WAY_HAND_ADD=4; + + @ApiModelProperty(value = "申请记录ID") + private Long id; + + @ApiModelProperty(value = "申请方式1、自主申请,2、自动添加,3上级邀请,4、手动添加(来源)") + private Integer applyWay; + + @ApiModelProperty(value = "申请用户id") + private String userId; + + + @ApiModelProperty(value = "邀请用户ID") + private String parentUserId; + + + @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过") + private Integer applyStatus; + + @ApiModelProperty(value = "备注") + private String remark; + + /** + * 公司ID + */ + @ApiModelProperty(hidden = true) + private Long companyId; + + @ApiModelProperty(value = "分销员") + private String nickname; + @ApiModelProperty(value = "头像") + private String avatarUrl; + @ApiModelProperty(value = "注册邀请人") + private String parentUser; + @ApiModelProperty(value = "当前上级") + private String parentUserNow; + @ApiModelProperty(value = "推广客户") + private Integer lowerLevelNum; + @ApiModelProperty(value = "邀请下级") + private Integer invitedNum; + + @ApiModelProperty(value = "累计收益") + private BigDecimal totalRevenue; + @ApiModelProperty(value = "待结算") + private BigDecimal balance; + @ApiModelProperty(value = "等级") + private String grade; + + @ApiModelProperty(value = "加入时间") + private Date createTime; + @ApiModelProperty(value = "状态") + private Integer state; +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanDetailVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanDetailVo.java new file mode 100644 index 0000000..a23a5bf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanDetailVo.java @@ -0,0 +1,5 @@ +package com.matrix.system.fenxiao.vo; + +public class ShopSalesmanDetailVo { + +} diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanGradeVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanGradeVo.java new file mode 100644 index 0000000..7704375 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanGradeVo.java @@ -0,0 +1,17 @@ +package com.matrix.system.fenxiao.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ShopSalesmanGradeVo", description = "返参") +public class ShopSalesmanGradeVo { + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "等级名称") + private String name; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleController.java index 04e7f46..a5a6be2 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleController.java @@ -49,7 +49,7 @@ AjaxResult showList(Article article, PaginationVO pageVo) { article.setType(Dictionary.ARTICEL_TYPE_NAME_SCWZ); SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - article.setShopId(users.getShopId()); + article.setCompanyId(users.getCompanyId()); return showList(currentService, article, pageVo); } @@ -61,7 +61,7 @@ article.setType(Dictionary.ARTICEL_TYPE_NAME_MDXY); SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - article.setShopId(users.getShopId()); + article.setCompanyId(users.getCompanyId()); return showList(currentService, article, pageVo); //return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findInPage(article, pageVo),currentService.findTotal(article)); } @@ -73,7 +73,7 @@ public @ResponseBody AjaxResult queryAll(Article article, PaginationVO pageVo) { article.setType(Dictionary.ARTICEL_TYPE_NAME_WXXMWZ); SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - article.setShopId(users.getShopId()); + article.setCompanyId(users.getCompanyId()); return showList(currentService, article, pageVo); //return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findInPage(article, pageVo),currentService.findTotal(article)); } @@ -99,7 +99,7 @@ @RemoveRequestToken public @ResponseBody AjaxResult addOrModify(Article article) { SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - article.setShopId(users.getShopId()); + article.setCompanyId(users.getCompanyId()); if (article.getId() != null) { return modify(currentService, article, "文章"); } else { diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java index 30443b0..716ebb0 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java @@ -1,16 +1,22 @@ package com.matrix.system.hive.action; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import javax.annotation.Resource; import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.ArticleType; +import com.matrix.system.hive.plugin.message.StringUtil; +import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.service.ArticleTypeService; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -72,7 +78,7 @@ public @ResponseBody AjaxResult queryAll(ArticleType articleType) { SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); articleType.setType(Dictionary.ARTICEL_TYPE_NAME_MDXY); - articleType.setShopId(users.getShopId()); + articleType.setCompanyId(users.getCompanyId()); return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findByModel(articleType), 0); } @@ -110,8 +116,21 @@ articleType.setType(Dictionary.ARTICEL_TYPE_NAME_MDXY); SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); articleType.setShopId(users.getShopId()); - if (articleType.getId() != null) { + articleType.setCompanyId(users.getCompanyId()); + Long parentId = articleType.getParentId(); + List<Long> ids = new ArrayList<>(); + while (parentId != 0) { + ArticleType type = currentService.findById(parentId); + ids.add(type.getId()); + parentId = type.getParentId(); + } + articleType.setParentIds(CollectionUtils.isNotEmpty(ids) ? StringUtils.collToStr(ids, ",") : null); + if (articleType.getId() != null) { + // 自己不能是自己的父节点 + if (articleType.getParentId() != null && articleType.getParentId().equals(articleType.getId())) { + throw new GlobleException("父级不能是自己"); + } return modify(currentService, articleType, "文章类型"); } else { diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/BaseController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/BaseController.java index 28052cf..3a8afed 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/BaseController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/BaseController.java @@ -6,8 +6,6 @@ import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.constance.SystemConstance; -import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.hive.plugin.util.BaseServices; import java.util.List; @@ -75,14 +73,7 @@ } - /** - * 获取当前操作的会员对象 - * @author 姜友瑶 - * @date 2016/7/5 - */ - public SysVipInfo getCurrentVioInfo() { - return (SysVipInfo) (WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER)); - } + } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java index 43aece2..8b46122 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java @@ -33,7 +33,7 @@ @RequestMapping(value = "/showList") public @ResponseBody AjaxResult showList(SysVipLevel vipLevel,PaginationVO pageVo) { SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - vipLevel.setShopId(users.getShopId()); + vipLevel.setCompanyId(users.getCompanyId()); return showList(cardLevelService,vipLevel,pageVo); } /** @@ -43,6 +43,7 @@ public @ResponseBody AjaxResult addOrModify(SysVipLevel vipLevel) { SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); vipLevel.setShopId(users.getShopId()); + vipLevel.setCompanyId(users.getCompanyId()); if (vipLevel.getId() != null) { return modify(cardLevelService, vipLevel, "会员卡信息"); @@ -77,8 +78,6 @@ */ @RequestMapping(value = "/all") public @ResponseBody AjaxResult all(SysVipLevel sysVipLevel) { - SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - sysVipLevel.setShopId(users.getShopId()); return new AjaxResult(AjaxResult.STATUS_SUCCESS, cardLevelService.findByModel(sysVipLevel), null); } } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/CustomerController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/CustomerController.java index 1b8c0b4..80835bf 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/CustomerController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/CustomerController.java @@ -153,7 +153,8 @@ @RequestMapping(value = "/findVipQuestionVipId") public String findVipQuestionVipId(Long id) { //获取会员所有的答案,分类型 - List<Question> questions=questionSerivce.findByVipId(id); + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + List<Question> questions=questionSerivce.findByVipId(id,user.getCompanyId()); WebUtil.getRequest().setAttribute("questions", questions); return "admin/hive/mobile/CRM-account-detail"; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/DepartInfoController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/DepartInfoController.java index 7a5e5d7..eb30467 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/DepartInfoController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/DepartInfoController.java @@ -1,5 +1,6 @@ package com.matrix.system.hive.action; +import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.WebUtil; @@ -58,7 +59,9 @@ public @ResponseBody AjaxResult addOrModify(SysDepartInfo departInfo) { if (departInfo.getId() != null) { - + if (departInfo.getParentId() != null && departInfo.getParentId().equals(departInfo.getId())) { + throw new GlobleException("父级不能是自己"); + } return modify(currentService, departInfo, "部门"); } else { QueryUtil.setQueryLimit(departInfo); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java new file mode 100644 index 0000000..b4f3e25 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java @@ -0,0 +1,101 @@ +package com.matrix.system.hive.action; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.dto.ScoreChangeDto; +import com.matrix.system.score.dao.ScoreUseRecordDao; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.api.dto.ScoreFlowDto; +import com.matrix.system.shopXcx.api.vo.ScoreUseRecordVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @author jyy + * @date 2021-03-22 15:10 + */ +@Api(tags = "用户积分接口类") +@RestController +@RequestMapping(value = "/admin/score") +public class ErpShopScoreAction { + + + + @Autowired + ScoreUseRecordDao scoreUseRecordDao; + + @Autowired + ScoreVipDetailDao scoreVipDetailDao; + + @Autowired + ScoreVipDetailService scoreVipDetailService; + + @Autowired + SysVipInfoDao sysVipInfoDao; + + @ApiOperation(value = "获取积分流水", notes = "") + @PostMapping(value = "/getFlowList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ScoreUseRecordVo.class) + }) + AjaxResult getFlowList(@RequestBody ScoreFlowDto scoreFlowDto) { + SysVipInfo vipInfo = sysVipInfoDao.selectById(scoreFlowDto.getVipId()); + scoreFlowDto.setVipId(vipInfo.getId()); + Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize()); + IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page,scoreFlowDto); + AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords(),shopScoreRecord.getTotal()); + return result; + } + + + + + + @ApiOperation(value = "调整用户积分", notes = "") + @PostMapping(value = "/changeUserScore") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + AjaxResult changeUserScore(@RequestBody @Validated ScoreChangeDto scoreChangeDto) { + SysVipInfo vipInfo = sysVipInfoDao.selectById(scoreChangeDto.getVipId()); + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + if(scoreChangeDto.getAmount()>0){ + scoreVipDetailService.addScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),scoreChangeDto.getAmount(),0L, ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); + }else if (scoreChangeDto.getAmount()<0){ + scoreVipDetailService.deductionScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),Math.abs(scoreChangeDto.getAmount()),0L,ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); + } + AjaxResult result=AjaxResult.buildSuccessInstance("调整成功"); + return result; + } + + + + + + + @ApiOperation(value = "获取用户积分", notes = "") + @PostMapping(value = "/getUserScore/{vipId}") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + AjaxResult getUserScore(@PathVariable Long vipId) { + AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(vipId)); + return result; + } + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/GoodsTypeController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/GoodsTypeController.java index 4348e50..c5ce387 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/GoodsTypeController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/GoodsTypeController.java @@ -1,6 +1,7 @@ package com.matrix.system.hive.action; import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; @@ -47,7 +48,9 @@ AjaxResult addOrModify(SysGoodsType sysGoodsType) { SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); if (sysGoodsType.getId() != null) { - + if (sysGoodsType.getParentId() != null && sysGoodsType.getParentId().equals(sysGoodsType.getId())) { + throw new GlobleException("父级不能是自己"); + } return modify(currentService, sysGoodsType, "产品分类"); } else { diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java index c4c732b..09274b6 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java @@ -1,28 +1,29 @@ package com.matrix.system.hive.action; +import com.matrix.component.asyncmessage.AsyncMessageManager; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.constance.Dictionary; -import com.matrix.system.constance.SystemConstance; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.MoneyCardUseDao; import com.matrix.system.hive.dao.MoneyCardUseFlowDao; -import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.pojo.CzXkVo; import com.matrix.system.hive.service.*; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import com.matrix.system.wechart.templateMsg.UniformMsgParam; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -50,34 +51,30 @@ @Resource private SysVipInfoService vipInfoService; - @Autowired + @Resource private MoneyCardUseFlowDao moneyCardUseFlowDao; - @Autowired + + @Resource private MoneyCardUseDao moneyCardUseDao; + + + @Value("${evn}") + private String evn; + + + @Autowired + private AsyncMessageManager asyncMessageManager; /** * 跳转 充值页面 * * @author jyy */ @RequestMapping(value = "/editFormCz") - public String editFormCz() { - SysVipInfo info = - (SysVipInfo) WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER); - MoneyCardUse cardUseInfo = cardUseService.findByVipId(info.getId()); - + public String editFormCz(Long id) { + MoneyCardUse cardUseInfo = cardUseService.findByVipId(id); if (cardUseInfo == null) { - cardUseInfo = new MoneyCardUse(); - cardUseInfo.setVipId(info.getId()); - cardUseInfo.setCardName("储值卡"); - cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); - cardUseInfo.setRealMoney(0D); - cardUseInfo.setGiftMoney(0D); - cardUseInfo.setSource("-"); - cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); - cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); - moneyCardUseDao.insert(cardUseInfo); + cardUseInfo=vipInfoService.addVipDefaultCard(id); } - WebUtil.getRequest().setAttribute("obj", cardUseInfo); return "admin/hive/beautySalon/cz-form"; } @@ -89,9 +86,15 @@ */ @RequestMapping(value = "/cz") public @ResponseBody - AjaxResult cz(CzXkVo czVo) { + AjaxResult cz(@RequestBody CzXkVo czVo) { SysOrder order= orderService.updateAddCardMoney(czVo); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "充值成功"); + + //发送微信公众号提醒 + UniformMsgParam uniformMsgParam=new UniformMsgParam(order.getCompanyId(),UniformMsgParam.GZH_CZCG); + uniformMsgParam.put("orderId",order.getId()); + asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); + result.putInMap("orderId",order.getId()); return result; } @@ -113,6 +116,10 @@ @RequestMapping(value = "/showCardFlowList") public @ResponseBody AjaxResult showCardFlowList(MoneyCardUseFlow moneyCardUseFlow, PaginationVO pageVo) { + MoneyCardUse vipCard = cardUseService.findByVipId(moneyCardUseFlow.getVipId()); + if (vipCard != null) { + moneyCardUseFlowDao.updateVipCardId(moneyCardUseFlow.getVipId(), vipCard.getId()); + } List<MoneyCardUseFlow> dataList = moneyCardUseFlowDao.selectInPage(moneyCardUseFlow, pageVo); return AjaxResult.buildSuccessInstance(dataList, moneyCardUseFlowDao.selectTotalRecord(moneyCardUseFlow)); } @@ -181,23 +188,14 @@ * @author jyy */ @RequestMapping(value = "/toBj") - public String toBj(Long id, HttpServletRequest request) { + public String toBj(Long id) { // 根据id查到对应的订单信息 SysOrder order = orderService.findById(id); - WebUtil.getRequest().setAttribute("order", order); - SysOrderItem item = new SysOrderItem(); item.setOrderId(order.getId()); - item.setStatus(Dictionary.ORDER_STATU_QK); - order.setItems(orderItemService.findByModel(item)); - - - MoneyCardUse moneyCardUse = new MoneyCardUse(); - moneyCardUse.setVipId(order.getVipId()); - moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); - List<MoneyCardUse> cards = cardUseService.findByModel(moneyCardUse); - - WebUtil.getRequest().setAttribute("cards", cards); + List<SysOrderItem> items = orderItemService.findByModel(item); + order.setItems(items); + WebUtil.getRequest().setAttribute("order", order); return "admin/hive/beautySalon/bj-form"; } @@ -221,13 +219,11 @@ /** * 补交 - * - * @throws GlobleException * @author jyy */ @RequestMapping(value = "/bj") public @ResponseBody - AjaxResult bj(SysOrder order) throws GlobleException { + AjaxResult bj(@RequestBody SysOrder order){ orderService.updateAfterMoney(order); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "补交成功"); @@ -283,9 +279,9 @@ @RequestMapping(value = "/active") public @ResponseBody AjaxResult active(MoneyCardUse moneyCardUse) { - MoneyCardUse proj = moneyCardUseDao.selectById(moneyCardUse.getId()); - String status = proj.getStatus(); - Date failTime = proj.getFailTime(); + MoneyCardUse cardUse = moneyCardUseDao.selectById(moneyCardUse.getId()); + String status = cardUse.getStatus(); + Date failTime = cardUse.getFailTime(); Date today = new Date(); Date newDate = null; newDate = moneyCardUse.getFailTime(); @@ -296,22 +292,33 @@ if (newDate != null && newDate.before(today)) { return new AjaxResult(AjaxResult.STATUS_FAIL, "有效期要大于当前日期"); } - if (newDate == null && failTime.before(today)) { + if (newDate == null && (failTime == null || failTime.before(today))) { //如果是已过期界面会提醒重新设置有效期 return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已过期"); } break; //如果是冻结状态则要算出冻结的天数,延长有效期 case Dictionary.TAOCAN_STATUS_DJ: - MoneyCardUseFreeze freeze = new MoneyCardUseFreeze(); - freeze = moneyCardUseFreezeService.findByMoneyCardUseId(proj.getId()); - proj.setFailTime(DateUtil.nextNDate(failTime, freeze.getGapDays())); + break; default: return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择无效或者冻结的充值卡"); } - proj.setFailTime(moneyCardUse.getFailTime()); - cardUseService.active(proj); + cardUse.setFailTime(moneyCardUse.getFailTime()); + cardUseService.active(cardUse); + + + MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + moneyCardUseFlow.setCarUseId(cardUse.getId()); + moneyCardUseFlow.setVipId(cardUse.getVipId()); + moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY); + moneyCardUseFlow.setCreateTime(new Date()); + moneyCardUseFlow.setOperationId(user.getSuId()); + moneyCardUseFlow.setContent("设置为有效"); + moneyCardUseFlowDao.insert(moneyCardUseFlow); + + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已设置为有效"); } @@ -324,9 +331,9 @@ @RequestMapping(value = "/invalid") public @ResponseBody AjaxResult invalidTc(MoneyCardUse moneyCardUse) { - MoneyCardUse proj = cardUseService.findById(moneyCardUse.getId()); + MoneyCardUse cardUse = cardUseService.findById(moneyCardUse.getId()); //以及转让或者退款的不能在设置为无效 - String status = proj.getStatus(); + String status = cardUse.getStatus(); switch (status) { case Dictionary.TAOCAN_STATUS_TK: return new AjaxResult(AjaxResult.STATUS_FAIL, "充值卡已退款"); @@ -335,7 +342,16 @@ case Dictionary.TAOCAN_STATUS_DJ: return new AjaxResult(AjaxResult.STATUS_FAIL, "充值卡已冻结"); } - cardUseService.invalid(proj); + cardUseService.invalid(cardUse); + MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + moneyCardUseFlow.setCarUseId(cardUse.getId()); + moneyCardUseFlow.setVipId(cardUse.getVipId()); + moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY); + moneyCardUseFlow.setCreateTime(new Date()); + moneyCardUseFlow.setOperationId(user.getSuId()); + moneyCardUseFlow.setContent("设置为无效"); + moneyCardUseFlowDao.insert(moneyCardUseFlow); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已设置为无效"); } @@ -366,63 +382,25 @@ public @ResponseBody AjaxResult freeze(MoneyCardUse moneyCardUse) { int i = cardUseService.freeze(moneyCardUse); + cardUseService.invalid(moneyCardUse); + + MoneyCardUse cardUse = cardUseService.findById(moneyCardUse.getId()); + MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + moneyCardUseFlow.setCarUseId(cardUse.getId()); + moneyCardUseFlow.setVipId(cardUse.getVipId()); + moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY); + moneyCardUseFlow.setCreateTime(new Date()); + moneyCardUseFlow.setOperationId(user.getSuId()); + moneyCardUseFlow.setContent("冻结会员卡"); + moneyCardUseFlowDao.insert(moneyCardUseFlow); if (i > 0) { return new AjaxResult(AjaxResult.STATUS_SUCCESS, "冻结成功"); } return new AjaxResult(AjaxResult.STATUS_FAIL, "冻结失败"); } - /** - * 退款 - * - * @return - */ - @RequestMapping(value = "getEffectCard") - public @ResponseBody - AjaxResult getEffectCard(MoneyCardUse moneyCardUse) { - AjaxResult result = AjaxResult.buildSuccessInstance(""); - //要退款的充值卡 - MoneyCardUse srcCardUse = cardUseService.findById(moneyCardUse.getId()); - if (!srcCardUse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX)) { - throw new GlobleException("不是有效充值卡"); - } - //该会员是否有有效会籍卡 - MoneyCardUse targetCardUse = cardUseService.findByVipId(moneyCardUse.getVipId()); - double money = srcCardUse.getRealMoney(); - if (targetCardUse != null) { - targetCardUse.setRealMoney(money); - List<MoneyCardUse> list = Arrays.asList(targetCardUse); - if (targetCardUse.getId().equals(srcCardUse.getId())) { - result.setInfo("会籍卡退款只能退现金"); - result.setRows(list); - - } else { - result.setInfo("有有效会籍卡"); - result.setRows(list); - } - } else { - //无会员卡则new一个,为了把钱传递到前台 - targetCardUse = new MoneyCardUse(); - targetCardUse.setRealMoney(money); - List<MoneyCardUse> list1 = Arrays.asList(targetCardUse); - result.setInfo("无有效会籍卡,退现金"); - result.setRows(list1); - } - return result; - } - - @RequestMapping(value = "/returnMoney") - public @ResponseBody - AjaxResult returnMoney(MoneyCardUse moneyCardUse, Long hjkId, String tcRemark, Long - shopId, Double money - , String tcName) { - int i = cardUseService.returnMoney(moneyCardUse, hjkId); - if (i > 0) { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); - } - return new AjaxResult(AjaxResult.STATUS_FAIL, "冻结失败"); - } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/OccupancyController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/OccupancyController.java index 1a3d742..b08b15a 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/OccupancyController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/OccupancyController.java @@ -12,6 +12,7 @@ import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.service.SysWorkBeatuistaffService; import com.matrix.system.hive.service.SysWorktimeService; +import io.swagger.annotations.ApiModelProperty; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -51,13 +52,19 @@ @RequestMapping(value = "/getKanban") public @ResponseBody AjaxResult showCwzyList(String timeStr) { + Long shopId = getMe().getShopId(); + return getCwzyList(timeStr,shopId); + } + + public AjaxResult getCwzyList(String timeStr,Long shopId){ + if (timeStr == null || timeStr.equals("")) { timeStr = DateUtil.dateToString(new Date(), "yyyy-MM-dd"); } // 查询上班下班的最大时间段 Date currentDate = DateUtil.stringToDate(timeStr, DateUtil.DATE_FORMAT_DD); // 把日期调整为当前查询日期 - Long shopId = 16L; //getMe().getShopId(); + Date maxTime = worktimeService.findMaxTime(shopId); //如果没有获取到门店的排班时间,无法查询占用情况 @@ -146,8 +153,7 @@ //计算表头的时间间隔 buildTimeSpan(startTime, maxTime, result); - - return result; + return result; } private void buildTimeSpan(Date startTime, Date maxTime, AjaxResult result) { @@ -233,7 +239,7 @@ } } - class OccupancySPan { + public class OccupancySPan { /** * 休息 */ @@ -247,12 +253,19 @@ */ static final int WORKTYPE_OCCUPANCY = 3; + @ApiModelProperty(value = "色块长度") Long spanLength; + @ApiModelProperty(value = "占用状态,1休息,2 上班,3 占用") int workType; + @ApiModelProperty(value = "床位名称") String bedName; + @ApiModelProperty(value = "项目名称") String projName; + @ApiModelProperty(value = "会员名称") String vipName; + @ApiModelProperty(value = "服务单id") Long serviceId; + @ApiModelProperty(value = "服务单状态") String serviceState; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java index 550f9ab..68cd634 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java @@ -1,5 +1,8 @@ package com.matrix.system.hive.action; +import cn.hutool.core.collection.CollUtil; +import com.matrix.component.asyncmessage.AsyncMessageManager; +import com.matrix.component.rabbitmq.RabiitMqTemplate; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; @@ -10,27 +13,22 @@ import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelUtil; import com.matrix.core.tools.excl.ExcelVersion; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.dao.SysCompanyDao; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.constance.Dictionary; -import com.matrix.system.constance.SystemConstance; -import com.matrix.system.hive.action.util.QueryUtil; -import com.matrix.system.hive.bean.AchieveNew; -import com.matrix.system.hive.bean.MoneyCardUse; -import com.matrix.system.hive.bean.SysOrder; -import com.matrix.system.hive.bean.SysOrderItem; -import com.matrix.system.hive.dao.MoneyCardUseDao; -import com.matrix.system.hive.dao.SysOrderDao; -import com.matrix.system.hive.dao.SysOrderItemDao; -import com.matrix.system.hive.dao.SysShopInfoDao; -import com.matrix.core.tools.DateUtil; -import com.matrix.system.hive.pojo.ShoppingCarItem; -import com.matrix.system.hive.pojo.ShoppingCarItemsVo; -import com.matrix.system.hive.service.AchieveNewService; -import com.matrix.system.hive.service.MoneyCardUseService; -import com.matrix.system.hive.service.SysOrderItemService; -import com.matrix.system.hive.service.SysOrderService; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.*; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.hive.service.*; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import com.matrix.system.wechart.templateMsg.UniformMsgParam; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.ModelMap; @@ -38,6 +36,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -61,6 +60,11 @@ public class OrderController extends BaseController { @Resource private SysOrderService orderService; + @Autowired + ShoppingGoodsDao shoppingGoodsDao; + + @Autowired + private CodeService codeService; @Autowired private SysOrderItemDao orderItemDao; @@ -83,6 +87,27 @@ @Autowired SysShopInfoDao shopInfoDao; + @Autowired + private SysVipInfoService sysVipInfoService; + + @Autowired + private SysOrderFlowService sysOrderFlowService; + + @Autowired + private SysOrderFlowDao sysOrderFlowDao; + + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + private SysProjServicesDao sysProjServicesDao; + + @Autowired + private AsyncMessageManager asyncMessageManager; + + @Value("${evn}") + private String evn; /** * 计算订单金额 @@ -101,7 +126,7 @@ total = total.add(new BigDecimal(item.getPrice() * item.getCount())); } SysOrder sysOrderResult = new SysOrder(); - sysOrderResult.setZkTotal(zkTotal.doubleValue()); + sysOrderResult.setZkTotal(zkTotal.setScale(2, BigDecimal.ROUND_DOWN).doubleValue()); sysOrderResult.setTotal(total.doubleValue()); return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrderResult)); @@ -117,17 +142,45 @@ AjaxResult payOrder(@RequestBody SysOrder sysOrder) { SysUsers user = getMe(); sysOrder.setShopId(user.getShopId()); + sysOrder.setOrderType(SysOrder.ORDER_TYPE_SEAL); + sysOrder.setIsHasRefund(SysOrder.IS_HAS_REFUND_N); //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 sysOrder = orderService.checkAndSaveOrder(sysOrder); orderService.updateReceiptMoney(sysOrder); + + //发送微信公众号提醒 + UniformMsgParam uniformMsgParam = new UniformMsgParam(user.getCompanyId(), UniformMsgParam.GZH_GMCG); + uniformMsgParam.put("orderId", sysOrder.getId()); + asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); + + //处理用户购买的产品 return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrder), "订单结算成功"); } - - - + /** + * 退款 + * + * @param sysOrder + * @return + */ + @RequestMapping(value = "/refundOrder") + @ResponseBody + public AjaxResult refundOrder(@RequestBody SysOrder sysOrder) { + //储值卡订单不能通过退款渠道退款 + if (CollectionUtils.isNotEmpty(sysOrder.getItems())) { + List<SysOrderItem> orderItem = orderItemService.findByOrderId(sysOrder.getItems().get(0).getOrderId()); + if (orderItem.size() == 1) { + if (orderItem.get(0).getShoppingGoods().getCode().equals("vipCzk")) { + return AjaxResult.buildFailInstance("充值订单请直接冲负数金额退款!"); + } + } + } + orderService.refundOrderMoney(sysOrder); + //处理用户购买的产品 + return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrder), "订单退款成功"); + } /** @@ -147,48 +200,6 @@ /** - * 新建订单 - * - * @author jiangyouyao - */ - @RequestMapping(value = "/addOrder") - public @ResponseBody - AjaxResult addOrder(ShoppingCarItemsVo car) { - - List<ShoppingCarItem> sessionCarItems = (List<ShoppingCarItem>) WebUtil.getSession().getAttribute( - SystemConstance.SHOPPING_CAR); - - List<ShoppingCarItem> carItems = new ArrayList<>(); - - // 设置购车中的具体类型信息,过滤没有被选中的商品 - for (ShoppingCarItem carItem : car.getCarItems()) { - - for (ShoppingCarItem sessionCar : sessionCarItems) { - - if (carItem.getId().equals(sessionCar.getId())) { - //已最后提交的数量为准 - sessionCar.setCount(carItem.getCount()); - carItems.add(sessionCar); - break; - } - } - } - //设置过滤后的购物车条目 - car.setCarItems(carItems); - - // 添加新订单 - int i = orderService.createOrder(WebUtil.getSession(), car); - - if (i > 0) { - WebUtil.getSession().removeAttribute(SystemConstance.SHOPPING_CAR); - return new AjaxResult(AjaxResult.STATUS_SUCCESS, "下单成功"); - } else { - return new AjaxResult(AjaxResult.STATUS_FAIL, "下单添加失败"); - } - } - - - /** * 列表显示 */ @RequestMapping(value = "/showList") @@ -201,7 +212,9 @@ if (StringUtils.isBlank(pageVo.getOrder())) { pageVo.setOrder("desc"); } - sysOrder.setShopId(getMe().getShopId()); + if (!DataAuthUtil.hasAllShopAuth()) { + sysOrder.setShopId(getMe().getShopId()); + } return new AjaxResult(AjaxResult.STATUS_SUCCESS, orderService.findInPage(sysOrder, pageVo), orderService.findTotal(sysOrder)); } @@ -216,11 +229,31 @@ return showList(sysOrder, pageVo); } + @Resource + SysCompanyDao companyDao; /** * 收款 */ - @RequestMapping(value = "sk") + @RequestMapping(value = "/printOrder") + public @ResponseBody + ModelAndView printOrder(SysOrder order) throws GlobleException { + ModelAndView mv = new ModelAndView("admin/hive/beautySalon/print-order"); + SysUsers user = getMe(); + String comRegisterCode = companyDao.selectById(user.getCompanyId()).getComRegisterCode(); + if (StringUtils.isNotBlank(comRegisterCode)) { + mv.addObject("page", comRegisterCode); + } else { + mv.addObject("page", "taiyan"); + } + return mv; + } + + + /** + * 收款 + */ + @RequestMapping(value = "/sk") public @ResponseBody AjaxResult sk(SysOrder order) throws GlobleException { orderService.updateReceiptMoney(order); @@ -235,13 +268,17 @@ public @ResponseBody AjaxResult updateOrderTime(SysOrder sysOrder) { - sysOrderDao.updateOrderTime(sysOrder.getOrderTime(), sysOrder.getId()); + sysOrderDao.updateOrderTime(sysOrder.getPayTime(), sysOrder.getId()); // 修改业绩时间 // 更新业绩时间 AchieveNew achieveNew = new AchieveNew(); achieveNew.setOrderId(sysOrder.getId()); - achieveNew.setDatatime(sysOrder.getOrderTime()); + achieveNew.setDatatime(sysOrder.getPayTime()); achieveNewService.modifyAchieveTime(achieveNew); + //更新收款流水时间 + sysOrderFlowDao.updateTimeByOrderId(sysOrder.getId(), sysOrder.getPayTime()); + + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); } @@ -258,16 +295,7 @@ MoneyCardUse cardUseInfo = cardUseService.findByVipId(order.getVipId()); if (cardUseInfo == null) { - cardUseInfo = new MoneyCardUse(); - cardUseInfo.setVipId(order.getVipId()); - cardUseInfo.setCardName("储值卡"); - cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); - cardUseInfo.setRealMoney(0D); - cardUseInfo.setGiftMoney(0D); - cardUseInfo.setSource("-"); - cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); - cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); - moneyCardUseDao.insert(cardUseInfo); + cardUseInfo = sysVipInfoService.addVipDefaultCard(order.getVipId()); } //打印需求加入门店信息 @@ -277,7 +305,6 @@ //查询会有所有有效的会员卡 result.putInMap("totalMoney", moneyCardUseDao.selectVipCardTotalMoney(order.getVipId())); - return result; @@ -353,6 +380,48 @@ return "admin/hive/beautySalon/point-order"; } + @RequestMapping(value = "/findOrderDetailByIdOrNo") + @ResponseBody + public AjaxResult findOrderDetailByIdOrNo(SysOrder orderVo) { + // 根据id查到对应的订单信息 + SysOrder order = null; + if (orderVo.getId() != null) { + order = orderService.findById(orderVo.getId()); + } else if (StringUtils.isNotBlank(orderVo.getOrderNo())) { + List<SysOrder> byModel = orderService.findByModel(orderVo); + if (byModel.size() == 1) { + order = orderService.findById(byModel.get(0).getId()); + } + } + List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(order.getId()); + order.setItems(sysOrderItems); + + SysVipInfo vipInfo = sysVipInfoService.findById(order.getVipId()); + // 根据会员Id查到会员有效的会员卡 + // 根据订单号查找订单条目 + List<SysOrderItem> orderItems = orderItemService.findByOrderId(order.getId()); + + MoneyCardUse moneyCardUse = new MoneyCardUse(); + moneyCardUse.setVipId(order.getVipId()); + List<MoneyCardUse> cards = cardUseService.findByModel(moneyCardUse); + + List<SysOrderFlow> flows = sysOrderFlowService.findByOrderId(order.getId()); + order.setFlows(flows); + + List<SysOrderFlow> payMethods = sysOrderFlowService.findPayMethodsAmount(order.getId()); + + List<AchieveNew> achieveList = achieveNewService.findOrderItemAchieve(order.getId()); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("orderItems", orderItems); + ajaxResult.putInMap("order", order); + ajaxResult.putInMap("cards", cards); + ajaxResult.putInMap("vipInfo", vipInfo); + ajaxResult.putInMap("payMethods", payMethods); + ajaxResult.putInMap("achieveList", achieveList); + return ajaxResult; + } + /** * 跳转 消费流水详情页面 * @@ -360,32 +429,14 @@ */ @RequestMapping(value = "/orderItem") public String orderItem(SysOrder orderVo) { - // 根据id查到对应的订单信息 - SysOrder order=null; - if(orderVo.getId()!=null){ - order = orderService.findById(orderVo.getId()); - }else if(StringUtils.isNotBlank(orderVo.getOrderNo())){ - List<SysOrder> byModel = orderService.findByModel(orderVo); - if(byModel.size()==1){ - order=orderService.findById(byModel.get(0).getId()); - } - } - List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(order.getId()); - order.setItems(sysOrderItems); - WebUtil.getRequest().setAttribute("order", order); - // 根据会员Id查到会员有效的会员卡 - // 根据订单号查找订单条目 - SysOrderItem orderItem = new SysOrderItem(); - orderItem.setOrderId(order.getId()); - List<SysOrderItem> orderItems = orderItemService.findByModel(orderItem); - WebUtil.getRequest().setAttribute("orderItems", orderItems); - - MoneyCardUse moneyCardUse = new MoneyCardUse(); - moneyCardUse.setVipId(order.getVipId()); - List<MoneyCardUse> cards = cardUseService.findByModel(moneyCardUse); - - WebUtil.getRequest().setAttribute("cards", cards); + if (orderVo.getId() != null) { + WebUtil.getRequest().setAttribute("orderParam", orderVo.getId()); + WebUtil.getRequest().setAttribute("orderId", orderVo.getId()); + } else if (StringUtils.isNotBlank(orderVo.getOrderNo())) { + WebUtil.getRequest().setAttribute("orderParam", orderVo.getOrderNo()); + WebUtil.getRequest().setAttribute("orderNo", orderVo.getOrderNo()); + } return "admin/hive/beautySalon/orderXq-form"; } @@ -399,6 +450,38 @@ } //=======================================页面转发END================================== + /** + * 2021-08-20 新增:erp系统取消订单接口,不做订单状态校验 + * 取消订单 + */ + @Transactional(rollbackFor = Exception.class) + @RequestMapping(value = "/erpCancelOrder") + public @ResponseBody + AjaxResult erpCancelOrder(Long id) { + + AjaxResult result = new AjaxResult(); + SysOrder order = orderService.findById(id); + if (order == null) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "订单不存在!"); + } + + List<SysOrderItem> items = orderItemDao.selectByOrderId(id); + for (SysOrderItem item : items) { + List<SysProjServices> sysProjServices = sysProjServicesDao.selectProjServicesByOrderItemId(item.getId()); + if (CollUtil.isNotEmpty(sysProjServices)) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "订单存在进行中的服务单无法取消/删除"); + } + } + + orderService.cancelOrder(id); + + result.setInfo("取消成功!"); + + result.setStatus(AjaxResult.STATUS_SUCCESS); + + return result; + } + /** * 取消订单 @@ -408,21 +491,15 @@ public @ResponseBody AjaxResult cancelOrder(Long id, Integer del) { - AjaxResult result = new AjaxResult(); SysOrder order = orderService.findById(id); - if (order == null) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "订单不存在!"); + BusParameterSettings shopManageAbleCancelDfkOrder = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER, order.getCompanyId()); + if (StringUtils.isNotBlank(shopManageAbleCancelDfkOrder.getParamValue()) + && shopManageAbleCancelDfkOrder.getParamValue().equals(Dictionary.FLAG_YES)) { + if (!Dictionary.ORDER_STATU_DFK.equals(order.getStatu())) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "您只能取消待付款订单"); + } } - orderService.cancelOrder(id); - if (del > 0) { - orderService.removeById(id); - result.setInfo("删除成功!"); - } else { - result.setInfo("取消成功!"); - } - result.setStatus(AjaxResult.STATUS_SUCCESS); - - return result; + return erpCancelOrder(id); } @RequestMapping(value = "/exportExcel") @@ -440,17 +517,16 @@ */ @RequestMapping(value = "/erpExportExcel") public void erpExportExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response, - SysOrder sysOrder) throws Exception { + SysOrder sysOrder) throws Exception { doExportOrder(response, sysOrder); return; } - - /** * 执行订单导出,总部和门店共用,但是搜索条件不一样 + * * @param response * @param sysOrder * @throws IOException diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java index 73cdcf9..020b110 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java @@ -1,5 +1,8 @@ package com.matrix.system.hive.action; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.matrix.core.anotations.RemoveRequestToken; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; @@ -12,23 +15,29 @@ import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelUtil; import com.matrix.core.tools.excl.ExcelVersion; +import com.matrix.system.app.dto.IdSubmitDto; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.dao.SysCompanyDao; import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.*; -import com.matrix.core.tools.DateUtil; -import com.matrix.system.hive.pojo.TaoCanVo; +import com.matrix.system.hive.dto.ServiceOrderTimeDto; import com.matrix.system.hive.service.*; +import com.matrix.system.hive.vo.ServiceOrderInfoVo; +import io.swagger.annotations.ApiOperation; import org.apache.commons.collections.CollectionUtils; -import org.jsoup.helper.DataUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -36,7 +45,9 @@ import java.io.IOException; import java.io.OutputStream; import java.net.URLEncoder; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** @@ -111,6 +122,33 @@ } //补充服务单扩展信息=============== List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(id); + if (CollUtil.isNotEmpty(beauticianStateList)) { + for (SysBeauticianState sysBeauticianState : beauticianStateList) { + SysProjUse item = sysBeauticianState.getProjUse(); + + // 若项目/套餐无效,则打印时,不显示余次 + if (!"无效".equals(item.getStatus())) { + item.setRemainCount(item.getSurplusCount()); + } else { + item.setRemainCount(null); + } + + if (sysBeauticianState.getProjUse().getTaocanId() != null) { + SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getProjUse().getTaocanId()); + if (!"无效".equals(sysProjUse.getStatus())) { + item.setRemainCount(sysProjUse.getSurplusCount()); + } else { + item.setRemainCount(null); + } + + sysBeauticianState.getProjInfo().setName(sysProjUse.getProjName()+"--"+sysBeauticianState.getProjInfo().getName()); + if ("Y".equals(sysProjUse.getIsCourse()) && "Y".equals(sysProjUse.getIsInfinite())) { + int count = projUseService.findTaocanCountForCourseAndInfinite(sysBeauticianState.getProjUse().getTaocanId(), projServices.getVipId()); + item.setRemainCount(count); + } + } + } + } projServices.setServiceItems(beauticianStateList); SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId()); projServices.setBedState(sysBedState); @@ -124,6 +162,20 @@ result.setStatus(AjaxResult.STATUS_SUCCESS); return result; + } + + /** + * 根据id查询服务单简单信息 + */ + @RequestMapping(value = "/findServiceOrderInfoVo/{id}") + public @ResponseBody + AjaxResult findServiceOrderInfoVo(@PathVariable Long id) { + // 获取服务单信息 + SysProjServices projServices = sysProjServicesService.findById(id); + + ServiceOrderInfoVo serviceOrderInfoVo= BeanUtil.copyProperties(projServices,ServiceOrderInfoVo.class); + + return AjaxResult.buildSuccessInstance(serviceOrderInfoVo); } @@ -140,7 +192,9 @@ if (StringUtils.isBlank(pageVo.getOrder())) { pageVo.setOrder("desc"); } - projService.setShopId(getMe().getShopId()); + if (!DataAuthUtil.hasAllShopAuth()) { + projService.setShopId(getMe().getShopId()); + } List<SysProjServices> dataList = projServicesSerivce.findInPage(projService, pageVo); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, projServicesSerivce.findTotal(projService)); return result; @@ -180,24 +234,17 @@ AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); SysProjUse queryUse = new SysProjUse(); - if(Objects.nonNull(vipId)){ - queryUse.setVipId(vipId); - }else{ - SysVipInfo vipInfo = getCurrentVioInfo(); - queryUse.setVipId(vipInfo.getId()); - } - + queryUse.setVipId(vipId); queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); queryUse.setTaocanId(-1L); queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); - queryUse.setIsOver(Dictionary.FLAG_NO_N); List<SysProjUse> projList = projUseService.findInPage(queryUse, null); //切换到套餐查询条件 queryUse.setTaocanId(null); queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null); taoCanList.forEach(item->{ - item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId())); + item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus())); item.setProjInfo(shoppingGoodsDao.selectById(item.getProjId())); }); result.putInMap("projList", projList); @@ -276,6 +323,7 @@ return "admin/hive/beautySalon/yypb-form"; } + /** * 进入预约排班详情 * @@ -306,6 +354,16 @@ //补充服务单扩展信息=============== List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); + if (CollUtil.isNotEmpty(beauticianStateList)) { + for (SysBeauticianState sysBeauticianState : beauticianStateList) { + if (sysBeauticianState.getProjUse().getTaocanId() != null) { + SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getProjUse().getTaocanId()); + if(sysProjUse != null) { + sysBeauticianState.getProjInfo().setName(sysProjUse.getProjName() + "--" + sysBeauticianState.getProjInfo().getName()); + } + } + } + } projServices.setServiceItems(beauticianStateList); SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId()); @@ -369,6 +427,17 @@ } } + @ApiOperation(value = "确认服务", notes = "确认服务") + @PostMapping(value = "/confirmServiceOrder") + public @ResponseBody AjaxResult confirmServiceOrder(Long id) { + int i=sysProjServicesService.confirmServiceOrder(id); + if(i>0){ + return AjaxResult.buildSuccessInstance("确认成功"); + } + return AjaxResult.buildFailInstance("确认失败"); + } + + /** * @author jiangyouyao @@ -393,13 +462,12 @@ */ @RequestMapping(value = "/updateOrderTime") public @ResponseBody - AjaxResult updateOrderTime(SysProjServices serviceQuery) { - SysProjServices services = sysProjServicesDao.selectById(serviceQuery.getId()); - sysProjServicesDao.updateOrderTime(serviceQuery.getCreateTime(), serviceQuery.getId()); + AjaxResult updateOrderTime(@RequestBody ServiceOrderTimeDto serviceOrderTimeDto) { + sysProjServicesDao.updateOrderTime(serviceOrderTimeDto); // 更新业绩时间 AchieveNew achieveNew = new AchieveNew(); - achieveNew.setServiceOrderId(serviceQuery.getId()); - achieveNew.setDatatime(serviceQuery.getCreateTime()); + achieveNew.setServiceOrderId(serviceOrderTimeDto.getId()); + achieveNew.setDatatime(serviceOrderTimeDto.getConsumeTime()); achieveNewService.modifyAchieveTime(achieveNew); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); } @@ -425,6 +493,25 @@ return new AjaxResult(AjaxResult.STATUS_SUCCESS, "成功"); } + @Autowired + private SysCompanyDao sysCompanyDao; + + /** + * 服务单打印 + */ + @RequestMapping(value = "/printOrder") + public @ResponseBody + ModelAndView printOrder() throws GlobleException { + ModelAndView mv = new ModelAndView("admin/hive/beautySalon/print-service"); + SysUsers user=(SysUsers)WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String comRegisterCode = sysCompanyDao.selectById(user.getCompanyId()).getComRegisterCode(); + if(StringUtils.isNotBlank(comRegisterCode)){ + mv.addObject("page",comRegisterCode); + }else { + mv.addObject("page","taiyan"); + } + return mv; + } /** * 根据id对服务单进行派单 @@ -441,12 +528,33 @@ } } + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + /** * 根据id取消预约 */ @RequestMapping(value = "/cancelOrder") public @ResponseBody AjaxResult cancelOrder(SysProjServices services) { + + SysProjServices checkProjServices = sysProjServicesDao.selectById(services.getId()); + BusParameterSettings shopManageAbleCancelDfkOrder = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER, checkProjServices.getCompanyId()); + if (StringUtils.isNotBlank(shopManageAbleCancelDfkOrder.getParamValue()) + && shopManageAbleCancelDfkOrder.getParamValue().equals(Dictionary.FLAG_YES)) { + if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY) + && !checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DQR)) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "您只能取消待预约订单"); + } + } + return erpCancelOrder(services); + } + /** + * 根据id取消预约 + */ + @RequestMapping(value = "/erpCancelOrder") + public @ResponseBody + AjaxResult erpCancelOrder(SysProjServices services) { int i = sysProjServicesService.modifyCancelProjServices(services); if (i > 0) { return new AjaxResult(AjaxResult.STATUS_SUCCESS, "取消预约成功"); @@ -454,7 +562,6 @@ return new AjaxResult(AjaxResult.STATUS_FAIL, "取消预约失败"); } } - /** * 设置服务单划扣成功 @@ -479,8 +586,7 @@ @RequestMapping(value = "/addService") public @ResponseBody AjaxResult servicceAdd(@RequestBody SysProjServices sysProjServices) { - SysVipInfo vipInfo = getCurrentVioInfo(); - sysProjServices.setVipId(vipInfo.getId()); + if (CollectionUtils.isEmpty(sysProjServices.getServiceItems())) { return new AjaxResult(AjaxResult.STATUS_FAIL, "没有选中可消耗的项目"); @@ -494,6 +600,9 @@ VerifyResult balanceverifyResult = sysProjServicesService.checkBalance(sysProjServices); if (balanceverifyResult.isError()) { return new AjaxResult(AjaxResult.STATUS_FAIL, balanceverifyResult.getMsg()); + } + if (StrUtil.isEmpty(sysProjServices.getState())) { + sysProjServices.setState(Dictionary.SERVICE_STATU_DYY); } SysProjServices newSysProjServices = sysProjServicesService.addSysProjServices(sysProjServices); if (newSysProjServices != null) { @@ -509,8 +618,8 @@ @RequestMapping(value = "/addServiceForForm") public @ResponseBody AjaxResult servicceAddForForm(SysProjServices sysProjServices) { - SysVipInfo vipInfo = getCurrentVioInfo(); - sysProjServices.setVipId(vipInfo.getId()); + + if (CollectionUtils.isEmpty(sysProjServices.getServiceItems())) { return new AjaxResult(AjaxResult.STATUS_FAIL, "没有选中可消耗的项目"); @@ -549,6 +658,26 @@ } + @RequestMapping(value = "/addServiceProj") + @ResponseBody + public AjaxResult addServiceProj(SysProjServices sysProjServices) { + + return AjaxResult.buildSuccessInstance("保存成功"); + } + + /** + * 删除服务单项目/套餐 + * @param id + * @return + */ + @RequestMapping(value = "/delServiceOrderItems") + @ResponseBody + public AjaxResult delServiceOrderItems(Long id) { + sysProjServicesService.deleteProjServiceItemById(id); + return AjaxResult.buildSuccessInstance("删除成功"); + } + + // 准备页面数据 private void pageDate() { // 根据岗位名称查询员工 diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjTypeController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjTypeController.java index 20b81ff..15abb61 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjTypeController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjTypeController.java @@ -25,13 +25,8 @@ @RequestMapping(value = "/admin/projtype") public class ProjTypeController extends BaseController { - @Resource private SysProjTypeService currentService; - - - - public static final String fnCode = "projType"; public static final String search = fnCode + ":search"; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java index 375256d..a8f8c09 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java @@ -4,28 +4,23 @@ import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.DateUtil; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.StringUtils; -import com.matrix.core.tools.WebUtil; +import com.matrix.core.tools.*; import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelUtil; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.MoneyCardUse; -import com.matrix.system.hive.bean.ShoppingGoods; -import com.matrix.system.hive.bean.SysProjUse; -import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.MoneyCardUseDao; import com.matrix.system.hive.dao.ShoppingGoodsDao; import com.matrix.system.hive.dao.SysProjUseDao; import com.matrix.system.hive.dao.SysVipInfoDao; -import com.matrix.system.hive.plugin.message.StringUtil; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.service.MoneyCardUseService; import com.matrix.system.hive.service.SysProjUseService; import com.matrix.system.hive.service.SysProjuseFreezeService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; @@ -60,6 +55,25 @@ @Resource private MoneyCardUseService moneyCardUseService; + @Resource + private SysProjUseDao projUseDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + ShoppingGoodsDao shoppingGoodsDao; + + @Autowired + MoneyCardUseDao moneyCardUseDao; + + @Value("${default.vip.photo.woman}") + String defaultWoman; + + @Value("${default.vip.photo.man}") + String defaultman; + + public static final String fnCode = "projUse"; public static final String search = fnCode + ":search"; @@ -85,6 +99,18 @@ projUseService.findInPage(sysProjUse, pageVo), projUseService.findTotal(sysProjUse)); } + /** + * 查看会员项目使用情况 + * + * @author jiangyouyao + * @date 2016-09-03 + */ + @RequestMapping(value = "/findProjUseFlow") + public @ResponseBody + AjaxResult findProjUseFlow(PaginationVO pageVo, SysProjUseFlow projUseFlow) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, + projUseDao.selectProjUseFlow(projUseFlow, pageVo), projUseDao.selectProjUseFlowTotal(projUseFlow)); + } /** * 将项目设置为有效 @@ -139,21 +165,7 @@ return new AjaxResult(AjaxResult.STATUS_FAIL, "项目转让失败"); } - @RequestMapping(value = "/returnProj") - public @ResponseBody - AjaxResult returnTc(SysProjUse sysProjUse, Long moneyCardUseId, String tcRemark, Long shopId, Double money, String tcName) { - MoneyCardUse card = null; - if (moneyCardUseId != null) { - card = moneyCardUseService.findById(moneyCardUseId); - } - int i = projUseService.returnMoneyProj(sysProjUse, card, moneyCardUseId); - if (i > 0) { - - return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); - } - return new AjaxResult(AjaxResult.STATUS_FAIL, "退款失败"); - } /** @@ -174,31 +186,6 @@ } - /** - * 退款 - * - * @return - */ - @RequestMapping(value = "/getEffectCard") - public @ResponseBody - AjaxResult getEffectCard(SysProjUse sysProjUse) { - MoneyCardUse cardUse = moneyCardUseService.findByVipId(sysProjUse.getVipId()); - double money = projUseService.getTotalMoneyProj(sysProjUse); - if (cardUse != null) { - cardUse.setRealMoney(money); - List<MoneyCardUse> list = new ArrayList<MoneyCardUse>(); - list.add(cardUse); - return new AjaxResult(AjaxResult.STATUS_SUCCESS, null, "有有效会籍卡", list, null); - } else { - //无会员卡则new一个,为了把钱传递到前台 - cardUse = new MoneyCardUse(); - cardUse.setRealMoney(money); - List<MoneyCardUse> list = new ArrayList<MoneyCardUse>(); - list.add(cardUse); - return new AjaxResult(AjaxResult.STATUS_SUCCESS, null, "无有效会籍卡", list, null); - } - - } /** * 冻结会员项目 @@ -217,10 +204,29 @@ /** * 添加或修改会员項目信息 */ + @Transactional @RequestMapping(value = "/addOrModify") public @ResponseBody AjaxResult addOrModify(SysProjUse sysProjUse) { if (sysProjUse.getId() != null) { + SysUsers user=getMe(); + //插入修改记录 + SysProjUse oldProjUse = projUseService.findById(sysProjUse.getId()); + SysProjUseFlow projUseFlow=new SysProjUseFlow(); + projUseFlow.setProjUseId(sysProjUse.getId()); + projUseFlow.setOptionType("人工修改"); + projUseFlow.setProjName(oldProjUse.getProjName()); + projUseFlow.setCreateBy(user.getSuName()); + projUseFlow.setUpdateBy(user.getSuName()); + projUseFlow.setPrice(sysProjUse.getPrice()); + projUseFlow.setStatus(sysProjUse.getStatus()); + projUseFlow.setBalance(sysProjUse.getBalance()); + projUseFlow.setFailTime(sysProjUse.getFailTime()); + projUseFlow.setIsOver(sysProjUse.getIsOver()); + projUseFlow.setRemark(sysProjUse.getUpdateRemark()); + projUseFlow.setSurplusCount(sysProjUse.getSurplusCount()); + projUseDao.insertFlow(projUseFlow); + return modify(projUseService, sysProjUse, "项目"); } else { return add(projUseService, sysProjUse, "项目"); @@ -228,17 +234,7 @@ } - @Autowired - SysVipInfoDao vipInfoDao; - @Autowired - ShoppingGoodsDao shoppingGoodsDao; - - @Autowired - SysProjUseDao projUseDao; - - @Autowired - MoneyCardUseDao moneyCardUseDao; @RequestMapping(value = "/importProjUse") @@ -247,8 +243,8 @@ public AjaxResult importVipInfo(HttpServletResponse response, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { String fileName = file.getOriginalFilename(); - String dirPath = "E:"; - //PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); +// String dirPath = "E:"; + String dirPath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); File saveFile = new File(dirPath + "/" + fileName); file.transferTo(saveFile); @@ -257,7 +253,7 @@ List<ExcelSheetPO> excelSheetPOList = ExcelUtil.readExcel(saveFile, null, null); -/* + //项目资料导入 List<List<Object>> dataList = excelSheetPOList.get(0).getDataList(); List<SysProjUse> projUseList = new ArrayList<>(); @@ -282,7 +278,7 @@ List<Object> objects = taocanDataList.get(j); LogUtil.info("导入套餐第" + j + "行" + objects); Object vipName = objects.get(0); - String vipNameStr = vipName.toString(); + String vipNameStr = vipName==null?"":vipName.toString(); if (taocan == null || (taocan != null && StringUtils.isNotBlank(vipNameStr))) { //切换下一个套餐 @@ -301,7 +297,6 @@ //套餐资料导入=======end=== -*/ //充值卡资料导入 List<List<Object>> cardList = excelSheetPOList.get(2).getDataList(); List<MoneyCardUse> cardUseArrayList = new ArrayList<>(); @@ -324,11 +319,12 @@ Object tel = objects.get(1); if (tel != null) { String telStr = tel.toString(); - SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr); + SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); if (vipInfo == null) { vipInfo = new SysVipInfo(); vipInfo.setShopId(sysUsers.getShopId()); vipInfo.setPhone(telStr); + vipInfo.setPhoto(defaultWoman); vipInfo.setName(objects.get(0).toString()); vipInfoDao.insert(vipInfo); } @@ -380,19 +376,24 @@ Object tel = objects.get(1); if (tel != null) { String telStr = tel.toString(); - SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr); + SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); if (vipInfo == null) { vipInfo = new SysVipInfo(); vipInfo.setShopId(sysUsers.getShopId()); vipInfo.setPhone(telStr); + vipInfo.setPhoto(defaultWoman); vipInfo.setName(objects.get(0).toString()); vipInfoDao.insert(vipInfo); } String goodNo = String.valueOf(objects.get(3)); - String goodName = String.valueOf(objects.get(2)).trim(); - - ShoppingGoods goods = shoppingGoodsDao.findByCode(goodNo); + + String goodName = String.valueOf(objects.get(2)).trim(); + if("储值卡".equals(goodName)){ + goods= shoppingGoodsDao.selectVipCzGoods(); + } + + if (goods != null || "储值卡".equals(goodName)) { moneyCardUse.setVipId(vipInfo.getId()); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java index 47e7a0b..3309ce6 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java @@ -7,7 +7,7 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.constance.Dictionary; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.service.SysShopInfoService; @@ -108,6 +108,16 @@ QueryUtil.setQueryLimitCom(shopInfo); return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findByModel(shopInfo), null); } + + @RequestMapping(value = "/findAllWithPermi" ) + public @ResponseBody AjaxResult findAllWithPermi(SysShopInfo shopInfo) { + QueryUtil.setQueryLimitCom(shopInfo); + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + if (!DataAuthUtil.hasAllShopAuth()) { + shopInfo.setId(sysUsers.getShopId()); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findByModel(shopInfo), null); + } /** * 查询非总店 商城店铺的门店 * TODO 微商城不应该调用这里的接口 diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsCategoryController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsCategoryController.java index 7f1903a..93d9088 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsCategoryController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsCategoryController.java @@ -1,5 +1,6 @@ package com.matrix.system.hive.action; +import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.hive.action.util.QueryUtil; @@ -44,6 +45,11 @@ public @ResponseBody AjaxResult addOrModify(ShoppingGoodsCategory shoppingGoodsCategory) { if (shoppingGoodsCategory.getId() != null) { + + // 自己不能是自己的父节点 + if (shoppingGoodsCategory.getParentId() != null && shoppingGoodsCategory.getParentId().equals(shoppingGoodsCategory.getId())) { + throw new GlobleException("父级不能是自己"); + } return modify(goodsCategoryService, shoppingGoodsCategory, "商品类型"); } else { @@ -111,11 +117,12 @@ @RequestMapping(value = "/all") public @ResponseBody AjaxResult all(ShoppingGoodsCategory shoppingGoodsCategory) { - SysUsers user = getMe(); - if(shoppingGoodsCategory.getShopId()==null){ - shoppingGoodsCategory.setShopId(user.getShopId()); - } - shoppingGoodsCategory.setCompanyId(user.getCompanyId()); +// SysUsers user = getMe(); +// if(shoppingGoodsCategory.getShopId()==null){ +// shoppingGoodsCategory.setShopId(user.getShopId()); +// } +// shoppingGoodsCategory.setCompanyId(user.getCompanyId()); + QueryUtil.setQueryLimitCom(shoppingGoodsCategory); return new AjaxResult(AjaxResult.STATUS_SUCCESS, goodsCategoryService.findByModel(shoppingGoodsCategory), 0); } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java index 26d1c64..106ecd6 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java @@ -23,7 +23,6 @@ import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.system.hive.service.ShoppingGoodsService; import com.matrix.system.hive.service.SysShopInfoService; -import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -176,8 +175,37 @@ public @ResponseBody AjaxResult showList(ShoppingGoods shoppingGoods, PaginationVO pageVo) { QueryUtil.setQueryLimit(shoppingGoods); - pageVo.setOrder("desc"); - pageVo.setSort("createTime"); + if(StringUtils.isBlank(pageVo.getSort())){ + pageVo.setOrder("desc"); + pageVo.setSort("createTime"); + } + + //2表示查询总部产品 + if (shoppingGoods.getHeadquarters()!=null && 2==shoppingGoods.getHeadquarters()) { + //仅查询本店产品 + SysShopInfo zbShop = shopInfoDao.selectZbShop(getMe().getCompanyId()); + //如果是总部自己查询自己的库存则不需加入这个调价 + if (getMe().getShopId().equals(zbShop.getId())){ + shoppingGoods.setHeadquarters(1); + } + } + shoppingGoods.setIsDel(ShoppingGoods.NORMAL); + shoppingGoods.setStaus(Dictionary.BUSINESS_STATE_UP); + List<ShoppingGoods> dataList = shoppingGoodsService.findInPage(shoppingGoods, pageVo); + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, shoppingGoodsService.findTotal(shoppingGoods)); + return result; + + } + + @RequestMapping(value = "/showAllList") + @ResponseBody + public AjaxResult showAllList(ShoppingGoods shoppingGoods, PaginationVO pageVo) { + QueryUtil.setQueryLimit(shoppingGoods); + if(StringUtils.isBlank(pageVo.getSort())){ + pageVo.setOrder("desc"); + pageVo.setSort("createTime"); + } + //2表示查询总部产品 if (shoppingGoods.getHeadquarters()!=null && 2==shoppingGoods.getHeadquarters()) { //仅查询本店产品 @@ -191,7 +219,6 @@ List<ShoppingGoods> dataList = shoppingGoodsService.findInPage(shoppingGoods, pageVo); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, shoppingGoodsService.findTotal(shoppingGoods)); return result; - } @RequestMapping(value = "/showListShopId") @@ -408,7 +435,7 @@ String title = "商品资料"; orderSheet.setSheetName(title); orderSheet.setTitle(title); - String[] header = {"商品名称", "商品编号", "售价/(本金)", "参考价/(赠送金额)", "真实销量", "状态", "是否赠送", "类型", "分类", "是否固定套餐", "产品归属"}; + String[] header = {"商品名称", "商品编号", "售价/(本金)", "参考价/(赠送金额)", "真实销量", "状态", "是否赠送", "类型", "分类", "是否固定套餐", "产品归属","时长"}; orderSheet.setHeaders(header); List<ShoppingGoods> dataList = shoppingGoodsService.findAll(shoppingGoods); List<List<Object>> list = new ArrayList<>(); @@ -426,6 +453,7 @@ temp.add(item.getCateName()); temp.add(item.getIsCourse()); temp.add(item.getHeadquarters() == 1 ? "总部产品" : "本店产品"); + temp.add(item.getTimeLength()); list.add(temp); } } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/SupplierInfoController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/SupplierInfoController.java index e381a62..b43c080 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/SupplierInfoController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/SupplierInfoController.java @@ -8,9 +8,12 @@ import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.bean.SysSupplierInfo; +import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.system.hive.service.CodeService; import com.matrix.system.hive.service.SysSupplierInfoService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -31,6 +34,8 @@ @Resource private CodeService codeService; + @Autowired + private SysShopInfoDao shopInfoDao; @@ -93,8 +98,9 @@ @RequestMapping(value = "/all") public @ResponseBody AjaxResult all(SysSupplierInfo sysSupplierInfo) { SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - sysSupplierInfo.setShopId(sysUsers.getShopId()); - sysSupplierInfo.setCompanyId(sysUsers.getCompanyId()); + SysShopInfo shopInfo = shopInfoDao.selectZbShop(sysUsers.getCompanyId()); + sysSupplierInfo.setShopId(shopInfo.getId()); + sysSupplierInfo.setCompanyId(shopInfo.getCompanyId()); return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findByModel(sysSupplierInfo), 0); } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/SysVipLabelController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/SysVipLabelController.java new file mode 100644 index 0000000..8d149de --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/SysVipLabelController.java @@ -0,0 +1,119 @@ +package com.matrix.system.hive.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.constance.Dictionary; +import com.matrix.system.hive.bean.SysVipLabel; +import com.matrix.system.hive.dao.SysVipLabelDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import jodd.util.CollectionUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Random; + +/** + * @author wzy + * @date 2020-12-17 + **/ +@Controller +@RequestMapping(value = "/admin/label") +public class SysVipLabelController extends BaseController{ + + @Autowired + private SysVipLabelDao sysVipLabelDao; + + + @RequestMapping(value = "/showList") + @ResponseBody + private AjaxResult showList(SysVipLabel sysVipLabel, PaginationVO pageVo) { + SysUsers user = getMe(); + sysVipLabel.setCompanyId(user.getCompanyId()); + return AjaxResult.buildSuccessInstance(sysVipLabelDao.selectInPage(sysVipLabel, pageVo), sysVipLabelDao.selectTotal(sysVipLabel)); + } + + @RequestMapping(value = "/add") + @ResponseBody + public AjaxResult add(SysVipLabel sysVipLabel) { + SysUsers sysUsers = getMe(); + + sysVipLabel.setIsAll(1); + sysVipLabel.setCompanyId(sysUsers.getCompanyId()); + List<SysVipLabel> sysVipLabels = sysVipLabelDao.selectByModel(sysVipLabel); + if (CollectionUtils.isNotEmpty(sysVipLabels)) { + return AjaxResult.buildFailInstance("已存在该标签"); + } + + sysVipLabel.setCreateBy(sysUsers.getSuName()); + sysVipLabel.setCreateTime(new Date()); + sysVipLabel.setColor(Dictionary.COLORS[new Random().nextInt(6)]); + + int i = sysVipLabelDao.insert(sysVipLabel); + if (i > 0) { + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("添加成功"); + ajaxResult.putInMap("label", sysVipLabel); + return ajaxResult; + } + return AjaxResult.buildFailInstance("添加失败"); + } + + @RequestMapping(value = "/modify") + @ResponseBody + public AjaxResult modify(SysVipLabel sysVipLabel) { + SysUsers sysUsers = getMe(); + + SysVipLabel hasExist = sysVipLabelDao.selectById(sysVipLabel.getId()); + if (!sysVipLabel.getLabel().equals(hasExist.getLabel())) { + SysVipLabel query = new SysVipLabel(); + query.setIsAll(1); + query.setCompanyId(sysUsers.getCompanyId()); + query.setLabel(sysVipLabel.getLabel()); + List<SysVipLabel> sysVipLabels = sysVipLabelDao.selectByModel(sysVipLabel); + if (CollectionUtils.isNotEmpty(sysVipLabels)) { + return AjaxResult.buildFailInstance("已存在该标签"); + } + } + + sysVipLabel.setColor(Dictionary.COLORS[new Random().nextInt(6)]); + + int i = sysVipLabelDao.update(sysVipLabel); + if (i > 0) { + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("编辑成功"); + ajaxResult.putInMap("label", sysVipLabel); + return ajaxResult; + } + return AjaxResult.buildFailInstance("编辑失败"); + } + + @RequestMapping(value = "/del") + @ResponseBody + public AjaxResult del(String keys) { + List<Long> ids = StringUtils.strToCollToLong(keys, ","); + int i = sysVipLabelDao.deleteByIds(ids); + if (i > 0) { + return AjaxResult.buildSuccessInstance("删除成功"); + } else { + return AjaxResult.buildFailInstance("删除失败"); + } + } + + + + @RequestMapping(value = "/edit") + public String edit(Long id) { + if (id != null) { + SysVipLabel sysVipLabel = sysVipLabelDao.selectById(id); + WebUtil.getRequest().setAttribute("obj", sysVipLabel); + } + return "admin/hive/operate/label-form"; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/TaocanController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/TaocanController.java index 607821c..ded5549 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/TaocanController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/TaocanController.java @@ -3,9 +3,11 @@ import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUsers; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.MoneyCardUse; import com.matrix.system.hive.bean.SysProjUse; +import com.matrix.system.hive.bean.SysProjUseFlow; import com.matrix.system.hive.dao.SysProjUseDao; import com.matrix.system.hive.service.MoneyCardUseService; import com.matrix.system.hive.service.SysProjUseService; @@ -63,7 +65,7 @@ List<SysProjUse> projUseList =sysProjUseService.findInPage(sysProjUse,null); //设置套餐中的项目 projUseList.forEach(taocanProjUse -> { - taocanProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(taocanProjUse.getId())); + taocanProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(taocanProjUse.getId(),sysProjUse.getStatus())); }); return new AjaxResult(AjaxResult.STATUS_SUCCESS, projUseList, sysProjUseService.findTotal(sysProjUse)); } @@ -121,21 +123,7 @@ return new AjaxResult(AjaxResult.STATUS_FAIL, "套餐转让失败"); } - @RequestMapping(value = "/returnTc") - public @ResponseBody - AjaxResult returnTc(SysProjUse sysProjUse, Long moneyCardUseId, String tcRemark, Long shopId, Double money, String tcName) { - System.out.println("moneyCardUseId = " + moneyCardUseId); - MoneyCardUse card = moneyCardUseService.findById(moneyCardUseId); - System.out.println("card = " + card); - int i = sysProjUseService.returnMoneyTc(sysProjUse, card, moneyCardUseId); - if (i > 0) { - - - return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); - } - return new AjaxResult(AjaxResult.STATUS_FAIL, "退款失败"); - } /** @@ -156,11 +144,7 @@ } - /** - * 退款 - * - * @return - */ + @RequestMapping(value = "/getEffectCard") public @ResponseBody AjaxResult getEffectCard(SysProjUse sysProjUse) { @@ -192,7 +176,7 @@ public String editForm(Long id) { if (id != null) { SysProjUse sysProjUse = sysProjUseService.findById(id); - sysProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(sysProjUse.getId())); + sysProjUse.setTaocanProjUse(sysProjUseService.selectTaocanProjUse(sysProjUse.getId(), sysProjUse.getStatus())); WebUtil.getRequest().setAttribute("obj", sysProjUse); } return "admin/hive/vip/tc-form"; @@ -205,6 +189,27 @@ public @ResponseBody AjaxResult addOrModify(SysProjUse sysProjUse) { if (sysProjUse.getId() != null) { + + //插入修改记录 + SysUsers user=getMe(); + //插入修改记录 + SysProjUse oldProjUse = sysProjUseService.findById(sysProjUse.getId()); + SysProjUseFlow projUseFlow=new SysProjUseFlow(); + projUseFlow.setProjUseId(sysProjUse.getId()); + projUseFlow.setOptionType("人工修改"); + projUseFlow.setProjName(oldProjUse.getProjName()); + projUseFlow.setCreateBy(user.getSuName()); + projUseFlow.setUpdateBy(user.getSuName()); + projUseFlow.setPrice(sysProjUse.getPrice()); + projUseFlow.setStatus(sysProjUse.getStatus()); + projUseFlow.setBalance(sysProjUse.getBalance()); + projUseFlow.setFailTime(sysProjUse.getFailTime()); + projUseFlow.setIsOver(sysProjUse.getIsOver()); + projUseFlow.setRemark(sysProjUse.getUpdateRemark()); + projUseFlow.setSurplusCount(sysProjUse.getSurplusCount()); + projUseDao.insertFlow(projUseFlow); + + int modifyResult = sysProjUseService.modify(sysProjUse); List<SysProjUse> modifyUse = sysProjUse.getTaocanProjUse(); @@ -212,6 +217,25 @@ if (modifyResult > 0) { if (CollectionUtils.isNotEmpty(modifyUse)) { for (SysProjUse use : modifyUse) { + + //插入修改记录 + SysProjUse oldProjUse2 = sysProjUseService.findById(use.getId()); + SysProjUseFlow projUseFlow2=new SysProjUseFlow(); + //套餐中的项目需要记录套餐id + projUseFlow2.setProjUseId(oldProjUse.getId()); + projUseFlow2.setOptionType("人工修改"); + projUseFlow2.setProjName(oldProjUse2.getProjName()); + projUseFlow2.setCreateBy(user.getSuName()); + projUseFlow2.setUpdateBy(user.getSuName()); + projUseFlow2.setPrice(use.getPrice()); + projUseFlow2.setStatus(use.getStatus()); + projUseFlow2.setBalance(use.getBalance()); + projUseFlow2.setFailTime(use.getFailTime()); + projUseFlow2.setIsOver(use.getIsOver()); + projUseFlow2.setRemark(sysProjUse.getUpdateRemark()); + projUseFlow2.setSurplusCount(use.getSurplusCount()); + projUseDao.insertFlow(projUseFlow2); + sysProjUseService.modify(use); } } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java index fd508ef..fed9f78 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java @@ -5,34 +5,34 @@ import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.*; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.PropertiesUtil; +import com.matrix.core.tools.WebUtil; import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelUtil; import com.matrix.core.tools.excl.ExcelVersion; -import com.matrix.system.common.bean.CustomerDataDictionary; -import com.matrix.system.common.bean.SystemDictionary; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.bean.SystemDictionary; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.CustomerDataDictionaryDao; -import com.matrix.system.common.service.SystemDictionaryService; import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.common.service.SystemDictionaryService; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.constance.Dictionary; -import com.matrix.system.constance.SystemConstance; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.MoneyCardUseDao; +import com.matrix.system.hive.dao.ShoppingGoodsDao; +import com.matrix.system.hive.dao.SysVipLabelDao; import com.matrix.system.hive.dao.VipAnswerDao; -import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.pojo.RegisterInfo; import com.matrix.system.hive.service.*; +import com.matrix.system.score.dao.ScoreVipDetailDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; @@ -41,11 +41,11 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.net.URLEncoder; -import java.security.NoSuchAlgorithmException; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.List; /** @@ -76,10 +76,149 @@ private MoneyCardUseDao moneyCardUseDao; @Autowired + private SysVipLabelDao sysVipLabelDao; + + @Autowired private SystemDictionaryService dataDictionaryService; @Autowired private CustomerDataDictionaryDao customerDataDictionaryDao; + @Resource + private SysOrderService sysOrderService; + @Autowired + ShoppingGoodsDao shoppingGoodsDao; + @Autowired + private ScoreVipDetailDao scoreVipDetailDao; + @Resource + private SysProjUseService projUseService; + @Resource + HttpServletResponse response; + + @RequestMapping(value = "/exportExcel/{vipId}") + public void getVipAllProjInfo(@PathVariable Long vipId) throws IOException { + + List<ExcelSheetPO> res = new ArrayList<>(); + ExcelSheetPO orderSheet = new ExcelSheetPO(); + + SysVipInfo vipInfo = vipInfoService.findById(vipId); + + String title = vipInfo.getVipName()+"("+vipInfo.getVipNo()+")会员资料"; + orderSheet.setSheetName(title); + orderSheet.setTitle(title); + String[] header = {"产品类型", "产品名称","来源", "状态", "余额", "余次", "到期时间", "本金", "赠金"}; + orderSheet.setHeaders(header); + + + SysProjUse queryUse = new SysProjUse(); + queryUse.setVipId(vipId); + queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); + queryUse.setTaocanId(-1L); + queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); + List<SysProjUse> projList = projUseService.findInPage(queryUse, null); + + List<List<Object>> list = new ArrayList<>(); + if (projList.size() > 0) { + for (SysProjUse item : projList) { + List<Object> temp = new ArrayList<>(); + temp.add("项目"); + temp.add(item.getProjName()); + temp.add(item.getSource()); + temp.add("有效"); + temp.add(item.getBalance()); + temp.add(item.getSurplusCount()); + temp.add(DateUtil.dateToString(item.getFailTimeStr(),DateUtil.DATE_FORMAT_DD)); + temp.add(""); + temp.add(""); + list.add(temp); + } + } + //套餐 + //切换到套餐查询条件 + SysProjUse queryTaocan = new SysProjUse(); + queryTaocan.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); + queryTaocan.setStatus(Dictionary.TAOCAN_STATUS_YX); + queryTaocan.setVipId(vipId); + List<SysProjUse> taoCanList = projUseService.findInPage(queryTaocan, null); + taoCanList.forEach(item->{ + item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus())); + item.setProjInfo(shoppingGoodsDao.selectById(item.getProjId())); + }); + if (taoCanList.size() > 0) { + for (SysProjUse item : taoCanList) { + List<Object> temp = new ArrayList<>(); + + if(Dictionary.FLAG_YES_Y.equals(item.getIsCourse())){ + temp.add("任选套餐"); + }else{ + temp.add("固定套餐"); + } + temp.add(item.getProjName()); + temp.add(item.getSource()); + temp.add("有效"); + temp.add(item.getBalance()); + temp.add(item.getSurplusCount()); + temp.add(DateUtil.dateToString(item.getFailTimeStr(),DateUtil.DATE_FORMAT_DD)); + temp.add(""); + temp.add(""); + list.add(temp); + + //套餐下项目 + List<SysProjUse> taocanProjUse = item.getTaocanProjUse(); + if (taocanProjUse.size() > 0) { + for (SysProjUse proj_item : taocanProjUse) { + List<Object> temp2 = new ArrayList<>(); + temp2.add(" |————"); + temp2.add(proj_item.getProjName()); + temp2.add(proj_item.getSource()); + temp2.add("有效"); + temp2.add(proj_item.getBalance()); + temp2.add(proj_item.getSurplusCount()); + temp2.add(DateUtil.dateToString(proj_item.getFailTimeStr(),DateUtil.DATE_FORMAT_DD)); + temp2.add(""); + temp2.add(""); + list.add(temp2); + } + } + + + } + } + + + //储值卡 + MoneyCardUse moneyCardUse = new MoneyCardUse(); + moneyCardUse.setVipId(vipId); + moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); + List<MoneyCardUse> cards = cardUseService.findByModel(moneyCardUse); + + if (cards.size() > 0) { + for (MoneyCardUse item : cards) { + List<Object> temp = new ArrayList<>(); + temp.add("储值卡"); + temp.add(item.getCardName()); + temp.add(item.getSource()); + temp.add("有效"); + temp.add(""); + temp.add(item.getLastCount()); + temp.add(DateUtil.dateToString(item.getFailTime(),DateUtil.DATE_FORMAT_DD)); + temp.add(item.getRealMoney()); + temp.add(item.getGiftMoney()); + list.add(temp); + } + } + + + + + orderSheet.setDataList(list); + res.add(orderSheet); + response = ResponseHeadUtil.setExcelHead(response); + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8")); + OutputStream os = response.getOutputStream(); + ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); + } + @RequestMapping(value = "/showVipLevel") @@ -97,9 +236,9 @@ public @ResponseBody AjaxResult showList(PaginationVO pageVo, SysVipInfo vipInfo) { -// if (!getMe().getShopRole().equals(Dictionary.FLAG_YES_Y)) { - vipInfo.setShopId(getMe().getShopId()); -// } + + QueryUtil.setQueryLimit(vipInfo); + return showList(vipInfoService, vipInfo, pageVo); } @@ -113,37 +252,19 @@ @RequestMapping(value = "/showVipInfo") public @ResponseBody AjaxResult findByModel(String keyWord) { - LinkedList<SysVipInfo> userList = null; - // 获取最近查询客户 - if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { - userList = new LinkedList<SysVipInfo>(); - WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); - } else { - userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); - } + List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); if (vips.size() > 0) { - // 在session存放当前查询的客户 + vips.get(0).setPointAll(scoreVipDetailDao.selectUserTotalScore(vips.get(0).getId())); + vips.get(0).setSysOrder(sysOrderService.findSysOrderTjByVipId(vips.get(0).getId())); vips.get(0).setLevelCard(cardUseService.findByVipId(vips.get(0).getId())); - WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); - // 满20后删除一个 - if (userList.size() == 20) { - userList.poll(); - } - // 去重标志 - boolean isNoRepeat = true; - for (SysVipInfo sysVipInfo : userList) { - if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { - isNoRepeat = false; - } - } - if (isNoRepeat) { - userList.add(vips.get(0)); - } + vips.get(0).setLabels(sysVipLabelDao.selectByVipId(vips.get(0).getId())); + vips.get(0).setAge(DateUtil.getAgeForBirthDay(vips.get(0).getBirthday1())); vips.get(0).setBalance(moneyCardUseDao.selectVipCardTotalMoney(vips.get(0).getId())); - AjaxResult result= new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); + vips.get(0).setArrears(sysOrderService.findVipArrearsByVipId(vips.get(0).getId())); + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); return result; - }else{ + } else { return AjaxResult.buildFailInstance("未查到询客户信息"); } @@ -168,27 +289,13 @@ public @ResponseBody AjaxResult addOrModify(SysVipInfo vipInfo) { if (vipInfo.getId() != null) { - - try { - if (vipInfo.getPassWord() != null) { - vipInfo.setPassWord(EncrypUtil.getMD5(vipInfo.getPassWord())); - } - } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { - e.printStackTrace(); - } return modify(vipInfoService, vipInfo, "会员信息"); } else { - - try { - if (StringUtils.isNotBlank(vipInfo.getPassWord())) { - vipInfo.setPassWord(EncrypUtil.getMD5(vipInfo.getPassWord())); - } - vipInfo.setVipState(Dictionary.VIP_STATE_HY); - } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { - e.printStackTrace(); - } + vipInfo.setVipState(Dictionary.VIP_STATE_HY); SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - vipInfo.setShopId(users.getShopId()); + if(vipInfo.getShopId()==null){ + vipInfo.setShopId(users.getShopId()); + } return add(vipInfoService, vipInfo, "会员信息"); } } @@ -259,7 +366,8 @@ public @ResponseBody AjaxResult getVipQuestions(Long id, HttpServletRequest request) { // 获取会员所有的答案,分类型 - List<Question> questions = questionSerivce.findByVipId(id); + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + List<Question> questions = questionSerivce.findByVipId(id, user.getCompanyId()); request.setAttribute("questions", questions); AjaxResult result = new AjaxResult(); result.putInMap("questions", questions); @@ -323,7 +431,7 @@ SystemDictionary dataDictionary = new SystemDictionary(); // 获取到店途径 dataDictionary.setType("到店途径"); - WebUtil.getRequest().setAttribute("ddtj", customerDataDictionaryDao.selectByParentCode("DDTJ",getMe().getCompanyId())); + WebUtil.getRequest().setAttribute("ddtj", customerDataDictionaryDao.selectByParentCode("DDTJ", getMe().getCompanyId())); // 获取生肖 dataDictionary.setType("生肖"); WebUtil.getRequest().setAttribute("sx", dataDictionaryService.findByModel(dataDictionary)); @@ -347,6 +455,7 @@ vipInfo.setVipState(Dictionary.VIP_STATE_HY); vipInfo.setStaffId(getMe().getSuId()); vipInfo.setShopId(getMe().getShopId()); + vipInfo.setCompanyId(getMe().getCompanyId()); vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); vipInfoService.add(vipInfo); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员信息注册成功"); @@ -410,33 +519,7 @@ @RequestMapping(value = "/findUserByPhoneOrNo") public @ResponseBody AjaxResult findUserByPhoneOrNo(String keyWord) { - LinkedList<SysVipInfo> userList = null; - // 获取最近查询客户 - if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { - userList = new LinkedList<SysVipInfo>(); - WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); - } else { - userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); - } List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); - if (vips.size() > 0) { - // 在session存放当前查询的客户 - WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); - // 满20后删除一个 - if (userList.size() == 20) { - userList.poll(); - } - // 去重标志 - boolean isNoRepeat = true; - for (SysVipInfo sysVipInfo : userList) { - if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { - isNoRepeat = false; - } - } - if (isNoRepeat) { - userList.add(vips.get(0)); - } - } return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); } @@ -465,25 +548,17 @@ } @RequestMapping(value = "/exportExcel") - public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response, + public void report( HttpServletResponse response, SysVipInfo vipInfo) throws IOException { - if (vipInfo.getVipType() != null && !(vipInfo.getVipType().equals(""))) { - vipInfo.setVipType(URLDecoder.decode(vipInfo.getVipType(), "UTF-8")); - } - if (vipInfo.getVipName() != null && !"".equals(vipInfo.getVipName())) { - vipInfo.setVipName(URLDecoder.decode(vipInfo.getVipName(), "UTF-8")); - } - if (vipInfo.getArrivalWay() != null && !"".equals(vipInfo.getArrivalWay())) { - vipInfo.setArrivalWay(URLDecoder.decode(vipInfo.getArrivalWay(), "UTF-8")); - } - if (vipInfo.getVipState() != null && !"".equals(vipInfo.getVipState())) { - vipInfo.setVipState(URLDecoder.decode(vipInfo.getVipState(), "UTF-8")); + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if(!DataAuthUtil.hasAllShopAuth()){ + vipInfo.setShopId(sysUsers.getShopId()); } List<ExcelSheetPO> res = new ArrayList<>(); ExcelSheetPO orderSheet = new ExcelSheetPO(); - String title = "每日单据明细"; + String title = "会员资料"; orderSheet.setSheetName(title); orderSheet.setTitle(title); String[] header = {"会员编号", "姓名", "性别", "手机号码", "会员类型", "会员活跃度", "到店途径", "健康顾问", "所属门店"}; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/util/QueryUtil.java b/zq-erp/src/main/java/com/matrix/system/hive/action/util/QueryUtil.java index e36ac64..0718dff 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/util/QueryUtil.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/util/QueryUtil.java @@ -5,6 +5,7 @@ import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; import java.lang.reflect.Method; @@ -12,40 +13,44 @@ /** * 为查询对象加上当前登录人的门店和公司查询限制 + * * @param queryObj */ public static void setQueryLimit(Object queryObj) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + Class<Object> objClazz = (Class<Object>) queryObj.getClass(); try { - Method setShopId = (Method) objClazz.getMethod("setShopId",Long.class); - setShopId.invoke(queryObj, sysUsers.getShopId()); - Method setCompanyId = (Method) objClazz.getMethod("setCompanyId",Long.class); + if (!AppConstance.USER_TYPE_ADMIN.equals(sysUsers.getSuUserType())) { + Method setShopId = (Method) objClazz.getMethod("setShopId", Long.class); + setShopId.invoke(queryObj, sysUsers.getShopId()); + } + Method setCompanyId = (Method) objClazz.getMethod("setCompanyId", Long.class); setCompanyId.invoke(queryObj, sysUsers.getCompanyId()); } catch (Exception e) { LogUtil.error(e.getMessage(), e); throw new GlobleException("系统参数错误007"); } + } /** * 限制数据公司id + * * @param queryObj */ public static void setQueryLimitCom(Object queryObj) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); Class<Object> objClazz = (Class<Object>) queryObj.getClass(); try { - Method setCompanyId = (Method) objClazz.getMethod("setCompanyId",Long.class); + Method setCompanyId = (Method) objClazz.getMethod("setCompanyId", Long.class); setCompanyId.invoke(queryObj, sysUsers.getCompanyId()); } catch (Exception e) { LogUtil.error(e.getMessage(), e); throw new GlobleException("系统参数错误008"); } } - - } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java index fee903f..3c68bcd 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java @@ -1,21 +1,23 @@ package com.matrix.system.hive.bean; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.anotations.Extend; import com.matrix.core.tools.DateUtil; +import com.matrix.system.common.bean.EntityDTOExt; import org.springframework.format.annotation.DateTimeFormat; -import java.io.Serializable; import java.util.Date; /** * * @date 2019-03-24 23:55 */ -public class AchieveNew implements Serializable{ +public class AchieveNew extends EntityDTOExt { @Extend - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - + @TableId(type = IdType.AUTO) private Long id; @@ -26,7 +28,7 @@ /** - * 美疗师id + * 美疗师id 把这个字段视为正式的业绩归属人 */ private Long beaultId; @@ -72,7 +74,15 @@ * 客户id */ private Long vipId; - + + + + /** + * 购买业绩 + */ + private Double goodsCash; + + private Double cardCash; /** * 赠送消耗 @@ -85,29 +95,7 @@ */ private Double hisConsume; - - /** - * 划扣金额 从卡中划扣钱买东西 - */ - private Double consume; - - - /** - * 卡项,套餐,充值,开会籍卡 - */ - private Double cardCash; - - - /** - * 现金单次,购买项目的业绩 - */ - private Double projCash; - - - /** - * 现金产品,购买家居产品的钱 - */ - private Double goodsCash; + /** @@ -155,20 +143,24 @@ * 总金额 */ private Double zkTotal; + /** * 公司id */ private Long companyId; - + private String t1; private String t2; - - - private String t3; - - + + + /** + * 业绩类型 + */ + private String achieveType; + + private String t4; @@ -200,6 +192,10 @@ private String day; + private String vipQueryKey; + + private Long achieveRuleId; + /** * 订单编号 @@ -227,6 +223,8 @@ */ private String meiliao; + private Integer arriveCnt; + @@ -234,6 +232,7 @@ * 开始时间 */ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private Date beginTime; @@ -241,15 +240,97 @@ * 结束时间 */ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private Date endTime; - /** - * 分配的业绩金额 - */ - @Extend - private Double achieveMoney; + private String goodsNo; + + private String goodsName; + + private String type; + + private String payMethod; + + private String cateName; + + /** + * 业绩规则名称 + */ + private String achieveRuleName; + + public String getAchieveRuleName() { + return achieveRuleName; + } + + public void setAchieveRuleName(String achieveRuleName) { + this.achieveRuleName = achieveRuleName; + } + + public Double getCardCash() { + return cardCash; + } + + public void setCardCash(Double cardCash) { + this.cardCash = cardCash; + } + + public String getCateName() { + return cateName; + } + + public void setCateName(String cateName) { + this.cateName = cateName; + } + + public String getPayMethod() { + return payMethod; + } + + public void setPayMethod(String payMethod) { + this.payMethod = payMethod; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getGoodsNo() { + return goodsNo; + } + + public void setGoodsNo(String goodsNo) { + this.goodsNo = goodsNo; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public Integer getArriveCnt() { + return arriveCnt; + } + + public void setArriveCnt(Integer arriveCnt) { + this.arriveCnt = arriveCnt; + } + + public String getVipQueryKey() { + return vipQueryKey; + } + + public void setVipQueryKey(String vipQueryKey) { + this.vipQueryKey = vipQueryKey; + } public Long getCompanyId() { return companyId; @@ -259,13 +340,6 @@ this.companyId = companyId; } - public Double getAchieveMoney() { - return achieveMoney; - } - - public void setAchieveMoney(Double achieveMoney) { - this.achieveMoney = achieveMoney; - } public Date getBeginTime() { return beginTime; @@ -351,24 +425,8 @@ public void setHisConsume(Double hisConsume) { this.hisConsume = hisConsume; } - public Double getConsume() { - return consume; - } - public void setConsume(Double consume) { - this.consume = consume; - } - public Double getCardCash() { - return cardCash; - } - public void setCardCash(Double cardCash) { - this.cardCash = cardCash; - } - public Double getProjCash() { - return projCash; - } - public void setProjCash(Double projCash) { - this.projCash = projCash; - } + + public Double getGoodsCash() { return goodsCash; } @@ -429,12 +487,15 @@ public void setT2(String t2) { this.t2 = t2; } - public String getT3() { - return t3; + + public String getAchieveType() { + return achieveType; } - public void setT3(String t3) { - this.t3 = t3; + + public void setAchieveType(String achieveType) { + this.achieveType = achieveType; } + public String getT4() { return t4; } @@ -484,6 +545,13 @@ this.day = day; } + public Long getAchieveRuleId() { + return achieveRuleId; + } + + public void setAchieveRuleId(Long achieveRuleId) { + this.achieveRuleId = achieveRuleId; + } public String getOrderNo() { return orderNo; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveRule.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveRule.java new file mode 100644 index 0000000..07e7594 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveRule.java @@ -0,0 +1,33 @@ +package com.matrix.system.hive.bean; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.matrix.system.hiveErp.pojo.AchieveRuleItem; +import com.matrix.system.score.entity.BaseEntity; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * 业绩规则 + * @author JIANGYOUYAO + * @date 2021/6/3 0003 + */ +@Data +@TableName("achieve_rule") +public class AchieveRule extends BaseEntity { + + @NotEmpty(message = "规则名称不能为空") + private String name; + + + private String rules; + + private Long companyId; + + @TableField(exist=false) + @NotEmpty(message = "规则不能为空") + private List<AchieveRuleItem> ruleItemList; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/AppVersion.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/AppVersion.java new file mode 100644 index 0000000..b61bd80 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/AppVersion.java @@ -0,0 +1,71 @@ +package com.matrix.system.hive.bean; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * @author wzy + * @date 2021-01-15 + **/ +public class AppVersion { + private static final long serialVersionUID = 1L; + + private Long id; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createtime; + + private String version; + private String content; + private String address; + private Integer type; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getCreatetime() { + return createtime; + } + + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/Article.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/Article.java index 8619f5f..c1cdda4 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/Article.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/Article.java @@ -1,5 +1,8 @@ package com.matrix.system.hive.bean; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; + import java.util.Date; import java.io.Serializable; /** @@ -65,6 +68,7 @@ /** * 创建时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_SS, timezone = "GMT+8") private Date createtiem; @@ -92,14 +96,14 @@ */ private Integer commentNum; - private Long shopId; + private Long companyId; - public Long getShopId() { - return shopId; + public Long getCompanyId() { + return companyId; } - public void setShopId(Long shopId) { - this.shopId = shopId; + public void setCompanyId(Long companyId) { + this.companyId = companyId; } public Integer getCommentNum() { diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java index 884b2c7..fc2cee1 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java @@ -56,6 +56,10 @@ private String type; private Long shopId; + + private String parentIds; + + private Long companyId; /** * 扩展属性 @@ -81,6 +85,15 @@ public void setArticle(Article article) { this.article = article; }*/ + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + public Long getId() { return id; } @@ -159,6 +172,14 @@ this.type=type; } + public String getParentIds() { + return parentIds; + } + + public void setParentIds(String parentIds) { + this.parentIds = parentIds; + } + @Override public String toString() { return "ArticleType [id=" + id + ", articleTypeName=" + articleTypeName diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java index 3169b9d..0787c91 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java @@ -1,26 +1,66 @@ package com.matrix.system.hive.bean; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.anotations.Extend; import com.matrix.core.tools.DateUtil; +import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.plugin.util.MoneyUtil; -import com.matrix.system.hive.pojo.MoneyCardUserVo; import org.springframework.format.annotation.DateTimeFormat; -import java.io.Serializable; import java.util.Date; /** * * @date 2016-09-17 10:17 */ -public class MoneyCardUse extends MoneyCardUserVo implements Serializable{ - private static final long serialVersionUID = 1L; +public class MoneyCardUse { - + @TableId(value = "id",type = IdType.AUTO) private Long id; - - + + + private String createBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + private String updateBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; + + /** + * 剩余次数 + */ + @TableField(exist = false) + String lastCountName; + /** + * 数据来源 + */ + @TableField(exist = false) + String sourceName; + + /*vo对象************/ + + /** + * 剩余次数 + */ + + private Integer lastCount; + + /** + * 来源,购买,转让,赠送 + */ + private String source; + /** + * 是会籍卡? Y 是,N否 + */ + private String isVipCar; + /** * 订单明细id */ @@ -33,12 +73,7 @@ private Integer useTotal; - /** - * 剩余次数 - */ - - private Integer lastCount; - + /** * 本金 @@ -58,23 +93,28 @@ private String status; - /** - * 来源,购买,转让,赠送 - */ - private String source; + /** * 失效时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") @DateTimeFormat(pattern= DateUtil.DATE_FORMAT_DD) private Date failTime; - + + /** * 充值卡的id */ private Long goodsId; + + /** + * 订单ID + */ + @TableField(exist = false) + private Long orderId; private Long vipId; @@ -85,10 +125,7 @@ */ private String isOver; - /** - * 是会籍卡? Y 是,N否 - */ - private String isVipCar; + /** * 备注 */ @@ -96,12 +133,21 @@ /** * 前台输入的退款金额 */ + @TableField(exist = false) private String returnMonery; /** * 充值卡名称 */ private String cardName; + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } public String getCardName() { return cardName; @@ -126,6 +172,87 @@ public void setRemark(String remark) { this.remark = remark; } + + /** + * 当大于10000时使用次数为不限,或者为会籍卡时 + * @return + */ + public String getLastCountName() { + if(getLastCount()==null){ + return ""; + } + if(Dictionary.FLAG_YES.equals(getIsVipCar())||getLastCount()>Dictionary.MAX_USE_COUNT_SIGN){ + lastCountName=Dictionary.MAX_USE_STRING; + }else{ + lastCountName=getLastCount().toString(); + } + return lastCountName; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public void setLastCountName(String lastCountName) { + this.lastCountName = lastCountName; + } + + public String getSourceName() { + if(getSource()==null){ + return ""; + } + if(getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)){ + sourceName=Dictionary.FLAG_YES; + }else{ + sourceName=Dictionary.FLAG_NO;; + } + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + + public String getIsVipCar() { + return isVipCar; + } + + public void setIsVipCar(String isVipCar) { + this.isVipCar = isVipCar; + } + + + + /** * 扩展对象 */ @@ -134,12 +261,14 @@ /** * 会员信息 */ + @TableField(exist = false) private SysVipInfo vipInfo; /** * 调整说明 */ @Extend + @TableField(exist = false) private String changeRemark; @@ -151,117 +280,110 @@ this.changeRemark = changeRemark; } - public String getIsVipCar() { - return isVipCar; - } - - public void setIsVipCar(String isVipCar) { - this.isVipCar = isVipCar; - } public Long getId() { return id; } - + public void setId(Long id) { this.id=id; } - + public Long getOrderItemId() { return orderItemId; } - + public void setOrderItemId(Long orderItemId) { this.orderItemId=orderItemId; } - + public Integer getUseTotal() { return useTotal; } - + public void setUseTotal(Integer useTotal) { this.useTotal=useTotal; } - + public Integer getLastCount() { return lastCount; } - + public void setLastCount(Integer lastCount) { this.lastCount=lastCount; } - + public Double getRealMoney() { return realMoney; } - + public void setRealMoney(Double realMoney) { this.realMoney=realMoney; } - + public Double getGiftMoney() { return giftMoney; } - + public void setGiftMoney(Double giftMoney) { this.giftMoney=giftMoney; } - + public String getStatus() { return status; } - + public void setStatus(String status) { this.status=status; } - + public String getSource() { return source; } - + public void setSource(String source) { this.source=source; } - + public Date getFailTime() { return failTime; } - + public void setFailTime(Date failTime) { this.failTime=failTime; } - + public Long getGoodsId() { return goodsId; } - + public void setGoodsId(Long goodsId) { this.goodsId=goodsId; } - + public Long getVipId() { return vipId; } - + public void setVipId(Long vipId) { this.vipId=vipId; } - + public String getIsOver() { return isOver; } - + public void setIsOver(String isOver) { this.isOver=isOver; } @@ -280,6 +402,6 @@ return MoneyUtil.add(realMoney,giftMoney); } - - + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUseFlow.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUseFlow.java index 8bb8780..8e4359e 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUseFlow.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUseFlow.java @@ -1,5 +1,7 @@ package com.matrix.system.hive.bean; +import com.fasterxml.jackson.annotation.JsonFormat; + import java.io.Serializable; import java.util.Date; /** @@ -27,7 +29,12 @@ * 订单编号 */ private String orderNo; - + + /** + * 微信支付编号 + */ + private String payNo; + /** * 操作员id @@ -43,6 +50,7 @@ /** * 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createTime; /** @@ -235,4 +243,12 @@ public void setTimes(Integer times) { this.times = times; } + + public String getPayNo() { + return payNo; + } + + public void setPayNo(String payNo) { + this.payNo = payNo; + } } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java index e75be3b..7eae13c 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java @@ -2,6 +2,7 @@ import com.matrix.core.anotations.Extend; import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; @@ -209,7 +210,7 @@ /** * 单会员是否只买一次 */ - private String isOnce; + private Integer isOnce; /** * 销售平台 @@ -393,7 +394,173 @@ */ private Integer isDel; + /** + * 购买有效期 + */ + private String buyValid; + /** + * 购买有效期单位 - 扩展字段用于参数接收 y/m/d + */ + private String buyDateUnit; + + /** + * 购买有效期时长 + */ + private Integer buyDateNum; + + /** + * 消耗有效期 + */ + private String useValid; + + /** + * 消耗有效期单位 - 扩展字段用于参数接收 y/m/d + */ + private String useDateUnit; + + /** + * 消耗有效期时长 + */ + private Integer useDateNum; + + /** + * 统一失效时间 + */ + private Date invalidTime; + + /** + * 任选套餐是否无限次 N-否 Y-是 + */ + private String isInfinite; + /** + *业绩规则id + */ + private Long achieveRuleId; + + /** + *业绩规则名称 + */ + @Extend + private String achieveRuleName; + + /** + * 支付方式 1-充值本金 2-赠送金额 3-积分 + */ + private String payMethods; + + /** + * 是否合作项目 + */ + private Integer isCooperate; + + public Integer getIsCooperate() { + return isCooperate; + } + + public void setIsCooperate(Integer isCooperate) { + this.isCooperate = isCooperate; + } + + public String getAchieveRuleName() { + return achieveRuleName; + } + + public void setAchieveRuleName(String achieveRuleName) { + this.achieveRuleName = achieveRuleName; + } + + public Long getAchieveRuleId() { + return achieveRuleId; + } + + public void setAchieveRuleId(Long achieveRuleId) { + this.achieveRuleId = achieveRuleId; + } + + public String getPayMethods() { + return payMethods; + } + + public void setPayMethods(String payMethods) { + this.payMethods = payMethods; + } + + public String getIsInfinite() { + return isInfinite; + } + + public void setIsInfinite(String isInfinite) { + this.isInfinite = isInfinite; + } + + public Integer getBuyDateNum() { + return buyDateNum; + } + + public void setBuyDateNum(Integer buyDateNum) { + this.buyDateNum = buyDateNum; + } + + public Integer getUseDateNum() { + return useDateNum; + } + + public void setUseDateNum(Integer useDateNum) { + this.useDateNum = useDateNum; + } + + public String getBuyValid() { + return buyValid; + } + + public void setBuyValid(String buyValid) { + if (StringUtils.isNotBlank(buyValid)) { + if (buyValid.contains("Y") || buyValid.contains("M") || buyValid.contains("D")) { + this.buyDateUnit = buyValid.substring(buyValid.length() - 1); + this.buyDateNum = Integer.parseInt(buyValid.substring(0, buyValid.length() - 1)); + } + } + this.buyValid = buyValid; + } + + public String getBuyDateUnit() { + return buyDateUnit; + } + + public void setBuyDateUnit(String buyDateUnit) { + this.buyDateUnit = buyDateUnit; + } + + public String getUseValid() { + return useValid; + } + + public void setUseValid(String useValid) { + if (StringUtils.isNotBlank(useValid)) { + if (useValid.contains("Y") || useValid.contains("M") || useValid.contains("D")) { + this.useDateUnit = useValid.substring(useValid.length() - 1); + this.useDateNum = Integer.parseInt(useValid.substring(0, useValid.length() - 1)); + } + } + this.useValid = useValid; + } + + public String getUseDateUnit() { + return useDateUnit; + } + + public void setUseDateUnit(String useDateUnit) { + this.useDateUnit = useDateUnit; + } + + public Date getInvalidTime() { + return invalidTime; + } + + public void setInvalidTime(Date invalidTime) { + this.invalidTime = invalidTime; + } public Integer getIsDel() { return isDel; @@ -848,11 +1015,12 @@ this.saleOffTime = saleOffTime; } - public String getIsOnce() { + + public Integer getIsOnce() { return isOnce; } - public void setIsOnce(String isOnce) { + public void setIsOnce(Integer isOnce) { this.isOnce = isOnce; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java new file mode 100644 index 0000000..fae082b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoodsCategory2.java @@ -0,0 +1,112 @@ +package com.matrix.system.hive.bean; + +import java.io.Serializable; + +/** + * + * @date 2016-07-30 09:54 + */ +public class ShoppingGoodsCategory2 implements Serializable{ + + private static final long serialVersionUID = 1L; + + + private String id; + + + /** + * 类型名称 + */ + private String name; + + + /** + * 父类型 + */ + private Long parentId; + + + /** + * 排序 + */ + private Integer sequence; + + /** + * 销售平台 + */ + private String salePlatform; + + + private Long shopId; + + private Long companyId; + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id=id; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name=name; + } + + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId=parentId; + } + + + public Integer getSequence() { + return sequence; + } + + public void setSequence(Integer sequence) { + this.sequence=sequence; + } + + public String getSalePlatform() { + return salePlatform; + } + + public void setSalePlatform(String salePlatform) { + this.salePlatform = salePlatform; + } + + @Override + public String toString() { + return "ShoppingGoodsCategory [id=" + id + ", name=" + name + + ", parentId=" + parentId + ", sequence=" + sequence + + ", salePlatform=" + salePlatform + "]"; + } + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java new file mode 100644 index 0000000..3085a5c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java @@ -0,0 +1,286 @@ +package com.matrix.system.hive.bean; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.pojo.EntityDTO; +import com.matrix.core.anotations.Extend; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.common.bean.EntityDTOExt; +import com.matrix.system.common.bean.SysUsers; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @description 跟进 + * @author + * @date 2021-01-10 15:15 + */ +public class SysFollowup extends EntityDTOExt{ + @Extend + private static final long serialVersionUID = 1L; + + + /** + * 主键 + */ + private Long id; + + + /** + * 员工ID + */ + private Long staffId; + + + /** + * 客户ID + */ + @NotNull(message = "客户ID不能为空") + @ApiModelProperty(value = "客户ID", example = "10") + private Long vipId; + + + /** + * 订单id + */ + @ApiModelProperty(value = "订单id", example = "10") + private Long orderId; + + + /** + * 服务单id + */ + @ApiModelProperty(value = "服务单id", example = "10") + private Long serviceId; + + + /** + * 门店id + */ + private Long shopId; + + + /** + * 公司id + */ + private Long companyId; + + + /** + * 下次跟进时间 + */ + @ApiModelProperty(value = "下次跟进时间", example = "2021-01-02 12:22") + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + private Date nextNotifyTime; + + + /** + * 跟进内容 + */ + @NotNull(message = "跟进内容不能为空") + @ApiModelProperty(value = "跟进内容", example = "") + private String content; + + + /** + * 可见范围1公开,2仅自己可见 + */ + @NotNull(message = "可见范围不能为空") + @ApiModelProperty(value = "可见范围1公开,2仅自己可见", example = "") + private Integer visible; + + + /** + * 订单摘要信息 + */ + @ApiModelProperty(value = "订单摘要信息", example = "") + private String orderAbstract; + + /** + * 点赞人ids + */ + @ApiModelProperty(value = "点赞人ids", example = "1,2") + private String zans; + + @Extend + @ApiModelProperty(value = "点赞人列表",example ="") + private List<SysUsers> zanUsers; + + @Extend + @ApiModelProperty(value = "图片集合", example = "") + private List<SysVipAlbum> albums; + + @Extend + @ApiModelProperty(value = "评论集合",example ="") + private List<SysFollowupComment> followupComments; + + @Extend + @ApiModelProperty(value = "员工名称",example ="") + private String staffName; + + @Extend + @ApiModelProperty(value = "员工头像",example ="") + private String staffPhoto; + + @Extend + @ApiModelProperty(value = "客户名称",example ="") + private String vipName; + + public String getStaffName() { + return staffName; + } + + public void setStaffName(String staffName) { + this.staffName = staffName; + } + + public String getStaffPhoto() { + return staffPhoto; + } + + public void setStaffPhoto(String staffPhoto) { + this.staffPhoto = staffPhoto; + } + + public String getVipName() { + return vipName; + } + + public void setVipName(String vipName) { + this.vipName = vipName; + } + + public List<SysFollowupComment> getFollowupComments() { + return followupComments; + } + + public void setFollowupComments(List<SysFollowupComment> followupComments) { + this.followupComments = followupComments; + } + + public Integer getVisible() { + return visible; + } + + public void setVisible(Integer visible) { + this.visible = visible; + } + + public List<SysUsers> getZanUsers() { + return zanUsers; + } + + public void setZanUsers(List<SysUsers> zanUsers) { + this.zanUsers = zanUsers; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getStaffId() { + return staffId; + } + + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public Long getServiceId() { + return serviceId; + } + + public void setServiceId(Long serviceId) { + this.serviceId = serviceId; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public List<SysVipAlbum> getAlbums() { + return albums; + } + + public void setAlbums(List<SysVipAlbum> albums) { + this.albums = albums; + } + + public Date getNextNotifyTime() { + return nextNotifyTime; + } + + public SysFollowup setNextNotifyTime(Date nextNotifyTime) { + this.nextNotifyTime=nextNotifyTime; + return this; + } + + + public String getContent() { + return content; + } + + public SysFollowup setContent(String content) { + this.content=content; + return this; + } + + + public String getOrderAbstract() { + return orderAbstract; + } + + public SysFollowup setOrderAbstract(String orderAbstract) { + this.orderAbstract=orderAbstract; + return this; + } + + + public String getZans() { + return zans; + } + + public SysFollowup setZans(String zans) { + this.zans=zans; + return this; + } + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java new file mode 100644 index 0000000..75602b4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java @@ -0,0 +1,90 @@ +package com.matrix.system.hive.bean; + +import com.matrix.core.pojo.EntityDTO; +import com.matrix.core.anotations.Extend; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @description 跟进评论 + * @author + * @date 2021-01-10 15:15 + */ +public class SysFollowupComment extends EntityDTO{ + @Extend + private static final long serialVersionUID = 1L; + + + /** + * 主键 + */ + private Long id; + + + /** + * 跟进id + */ + @NotNull(message = "跟进记录id不能为空") + @ApiModelProperty(value = "跟进id", example = "1") + private Long follId; + + + /** + * 员工ID + */ + private Long staffId; + + + /** + * 评论内容 + */ + @NotNull(message = "评论内容不能为空") + @ApiModelProperty(value = "评论内容不能为空", example = "不错") + private String content; + + + + public Long getId() { + return id; + } + + public SysFollowupComment setId(Long id) { + this.id=id; + return this; + } + + + public Long getFollId() { + return follId; + } + + public SysFollowupComment setFollId(Long follId) { + this.follId=follId; + return this; + } + + + public Long getStaffId() { + return staffId; + } + + public SysFollowupComment setStaffId(Long staffId) { + this.staffId=staffId; + return this; + } + + + public String getContent() { + return content; + } + + public SysFollowupComment setContent(String content) { + this.content=content; + return this; + } + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysInstoreInfo.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysInstoreInfo.java index 5974dbb..266437e 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysInstoreInfo.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysInstoreInfo.java @@ -18,6 +18,7 @@ private static final long serialVersionUID = 1L; + public static final String INSTORE_TYPE_RETURN = "退货入库"; /** * 序号 diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrder.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrder.java index bb4736d..f160d12 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrder.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrder.java @@ -15,7 +15,15 @@ */ public class SysOrder implements Serializable { - private static final long serialVersionUID = 1L; + /** + * 订单类型-销售订单 + */ + public static final int ORDER_TYPE_SEAL= 1; + + /** + * 订单类型-退款订单 + */ + public static final int ORDER_TYPE_REFUND= 2; /** * 序号 @@ -34,7 +42,7 @@ private Date orderTime; /** - * 收款 + * calculationType: 1, */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date payTime; @@ -77,24 +85,24 @@ /** * 订单总价 */ - private double total; + private Double total; /** * 折后价 */ - private double zkTotal; + private Double zkTotal; /** * 现金支付金额 */ - private double cashPay; + private Double cashPay; /** * 现金支付金额 */ - private double cardPay; + private Double cardPay; /** * 欠款金额 */ - private double arrears; + private Double arrears; /** * 店铺id @@ -114,6 +122,8 @@ * 订单明细 */ private List<SysOrderItem> items; + + private List<SysOrderFlow> flows; /** * 会员姓名 */ @@ -123,7 +133,12 @@ * 会员姓名 */ private String vipNo; - + + /** + * 订单类型1,销售订单,2退款订单 + */ + private Integer orderType; + /* 会员手机号 */ private String vipPhone; @@ -131,6 +146,8 @@ private String staffName; private String shopName; + + private String shopShortName; private Long searchShop; /** @@ -155,6 +172,89 @@ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date endTimeVo; + /** + * 消费次数 + */ + private Integer times; + + + private String type; + + /** + * 原有订单ID 退款时使用 + */ + private Long oldOrderId; + + /** + * 该订单有退款 + */ + public static final Integer IS_HAS_REFUND_Y = 1; + + /** + * 该订单无退款 + */ + public static final Integer IS_HAS_REFUND_N = 2; + + /** + * 是否发生退款 1-是 2-否 + */ + private Integer isHasRefund; + + public Integer getIsHasRefund() { + return isHasRefund; + } + + public void setIsHasRefund(Integer isHasRefund) { + this.isHasRefund = isHasRefund; + } + + public Long getOldOrderId() { + return oldOrderId; + } + + public void setOldOrderId(Long oldOrderId) { + this.oldOrderId = oldOrderId; + } + + public List<SysOrderFlow> getFlows() { + return flows; + } + + public void setFlows(List<SysOrderFlow> flows) { + this.flows = flows; + } + + public String getShopShortName() { + return shopShortName; + } + + public void setShopShortName(String shopShortName) { + this.shopShortName = shopShortName; + } + + public Integer getOrderType() { + return orderType; + } + + public void setOrderType(Integer orderType) { + this.orderType = orderType; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Integer getTimes() { + return times; + } + + public void setTimes(Integer times) { + this.times = times; + } public String getBeatuyId() { return beatuyId; @@ -188,19 +288,19 @@ this.searchShop = searchShop; } - public double getArrears() { + public Double getArrears() { return arrears; } - public void setArrears(double arrears) { + public void setArrears(Double arrears) { this.arrears = arrears; } - public double getCardPay() { + public Double getCardPay() { return cardPay; } - public void setCardPay(double cardPay) { + public void setCardPay(Double cardPay) { this.cardPay = cardPay; } @@ -227,11 +327,11 @@ public void setEndTimeVo(Date endTimeVo) { this.endTimeVo = endTimeVo; } - public double getCashPay() { + public Double getCashPay() { return cashPay; } - public void setCashPay(double cashPay) { + public void setCashPay(Double cashPay) { this.cashPay = cashPay; } @@ -337,11 +437,11 @@ this.activity = activity; } - public double getTotal() { + public Double getTotal() { return total; } - public void setTotal(double total) { + public void setTotal(Double total) { this.total = total; } @@ -366,11 +466,11 @@ this.changeId = changeId; } - public double getZkTotal() { + public Double getZkTotal() { return zkTotal; } - public void setZkTotal(double zkTotal) { + public void setZkTotal(Double zkTotal) { this.zkTotal = zkTotal; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderFlow.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderFlow.java new file mode 100644 index 0000000..41b23ab --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderFlow.java @@ -0,0 +1,74 @@ +package com.matrix.system.hive.bean; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.anotations.Extend; +import com.matrix.core.tools.DateUtil; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author wzy + * @date 2021-01-07 + **/ +@Data +public class SysOrderFlow implements Serializable { + private static final long serialVersionUID = 7519131902836023680L; + + public static final String PAY_METHOD_CARD = "储值卡"; + + public static final String PAY_METHOD_ARREARS = "欠款"; + + public static final String FLOW_TYPE_BUY = "购买"; + + public static final String FLOW_TYPE_REPAY = "还款"; + + public static final String FLOW_TYPE_REFUND = "退款"; + + public static final String IS_GIFT_Y = "Y"; + public static final String IS_GIFT_N = "N"; + + private String createBy; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT-8") + private Date createTime; + + private String updateBy; + + private Date updateTime; + + private Long id; + + private String flowNo; + + private Long orderId; + + private String flowContent; + + private String flowType; + + private BigDecimal amount; + + private String payMethod; + + private Long vipId; + + private Long cardId; + /** + * 扩展字段-支付卡名称 + */ + @Extend + private String cardName; + + private String isGift; + + private String orderNo; + + private Long shopId; + + private Long companyId; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderItem.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderItem.java index 366c0d8..acd3b19 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderItem.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderItem.java @@ -33,6 +33,11 @@ private Integer count; + /** + * 退款数量 + */ + private Integer refundCount; + /** * 是否为赠送和 是否 @@ -87,11 +92,8 @@ * 欠款金额 */ private Double arrears; - - - - //页面参数使用 + /** * 付款方式 */ @@ -108,8 +110,7 @@ */ private Long cardId; - - + /** * 是否为综合卡创建的订单明细 * 1是 @@ -123,6 +124,53 @@ */ private ShoppingGoods shoppingGoods; + + /** + * 原有数量 + */ + private int preCount; + + /** + * 是否退库存 + */ + private String isReturnStore; + + /** + * 退款时,原itemid + */ + private Long oldItemId; + + public Long getOldItemId() { + return oldItemId; + } + + public void setOldItemId(Long oldItemId) { + this.oldItemId = oldItemId; + } + + public String getIsReturnStore() { + return isReturnStore; + } + + public void setIsReturnStore(String isReturnStore) { + this.isReturnStore = isReturnStore; + } + + public int getPreCount() { + return preCount; + } + + public Integer getRefundCount() { + return refundCount; + } + + public void setRefundCount(Integer refundCount) { + this.refundCount = refundCount; + } + + public void setPreCount(int preCount) { + this.preCount = preCount; + } public ShoppingGoods getShoppingGoods() { return shoppingGoods; @@ -143,15 +191,15 @@ /** * 业绩计算 */ - private List<AchieveNew> achaeveList; + private List<AchieveNew> achieveList; - public List<AchieveNew> getAchaeveList() { - return achaeveList; + public List<AchieveNew> getAchieveList() { + return achieveList; } - public void setAchaeveList(List<AchieveNew> achaeveList) { - this.achaeveList = achaeveList; + public void setAchieveList(List<AchieveNew> achieveList) { + this.achieveList = achieveList; } public String getPayMethodDetail() { diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java index 252be5f..628ca52 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java @@ -1,5 +1,6 @@ package com.matrix.system.hive.bean; +import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.anotations.Extend; import com.matrix.core.tools.DateUtil; import org.springframework.format.annotation.DateTimeFormat; @@ -36,11 +37,14 @@ /** * 订单创建时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date createTime; /** * 订单划扣时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date consumeTime; /** @@ -60,9 +64,7 @@ * 床位 */ private Long bedId; - /** - * 床位 - */ + private Long companyId; /** @@ -230,6 +232,14 @@ * 床位名称 */ private String bedName; + /** + * 评价 + */ + private String comment; + /** + * 评价回复 + */ + private String reply; /** * 商机 */ @@ -239,6 +249,12 @@ * 服务预计时长 */ private Integer totalTime; + + + /** + * 到时提醒次数 + */ + private Integer overtimeNotice; @@ -253,6 +269,22 @@ * 门店 */ private SysShopInfo shopInfo; + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getReply() { + return reply; + } + + public void setReply(String reply) { + this.reply = reply; + } @Extend private String shopName; @@ -287,12 +319,14 @@ /** * 扩展属性-预约查询开始时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date beginTime; /** * 扩展属性-预约查询结束时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date closureTime; @@ -302,6 +336,15 @@ @Extend private String pageFlae; + + public Integer getOvertimeNotice() { + return overtimeNotice; + } + + public void setOvertimeNotice(Integer overtimeNotice) { + this.overtimeNotice = overtimeNotice; + } + public String getPageFlae() { return pageFlae; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUse.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUse.java index a0c163e..a019374 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUse.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUse.java @@ -2,7 +2,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.anotations.Extend; +import com.matrix.core.pojo.EntityDTO; import com.matrix.core.tools.DateUtil; +import com.matrix.system.common.bean.EntityDTOExt; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; @@ -13,7 +15,7 @@ /** * @date 2016-07-03 20:53 */ -public class SysProjUse implements Serializable { +public class SysProjUse extends EntityDTO { private static final long serialVersionUID = 1L; @@ -44,19 +46,27 @@ /** * 有效期 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) private Date failTime; + + + private Date targetFailTime; /** * 套餐id */ private Long taocanId; - - /** * 订单明细id 不明确 */ private Long orderItemId; + + /** + * 订单id + */ + @Extend + private Long orderId; /** * 单次扣减金额(理解为单次手工业绩) @@ -115,10 +125,93 @@ private String isCourse; /** + * 任选套餐 是否无限次 Y-是 N-否 + */ + private String isInfinite; + + /** * 单次划扣次数 */ private Integer deductionNum; + private Integer timeLength; + + private String img; + + private String queryKey; + + @Extend + private String updateRemark; + + /** + * 套餐/项目剩余次数 + */ + private Integer remainCount; + + public Integer getRemainCount() { + return remainCount; + } + + public void setRemainCount(Integer remainCount) { + this.remainCount = remainCount; + } + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public String getUpdateRemark() { + return updateRemark; + } + + public void setUpdateRemark(String updateRemark) { + this.updateRemark = updateRemark; + } + + public Date getTargetFailTime() { + return targetFailTime; + } + + public void setTargetFailTime(Date targetFailTime) { + this.targetFailTime = targetFailTime; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public Integer getTimeLength() { + return timeLength; + } + + public void setTimeLength(Integer timeLength) { + this.timeLength = timeLength; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getIsInfinite() { + return isInfinite; + } + + public void setIsInfinite(String isInfinite) { + this.isInfinite = isInfinite; + } + public String getIsCourse() { return isCourse; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java new file mode 100644 index 0000000..5c23ed7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java @@ -0,0 +1,96 @@ +package com.matrix.system.hive.bean; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.anotations.Extend; +import com.matrix.core.pojo.EntityDTO; +import com.matrix.core.tools.DateUtil; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + + +/**项目余次操作记录 + * @date 2016-07-03 20:53 + */ +@Data +public class SysProjUseFlow extends EntityDTO { + + private static final long serialVersionUID = 1L; + + /** + */ + private Long id; + + + /** + * 项目id + */ + private Long projUseId; + + /** + * 剩余次数 + */ + private Integer surplusCount; + + /** + * 是否使用完成Y完成,N未完成 + */ + private String isOver; + + /** + * 有效期 + */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) + private Date failTime; + + /** + * 单次扣减金额 + */ + private Double price; + + /** + * 套餐状态,有效,无效,冻结,转让,退款 + */ + private String status; + + + + /** + * 使用情况余额 + */ + private Double balance; + + /** + * 备注 + */ + private String remark; + + + + /** + * 项目名称 + */ + private String projName; + + /** + * 操作类型 + */ + private String optionType; + + /** + * 开始时间 + */ + @Extend + private String beginTime; + + /** + *结束时间 + */ + @Extend + private String endTime; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysSkinCheckRecord.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysSkinCheckRecord.java index 6f45a21..62d9262 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysSkinCheckRecord.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysSkinCheckRecord.java @@ -3,6 +3,8 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.pojo.EntityDTO; import com.matrix.core.anotations.Extend; +import com.matrix.core.tools.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; import java.util.List; @@ -55,7 +57,14 @@ private Date checkTime; private String checkTimeStr; - + + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) + @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") + private Date beginTime; + + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) + @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") + private Date endTime; /** * 扩展字段 */ @@ -89,11 +98,38 @@ private String userName; @Extend + private String sex; + + @Extend private String shopName; @Extend private String checkUserName; + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + public List<SysSkinDetail> getAnalysisDetail() { return analysisDetail; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysStoreInfo.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysStoreInfo.java index 4be4827..658e142 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysStoreInfo.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysStoreInfo.java @@ -87,6 +87,17 @@ private String name; + @Extend + private String queryKey; + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + public String getName() { return name; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java new file mode 100644 index 0000000..b6e2a82 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java @@ -0,0 +1,96 @@ +package com.matrix.system.hive.bean; + +import com.matrix.core.pojo.EntityDTO; +import com.matrix.core.anotations.Extend; + +/** + * @description 客户相册 + * @author + * @date 2021-01-10 15:15 + */ +public class SysVipAlbum extends EntityDTO{ + @Extend + private static final long serialVersionUID = 1L; + public static final int SOURCE_FOLLOW = 1; + public static final int SOURCE_SKILL = 2; + + + /** + * 主键 + */ + private Long id; + + + /** + * 客户ID + */ + private Long vipId; + + + /** + * 图片路径 + */ + private String img; + + + /** + * 来源1,跟进,2批发检测 + */ + private Integer source; + + + /** + * 来源主键 + */ + private Long sourceId; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public String getImg() { + return img; + } + + public SysVipAlbum setImg(String img) { + this.img=img; + return this; + } + + + public Integer getSource() { + return source; + } + + public SysVipAlbum setSource(Integer source) { + this.source=source; + return this; + } + + + public Long getSourceId() { + return sourceId; + } + + public SysVipAlbum setSourceId(Long sourceId) { + this.sourceId=sourceId; + return this; + } + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java index 92105d9..09224d4 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java @@ -1,25 +1,35 @@ package com.matrix.system.hive.bean; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.google.gson.annotations.Expose; import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.plugin.util.ExcelAnnotation; +import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; import java.util.List; -/** - * @Title: SysVipInfo.java - * @Package com.zkingsoft.model - * @description - * @author jyy - * @email 18075895212@qq.com - * @date 2016年7月14日 上午10:59:29 - */ + +@Data public class SysVipInfo implements Serializable { private static final long serialVersionUID = 1L; + /** + * 是销售员 + */ + public static final int IS_SALES = 1; + /** + * 不是销售员 + */ + public static final int NOT_SALES = 2; + + + /** * 1、成交客户 * **/ @@ -91,8 +101,11 @@ /** * 生日 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) private Date birthday1; + + private String age; /** * 地址 @@ -139,6 +152,7 @@ /** * 注册时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") private Date createTime; /** * 备注 @@ -185,6 +199,26 @@ private Long companyId; + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 推荐人 + */ + private Long recommendId; + //血型 private String blood; @@ -203,41 +237,65 @@ private Date createDistributionTime; + private SysOrder sysOrder; - public Integer getIsDeal() { - return isDeal; - } + /** + * 可提现金额 + */ + private Double withdrawalCash; + /** + *推广员等级 + */ + private Long salesmanGrade; - public void setIsDeal(Integer isDeal) { - this.isDeal = isDeal; - } - - public Long getParentId() { - return parentId; - } - - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - public Date getCreateDistributionTime() { - return createDistributionTime; - } - - public void setCreateDistributionTime(Date createDistributionTime) { - this.createDistributionTime = createDistributionTime; - } - - public Date getHandleTime() { - return handleTime; - } - - public void setHandleTime(Date handleTime) { - this.handleTime = handleTime; - } + /** + * 用户昵称 + */ + private String nickName; - /** 扩展信息 **/ + /** + * 头像 + */ + private String avatarUrl; + + /** + * 性别 1、男 2、女 0、未知 + */ + private Integer gender; + + /** + * 用户所在国家 + */ + private String country; + + + + /** + * 用户是否授权 1、是 2、否 + */ + private Integer userIsAuthorize; + + + /** + * 绑定上级用户时间 + */ + private Date bindingParentTime; + + + /** + * 是否是销售员(1=是,2=否) + */ + private Integer isSales; + + /** + * 用户类型 1、待审核 2、审核通过 0、审核未通过 + */ + private Integer fenxiaoState; + + private String sessionKey; + + /** * 会员等级id */ @@ -273,6 +331,8 @@ * 页面上的入会时间 */ private String inDateVo; + + /** * 页面上的生日 */ @@ -341,116 +401,31 @@ /** * 美疗师集合 */ + @Expose(serialize = false) private List<MyBeatician> beauticains; /** * 会员问卷信息-答案,传递数据使用 */ + @Expose(serialize = false) List<VipAnswer> vipAnswers; - public Long getCompanyId() { - return companyId; - } + /** + * 会员标签 + */ + @Expose(serialize = false) + List<SysVipLabel> labels; - public void setCompanyId(Long companyId) { - this.companyId = companyId; - } - - public String getOpenId() { - return openId; - } - - public void setOpenId(String openId) { - this.openId = openId; - } - - public String getPayTotal() { - return payTotal; - } - - public void setPayTotal(String payTotal) { - this.payTotal = payTotal; - } - - public Integer getCostTotal() { - return costTotal; - } - - public void setCostTotal(Integer costTotal) { - this.costTotal = costTotal; - } - - public String getCostNum() { - return costNum; - } - - public void setCostNum(String costNum) { - this.costNum = costNum; - } - - public String getTimeStart() { - return timeStart; - } - - public void setTimeStart(String timeStart) { - this.timeStart = timeStart; - } - - public String getTimeEnd() { - return timeEnd; - } - - public void setTimeEnd(String timeEnd) { - this.timeEnd = timeEnd; - } - - public Integer getVipNum() { - return vipNum; - } - - public void setVipNum(Integer vipNum) { - this.vipNum = vipNum; - } - - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getYear() { - return year; - } - - public void setYear(String year) { - this.year = year; - } - - public boolean isQdSign() { - return qdSign; - } /** * 会员所有的充值卡 */ + @Expose(serialize = false,deserialize = false) private List<MoneyCardUse> cards; - - - - public List<MoneyCardUse> getCards() { - return cards; - } - - public void setCards(List<MoneyCardUse> cards) { - this.cards = cards; - } @@ -460,443 +435,10 @@ * 没签到false */ private boolean qdSign; + private String name; - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - public boolean getQdSign() { - return qdSign; - } - - public void setQdSign(boolean qdSign) { - this.qdSign = qdSign; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public String getDisease() { - return disease; - } - - public void setDisease(String disease) { - this.disease = disease; - } - - public Date getStartTime() { - return startTime; - } - - public Integer getRankType() { - return rankType; - } - - public void setRankType(Integer rankType) { - this.rankType = rankType; - } - - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - - public Date getEndTime() { - return endTime; - } - - - - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - - public Integer getRanking() { - return ranking; - } - - public void setRanking(Integer ranking) { - this.ranking = ranking; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getShopName() { - return shopName; - } - - public String getInDateVo() { - return inDateVo; - } - - public void setInDateVo(String inDateVo) { - this.inDateVo = inDateVo; - } - - public String getBirthday1Vo() { - return birthday1Vo; - } - - public void setBirthday1Vo(String birthday1Vo) { - this.birthday1Vo = birthday1Vo; - } - - public void setShopName(String shopName) { - this.shopName = shopName; - } - - public Long getShopId() { - return shopId; - } - - public void setShopId(Long shopId) { - this.shopId = shopId; - } - public Long getStaffId() { - return staffId; - } - - public void setStaffId(Long staffId) { - this.staffId = staffId; - } - - - - - - public String getStaffName() { - return staffName; - } - - public void setStaffName(String staffName) { - this.staffName = staffName; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getVipNo() { - return vipNo; - } - - public void setVipNo(String vipNo) { - this.vipNo = vipNo; - } - - public String getVipName() { - return vipName; - } - - public void setVipName(String vipName) { - this.vipName = vipName; - } - - - public String getZjm() { - return zjm; - } - - public void setZjm(String zjm) { - this.zjm = zjm; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - } - - public Date getBirthday1() { - return birthday1; - } - - public void setBirthday1(Date birthday1) { - this.birthday1 = birthday1; - } - - public String getAddr() { - return addr; - } - - public void setAddr(String addr) { - this.addr = addr; - } - - public String getConstell() { - return constell; - } - - public void setConstell(String constell) { - this.constell = constell; - } - - public String getAnimalSign() { - return animalSign; - } - - public void setAnimalSign(String animalSign) { - this.animalSign = animalSign; - } - - public String getArrivalWay() { - return arrivalWay; - } - - public void setArrivalWay(String arrivalWay) { - this.arrivalWay = arrivalWay; - } - - public String getVipType() { - return vipType; - } - - public void setVipType(String vipType) { - this.vipType = vipType; - } - - public String getVipState() { - return vipState; - } - - public void setVipState(String vipState) { - this.vipState = vipState; - } - - public String getIsDelete() { - return isDelete; - } - - public void setIsDelete(String isDelete) { - this.isDelete = isDelete; - } - - public Integer getPointAll() { - return pointAll; - } - - public void setPointAll(Integer pointAll) { - this.pointAll = pointAll; - } - - public Double getCommissionAll() { - return commissionAll; - } - - public void setCommissionAll(Double commissionAll) { - this.commissionAll = commissionAll; - } - - public Date getInDate() { - return inDate; - } - - public void setInDate(Date inDate) { - this.inDate = inDate; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPassWord() { - return passWord; - } - - public void setPassWord(String passWord) { - this.passWord = passWord; - } - - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Long getLevelId() { - return levelId; - } - - public void setLevelId(Long levelId) { - this.levelId = levelId; - } - - public SysVipLevel getVipLevel() { - return vipLevel; - } - - public void setVipLevel(SysVipLevel vipLevel) { - this.vipLevel = vipLevel; - } - - - - - public String getStatu() { - return statu; - } - - public void setStatu(String statu) { - this.statu = statu; - } - - public Double getBalance() { - return balance; - } - - public void setBalance(Double balance) { - this.balance = balance; - } - - - - public MoneyCardUse getLevelCard() { - return levelCard; - } - - public void setLevelCard(MoneyCardUse levelCard) { - this.levelCard = levelCard; - } - - public String getBeatuyId() { - return beatuyId; - } - - public void setBeatuyId(String beatuyId) { - this.beatuyId = beatuyId; - } - - public List<MyBeatician> getBeauticains() { - return beauticains; - } - - public void setBeauticains(List<MyBeatician> beauticains) { - this.beauticains = beauticains; - } - - public String getBlood() { - return blood; - } - - public void setBlood(String blood) { - this.blood = blood; - } - - public String getSfCard() { - return sfCard; - } - - public void setSfCard(String sfCard) { - this.sfCard = sfCard; - } - - public String getLink() { - return link; - } - - public void setLink(String link) { - this.link = link; - } - - public String getMarry() { - return marry; - } - - public void setMarry(String marry) { - this.marry = marry; - } - - public String getVocation() { - return vocation; - } - - public void setVocation(String vocation) { - this.vocation = vocation; - } - - public List<VipAnswer> getVipAnswers() { - return vipAnswers; - } - - public void setVipAnswers(List<VipAnswer> vipAnswers) { - this.vipAnswers = vipAnswers; - } - - - public Integer getBirthdayType() { - return birthdayType; - } - - public void setBirthdayType(Integer birthdayType) { - this.birthdayType = birthdayType; - } - - @Override - public String toString() { - return "SysVipInfo [id=" + id + ", vipNo=" + vipNo + ", vipName=" - + vipName + ", phone=" + phone + ", vipType=" + vipType - + ", shopName=" + shopName + ", vipState=" + vipState - + ", passWord=" + passWord + ", beatuyId=" + beatuyId - + ", sex=" + sex + ", birthday1=" + birthday1 + ", addr=" - + addr + ", constell=" + constell + ", animalSign=" - + animalSign + ", arrivalWay=" + arrivalWay + ", photo=" - + photo + ", pointAll=" + pointAll + ", commissionAll=" - + commissionAll + ", inDate=" + inDate + ", createTime=" - + createTime + ", remark=" + remark + ", staffId=" + staffId - + ", shopId=" + shopId + ", isDelete=" + isDelete + ", email=" - + email + ", blood=" + blood + ", sfCard=" + sfCard + ", link=" - + link + ", marry=" + marry + ", vocation=" + vocation - + ", levelId=" + levelId + ", uuid=" + uuid + ", balance=" - + balance + ", levelCard=" + levelCard + ", vipLevel=" - + vipLevel + ", staffName=" + staffName + ", inDateVo=" - + inDateVo + ", birthday1Vo=" + birthday1Vo + ", ranking=" - + ranking + ", startTime=" + startTime + ", endTime=" + endTime - + ", rankType=" + rankType + ", year=" + year + ", vipNum=" - + vipNum + ", timeStart=" + timeStart + ", timeEnd=" + timeEnd - + ", payTotal=" + payTotal + ", costTotal=" + costTotal - + ", costNum=" + costNum + ", openId=" + openId + ", statu=" - + statu + ", beauticains=" + beauticains + ", vipAnswers=" - + vipAnswers + ", cards=" + cards + ", qdSign=" + qdSign + "]"; - } - - + private BigDecimal arrears; - } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java new file mode 100644 index 0000000..edfde3a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java @@ -0,0 +1,122 @@ +package com.matrix.system.hive.bean; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author wzy + * @date 2020-12-17 + **/ +public class SysVipLabel implements Serializable { + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建人 + */ + private String createBy; + + /** + * 主键ID + */ + private Long id; + + /** + * 标签内容 + */ + private String label; + + private Long shopId; + + private Long companyId; + + private Long userId; + + private Integer isAll; + + private String color; + + private String shopName; + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Integer getIsAll() { + return isAll; + } + + public void setIsAll(Integer isAll) { + this.isAll = isAll; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabelRelate.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabelRelate.java new file mode 100644 index 0000000..d3fdd37 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabelRelate.java @@ -0,0 +1,41 @@ +package com.matrix.system.hive.bean; + +import java.io.Serializable; + +/** + * @author wzy + * @date 2021-01-22 + **/ +public class SysVipLabelRelate implements Serializable { + private static final long serialVersionUID = 1860770077746416680L; + + private Long id; + + private Long labelId; + + private Long vipId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getLabelId() { + return labelId; + } + + public void setLabelId(Long labelId) { + this.labelId = labelId; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLevel.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLevel.java index 5b3f178..e235061 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLevel.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLevel.java @@ -54,7 +54,15 @@ private Long shopId; + private Long companyId; + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } public Long getShopId() { return shopId; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java index 01f07c0..ec7c010 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java @@ -1,11 +1,22 @@ package com.matrix.system.hive.dao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.vo.OrderDetailAchieveItemVo; +import com.matrix.system.app.vo.RankingVo; +import com.matrix.system.app.vo.UserAchieveVo; +import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.dto.AchieveNewStatisticsDto; +import com.matrix.system.hive.vo.AchieveNewStatisticsVo; +import com.matrix.system.hive.vo.DailyBeautyListVo; +import org.apache.ibatis.annotations.Param; + +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; - -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.hive.bean.AchieveNew; -import org.apache.ibatis.annotations.Param; /** @@ -14,7 +25,7 @@ */ -public interface AchieveNewDao{ +public interface AchieveNewDao extends BaseMapper<AchieveNew> { public int insert(@Param("item") AchieveNew achieveNew); @@ -51,7 +62,41 @@ public List<AchieveNew> findSumDailyInfoNew(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo); - - - + + List<Map<String, Object>> selectVipConsumeStatisticsList(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo); + + int selectVipConsumeStatisticsTotal(@Param("record") AchieveNew achieveNew); + + UserAchieveVo selectUserAchieveByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("userId") Long userId); + + List<OrderDetailAchieveItemVo> selectApiOrderItemAchieve(@Param("itemId") Long itemId); + + List<RankingVo> selectShopConsumeAchieveRanking(@Param("record") AchieveNew achieveNew); + + List<RankingVo> selectShopSaleAchieveRanking(@Param("record") AchieveNew achieveNew); + + List<RankingVo> selectBeauticianConsumeAchieveRanking(@Param("record") AchieveNew achieveNew); + + List<AchieveNew> selectOrderItemAchieveByOrderId(Long orderId); + + List<RankingVo> selectStaffSaleAchieveRanking(@Param("record") AchieveNew achieveNew); + + int deleteByOrderId(@Param("orderId") Long orderId); + + List<AchieveNew> selectSaleManAchieveList(@Param("saleId") Long saleId, @Param("vipId") Long vipId, @Param("date") Date date); + + List<AchieveNew> selectBeautyManAchieveList(@Param("beautyId") Long beautyId, @Param("vipId") Long vipId, @Param("date") Date date); + + int updateAchieveNumOfPeople(@Param("list") List<AchieveNew> list, @Param("num") Double num); + + IPage<AchieveNewStatisticsVo> achieveNewStatistics(Page<AchieveNewStatisticsVo> page, @Param("record")AchieveNewStatisticsDto queryDto); + + void setPayMethod(@Param("paymethod") String paymethod, @Param("list") ArrayList<Long> ids); + + List<RankingVo> selectNumOfPeopleAchieveRanking(@Param("record") AchieveNew achieveNew); + + List<DailyBeautyListVo> selectDailyBeautyList(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo); + int selectDailyBeautyListTotal(@Param("record") AchieveNew achieveNew); + + String selectPlInfoByVipIdAndDate(@Param("datatime") Date datatime, @Param("vipId") Long vipId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveRuleDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveRuleDao.java new file mode 100644 index 0000000..08034c3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveRuleDao.java @@ -0,0 +1,11 @@ +package com.matrix.system.hive.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.hive.bean.AchieveRule; + +/** + * 业绩规则dao + */ +public interface AchieveRuleDao extends BaseMapper<AchieveRule> { + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/ArticleDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/ArticleDao.java index 681ed4e..644d380 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/ArticleDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/ArticleDao.java @@ -2,6 +2,7 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.system.hive.bean.Article; +import com.matrix.system.hive.bean.ArticleType; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -31,5 +32,7 @@ public int selectTotalRecord(@Param("record") Article article); public Article selectById(Long id); - + + public List<Article> selectApiArticleListInPage(@Param("record") Article article, @Param("pageVo") PaginationVO pageVo); + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardAssembleDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardAssembleDao.java index 516c0ca..1e9ccb6 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardAssembleDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardAssembleDao.java @@ -3,7 +3,9 @@ import java.util.List; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.vo.ShoppingGoodsDetailVo; import com.matrix.system.hive.bean.MoneyCardAssemble; +import com.matrix.system.hive.bean.ShoppingGoodsCategory; import org.apache.ibatis.annotations.Param; @@ -37,4 +39,8 @@ public void batchInsert(@Param("list") List<MoneyCardAssemble> newAssemble); public List<MoneyCardAssemble> selectByCardId(Long cardId); + + List<ShoppingGoodsDetailVo> selectCardRelationGoods(@Param("cardId") Long cardId); + + List<ShoppingGoodsCategory> selectCardRelationCategory(@Param("cardId") Long cardId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java index c989c1f..4f422ae 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java @@ -1,5 +1,6 @@ package com.matrix.system.hive.dao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.matrix.core.pojo.PaginationVO; import com.matrix.system.hive.bean.MoneyCardUse; import org.apache.ibatis.annotations.Param; @@ -15,7 +16,7 @@ */ -public interface MoneyCardUseDao{ +public interface MoneyCardUseDao extends BaseMapper<MoneyCardUse> { public int insert(MoneyCardUse moneyCardUse); @@ -84,5 +85,7 @@ public Double selectVipCardTotalMoney(@Param("vipId") Long vipId); - + int updateInvalidMoneyCardUse(); + + void updateId(@Param("id")Long id, @Param("newId")Long i); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java index 5c4bad7..7a26149 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java @@ -1,10 +1,11 @@ package com.matrix.system.hive.dao; -import java.util.List; - import com.matrix.core.pojo.PaginationVO; import com.matrix.system.hive.bean.MoneyCardUseFlow; +import com.matrix.system.shopXcx.api.dto.MoneyCardUseFlowDto; import org.apache.ibatis.annotations.Param; + +import java.util.List; /** @@ -25,10 +26,14 @@ public List<MoneyCardUseFlow> selectInPage(@Param("record") MoneyCardUseFlow moneyCardUseFlow, @Param("pageVo") PaginationVO pageVo); + public List<MoneyCardUseFlow> selectForWxInPage(@Param("record")MoneyCardUseFlowDto moneyCardUseFlowDto); + public List<MoneyCardUseFlow> selectByModel(@Param("record") MoneyCardUseFlow moneyCardUseFlow); public int selectTotalRecord(@Param("record") MoneyCardUseFlow moneyCardUseFlow); public MoneyCardUseFlow selectById(Long id); + + int updateVipCardId(@Param("vipId") Long vipId, @Param("cardId") Long cardId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseV2Dao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseV2Dao.java new file mode 100644 index 0000000..741d039 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseV2Dao.java @@ -0,0 +1,12 @@ +package com.matrix.system.hive.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.hive.bean.MoneyCardUse; + +/** + * @description 订单表 + */ +public interface MoneyCardUseV2Dao extends BaseMapper<MoneyCardUse> { + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/QuestionDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/QuestionDao.java index 19a388a..b102348 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/QuestionDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/QuestionDao.java @@ -47,6 +47,6 @@ * @param type 问卷分类 * @return */ - public List<Question> selectVipAnswerAllByModel(@Param("id") Long id, @Param("type") String type); + public List<Question> selectVipAnswerAllByModel(@Param("id") Long id,@Param("companyId") Long companyId, @Param("type") String type); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsAssembleDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsAssembleDao.java index ac6776e..3abe996 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsAssembleDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsAssembleDao.java @@ -3,6 +3,7 @@ import java.util.List; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.vo.ShoppingGoodsDetailVo; import com.matrix.system.hive.bean.ShoppingGoodsAssemble; import org.apache.ibatis.annotations.Param; @@ -63,4 +64,6 @@ public int deleteByGoodsId(@Param("shoppingGoodsId") Long shoppingGoodsId); public void batchInsert(@Param("list") List<ShoppingGoodsAssemble> list); + + List<ShoppingGoodsDetailVo> selectGoodsRelationGoodsList(@Param("goodsId") Long id, @Param("goodsType") String goodsType); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsCategoryDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsCategoryDao.java index b954c8b..beb0efd 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsCategoryDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsCategoryDao.java @@ -35,4 +35,6 @@ public int batchInsert(@Param("list")List<ShoppingGoodsCategory> shoppingGoodsCategoryList); + List<ShoppingGoodsCategory> selectChildNodesByName(@Param("record") ShoppingGoodsCategory shoppingGoodsCategory); + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java index d7acfcc..cc06823 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java @@ -1,6 +1,8 @@ package com.matrix.system.hive.dao; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.dto.ShoppingGoodsListDto; +import com.matrix.system.app.vo.ShoppingGoodsListVo; import com.matrix.system.hive.bean.ShoppingGoods; import org.apache.ibatis.annotations.Param; @@ -83,4 +85,12 @@ * @return */ public ShoppingGoods selectVipCzGoods(); + + List<ShoppingGoodsListVo> selectShoppingGoodsApiInPage(@Param("record") ShoppingGoodsListDto shoppingGoodsListDto, @Param("pageVo") PaginationVO pageVo); + + int selectShopppingGoodsAipTotal(@Param("record") ShoppingGoodsListDto shoppingGoodsListDto); + + public List<ShoppingGoods> selectByIds(@Param("ids")List<Integer> ids); + + int updateInvalidProduct(); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBeauticianStateDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBeauticianStateDao.java index c701b27..6a318c6 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBeauticianStateDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBeauticianStateDao.java @@ -2,6 +2,7 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysProjUse; import org.apache.ibatis.annotations.Param; import java.util.Date; @@ -73,5 +74,8 @@ public int summaryItemDetailTotal(Map<String,Object> obj); + List<SysBeauticianState> selectByProjUse(@Param("list") List<SysProjUse> list, @Param("state") String state); + + List<SysBeauticianState> selectBeauticianStateByPuseIdAndNoStatus(@Param("puseId") Long puseId, @Param("state") String state); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java index d4ba3fe..5b94366 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java @@ -1,8 +1,11 @@ package com.matrix.system.hive.dao; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.vo.BusinessesDataShowVo; import com.matrix.system.hive.bean.SysBusinessData; import com.matrix.system.hive.statistics.BusinessDataShowVo; +import com.matrix.system.hive.statistics.DailySaleVo; +import com.matrix.system.hiveErp.analysUtil.StatisticsTimeDaoParam; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -44,5 +47,12 @@ public SysBusinessData selectById(Integer id); public SysBusinessData selectForUpdate(Integer id); - + + List<BusinessesDataShowVo> selectApiBusinessDataInPage(@Param("record") SysBusinessData data,@Param("pageVo") PaginationVO pageVo); + + int selectApiBusinessDataTotal(@Param("record") SysBusinessData data); + + List<BusinessesDataShowVo> selectApiBusinessData(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + List<DailySaleVo> selectDailySaleData(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java new file mode 100644 index 0000000..224e6c1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java @@ -0,0 +1,42 @@ +package com.matrix.system.hive.dao; + +import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysFollowupComment; + +/** + * @description 跟进评论 + * @author + * @date 2021-01-10 15:15 + */ +public interface SysFollowupCommentDao{ + + public int insert(@Param("item") SysFollowupComment sysFollowupComment); + + public int batchInsert(@Param("list") List<SysFollowupComment> sysFollowupCommentList); + + public int updateByMap(Map<String, Object> modifyMap); + + public int updateByModel(@Param("record")SysFollowupComment sysFollowupComment); + + public int deleteByIds(@Param("list") List<String> list); + + public int deleteById(Integer id); + + public int deleteByModel(@Param("record") SysFollowupComment sysFollowupComment); + + public List<SysFollowupComment> selectInPage(@Param("record") SysFollowupComment sysFollowupComment, @Param("pageVo") PaginationVO pageVo); + + public List<SysFollowupComment> selectByfollId(Long follId); + + public List<SysFollowupComment> selectByModel(@Param("record") SysFollowupComment sysFollowupComment); + + public int selectTotalRecord(@Param("record") SysFollowupComment sysFollowupComment); + + public SysFollowupComment selectById(Long id); + + public SysFollowupComment selectForUpdate(Long id); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java new file mode 100644 index 0000000..28fafcb --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java @@ -0,0 +1,44 @@ +package com.matrix.system.hive.dao; + +import com.matrix.system.app.dto.FollowupListDto; +import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysFollowup; + +/** + * @description 跟进 + * @author + * @date 2021-01-10 15:15 + */ +public interface SysFollowupDao{ + + public int insert(@Param("item") SysFollowup sysFollowup); + + public int batchInsert(@Param("list") List<SysFollowup> sysFollowupList); + + public int updateByMap(Map<String, Object> modifyMap); + + public int updateByModel(@Param("record")SysFollowup sysFollowup); + + public int deleteByIds(@Param("list") List<String> list); + + public int deleteById(Long id); + + public int deleteByModel(@Param("record") SysFollowup sysFollowup); + + public List<SysFollowup> selectInPage(@Param("record") SysFollowup sysFollowup, @Param("pageVo") PaginationVO pageVo); + + public List<SysFollowup> selectByModel(@Param("record") SysFollowup sysFollowup); + + public int selectTotalRecord(@Param("record") SysFollowup sysFollowup); + + public SysFollowup selectById(Long id); + + public SysFollowup selectForUpdate(Long id); + + void updateZan(@Param("id")Long id, @Param("zans")String zans); + + List<SysFollowup> selectByAppDto(FollowupListDto followupListDto); +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderDao.java index 361420c..22ef160 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderDao.java @@ -1,9 +1,15 @@ package com.matrix.system.hive.dao; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.dto.OrderListDto; +import com.matrix.system.app.vo.OrderDetailVo; +import com.matrix.system.app.vo.RankingVo; import com.matrix.system.hive.bean.SysOrder; +import com.matrix.system.shopXcx.api.dto.ErpOrderListDto; +import com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -32,6 +38,23 @@ public int selectInPageCount(@Param("record") SysOrder sysOrder); - public void updateOrderTime(@Param("orderTime") Date orderTime, @Param("id") Long id); - + public void updateOrderTime(@Param("payTime") Date orderTime, @Param("id") Long id); + + SysOrder selectVipOrderInfoTotal(@Param("vipId") Long vipId); + + List<OrderDetailVo> selectApiOrderListInPage(@Param("record") OrderListDto orderListDto, @Param("pageVo") PaginationVO pageVo); + + int selectApiOrderListTotal(@Param("record") OrderListDto orderListDto); + + OrderDetailVo selectApiOrderDetailById(@Param("orderId") Long orderId); + + List<RankingVo> selectShopAchieveRanking(@Param("record") SysOrder sysOrder); + + List<RankingVo> selectStaffSaleAchieveRanking(@Param("record") SysOrder sysOrder); + + List<ErpOrderDetailVo> selectErpOrderList(ErpOrderListDto erpOrderListDto); + + ErpOrderDetailVo findUserOrderById(Long orderId); + + BigDecimal selectArrearsByVipId(Long vipId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderFlowDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderFlowDao.java new file mode 100644 index 0000000..f05780d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderFlowDao.java @@ -0,0 +1,27 @@ +package com.matrix.system.hive.dao; + +import com.matrix.system.hive.bean.SysOrderFlow; +import com.matrix.system.hive.dto.OrderFlowListDto; +import com.matrix.system.hive.vo.OrderFlowVo; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +public interface SysOrderFlowDao { + + public int insert(SysOrderFlow sysOrderFlow); + + public List<SysOrderFlow> selectByOrderId(@Param("orderId") Long orderId); + + public List<SysOrderFlow> selectPayMethodsAmountByOrderId(@Param("orderId") Long orderId); + + List<OrderFlowVo> selectInPage(@Param("record") OrderFlowListDto orderFlowListDto); + + Integer selectTotal(@Param("record")OrderFlowListDto orderFlowListDto); + + Integer updateTimeByOrderId(@Param("orderId") Long orderId, @Param("payTime") Date payTime); + + Integer deleteByOrderId(@Param("orderId") Long orderId); + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java index 32dd90e..b8793dc 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java @@ -1,7 +1,9 @@ package com.matrix.system.hive.dao; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.vo.OrderDetailItemVo; import com.matrix.system.hive.bean.SysOrderItem; +import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo; import org.apache.ibatis.annotations.Param; import java.util.Date; @@ -44,7 +46,7 @@ */ public List<SysOrderItem> selectByOrderId(@Param("orderId") Long orderId); - public Integer selectByGoodsId(@Param("goodsId") Long goodsId); + public Integer selectByGoodsId(@Param("goodsId") Long goodsId,@Param("vipId") Long vipId); public List<SysOrderItem> selectItemByTime(@Param("shopId")Long shopId, @Param("time")Date time); @@ -58,4 +60,10 @@ public int deleteByOrderId(Long id); + + List<OrderDetailItemVo> selectApiOrderDetailItemsByOrderId(@Param("orderId") Long orderId); + + List<ErpOrderDetailItemVo> selectErpOrderItemByOrderId(String orderId); + + List<SysOrderItem> selectDgd(); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjServicesDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjServicesDao.java index 8614295..588612c 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjServicesDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjServicesDao.java @@ -1,10 +1,13 @@ package com.matrix.system.hive.dao; -import com.matrix.system.hive.bean.SysProjServices; -import org.apache.ibatis.annotations.Param; - import com.matrix.core.pojo.PaginationVO; - +import com.matrix.system.app.dto.ServiceOrderListDto; +import com.matrix.system.app.vo.ServiceOrderListVo; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.dto.ServiceOrderTimeDto; +import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; +import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; +import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @@ -34,7 +37,38 @@ public SysProjServices selectById(Long id); - public void updateOrderTime(@Param("createTime") Date createTime, @Param("id") Long id); - + public void updateOrderTime(@Param("serviceOrderTimeDto") ServiceOrderTimeDto serviceOrderTimeDto); + List<ServiceOrderListVo> selectApiServiceOrderListInPage(@Param("record") ServiceOrderListDto serviceOrderListDto, @Param("pageVo") PaginationVO pageVo); + + int selectApiServiceOrderListTotal(@Param("record") ServiceOrderListDto serviceOrderListDto); + + /** + * 小程序端查询客户预约单 + * @param orderListDto + * @return + */ + List<ErpServiceOrderListVo> findWxServiceOrderList(ErpServiceOrderListDto orderListDto); + + /** + * 小程序端查询客户预约单详情 + * @param id + * @return + */ + ErpServiceOrderListVo findWxServiceOrderById(Long id); + + /** + * 查询预约时间在1小时之内且没有通知过的服务单 + * @return + */ + List<SysProjServices> selectNeedNoticeService(); + + /** + * 设置服务单为已通知 + * @param noticedIds + * @return + */ + int updateNoticeTimes(@Param("list")List<Long> noticedIds); + + List<SysProjServices> selectProjServicesByOrderItemId(@Param("itemId") Long itemId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java index 58dc577..cd19d3d 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java @@ -1,6 +1,7 @@ package com.matrix.system.hive.dao; import com.matrix.system.hive.bean.SysProjUse; +import com.matrix.system.hive.bean.SysProjUseFlow; import org.apache.ibatis.annotations.Param; import com.matrix.core.pojo.PaginationVO; @@ -18,7 +19,9 @@ public interface SysProjUseDao{ public int insert(SysProjUse sysProjUse); - + + public int insertFlow(SysProjUseFlow sysProjUseFlow); + public int update(SysProjUse sysProjUse); /** * 批量修改余次信息 @@ -37,6 +40,7 @@ public List<SysProjUse> selectByModel(@Param("record") SysProjUse sysProjUse); + public List<SysProjUse> selectFlowByProjUseId(Long projUseId); public int selectTotalRecord(@Param("record") SysProjUse sysProjUse); @@ -122,4 +126,14 @@ public int updateTcStatus(@Param("id") Long id, @Param("status") String status); + + int updateInvalidProjUse(); + + List<SysProjUseFlow> selectProjUseFlow(@Param("record") SysProjUseFlow projUseFlow, @Param("pageVo")PaginationVO pageVo); + + Integer selectProjUseFlowTotal(@Param("record") SysProjUseFlow projUseFlow); + + List<SysProjUse> selectTaoCanListWithProj(@Param("record") SysProjUse sysProjUse); + + int selectTaocanCountForCourseAndInfinite(@Param("taocanId") Long taocanId, @Param("vipId") Long vipId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java new file mode 100644 index 0000000..70f2950 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java @@ -0,0 +1,42 @@ +package com.matrix.system.hive.dao; + +import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysVipAlbum; + +/** + * @description 客户相册 + * @author + * @date 2021-01-10 15:15 + */ +public interface SysVipAlbumDao{ + + public int insert(@Param("item") SysVipAlbum sysVipAlbum); + + public int batchInsert(@Param("list") List<SysVipAlbum> sysVipAlbumList); + + public int updateByMap(Map<String, Object> modifyMap); + + public int updateByModel(@Param("record")SysVipAlbum sysVipAlbum); + + public int deleteByIds(@Param("list") List<String> list); + + public int deleteById(Integer id); + + public int deleteByModel(@Param("record") SysVipAlbum sysVipAlbum); + + public List<SysVipAlbum> selectInPage(@Param("record") SysVipAlbum sysVipAlbum, @Param("pageVo") PaginationVO pageVo); + + public List<SysVipAlbum> selectBySourceId(Long sourceId); + + public List<SysVipAlbum> selectByModel(@Param("record") SysVipAlbum sysVipAlbum); + + public int selectTotalRecord(@Param("record") SysVipAlbum sysVipAlbum); + + public SysVipAlbum selectById(Long id); + + public SysVipAlbum selectForUpdate(Long id); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java index 6e7f1ec..fd8fba7 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java @@ -1,11 +1,14 @@ package com.matrix.system.hive.dao; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.dto.VipInfoListDto; +import com.matrix.system.app.vo.VipInfoListVo; import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.hive.pojo.VipInfoVo; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** @@ -36,7 +39,7 @@ public SysVipInfo selectById(Long id); - public List<SysVipInfo> selectByVipNoOrTel(@Param("key") String key, @Param("shopId") Long shopId); + public List<SysVipInfo> selectByVipNoOrTel(@Param("key") String key); /** * 查询是否唯一 @Title: selectTotalByField @@ -132,7 +135,7 @@ * @param keyWord * @return */ - public List<SysVipInfo> selectUserByKey(@Param("keyWord") String keyWord, @Param("shopId") Long shopId); + public List<SysVipInfo> selectUserByKey(@Param("keyWord") String keyWord,@Param("companyId") Long companyId); /** * 会员活跃状态自动修改 @@ -187,7 +190,7 @@ public int selectSecondTotalRecord(@Param("record") SysVipInfo sysVipInfo); - public SysVipInfo selectByPhone(String phone); + public SysVipInfo selectByPhone(@Param("phone") String phone,@Param("companyId") Long companyId); @@ -202,4 +205,18 @@ public int batchInsert(@Param("list") List<SysVipInfo> list); public List<SysVipInfo> selectVipInfoByVipNo(@Param("companyId") Long companyId, @Param("vipNo") String vipNo); + + List<VipInfoListVo> selectVipAddressBookByList(@Param("record") VipInfoListDto vipInfoListDto); + + com.matrix.system.app.vo.VipInfoVo selectVipInfoById(@Param("id") Long id); + + public SysVipInfo findByOpenId(String openId); + + int unbundlingSaleMan(Long userId); + + int bindingRecommend(@Param("recommendId") Long recommendId,@Param("userId") Long userId); + + List<Map<String, Object>> selectVipArrearsStatistics(@Param("record") SysVipInfo sysVipInfo, @Param("pageVo") PaginationVO pageVo); + + Integer selectVipArrearsStatisticsTotal(@Param("record") SysVipInfo sysVipInfo); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java new file mode 100644 index 0000000..25774ab --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java @@ -0,0 +1,33 @@ +package com.matrix.system.hive.dao; + +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysVipLabel; +import com.matrix.system.hive.bean.SysVipLabelRelate; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface SysVipLabelDao { + + int insert(SysVipLabel sysVipLabel); + + int insertRelate(SysVipLabelRelate sysVipLabelRelate); + + int update(SysVipLabel sysVipLabel); + + List<SysVipLabel> selectInPage(@Param("record") SysVipLabel sysVipLabel, @Param("pageVo") PaginationVO pageVo); + + int selectTotal(@Param("record") SysVipLabel sysVipLabel); + + int deleteById(@Param("id") Long id); + + int deleteByIds(@Param("list") List<Long> list); + + List<SysVipLabel> selectByVipId(@Param("vipId") Long vipId); + + List<SysVipLabel> selectByModel(@Param("record") SysVipLabel sysVipLabel); + + int deleteRelateByVipId(@Param("vipId") Long vipId); + + SysVipLabel selectById(@Param("id") Long id); +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dto/AchieveNewStatisticsDto.java b/zq-erp/src/main/java/com/matrix/system/hive/dto/AchieveNewStatisticsDto.java new file mode 100644 index 0000000..f4b4816 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dto/AchieveNewStatisticsDto.java @@ -0,0 +1,41 @@ +package com.matrix.system.hive.dto; + +import com.google.common.base.CaseFormat; +import com.matrix.core.pojo.BasePageQueryDto; +import com.matrix.core.tools.StringUtils; +import lombok.Data; + +@Data +public class AchieveNewStatisticsDto extends BasePageQueryDto { + + //规则名称 + String achieveRuleId; + + + //业绩归属人id + String staffName; + + + //门店名称 + Long shopId; + + //公司id + Long companyId; + + //订单类型 + String orderType; + + @Override + public void setSort(String sort) { + if(StringUtils.isNotBlank(sort)){ + if ("ruleName".equals(sort)) { + super.setSort("u.name"); + } else { + super.setSort(CaseFormat.LOWER_CAMEL.to + (CaseFormat.LOWER_UNDERSCORE, sort)); + } + }else{ + super.setSort(sort); + } + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dto/OrderFlowListDto.java b/zq-erp/src/main/java/com/matrix/system/hive/dto/OrderFlowListDto.java new file mode 100644 index 0000000..b5d05a3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dto/OrderFlowListDto.java @@ -0,0 +1,126 @@ +package com.matrix.system.hive.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.pojo.PaginationDto; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * @author jyy + * @date 2021-01-27 + **/ +@ApiModel(value = "OrderFlowListDto", description = "交易流水查询参数") +public class OrderFlowListDto extends PaginationDto { + + + @ApiModelProperty(value = "客户姓名/拼音/手机") + private String queryKey; + + @ApiModelProperty(value ="操作人") + private String oprationMan; + + @ApiModelProperty(value ="订单号") + private String orderNo; + + @ApiModelProperty(value ="交易类型") + private String flowType; + + + @ApiModelProperty(value ="支付方式") + private String payMethod; + + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "查询参数开始时间", example = "2021-01-10") + private Date startTime; + + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "查询参数结束时间", example = "2021-01-10") + private Date endTime; + + @ApiModelProperty(hidden = true) + private Long shopId; + + + @ApiModelProperty(hidden = true) + private Long companyId; + + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public String getOprationMan() { + return oprationMan; + } + + public void setOprationMan(String oprationMan) { + this.oprationMan = oprationMan; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getFlowType() { + return flowType; + } + + public void setFlowType(String flowType) { + this.flowType = flowType; + } + + public String getPayMethod() { + return payMethod; + } + + public void setPayMethod(String payMethod) { + this.payMethod = payMethod; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dto/ScoreChangeDto.java b/zq-erp/src/main/java/com/matrix/system/hive/dto/ScoreChangeDto.java new file mode 100644 index 0000000..5307e08 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dto/ScoreChangeDto.java @@ -0,0 +1,26 @@ +package com.matrix.system.hive.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(value = "ScoreChangeDto", description = "积分修改参数接收类") +public class ScoreChangeDto { + + @NotNull + @ApiModelProperty(value = "会员id", example = "1") + private Long vipId; + + @NotNull(message = "调整数量不能为空") + @ApiModelProperty(value = "调整数量", example = "1") + private Integer amount; + + @NotEmpty(message = "调整说明不能为空") + @ApiModelProperty(value = "调整说明", example = "线下兑换") + private String remarks; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dto/ServiceOrderTimeDto.java b/zq-erp/src/main/java/com/matrix/system/hive/dto/ServiceOrderTimeDto.java new file mode 100644 index 0000000..bedaf81 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dto/ServiceOrderTimeDto.java @@ -0,0 +1,34 @@ +package com.matrix.system.hive.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class ServiceOrderTimeDto { + + /** + * 服务单id + */ + private Long id; + /** + * 预约时间 + */ + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) + private Date yyTime; + + /** + * 订单创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date createTime; + /** + * 订单划扣时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date consumeTime; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/ImageUtil.java b/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/ImageUtil.java index 2cd53bb..4b3ef37 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/ImageUtil.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/ImageUtil.java @@ -1,10 +1,14 @@ package com.matrix.system.hive.plugin.util; +import com.matrix.core.tools.DateUtil; +import sun.misc.BASE64Decoder; +import sun.misc.BASE64Encoder; + import java.awt.Image; import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; +import java.io.*; +import java.util.Calendar; +import java.util.Date; import javax.imageio.ImageIO; @@ -56,12 +60,80 @@ } } - - + public static String base64ToFile(String base64Str, String savePath, String fileName) { - - + + File dir = new File(savePath); + if (!dir.isDirectory()) { + dir.mkdir(); + } + + BufferedOutputStream bos = null; + FileOutputStream fos = null; + File file = null; + String filePathAndName = dir + File.separator + fileName; + BASE64Decoder decoder = new BASE64Decoder(); + byte[] bfile = new byte[0]; + try { + bfile = decoder.decodeBuffer(base64Str); + file = new File(filePathAndName); + fos = new FileOutputStream(file); + bos = new BufferedOutputStream(fos); + bos.write(bfile); + } catch (IOException e) { + e.printStackTrace(); + } + + return filePathAndName; + } + + + public static void main(String[] args) { + GenerateImage("iVBORw0KGgoAAAANSUhEUgAABAEAAAQBCAIAAADU4QRPAAAACXBIWXMAAAsSAAALEgHS3X78AAAgAElEQVR4nOzdQWyc530/+CekmWGG4gwZdIRdeJC/DDbdlkM0pYJKFHqQKKDWtqHcQ7alsHAu8sE9WD2kB+8l3aCXNVB4u1inrYvCav+osbXgeg82162LQpLRdmWqrZRNSRVIpJXaMkCqSSOJEseaakUtHo4gO9RIoqghOe/7fD7QLQggPS8tvd+Z7+/3fObfr905MR8AAIBEPHV5MRz7yNMGAIBU9HjSAACQFBkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQBStL0U9tc8eYBEPeXBAyRloBCmdobpifhnnhwNR0+Gi3U/AQBpkQEAErK/Ft/+K6W7f+JaNbz6fDhxLiaBpaYfBIBUyAAASRirhuk98aX/fpOjYfdIeO9sOHbKzwJAEmQAgJzbXopv/5OjD/tTFgvx+4H9o+G1D8Lcgp8IgJyTAQDybHpPODgeX/HXolIKv/2rYX4hJoHLi34uAHJLBgDIp90j4fC+T6r/a1erhtdfCDMr1SBDAgC5JAMA5M0zlfj237b6v3ZT47Ea9NZHYeaMHxCAvJEBAPJjoBDf/h9e/V+7YiEc3huTwNGThgQAckUGAMiJqZ3h0MRaq/9rt6MShwROX4hJwJAAQD7IAACZN1YNRw6sp/q/drtG4q9jK9UgQwIAWScDAGTY9lJ8+3/C6v/aTU/ELUNHPwzH5/3UAGSYDACQSQOFWP6Zntjs33uxEF56No4cHDtlSAAgq2QAgOzZX4vTuh2v/q9drRqHBE6ci0nAkABA5sgAAFkyVo2bf3ZUuuK3PDkabyF476whAYCMkQEAsmF7Kb797xrprt9ssRD7SK39obMXuuA3BMAayAAA3a5V/T84vpXln4erlMLLz4X5hZgELtYzcKQAiZMBALra/lr8oH1D9352Sq0aXn0+DgkcPakaBNDVZACALjVWDdN7Nm/vZ6e0hgTeWrlJAIDuJAMAdJ2BQqz+T45m9ckUC3Ft0cHx8NoH9ocCdCMZAKC7TO/p6ur/2lVKcX/o/EJMAvaHAnQVGQCgW+weiR//Z6L6v3a1anj9hTBzNt4kYEgAoEvIAABb75lKfPvPXPV/7abGV/aHfhiOz2fltwyQZzIAwFYaKMTyz9R4/h9CsRBeejb+SY+eNCQAsMVkAIAtM7UzHJrIQ/V/7XZU4pDA6QsxCRgSANgqMgDAFhirhiMH8lb9X7tdI/HXsZX9oYYEADafDACwqbaXYvV/14hTj3ef7R+NScCQAMAmkwEANslAIZZ/piec9ycqpTgkMDkatwYZEgDYNDIAwGbYX4vXZiVV/V+7WjUOCZw4F5OAIQGATSADAGyssWos/+yoOOZHmByNNyS8t3KTAAAbSgYA2CjbS3Hv5+SoA16rYuHukMDRk2H2QjZ+zwBZJAMAdF6r+n9wXPlnPSql8PJzYX4hJoGL9ez9/gG6nwwA0GH7a/HD7GT3fnZKrRpefT7MrFSD7A8F6CwZAKBjnqnE6n+t6kQ7Zmo8VoPeWrlJAIBOkQEAOmCgEN/+Vf83QrEQVyodHA+vfWB/KEBnyAAAT2p6j+r/hquU4v7Q+YWYBOwPBXhCMgDA+o1Vw5EDqv+bp1YNr78QrxaeOWNIAGD9ZACA9dheim//qv9bYnoifvFy9MNwfD7BPz1AB8gAAI9noBDLP1Pjjm0rFQvhpWfjUzh60pAAwGOTAQAew9TOcGhC9b9b7KjEIYHTF2ISMCQAsHYyAMCajFXj5p8dFafVdXaNxKfz3llDAgBrJQMAPML2Unz73zXinLpXsRCHBPaPxnFhQwIAjyQDADzQQCGWf6YnnFA2VEpxSGByNF4tbEgA4CFkAID29tfi1VSq/5lTq8YhgRPn4pCAahBAWzIAwGpj1bj5x97PTJscDbtH4pDAsVOpHwXA/WQAgE9sL8W3/8lRR5IH94YEjp4MsxdSPw2AT5MBAMK96v/BceWfvKmUwsvPhfmF8NoH9ocC3CUDAMTSyOF98WWRvKpVw+svhJmVapAhAQAZAEjaM5X49q/6n4ip8VgNeuujeJMAQMpkACBRA4X49q/6n5piIa57Ojgeq0H2hwLJkgGAFE3tDIcmVP/TVSnF/aGnL8RxYUMCQIJkACAtY9Vw5IDqP9Gukfjr2Eo1yJAAkBQZAEjF9lJ8+1f9Z5XpifCVn719fK75J39XdDZAImQAIP8GCnHr/9S4R81qy8vLN27cWFpa+vLTyzunb8zMlf9qXkUMyD8ZAMi5/bU4A6r6z/1u3rx59erV27dvt/6Xz9y5dbD2w71fLP7XU6Xv/nuvAwNyTAYAcmusGjf/7Kh4wqx269ata9euNZtthgBKn238xr6b/3Jt4I//dtsPb/Q4OiCXZAAgh7aX4tv/rhHPltWWl5evXbvWaDQecjJ37ix/oXT9m1ON//v/Lf0fpw0JADkkAwC5MlCIez+nJzxV2rhx48b169eXl5fXcjh3lm/v2XHl53c0/uzvy6cv9jlPIE9kACA/9tfi27+9n9yv2WxeuXLlXvV/7Z4Kza/9/OVf+VLxd/+6rBoE5IYMAOTBWDVu/rH3k/vdvn376tWrN2/efJKzKX228c2vxCGB3/lLERPIAxkAyLbtpfj2PznqMbJaa+/n9evXO3IyrSGBbx1qvPtPw/aHAlknAwAZNr0nHBy395M2Go3G4uLiOso/D3dn+fbB2g9/qVb4gw+H7Q8FsksGADJp90jc/KP6z/0esvezU54KzSN7f1BvbPv9k4OGBIAskgGAjHmmEt/+Vf+531r2fnZQpXjjm19p/HN98PeOb/M0gGyRAYDMGCjE8s/UuCdGG4+197NT7txZ/umfuPa/Tzdm5sqGBIAMkQGAbJjaGQ5NqP7Txrr3fnbKZ+7cOlj74S/+TP8f/c2QIQEgE2QAoNuNVcORA6r/tNGRvZ+d0t9z88jeH/zr4uAf/+02QwJAl5MBgO61vRTf/lX/uV9n93520BdK17/5laV/WCj/yd8VPTega8kAQDcaKMTyz/SEh0MbG7T3s1Pu3Fn+8tNXvvRrjb+YHzQkAHQnGQDoOvtr4fBe1X/a2IS9n53yVGgerDX3frH4X0+VDAkA3UYGALrIWDXu/dxR8UxYbZP3fnZK6bON39h381+uDfzOX5poAbqIDAB0he2l+Pa/a8TToI0t2fvZKXfuLH+hdP1bhxonvzf05//Y7/kC3UAGALZYq/p/cFz5hza2fO9np9xZvr135D9+YaTwZ39fPn2xz7MGtpYMAGyl/bU4+GvvJ/frqr2fnfJUaH7t5y//ypeKv/vXZftDgS0kAwBbY6waL/2195P7de3ez04pfbbxza/c/Of64O8d35aPPxGQOTIAsNkGCrH6Pznq4Gmjy/d+dsqdO8s//RPXvnXoxrv/NGx/KLD5ZABgU03vUf2nvQzt/eyUO8u3D9Z++Eu1wh98OGx/KLCZZABgk+weiR//q/5zv4zu/eyUp0LzyN4f1Bvbfv/koCEBYHPIAMCG214KRw6o/tNepvd+dlCleOObX2n8w0L5T/6umJs/FNC1ZABgAw0UYvlnatwZ00Zu9n52yp07y19++srO6Rszc2VDAsCGkgGAjTK1MxyaUP2njVzu/eyUz9y5dbD2w1/8mf4/+pshQwLABpEBgM4bq8byj+o/98v93s9O6e+5eWTvD/51cfCP/3abIQGg42QAoJO2l+Lg764Rh0objUbj2rVrqv9r94XS9W9ONf7h30qGBIDOkgGAzhgoxPLP9ITjpI1ms3n9+vWk9n52yp3l219++sqXfq3xF/ODhgSATpEBgA7YXwuH96r+00biez875anQPFhr7v1i8Xf/uqwaBDw5GQB4ImPVWP7ZUXGKtLG4uLi0tKT80ymlzza++ZWb/3Jt4Hf+0rQN8ERkAGCdtpfi3s/JUedHG/Z+bpA7d5a/ULr+rUONk98b+vN/7M/lnxHYBDIA8Nha1f+D48o/tHH79u0rV66o/m+oO8u39478xy+MFP7s78unL/bl+E8KbBAZAHg8u0di+cfeT+5n7+cmeyo0v/bzl//72rbfPzloSAB4LDIAsFbPVOLbf63qwGjD3s+tUine+OZXGv9cH/y949vSPAFgHWQA4NEGCvHtX/Wftuz93HJ37iz/9E9c+9ahG+/+07D9ocBayADAI0zvUf2nPXs/u8qd5dsHaz/8pVrhDz4c/u6/96Z+HMBDyQDAA41Vw5EDqv+0Z+9nd3oqNI/s/cG/Lg7+8d9uMyQAPIgMALSxvRTf/lX/acvez+73hdL1b35l6R8Wyn/yd8XUzwJoRwYAfsxAIZZ/psadCm3Y+5khd+4sf/npKzunb8zMlQ0JAKvIAMAnpnaGQxOq/7Rh72dGfebOrYO1H/7iz/T/0d8MGRIA7pEBgNCq/h/eF3ZUHAZt2PuZdf09N39j3+V/uTZgSABokQEgddtL8e1/10jq50Bb9n7mxp07y3FIYKrxD/9WMiQAyACQroFCLP9MT/gRoA17P3PpzvLtLz995Uu/1vizvy+fvtiX+nFAwmQASNT+Wji8V/Wf9uz9zLenQvNrP3/5V75U/N2/LqsGQZpkAEjOWDVu/rH3k7bs/UxH6bONb37l5r9cG/idv3QJCCRHBoCEbC/Ft//JUc+cNuz9TFBrSOBbhxonvzf05//Yn/pxQEpkAEjF9J5wcFz5hzbs/UzcneXbe0f+4xdGCn/w4bD9oZAIGQDyb/dI3PxT8W0/7dj7SctToXlk7w9+sDT4v/11acm3QZB3MgDk2TOV+Pav+k9b9n6ySrFYHP9vt/3hfwlvfRRmzjgdyDMZAPJpoBDf/lX/eZD5hTD0mR86HloKhUK5XO7ri9tCi4W4NOzgeHjtgzC34IAgn2QAyKGpneHQhOo/7dUXw9GTYfZCeO3XnBCht7d3aGiov3/1QHClFH77V8PpC/Gn5fKic4K8kQEgV8aq4cgB1X/aazTDe2djx0PbmxBCT0/PwMDAtm3benoeeEXArpH469hHfmwgb2QAyIntpfj2r/rPg5w4F46d8oEudxWLxVKp1Nu7pi1A0xOxGnT0w3B83vlBTsgAkHkDhbj3c2rck6S9+YX49q/YTUtfX1+5XC4UHq8sWCyEl56NI0Z+liAfZADItv21OL2n+k9bjabPbvlET09PuVwuFovrPpNaNQ4J+E4JckAGgKwaq8bNPzsqHiDt6XDzaYODgw+v/q/d5Gi8dcRsCWSaDADZs70U3/53jXh0tGeXC5/W398/NDS0xur/GhULcUhg/+jdHVNA5sgAkCUDhbj3c3rCQ6O9S/X4TqauTUtvb+/w8PDjVv/XrlIKLz8XB06OngwX6w4dskQGgMzYX4tv//Z+0laj6W5XPtHT09Mq/2zCmdSq4dXn45DA0ZOqQZAZMgBkwFg1bv6x95MHmTkbZzS9ftGybdu2wcHBjlT/1+7ekMCxUx4DZIAMAF1toBCr/5OjnhLtzS+E1z5Q/eeuQqEwPDzc2er/2t0bEnjtA4U06HYyAHSv6T3xXh57P2mrvmgck0/09vYODQ319/dv+ZlUSnF/qHQKXU4GgG60eyR+/K/6T1uNpsYFn+jp6RkYGCiVuuvvi1o1vP6Clhp0LxkAusszlfj2r/rPg5i85NOKxWK5XN7k6v/aTY3HapBpdehCMgB0i4FCLP9MjXsgtGcDI59WKBTK5XJfX1+Xn0qxEO8yb90kYEgAuocMAF1hamc4NKH6T3v1xXjp7/F5x0NoVf9LpVKxWMzQaeyoxCEBt9dB95ABYIuNVcORA6r/tNeq/s+cUf4h3Kv+b9u2rWvLPw+3ayT+OvaRH2nYejIAbJntpfj2r/rPg5w4F+cpfWhKS39//9DQ0Fbt/eyg1v5QX23B1pIBYAsMFGL5Z3rC2dPepbryNJ/o6+srl8uFQn7KgpVSeOnZePPJsVN+zmFryACw2fbX4oSc6j9tNZrh6Ic+H+Wunp6ecrmcrer/2tWqcUjA912wJWQA2Dxj1bj3c0fFkdOenjSfNjg4mN3q/9pNjsYbUVx5AZtMBoDNsL0U3/53jThs2rMvhU8rFArDw8M5qP6vUbFwd0jA1dewaWQA2Fit6v/BceUf2qsvhtc+UInmrt7e3uHh4TxV/9euUgovP+ceDNgkMgBsoP21+OGWvZ+01Wi6P5VP9PT0tMo/iZ9JrRpefd592LDhZADYEM9UYvnH3k8eZGal/ewVh5Zt27YNDg7mvvq/dq0hASEZNo4MAB02UIhv/5OjzpX2VB34tEKhUC6X+/r6nMoqxUJcoXZwXFkONoQMAJ00vUf1nweqLxp55BO9vb1DQ0P9/f3O5CEqpbg/dH4hJgFD89BBMgB0xu6R+PG/6j9tNZpWH/KJnp6egYGBUsnfF2tVq4bXX9Cgg06SAeBJbS+FIwdU/3kg0418WrFYLJfLqv/rMDW+sj/UJXrQCTIArN9AIZZ/psYdIe3NL8SPLVWZaSkUCoODg2nu/eyUYiG89Gz8W/foSf9lwRORAWCdpnaGQxOq/7RXX4yX/vq0kpbe3t5SqVQsFp1HR+yoxCEBN+vBk5AB4LGNVWP5R/WftlrV/5kzyj/c1dr6r/zTcbtG4t/G/nOD9ZEB4DFsL8XB310jzoz2fDDJp/X39w8NDfX29jqVDVIsxHsY94/62g0emwwAazJQiOWf6QmnRXuX6grKfKKvr69cLqv+b45KKQ4JTI4av4HHIAPAo+2vxatqVP9pq9G0qIRP9PT0lMtl1f/NV6vGIQFruGCNZAB4mLFq3Pxj7ycPYmE5n7Zt27bBwUHV/y00ORpva3EdBzySDADtbS/Ft//JUcdDey4u5dMKhcLw8LDqfze4NyTgWm54CBkAVmtV/w+OK//QXn0xvv2rHdPS29s7PDys+t9tKqXw8nMxqx89GS7WUz8NuJ8MAD9m90jc/GPvJ201muGtj+IiQmhV/1t7Px1G16pVw6vP6+xBGzIA3PVMJb79q/7zIGYN+bRisVgul1X/M2FqPFaDBHj4NBkAYvnn8D7Vfx5InYBPKxQK5XK5r6/PqWRIsRDXux0cV+SDu2QAUje9R/WfB6ovGivkE729vUNDQ/39/c4koyqluD/UQD/JCzIASRurhiMHVP9pr9G0XpBP9PT0DAwMlEr+vsiDWjW8/kK8WnjmjHYf6ZIBSNH2Unz7V/3nQU6ci2//PiakpVgslkolez9zZnoifgnsgj+SJQOQloFCLP9MjXvstDe/EN/+1YVpKRQKg4OD9n7mVbEQXno2/otw9KT/6kmODEBCpnaGQxOq/7RXX4zdAJ8I0tLT01Mul4vFovPIvR2VOCTg2z9SIwOQhLFq3Pyzo+Jp055mMJ/W2vpv72dSJkfj/TDvnfVXAamQAci57aX49r9rxHOmvdMXYg0gzQ//ztcLP1nxsvNj+vv7h4aGVP/TVCzEIYH9o74SJAkyALk1UIjln+kJT5j2LtWVgPlEb2/v8PCw6j+VUhwSmBx1Kwg5JwOQT/tr8e3f3k/aajTdGMpqTz31lADAPbVqePV5t4OTZzIAeTNWjZt/7P3kQWZWtv77Rx14pHtDAq4KIX9kAPJjeym+/U+OeqS053JQHuLyYigO2hvGaveGBFwZTs7IAOTE9J5424t/v2mrvhjf/lX/eYj6Yvhf/jKuEPA5AverlMLLz/kcgVyRAci83SPxn23Vf9pqNH2Pz1otNeMb3ol5fULaq1XD6y/oE5ITMgAZ9kwlvv37p5oHMc/HOswthLm37RXggabGYzXIXgGyTgYgw1593tOjvfkFe/14Isfnw+x5+4Vpr79v+X8Yv/GfzcJfzWugklUyAJAr9UWje3TGUjNWPk7Mu2eQH9NoNBYXF2/fvh2CAECGyQBATrSq/+75p7MuL4ZX3o1Lhw/vCzsqDjdpt27dunbtWrPprxjyQAYA8uDEufiRrX0dbJC5hfD1N+OQwOG99o+laHl5+fr16zdu3Ej9IMgRGQDItvmF+PZv7yeboDUkML0nToWSjkajce3ateXlZc+cPJEBgKxqNMPRD+NrGWyapWYcOJk5E44csJQs/5R/yDEZAMikYx+p/rNlLi+Gb7wdhwSOHLA/NJ+Uf8g9GQDImNMX4gexqv9submF8OIbcX/ooQlDArmi/EMKZAAgM+qL8RpX1X+6ysyZu/tDJ0c9mMxT/iEdMgCQAY2mWznpXkvNmE5nzri5PMOUf0iNDAB0u5mzcfOP6j9d7mI9DgnsHolJwJBAtty4ceP69evKPyRFBgC61/xC/HhV9Z8Mmb0Qf03vCQfHDQlkQLPZvHbt2q1bt1I/CNIjAwDdqL4YB39nL3g4ZNKxU3FIYHqPIYHutby8fO3atUajkfpBkCoZAOgujWZ4b6X8A5l2eWWEvZUEDAl0G+UfkAGALnLiXPz4X/Wf3JhbCHNvh/21cHivalBXUP6BFhkA6ArzC/Ht/2Ld0yCHjs+H2fPxJoHpCY93yyj/wKfJAMAWqy/GS3+Pz3sO5NlS8+6QwOF9YdeIR73ZlH9gFRkA2DKt6v/MGeUfUnF5MbzybhirxiSwo+KxbwblH2hLBgC2xolz8WNRez9J0NxC+PqbsRp0aMKQwAa6ffv24uKi8g+0JQMAm+1SPVb/5xYcPEmbOXN3a9DUeOpHsREWFxeXlpaUf+BBZABg8zSa4eiHqv9w11Iz5uGZM+HIAftDO6bZbF65cuX27ds5+fPAxpABgE1y7CPVf2jj8mL4xttxSODIgVApOaH1u3379tWrV2/evJnVPwBsIhkA2HDzC/GyJNV/eIi5hfDiG7EadHDckMB6KP/AY5EBgA1UX7kqVfUf1ujYqfh12eF9YXLUka2V8g+sgwwAbIhGM7y1Uv4BHstSMybnVhIwJPBwyj+wbjIA0HkzZ+PHmar/sG4X63FIYPdITAKGBNpS/oEnIQMAnTS/EPecXKw7VOiA2QuxSje105DAj1H+gScnAwCdUV+Mb/+zFxwndNJSM36r1rpJwJDA7du3r1y50mz6khGelAwAPKlGM7y3Uv4BNsjllfH6E/OxGrSjkuIpLy8v37hx4/r1613we4E8kAGAJ3LiXPz4X/UfNsHcQvj6m2F/LRzem1Y16ObNm1evXlX+gQ6SAYB1ml+In/3b+wmb7Ph8mD0fhwSmJ/J/9Mo/sEFkAOCx1Rfjpb/H550cbI17QwKH94VdI/l8CMo/sKFkAODxHFvZ+q/8A1vu8mJ45d0wVg1HDuRtf6jyD2w0GQBYq9MXYvX/8qIDgy4ytxBefCNWgw5N5GFIQPkHNocMADzapXp8+1f9h641c+bu/tCp8aw+JOUf2EwyAPAwjWY4+qHqP2TAUjNm9ZkzsRpUq2bsiTUajWvXrrn0FzaNDAA80MzK1n/Vf8iQy4vhG2+H3SNxXDgTQwK3bt26du2a8g9sMhkAaGN+IV5IpPoPGTV7If6a3hMOjnfvkMDy8vL169dv3LjRBb8XSI4MAPyY+sp1pKr/kAPHTsVq0OF9YXK06/4wyj+wtWQA4K5GM7y1svcTyI2lZkz1rSTQJUMCyj/QDWQAIDpxLk4Tqv5DLl2sxyGB/bV4tfAWDgko/0D3kBxt+2gAACAASURBVAEgdfML8e3/Yj31c4DcOz4fZs/HmwS2ZEhA+Qe6igwA6aovxrf/2Qt+BCAVS804JHBiPlaDdo1s0h9a+Qe6kAwAKWo0w3srez+BBF1eDK+8G8aqMQnsqGzgn395efnatWuNRsNPGXQbGQCSc+JcfPu39xMSN7cQvv5mHBI4vHdDqkGtS3+Vf6A7yQCQkPmF+PZv7ydwz70hgemJjh1Ks9m8du3arVu3HDN0LRkAktBohqMfxn/sAVa5NyRw5MCT7g9V/oGskAEg/46tbP239xN4iMuLcX/oWDUmgfXtD1X+gQyRASDPTl+Im39U/4E1mlsIL74Rq0GHJh5jSED5BzJHBoB8ulSPb/+q/8A6zJyJ1aDpPWFq/BH/Z+UfyCgZAPKm0QxvrZR/ANZtqRk/R2jdJPCgIQHlH8guGQByZWZl67/qP9ARF+txSGD3SEwCnx4SUP6BrJMBICfqK/N8qv9Ax81eiL8O74vVoNu3b1+9evXmzZuOGTKtx+ODfLi8KAAAG+j0+bC4uHj58mUBAHLA9wAAwCN8cXvzf/zylevXbzsoyAcZAAB4oM8P3P7qz1392ad99g+5IgMAAO39cm1x308tfa7P5h/IGxkAAFjti9ubz++68vmi8g/kkwwAAHxC+QdSIAMAAHcp/0AiZAAAIPzs0ze/On5V+QcSIQMAQNI+P3D7a7uu/GTFBeOQEBkAABL1ub7lyZ+68Uu1634AIDUyAACkSPkHUiYDAEBalH8AGQAAUqH8A7TIAACQBOUf4B4ZAAByTvkHWEUGAIDcUv4B2pIBACCfdu9ofHX8mkt/gfvJAACQN9WhW18dv6b8AzyIDAAA+fG5vuVfHru+74s3PFPgIWQAAMgJ5R9gjWQAAMg85R/gscgAAJBhyj/AOsgAAJBVyj/A+sgAAJA9yj/Ak5ABACBLPte3/NXxa7t3NDw1YN1kAADIjNalv8o/wBOSAQAgA764vfnVn7v29NAtDwt4cjIAAHQ15R+g42QAAOheyj/ARpABAKAbKf8AG0cGAIDuovwDbDQZAAC6iPIPsAlkAADoCso/wKaRAQBgi31+4PZXf+7qzz5904MANocMAABb6Zdri/t+akn5B9hMMgAAbI0vbm8+v+vK54u3nT+wyWQAANhsyj/A1pIBAGBTKf8AW04GAIBNovwDdAkZAAA2nPIP0FVkAADYWMo/QLeRAQBgo/zs0ze/On5V+QfoNjIAAHTe5wduf23XlZ+sNJ0t0IVkAADopM/1LU/+1I1fql13qkDXkgEAoGOUf4BMkAEAoAOUf4AMkQEA4Iko/wCZIwMAwPop/wBZJAMAwHoo/wDZJQMAwONR/gGyTgYAgMewe0fjq+PXXPqbuGKx+MOlvtRPgSyTAQBgTapDt746fk35J3GFQmFwcLBQKPzn/5f6UZBpMgAAPMLn+pZ/eez6vi/ecFAp6+npKZfLxWIx9YMgF2QAAHgY5R9CCIODg9u2bevp6XEY5IMMAADtKf8QQujv7x8aGurt7XUY5IkMAACrKf8QQujt7R0eHi4UCg6D/JEBAODHKP/Q09PTKv8kfxLklgwAAHcp/xBC2LZt2+DgoOo/+SYDAEAs/zy/68ruHQ1HkbJCoVAul/v6LP4n/2QAAAhPD916euiWc0hWb2/v0NBQf39/6gdBMmQAACBdPT09AwMD9n6SGhkAAEhUsVgslUr2fpIgGQAASE5fX1+5XLb3k2TJAABAQnp6esrlcrFY9NBJmQwAAKSitfVf9R9kAAAg/wqFwvDwsOo/tMgAAECe9fb2Dg8Pq/7Dp8kAAEA+tfZ+lkolzxdWkQEAgBwqFovlcln1H9qSAQCAXCkUCuVyua+vz2OFB5EBAICc6O3tLZVK9n7CI8kAAEDmtar/9n7CGskAAEC29ff3Dw0N2fsJaycDAABZ1dfXVy6X7f2ExyUDAADZ09PT07r017ODdZABAICM2bZt2+DgoOo/rJsMAABkRqFQGB4eVv2HJyQDAAAZ0NvbOzQ01N/f72HBk5MBAICu1tr7WSqVPCboFBkAAOhexWKxXC6r/kNnyQAAQDcqFAqDg4P2fsJGkAEAgO7S09NTLpeLxaLnAhtEBgAAukhr67/yD2woGQAA6Ar9/f1DQ0P2fsImkAEAgC3W29s7PDys+g+bRgYAALZMT09Pq/zjEcBmkgEAgK2xbdu2wcFB1X/YfDIAALDZCoVCuVzu6+tz8rAlZAAAYPP09vYODQ319/c7c9hCMgAAsBl6enoGBgbs/YRuIAMAABuuWCyWSiV7P6FLyAAAwAbq6+srl8v2fkJXkQEAgA3R09NTLpeLxaLjhW4jAwAAndfa+q/6D91JBgAAOqlQKAwPD6v+QzeTAQCAzujt7R0eHlb9h+4nAwAAT6q197NUKjlJyAQZAAB4IsVisVwuq/5DhsgAAMA6FQqFcrnc19fnACFbZAAA4LH19vaWSiV7PyGjZAAA4DG0qv/2fkKmyQAAwFr19/cPDQ3Z+wlZJwMAAI/2H0t9/91/Kdv7CfngWzwA4GE+vtXzf367/Of/z3YBAHLD9wAAwAOd/N629+cGP77VM1Z1SJAfMgAA0Mb5euFPTw//aEn1H3JIBgAAfsyPGr3vnB36zvf7HQvklQwAANz18a2ek98deH++5EAg32QAACCavVR852z541v2hUD+yQAAkLrz9cL784Pfu2ztD6RCBgCAdH18q+eds+XZS0U/A5AUGQAAEvUX84MnvrtN+QcSJAMAQHK+8/3+d749ZO8nJEsGAICE/KjR++bpYdV/SJwMAABJ+PhWT6v843EDMgAA5N/J7217f25Q9R9okQEAIM/O1wvvnC0vXO3zlIF7ZAAAyKcfNXrfOTv0ne/3e77AKjIAAOTNx7d6Tn53wN5P4EFkAADIldlLxffnS/Z+Ag8hAwBATnz/at873y7b+wk8kgwAAJn38a2ed86WZy8VPUpgLWQAAMi21tZ/1X9g7WQAAMiq8/XCn54eVv0HHpcMAADZ86NG75unh1X/gfWRAQAgS1p7P9+fL3lqwLrJAACQGbOXiu+cLav+A09IBgCADDhfL7xztrxwtc/DAp6cDAAAXe1Hjd7350r2fgIdJAMAQJdqVf/t/QQ6TgYAgG70ne/3v/PtIXs/gY0gAwBAd/n+1b53vl229xPYODIAAHSLj2/1tC799USADSUDAEBXOPm9be/PDar+A5tABgCALXa+XvjT08Oq/8CmkQEAYMv8qNH7ztmh73y/3yMANpMMAABboLX38/35ksMHNp8MAACbbfZS8Z2zZdV/YKvIAACwec7XC+/PD9r7CWwtGQAANsPHt3reOVuevVR02sCWkwEAYMO1tv4r/wBdQgYAgA30ne/3v/PtIXs/ga4iAwDAhvhRo/fN08Oq/0AXkgEAoMM+vtXTKv84WKA7yQAA0En2fgLdTwYAgM44Xy+8c7a8cLXPeQJdTgYAgCf1o0bvO2eHvvP9ficJZIIMAADr9/GtnpPfHbD3E8gWGQAA1mn2UvH9+ZK9n0DmyAAA8Ni+f7XvnW+X7f0EMkoGAIDH8PGtnnfOlmcvFR0akF0yAACs1cnvbXt/blD1H8g6GQAAHu18vfCnp4dV/4F8kAEA4GF+1Oh98/Sw6j+QJzIAALTX2vv5/nzJ+QA5IwMAQBuzl4rvnC2r/gO5JAMAwI85Xy+8c7a8cLXPsQB5JQMAwF0/avS+P1ey9xPIPRkAAKK/mB888d1tyj9ACmQAAAj/8//139j7CaTDpx0AEAQAICkyAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRAQAAIC0yAAAApEUGAACAtMgAAACQFhkAAADSIgMAAEBaZAAAAEiLDAAAAGmRASAnatXwPz0Xtpc8T6DzpnbGv2GA3HjKo4Tc2DUSfx37KMycCUtNzxXogLFqOHIgVHy+APkiA0DeTE+Eg+Ph6Ifh+LxnC6zf9lJ8+69VHSHkkAwAOVQshJeeDZOj4dipMLfgCQOPZ6AQyz/TE44NcksGgNyqVcNv/2o4cS4mgcuLnjOwJvtr4fDe+FECkGMyAOTc5GjYPRLeOxuTAMBDjFXD4X1hR8UZQf7JAJB/xUL8Tn//aDh6Msxe8MCB1baX4tv/rhEHA6mQASAVlVJ4+bkwvxCTwMW6xw6Ee9X/g+PKP5AWGQDSUquGV5+PQwJHT9ofCqnbX4tfEtr7CQmSASBFrSGBt1ZuEgAS9Ewlln/s/YRkyQCQqGIhrv44OB5e+8D+UEjIQCG+/U+OeuaQNBkAklYpxf2h8wsxCdgfCrk3vUf1HwgyABBaQwKvvxBmVvaHGhKAXNo9Ej/+V/0HWmQA4K6p8ZX9oR+G4/OOBPJjeykcOaD6D/wYGQD4RLEQXno2hoGjJw0JQOYNFGL5Z2rckwRWkwGA1XZU4pDA6QsxCRgSgIya2hkOTaj+A+3JAEB7u0bir2Mr+0MNCUCGjFVj+Uf1H3gIGQB4mOmJOCRw7CNDApAB20tx8HfXiGcFPIIMADxCpRSHBCZH49YgQwLQnQYKsfwzPeHxAGsiAwBrUqvGIYET5+KQgGoQdJX9tXjln+o/sHYyAPAYJkfjlvH3Vm4SALbcWDWWf3ZUPAng8cgAwOMpFu4OCRw9GWYvODzYGttLce/n5KjjB9ZDBgDWo1IKLz8X5hdiErhYd4SweVrV/4Pjyj/A+skAwPrVquHV58PMSjXIkABsgt0jsfxj7yfwhGQA4ElNjcdq0FsrNwkAG+SZSnz7r1WdL9ABMgDQAcVCXEtycDy89oH9odBhA4X49q/6D3SQDAB0TKUU94fOL8QkcHnRuUIHTO9R/Qc6TwYAOqxWDa+/EK8WnjljSADWb6wajhxQ/Qc2hAwAbIjpifjh5dEPw/F5BwyPZ3spvv2r/gMbRwYANkqxEF56Nk4MHz1pSADWZKAQyz9T404L2FgyALCxdlTikMCJc3F/qCEBeIipneHQhOo/sBlkAGAzTI7GvebvnTUkAG2MVePmnx0VZwNsEhkA2CTFQhwS2D8ax4UNCUDL9lJ8+9814jiATSUDAJuqUopDApOjcUjgYt3Zk66BQiz/TE/4EQC2gAwAbIFaNbz6fBwSOHpSNYgU7a/Fa/VU/4GtIgMAW+bekMCxUx4CqRirxs0/9n4CW0sGALbSvSGBoyfD7AWPgjzbXopv/5OjHjKw9WQAYOtVSuHl58L8QnjtA/tDyafpPfHWPOUfoEvIAEC3qFXD6y+EmZVqkCEBcmP3SNz8Uyl5okAXkQGA7jI1HqtBb30UbxKATHumEt/+Vf+BLiQDAF2nWIgrUw6Ox2rQ3ILnQ/YMFOLbv+o/0LVkAKBLVUrht381nL4Qx4UNCZAhUzvDoQnVf6CryQBAV9s1En8dW6kGGRKgy41Vw5EDqv9ABsgAQAZMT8Rq0NEPw/F5j4tutL0U3/5V/4GskAGAbCgWwkvPxoL1sVOGBDpj4WrfT1Z8t/KkBgpx7+fUeLb/FEBqZAAgS2rVOCRw4lxMAoYEntDH//mZTP/+u8H+WpxfV/0HMkcGALJncjTuXH/vrCEBtsxYNW7+2VHxBIBMkgGATCoW4pDA/tG4NWj2gmfI5tleim//u0YcOZBhMgCQYZVSePm5ML8Qk8DFuifJxhooxL2fB8eVf4DMkwGAzKtVw6vPxyGBoydVg9go+2vxqyd7P4F8kAGAnLg3JHDslEdKJ41V4+Yfez+BPJEBgPy4NyTw2gf2h9IBA4VY/Z8cdZZA3sgAZNiJc/5tpo1KKe4PnV+IScD+UNZteo/qPw9UX/TXC9kmA5Bhr30QTsz7jp72atXw+gthZqUaZEiAx7J7JH78r/pPW42mziF5IAOQbXMLYe5ts3o80NR4rAa99VG8SQAe6ZlKfPv3sQIPYvcAuSEDkAfH58Ps+bizb3rC82S1YiHe5Nq6ScCQAA8yUIhfKk6NOyDas4OYnPnMP/3bnd9621MlJ9zdw8OdvhD/Fdfibfnl2uIv1a53w++kGwz/xNOq/7RVXwzHPoofNkGe+B6AXLm8GF551x3+PNCukfjr2Eo1yLf5fJoAwP1a1X9/XZBLMgA5NLcQvv5mrAYdmvDvOm209of6YA94iBPn4uCvrw3JKxmA3Jo5c3drkIIv96uUwkvPxt2yx04ZEgB+zKW68SHyTwYgz5aa8e/xmTPhyAGLPmijVo03Cfi0D2hpNMPRD31DSBJkAPLv8mL4xttxSODIAftDaWNyNO6Dt/AbEmdSiKT0eNwkYm4hvPhG/Cu+4e937lMsxCGBP3whhgEgNfML4dffcJ8gafE9AGk5dip+zHN4X/zoF1aplMLLz9kCDgmpL8Yr51X/SZDvAUjOUjP+jf+bb8ZXPbhfrRpefT42xwYslYL8alX/X3xDACBRvgcgURfrcUhg90j8TsCQAPdrDQm8tdIPBnJm5qzmD6mTAUja7IX4CdDUznBw3E0CrFYshMN748+GqgDkhrIftMgApG6pGT8Nat0kYEiA+1VKcX/o/EJMAvaHQnbVF+Pb/+wFjxCCDAB3XV4ZC2slATcJcL9aNbz+gv4AZFKjafkvrCYDwCfmFsLc22F/LTZAVIO439R42D/qCiHIkhPn4sf/ojusIgPAasfnw+z5OCQwPeFsWK1YCC89G8PA0ZOGBKCrzS/Ez/79dwptyQDQxr0hgcP7wi6XRnGfHZU4JHD6QkwChgSg29QX442Qvq+Dh5AB4IEuL4ZX3g1j1bgq3v5Q7rdrJP54vHc27g/VNIBu0Kr++08SHkkGgEeYW4iXyEztDIcmDAmwWrEQO2P7R33oCFvPV3OwdjIArMnMmbtbg6bGHRirVUpxSGByVPkYtsaluhEdeDw9zgvWaKkZ/4359TfinBncr1aNQwJHDoQB3xfBZmk0w7f+Knz9TQEAHo/vAeDxXF4M33g77B6J48KGBLjf5Gj88bCMHDaBKztg3WQAWI/ZC/HX9J5wcNyQAKvdGxJwKSlsEFd3wxOSAWD9jp2KcwKH98WPfmGVSim8/Fx8Uzl6MlysOx3ojPrKte6aP/CEzAPAE1lqxn+NfvNNQwK0V6uGV5+PQdGQADyhRjPe0v3iGwIAdIDvAaADLtbjkMD+WmyAGBLgflPjsRr01kfxiyNgHU6ci1+pqf5Dp8gA0DHH58Ps+XiTgCEB7lcshMN748+GGgM8FoU62AgyAHTSUjMOCZyYj92PXSOOltUqpbg/1E1GsBb1RYP1sFFkAOi8y4vhlXfDWDUmgR0VB8xqu0bir2Mr1SDdBrhfo2nBLmwsM8GwUeYW4rU13/qr+I8Z3G96IvzhC3GMBPi0E+fiX54CAGwo3wPAxro3JDA94aRZrVgILz0bJ4aPnjQkALH6f+yU/xZgM8gAsOHuDQkcORA3RcIqOypxSODEufhzYkiANNUXYzvu+LzHD5tEBoBNcnkx7g8dq8YkYH8o95scDbtHYgfakACpMRsDm08GgE01txAvuJnaGQ5N2B/KasVC7IztH/WBKKmwIwu2igwAW2DmTKwGTe+JRXBYpVKKQwKTo3aik2eX6sZgYCvJALA1lprx37/WTQKGBLhfrRpefd7dqORQo+nObNh6MgBspYv1OCSweyQmAUMC3O/ekIA9ieTDzMoPs1gLW04GgK03eyH+mt4TDo4bEmC1e0MCLkwl0+YXwmsfqP5Dt5ABoFscOxW/HD+8L370C6tUSuHl57xFkUn1xfhzq/oPXcU9wdBFlprxX8rfeju+6sH9atXw+gsxKA74vogsaDTjkqsX3xAAoOv4HgC6ztxCmHs77K/FBoghAe43NR6rQaYq6XIm2qGbyQDQpY7Ph9nz8SaB6QmPiNWKhXB4790hAZ+w0m3mF2y2hW4nA0D3WmrGIYHW/tBdIx4Uq+2ohN/+Vbcs0UXqi4bXIRtkAOh2lxfDK++GsWpMAjsqHher7RqJv46tVIP0LtgqjWZcYuuHELJCBoBsmFsIX38zDgkc3mt/KG1MT8Tdskc/jC0y2GQnzsUvLX0ZBRkiA0CWtIYEpvfEqVBYpVgILz0bd8seO2VIgE0yv+DnDTJJBoCMWWrGuu3MmXDkQNwUCavUqnFIwOeybLRG0/dOkGEyAGTS5cXwjbfjkMCRA/aH0sbkaNg9op/NRjF/AlnnjjDIsLmFePnO0Q/jB3KwSrEQhwT+1+djGIBOOX0h/Pob8VsmAQAyzfcAkHkzZ+7uD50c9TBZrVIKLz9nXzsdUF+MF5mr/kM++B4A8mCpGf9t/s0346se3K9WDa8+H5tjA5ZK8fha1f8X3xAAID98DwD5cbEehwR2j8TvBAwJcL97QwLHTjkd1mrmrOYP5JAMAHkzeyH+mt4Tt8W7SYBVWkMC+0fjF0d9/gXgoeYX4s+J7VKQS5/5p3+781tve7aQQ9tLMQkYEuBBFhcXr1+/7nhann766W74bXSJ+mIcIJm9kPo5QI75FAhy6/LKAN+J+ZgE3CQArEWjqS0GSZABIOfmFsLc22F/LRzeqxoEPMyJc/Hjf9V/SIEMAEk4Ph9mz4epnbELDrCK7bGQGhkAUrHUjN/vt24S2OXSKGBFfTFe+nt83mlAWmQASMvlxfDKu2GsGpPAjoqHD+lqVf9nzij/QIpkAEjR3EL4+puxGnRowpAApOj0hVj+sfcTkiUDQLpmztzdGjQ17qcAUnGpHt/+3fgLiZMBIGlLzfg2MHMmHDlgfyjkXKMZjn6o+g8EGQAIrSGBb7wdhwSOHAiVkiOBHDr2keo/8AkZALhrbiG8+EasBh0cNyQA+TG/EK8LVP0HPk0GAH7MsVPxw8LD+8LkqIOBbKuvXBau+g/cTwYAVltqxveGVhIwJABZ1GiGt1bKPwBtyQBAexfrcUhg90hMAoYEIENmzsYv9FT/gYeQAYCHmb0QiwRTOw0JQAbML8RNXxfrnhXwCDIA8AhLzfiZYusmAUMC0J3qi/Htf/aCxwOsiQwArMnlleHCE/OxGrSj4sygWzSa4b2V8g/A2skAwGOYWwhffzPsr4XDe1WDYOudOBc//lf9Bx6XDAA8tuPzYfZ8HBKYnnB4sDXmF+Jn//Z+AusjAwDrcW9I4PC+sGvEEcLmqS/GS3+PzztyYP1kAGD9Li+GV94NY9Vw5ID9obAZjq1s/Vf+AZ6QDAA8qbmF8OIbsRp0aMKQAGyU0xdi9f/yogMGOkAGADpj5szd/aFT404UOulSPb79q/4DHSQDAB2z1IxvKjNnYjWoVnWu8KQazXD0Q9V/oPNkAKDDLi+Gb7wddo/EcWFDArBuMytb/1X/gY0gAwAbYvZC/DW9JxwcNyQAj2d+IV7Jp/oPbBwZANhAx07FatDhfWFy1DHDo9VXLuRW/Qc2mgwAbKylZnynaY0LGxKAB2k0w1srez8BNoEMAGyGuYUw93bYX4tXCxsSgFVOnIvz9Kr/wKaRAYDNc3w+zJ6PNwkYEoCW+YX49n+x7jiATSUDAJtqqRmHBE7MxyGBXSPOnnTVF+Pb/+wFPwLAFpABgC1weTG88m4Yq8YksKPiCZCWRjO8t7L3E2CryADAlplbCF9/Mw4JHN6rGkQqTpyLb//2fgJbSwYAtti9IYHpCY+CPJtfiG//9n4C3UAGALbevSGBIwfsDyWHGs1w9MMYdwG6hAwAdIvLi+Ebb8chgSMH7A8lP46tbP239xPoKjIA0F3mFsKLb8Rq0KEJQwJk2+kLcfOP6j/QhWQAoBvNnLl7tfDUuOdD9lyqx7d/1X+ga8kAQJdaasa3qNZNAoYEyIpGM7y1Uv4B6GYyANDVLtbjkMDukZgEDAnQ5WZWtv6r/gPdTwYAMmD2Qvw1vSccHDckQDeaXwivfaD6D2SGDABkRmt/6PSeMDnqodEt6ovx7V/1H8gWGQDIkssr71utJGBIgK3VaIb3Vso/AJkjAwDZM7cQ5t4O+2vxamFDAmyJE+fizLrqP5BRMgCQVcfnw+z5eJPA9IRnyOaZX4hv/xfrjhzIMBkAyLCl5t0hgcP7wq4RT5KNVV+Mb/+zFxwzkHkyAJB5lxfDK++GsWpMAjsqnied16r+z5xR/gFyQgYAcmJuIXz9zTgkcHiv/aF00olz8esmez+BPJEBgFxpDQlM7wlT4x4sT+pSPZZ/7P0E8kcGAPJm6f9v715+ozrPAA5/M65ly/Yw9oJFJRZI3gGqRBdgVlw2bMLarL1hxYau2SN1EzVKQ9JiEslVhVxaCVlVaSLADjeH4LZkrKBgSpNMqTJOSnCYoClgqhNbJFFpuPkyc97nkf+A42+88M/+3vc0st/bxqbS/t32h/Kcvm6k4fEsKQFySQMA+VSbSwdHsyGB/bvtD+XZHLvo6j+QcxoAyLNKNe07ku0P3TtgSIAne+969k8kV/+B3NMAQP6NTS3uD925wafN481+8wpqV/+BIIo+aCCCeiP7De9nI9kLnuC7CoXi1c/L+44IACAQ/wcAArkxmw0JbO3P/idgSIDsz/9f9/zyTOnzO/4iBsSiAYBwJq9nf/F96adpz2ZDAnHdTx1Hz5evVNujHwQQkgYAIqo3src+nZ7O3iRgSCCaQrHtzLXe313ujH4QQGAaAIir9s0Y6EIJeJNABIVC8ePb3T//k3tgQHQaAIiuUk2VnYT1oAAACXJJREFU0bRrYxra7mpQns39p+u18TXVW23RDwJAAwAsODWdJmeyIYHBASeSNw9S+x+ny3+eVngAizQAwKJHQwJDO9KWfqeSC4Xi5Wr5zXNd0c8B4Ps0AMD31ObSoRNp07qsBNavdTYt7JO50tGzPfZ+AvwvDQDwGJVqOjCSXQ3aO2BIoPU05jveeLfvo89c/Qd4PA0A8H+NTS1uDXpps0NqDQ8LbWOVPlf/AX6YBgD4IfVGGj6TxcD+3faHNrVCoXjlX6U3JnqiHwTAU9AAAE9Wm0sHR9PW/mxIYK3l8s2nVu96bbzs6j/AU9IAAE9r8nr2Nbgt7dlsSKBZ3E8dR8+Xr1Tbox8EwLPQAADP5tiF7GrQ0I60c4OTW02FYtvpj9Ycn7L3E+CZaQCAZ1ZvpFdOLpaAIYGVVygUZ77ofn285+49l38AnocGAHhON2azIYFdG7NXCxsSWDG3G52HJ3qrt+z9BHh+GgDghZyaTpMz2ZsEDAkstwep/fd/KU9cc8oAL0oDALyoeiMbElh4k4AhgWVRKL7/SemtC/Z+AiwNDQCwNGpz2ZDA6elsSGD9Woe6ZG5+1fPyOyVX/wGWkAYAWEqVajowkg0JDG13NehF3b3f8etzfR995uo/wBLTAABL79GQwOCA030e86nt7au9Y1c6W+/RAVqBBgBYFo+GBIZ2pC39zvipFYpXa92vnrZoCWAZaQCAZVSbS4dOpE3r0v7d9oc+Wa3e9dp4+fM7rv4DLC8NALDsKtW070h2NWjvgCGBx2vMdxx7v3TpH04HYCVoAIAVMja1uD/0pc2O/LuKZ2bKx6e6mueBAHJPAwCsnHojDZ9ZHBLYuM7Bp6uzpeGzPfZ+AqwwDQCw0m7MpoOjaWt/VgJhhwRuNzoPT/RWb9n7CbAKNADA6pi8nn0Nbkt7NscaEphPbSPv9bn6D7CKNADAajp2IZsTGNqRdm4I8DkUiuf/XvrtpZ4meBSA0DQAwCqrN9IrJxfHhXM8JPDxlz2vni65+g/QDDQAQFOoVFNlNO3amL1aOGdDAnfvd/zqbPlarb0JngWApAEAmsup6TQ5k71JIB9DAvOpbeyD3rc/7GyCZwHgWxoAoLnUG9mQwML+0C39LfvhFIpXbnaPXLT3E6AZaQCAZlSbS4dOpE3rshJYv7bFPqJavevo+TX2fgI0LQ0A0Lwq1XRgJBsSGNreGleDGg/aj10u2/sJ0OQ0AECzezQkMDjQvE/6MBXHZ8rHp7qa4FkAeAINANACHg0J7N/djPtDr86Whs+6+g/QMjQAQMuozaWDo9mQwP7dzbI/9Haj4/BEn6v/AK1FAwC0mEo17TuSXQ3aO7CaQwIPHrb95lKfq/8ArUgDALSksanF/aE7N6z84xcvf9r95oV8vckMIBINANCq6o30ysksBoZ2rNyQwM2vul5+p+zqP0BL0wAAre3GbDYksLU/K4FlHRK4c69j+Fz5Wq3dDwxAq9MAAHkweT37GtyW9mxe+iGB+dQ29sGatz+09xMgJzQAQH4s7A8d3LZ0QwKF4pWb3SMX7f0EyBUNAJArtblsSGChBF5wSOCLu52/ONX777q9nwB5owEAcqhSTZXRtGtj9mrh5xgSaDxof+ti+YN/2vsJkE8aACC3Tk2nyZnsTQKDA0/7LT5MxfGZ0vGpHj8VADmmAQDyrN5YHBIY2pG29D/hG73+Rc/rEyVX/wFyTwMA5F9tLh06kTaty0pg/drHfLu3Gx2HJ/qqt1z9BwhBAwBEUammAyPZkMDQ9m/3h96bb/vD33rfvdbpxwAgDg0AEMvCkMDgtvSTHxf/+mnpzQvL+V4xAJqSBgAIp95Iw2dSSgZ/AYIy+AUAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEIsGAACAWDQAAADEogEAACAWDQAAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEIsGAACAWDQAAADEogEAACAWDQAAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEIsGAACAWDQAAADEogEAACAWDQAAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEIsGAACAWDQAAADEogEAACAWDQAAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEIsGAACAWDQAAADEogEAACAWDQAAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEIsGAACAWDQAAADEogEAACAWDQAAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEIsGAACAWDQAAADEogEAACAWDQAAALFoAAAAiEUDAABALBoAAABi0QAAABCLBgAAgFg0AAAAxKIBAAAgFg0AAACxaAAAAIhFAwAAQCwaAAAAYtEAAAAQiwYAAIBYNAAAAMSiAQAAIBYNAAAAsWgAAACIRQMAAEAsGgAAAGLRAAAAEMuPujvSxnU+dAAACCGl9F8D7Zh3C+ILkwAAAABJRU5ErkJggg==" + ,"E:\\2021011620210116\\1.jpg"); + } + + + public static boolean GenerateImage(String imgStr, String imgFilePath) {// 对字节数组字符串进行Base64解码并生成图片 + if (imgStr == null) // 图像数据为空 + return false; + BASE64Decoder decoder = new BASE64Decoder(); + try { + // Base64解码 + byte[] bytes = decoder.decodeBuffer(imgStr); + for (int i = 0; i < bytes.length; ++i) { + if (bytes[i] < 0) {// 调整异常数据 + bytes[i] += 256; + } + } + // 生成jpeg图片 + OutputStream out = new FileOutputStream(imgFilePath); + out.write(bytes); + out.flush(); + out.close(); + return true; + } catch (Exception e) { + return false; + } + } + + public static String imgTobase64(String imgPath){ + InputStream inputStream = null; + byte[] data = null; + try { + inputStream = new FileInputStream(imgPath); + data = new byte[inputStream.available()]; + inputStream.read(data); + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + // 加密 + BASE64Encoder encoder = new BASE64Encoder(); + return encoder.encode(data); + } + diff --git a/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java b/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java index 3b5af52..7c9f166 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/plugin/util/MoneyUtil.java @@ -62,7 +62,7 @@ v2=v2==null ? 0:v2; BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); - return b1.multiply(b2).doubleValue(); + return b1.multiply(b2).setScale(2,BigDecimal.ROUND_DOWN).doubleValue(); } @@ -104,7 +104,7 @@ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); - return b1.divide(b2, scale, BigDecimal.ROUND_HALF_DOWN).doubleValue(); + return b1.divide(b2, scale, BigDecimal.ROUND_DOWN).doubleValue(); } /** diff --git a/zq-erp/src/main/java/com/matrix/system/hive/pojo/CzXkVo.java b/zq-erp/src/main/java/com/matrix/system/hive/pojo/CzXkVo.java index b071654..66abb3a 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/pojo/CzXkVo.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/pojo/CzXkVo.java @@ -1,6 +1,7 @@ package com.matrix.system.hive.pojo; import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.bean.SysOrderFlow; import java.util.List; @@ -17,8 +18,17 @@ private Long staffId; private Long vipId; private List<AchieveNew> achaeveList; - - + + private List<SysOrderFlow> flows; + + public List<SysOrderFlow> getFlows() { + return flows; + } + + public void setFlows(List<SysOrderFlow> flows) { + this.flows = flows; + } + public Long getCardId() { return cardId; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java b/zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java deleted file mode 100644 index 524857c..0000000 --- a/zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.matrix.system.hive.pojo; - - -import com.matrix.system.constance.Dictionary; - -public class MoneyCardUserVo{ - - /** - * - */ - private static final long serialVersionUID = 1L; - /*vo对象************/ - /** - * 剩余次数 - */ - String lastCountName; - /** - * 数据来源 - */ - String sourceName; - - /*vo对象************/ - - /** - * 剩余次数 - */ - - private Integer lastCount; - - /** - * 来源,购买,转让,赠送 - */ - private String source; - /** - * 是会籍卡? Y 是,N否 - */ - private String isVipCar; - - /** - * 当大于10000时使用次数为不限,或者为会籍卡时 - * @return - */ - public String getLastCountName() { - if(getLastCount()==null){ - return ""; - } - if(Dictionary.FLAG_YES.equals(getIsVipCar())||getLastCount()>Dictionary.MAX_USE_COUNT_SIGN){ - lastCountName=Dictionary.MAX_USE_STRING; - }else{ - lastCountName=getLastCount().toString(); - } - return lastCountName; - } - - public void setLastCountName(String lastCountName) { - this.lastCountName = lastCountName; - } - - public String getSourceName() { - if(getSource()==null){ - return ""; - } - if(getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)){ - sourceName=Dictionary.FLAG_YES; - }else{ - sourceName=Dictionary.FLAG_NO;; - } - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public Integer getLastCount() { - return lastCount; - } - - public void setLastCount(Integer lastCount) { - this.lastCount = lastCount; - } - - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - public String getIsVipCar() { - return isVipCar; - } - - public void setIsVipCar(String isVipCar) { - this.isVipCar = isVipCar; - } - - - - -} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/pojo/ShoppingCarItemsVo.java b/zq-erp/src/main/java/com/matrix/system/hive/pojo/ShoppingCarItemsVo.java index e27b98d..ca3e448 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/pojo/ShoppingCarItemsVo.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/pojo/ShoppingCarItemsVo.java @@ -21,8 +21,16 @@ private Long beatuyId; private String beatuyName; - - + + private Long vipId; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } public Long getBeatuyId() { return beatuyId; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/pojo/StoreInOutRecordVO.java b/zq-erp/src/main/java/com/matrix/system/hive/pojo/StoreInOutRecordVO.java index 12f25bd..3e84fff 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/pojo/StoreInOutRecordVO.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/pojo/StoreInOutRecordVO.java @@ -84,6 +84,15 @@ private Long goodsSortId; + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } public Date getCreateTime() { return createTime; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java index 09757e9..0698dac 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java @@ -1,13 +1,15 @@ package com.matrix.system.hive.service; -import java.util.List; - +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.vo.UserAchieveVo; import com.matrix.system.hive.bean.AchieveNew; import com.matrix.system.hive.bean.SysOrder; import com.matrix.system.hive.bean.SysProjServices; - -import com.matrix.core.pojo.PaginationVO; import com.matrix.system.hive.plugin.util.BaseServices; +import com.matrix.system.hive.vo.DailyBeautyListVo; + +import java.util.List; +import java.util.Map; /** * @@ -108,5 +110,15 @@ public void modifyAchieveTime(AchieveNew achieveNew); + List<Map<String, Object>> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo); + + int findVipConsumeStatisticsTotal(AchieveNew achieveNew); + + public UserAchieveVo findUserAchieveByTime(int type); + + public List<AchieveNew> findOrderItemAchieve(Long orderid); + + List<DailyBeautyListVo> findDailyBeautyList(AchieveNew achieveNew, PaginationVO pageVo); + int findDailyBeautyListTotal(AchieveNew achieveNew); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveRuleService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveRuleService.java new file mode 100644 index 0000000..601c8fe --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveRuleService.java @@ -0,0 +1,33 @@ +package com.matrix.system.hive.service; + +import cn.hutool.json.JSONUtil; +import com.matrix.system.hive.bean.AchieveRule; +import com.matrix.system.hive.dao.AchieveRuleDao; +import com.matrix.system.hiveErp.pojo.AchieveRuleItem; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * 业绩规则服务 + * @author JIANGYOUYAO + * @date 2021/6/3 0003 + */ +@Service +@AllArgsConstructor +public class AchieveRuleService { + + AchieveRuleDao achieveRuleDao; + + + /** + * 根据id查询 AchieveRule + * @param id + * @return + */ + public AchieveRule selectById(Long id){ + AchieveRule achieveRule = achieveRuleDao.selectById(id); + achieveRule.setRuleItemList(JSONUtil.toList(JSONUtil.parseArray(achieveRule.getRules()), AchieveRuleItem.class)); + return achieveRule; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/ArticleService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/ArticleService.java index dceb4ad..af74da5 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/ArticleService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/ArticleService.java @@ -72,6 +72,7 @@ */ public Article findById(Long id); + public List<Article> findApiArticleListInPage(Article article, PaginationVO pageVo); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/CodeService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/CodeService.java index fefb430..13508db 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/CodeService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/CodeService.java @@ -24,6 +24,17 @@ * @throws */ public String getOrderCode(); + + String get32LenNumberCode(); + + public String getFlowCode(); + /** + * 生成一个加上typeName前缀的编号 + * typeName+时间戳+四位随机数 + * @param typeName + * @return + */ + public String getCodeByTyle(String typeName); /** * 根据一定的规则返回一个随机编号。 diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/MoneyCardUseService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/MoneyCardUseService.java index cc80452..c677c7b 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/MoneyCardUseService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/MoneyCardUseService.java @@ -93,11 +93,7 @@ */ public void transfer(MoneyCardUse moneyCardUse, Long vipId2, Double money); - /** - * 退款 - * jyy - */ - public int returnMoney(MoneyCardUse moneyCardUse, Long hjkId); + /** * 设置为有效 diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/QuestionSerivce.java b/zq-erp/src/main/java/com/matrix/system/hive/service/QuestionSerivce.java index 44b94b7..c986c81 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/QuestionSerivce.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/QuestionSerivce.java @@ -77,7 +77,7 @@ * luokai * @return */ - public List<Question> findByVipId(Long id); + public List<Question> findByVipId(Long id,Long companyId); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsCategoryService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsCategoryService.java index fec260e..c45df9c 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsCategoryService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsCategoryService.java @@ -60,6 +60,6 @@ public ShoppingGoodsCategory findById(Long id); - + List<ShoppingGoodsCategory> findChildNodesByName(ShoppingGoodsCategory shoppingGoodsCategory); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsService.java index 61e0ace..366dbf4 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/ShoppingGoodsService.java @@ -1,9 +1,13 @@ package com.matrix.system.hive.service; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.dto.ShoppingGoodsListDto; +import com.matrix.system.app.vo.ShoppingGoodsDetailVo; +import com.matrix.system.app.vo.ShoppingGoodsListVo; import com.matrix.system.hive.bean.ShoppingGoods; import com.matrix.system.hive.plugin.util.BaseServices; +import java.util.Date; import java.util.List; /** * @@ -98,4 +102,12 @@ public List<ShoppingGoods> findAll(ShoppingGoods shoppingGoods); public ShoppingGoods findByCode(String goodsCode); + + Date calInvalidTime(ShoppingGoods shoppingGoods, Integer type, Date buyDate); + + List<ShoppingGoodsListVo> findShoppingGoodsListForApi(ShoppingGoodsListDto shoppingGoodsListDto); + + int findShoppingGoodsListTotalForApi(ShoppingGoodsListDto shoppingGoodsListDto); + + ShoppingGoodsDetailVo findApiShoppingGoodsDetailById(Long id); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysBeauticianStateService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysBeauticianStateService.java index 17cf5ab..5904b62 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/SysBeauticianStateService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/SysBeauticianStateService.java @@ -75,7 +75,7 @@ public List<SysBeauticianState> findByTimeAndStaff(Long id, Date beginTime, Date endTime); - + public List<SysBeauticianState> findBySerId(Long serviceId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderFlowService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderFlowService.java new file mode 100644 index 0000000..609de95 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderFlowService.java @@ -0,0 +1,17 @@ +package com.matrix.system.hive.service; + +import com.matrix.system.hive.bean.SysOrderFlow; +import com.matrix.system.hive.plugin.util.BaseServices; + +import java.util.List; + +/** + * @author wzy + * @date 2021-01-11 + **/ +public interface SysOrderFlowService extends BaseServices<SysOrderFlow> { + + public List<SysOrderFlow> findByOrderId(Long orderId); + + public List<SysOrderFlow> findPayMethodsAmount(Long orderId); +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderItemService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderItemService.java index ddd6344..2fb658c 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderItemService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderItemService.java @@ -72,7 +72,8 @@ */ public Integer findDclItemTotal(Long vipId); - + public List<SysOrderItem> findByOrderId(Long orderId); - + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderService.java index f9aa2a2..2be2912 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/SysOrderService.java @@ -2,6 +2,9 @@ import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.dto.OrderListDto; +import com.matrix.system.app.vo.OrderDetailVo; +import com.matrix.system.app.vo.RankingVo; import com.matrix.system.hive.bean.SysOrder; import com.matrix.system.hive.plugin.util.BaseServices; import com.matrix.system.hive.pojo.CzXkVo; @@ -9,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpSession; +import java.math.BigDecimal; import java.util.List; /** @@ -81,6 +85,8 @@ */ public void updateReceiptMoney(SysOrder sysOrder) throws GlobleException; + public void refundOrderMoney(SysOrder sysOrder); + /** * 创建订单 * @param session @@ -126,4 +132,17 @@ * @return */ SysOrder checkAndSaveOrder(SysOrder sysOrder); + + SysOrder findSysOrderTjByVipId(Long vipId); + + List<OrderDetailVo> findApiOrderListInPage(OrderListDto orderListDto, PaginationVO pageVo); + + int findApiOrderListTotal(OrderListDto orderListDto); + + OrderDetailVo findApiOrderDetailByOrderId(Long orderId); + + List<RankingVo> findApiShopAchieveRanking(SysOrder sysOrder); + + BigDecimal findVipArrearsByVipId(Long vipId); + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjServicesService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjServicesService.java index 95ec6b1..6383e2d 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjServicesService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjServicesService.java @@ -2,6 +2,8 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.core.pojo.VerifyResult; +import com.matrix.system.app.dto.ServiceOrderListDto; +import com.matrix.system.app.vo.ServiceOrderListVo; import com.matrix.system.hive.bean.SysProjServices; import com.matrix.system.hive.plugin.util.BaseServices; @@ -70,6 +72,13 @@ */ public int modifyCancelProjServices(SysProjServices projServices); + /** + * 删除服务单中明细, 即项目/套餐 + * @param id + * @return + */ + public int deleteProjServiceItemById(Long id); + /** * 划扣 @@ -97,4 +106,18 @@ public VerifyResult checkArrears(SysProjServices sysProjServices); public VerifyResult checkBalance(SysProjServices sysProjServices); + + + List<ServiceOrderListVo> findApiServiceOrderListInPage(ServiceOrderListDto serviceOrderListDto, PaginationVO pageVo); + + int findApiServiceOrderListTotal(ServiceOrderListDto serviceOrderListDto); + + public boolean skipServiceOrderStep(String step); + + /** + * 确认服务单 + * @param id + * @return + */ + int confirmServiceOrder(Long id); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjUseService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjUseService.java index 82f5810..ed21be0 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjUseService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/SysProjUseService.java @@ -94,12 +94,7 @@ public int invalidTc(SysProjUse sysProjUse); - /** - * 退款 - * @param sysProjUse - * @return - */ - public int returnMoneyTc(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId); + /** * 设置为有效套餐 * @param proj @@ -134,28 +129,20 @@ /** - * 退款 - * @param sysProjUse - * @return - */ - public int returnMoneyProj(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId); - /** * 设置为有效套餐 * @param proj * @return */ public AjaxResult activeProj(SysProjUse proj); - /** - * 退款项目 - * @param sysProjUse - * @return - */ - public double getTotalMoneyProj(SysProjUse sysProjUse); public int updateProjUseTck(SysProjUse projUse); - public List<SysProjUse> selectTaocanProjUse(Long id); + public List<SysProjUse> selectTaocanProjUse(Long id, String status); + + public List<SysProjUse> findTaocaoProjUseWithProj(SysProjUse sysProjUse); + + int findTaocanCountForCourseAndInfinite(Long taocanId, Long vipId); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java index e6d1211..cd93e2d 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java @@ -1,6 +1,12 @@ package com.matrix.system.hive.service; import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.dto.AddVipDto; +import com.matrix.system.app.dto.ModifyVipDto; +import com.matrix.system.app.dto.VipInfoListDto; +import com.matrix.system.app.vo.VipInfoDetailVo; +import com.matrix.system.app.vo.VipInfoListVo; +import com.matrix.system.hive.bean.MoneyCardUse; import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.hive.plugin.util.BaseServices; import com.matrix.system.hive.pojo.VipInfoVo; @@ -8,6 +14,7 @@ import java.io.File; import java.io.IOException; import java.util.List; +import java.util.Map; /** * @@ -15,7 +22,7 @@ */ public interface SysVipInfoService extends BaseServices<SysVipInfo>{ - public int addVipDefaultCard(Long vipId); + public MoneyCardUse addVipDefaultCard(Long vipId); /** * 新增SysVipInfo * @@ -180,4 +187,27 @@ public List<SysVipInfo> findAll(SysVipInfo sysVipInfo); public int importVipInfo(File file) throws IOException; + + List<VipInfoListVo> findVipAddressBook(VipInfoListDto vipInfoListDto); + + com.matrix.system.app.vo.VipInfoVo findApiVipInfoById(Long id); + + int apiAddVip(AddVipDto addVipDto); + + int apiModifyVip(ModifyVipDto modifyVipDto); + + VipInfoDetailVo findVipInfoDetail(Long id); + + + /** + * 设置为推广员 + * @param invitationId + */ + public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId); + + SysVipInfo findByOpenId(String openId); + + List<Map<String, Object>> findVipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo); + + Integer findVipArrearsStatisticsTotal(SysVipInfo sysVipInfo); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/TaiYanAliyunSmsService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/TaiYanAliyunSmsService.java new file mode 100644 index 0000000..1aa4621 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/TaiYanAliyunSmsService.java @@ -0,0 +1,126 @@ +/** + * projectName: zq-erp + * fileName: TaiYanAliyunSmsService.java + * packageName: com.matrix.system.hive.service + * date: 2021-10-28 11:18 + * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. + */ +package com.matrix.system.hive.service; + +import com.google.common.collect.Maps; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.SmsUtils; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.service.BusParameterSettingService; +import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import lombok.AllArgsConstructor; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +/** + * @version: V1.0 + * @author: JiangYouYao + * @className: TaiYanAliyunSmsService + * @packageName: com.matrix.system.hive.service + * @description: 肽妍短信提醒服务 + * @data: 2021-10-28 11:18 + **/ +@Service +@AllArgsConstructor +public class TaiYanAliyunSmsService { + + SysVipInfoDao vipInfoDao; + + SmsUtils smsUtils; + + SysShopInfoService shopInfoService; + + SysBeauticianStateService sysBeauticianStateService; + + BusParameterSettingService busParameterSettingService; + /** + * 预约成功短信提醒 + * + * @param services + */ + @Async + public void sendYycgNotice(SysProjServices services) { + //短信接口为肽妍公司定制,暂时写死 + if (chackSetting(services)) return; + + SysVipInfo sysVipInfo = vipInfoDao.selectById(services.getVipId()); + SysShopInfo shopInfo = shopInfoService.findById(services.getShopId()); + String date = DateUtil.dateFormatStr(new Date(), "yyyy年MM月dd日"); + LogUtil.debug("发送阿里云预约成功短信,手机号={}", sysVipInfo.getPhone()); + if (StringUtils.isNotBlank(sysVipInfo.getPhone())) { + HashMap<String, String> param = Maps.newHashMap(); + param.put("date", date); + param.put("tel", shopInfo.getShopTel()); + param.put("shopName", shopInfo.getShopName()); + smsUtils.sendSms(sysVipInfo.getPhone(), "SMS_226995798", param); + } + + + } + + + /** + * 项目划扣短信提醒 + * + * @param services + */ + @Async + public void sendHkNotice(SysProjServices services) { + if (chackSetting(services)) return; + + SysVipInfo sysVipInfo = vipInfoDao.selectById(services.getVipId()); + SysShopInfo shopInfo = shopInfoService.findById(services.getShopId()); + String date = DateUtil.dateFormatStr(new Date(), "yyyy年MM月dd日"); + + List<SysBeauticianState> items = sysBeauticianStateService.findBySerId(services.getId()); + for (SysBeauticianState item : items) { + if (item.getProjInfo() != null) { + String projName = item.getProjInfo().getName(); + LogUtil.debug("发送阿里云项目划扣短信,手机号={}", sysVipInfo.getPhone()); + if (StringUtils.isNotBlank(sysVipInfo.getPhone())) { + HashMap<String, String> param = Maps.newHashMap(); + param.put("date", date); + param.put("projName", projName); + param.put("count", item.getCount() + ""); + param.put("balanceCount", item.getProjUse().getSurplusCount() + ""); + param.put("tel", shopInfo.getShopTel()); + param.put("shopName", shopInfo.getShopName()); + smsUtils.sendSms(sysVipInfo.getPhone(), "SMS_226995796", param); + } + + } + } + + + } + + private boolean chackSetting(SysProjServices services) { + //短信接口为肽妍公司定制,暂时写死 + if (services.getCompanyId() != 17L) { + return true; + } + if (!busParameterSettingService.isSettingOpen(AppConstance.OPEN_SMS_NOTICE, services.getCompanyId())) { + return true; + } + return false; + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java index 7211bb8..f32259e 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java @@ -1,25 +1,34 @@ package com.matrix.system.hive.service.imp; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.json.JSONUtil; +import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.vo.UserAchieveVo; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.common.dao.SysUsersDao; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.*; -import com.matrix.system.hive.dao.AchieveNewDao; -import com.matrix.system.hive.dao.ShoppingGoodsDao; -import com.matrix.system.hive.dao.SysBeauticianStateDao; -import com.matrix.system.hive.dao.SysProjUseDao; +import com.matrix.system.hive.dao.*; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.service.AchieveNewService; +import com.matrix.system.hive.service.SysProjServicesService; +import com.matrix.system.hive.vo.DailyBeautyListVo; +import com.matrix.system.hiveErp.pojo.AchieveRuleItem; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.util.*; /** * This field was generated by Zking.software.Codegen. @@ -40,6 +49,9 @@ @Autowired private SysProjUseDao sysProjUseDao; + + @Autowired + private SysProjServicesService projServicesService; @Override public int add(AchieveNew achieveNew) { @@ -152,13 +164,18 @@ @Override - public void addAchieveByServiceOrder(SysProjServices projServices) { + public void addAchieveByServiceOrder(SysProjServices projServices) { List<AchieveNew> achieveNewList = new ArrayList<>(); List<SysBeauticianState> beauticianStateList = sysBeauticianStateDao.selectBySerIds(projServices.getId()); int size = beauticianStateList.size(); Long achieveId = projServices.getCreateStaffId(); + // 下单人是否计算消耗业绩 + boolean flag = projServicesService.skipServiceOrderStep(Dictionary.SALE_MAN_IS_CONSUME_ACHIEVE); + + + Set<Long> beautyIds = new HashSet<>(); for (SysBeauticianState beauticianState : beauticianStateList) { // 是否第一次计算改美疗师 boolean isFirst = true; @@ -170,40 +187,138 @@ achieveNew.setVipId(projServices.getVipId()); // 是否为赠送业绩 if (Dictionary.TAOCAN_SOURCE_ZS.equals(projUse.getSource())) { - achieveNew.setFreeConsume(projUse.getPrice()); + + achieveNew.setFreeConsume(projUse.getPrice()*beauticianState.getCount()); + //计算提成 + achieveNew.setProjPercentage( + calculationProjPercentage(AchieveRuleItem.ACHIEVE_TYPE_ZS,achieveNew.getFreeConsume(),beauticianState.getProjId())); + } else { - achieveNew.setHisConsume(projUse.getPrice()); + achieveNew.setHisConsume(new BigDecimal(projUse.getPrice()*beauticianState.getCount()).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue()); + //计算提成 + achieveNew.setProjPercentage( + calculationProjPercentage(AchieveRuleItem.ACHIEVE_TYPE_BJ,achieveNew.getHisConsume(),beauticianState.getProjId())); } achieveNew.setT2(projUse.getSource()); - if (projServices.getCreateTime() != null) { - achieveNew.setDatatime(projServices.getCreateTime()); - } else { - achieveNew.setDatatime(new Date()); - } + achieveNew.setDatatime(new Date()); achieveNew.setOrderType(Dictionary.ORDER_TYPE_SERVICE); achieveNew.setServiceOrderId(projServices.getId()); achieveNew.setOrderItemId(beauticianState.getId()); achieveNew.setShopId(projServices.getShopId()); + achieveNew.setCompanyId(projServices.getCompanyId()); achieveNew.setShoppingGoodsId(projUse.getProjId()); - achieveNew.setNumberOfPeople(1D / size); + + + if (flag) { +// if (!achieveId.equals(beauticianState.getStaffId())) { + AchieveNew saleManAchieve = new AchieveNew(); + BeanUtils.copyProperties(achieveNew, saleManAchieve); + saleManAchieve.setBeaultId(achieveId); + + saleAchieveNumOfPeople(saleManAchieve); + //销售人员不计算项目提成 + saleManAchieve.setProjPercentage(0D); + achieveNewList.add(saleManAchieve); +// } + } + +// List<AchieveNew> beautyList = achieveNewDao.selectBeautyManAchieveList(beauticianState.getStaffId(), projServices.getVipId(), new Date()); +// if (CollUtil.isEmpty(beautyList)) { +// achieveNew.setNumberOfPeople(1D / size); +// } else { +// achieveNew.setNumberOfPeople(1D / (size + beautyList.size())); +// achieveNewDao.updateAchieveNumOfPeople(beautyList, achieveNew.getNumberOfPeople()); +// } + achieveNew.setProjNum(1); if (StringUtils.isNotBlank(beauticianState.getExtract())) { achieveNew.setProjPercentage(Double.parseDouble(beauticianState.getExtract())); } if (isFirst && beauticianState.getEndTime() != null && beauticianState.getBeginTime() != null) { - long timeSpace = beauticianState.getEndTime().getTime() - beauticianState.getBeginTime().getTime(); - if (timeSpace > 0) { - achieveNew.setProjTime((int) (timeSpace / 1000 / 60)); - } else { - achieveNew.setProjTime(1); - } +// long timeSpace = beauticianState.getEndTime().getTime() - beauticianState.getBeginTime().getTime(); +// if (timeSpace > 0) { +// achieveNew.setProjTime((int) (timeSpace / 1000 / 60)); +// } else { +// achieveNew.setProjTime(1); +// } + achieveNew.setProjTime(beauticianState.getExcTime()); isFirst = false; } + + beautyIds.add(achieveNew.getBeaultId()); achieveNewList.add(achieveNew); } if (CollectionUtils.isNotEmpty(achieveNewList)) { achieveNewDao.batchInsert(achieveNewList); + achieveNumOfPeople(beautyIds, projServices.getVipId()); + } + + } + + @Autowired + AchieveRuleDao achieveRuleDao; + + private Double calculationProjPercentage(int type, Double consume, Long goodsId) { + ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(goodsId); + if(shoppingGoods.getAchieveRuleId()!=null){ + + AchieveRule achieveRule = achieveRuleDao.selectById(shoppingGoods.getAchieveRuleId()); + if(achieveRule!=null){ + List<AchieveRuleItem> achieveRuleItems = JSONUtil.toList(JSONUtil.parseArray(achieveRule.getRules()), AchieveRuleItem.class); + double percentage=0D; + for(AchieveRuleItem item:achieveRuleItems){ + if(item.getAchieveType()==type + && (item.getLower() == consume + || (item.getLower()< consume && consume < item.getUpper() ))){ + + if(AchieveRuleItem.ACHIEVE_TYPE_FIXED==item.getCalculationType()){ + percentage=item.getAchieve(); + }else{ + percentage= consume * (item.getAchieve()/100); + } + break; + } + } + return percentage; + } + } + return 0D; + } + + /** + * 顾问人头业绩 + * @param achieveNew + */ + private void saleAchieveNumOfPeople(AchieveNew achieveNew) { + List<AchieveNew> saleList = achieveNewDao.selectSaleManAchieveList(achieveNew.getSaleId(), achieveNew.getVipId(), new Date()); + if (CollUtil.isEmpty(saleList)) { + achieveNew.setNumberOfPeople(1D); + } else { + achieveNew.setNumberOfPeople(1D / (1D + saleList.size())); + achieveNewDao.updateAchieveNumOfPeople(saleList, achieveNew.getNumberOfPeople()); + } + } + + /** + * + * 合并订单与服务单人头逻辑,即每一个客户对美疗师/顾问来说,每一天同一个客户只算一个人头。 + * 如若A给客户X下订单,并给客户X服务,对A来说只算一个人头 + */ + private void achieveNumOfPeople(Set<Long> beautyIds, Long vipId) { + for (Long userId : beautyIds) { + double num; + List<AchieveNew> achieveNewList = achieveNewDao.selectBeautyManAchieveList(userId, vipId, new Date()); + + if (CollUtil.isEmpty(achieveNewList)) { + num = 1D; + } else { + num = 1D / achieveNewList.size(); + } + + if (CollUtil.isNotEmpty(achieveNewList)) { + achieveNewDao.updateAchieveNumOfPeople(achieveNewList, num); + } } } @@ -211,78 +326,77 @@ @Override public void addAchaeveByOrder(SysOrder pageOrder) { List<AchieveNew> achieveNewList = new ArrayList<>(); + Set<Long> beautyIds = new HashSet<>(); if (CollectionUtils.isNotEmpty(pageOrder.getItems())) { for (SysOrderItem orderItem : pageOrder.getItems()) { - if (orderItem != null && CollectionUtils.isNotEmpty(orderItem.getAchaeveList())) { + if (orderItem != null && CollectionUtils.isNotEmpty(orderItem.getAchieveList())) { - for (AchieveNew achieveNew : orderItem.getAchaeveList()) { - if (achieveNew !=null && achieveNew.getT1()!=null) { + for (AchieveNew achieveNew : orderItem.getAchieveList()) { + if (achieveNew !=null && achieveNew.getGoodsCash()!=null) { buildAchieve(pageOrder, orderItem, achieveNew); - // 新增美疗师业绩 achieveNewList.add(achieveNew); + + beautyIds.add(achieveNew.getBeaultId()); } } - } else { - // 如果该订单明细没有设置美疗师则单独设置顾问业绩 - AchieveNew achieveNew = new AchieveNew(); - // 顾问业绩等于收款金额 - achieveNew.setT1(orderItem.getPayMoney() + ""); - buildAchieve(pageOrder, orderItem, achieveNew); - // 新增顾问业绩 - achieveNewList.add(achieveNew); } } } + if (CollectionUtils.isNotEmpty(achieveNewList)) { achieveNewDao.batchInsert(achieveNewList); + if (!beautyIds.isEmpty()) { + achieveNumOfPeople(beautyIds, pageOrder.getVipId()); + } } } @Autowired ShoppingGoodsDao shoppingGoodsDao; + @Autowired + BusParameterSettingsDao busParameterSettingsDao; private void buildAchieve(SysOrder pageOrder, SysOrderItem orderItem, AchieveNew achieveNew) { - achieveNew.setVipId(pageOrder.getVipId()); - achieveNew.setSaleId(pageOrder.getStaffId()); + BusParameterSettings shopManageJjcpasConsume =null; + if (Dictionary.ORDER_STATU_TK.equals(pageOrder.getStatu())) { + achieveNew.setId(null); + achieveNew.setProjPercentage(0 - achieveNew.getProjPercentage()); + achieveNew.setGoodsCash(0 - achieveNew.getGoodsCash()); + } - if (pageOrder.getOrderTime() != null) { - achieveNew.setDatatime(pageOrder.getOrderTime()); - } else if (pageOrder.getOrderTime() != null) { - achieveNew.setDatatime(pageOrder.getOrderTime()); + achieveNew.setVipId(pageOrder.getVipId()); + if(achieveNew.getSaleId()==null){ + achieveNew.setSaleId(pageOrder.getStaffId()); + } + + + if (pageOrder.getPayTime() != null) { + achieveNew.setDatatime(pageOrder.getPayTime()); } else { achieveNew.setDatatime(new Date()); } + if(Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(orderItem.getShoppingGoods().getGoodType())){ + if(shopManageJjcpasConsume==null){ + shopManageJjcpasConsume = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_JJCPAS_CONSUME, pageOrder.getCompanyId()); + } + if(AppConstance.IS_Y.equals(shopManageJjcpasConsume.getParamValue())){ + achieveNew.setHisConsume(achieveNew.getGoodsCash()); + } + + } + + // 设置顾问人头业绩 +// saleAchieveNumOfPeople(achieveNew); + achieveNew.setOrderType(Dictionary.ORDER_TYPE_SEAL); achieveNew.setOrderId(pageOrder.getId()); achieveNew.setOrderItemId(orderItem.getId()); achieveNew.setShopId(pageOrder.getShopId()); + achieveNew.setCompanyId(pageOrder.getCompanyId()); achieveNew.setShoppingGoodsId(orderItem.getGoodsId()); // 是否赠送 achieveNew.setT2(orderItem.getIsFree()); - // 根据商品类型设置业绩类型 - - String goodType = shoppingGoodsDao.selectById(orderItem.getGoodsId()).getGoodType(); - if (orderItem.getPayMethod().equals(Dictionary.PAY_TYPE_MOENY) - && Dictionary.SHOPPING_GOODS_TYPE_XM.equals(goodType)) { - // 现金支付设置现金单次 - achieveNew.setProjCash(Double.parseDouble(achieveNew.getT1())); - - } else if (orderItem.getPayMethod().equals(Dictionary.PAY_TYPE_MOENY) - && Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(goodType)) { - // 设置现金产品 - achieveNew.setGoodsCash(Double.parseDouble(achieveNew.getT1())); - } else if (orderItem.getPayMethod().equals(Dictionary.PAY_TYPE_MOENY) - && (Dictionary.SHOPPING_GOODS_TYPE_TC.equals(goodType) - || Dictionary.SHOPPING_GOODS_TYPE_CZK.equals(goodType) - || Dictionary.SHOPPING_GOODS_TYPE_ZHK.equals(goodType) - || Dictionary.SHOPPING_GOODS_TYPE_TCK.equals(goodType))) { - // 设置卡项 - achieveNew.setCardCash(Double.parseDouble(achieveNew.getT1())); - } else if (!orderItem.getPayMethod().equals(Dictionary.PAY_TYPE_CARD)) { - // 设置划扣金额 - achieveNew.setConsume(Double.parseDouble(achieveNew.getT1())); - } } @Override @@ -308,5 +422,71 @@ achieveNewDao.updateAchieveTime(achieveNew); } + @Override + public List<Map<String, Object>> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo) { + return achieveNewDao.selectVipConsumeStatisticsList(achieveNew, pageVo); + } + @Override + public int findVipConsumeStatisticsTotal(AchieveNew achieveNew) { + return achieveNewDao.selectVipConsumeStatisticsTotal(achieveNew); + } + + @Override + public UserAchieveVo findUserAchieveByTime(int type) { + SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Calendar calendar = Calendar.getInstance(); + Date startTime = calendar.getTime(); + Date endTime = calendar.getTime(); + switch (type) { + // 本日 + case 1 : + break; + // 昨日 + case 2: + startTime = DateUtil.previousNDate(startTime, 1); + endTime = startTime; + break; + // 本月 + case 3: + calendar.set(Calendar.DAY_OF_MONTH, 1); + startTime = calendar.getTime(); + break; + // 上月 + case 4: + calendar.add(Calendar.MONTH, -1); + calendar.set(Calendar.DAY_OF_MONTH, 1); + startTime = calendar.getTime(); + calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); + endTime = calendar.getTime(); + break; + default: + break; + + } + + return achieveNewDao.selectUserAchieveByTime(startTime, endTime, users.getSuId()); + } + + @Override + public List<AchieveNew> findOrderItemAchieve(Long orderId) { + return achieveNewDao.selectOrderItemAchieveByOrderId(orderId); + } + + @Override + public List<DailyBeautyListVo> findDailyBeautyList(AchieveNew achieveNew, PaginationVO pageVo) { + List<DailyBeautyListVo> list = achieveNewDao.selectDailyBeautyList(achieveNew, pageVo); + if (CollUtil.isNotEmpty(list)) { + for (DailyBeautyListVo item : list) { + String pl = achieveNewDao.selectPlInfoByVipIdAndDate(item.getDatatime(), item.getVipId()); + item.setProjInfo(pl); + } + } + return list; + } + + @Override + public int findDailyBeautyListTotal(AchieveNew achieveNew) { + return achieveNewDao.selectDailyBeautyListTotal(achieveNew); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ArticleServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ArticleServiceImpl.java index 2749a58..f42702b 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ArticleServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ArticleServiceImpl.java @@ -117,7 +117,8 @@ } - - - + @Override + public List<Article> findApiArticleListInPage(Article article, PaginationVO pageVo) { + return articleDao.selectApiArticleListInPage(article, pageVo); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/CodeServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/CodeServiceImpl.java index fa3cb22..77c291c 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/CodeServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/CodeServiceImpl.java @@ -9,9 +9,9 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Random; - /** * * @@ -94,5 +94,31 @@ Date date=new Date(); return fmt.format(date); } - + + @Override + public String get32LenNumberCode(){ + DateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmss"); + Date date=new Date(); + + String str = "0123456789"; + Random random = new Random(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 18; i++) { + int number = random.nextInt(str.length()); + sb.append(str.charAt(number)); + } + return fmt.format(date)+sb.toString(); + } + + + + @Override + public String getFlowCode() { + return "F" + getNowTimeString(); + } + + @Override + public String getCodeByTyle(String typeName) { + return typeName+getNowTimeString()+ StringUtils.getRandomString(4); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/DataAnalysisCustomerServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/DataAnalysisCustomerServiceImpl.java new file mode 100644 index 0000000..1b11435 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/DataAnalysisCustomerServiceImpl.java @@ -0,0 +1,192 @@ +package com.matrix.system.hive.service.imp; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.VipStatisticsParamDto; +import com.matrix.system.common.bean.SysCompany; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.SysCompanyDao; +import com.matrix.system.common.dao.SysUsersDao; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hiveErp.analysUtil.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @author wzy + * @date 2020-12-30 + **/ +@Service +public class DataAnalysisCustomerServiceImpl { + + @Autowired + private SysShopInfoDao shopInfoDao; + + @Autowired + private SysCompanyDao sysCompanyDao; + + @Autowired + private SysUsersDao sysUsersDao; + + /** + * 按店铺查询数据通用格式执行方法,支持时、日、月、年维度 + * 如: A店铺 B店铺 + * 2020-01-01 12 13 + * 2020-02-02 10 11 + * + * @param statisticsParam 时间条件 + * @param caculate 循环调用caculate计算该店的数据 + * 查询的数据需满足 只有一个门店只有一行 列名称为 t0,t1,t2 + * @return + */ + public AjaxResult getAnalysisResult(StatisticsParamVo statisticsParam, Caculate caculate) { + AjaxResult result = new AjaxResult(); + + //根据计算横坐标 + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(statisticsParam.getBeginTime(), statisticsParam.getEndTime(), statisticsParam.getStatisticsUnit()); + + //获取所有门店 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + List<SysShopInfo> shops = null; + if (statisticsParam.getShopId() != null) { + shops = Arrays.asList(shopInfoDao.selectById(user.getShopId())); + } else { + if (DataAuthUtil.hasAllShopAuth()) { + shops = shopInfoDao.selectShopInfo(user.getCompanyId()); + } else { + shops = Arrays.asList(shopInfoDao.selectById(user.getShopId())); + } + } + //定义数据项内容 + List<SeriesVo> series = new ArrayList<>(); + + //定义数据主体 + String[] legendData = new String[shops.size()]; + + int i = 0; + + //按门店统计数据 + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + for (SysShopInfo shop : shops) { + + legendData[i++] = shop.getShopName(); + //数据项内容 + SeriesVo storeInfoSeries = new SeriesVo(); + storeInfoSeries.setName(shop.getShopName()); + //调用计算器获取数据库统计的结果 + Map<String, Integer> yAxisMap = caculate.exec(timeSpaceParam, shop.getId(), null); + //把统计结果转成数组格式 + storeInfoSeries.setData(StatisticsTimeUtil.getSeries(yAxisMap)); + series.add(storeInfoSeries); + + } + //构造返回对象 + Map<Object, Object> data = new HashMap<>(); + data.put("legendData", legendData); + data.put("series", series); + String[] xData = StatisticsTimeUtil.getFormartDateList(xAxis, statisticsParam); + data.put("xAxis", Arrays.copyOf(xData, xData.length - 1)); + result.setMapInfo(data); + result.setStatus(AjaxResult.STATUS_SUCCESS); + return result; + } + + public AjaxResult getCompanyAnalysisResult(StatisticsParamVo statisticsParam, Caculate caculate) { + AjaxResult result = new AjaxResult(); + + //根据计算横坐标 + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(statisticsParam.getBeginTime(), statisticsParam.getEndTime(), statisticsParam.getStatisticsUnit()); + + //获取所有门店 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + SysCompany company = sysCompanyDao.selectById(user.getCompanyId()); + + //定义数据项内容 + List<SeriesVo> series = new ArrayList<>(); + + //定义数据主体 + String[] legendData = new String[1]; + + int i = 0; + + //按门店统计数据 + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + + legendData[0] = company.getComName(); + //数据项内容 + SeriesVo storeInfoSeries = new SeriesVo(); + storeInfoSeries.setName(company.getComName()); + //调用计算器获取数据库统计的结果 + Map<String, Integer> yAxisMap = caculate.exec(timeSpaceParam, null, company.getComId()); + //把统计结果转成数组格式 + storeInfoSeries.setData(StatisticsTimeUtil.getSeries(yAxisMap)); + series.add(storeInfoSeries); + + //构造返回对象 + Map<Object, Object> data = new HashMap<>(); + data.put("legendData", legendData); + data.put("series", series); + String[] xData = StatisticsTimeUtil.getFormartDateList(xAxis, statisticsParam); + data.put("xAxis", Arrays.copyOf(xData, xData.length - 1)); + result.setMapInfo(data); + result.setStatus(AjaxResult.STATUS_SUCCESS); + return result; + } + + public AjaxResult getStaffAnalysisResult(VipStatisticsParamDto statisticsParam, Caculate caculate) { + AjaxResult result = new AjaxResult(); + + //根据计算横坐标 + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(statisticsParam.getBeginTime(), statisticsParam.getEndTime(), statisticsParam.getStatisticsUnit()); + + //获取所有门店 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + Long staffId = null; + if (statisticsParam.getStaffId() == null) { + staffId = user.getSuId(); + } else { + staffId = statisticsParam.getStaffId(); + } + SysUsers sysUsers = sysUsersDao.selectById(staffId); + + //定义数据项内容 + List<SeriesVo> series = new ArrayList<>(); + + //定义数据主体 + String[] legendData = new String[1]; + + int i = 0; + + //按门店统计数据 + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + + legendData[0] = sysUsers.getSuName(); + //数据项内容 + SeriesVo storeInfoSeries = new SeriesVo(); + storeInfoSeries.setName(sysUsers.getSuName()); + //调用计算器获取数据库统计的结果 + Map<String, Integer> yAxisMap = caculate.exec(timeSpaceParam, null, sysUsers.getSuId()); + //把统计结果转成数组格式 + storeInfoSeries.setData(StatisticsTimeUtil.getSeries(yAxisMap)); + series.add(storeInfoSeries); + + //构造返回对象 + Map<Object, Object> data = new HashMap<>(); + data.put("legendData", legendData); + data.put("series", series); + StatisticsParamVo statisticsParam1 = new StatisticsParamVo(); + statisticsParam1.setStatisticsUnit(statisticsParam.getStatisticsUnit()); + String[] xData = StatisticsTimeUtil.getFormartDateList(xAxis, statisticsParam1); + data.put("xAxis", Arrays.copyOf(xData, xData.length - 1)); + result.setMapInfo(data); + result.setStatus(AjaxResult.STATUS_SUCCESS); + return result; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/MoneyCardUseServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/MoneyCardUseServiceImpl.java index 4b91861..5eb09f1 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/MoneyCardUseServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/MoneyCardUseServiceImpl.java @@ -1,21 +1,20 @@ package com.matrix.system.hive.service.imp; -import com.matrix.core.constance.MatrixConstance; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.WebUtil; -import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.*; -import com.matrix.system.hive.dao.*; import com.matrix.core.tools.DateUtil; -import com.matrix.system.hive.plugin.util.MoneyUtil; +import com.matrix.system.constance.Dictionary; +import com.matrix.system.hive.bean.MoneyCardUse; +import com.matrix.system.hive.bean.MoneyCardUseFreeze; +import com.matrix.system.hive.bean.SysOrderItem; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.*; import com.matrix.system.hive.service.MoneyCardUseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.text.DecimalFormat; import java.util.Date; import java.util.List; @@ -24,7 +23,7 @@ * @date 2016-09-17 10:17 */ @Service("moneyCardUseService") -public class MoneyCardUseServiceImpl implements MoneyCardUseService { +public class MoneyCardUseServiceImpl extends ServiceImpl<MoneyCardUseDao,MoneyCardUse> implements MoneyCardUseService { @Autowired @@ -41,6 +40,10 @@ @Autowired private SysVipLevelDao viplevelDao; + + + + @Override public int add(MoneyCardUse moneyCardUse) { @@ -213,64 +216,7 @@ } } - //退款 - @Override - public int returnMoney(MoneyCardUse moneyCardUse, Long hjkId) { - - MoneyCardUse realObj = moneyCardUseDao.selectById(moneyCardUse.getId()); - - //检测商品是否已付款完成 - if (realObj.getOrderItemId() != 1) {//不是数据迁移过来的判断付款状态 - checkOrderStatu(realObj.getOrderItemId()); - } - - if (!realObj.getStatus().equals(Dictionary.TAOCAN_STATUS_YX)) { - throw new GlobleException("不是有效充值卡"); - } - - if (realObj.getSource().contains(Dictionary.TAOCAN_SOURCE_ZR)) { - throw new GlobleException("转让的充值卡不能退款"); - } - if (realObj.getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)) { - throw new GlobleException("赠送的充值卡不能退款"); - } - - if (Dictionary.FLAG_YES_Y.equals(realObj.getIsVipCar())) { - //更新会员等级 - realObj.getVipInfo().setLevelId(0L); - infoDao.update(realObj.getVipInfo()); - } - StringBuilder content = new StringBuilder(); - - //有会籍卡退到会籍卡中,无则退了现金 - if (hjkId != null && !hjkId.equals("")) { - MoneyCardUse vipCard = moneyCardUseDao.selectById(hjkId); - vipCard.setRealMoney(vipCard.getRealMoney() + realObj.getRealMoney()); - moneyCardUseDao.update(vipCard); - content.append(realObj.getCardName() + "退款¥" + realObj.getRealMoney() + "到会籍卡") - .append(vipCard.getCardName()) - .append(",余次:" + vipCard.getLastCountName()) - .append(",本金余额:" + vipCard.getRealMoney()) - .append(",有效期:" + DateUtil.dateToString(vipCard.getFailTime(), DateUtil.DATE_FORMAT_MM)) - .append(",是否赠送:" + vipCard.getSourceName()); - } else { - content.append(realObj.getCardName() + "退款现金¥" + moneyCardUse.getReturnMonery() + ""); - } - DecimalFormat df = new DecimalFormat("#.00"); - double d = Double.valueOf(df.format(realObj.getRealMoney() - Double.valueOf(moneyCardUse.getReturnMonery()))); - //退款的本金为零,状态为已退款 - realObj.setRealMoney(d); - //赠送金额也清零 - realObj.setGiftMoney(0.0); - if (d <= 0) { - realObj.setStatus(Dictionary.TAOCAN_STATUS_TK); - } - int i = moneyCardUseDao.update(realObj); - SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - //新增退款流水 - return i; - } //设置为有效 @Override @@ -284,8 +230,7 @@ } } moneyCardUseDao.update(proj); - StringBuilder content = new StringBuilder(); - content.append(proj.getCardName() + "设置有效"); + } //设置为失效 diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/QuestionServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/QuestionServiceImpl.java index b37bbfd..5cb357a 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/QuestionServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/QuestionServiceImpl.java @@ -175,12 +175,12 @@ * @return */ @Override - public List<Question> findByVipId(Long id) { + public List<Question> findByVipId(Long id,Long companyId) { - List<Question> vipAnswerList=quesionDao.selectVipAnswerAllByModel(id,Question.TYPE_ZXDAGL); + List<Question> vipAnswerList=quesionDao.selectVipAnswerAllByModel(id,companyId,Question.TYPE_ZXDAGL); return vipAnswerList; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsCategoryServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsCategoryServiceImpl.java index f9157ea..330eb1c 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsCategoryServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsCategoryServiceImpl.java @@ -90,6 +90,9 @@ } } } - - + + @Override + public List<ShoppingGoodsCategory> findChildNodesByName(ShoppingGoodsCategory shoppingGoodsCategory) { + return shoppingGoodsCategoryDao.selectChildNodesByName(shoppingGoodsCategory); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java index fc8b5d5..e13f1f9 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java @@ -3,29 +3,33 @@ import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.ShoppingGoodsListDto; +import com.matrix.system.app.vo.ShoppingGoodsDetailVo; +import com.matrix.system.app.vo.ShoppingGoodsListVo; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.dao.UtilDao; import com.matrix.system.common.tools.ServiceUtil; import com.matrix.system.constance.Dictionary; import com.matrix.system.constance.TableMapping; -import com.matrix.system.hive.bean.MoneyCardAssemble; import com.matrix.system.hive.bean.ShoppingGoods; import com.matrix.system.hive.bean.ShoppingGoodsAssemble; +import com.matrix.system.hive.bean.ShoppingGoodsCategory; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.dao.MoneyCardAssembleDao; import com.matrix.system.hive.dao.ShoppingGoodsAssembleDao; import com.matrix.system.hive.dao.ShoppingGoodsDao; import com.matrix.system.hive.dao.SysShopInfoDao; -import com.matrix.system.hive.plugin.message.StringUtil; import com.matrix.system.hive.service.ShoppingGoodsService; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.awt.event.WindowStateListener; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -88,12 +92,15 @@ shoppingGoods.setCreateTime(new Date()); setPublicAttr(shoppingGoods); + + setShoppingGoodsInvalidTime(shoppingGoods); + if (shoppingGoods.getReferencePice() == null) { //赠送金额 shoppingGoods.setReferencePice(0D); } // 验证套餐卡卡必须填写最大使用次数 - if (Dictionary.FLAG_YES_Y.equals(shoppingGoods.getIsCourse())) { + if (Dictionary.FLAG_YES_Y.equals(shoppingGoods.getIsCourse()) && Dictionary.FLAG_NO_N.equals(shoppingGoods.getIsInfinite())) { if (shoppingGoods.getCarUseCount() == null) { shoppingGoods.setCarUseCount(0); } @@ -116,6 +123,36 @@ return i; + } + + private void setShoppingGoodsInvalidTime(ShoppingGoods shoppingGoods) { + // 若未设置购买有效期和消耗有效期,则默认永久有效 +// if (shoppingGoods.getBuyDateNum() == null && shoppingGoods.getUseDateNum() == null) { +// shoppingGoods.setInvalidTime(DateUtil.stringToDate("2099-12-31", DateUtil.DATE_FORMAT_DD)); +// } else { +// // 计算失效日期,判断购买有效期和消耗有效期哪个先失效,则为失效日期 +// Date buyValidDate = DateUtil.calDate(shoppingGoods.getBuyDateNum(), shoppingGoods.getBuyDateUnit()); +// Date useValidDate = DateUtil.calDate(shoppingGoods.getUseDateNum(), shoppingGoods.getUseDateUnit()); +// if (buyValidDate.after(useValidDate)) { +// shoppingGoods.setInvalidTime(useValidDate); +// } else { +// shoppingGoods.setInvalidTime(buyValidDate); +// } +// shoppingGoods.setBuyValid(shoppingGoods.getBuyDateNum() + shoppingGoods.getBuyDateUnit()); +// shoppingGoods.setUseValid(shoppingGoods.getUseDateNum() + shoppingGoods.getUseDateUnit()); +// } + + if (shoppingGoods.getBuyDateNum() != null && StringUtils.isNotBlank(shoppingGoods.getBuyDateUnit())) { + shoppingGoods.setBuyValid(shoppingGoods.getBuyDateNum() + shoppingGoods.getBuyDateUnit()); + } else { + shoppingGoods.setBuyValid(null); + } + + if (shoppingGoods.getUseDateNum() != null && StringUtils.isNotBlank(shoppingGoods.getUseDateUnit())) { + shoppingGoods.setUseValid(shoppingGoods.getUseDateNum() + shoppingGoods.getUseDateUnit()); + } else { + shoppingGoods.setUseValid(null); + } } private void setGoodsAssembles(ShoppingGoods shoppingGoods) { @@ -190,7 +227,7 @@ } } - + setShoppingGoodsInvalidTime(shoppingGoods); return shoppingGoodsDao.update(shoppingGoods); @@ -386,4 +423,116 @@ return shoppingGoodsDao.selectByModelData(shoppingGoods); } + + /** + * 计算失效时间 + * + * @param shoppingGoods + * @param type 1 - 购买时 2 - 消耗时 + * @param buyDate 购买日期, 当计算消耗日期时,不能为空 + * @return + */ + @Override + public Date calInvalidTime(ShoppingGoods shoppingGoods, @NotNull Integer type, Date buyDate) { + if (StringUtils.isBlank(shoppingGoods.getBuyValid()) && StringUtils.isBlank(shoppingGoods.getUseValid()) && shoppingGoods.getInvalidTime() == null) { + return DateUtil.stringToDate("2099-12-31", DateUtil.DATE_FORMAT_DD); + } + + if (type == 2 && shoppingGoods.getUseDateNum() == null && StringUtils.isNotBlank(shoppingGoods.getBuyDateUnit())) { + return DateUtil.stringToDate("2099-12-31", DateUtil.DATE_FORMAT_DD); + } + + if (type == 2 && buyDate == null) { + throw new GlobleException("购买日期不能为空"); + } + + Date target = null; + Date buyValidDate = null; + if (type == 1) { + buyValidDate = DateUtil.calDate(shoppingGoods.getBuyDateNum(), shoppingGoods.getBuyDateUnit()); + } else { + buyValidDate = buyDate; + } + + Date useValidDate = DateUtil.stringToDate("2099-12-31", DateUtil.DATE_FORMAT_DD); + if (type == 2) { + useValidDate = DateUtil.calDate(shoppingGoods.getUseDateNum(), shoppingGoods.getUseDateUnit()); + } + + if (buyValidDate.after(useValidDate)) { + target = useValidDate; + } else { + target = buyValidDate; + } + + if (shoppingGoods.getInvalidTime() != null) { + if (target.after(shoppingGoods.getInvalidTime())) { + target = shoppingGoods.getInvalidTime(); + } + } + return target; + } + + + @Override + public List<ShoppingGoodsListVo> findShoppingGoodsListForApi(ShoppingGoodsListDto shoppingGoodsListDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + shoppingGoodsListDto.setShopId(user.getShopId()); + PaginationVO pageVo = new PaginationVO(); + int offset = (shoppingGoodsListDto.getPageNum() - 1) * shoppingGoodsListDto.getPageSize(); + int limit = shoppingGoodsListDto.getPageSize(); + pageVo.setOffset(offset); + pageVo.setLimit(limit); + return shoppingGoodsDao.selectShoppingGoodsApiInPage(shoppingGoodsListDto, pageVo); + } + + @Override + public int findShoppingGoodsListTotalForApi(ShoppingGoodsListDto shoppingGoodsListDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + shoppingGoodsListDto.setShopId(user.getShopId()); + + return shoppingGoodsDao.selectShopppingGoodsAipTotal(shoppingGoodsListDto); + } + + @Override + public ShoppingGoodsDetailVo findApiShoppingGoodsDetailById(Long id) { + ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(id); + ShoppingGoodsDetailVo goodsDetailVo = goodsToGoodsDetailVo(shoppingGoods); + + if (ShoppingGoods.SHOPPING_GOODS_TYPE_TC.equals(shoppingGoods.getGoodType())) { + List<ShoppingGoodsDetailVo> products = shoppingGoodsAssembleDao.selectGoodsRelationGoodsList(shoppingGoods.getId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP); + List<ShoppingGoodsDetailVo> proj = shoppingGoodsAssembleDao.selectGoodsRelationGoodsList(shoppingGoods.getId(), ShoppingGoods.SHOPPING_GOODS_TYPE_XM); + + goodsDetailVo.setAssembleTaocanProduct(products); + goodsDetailVo.setAssembleTaocanProj(proj); + } else if (ShoppingGoods.SHOPPING_GOODS_TYPE_XM.equals(shoppingGoods.getGoodType())) { + List<ShoppingGoodsDetailVo> products = shoppingGoodsAssembleDao.selectGoodsRelationGoodsList(shoppingGoods.getId(), null); + goodsDetailVo.setAssembleProj(products); + } else if (ShoppingGoods.SHOPPING_GOODS_TYPE_CZK.equals(shoppingGoods.getGoodType())) { + List<ShoppingGoodsDetailVo> cardGoods = moneyCardAssembleDao.selectCardRelationGoods(shoppingGoods.getId()); + List<ShoppingGoodsCategory> cardCategory = moneyCardAssembleDao.selectCardRelationCategory(shoppingGoods.getId()); + + goodsDetailVo.setAssembleProj(cardGoods); + goodsDetailVo.setCardCategory(cardCategory); + } + return goodsDetailVo; + } + + private ShoppingGoodsDetailVo goodsToGoodsDetailVo(ShoppingGoods shoppingGoods) { + ShoppingGoodsDetailVo goodsDetailVo = new ShoppingGoodsDetailVo(); + goodsDetailVo.setImg(shoppingGoods.getImg()); + goodsDetailVo.setGoodsName(shoppingGoods.getName()); + goodsDetailVo.setGoodsNo(shoppingGoods.getCode()); + goodsDetailVo.setGoodsType(shoppingGoods.getGoodType()); + goodsDetailVo.setDesc(shoppingGoods.getDescription()); + goodsDetailVo.setMaxSaleCnt(shoppingGoods.getCarMaxSaleCount()); + goodsDetailVo.setLimitBuyCnt(shoppingGoods.getIsOnce()); + goodsDetailVo.setMaxUseCnt(shoppingGoods.getCarUseCount()); + goodsDetailVo.setMeasure(shoppingGoods.getMeasure()); + goodsDetailVo.setVolume(shoppingGoods.getVolume()); + goodsDetailVo.setSalePrice(BigDecimal.valueOf(shoppingGoods.getSealPice())); + goodsDetailVo.setSaleCnt(shoppingGoods.getRealSealCount()); + goodsDetailVo.setGiftPrice(BigDecimal.valueOf(shoppingGoods.getReferencePice() == null ? 0 : shoppingGoods.getReferencePice())); + return goodsDetailVo; + } } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysBeauticianStateServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysBeauticianStateServiceImpl.java index 668802f..843dd94 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysBeauticianStateServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysBeauticianStateServiceImpl.java @@ -93,7 +93,9 @@ return sysBeauticianStateDao.selectByTimeAndStaff(id,beginTime,endTime); } - - - + + @Override + public List<SysBeauticianState> findBySerId(Long serviceId) { + return sysBeauticianStateDao.selectBySerIds(serviceId); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysInstoreInfoServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysInstoreInfoServiceImpl.java index f1ca701..6ca75ad 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysInstoreInfoServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysInstoreInfoServiceImpl.java @@ -69,9 +69,10 @@ Long id = sysInstoreInfo.getId(); SysInstoreInfo getInstoreInfo = sysInstoreInfoDao.selectById(id); // 已经审核过的单据不能在修改 - if (!getInstoreInfo.getCheckStatus().equals(Dictionary.CHECK_STATUS_DSH)) { + if (!getInstoreInfo.getCheckStatus().equals(Dictionary.CHECK_STATUS_DSH) && !getInstoreInfo.getCheckStatus().equals(Dictionary.CHECK_STATUS_SHWTG)) { throw new GlobleException("已审核,不能再修改"); } + sysInstoreInfo.setCheckStatus(Dictionary.CHECK_STATUS_DSH); // 设置总金额 sysInstoreInfo.setSumall(savevDetatil(sysInstoreInfo)); return sysInstoreInfoDao.update(sysInstoreInfo); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderFlowServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderFlowServiceImpl.java new file mode 100644 index 0000000..c4553ce --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderFlowServiceImpl.java @@ -0,0 +1,71 @@ +package com.matrix.system.hive.service.imp; + +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysOrderFlow; +import com.matrix.system.hive.dao.SysOrderFlowDao; +import com.matrix.system.hive.service.SysOrderFlowService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wzy + * @date 2021-01-11 + **/ +@Service +public class SysOrderFlowServiceImpl implements SysOrderFlowService { + + @Autowired + private SysOrderFlowDao sysOrderFlowDao; + + @Override + public int add(SysOrderFlow obje) { + return 0; + } + + @Override + public int modify(SysOrderFlow obje) { + return 0; + } + + @Override + public int remove(List<Long> list) { + return 0; + } + + @Override + public int removeById(Long id) { + return 0; + } + + @Override + public List<SysOrderFlow> findInPage(SysOrderFlow obje, PaginationVO pageVo) { + return null; + } + + @Override + public List<SysOrderFlow> findByModel(SysOrderFlow obje) { + return null; + } + + @Override + public int findTotal(SysOrderFlow obje) { + return 0; + } + + @Override + public SysOrderFlow findById(Long id) { + return null; + } + + @Override + public List<SysOrderFlow> findByOrderId(Long orderId) { + return sysOrderFlowDao.selectByOrderId(orderId); + } + + @Override + public List<SysOrderFlow> findPayMethodsAmount(Long orderId) { + return sysOrderFlowDao.selectPayMethodsAmountByOrderId(orderId); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderItemServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderItemServiceImpl.java index c48c3ea..a61e323 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderItemServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderItemServiceImpl.java @@ -88,4 +88,8 @@ return sysOrderItemDao.selectDclItemTotal(vipId); } + @Override + public List<SysOrderItem> findByOrderId(Long orderId) { + return sysOrderItemDao.selectByOrderId(orderId); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java index b0bf857..0c14697 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java @@ -1,35 +1,49 @@ package com.matrix.system.hive.service.imp; +import cn.hutool.core.collection.CollectionUtil; +import com.matrix.component.asyncmessage.AsyncMessageManager; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.OrderListDto; +import com.matrix.system.app.mapper.SysProjUseMapper; +import com.matrix.system.app.vo.OrderDetailAchieveItemVo; +import com.matrix.system.app.vo.OrderDetailItemVo; +import com.matrix.system.app.vo.OrderDetailVo; +import com.matrix.system.app.vo.RankingVo; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.common.dao.SysUsersDao; import com.matrix.system.constance.Dictionary; -import com.matrix.system.constance.SystemConstance; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.*; -import com.matrix.system.hive.hievEnum.PayMethodEnum; import com.matrix.system.hive.plugin.util.CollectionUtils; -import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.plugin.util.MoneyUtil; import com.matrix.system.hive.pojo.CzXkVo; import com.matrix.system.hive.pojo.ShoppingCarItem; import com.matrix.system.hive.pojo.ShoppingCarItemsVo; -import com.matrix.system.hive.service.AchieveNewService; -import com.matrix.system.hive.service.CodeService; -import com.matrix.system.hive.service.SysOrderService; +import com.matrix.system.hive.service.*; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import com.matrix.system.wechart.templateMsg.UniformMsgParam; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpSession; +import javax.validation.constraints.NotEmpty; +import java.math.BigDecimal; import java.util.*; +import java.util.stream.Collectors; /** * @date 2016-07-03 20:53 @@ -55,7 +69,11 @@ @Autowired MoneyCardUseFlowDao moneyCardUseFlowDao; + @Autowired + ScoreVipDetailService scoreVipDetailService; + @Autowired + BusParameterSettingsDao busParameterSettingsDao; @Autowired SysVipLevelDao sysVipLevelDao; @@ -79,7 +97,35 @@ private AchieveNewService achieveNewService; @Autowired + private AchieveNewDao achieveNewDao; + + @Autowired private WarehouseDao warehouseDao; + + @Autowired + private ShoppingGoodsService shoppingGoodsService; + + @Autowired + private SysOrderFlowDao sysOrderFlowDao; + + @Autowired + private SysSupplierInfoDao sysSupplierInfoDao; + + @Autowired + private SysInstoreInfoDao sysInstoreInfoDao; + + @Autowired + private SysInstoreDetailDao sysInstoreDetailDao; + + @Autowired + private SysInstoreInfoService sysInstoreInfoService; + + @Autowired + BusParameterSettingsDao parameterSettingsDao; + + @Autowired + private AsyncMessageManager asyncMessageManager; + @Override public int add(SysOrder sysOrder) { @@ -109,7 +155,7 @@ @Override public List<SysOrder> findInPage(SysOrder sysOrder, PaginationVO pageVo) { - if(pageVo!=null){ + if (pageVo != null) { pageVo.setSort("desc"); pageVo.setSort("orderTime"); } @@ -140,23 +186,25 @@ @Override public SysOrder checkAndSaveOrder(SysOrder sysOrder) { - // 收款改变订单状态 - /** - * 判断订单条目的一个付款情况 - */ - // 计算现金支付金额 - double xjMoney = 0.0; - // 计算卡支付总额 - double cardMoney = 0.0; // 计算订单折扣金额,收款情况下 计算订单总额 double zkTotal = 0.0; - /** - * 记录本次消费的卡,防止扣除多次消费记录 - */ - ArrayList<Long> userCard = new ArrayList<Long>(); + + // 判断是否为退款 + String orderStatus = Dictionary.ORDER_STATU_DFK; + if (Dictionary.ORDER_STATU_TK.equals(sysOrder.getStatu())) { + orderStatus = Dictionary.ORDER_STATU_TK; + } // 页面的pageOrder 参数只包含支付金额信息,不带有购买商品 for (SysOrderItem item : sysOrder.getItems()) { + // 若为退款,则先更新原有数量 + if (orderStatus.equals(Dictionary.ORDER_STATU_TK)) { + SysOrderItem sysOrderItem = new SysOrderItem(); + sysOrderItem.setId(item.getId()); + sysOrderItem.setCount(item.getPreCount() - item.getCount()); + orderItemDao.update(sysOrderItem); + } + item.setId(null); ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(item.getGoodsId()); item.setType(shoppingGoods.getGoodType()); @@ -164,52 +212,29 @@ item.setIsFree(Dictionary.FLAG_YES); } - - // 如果支付方式是非现金则记录现金支付金额 - if (!item.getPayMethod().equals(PayMethodEnum.VIP_CARD.getCode())) { - xjMoney = MoneyUtil.add(xjMoney, item.getPayMoney()); - item.setCashPay(item.getPayMoney()); - } else { - cardMoney = MoneyUtil.add(cardMoney, item.getPayMoney()); - item.setCardPay(item.getPayMoney()); - - } - - // 订单欠款减去支付金额 设置实际欠款 Double itemZkTotal = MoneyUtil.mul(item.getZkPrice(), Double.valueOf(item.getCount())); - zkTotal=MoneyUtil.add(zkTotal, itemZkTotal); - item.setArrears(MoneyUtil.sub(itemZkTotal, item.getPayMoney())); - - - // 如果存在欠款,将条目状态设置为欠款 - if (item.getArrears() > 0) { - item.setStatus(Dictionary.ORDER_STATU_QK); - } else if (item.getArrears() < 0) { - item.setPayMoney(item.getZkPrice()); - item.setStatus(Dictionary.ORDER_STATU_DFK); - } else { - item.setStatus(Dictionary.ORDER_STATU_DFK); - } + zkTotal = MoneyUtil.add(zkTotal, itemZkTotal); + item.setStatus(orderStatus); } - double arrears; - SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - // 如果是收款,收款可以改变订单价格,所以需要求和出 订单折后价来计算本次欠款 - arrears = MoneyUtil.sub(zkTotal, MoneyUtil.add(cardMoney, xjMoney)); - sysOrder.setZkTotal(zkTotal); - sysOrder.setArrears(arrears); - sysOrder.setCardPay(cardMoney); - sysOrder.setCashPay(xjMoney); - sysOrder.setStatu(Dictionary.ORDER_STATU_DFK); - sysOrder.setCompanyId(user.getCompanyId()); - sysOrder.setPayTime(new Date()); - if(sysOrder.getId()==null){ + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + sysOrder.setZkTotal(zkTotal); + sysOrder.setStatu(orderStatus); + SysOrder source = null; + if (sysOrder.getId() != null) { + source = sysOrderDao.selectById(sysOrder.getId()); + } + sysOrder.setStaffId(source != null ? source.getStaffId() : user.getSuId()); + sysOrder.setCompanyId(source != null ? source.getCompanyId() : user.getCompanyId()); + + + if (sysOrder.getId() == null) { //新增订单 sysOrder.setOrderNo(codeService.getOrderCode()); sysOrderDao.insert(sysOrder); - }else{ + } else { //更新订单 sysOrderDao.update(sysOrder); //删除原有订单明细 @@ -218,7 +243,16 @@ sysOrder.getItems().forEach(sysOrderItem -> { sysOrderItem.setOrderId(sysOrder.getId()); - orderItemDao.insert(sysOrderItem); + if (sysOrder.getStatu().equals(Dictionary.ORDER_STATU_TK)) { + // 取负数 + sysOrderItem.setCount(-sysOrderItem.getCount()); + orderItemDao.insert(sysOrderItem); + // 调整回来 + sysOrderItem.setCount(-sysOrderItem.getCount()); + } else { + orderItemDao.insert(sysOrderItem); + } + }); return sysOrder; @@ -226,7 +260,6 @@ /** * 取消订单 - * 本方法无法退回多次不同卡项收款的订单 * * @param id * @return @@ -240,6 +273,12 @@ order.setStatu(Dictionary.ORDER_STATU_YQX); order.setArrears(0D); + + //发送微信公众号提醒 + UniformMsgParam uniformMsgParam = new UniformMsgParam(order.getCompanyId(), UniformMsgParam.GZH_DDQX); + uniformMsgParam.put("orderId", order.getId()); + asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); + return sysOrderDao.update(order); } else { @@ -249,26 +288,25 @@ throw new GlobleException("订单已取消"); } - List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(id); + List<SysOrderFlow> flows = sysOrderFlowDao.selectByOrderId(id); + // 非现金收款退回扣卡余额 + for (SysOrderFlow flow : flows) { + if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { - for (SysOrderItem orderItem : sysOrderItems) { - - //非现金收款退回扣卡余额 - if (StringUtils.isNotBlank(orderItem.getPayMethodDetail())) { - - MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(Long.parseLong(orderItem.getPayMethodDetail())); + MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); if (moneyCardUse != null) { - // 根据订单明细判断是赠送金额购买还是本金购买 - - moneyCardUseFlow.setTotal(orderItem.getCardPay()); - moneyCardUse.setRealMoney(MoneyUtil.add(moneyCardUse.getRealMoney(), orderItem.getCardPay())); - //TODO 目前无法退回到具体的赠送金额还是本金 + moneyCardUseFlow.setTotal(flow.getAmount().doubleValue()); + if (SysOrderFlow.IS_GIFT_Y.equals(flow.getIsGift())) { + moneyCardUse.setGiftMoney(MoneyUtil.add(moneyCardUse.getGiftMoney(), flow.getAmount().doubleValue())); + } else { + moneyCardUse.setRealMoney(MoneyUtil.add(moneyCardUse.getRealMoney(), flow.getAmount().doubleValue())); + } if (!moneyCardUse.getIsVipCar().equals(Dictionary.FLAG_YES_Y)) { - if(moneyCardUse.getLastCount()!=null) { + if (moneyCardUse.getLastCount() != null) { moneyCardUse.setLastCount(moneyCardUse.getLastCount() + 1); moneyCardUseFlow.setTimes(1); } @@ -283,33 +321,30 @@ moneyCardUseFlow.setCreateTime(new Date()); moneyCardUseFlow.setOperationId(user.getSuId()); moneyCardUseFlow.setContent(moneyCardUse.getChangeRemark()); - moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney()+moneyCardUse.getRealMoney()); + moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney()); moneyCardUseFlowDao.insert(moneyCardUseFlow); } } + } + + List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(id); + for (SysOrderItem orderItem : sysOrderItems) { // 充值卡类型退款 if (Dictionary.SHOPPING_GOODS_TYPE_CZK.equals(orderItem.getType())) { - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(orderItem.getGoodsId()); - - //删除购买的充值卡 moneyCardUseDao.deleteByOrderItemId(orderItem.getId()); - } else if (Dictionary.SHOPPING_GOODS_TYPE_XM.equals(orderItem.getType()) || Dictionary.SHOPPING_GOODS_TYPE_TC.equals(orderItem.getType())) { // 项目套餐退款 // 删除套餐项目使用情况 sysProjUseDao.deleteByOrderItemId(orderItem.getId()); - - } else if (Dictionary.SHOPPING_GOODS_TYPE_ZHK.equals(orderItem.getType())) { // 综合卡 // 删除套餐项目使用情况 sysProjUseDao.deleteByOrderItemId(orderItem.getId()); // 删除充值卡 moneyCardUseDao.deleteByOrderItemId(orderItem.getId()); - } } @@ -333,10 +368,18 @@ AchieveNew achieveNew = new AchieveNew(); achieveNew.setOrderId(id); achieveNewService.removeByModel(achieveNew); + + // 删除收款记录 + sysOrderFlowDao.deleteByOrderId(id); + + //删除积分 + scoreVipDetailService.removeByBusinessId(order.getVipId(), order.getId()); + // 取消订单 order.setStatu(Dictionary.ORDER_STATU_YQX); return sysOrderDao.update(order); } + } @@ -351,12 +394,10 @@ throw new GlobleException("没用选择购买产品"); } // 获取会员信息,判断等级 获取相应家居折扣 - SysVipInfo info = (SysVipInfo) WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER); + SysVipInfo info = sysVipInfoDao.selectById(car.getVipId()); //获取折扣----- Double zk = zk = 1.0; - //验证商品是否只购买了一次 - checkBuyOnce(car, info.getId()); SysOrder order = new SysOrder(); SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); @@ -371,6 +412,7 @@ order.setStatu(Dictionary.ORDER_STATU_DFK); order.setCardPay(0.00); order.setCashPay(0.00); + order.setCompanyId(user.getCompanyId()); order.setBeatuyId(car.getBeatuyId() + ""); // 根据美疗师id查询美疗师姓名 if (car.getBeatuyId() != null) { @@ -386,8 +428,7 @@ int count = 0; // 设置订单条目 for (ShoppingCarItem carItem : car.getCarItems()) { - // 检测最大销售数量 - checkIsArrivedMax(carItem); + SysOrderItem orderItem = new SysOrderItem(); orderItem.setOrderId(order.getId()); orderItem.setCount(carItem.getCount()); @@ -420,26 +461,10 @@ // 设置订单总价与折后价 order.setTotal(total); order.setZkTotal(zkTotal); - order.setArrears(zkTotal); sysOrderDao.update(order); return i; } - - /** - * 验证商品是否购买过一次 - * - * @Title: checkBuyOnce @author:jyy @param car void 返回类型 @date - * 2016年9月22日 上午10:05:33 @throws - */ - private void checkBuyOnce(ShoppingCarItemsVo car, Long vipId) { - for (ShoppingCarItem carItem : car.getCarItems()) { - if (shoppingGoodsDao.selectBuyCount(carItem.getGoodsId(), vipId) > 0) { - ShoppingGoods goods = shoppingGoodsDao.selectById(carItem.getGoodsId()); - throw new GlobleException(goods.getName() + "只能购买一次!"); - } - } - } /** * jyy 收款 @@ -448,10 +473,16 @@ @Transactional(rollbackFor = Exception.class) public void updateReceiptMoney(SysOrder pageOrder) throws GlobleException { - if (!Dictionary.ORDER_STATU_DFK.equals(pageOrder.getStatu())) { throw new GlobleException("该订单已经收过款,请刷新页面再试!"); } + + + checkOrder(pageOrder); + + + // 更新收款时间 + updateOrderInfo(pageOrder); // 获取用户信息 SysVipInfo vipInfo = sysVipInfoDao.selectById(pageOrder.getVipId()); @@ -461,66 +492,336 @@ sysVipInfoDao.update(vipInfo); } - changeOrderStatu(pageOrder); + //添加支付流水 + addOrderFlow(pageOrder); + // 设置会员充值卡使用情况 addMoneyCardUse(pageOrder); - // 新增出库单 - addOutStore(pageOrder); - // 改变客户项目套餐使用情况 addTaocanProj(pageOrder); + + // 新增出库单 + addOutStore(pageOrder); // 设置业绩 achieveNewService.addAchaeveByOrder(pageOrder); setShopSelCount(pageOrder); + //设置会员积分 + addVipScore(pageOrder); } /** - * 收款改变订单状态,划扣金额 - * @author:姜友瑶 + * 付款后更新订单信息 + * @param pageOrder */ - private void changeOrderStatu(SysOrder sourceOrder) { + private void updateOrderInfo(SysOrder pageOrder) { + pageOrder.setPayTime(new Date()); + pageOrder.setStatu(Dictionary.ORDER_STATU_YFK); + List<SysOrderFlow> flows = pageOrder.getFlows(); - boolean haQk=false; + BigDecimal cashPayAmount = flows.stream() + .filter(item -> (!item.getPayMethod().equals("储值卡")) && (!item.getPayMethod().equals("欠款"))) + .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); - for(SysOrderItem sysOrderItem:sourceOrder.getItems()){ + BigDecimal cardPayAmount = flows.stream() + .filter(item -> item.getPayMethod().equals("储值卡") && item.getIsGift().equals("N")) + .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); - if(!sysOrderItem.getStatus().equals(Dictionary.ORDER_STATU_QK)){ - SysOrderItem updateItem=new SysOrderItem(); - updateItem.setId(sysOrderItem.getId()); - updateItem.setStatus(Dictionary.ORDER_STATU_YFK); + pageOrder.setCardPay(cardPayAmount.doubleValue()); + pageOrder.setCashPay(cashPayAmount.doubleValue()); + //欠款金额在流水处理中处理了 - if (sysOrderItem.getPayMethod().equals(Dictionary.PAY_TYPE_MOENY_CARD ) ) { + double sum = flows.stream().mapToDouble(item -> item.getAmount().doubleValue()).sum(); - if(sysOrderItem.getPayMethodDetail()!=null){ - // 查询要支付的充值卡 - MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(Long.parseLong(sysOrderItem.getPayMethodDetail())); - // 扣除付款卡金额并添加流水 - cardPaySk(moneyCardUse, sourceOrder, sysOrderItem); - }else{ - throw new GlobleException("请选择支付的会员卡"); - } + if(sum>0 && cardPayAmount.doubleValue()==0 && cashPayAmount.doubleValue()==0 ){ + throw new GlobleException("订单更新失败,支付金额计算错误,请联系管理员"); + } + sysOrderDao.update(pageOrder); + } + + private void checkOrder(SysOrder pageOrder) { + //检查交易限制调整 + checkSealLimit(pageOrder); + //检查业绩设置 + checkOrderAchieve(pageOrder); + } + + /** + * 检查业绩设置是否合理 + * 1、每个订单明细都要有至少一个对应的业绩 + * 2、每个订单明细的同类型业绩金额之和不能大于明细支付金额 + * + * @param pageOrder + */ + private void checkOrderAchieve(SysOrder pageOrder) { + + pageOrder.getItems().forEach(item -> { + + if (CollectionUtil.isEmpty(item.getAchieveList())) { + ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId()); + throw GlobleException.instance(shopGoods.getName() + "缺少设置业绩"); + } + + //按业绩类型分组后比较支付金额与业绩金额是否相等 + Map<String, List<AchieveNew>> achieveTypeMap = item.getAchieveList().stream().collect(Collectors.groupingBy(AchieveNew::getAchieveType)); + Set<Map.Entry<String, List<AchieveNew>>> entries = achieveTypeMap.entrySet(); + entries.forEach(entrie -> { + double sum = entrie.getValue().stream().mapToDouble(AchieveNew::getGoodsCash).sum(); + //todo 目前使用js计算金额可能存在精度的误差展示用0.1屏蔽 + if (Math.abs(sum- (item.getZkPrice()*item.getCount()) )>0.1) { + ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId()); + throw GlobleException.instance(shopGoods.getName() + "," + entrie.getKey() + "业绩金额与收款金额不一致"); } - orderItemDao.update(updateItem); - }else { - haQk=true; + }); + }); + + } + + /** + * 检查产品销售次数 + */ + private void checkSealLimit(SysOrder pageOrder) { + pageOrder.getItems().forEach(item -> { + ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId()); + + //最大销售次数检测 + Integer maxNum = shopGoods.getCarMaxSaleCount(); + if (maxNum != null && maxNum != 0) { + Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId(), null); + if ((buyNum + item.getCount()) > maxNum) { + throw new GlobleException(shopGoods.getName() + "已超过最大销售数量"); + } + if ((buyNum + item.getCount()) == maxNum) { + if (!shopGoods.getStaus().equals(Dictionary.BUSINESS_STATE_DOWN)) { + shopGoods.setStaus(Dictionary.BUSINESS_STATE_DOWN); + shoppingGoodsDao.update(shopGoods); + } + } + } + //每人限购次数检测 + Integer onceCount = shopGoods.getIsOnce(); + if (onceCount != null && onceCount != 0) { + Integer buyOnceCount = orderItemDao.selectByGoodsId(shopGoods.getId(), pageOrder.getVipId()); + + if ((buyOnceCount + item.getCount()) > onceCount) { + throw new GlobleException(shopGoods.getName() + "每人限购" + onceCount + "次"); + } + } + + }); + + } + + + /** + * 设置会员消费积分 + * + * @param pageOrder + */ + private void addVipScore(SysOrder pageOrder) { + + SysVipInfo vipInfo = sysVipInfoDao.selectById(pageOrder.getVipId()); + + List<SysOrderFlow> flows = pageOrder.getFlows(); + int[] cashScore = {0, 0, 0}; + //现金支付金额 + BigDecimal cashPayAmount = flows.stream() + .filter(item -> (!item.getPayMethod().equals("储值卡")) && (!item.getPayMethod().equals("欠款"))) + .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BusParameterSettings cashConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.CASH_CONSUMPTION, vipInfo.getCompanyId()); + if (cashPayAmount != null + && cashPayAmount.compareTo(BigDecimal.ZERO) > 0 + && StringUtils.isNotBlank(cashConsumption.getParamValue())) { + + BigDecimal scoreSetting0 = new BigDecimal(cashConsumption.getParamValue()); + if (scoreSetting0.compareTo(BigDecimal.ZERO) > 0) { + cashScore[0] = cashPayAmount.divide(scoreSetting0).intValue(); + } + + if (StringUtils.isNotBlank(cashConsumption.getParamValue1())) { + BigDecimal scoreSetting1 = new BigDecimal(cashConsumption.getParamValue1()); + if (scoreSetting1.compareTo(BigDecimal.ZERO) > 0) { + cashScore[1] = cashPayAmount.divide(scoreSetting1).intValue(); + } + + } + + if (StringUtils.isNotBlank(cashConsumption.getParamValue2())) { + BigDecimal scoreSetting2 = new BigDecimal(cashConsumption.getParamValue2()); + if (scoreSetting2.compareTo(BigDecimal.ZERO) > 0) { + cashScore[2] = cashPayAmount.divide(scoreSetting2).intValue(); + } + } } - //更新收款状态 - if(haQk){ - sourceOrder.setStatu(Dictionary.ORDER_STATU_QK); - }else{ - sourceOrder.setStatu(Dictionary.ORDER_STATU_YFK); + + int[] cardScore = {0, 0, 0}; + //储值卡本金支付金额 + BigDecimal cardPayAmount = flows.stream() + .filter(item -> item.getPayMethod().equals("储值卡") && item.getIsGift().equals("N")) + .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + + BusParameterSettings principalBalanceConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, vipInfo.getCompanyId()); + if (cardPayAmount != null + && cardPayAmount.compareTo(BigDecimal.ZERO) > 0 + && StringUtils.isNotBlank(principalBalanceConsumption.getParamValue())) { + + BigDecimal scoreSetting0 = new BigDecimal(principalBalanceConsumption.getParamValue()); + if (scoreSetting0.compareTo(BigDecimal.ZERO) > 0) { + cardScore[0] = cardPayAmount.divide(scoreSetting0).intValue(); + } + + if (StringUtils.isNotBlank(principalBalanceConsumption.getParamValue1())) { + BigDecimal scoreSetting1 = new BigDecimal(principalBalanceConsumption.getParamValue1()); + if (scoreSetting1.compareTo(BigDecimal.ZERO) > 0) { + cardScore[1] = cardPayAmount.divide(scoreSetting1).intValue(); + } + } + + if (StringUtils.isNotBlank(principalBalanceConsumption.getParamValue2())) { + BigDecimal scoreSetting2 = new BigDecimal(principalBalanceConsumption.getParamValue2()); + if (scoreSetting2.compareTo(BigDecimal.ZERO) > 0) { + cardScore[2] = cardPayAmount.divide(scoreSetting2).intValue(); + } + } } - sysOrderDao.update(sourceOrder); + int[] giftScore = {0, 0, 0}; + //储值卡本赠送付金额 + BigDecimal giftPayAmount = flows.stream() + .filter(item -> item.getPayMethod().equals("储值卡") && item.getIsGift().equals("Y")) + .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BusParameterSettings bonusBalanceConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, vipInfo.getCompanyId()); + if (giftPayAmount != null + && giftPayAmount.compareTo(BigDecimal.ZERO) > 0 + && StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue())) { + BigDecimal scoreSetting0 = new BigDecimal(bonusBalanceConsumption.getParamValue()); + if (scoreSetting0.compareTo(BigDecimal.ZERO) > 0) { + giftScore[0] = giftPayAmount.divide(scoreSetting0).intValue(); + } + + if (StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue1())) { + BigDecimal scoreSetting1 = new BigDecimal(bonusBalanceConsumption.getParamValue1()); + if (scoreSetting1.compareTo(BigDecimal.ZERO) > 0) { + giftScore[1] = giftPayAmount.divide(scoreSetting1).intValue(); + } + } + + if (StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue2())) { + BigDecimal scoreSetting2 = new BigDecimal(bonusBalanceConsumption.getParamValue2()); + if (scoreSetting2.compareTo(BigDecimal.ZERO) > 0) { + giftScore[2] = giftPayAmount.divide(scoreSetting2).intValue(); + } + } + } + + int selfScore = cashScore[0] + cardScore[0] + giftScore[0]; + int parentScore = cashScore[1] + cardScore[1] + giftScore[1]; + int topParentScore = cashScore[2] + cardScore[2] + giftScore[2]; + + + //添加自己的积分 + if (selfScore > 0) { + scoreVipDetailService.addScore( + vipInfo.getId(), + pageOrder.getStaffId(), + pageOrder.getShopId(), + selfScore, + pageOrder.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "消费奖励" + ); + } + + if (vipInfo.getRecommendId() != null) { + //推荐注册老带新积分奖励 + SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); + if (parentScore > 0) { + scoreVipDetailService.addScore( + referrerVip.getId(), + pageOrder.getStaffId(), + pageOrder.getShopId(), + parentScore, + pageOrder.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "推荐消费奖励" + ); + } + //推荐注册二级带新积分奖励 + if (referrerVip.getRecommendId() != null) { + SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); + if (topParentScore > 0) { + scoreVipDetailService.addScore( + topVipInfo.getId(), + pageOrder.getStaffId(), + pageOrder.getShopId(), + topParentScore, + pageOrder.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "推荐消费奖励" + ); + } + } + } + } + + /** + * 创建支付流水 + * + * @author:姜友瑶 + */ + private void addOrderFlow(SysOrder sourceOrder) { + + + //处理支付流水 + int flowCount = 1; + for (SysOrderFlow flow : sourceOrder.getFlows()) { + //支付内容摘要设置 + Long goodsId = sourceOrder.getItems().get(0).getGoodsId(); + ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); + flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); + // 若是退款,则取负数 + if (SysOrder.ORDER_TYPE_REFUND == sourceOrder.getOrderType()) { + flow.setFlowType(SysOrderFlow.FLOW_TYPE_REFUND); + flow.setAmount(flow.getAmount().negate()); + flow.setOrderId(sourceOrder.getOldOrderId()); + } else { + flow.setFlowType(SysOrderFlow.FLOW_TYPE_BUY); + flow.setOrderId(sourceOrder.getId()); + } + + //欠款处理 + if (SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod())) { + sourceOrder.setStatu(Dictionary.ORDER_STATU_QK); + sourceOrder.setArrears(flow.getAmount().doubleValue()); + sysOrderDao.update(sourceOrder); + } + + //统计储值卡支付 + if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { + if (flow.getCardId() != null) { + MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); + //修改储值卡余额 + cardPaySk(moneyCardUse, sourceOrder, flow); + } else { + throw new GlobleException("无效的储值卡支付方式"); + } + } + + flow.setFlowNo(codeService.getFlowCode() + "-" + flowCount); + flow.setVipId(sourceOrder.getVipId()); + flow.setShopId(sourceOrder.getShopId()); + flow.setCompanyId(sourceOrder.getCompanyId()); + sysOrderFlowDao.insert(flow); + flowCount++; + } } @@ -538,11 +839,10 @@ // 最大发卡数量为0代表不做限制 if (maxNum != null && maxNum != 0) { // 查询该商品已经被购买的次数 - Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId()); + Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId(), null); buyNum = (buyNum == null ? 0 : buyNum); if ((buyNum + carItem.getCount()) > maxNum) { - - throw new GlobleException(shopGoods.getName() + "已超过最大销售数量,还剩【" + (maxNum - buyNum) + "】件"); + throw new GlobleException(shopGoods.getName() + "已超过最大销售数量"); } if ((buyNum + carItem.getCount()) == maxNum) { if (!shopGoods.getStaus().equals(Dictionary.BUSINESS_STATE_DOWN)) { @@ -555,78 +855,67 @@ } - /** * 使用充值卡付款操作 * * @param sourceOrder - * @param userCard - * @param orderItem - * @param temp 设置是否扣除使用次数 true 扣除 + * @param moneyCardUse + * @param flow */ - private void cardPaySk(MoneyCardUse moneyCardUse, SysOrder sourceOrder, - SysOrderItem orderItem) { + private void cardPaySk(MoneyCardUse moneyCardUse, SysOrder sourceOrder, SysOrderFlow flow) { // 判断商品是否在充值卡的限制购买,判断分类 - if (!isInBangding(moneyCardUse, orderItem.getGoodsId())) { - throw new GlobleException(shoppingGoodsDao.selectById(orderItem.getGoodsId()).getName() + "不在" - + moneyCardUse.getCardName() + "优惠中"); - } - SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - Double balance = moneyCardUse.getRealMoney(); - if (moneyCardUse.getGiftMoney() != null) { - balance = MoneyUtil.add(balance, moneyCardUse.getGiftMoney()); - } - // 判断金额是否足够支付 - if (balance >= orderItem.getPayMoney()) { - - MoneyCardUseFlow moneyCardUseFlow=new MoneyCardUseFlow(); - - // 余额充足先从本金中扣除 - if (moneyCardUse.getRealMoney() >= orderItem.getPayMoney()) { - double surplus = MoneyUtil.sub(moneyCardUse.getRealMoney(), orderItem.getPayMoney()); - moneyCardUse.setRealMoney(surplus); - moneyCardUseFlow.setTotal(0-orderItem.getPayMoney()); - - } else { - // 本金不够 - double surplus = MoneyUtil.sub(orderItem.getPayMoney(), moneyCardUse.getRealMoney()); - moneyCardUseFlow.setTotal(0- moneyCardUse.getRealMoney()); - // 扣除所有本金 - moneyCardUse.setRealMoney(0D); - moneyCardUse.setGiftMoney(MoneyUtil.sub(moneyCardUse.getGiftMoney(), surplus)); - // 只要是用了赠送金额购买的就视为赠送套餐 18-12-01 jyy - orderItem.setIsFree(Dictionary.FLAG_YES); - moneyCardUseFlow.setGiftMoney(0-surplus); + sourceOrder.getItems().forEach(item -> { + if (!isInBangding(moneyCardUse, item.getGoodsId())) { + throw new GlobleException(shoppingGoodsDao.selectById(item.getGoodsId()).getName() + "不在" + moneyCardUse.getCardName() + "优惠中"); } + }); - //设置卡项使用流水 - moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); - moneyCardUseFlow.setOrderNo(sourceOrder.getOrderNo()); - moneyCardUseFlow.setVipId(sourceOrder.getVipId()); - moneyCardUseFlow.setTimes(-1); - moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CONSUMER); - moneyCardUseFlow.setCreateTime(new Date()); - moneyCardUseFlow.setOperationId(user.getSuId()); - moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney()+moneyCardUse.getRealMoney()); - moneyCardUseFlowDao.insert(moneyCardUseFlow); + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); + if (SysOrderFlow.IS_GIFT_Y.equals(flow.getIsGift())) { + if (moneyCardUse.getGiftMoney() >= flow.getAmount().doubleValue()) { + double surplus = MoneyUtil.sub(moneyCardUse.getGiftMoney(), flow.getAmount().doubleValue()); + moneyCardUse.setGiftMoney(surplus); + moneyCardUseFlow.setGiftMoney(0D - flow.getAmount().doubleValue()); + } else { + throw new GlobleException(moneyCardUse.getCardName() + "余额不足"); + } } else { - throw new GlobleException(moneyCardUse.getCardName() + "余额不足"); + if (moneyCardUse.getRealMoney() >= flow.getAmount().doubleValue()) { + double surplus = MoneyUtil.sub(moneyCardUse.getRealMoney(), flow.getAmount().doubleValue()); + moneyCardUse.setRealMoney(surplus); + moneyCardUseFlow.setTotal(0 - flow.getAmount().doubleValue()); + } else { + throw new GlobleException(moneyCardUse.getCardName() + "余额不足"); + } } - // 达到使用次数后自动清空余额 - if (!moneyCardUse.getIsVipCar().equals(Dictionary.FLAG_YES_Y) - && moneyCardUse.getLastCount() <= 0) { - moneyCardUse.setIsOver(Dictionary.FLAG_YES_Y); - moneyCardUse.setLastCount(0); - moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_WX); + if (moneyCardUse.getIsVipCar().equals(Dictionary.FLAG_NO_N)) { + //余额为0时充值卡变为无效 + if (moneyCardUse.getRealMoney().equals(0D) && moneyCardUse.getGiftMoney().equals(0D)) { + moneyCardUse.setIsOver(Dictionary.FLAG_YES_Y); + moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_WX); + } } - if (moneyCardUse.getRealMoney().equals(0D) && moneyCardUse.getGiftMoney().equals(0D)) { - moneyCardUse.setIsOver(Dictionary.FLAG_YES_Y); - moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_WX); + + ShoppingGoods shoppingGoods = shoppingGoodsService.findById(moneyCardUse.getGoodsId()); + if (shoppingGoods != null) { + Date invalidTime = shoppingGoodsService.calInvalidTime(shoppingGoods, 2, moneyCardUse.getFailTime()); + moneyCardUse.setFailTime(invalidTime); } // 更新充值卡信息 moneyCardUseDao.update(moneyCardUse); + //设置卡项使用流水 + moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); + moneyCardUseFlow.setOrderNo(sourceOrder.getOrderNo()); + moneyCardUseFlow.setVipId(sourceOrder.getVipId()); + moneyCardUseFlow.setTimes(-1); + moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CONSUMER); + moneyCardUseFlow.setCreateTime(new Date()); + moneyCardUseFlow.setOperationId(user.getSuId()); + moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney()); + moneyCardUseFlowDao.insert(moneyCardUseFlow); } /** @@ -644,6 +933,14 @@ return true; } else { // 不是一卡通, + // 判断卡是否可应用于所有产品 + ShoppingGoods cardGoods = shoppingGoodsDao.selectById(moneyCardUse.getGoodsId()); + if (cardGoods != null) { + if (Dictionary.FLAG_YES.equals(cardGoods.getCarIsAll())) { + return true; + } + } + // 比较分类 MoneyCardAssemble moneyCardAssemble = new MoneyCardAssemble(); moneyCardAssemble.setCardId(moneyCardUse.getGoodsId()); @@ -699,48 +996,40 @@ // 如果购买的是充值卡 if (sysOrderItem.getType().equals(Dictionary.SHOPPING_GOODS_TYPE_CZK)) { - ShoppingGoods moneyCar = shoppingGoodsDao.selectById(sysOrderItem.getGoodsId()); - MoneyCardUse moneyCardUse = new MoneyCardUse(); - moneyCardUse.setVipId(sourceOrder.getVipId()); - moneyCardUse.setGiftMoney(moneyCar.getReferencePice()); - moneyCardUse.setRealMoney(moneyCar.getSealPice()); - moneyCardUse.setGoodsId(moneyCar.getId()); - moneyCardUse.setIsOver(Dictionary.FLAG_NO_N); - moneyCardUse.setOrderItemId(sysOrderItem.getId()); - moneyCardUse.setSource(Dictionary.TAOCAN_SOURCE_GM); - moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); - moneyCardUse.setCardName(moneyCar.getName()); - - if (Dictionary.FLAG_YES.equals(moneyCar.getCarIsAll())) { - moneyCardUse.setIsVipCar(Dictionary.FLAG_YES_Y); - } else { - // 非会籍卡 - moneyCardUse.setIsVipCar(Dictionary.FLAG_NO_N); - } - - // 是否为赠送 - if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_YES)) { - moneyCardUse.setSource(Dictionary.TAOCAN_SOURCE_ZS); - } else { + for (int i = 0; i < sysOrderItem.getCount(); i++) { + ShoppingGoods moneyCar = shoppingGoodsDao.selectById(sysOrderItem.getGoodsId()); + MoneyCardUse moneyCardUse = new MoneyCardUse(); + moneyCardUse.setVipId(sourceOrder.getVipId()); + moneyCardUse.setGiftMoney(moneyCar.getReferencePice()); + moneyCardUse.setRealMoney(moneyCar.getSealPice()); + moneyCardUse.setGoodsId(moneyCar.getId()); + moneyCardUse.setOrderItemId(sysOrderItem.getId()); moneyCardUse.setSource(Dictionary.TAOCAN_SOURCE_GM); + moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); + moneyCardUse.setCardName(moneyCar.getName()); + moneyCardUse.setIsVipCar(Dictionary.FLAG_NO_N); + moneyCardUse.setVipId(sourceOrder.getVipId()); + + // 是否为赠送 + if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_YES)) { + moneyCardUse.setSource(Dictionary.TAOCAN_SOURCE_ZS); + } else { + moneyCardUse.setSource(Dictionary.TAOCAN_SOURCE_GM); + } + //余次处理 + if (moneyCar.getCarUseCount() == null || moneyCar.getCarUseCount() == 0) { + moneyCardUse.setUseTotal(999999999); + moneyCardUse.setLastCount(999999999); + } else { + moneyCardUse.setUseTotal(moneyCar.getCarUseCount()); + moneyCardUse.setLastCount(moneyCar.getCarUseCount()); + } + //失效时间处理 + Date invalidTime = shoppingGoodsService.calInvalidTime(sysOrderItem.getShoppingGoods(), 1, null); + moneyCardUse.setFailTime(invalidTime); + + moneyCardUseDao.insert(moneyCardUse); } - if (moneyCar.getCarUseCount() == null || moneyCar.getCarUseCount() == 0) { - moneyCardUse.setUseTotal(999999999); - moneyCardUse.setLastCount(999999999); - } else { - moneyCardUse.setUseTotal(moneyCar.getCarUseCount()); - moneyCardUse.setLastCount(moneyCar.getCarUseCount()); - } - moneyCardUse.setVipId(sourceOrder.getVipId()); - if (moneyCar.getValidity() == null || moneyCar.getValidity() == 0) { - // 设置失效时间 - Calendar cal = Calendar.getInstance(); - cal.set(2200, 1, 1); - moneyCardUse.setFailTime(cal.getTime()); - } else { - moneyCardUse.setFailTime(DateUtil.nextNDate(new Date(), 30 * moneyCar.getValidity())); - } - moneyCardUseDao.insert(moneyCardUse); } } } @@ -752,71 +1041,58 @@ @Transactional(rollbackFor = Exception.class) @Override public void updateAfterMoney(SysOrder pageOrder) { - SysOrder sourceOrder = sysOrderDao.selectById(pageOrder.getId()); - boolean haQk=false; + int i = 1; + double refundTotal = 0D; + double cardPayTotal = 0D; + double cashPayTotal = 0D; + for (SysOrderFlow flow : pageOrder.getFlows()) { + flow.setFlowNo(codeService.getFlowCode() + "-" + i); + Long goodsId = pageOrder.getItems().get(0).getGoodsId(); + ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); + flow.setFlowContent(goods.getName() + "等" + pageOrder.getItems().size() + "件产品"); - double cardPayTotal=0D; - double carshPayTotal=0D; + flow.setOrderId(pageOrder.getId()); + flow.setVipId(pageOrder.getVipId()); + flow.setFlowType(SysOrderFlow.FLOW_TYPE_REPAY); + // 若使用储值卡付款 + if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { + if (flow.getCardId() != null) { + cardPayTotal += flow.getAmount().doubleValue(); + MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); + cardPaySk(moneyCardUse, pageOrder, flow); + } + } else { + cashPayTotal += flow.getAmount().doubleValue(); + } - - for(SysOrderItem pageItem:pageOrder.getItems()){ - SysOrderItem sourceItem=orderItemDao.selectById(pageItem.getId()); - - //结清 - if(sourceItem.getArrears() == pageItem.getPayMoney()){ - - sourceItem.setStatus(Dictionary.ORDER_STATU_YFK); - }else if(sourceItem.getArrears() > pageItem.getPayMoney()) { - //未结清 - sourceItem.setStatus(Dictionary.ORDER_STATU_QK); - haQk=true; - }else if(sourceItem.getArrears() < pageItem.getPayMoney()) { - - throw new GlobleException("支付金额不能大于欠款金额"); - - } - - //更新卡支付 - if (!pageItem.getPayMethod().equals(Dictionary.PAY_TYPE_MOENY)) { - // 查询要支付的充值卡 - MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(Long.parseLong(pageItem.getPayMethod())); - // 扣除付款卡金额并添加流水 - cardPaySk(moneyCardUse, sourceOrder, pageItem); - sourceItem.setCardPay((sourceItem.getCardPay()==null?0:sourceItem.getCardPay())+pageItem.getPayMoney()); - cardPayTotal+=pageItem.getPayMoney(); - }else{ - carshPayTotal+=pageItem.getPayMoney(); - sourceItem.setCashPay((sourceItem.getCashPay()==null?0:sourceItem.getCashPay())+pageItem.getPayMoney()); - } - - //更新订单明细状态 - sourceItem.setArrears(sourceItem.getArrears()-pageItem.getPayMoney()); - - orderItemDao.update(sourceItem); - + refundTotal += flow.getAmount().doubleValue(); + flow.setShopId(sourceOrder.getShopId()); + flow.setCompanyId(sourceOrder.getCompanyId()); + sysOrderFlowDao.insert(flow); + i++; } + + boolean haQk = false; + + if (refundTotal == pageOrder.getArrears()) { + haQk = true; + } + //更新收款状态 - if(haQk){ - sourceOrder.setStatu(Dictionary.ORDER_STATU_QK); - }else{ + if (haQk) { sourceOrder.setStatu(Dictionary.ORDER_STATU_YFK); + } else { + sourceOrder.setStatu(Dictionary.ORDER_STATU_QK); } - sourceOrder.setArrears(sourceOrder.getArrears()-carshPayTotal-cardPayTotal); - sourceOrder.setCardPay(sourceOrder.getCardPay()+cardPayTotal); - sourceOrder.setCashPay(sourceOrder.getCashPay()+carshPayTotal); + sourceOrder.setArrears(sourceOrder.getArrears() - refundTotal); + sourceOrder.setCardPay(sourceOrder.getCardPay() == null ? 0 : sourceOrder.getCardPay() + cardPayTotal); + sourceOrder.setCashPay(sourceOrder.getCashPay() == null ? 0 : sourceOrder.getCashPay() + cashPayTotal); sysOrderDao.update(sourceOrder); - - // 设置业绩 - achieveNewService.addAchaeveByOrder(pageOrder); - } - - @Autowired - BusParameterSettingsDao parameterSettingsDao; /** * @param order 新增出库单并更新本店库存 @@ -826,102 +1102,110 @@ @Override public void addOutStore(SysOrder order) { - List<SysOutStoreItem> storeItemList = new ArrayList<>(); + BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, order.getCompanyId()); + if (AppConstance.IS_Y.equals(manageStockSetting.getParamValue())) { - for (SysOrderItem sysOrderItem : order.getItems()) { + List<SysOutStoreItem> storeItemList = new ArrayList<>(); - if (ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP.equals(sysOrderItem.getType())) { + for (SysOrderItem sysOrderItem : order.getItems()) { - SysOutStoreItem storeItem = new SysOutStoreItem(); - storeItem.setSkuId(sysOrderItem.getGoodsId()); - storeItem.setAmount(Double.valueOf(sysOrderItem.getCount())); - storeItemList.add(storeItem); + if (ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP.equals(sysOrderItem.getType())) { - } else if (ShoppingGoods.SHOPPING_GOODS_TYPE_TC.equals(sysOrderItem.getType()) + SysOutStoreItem storeItem = new SysOutStoreItem(); + storeItem.setSkuId(sysOrderItem.getGoodsId()); + storeItem.setAmount(Double.valueOf(sysOrderItem.getCount())); + storeItemList.add(storeItem); - || ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { + } else if (ShoppingGoods.SHOPPING_GOODS_TYPE_TC.equals(sysOrderItem.getType()) - List<ShoppingGoodsAssemble> goodsList = new ArrayList<>(); + || ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { - goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); + List<ShoppingGoodsAssemble> goodsList = new ArrayList<>(); - if (ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { - //综合卡处理,中的套餐,中的家居产品 - List<ShoppingGoodsAssemble> zhkAssemble = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_TC); - zhkAssemble.forEach(item -> { - goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(item.getAssembleGoodId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); + goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); + + if (ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { + //综合卡处理,中的套餐,中的家居产品 + List<ShoppingGoodsAssemble> zhkAssemble = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_TC); + zhkAssemble.forEach(item -> { + goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(item.getAssembleGoodId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); + }); + } + + goodsList.forEach(item -> { + SysOutStoreItem storeItem = new SysOutStoreItem(); + storeItem.setSkuId(item.getAssembleGoodId()); + storeItem.setAmount(Double.valueOf(item.getTotal())); + storeItemList.add(storeItem); }); } - - goodsList.forEach(item -> { - SysOutStoreItem storeItem = new SysOutStoreItem(); - storeItem.setSkuId(item.getAssembleGoodId()); - storeItem.setAmount(Double.valueOf(item.getTotal())); - storeItemList.add(storeItem); - }); } - } - if (CollectionUtils.isNotEmpty(storeItemList)) { - Long warehouseId = warehouseDao.findShopWarehouse(order.getShopId()).get(0).getId(); - SysOutStore outStore = new SysOutStore(); - outStore.setOutStoreNo(codeService.getOutStoreCode()); - outStore.setOrderId(order.getId()); - outStore.setShopId(order.getShopId()); - outStore.setShopId(order.getShopId()); - outStore.setStaffId(order.getStaffId()); - outStore.setType(Dictionary.OUT_STORE_JJCPCK); - outStore.setServiceNo(order.getOrderNo()); - outStore.setTime(new Date()); - outStore.setCheckStatus(Dictionary.CHECK_STATUS_DSH); - outStore.setCompanyId(order.getCompanyId()); - sysOutStoreDao.insert(outStore); + if (CollectionUtils.isNotEmpty(storeItemList)) { + Long warehouseId = warehouseDao.findShopWarehouse(order.getShopId()).get(0).getId(); + SysOutStore outStore = new SysOutStore(); + outStore.setOutStoreNo(codeService.getOutStoreCode()); + outStore.setOrderId(order.getId()); + outStore.setShopId(order.getShopId()); + outStore.setShopId(order.getShopId()); + outStore.setStaffId(order.getStaffId()); + outStore.setType(Dictionary.OUT_STORE_JJCPCK); + outStore.setServiceNo(order.getOrderNo()); + outStore.setTime(new Date()); + outStore.setCheckStatus(Dictionary.CHECK_STATUS_DSH); + outStore.setCompanyId(order.getCompanyId()); + sysOutStoreDao.insert(outStore); - //出库明细,根据批次维度定义 - List<SysOutStoreItem> realOutStoreItemList = new ArrayList<>(); + //出库明细,根据批次维度定义 + List<SysOutStoreItem> realOutStoreItemList = new ArrayList<>(); - storeItemList.forEach(outStoreItem -> { + storeItemList.forEach(outStoreItem -> { - //设置出库主键 - outStoreItem.setOutStoreId(outStore.getId()); + //设置出库主键 + outStoreItem.setOutStoreId(outStore.getId()); - //计算库存总数是否满足本次扣减的需求 - List<SysStoreInfo> stores = storeInfoDao.selectStoInfoBySku(outStoreItem.getSkuId(), warehouseId); - double sum = stores.stream().mapToDouble(item -> item.getStoreTotal()).sum(); - if (sum < outStoreItem.getAmount()) { - ShoppingGoods sysGoods = shoppingGoodsDao.selectById(outStoreItem.getSkuId()); - if (sysGoods != null) { - throw new GlobleException("出库失败:【" + sysGoods.getName() + "库存不足】"); - } else { - throw new GlobleException("出库失败没有找到出库产品"); + //计算库存总数是否满足本次扣减的需求 + List<SysStoreInfo> stores = storeInfoDao.selectStoInfoBySku(outStoreItem.getSkuId(), warehouseId); + double sum = stores.stream().mapToDouble(item -> item.getStoreTotal()).sum(); + if (sum < outStoreItem.getAmount()) { + ShoppingGoods sysGoods = shoppingGoodsDao.selectById(outStoreItem.getSkuId()); + if (sysGoods != null) { + throw new GlobleException("出库失败:【" + sysGoods.getName() + "库存不足】"); + + } else { + throw new GlobleException("出库失败没有找到出库产品"); + } } - } - //循环获取所有批次产品,并扣减库存 - Double number = outStoreItem.getAmount(); - for (SysStoreInfo storeInfo : stores) { - Double oldStoreTotal = storeInfo.getStoreTotal(); - Double surplus = storeInfo.getStoreTotal() - number; - //更新库存 - storeInfo.setStoreTotal(surplus < 0 ? 0 : surplus); + //循环获取所有批次产品,并扣减库存 + Double number = outStoreItem.getAmount(); + for (SysStoreInfo storeInfo : stores) { + Double oldStoreTotal = storeInfo.getStoreTotal(); + Double surplus = storeInfo.getStoreTotal() - number; + //更新库存 + storeInfo.setStoreTotal(surplus < 0 ? 0 : surplus); - //每次扣减库存都创建一个出库记录 - SysOutStoreItem sysOutStoreItem = new SysOutStoreItem(); - BeanUtils.copyProperties(outStoreItem, sysOutStoreItem); - sysOutStoreItem.setStoreId(storeInfo.getId()); - sysOutStoreItem.setAmount(oldStoreTotal - storeInfo.getStoreTotal()); - realOutStoreItemList.add(sysOutStoreItem); + //每次扣减库存都创建一个出库记录 + SysOutStoreItem sysOutStoreItem = new SysOutStoreItem(); + BeanUtils.copyProperties(outStoreItem, sysOutStoreItem); + sysOutStoreItem.setStoreId(storeInfo.getId()); + sysOutStoreItem.setAmount(oldStoreTotal - storeInfo.getStoreTotal()); + realOutStoreItemList.add(sysOutStoreItem); - storeInfoDao.update(storeInfo); - //扣除后剩余库存大于0则跳出扣除,否则剩余数量的负数的绝对值就是再次扣减的数量 - if (surplus > 0) { - break; - } else { - number = Math.abs(surplus); + storeInfoDao.update(storeInfo); + //扣除后剩余库存大于0则跳出扣除,否则剩余数量的负数的绝对值就是再次扣减的数量 + if (surplus > 0) { + break; + } else { + number = Math.abs(surplus); + } } - } - }); - sysOutStoreItemDao.batchInsert(realOutStoreItemList); + }); + sysOutStoreItemDao.batchInsert(realOutStoreItemList); + } + + } else { + LogUtil.debug("不管理库存"); } @@ -954,7 +1238,6 @@ } - public void addZongheCarUse(SysOrder order, SysOrderItem sysOrderItem) { @@ -965,7 +1248,8 @@ //综合卡中包含的项目 List<ShoppingGoodsAssemble> assembleList = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_XM); assembleList.forEach(item -> { - createProjuseByAssemble(order, sysOrderItem, item, null); + //TODO 补综合卡逻辑 + createProjuseByAssemble(order, sysOrderItem, item, null, null, null, 0); }); //处理综合卡中包含的套餐 @@ -986,37 +1270,47 @@ * 通过组合关系创建用户项目余次 */ private SysProjUse createProjuseByAssemble(SysOrder order, SysOrderItem sysOrderItem, - ShoppingGoodsAssemble goodsAssemble, Long taocanId) { + ShoppingGoodsAssemble goodsAssemble, Long taocanId, Date failTime, String source, Integer maxCount) { //计算折扣 - Double zk=sysOrderItem.getZkPrice()/sysOrderItem.getPrice(); + Double zk = sysOrderItem.getZkPrice() / sysOrderItem.getPrice(); SysProjUse puse = new SysProjUse(); puse.setIsOver(Dictionary.DELETED_N); puse.setOrderItemId(sysOrderItem.getId()); puse.setProjId(goodsAssemble.getAssembleGoodId()); - puse.setSurplusCount(goodsAssemble.getTotal()); + puse.setSurplusCount(goodsAssemble.getTotal() == null ? maxCount : goodsAssemble.getTotal()); puse.setDeductionNum(goodsAssemble.getDeductionNum()); puse.setProjName(goodsAssemble.getShoppingGoods().getName()); puse.setVipId(order.getVipId()); puse.setStatus(Dictionary.TAOCAN_STATUS_YX); puse.setTaocanId(taocanId); puse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); + puse.setSource(source); + if (taocanId == null) { - puse.setPrice(goodsAssemble.getShoppingGoods().getPrice() * zk ); + puse.setPrice(goodsAssemble.getShoppingGoods().getPrice() * zk); } else { - puse.setPrice(goodsAssemble.getPrice() * zk ); + puse.setPrice(goodsAssemble.getPrice() * zk); } + + + //赠送项目是否计算消耗业绩否则 赠送产品按原价计算消耗 + boolean zsConsumeAchieve = projServicesService.skipServiceOrderStep(Dictionary.ZS_CONSUME_ACHIEVE); + if (zsConsumeAchieve) { + if (sysOrderItem.getPrice() <= 0) { + //等于0取原价 + if (taocanId == null) { + puse.setPrice(goodsAssemble.getShoppingGoods().getPrice()); + } else { + puse.setPrice(goodsAssemble.getPrice()); + } + } + } else { + puse.setPrice(0D); + } + puse.setBalance(MoneyUtil.mul(puse.getPrice(), Double.valueOf(puse.getSurplusCount()))); - // 赠送和打折后金额为0的都视为赠送项目 - if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0) { - puse.setSource(Dictionary.TAOCAN_SOURCE_GM); - } else { - puse.setSource(Dictionary.TAOCAN_SOURCE_ZS); - } - // 设置失效时间 - Calendar cal = Calendar.getInstance(); - cal.set(2200, 1, 1); - puse.setFailTime(cal.getTime()); + puse.setFailTime(failTime); sysProjUseDao.insert(puse); return puse; } @@ -1046,39 +1340,44 @@ taocanProjUse.setStatus(Dictionary.TAOCAN_STATUS_YX); taocanProjUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); taocanProjUse.setIsCourse(taocanShoppingGoods.getIsCourse()); + taocanProjUse.setIsInfinite(taocanShoppingGoods.getIsInfinite()); // 赠送和打折后金额为0的都视为赠送项目 - if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0) { + if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0 && !isGiftMoneyPay(order)) { taocanProjUse.setSource(Dictionary.TAOCAN_SOURCE_GM); } else { taocanProjUse.setSource(Dictionary.TAOCAN_SOURCE_ZS); } - // TODO 设置失效时间 - Calendar cal = Calendar.getInstance(); - cal.set(2200, 1, 1); - taocanProjUse.setFailTime(cal.getTime()); + // 失效时间 + Date invalidTime = shoppingGoodsService.calInvalidTime(taocanShoppingGoods, 1, null); + taocanProjUse.setFailTime(invalidTime); sysProjUseDao.insert(taocanProjUse); //计划次数 - int surplusCount=0; + int surplusCount = 0; //总余额 Double sumBanance = 0D; //创建套餐绑定的项目 List<ShoppingGoodsAssemble> assembleList = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(projId, ShoppingGoods.SHOPPING_GOODS_TYPE_XM); for (ShoppingGoodsAssemble assemble : assembleList) { - SysProjUse tempUse = createProjuseByAssemble(order, sysOrderItem, assemble, taocanProjUse.getId()); + SysProjUse tempUse = createProjuseByAssemble(order, sysOrderItem, assemble, taocanProjUse.getId(), taocanProjUse.getFailTime(), taocanProjUse.getSource(), taocanShoppingGoods.getCarUseCount()); sumBanance += tempUse.getBalance(); - surplusCount+=tempUse.getSurplusCount(); + surplusCount += tempUse.getSurplusCount(); } - if(Dictionary.FLAG_NO_N.equals(taocanShoppingGoods.getIsCourse())){ + if (Dictionary.FLAG_NO_N.equals(taocanShoppingGoods.getIsCourse())) { //固定套餐,剩余次数等于绑定项目的次数 taocanProjUse.setSurplusCount(surplusCount); - }else{ + //合计套餐余额 + taocanProjUse.setBalance(sumBanance); + } else { //任选套餐剩余次数等于最大使用次数 taocanProjUse.setSurplusCount(taocanShoppingGoods.getCarUseCount()); + taocanProjUse.setBalance(sysOrderItem.getZkPrice()); } - //合计套餐余额 - taocanProjUse.setBalance(sumBanance); + sysProjUseDao.update(taocanProjUse); } + + @Autowired + private SysProjServicesService projServicesService; /** * 根据订单创建用户项目使用情况 @@ -1095,25 +1394,59 @@ puse.setVipId(order.getVipId()); puse.setStatus(Dictionary.TAOCAN_STATUS_YX); puse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); - puse.setBalance(MoneyUtil.add(sysOrderItem.getCardPay(), sysOrderItem.getCashPay())); - puse.setPrice(sysOrderItem.getZkPrice()); + + puse.setProjName(sysOrderItem.getShoppingGoods().getName()); + + // 赠送和打折后金额为0的都视为赠送项目 - if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0) { + if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0 && !isGiftMoneyPay(order)) { puse.setSource(Dictionary.TAOCAN_SOURCE_GM); + puse.setPrice(sysOrderItem.getZkPrice()); } else { puse.setSource(Dictionary.TAOCAN_SOURCE_ZS); + //赠送项目是否计算消耗业绩否则 赠送产品按原价计算消耗 + boolean zsConsumeAchieve = projServicesService.skipServiceOrderStep(Dictionary.ZS_CONSUME_ACHIEVE); + if (zsConsumeAchieve) { + //赠送情况下,如果收款金额大于0,就是赠送金额划扣的情况,金额即为划扣的折扣金额 + if(sysOrderItem.getZkPrice()>0){ + puse.setPrice(sysOrderItem.getZkPrice()); + }else{ + puse.setPrice(sysOrderItem.getShoppingGoods().getSealPice()); + } + } else { + puse.setPrice(0D); + } } // 设置失效时间 - Calendar cal = Calendar.getInstance(); - cal.set(2300, 1, 1); - puse.setFailTime(cal.getTime()); + Date invalidTime = shoppingGoodsService.calInvalidTime(sysOrderItem.getShoppingGoods(), 1, null); + puse.setFailTime(invalidTime); + puse.setBalance(puse.getPrice() * puse.getSurplusCount()); sysProjUseDao.insert(puse); + } + + /** + * 全是赠送金额,且配置了赠送金额购买计算为赠送 + * + * @param order + * @return + */ + private boolean isGiftMoneyPay(SysOrder order) { + BusParameterSettings giftiIsfree = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_GIFTISFREE, order.getCompanyId()); + if (giftiIsfree.getParamValue().equals("是")) { + return order.getFlows().stream().allMatch(item -> SysOrderFlow.IS_GIFT_Y.equals(item.getIsGift()) + && item.getAmount().doubleValue() > 0D); + } else { + return false; + } + + } /** * 会员卡充值 + * * @param czVo */ @Override @@ -1121,11 +1454,11 @@ public SysOrder updateAddCardMoney(CzXkVo czVo) { SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - SysVipInfo vip = (SysVipInfo) WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER); - czVo.setVipId(vip.getId()); +// SysVipInfo vip = (SysVipInfo) WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER); +// czVo.setVipId(vip.getId()); //更新会员会员卡金额 - MoneyCardUse cardUser = moneyCardUseDao.selectVipCard(vip.getId()); + MoneyCardUse cardUser = moneyCardUseDao.selectVipCard(czVo.getVipId()); cardUser.setRealMoney(MoneyUtil.add(cardUser.getRealMoney(), czVo.getBjmoney())); cardUser.setGiftMoney(MoneyUtil.add(cardUser.getGiftMoney(), czVo.getGiftMoney())); moneyCardUseDao.update(cardUser); @@ -1155,14 +1488,16 @@ order.setRemark(cardUser.getCardName()); order.setStaffId(user.getSuId()); order.setIsCross(2 + ""); + order.setOrderType(SysOrder.ORDER_TYPE_SEAL); order.setStatu(Dictionary.ORDER_STATU_YFK); + order.setCompanyId(user.getCompanyId()); sysOrderDao.insert(order); SysOrderItem orderItem = new SysOrderItem(); orderItem.setOrderId(order.getId()); orderItem.setOrderNo(order.getOrderNo()); orderItem.setArrears(0D); - ShoppingGoods shoppingGoods= shoppingGoodsDao.selectVipCzGoods(); + ShoppingGoods shoppingGoods = shoppingGoodsDao.selectVipCzGoods(); orderItem.setGoodsId(shoppingGoods.getId()); orderItem.setPayMethod(Dictionary.PAY_TYPE_MOENY); orderItem.setCashPay(czVo.getBjmoney()); @@ -1173,12 +1508,16 @@ orderItem.setIsFree(Dictionary.FLAG_NO); orderItem.setPrice(czVo.getBjmoney()); orderItem.setStatus(Dictionary.ORDER_STATU_YFK); - orderItem.setAchaeveList(czVo.getAchaeveList()); + orderItem.setAchieveList(czVo.getAchaeveList()); + orderItem.setShoppingGoods(shoppingGoods); orderItemDao.insert(orderItem); + List<SysOrderItem> items = new ArrayList<>(); + items.add(orderItem); + order.setItems(items); //设置卡项使用流水 - MoneyCardUseFlow moneyCardUseFlow=new MoneyCardUseFlow(); + MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); moneyCardUseFlow.setTotal(czVo.getBjmoney()); moneyCardUseFlow.setGiftMoney(czVo.getGiftMoney()); moneyCardUseFlow.setCarUseId(czVo.getCardId()); @@ -1187,17 +1526,344 @@ moneyCardUseFlow.setOrderNo(order.getOrderNo()); moneyCardUseFlow.setCreateTime(new Date()); moneyCardUseFlow.setOperationId(user.getSuId()); - moneyCardUseFlow.setBalance(cardUser.getGiftMoney()+cardUser.getRealMoney()); + moneyCardUseFlow.setBalance(cardUser.getGiftMoney() + cardUser.getRealMoney()); + moneyCardUseFlow.setCarUseId(cardUser.getId()); moneyCardUseFlowDao.insert(moneyCardUseFlow); + order.setFlows(czVo.getFlows()); + + addOrderFlow(order); // 添加员工业绩 achieveNewService.addAchaeveByOrder(order); + return order; } + @Override + public SysOrder findSysOrderTjByVipId(Long vipId) { + return sysOrderDao.selectVipOrderInfoTotal(vipId); + } + + @Override + public List<OrderDetailVo> findApiOrderListInPage(OrderListDto orderListDto, PaginationVO pageVo) { + return sysOrderDao.selectApiOrderListInPage(orderListDto, pageVo); + } + + @Override + public int findApiOrderListTotal(OrderListDto orderListDto) { + return sysOrderDao.selectApiOrderListTotal(orderListDto); + } + + @Override + public OrderDetailVo findApiOrderDetailByOrderId(Long orderId) { + OrderDetailVo orderDetail = sysOrderDao.selectApiOrderDetailById(orderId); + + if (orderDetail == null) { + throw new GlobleException("该订单不存在"); + } + + List<OrderDetailItemVo> items = orderItemDao.selectApiOrderDetailItemsByOrderId(orderId); + if (CollectionUtils.isNotEmpty(items)) { + for (OrderDetailItemVo item : items) { + List<OrderDetailAchieveItemVo> achieveItems = achieveNewDao.selectApiOrderItemAchieve(item.getId()); + item.setAchieves(achieveItems); + } + } + + orderDetail.setItems(items); + return orderDetail; + } + + @Override + public List<RankingVo> findApiShopAchieveRanking(SysOrder sysOrder) { + return sysOrderDao.selectShopAchieveRanking(sysOrder); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void refundOrderMoney(SysOrder sysOrder) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + //原订单设置为退款状态 + SysOrder sourceOrder = new SysOrder(); + sourceOrder.setId(sysOrder.getOldOrderId()); + sourceOrder.setIsHasRefund(SysOrder.IS_HAS_REFUND_Y); +// sourceOrder.setStatu(Dictionary.ORDER_STATU_TK); + sysOrderDao.update(sourceOrder); + SysOrder oldOrder = sysOrderDao.selectById(sysOrder.getOldOrderId()); + + sysOrder.setId(null); + sysOrder.setStaffId(user.getSuId()); + sysOrder.setCompanyId(user.getCompanyId()); + sysOrder.setShopId(user.getShopId()); + sysOrder.setOrderType(SysOrder.ORDER_TYPE_REFUND); + sysOrder.setStatu(Dictionary.ORDER_STATU_YFK); + Date now = new Date(); + sysOrder.setOrderTime(now); + sysOrder.setPayTime(now); + sysOrder.setOrderNo(codeService.getRefundOrderNo()); + sysOrder.setZkTotal(-sysOrder.getZkTotal()); + //新增订单 + sysOrderDao.insert(sysOrder); + //插入明细 + for (SysOrderItem item : sysOrder.getItems()) { + + //更新原订单明细的可退数量 + SysOrderItem oldItem = new SysOrderItem(); + oldItem.setId(item.getId()); + oldItem.setRefundCount(item.getCount()); + orderItemDao.update(oldItem); + + //插入新的订单明细 + item.setId(null); + item.setCount(-item.getCount()); + item.setOrderId(sysOrder.getId()); + orderItemDao.insert(item); + } + // 添加订单收款流水 + addOrderFlow(sysOrder); + //退款退套餐退项目 + refundProjUse(sysOrder); + //删除积分 + scoreVipDetailService.removeByBusinessId(oldOrder.getVipId(), oldOrder.getId()); + + // 设置业绩 + achieveNewService.addAchaeveByOrder(sysOrder); + + } + + private void addRefundOrderFlow(SysOrder sourceOrder) { + //处理支付流水 + int flowCount = 1; + for (SysOrderFlow flow : sourceOrder.getFlows()) { + //支付内容摘要设置 + Long goodsId = sourceOrder.getItems().get(0).getGoodsId(); + ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); + flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); + // 退款,则取负数 + flow.setFlowType(SysOrderFlow.FLOW_TYPE_REFUND); + flow.setAmount(flow.getAmount().negate()); + flow.setOrderId(sourceOrder.getOldOrderId()); + + //统计储值卡支付 + if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { + if (flow.getCardId() != null) { + MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); + //修改储值卡余额 + cardPaySk(moneyCardUse, sourceOrder, flow); + } else { + throw new GlobleException("无效的储值卡支付方式"); + } + } + + flow.setFlowNo(codeService.getFlowCode() + "-" + flowCount); + flow.setVipId(sourceOrder.getVipId()); + flow.setShopId(sourceOrder.getShopId()); + flow.setCompanyId(sourceOrder.getCompanyId()); + sysOrderFlowDao.insert(flow); + flowCount++; + } + } + + private void refundCard(MoneyCardUse moneyCardUse, SysOrder sourceOrder, SysOrderFlow flow) { + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + + MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); + if (SysOrderFlow.IS_GIFT_Y.equals(flow.getIsGift())) { + if (moneyCardUse.getGiftMoney() >= flow.getAmount().doubleValue()) { + double surplus = MoneyUtil.sub(moneyCardUse.getGiftMoney(), flow.getAmount().doubleValue()); + moneyCardUse.setGiftMoney(surplus); + moneyCardUseFlow.setGiftMoney(0D - flow.getAmount().doubleValue()); + } else { + throw new GlobleException(moneyCardUse.getCardName() + "余额不足"); + } + } else { + if (moneyCardUse.getRealMoney() >= flow.getAmount().doubleValue()) { + double surplus = MoneyUtil.sub(moneyCardUse.getRealMoney(), flow.getAmount().doubleValue()); + moneyCardUse.setRealMoney(surplus); + moneyCardUseFlow.setTotal(0 - flow.getAmount().doubleValue()); + } else { + throw new GlobleException(moneyCardUse.getCardName() + "余额不足"); + } + } + + if (moneyCardUse.getIsVipCar().equals(Dictionary.FLAG_NO_N)) { + //余额为0时充值卡变为无效 + if (moneyCardUse.getRealMoney().equals(0D) && moneyCardUse.getGiftMoney().equals(0D)) { + moneyCardUse.setIsOver(Dictionary.FLAG_YES_Y); + moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_WX); + } + } + + ShoppingGoods shoppingGoods = shoppingGoodsService.findById(moneyCardUse.getGoodsId()); + if (shoppingGoods != null) { + Date invalidTime = shoppingGoodsService.calInvalidTime(shoppingGoods, 2, moneyCardUse.getFailTime()); + moneyCardUse.setFailTime(invalidTime); + } + // 更新充值卡信息 + moneyCardUseDao.update(moneyCardUse); + //设置卡项使用流水 + moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); + moneyCardUseFlow.setOrderNo(sourceOrder.getOrderNo()); + moneyCardUseFlow.setVipId(sourceOrder.getVipId()); + moneyCardUseFlow.setTimes(-1); + moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CONSUMER); + moneyCardUseFlow.setCreateTime(new Date()); + moneyCardUseFlow.setOperationId(user.getSuId()); + moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney()); + moneyCardUseFlowDao.insert(moneyCardUseFlow); + } + + /** + * 退款退项目,套餐,卡项 + * + * @param sysOrder + */ + private void refundProjUse(SysOrder sysOrder) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + //记录需要退库存的产品 + List<SysOrderItem> returnGoodsList = new ArrayList<>(); + + for (SysOrderItem item : sysOrder.getItems()) { + + SysProjUse queryProjUse = new SysProjUse(); + queryProjUse.setOrderItemId(item.getOldItemId()); + // 修改项目信息 + if (Dictionary.SHOPPING_GOODS_TYPE_XM.equals(item.getType()) || Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(item.getType())) { + + if (Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(item.getType())) { + if (Dictionary.FLAG_YES_Y.equals(item.getIsReturnStore())) { + returnGoodsList.add(item); + } + } else { + SysProjUse sysProjUse = sysProjUseDao.selectByModel(queryProjUse).get(0); + + int sub = sysProjUse.getSurplusCount() - item.getCount(); + if (sub < 0) { + throw new GlobleException("项目余次不足"); + } else if (sub == 0) { + sysProjUse.setIsOver(Dictionary.FLAG_YES_Y); + sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_WX); + } + sysProjUse.setSurplusCount(sub); + sysProjUseDao.update(sysProjUse); + SysProjUseFlow sysProjUseFlow = SysProjUseMapper.INSTANCE.projUseToFlow(sysProjUse); + sysProjUseFlow.setOptionType("退款修改"); + sysProjUseFlow.setId(null); + sysProjUseFlow.setUpdateBy(user.getSuName()); + sysProjUseFlow.setCreateBy(user.getSuName()); + sysProjUseDao.insertFlow(sysProjUseFlow); + } + } + + if (Dictionary.SHOPPING_GOODS_TYPE_TC.equals(item.getType())) { + queryProjUse.setTaocanId(-1L); + List<SysProjUse> sysProjUses = sysProjUseDao.selectByModel(queryProjUse); + + + for (int i = 0; i < sysProjUses.size(); i++) { + + SysProjUse sysProjUse = sysProjUses.get(i); + sysProjUse.setIsOver(Dictionary.FLAG_YES_Y); + sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_WX); + sysProjUseDao.update(sysProjUse); + SysProjUseFlow sysProjUseFlow = SysProjUseMapper.INSTANCE.projUseToFlow(sysProjUse); + sysProjUseFlow.setOptionType("退款修改"); + sysProjUseFlow.setId(null); + sysProjUseFlow.setUpdateBy(user.getSuName()); + sysProjUseFlow.setCreateBy(user.getSuName()); + sysProjUseDao.insertFlow(sysProjUseFlow); + } + } + + if (Dictionary.SHOPPING_GOODS_TYPE_CZK.equals(item.getType())) { + MoneyCardUse queryCardUse = new MoneyCardUse(); + queryCardUse.setStatus(Dictionary.TAOCAN_STATUS_YX); + queryCardUse.setOrderItemId(item.getOldItemId()); + + List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectByModel(queryCardUse); + for (int i = 0; i < item.getCount(); i++) { + MoneyCardUse moneyCardUse = moneyCardUses.get(i); + moneyCardUse.setIsOver(Dictionary.FLAG_YES_Y); + moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_WX); + moneyCardUseDao.update(moneyCardUse); + } + } + + // TODO 综合卡退款 + if (Dictionary.SHOPPING_GOODS_TYPE_ZHK.equals(item.getType())) { + + } + + + ShoppingGoods goods = shoppingGoodsDao.selectById(item.getGoodsId()); + goods.setRealSealCount(goods.getRealSealCount() - item.getCount()); + shoppingGoodsDao.update(goods); + } + + BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, sysOrder.getCompanyId()); + if (AppConstance.IS_Y.equals(manageStockSetting.getParamValue())) { + // 家居产品退库存 + if (CollectionUtils.isNotEmpty(returnGoodsList)) { + refundInstore(returnGoodsList); + } + } + + } + + /** + * 退款入库 + */ + private void refundInstore(@NotEmpty List<SysOrderItem> items) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysSupplierInfo supplierInfo = new SysSupplierInfo(); + supplierInfo.setShopId(user.getShopId()); + supplierInfo = sysSupplierInfoDao.selectByModel(supplierInfo).get(0); + + Warehouse warehouse = warehouseDao.findShopWarehouse(user.getShopId()).get(0); + SysInstoreInfo instoreInfo = new SysInstoreInfo(); + instoreInfo.setInstoreType(SysInstoreInfo.INSTORE_TYPE_RETURN); + instoreInfo.setInstoreDate(new Date()); + instoreInfo.setSupplierId(supplierInfo.getId().toString()); + instoreInfo.setStoreId(warehouse.getId()); + instoreInfo.setCheckStatus(Dictionary.CHECK_STATUS_DSH); + // 设置入库单编号 + instoreInfo.setInstoreId(DateUtil.getTimeMark()); + instoreInfo.setShopId(user.getShopId()); + instoreInfo.setCompanyId(user.getCompanyId()); + sysInstoreInfoDao.insert(instoreInfo); + + Double total = 0.0; + List<SysInstoreDetail> instoreDetails = new ArrayList<>(); + for (SysOrderItem item : items) { + ShoppingGoods goods = shoppingGoodsDao.selectById(item.getGoodsId()); + SysInstoreDetail sysInstoreDetail = new SysInstoreDetail(); + sysInstoreDetail.setAmount(item.getCount().doubleValue()); + sysInstoreDetail.setPrice(item.getZkPrice()); + sysInstoreDetail.setSkuId(goods.getId()); + + total = MoneyUtil.add(MoneyUtil.mul(Double.parseDouble(sysInstoreDetail.getAmount() + ""), sysInstoreDetail.getPrice()), total); + sysInstoreDetail.setInstoreId(instoreInfo.getId()); + // 设置小计 + sysInstoreDetail.setPriceTotal(MoneyUtil.mul(Double.parseDouble(sysInstoreDetail.getAmount() + ""), sysInstoreDetail.getPrice())); + instoreDetails.add(sysInstoreDetail); + + } + instoreInfo.setSumall(total); + sysInstoreInfoDao.update(instoreInfo); + sysInstoreDetailDao.batchInsert(instoreDetails); + + sysInstoreInfoService.check(instoreInfo); + } + + @Override + public BigDecimal findVipArrearsByVipId(Long vipId) { + return sysOrderDao.selectArrearsByVipId(vipId); + } } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java index ada929f..51fea08 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java @@ -1,21 +1,34 @@ package com.matrix.system.hive.service.imp; +import cn.hutool.core.collection.CollUtil; +import com.google.common.collect.Lists; +import com.matrix.component.asyncmessage.AsyncMessageManager; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.pojo.VerifyResult; import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.ServiceOrderListDto; +import com.matrix.system.app.vo.ServiceOrderListVo; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.common.dao.SysUsersDao; +import com.matrix.system.common.service.BusParameterSettingService; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.*; -import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.plugin.util.MoneyUtil; -import com.matrix.system.hive.pojo.MyBeauticianCount; import com.matrix.system.hive.service.*; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import com.matrix.system.wechart.templateMsg.UniformMsgParam; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -23,9 +36,8 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.math.BigDecimal; +import java.util.*; import java.util.stream.Collectors; /** @@ -57,7 +69,8 @@ private SysOutStoreItemDao sysOutStoreItemDao; @Autowired private SysBedInfoDao sysBedInfoDao; - + @Autowired + TaiYanAliyunSmsService taiYanAliyunSmsService; @Autowired private SysStoreInfoDao storeInfoDao; @@ -97,6 +110,28 @@ private SysOrderService sysOrderService; @Autowired WarehouseDao warehouseDao; + @Resource + private ShoppingGoodsService shoppingGoodsService; + + @Autowired + private AsyncMessageManager asyncMessageManager; + + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + BusParameterSettingService busParameterSettingService; + + @Autowired + ScoreVipDetailService scoreVipDetailService; + + @Autowired + SysVipInfoDao sysVipInfoDao; + + + @Autowired + ShoppingGoodsAssembleDao goodsAssembleDao; /** * 新增服务单 jyy @@ -108,17 +143,21 @@ public SysProjServices addSysProjServices(SysProjServices sysProjServices) throws GlobleException { //创建服务单 - SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - sysProjServices.setCreateStaffId(user.getSuId()); - sysProjServices.setShopId(user.getShopId()); - sysProjServices.setCompanyId(user.getCompanyId()); - sysProjServices.setCreateTime(new Date()); - // 设置状态为待预约 - sysProjServices.setState(Dictionary.SERVICE_STATU_DYY); - sysProjServices.setServiceNo(codeService.getServiceOrderCode()); - Double hkPrice = 0.0; - int i = sysProjServicesDao.insert(sysProjServices); + if (WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY) != null) { + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + sysProjServices.setCreateStaffId(user.getSuId()); + sysProjServices.setShopId(user.getShopId()); + sysProjServices.setCompanyId(user.getCompanyId()); + } + + if (sysProjServices.getId() == null) { + sysProjServices.setCreateTime(new Date()); + sysProjServices.setServiceNo(codeService.getServiceOrderCode()); + int i = sysProjServicesDao.insert(sysProjServices); + } + + Double hkPrice = 0.0; // 计算项目总时长 int totalTime = 0; //处理订单明细 @@ -144,6 +183,14 @@ //本次消费金额 Double bcxfje = MoneyUtil.mul(sysProjUse.getPrice(), Double.valueOf(sysBeauticianState.getCount())); upProjUse.setBalance(MoneyUtil.sub(sysProjUse.getBalance(), bcxfje)); + + // 判断是否第一次使用该项目, 若是则根据商品消耗有效期更新到期时间 + List<SysBeauticianState> sysBeauticianStates = beauticianStateDao.selectBeauticianStateByPuseIdAndNoStatus(sysBeauticianState.getPuseId(), Dictionary.SERVICE_STATU_YYQX); + if (CollectionUtils.isEmpty(sysBeauticianStates)) { + Date useInvalidTime = shoppingGoodsService.calInvalidTime(sysProjInfo, 2, sysProjUse.getFailTime()); + upProjUse.setFailTime(useInvalidTime); + } + //更新余次信息 sysProjUseDao.updateSurplusCount(upProjUse); //如果项目是套餐 中项目则判断套餐是否失效 @@ -158,15 +205,33 @@ taocan.setIsOver(Dictionary.FLAG_YES_Y); taocan.setSurplusCount(0); taocan.setStatus(Dictionary.TAOCAN_STATUS_WX); - } else if (Dictionary.FLAG_YES_Y.equals(taocan.getIsCourse())) { + } else if ( + Dictionary.FLAG_NO_N.equals(taocan.getIsCourse()) + || (Dictionary.FLAG_YES_Y.equals(taocan.getIsCourse()) + && (StringUtils.isBlank(taocan.getIsInfinite()) || Dictionary.FLAG_NO_N.equals(taocan.getIsInfinite())))) { + //任选套餐检查套餐整体剩余次数 - int tcSurplusCount = taocan.getSurplusCount() - sysProjUse.getDeductionNum(); + int tcSurplusCount = taocan.getSurplusCount() - sysBeauticianState.getCount(); if (tcSurplusCount < 0) { throw new GlobleException(taocan.getProjName() + "已经达到最大使用次数"); } else { taocan.setSurplusCount(tcSurplusCount); } + + if (tcSurplusCount == 0) { + taocan.setIsOver(Dictionary.FLAG_YES_Y); + taocan.setStatus(Dictionary.TAOCAN_STATUS_WX); + } } + + // 根据套餐内所有项目查询该套餐是否第一次使用,若第一次使用则更新该套餐有效期 + List<SysBeauticianState> taocanHas = beauticianStateDao.selectByProjUse(taocanProjUses, Dictionary.SERVICE_STATU_YYQX); + if (CollectionUtils.isEmpty(taocanHas)) { + ShoppingGoods taocanInfo = shoppingGoodsDao.selectById(taocan.getProjId()); + Date useInvalidTime = shoppingGoodsService.calInvalidTime(taocanInfo, 2, sysProjUse.getFailTime()); + taocan.setFailTime(useInvalidTime); + } + taocan.setBalance(MoneyUtil.sub(taocan.getBalance(), bcxfje)); sysProjUseDao.updateSurplusCount(taocan); } @@ -176,13 +241,13 @@ //插入订单明细 sysBeauticianState.setProjId(sysProjInfo.getId()); sysBeauticianState.setServicesId(sysProjServices.getId()); - sysBeauticianState.setShopId(user.getShopId()); - sysBeauticianState.setState(Dictionary.BEATUI_STATE_DYY); + sysBeauticianState.setShopId(sysProjServices.getShopId()); + sysBeauticianState.setState(sysProjServices.getState()); beauticianStateDao.insert(sysBeauticianState); } // 设置项目总时长 sysProjServices.setTotalTime(totalTime); - sysProjServices.setMoney(hkPrice); + sysProjServices.setMoney(new BigDecimal(hkPrice).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue()); sysProjServicesDao.update(sysProjServices); return sysProjServices; } @@ -200,6 +265,12 @@ for (SysBeauticianState sysBeauticianState : sysProjServices.getServiceItems()) { SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getPuseId()); + + //检查是否已经处于无效状态 + if (Dictionary.TAOCAN_STATUS_WX.equals(sysProjUse.getStatus())) { + return new VerifyResult(true, sysProjUse.getProjName() + "项目已经失效"); + } + int kjcs = 1; if (sysProjUse.getTaocanId() != null) { kjcs = sysBeauticianState.getCount() * sysProjUse.getDeductionNum(); @@ -263,15 +334,13 @@ */ @Override public VerifyResult checkArrears(SysProjServices sysProjServices) { - //检测欠款 - /* for (SysBeauticianState sysBeauticianState : sysProjServices.getServiceItems()) { - + // 检测欠款 + /*for (SysBeauticianState sysBeauticianState : sysProjServices.getServiceItems()) { SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getPuseId()); - - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(sysProjUse.getProjId()); - SysOrderItem orderItem = sysOrderItemService.findById(sysProjUse.getOrderItemId()); + SysOrderItem item = sysOrderItemService.findById(sysProjUse.getOrderItemId()); + SysOrder orderItem = sysOrderService.findById(item.getOrderId()); if ("购买".equals(sysProjUse.getSource())) { // 如果用户有欠款,服务单总价不能超过已付金额 if (orderItem!=null && orderItem.getArrears() > 0) { @@ -287,13 +356,13 @@ double money = MoneyUtil.sub((bj - orderItem.getArrears()), (yxfje + bcxfje)); // 如果 已付金额 - (已消费金额+本次消费金额)<0 则不能再消费 if (money < 0) { - return new VerifyResult(true, shoppingGoods.getName() + "存在欠款" + orderItem.getArrears() + "元 , 订单编号[ " + sysOrderService.findById(orderItem.getOrderId()).getOrderNo() + " ] "); + return new VerifyResult(true, shoppingGoods.getName() + "存在欠款" + orderItem.getArrears() + "元 , 订单编号[ " + orderItem.getOrderNo() + " ] "); } } } else if ("赠送".equals(sysProjUse.getSource())) { - if (orderItem!=null &&orderItem.getArrears() > 0) { + if (orderItem!=null && orderItem.getArrears()!=null&&orderItem.getArrears() > 0) { return new VerifyResult(true, shoppingGoods.getName() + "存在欠款" + orderItem.getArrears() + "元 , 不能消费赠送项目,订单编号[ " + sysOrderService.findById(orderItem.getOrderId()).getOrderNo() + " ] "); } } @@ -308,8 +377,8 @@ /** 验证数据是否正确 */ SysProjServices checkProjServices = sysProjServicesDao.selectById(projServices.getId()); // 验证服务单是否存在或者取消 - if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY) - && !checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYCG)) { + if (checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYQX) + || checkProjServices.getState().equals(Dictionary.SERVICE_STATU_FFJS)) { throw new GlobleException("该服务单已被取消或者不存在!"); } // 验证是否选择床位 @@ -336,7 +405,7 @@ } // 判断是否是编辑,还是新增,编辑则需要先释放资源 - if (checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYCG)) { + if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY)) { // 释放床位资源 bedStateDao.deleteByServiceId(checkProjServices.getId()); } @@ -354,6 +423,7 @@ if (beauticianStateDao.checkBeauticianClash(beauticianState) > 0) { throw new GlobleException("该美疗师已被占用,请重新分配!"); } +// beauticianState.setExcTime(beauticianState.getProjInfo().getTimeLength()); beauticianState.setState(Dictionary.BEATUI_STATE_YYY); beauticianStateDao.update(beauticianState); @@ -363,8 +433,10 @@ } - // 设置成功状态 - projServices.setState(Dictionary.SERVICE_STATU_YYCG); + if (Dictionary.SERVICE_STATU_DYY.equals(projServices.getState())) { + // 设置成功状态 + projServices.setState(Dictionary.SERVICE_STATU_XPL); + } // 判断当前门店是否有历史美疗师 LastestWorkBeatuistaff lastWorkStaff = new LastestWorkBeatuistaff(); lastWorkStaff.setShopId(checkProjServices.getShopId()); @@ -385,7 +457,54 @@ lastList.add(lastWork); } LastestWorkBeatuistaffDao.batchInsert(lastList); - return sysProjServicesDao.update(projServices); + int i = sysProjServicesDao.update(projServices); + + //根据配置是否完成自动配料 + if (busParameterSettingService.isSettingOpen(AppConstance.OPEN_SERVICE_ORDER_AUTO_BATCHING, checkProjServices.getCompanyId())){ + autoBatching(projServices); + } + + + return i; + } + + + /** + * 根据配置是否完成自动配料 + * + * @param projServices + */ + private void autoBatching(SysProjServices projServices) { + + //获取最新的服务单信息 + projServices=findById(projServices.getId()); + List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); + + + List<SysOutStoreItem> outStoreItemList = Lists.newLinkedList(); + beauticianStateList.stream().forEach(item -> { + + List<ShoppingGoodsAssemble> shoppingGoodsAssembles = goodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(item.getProjId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP); + + if (CollUtil.isNotEmpty(shoppingGoodsAssembles)) { + outStoreItemList.addAll(shoppingGoodsAssembles.stream().map(assemble -> { + SysOutStoreItem outStoreItem = new SysOutStoreItem(); + outStoreItem.setSkuId(assemble.getAssembleGoodId()); + outStoreItem.setAmount(Double.parseDouble(assemble.getTotal()+"")); + outStoreItem.setRemark("自动配料"); + return outStoreItem; + }).collect(Collectors.toList())); + } + }); + //组合配料参数 + projServices.setOutStoreItem(outStoreItemList); + //调用配料出库方法 + try { + modifyPLProjServices(projServices); + }catch (GlobleException e){ + LogUtil.debug("配料失败:{}",e.getMessage()); + } + } @@ -446,6 +565,9 @@ sysOutStoreDao.deleteById(sysOutStore.getId()); sysOutStoreItemDao.deleteByOrderId(sysOutStore.getId()); } + //删除积分 + scoreVipDetailService.removeByBusinessId(checkProjServices.getVipId(), checkProjServices.getId()); + //更新服务单状态 return sysProjServicesDao.update(checkProjServices); } @@ -457,8 +579,22 @@ */ private void backProjCount(SysProjServices projServices) { List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); + + backProjCountItems(beauticianStateList, 1); + } + + private void backProjCountItems(List<SysBeauticianState> beauticianStateList, int type) { + Map<Long, List<SysProjUse>> taocanMap = new HashMap<>(); // 回退项目余额 for (SysBeauticianState beauticianState : beauticianStateList) { + if (type == 1) { + // 该修改为 有效日期判断更新所有 + beauticianState.setState(Dictionary.BEATUI_STATE_YYQX); + beauticianStateDao.update(beauticianState); + } else { + beauticianStateDao.deleteById(beauticianState.getId()); + } + SysProjUse sysProjUse = sysProjUseDao.selectById(beauticianState.getPuseId()); if (sysProjUse != null && sysProjUse.getId() != null) { sysProjUse = sysProjUseDao.selectById(sysProjUse.getId()); @@ -469,16 +605,75 @@ if (sysProjUse.getSurplusCount() == 0) { upProjUse.setIsOver(Dictionary.DELETED_N); upProjUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); - if (sysProjUse.getTaocanId() != null) { - //TODO 更新套餐状态为有效 - } } int surplus = sysProjUse.getSurplusCount() + beauticianState.getCount(); upProjUse.setSurplusCount(surplus); - upProjUse.setBalance(MoneyUtil.add(sysProjUse.getBalance(), sysProjUse.getPrice())); + + BigDecimal backBlance = new BigDecimal(sysProjUse.getPrice() * beauticianState.getCount()); + + upProjUse.setBalance(MoneyUtil.add(sysProjUse.getBalance(), backBlance.doubleValue())); + + + if (sysProjUse.getTaocanId() != null) { + SysProjUse taocanProjUse = sysProjUseDao.selectById(sysProjUse.getTaocanId()); + taocanProjUse.setIsOver(Dictionary.DELETED_N); + taocanProjUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); + taocanProjUse.setBalance(MoneyUtil.add(taocanProjUse.getBalance(), backBlance.doubleValue())); + if (Dictionary.FLAG_YES_Y.equals(taocanProjUse.getIsCourse())) { + if (StringUtils.isBlank(taocanProjUse.getIsInfinite()) || Dictionary.FLAG_NO_N.equals(taocanProjUse.getIsInfinite())) { + taocanProjUse.setSurplusCount(taocanProjUse.getSurplusCount() + beauticianState.getCount()); + } + } + sysProjUseDao.update(taocanProjUse); + } + + + // 取消时,判断该项目之前是否有使用过,若使用过则非第一次使用,则不更新有效日期,若未使用表明此次为第一次使用,则更新有效日期为购买日期或统一失效日期 + List<SysBeauticianState> hasBeautician = beauticianStateDao.selectBeauticianStateByPuseIdAndNoStatus(beauticianState.getPuseId(), Dictionary.BEATUI_STATE_YYQX); + if (hasBeautician.isEmpty()) { + ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(beauticianState.getProjId()); + Date useInvalidTime = shoppingGoodsService.calInvalidTime(shoppingGoods, 1, null); + upProjUse.setFailTime(useInvalidTime); + } + + if (sysProjUse.getTaocanId() != null) { + List<SysProjUse> sysProjUses = taocanMap.get(sysProjUse.getTaocanId()); + if (CollectionUtils.isEmpty(sysProjUses)) { + List<SysProjUse> taocanItems = new ArrayList<>(); + taocanItems.add(sysProjUse); + taocanMap.put(sysProjUse.getTaocanId(), taocanItems); + } else { + sysProjUses.add(sysProjUse); + taocanMap.put(sysProjUse.getTaocanId(), sysProjUses); + } + } sysProjUseDao.updateSurplusCount(upProjUse); } } + + if (taocanMap.size() != 0) { + for (Map.Entry<Long, List<SysProjUse>> entry : taocanMap.entrySet()) { + List<SysBeauticianState> taocanUse = beauticianStateDao.selectByProjUse(entry.getValue(), Dictionary.BEATUI_STATE_YYQX); + if (CollectionUtils.isEmpty(taocanUse)) { + SysProjUse taocan = sysProjUseDao.selectById(entry.getKey()); + ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(taocan.getProjId()); + Date buyInvalidDate = shoppingGoodsService.calInvalidTime(shoppingGoods, 1, null); + taocan.setFailTime(buyInvalidDate); + + sysProjUseDao.update(taocan); + } + } + } + } + + @Override + public int deleteProjServiceItemById(Long id) { + SysBeauticianState sysBeauticianState = beauticianStateDao.selectById(id); + List<SysBeauticianState> list = new ArrayList<>(); + list.add(sysBeauticianState); + + backProjCountItems(list, 2); + return 1; } // 划扣 jyy @@ -489,13 +684,152 @@ if (!projServices.getState().equals(Dictionary.SERVICE_STATU_FWWC)) { throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); } else { + SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if (skipServiceOrderStep(Dictionary.SERVICE_OVER_BEGIN_END)) { + SysBeauticianState checkBeauticianState = new SysBeauticianState(); + checkBeauticianState.setServicesId(projServices.getId()); + checkBeauticianState.setState(Dictionary.BEATUI_STATE_FWJS); + beauticianStateDao.chengItemState(checkBeauticianState); + + // 释放床位资源 + SysBedState checkBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId()); + if (checkBedState != null) { + checkBedState.setBedState(Dictionary.BED_STATE_SYJS); + bedStateDao.update(checkBedState); + } + projServices.setEndTime(new Date()); + // 计算时差 + long minspace = DateUtil.getDifTimeMin(projServices.getStartTime(), projServices.getEndTime()) - projServices.getTotalTime(); + // 判断是服务超时还是服务提前结束,如果minspace大于0则是超时服务,小于0则是提前结束服务 + projServices.setIsOverTime(minspace + ""); + projServices.setState(Dictionary.SERVICE_STATU_FWWC); + sysProjServicesDao.update(projServices); + } projServices.setState(Dictionary.SERVICE_STATU_FFJS); projServices.setConsumeTime(new Date()); - return sysProjServicesDao.update(projServices); + int result = sysProjServicesDao.update(projServices); + achieveNewService.addAchieveByServiceOrder(projServices); + + //设置会员积分 + addVipScore(projServices); + + //发送微信公众号提醒 + UniformMsgParam uniformMsgParam = new UniformMsgParam(projServices.getCompanyId(), UniformMsgParam.GZH_FWWC); + uniformMsgParam.put("serviceId", projServices.getId()); + asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG, uniformMsgParam); + //发送划扣短信提醒 + taiYanAliyunSmsService.sendHkNotice(projServices); + + return result; } + + } + /** + * 设置会员消费积分 + */ + private void addVipScore(SysProjServices projServices) { + + SysVipInfo vipInfo = sysVipInfoDao.selectById(projServices.getVipId()); + + List<SysBeauticianState> sysBeauticianStates = beauticianStateDao.selectBySerIds(projServices.getId()); + + + double principalPrice = 0D; + double giftPrice = 0D; + for (SysBeauticianState sysBeauticianState : sysBeauticianStates) { + SysProjUse projUse = sysBeauticianState.getProjUse(); + if (projUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZS)) { + giftPrice += projUse.getPrice(); + } else { + principalPrice += projUse.getPrice(); + } + } + + int[] principalConsumScore = {0, 0, 0}; + BusParameterSettings principalConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, vipInfo.getCompanyId()); + //本金消耗 + if (principalPrice > 0 + && StringUtils.isNotBlank(principalConsumption.getParamValue())) { + + principalConsumScore[0] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue())); + + if (StringUtils.isNotBlank(principalConsumption.getParamValue1())) { + principalConsumScore[1] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue1())); + } + + if (StringUtils.isNotBlank(principalConsumption.getParamValue2())) { + principalConsumScore[2] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue2())); + } + } + + int[] giveConsumScore = {0, 0, 0}; + BusParameterSettings giveConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.GIVE_CONSUMPTION, vipInfo.getCompanyId()); + //本金消耗 + if (giftPrice > 0 + && StringUtils.isNotBlank(giveConsumption.getParamValue())) { + + giveConsumScore[0] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue())); + + if (StringUtils.isNotBlank(giveConsumption.getParamValue1())) { + giveConsumScore[1] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue1())); + } + + if (StringUtils.isNotBlank(giveConsumption.getParamValue2())) { + giveConsumScore[2] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue2())); + } + } + + int selfScore = principalConsumScore[0] + giveConsumScore[0]; + int parentScore = principalConsumScore[1] + giveConsumScore[1]; + int topParentScore = principalConsumScore[2] + giveConsumScore[2]; + + //添加自己的积分 + if (selfScore > 0) { + scoreVipDetailService.addScore( + vipInfo.getId(), + projServices.getCreateStaffId(), + projServices.getShopId(), + selfScore, + projServices.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "消耗奖励" + ); + } + + if (vipInfo.getRecommendId() != null) { + //推荐注册老带新积分奖励 + SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); + if (parentScore > 0) { + scoreVipDetailService.addScore( + referrerVip.getId(), + projServices.getCreateStaffId(), + projServices.getShopId(), + parentScore, + projServices.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "推荐消耗奖励" + ); + } + //推荐注册二级带新积分奖励 + if (referrerVip.getRecommendId() != null) { + SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); + if (topParentScore > 0) { + scoreVipDetailService.addScore( + topVipInfo.getId(), + projServices.getCreateStaffId(), + projServices.getShopId(), + topParentScore, + projServices.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "推荐消耗奖励" + ); + } + } + } + } // 派单 jyy @@ -528,10 +862,11 @@ @Override public int modifyPLProjServices(SysProjServices projServicesVo) throws GlobleException { SysProjServices projServices = sysProjServicesDao.selectById(projServicesVo.getId()); - + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); if (!projServices.getState().equals(Dictionary.SERVICE_STATU_XPL)) { throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); } + projServicesVo.setCompanyId(projServices.getCompanyId()); if (isNeedOutStore(projServicesVo)) { // 生成出库单 @@ -540,10 +875,10 @@ outStore.setOutStoreNo(codeService.getOutStoreCode()); outStore.setShopId(projServices.getShopId()); - if(projServices.getDevisionId()!=null){ + if (projServices.getDevisionId() != null) { outStore.setStaffId(projServices.getDevisionId()); - }else{ - SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + } else { + outStore.setStaffId(sysUsers.getSuId()); } outStore.setServiceId(projServices.getId()); @@ -567,7 +902,7 @@ double sum = stores.stream().mapToDouble(item2 -> item2.getStoreTotal()).sum(); Double needAmount = MoneyUtil.div(item.getAmount(), Double.valueOf(shoppingGoods.getVolume())); if (sum < needAmount) { - throw new GlobleException("出库失败:【" + shoppingGoods.getName() + "库存不足】"); + throw new GlobleException("出库失败:【" + shoppingGoods.getName() + "-" + shoppingGoods.getCode() + "库存不足】"); } //循环获取所有批次产品,并扣减库存 for (SysStoreInfo storeInfo : stores) { @@ -583,8 +918,6 @@ sysOutStoreItem.setStoreId(storeInfo.getId()); sysOutStoreItem.setAmount(oldStoreTotal - storeInfo.getStoreTotal()); realOutStoreItemList.add(sysOutStoreItem); - - storeInfoDao.update(storeInfo); //扣除后剩余库存大于0则跳出扣除,否则剩余数量的负数的绝对值就是再次扣减的数量 if (surplus > 0) { @@ -598,43 +931,55 @@ LogUtil.debug("未选择配料跳过sku={},amount={}", item.getSkuId(), item.getAmount()); } } - sysOutStoreItemDao.batchInsert(realOutStoreItemList); + } + // 设置服务单状态 +// projServices.setState(Dictionary.SERVICE_STATU_PLWC); + if (projServices.getDevisionId() == null) { + //如果没有设置配料师则默认为操作配料的人为配料师 + projServices.setDevisionId(sysUsers.getSuId()); } - // 设置服务单状态 - projServices.setState(Dictionary.SERVICE_STATU_PLWC); - // 设置服务单操作流水 - // TODO 本功能待完善记录最新的排班员工 - /* List<LastestWorkBeatuistaff> lastList = LastestWorkBeatuistaffDao.selectByModel(null); - LastestWorkBeatuistaff lastWork = new LastestWorkBeatuistaff(); - if (lastList.size() > 0) { - lastWork.setChangeDate(new Date()); - lastWork.setStaffId(projServices.getBeauticianId()); - LastestWorkBeatuistaffDao.insert(lastWork); - } else { - - //TODO 有bug集合为零了 - LastestWorkBeatuistaff modifyObj = lastList.get(0); - modifyObj.setChangeDate(new Date()); - modifyObj.setStaffId(projServices.getBeauticianId()); - LastestWorkBeatuistaffDao.update(modifyObj); - }*/ - + // 判断是否跳过开始/结束服务 + if (skipServiceOrderStep(Dictionary.SERVICE_OVER_BEGIN_END)) { + projServices.setStartTime(new Date()); + projServices.setState(Dictionary.SERVICE_STATU_FWWC); + } else { + projServices.setState(Dictionary.SERVICE_STATU_PLWC); + } + // 释放床位资源 +// SysBedState checkBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getBedId(), projServices.getId()); +// if (checkBedState != null) { +// checkBedState.setBedState(Dictionary.BED_STATE_SYJS); +// bedStateDao.update(checkBedState); +// } +// projServices.setStartTime(new Date()); +// projServices.setEndTime(new Date()); +// // 计算时差 +// long minspace = DateUtil.getDifTimeMin(projServices.getStartTime(), projServices.getEndTime()) +// - projServices.getTotalTime(); +// // 判断是服务超时还是服务提前结束,如果minspace大于0则是超时服务,小于0则是提前结束服务 +// projServices.setIsOverTime(minspace + ""); +// projServices.setState(Dictionary.SERVICE_STATU_FWWC); return sysProjServicesDao.update(projServices); } /** * 服务单收费需要生成出库记录 + * * @param projServicesVo * @return */ private boolean isNeedOutStore(SysProjServices projServicesVo) { - if(CollectionUtils.isNotEmpty(projServicesVo.getOutStoreItem())){ - for (SysOutStoreItem item : projServicesVo.getOutStoreItem()) { - if (item.getAmount() != null && item.getAmount() > 0) { - return true; + + if (CollectionUtils.isNotEmpty(projServicesVo.getOutStoreItem())) { + BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, projServicesVo.getCompanyId()); + if (AppConstance.IS_Y.equals(manageStockSetting.getParamValue())) { + for (SysOutStoreItem item : projServicesVo.getOutStoreItem()) { + if (item.getAmount() != null && item.getAmount() > 0) { + return true; + } } } } @@ -688,7 +1033,6 @@ SysBeauticianState checkBeauticianState = new SysBeauticianState(); checkBeauticianState.setServicesId(projServices.getId()); checkBeauticianState.setState(Dictionary.BEATUI_STATE_FWJS); - checkBeauticianState.setStaffId(users.getSuId()); int rerunlt = beauticianStateDao.chengItemState(checkBeauticianState); // 验证是否是最后一个美疗师结束服务 @@ -718,7 +1062,6 @@ } return rerunlt; - } @Override @@ -733,4 +1076,60 @@ } + @Override + public List<ServiceOrderListVo> findApiServiceOrderListInPage(ServiceOrderListDto serviceOrderListDto, PaginationVO pageVo) { + return sysProjServicesDao.selectApiServiceOrderListInPage(serviceOrderListDto, pageVo); + } + + @Override + public int findApiServiceOrderListTotal(ServiceOrderListDto serviceOrderListDto) { + return sysProjServicesDao.selectApiServiceOrderListTotal(serviceOrderListDto); + } + + /** + * 跳过服务单某步骤 + */ + @Override + public boolean skipServiceOrderStep(String step) { + SysUsers users = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + ParameterSettings ps = new ParameterSettings(); + ps.setCompanyId(users.getCompanyId()); + ps.setCategory("店务配置"); + List<ParameterSettings> settings = parameterSettingsDao.getByCategory(ps); + + boolean flag = false; + if (CollUtil.isNotEmpty(settings)) { + for (ParameterSettings setting : settings) { + if (step.equals(setting.getCode()) && Dictionary.FLAG_YES.equals(setting.getUserValue())) { + flag = true; + break; + } + } + } + + return flag; + } + + + @Override + public int confirmServiceOrder(Long id) { + SysProjServices services = new SysProjServices(); + services.setId(id); + services.setState(Dictionary.BEATUI_STATE_DYY); + int i = modify(services); + if (i > 0) { + //发送微信公众号提醒 + services = findById(services.getId()); + UniformMsgParam uniformMsgParam = new UniformMsgParam(services.getCompanyId(), UniformMsgParam.GZH_YYCG); + uniformMsgParam.put("serviceId", services.getId()); + asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG, uniformMsgParam); + + taiYanAliyunSmsService.sendYycgNotice(services); + + + } + return i; + } + + } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java index 8e0556f..b30f76c 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java @@ -10,15 +10,12 @@ import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.*; -import com.matrix.system.hive.plugin.util.CollectionUtils; -import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.plugin.util.MoneyUtil; import com.matrix.system.hive.service.SysProjUseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.xml.crypto.Data; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -62,6 +59,9 @@ @Override public int modify(SysProjUse sysProjUse) { + //插入套餐项目操作记录 + + return sysProjUseDao.update(sysProjUse); @@ -198,24 +198,52 @@ @Override public AjaxResult activeTc(SysProjUse proj) { - + Date newDate = proj.getFailTime(); + Date today = new Date(); SysProjUse taocan = sysProjUseDao.selectById(proj.getId()); switch (taocan.getStatus()) { case Dictionary.TAOCAN_STATUS_WX: // 如果到期,需要重新设置有效期 - if (taocan.getFailTime().before(new Date())) { - taocan.setFailTime(DateUtil.getDateAfterMonth(new Date(),12)); + if (newDate != null && !newDate.equals("")) { + taocan.setFailTime(newDate); + if (newDate.before(today)) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "有效期要大于当前日期"); + } + } + + if (newDate == null && (taocan.getFailTime() == null || taocan.getFailTime().before(today))) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已过期"); } break; - //TODO 如果是冻结状态则要算出冻结的天数,延长有效期 case Dictionary.TAOCAN_STATUS_DJ: - + SysProjuseFreeze freeze = new SysProjuseFreeze(); + freeze.setOrderItemId(taocan.getId().toString()); + freeze.setVipId(taocan.getVipId()); + SysProjuseFreeze freezeProj = sysProjuseFreezeDao.selectByOrderItemId(freeze); + // todo 因为目前没有在冻结的时候插入冻结记录,所以这里暂时这样处理 + if(freezeProj!=null){ + Date dateAfter = DateUtil.nextNDate(taocan.getFailTime(), freezeProj.getGapDays()); + taocan.setFailTime(dateAfter); + } break; default: return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择无效或者冻结的套餐"); } taocan.setStatus(Dictionary.TAOCAN_STATUS_YX); - sysProjUseDao.updateTcStatus(taocan.getId(),"有效"); + sysProjUseDao.updateProjStatus(taocan); + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysProjUseFlow useFlow=new SysProjUseFlow(); + useFlow.setProjName(taocan.getProjName()); + useFlow.setProjUseId(taocan.getId()); + useFlow.setOptionType("人工修改"); + useFlow.setRemark("设置为有效状态"); + useFlow.setFailTime(taocan.getFailTime()); + useFlow.setStatus(Dictionary.TAOCAN_STATUS_YX); + useFlow.setCreateBy(sysUsers.getSuName()); + useFlow.setUpdateBy(sysUsers.getSuName()); + sysProjUseDao.insertFlow(useFlow); + + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功"); } @@ -243,6 +271,19 @@ } else { i = sysProjuseFreezeDao.insert(freeze); } + + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysProjUseFlow useFlow=new SysProjUseFlow(); + useFlow.setProjName(taocan.getProjName()); + useFlow.setProjUseId(taocan.getId()); + useFlow.setOptionType("人工修改"); + useFlow.setStatus(Dictionary.TAOCAN_STATUS_DJ); + useFlow.setRemark("冻结项目"); + + useFlow.setCreateBy(sysUsers.getSuName()); + useFlow.setUpdateBy(sysUsers.getSuName()); + sysProjUseDao.insertFlow(useFlow); + return i; } else { throw new GlobleException("未找到套餐"); @@ -288,73 +329,6 @@ return money; } - public double getTotalMoney(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId) { - List<SysProjUse> list = sysProjUseDao.selectByModel(sysProjUse); - double money = 0; - if (CollectionUtils.isEmpty(list)) { - throw new GlobleException("该套餐没有可退款的项目!"); - } - //判断套餐是否存在欠款 - SysProjUse projuse = list.get(0); - checkOrderStatu(projuse); - if (!(projuse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX))) { - throw new GlobleException("不是有效套餐"); - } - if (projuse.getSource().contains(Dictionary.TAOCAN_SOURCE_ZR)) { - throw new GlobleException("转让的套餐不能退款"); - } - if (projuse.getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)) { - throw new GlobleException("赠送的套餐不能退款"); - } - //获取会员卡 - cardUse = moneyCardUseDao.selectVipCard(projuse.getVipId()); - String content; - //如果是套餐卡 - ShoppingGoodsAssemble shoppingGoodsAssemble = shoppingGoodsAssembleDao.selectById(sysProjUse.getAssembleId()); - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(shoppingGoodsAssemble.getShoppingGoodsId()); - if (Dictionary.SHOPPING_GOODS_TYPE_TCK.equals(projuse.getType())) { - money = projuse.getBalance(); - //余次使用流水操作 - - content = shoppingGoods.getName() + "退款¥" + projuse.getBalance(); - } else { - for (SysProjUse itemUser : list) { - Double emoney = MoneyUtil.mul(Double.parseDouble(itemUser.getSurplusCount() + ""), itemUser.getPrice()); - money = MoneyUtil.add(emoney, money); - } - //余次使用流水操作 - content = shoppingGoods.getName() + "退款¥" + money; - } - - - SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - // 1、金额退到该用户的有效会籍卡中 - System.out.println("==========" + cardUse); - if (moneyCardUseId != null) { - if (cardUse == null) { - content += "到现金。"; - } else { - //SysOrderItem orderItem = orderItemDao.selectById(cardUse.getOrderItemId()); - - StringBuilder contentBuild = new StringBuilder(); - contentBuild.append("到" + cardUse.getCardName()) - .append(",余次:" + cardUse.getLastCountName()) - .append(",本金余额:" + MoneyUtil.add(cardUse.getRealMoney(), money)) - .append(",赠送余额:" + cardUse.getGiftMoney()) - .append(",有效期:" + DateUtil.dateToString(cardUse.getFailTime(), DateUtil.DATE_FORMAT_MM)) - .append(",是否赠送:" + cardUse.getSourceName()); - content += contentBuild.toString(); - - cardUse.setRealMoney(cardUse.getRealMoney() + money); - ; - moneyCardUseDao.update(cardUse); - - } - } else { - content += "到现金。"; - } - return money; - } /** * 检测是否存在欠款 @@ -386,27 +360,26 @@ throw new GlobleException("套餐已冻结"); } taocan.setStatus(Dictionary.TAOCAN_STATUS_WX); + int i = sysProjUseDao.updateTcStatus(sysProjUse.getId(), "无效"); + + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysProjUseFlow useFlow=new SysProjUseFlow(); + useFlow.setProjName(taocan.getProjName()); + useFlow.setProjUseId(taocan.getId()); + useFlow.setOptionType("人工修改"); + useFlow.setStatus(Dictionary.TAOCAN_STATUS_WX); + useFlow.setRemark("设置为无效状态"); + useFlow.setFailTime(taocan.getFailTime()); + + useFlow.setCreateBy(sysUsers.getSuName()); + useFlow.setUpdateBy(sysUsers.getSuName()); + sysProjUseDao.insertFlow(useFlow); + return i; } - /** - * cardUser暂时没有用到 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int returnMoneyTc(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId) { - //充值记录 - //SysRechargeFlow flow=new SysRechargeFlow(); - // 计算出套餐所有项目的剩余次数的钱 - getTotalMoney(sysProjUse, cardUse, moneyCardUseId); - //3、套餐下的项目状态改为退款 - sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_TK); - int j = sysProjUseDao.updateProjStatus(sysProjUse); - - return j; - } /*********************以下为项目使用情况操作***********************/ @@ -504,6 +477,17 @@ } else { i = sysProjuseFreezeDao.insert(freeze); } + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysProjUseFlow useFlow=new SysProjUseFlow(); + useFlow.setProjName(sysProjUse.getProjName()); + useFlow.setProjUseId(sysProjUse.getId()); + useFlow.setOptionType("人工修改"); + useFlow.setStatus(Dictionary.TAOCAN_STATUS_DJ); + useFlow.setRemark("冻结项目"); + + useFlow.setCreateBy(sysUsers.getSuName()); + useFlow.setUpdateBy(sysUsers.getSuName()); + sysProjUseDao.insertFlow(useFlow); return i; } @@ -529,56 +513,24 @@ throw new GlobleException("套餐已冻结"); } sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_WX); - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(sysProjUse.getProjId()); - String content = shoppingGoods.getName() + "设置为" + sysProjUse.getStatus(); + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysProjUseFlow useFlow=new SysProjUseFlow(); + useFlow.setProjName(sysProjUse.getProjName()); + useFlow.setProjUseId(sysProjUse.getId()); + useFlow.setOptionType("人工修改"); + useFlow.setStatus(Dictionary.TAOCAN_STATUS_WX); + useFlow.setRemark("设置为无效状态"); + useFlow.setFailTime(sysProjUse.getFailTime()); + + useFlow.setCreateBy(sysUsers.getSuName()); + useFlow.setUpdateBy(sysUsers.getSuName()); + sysProjUseDao.insertFlow(useFlow); return sysProjUseDao.update(sysProjUse); } - /** - * 退款 - * - * @param sysProjUse - * @return - */ - public int returnMoneyProj(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId) { - int i = 0; - sysProjUse = sysProjUseDao.selectById(sysProjUse.getId()); - //判断套餐是否存在欠款 - checkOrderStatu(sysProjUse); - if (!(sysProjUse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX))) { - throw new GlobleException("不是有效项目"); - } - if (sysProjUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZR)) { - throw new GlobleException("转让的项目不能退款"); - } - if (sysProjUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZS)) { - throw new GlobleException("赠送的项目不能退款"); - } - StringBuilder content = new StringBuilder(); - ShoppingGoodsAssemble shoppingGoodsAssemble = shoppingGoodsAssembleDao.selectById(sysProjUse.getAssembleId()); - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(shoppingGoodsAssemble.getShoppingGoodsId()); - content.append(shoppingGoods + "退款"); - if (cardUse != null) { - // 1、金额退到该用户的有效会籍卡中 - MoneyCardUse upCard = moneyCardUseDao.selectById(cardUse.getId()); - upCard.setRealMoney(upCard.getRealMoney() + sysProjUse.getBalance()); - ; - moneyCardUseDao.update(upCard); - content.append("到会籍卡(" + upCard.getCardName() + ")" + sysProjUse.getBalance() + "元") - .append(",余次:" + upCard.getLastCountName()) - .append(",本金余额:" + upCard.getRealMoney()) - .append(",有效期:" + DateUtil.dateToString(upCard.getFailTime(), DateUtil.DATE_FORMAT_MM)) - .append(",是否赠送:" + upCard.getSourceName()); - } else { - content.append("现金" + sysProjUse.getBalance() + "元"); - } - - sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_TK); - return sysProjUseDao.update(sysProjUse); - } /** * 设置为有效套餐 @@ -590,6 +542,7 @@ public AjaxResult activeProj(SysProjUse proj) { Date today = new Date(); Date newDate = proj.getFailTime(); + proj = sysProjUseDao.selectById(proj.getId()); switch (proj.getStatus()) { case Dictionary.TAOCAN_STATUS_WX: @@ -600,47 +553,42 @@ return new AjaxResult(AjaxResult.STATUS_FAIL, "有效期要大于当前日期"); } } - if (newDate == null && proj.getFailTime().before(today)) { + if (newDate == null && (proj.getFailTime() == null || proj.getFailTime().before(today))) { return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已过期"); } break; //如果是冻结状态则要算出冻结的天数,延长有效期 case Dictionary.TAOCAN_STATUS_DJ: + SysProjuseFreeze freeze = new SysProjuseFreeze(); + freeze.setOrderItemId(proj.getId().toString()); + freeze.setVipId(proj.getVipId()); + SysProjuseFreeze freezeProj = sysProjuseFreezeDao.selectByOrderItemId(freeze); + Date dateAfter = DateUtil.nextNDate(proj.getFailTime(), freezeProj.getGapDays()); + proj.setFailTime(dateAfter); break; default: return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择无效或者冻结的套餐"); } proj.setStatus(Dictionary.TAOCAN_STATUS_YX); sysProjUseDao.update(proj); - StringBuilder content = new StringBuilder(); - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(proj.getProjId()); - content.append(shoppingGoods.getName() + "设置为有效") - .append(",有效期:" + DateUtil.dateToString(proj.getFailTime(), DateUtil.DATE_FORMAT_MM)); + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysProjUseFlow useFlow=new SysProjUseFlow(); + useFlow.setProjName(proj.getProjName()); + useFlow.setProjUseId(proj.getId()); + useFlow.setOptionType("人工修改"); + useFlow.setStatus(Dictionary.TAOCAN_STATUS_YX); + useFlow.setRemark("设置为有效状态"); + useFlow.setFailTime(proj.getFailTime()); + + useFlow.setCreateBy(sysUsers.getSuName()); + useFlow.setUpdateBy(sysUsers.getSuName()); + sysProjUseDao.insertFlow(useFlow); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功"); } - /** - * 退款项目 - */ - @Override - public double getTotalMoneyProj(SysProjUse sysProjUse) { - sysProjUse = sysProjUseDao.selectById(sysProjUse.getId()); - //判断套餐是否存在欠款 - checkOrderStatu(sysProjUse); - if (!(sysProjUse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX))) { - throw new GlobleException("不是有效项目"); - } - if (sysProjUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZR)) { - throw new GlobleException("转让的项目不能退款"); - } - if (sysProjUse.getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)) { - throw new GlobleException("赠送的项目不能退款"); - } - return sysProjUse.getBalance(); - } @Override @@ -649,9 +597,20 @@ } @Override - public List<SysProjUse> selectTaocanProjUse(Long taocanId) { + public List<SysProjUse> selectTaocanProjUse(Long taocanId, String status) { SysProjUse projUse = new SysProjUse(); projUse.setTaocanId(taocanId); + projUse.setStatus(status); return sysProjUseDao.selectByModel(projUse); } + + @Override + public List<SysProjUse> findTaocaoProjUseWithProj(SysProjUse sysProjUse) { + return sysProjUseDao.selectTaoCanListWithProj(sysProjUse); + } + + @Override + public int findTaocanCountForCourseAndInfinite(Long taocanId, Long vipId) { + return sysProjUseDao.selectTaocanCountForCourseAndInfinite(taocanId, vipId); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java index 3a7c6df..0515e39 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java @@ -3,25 +3,35 @@ import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.*; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.EncrypUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelUtil; +import com.matrix.system.app.dto.AddVipDto; +import com.matrix.system.app.dto.ModifyVipDto; +import com.matrix.system.app.dto.VipInfoListDto; +import com.matrix.system.app.vo.VipInfoDetailVo; +import com.matrix.system.app.vo.VipInfoListVo; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.common.tools.ServiceUtil; import com.matrix.system.constance.Dictionary; import com.matrix.system.constance.TableMapping; -import com.matrix.system.hive.bean.MoneyCardUse; -import com.matrix.system.hive.bean.MyBeatician; -import com.matrix.system.hive.bean.SysVipInfo; -import com.matrix.system.hive.bean.VipAnswer; -import com.matrix.system.hive.dao.MoneyCardUseDao; -import com.matrix.system.hive.dao.MyBeaticianDao; -import com.matrix.system.hive.dao.SysVipInfoDao; -import com.matrix.system.hive.dao.VipAnswerDao; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.*; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.pojo.VipInfoVo; import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -29,9 +39,7 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; /** @@ -57,13 +65,31 @@ @Autowired private MoneyCardUseDao moneyCardUseDao; + @Autowired + private SysVipLabelDao sysVipLabelDao; + + @Value("${default.vip.photo.woman}") + String defaultWoman; + + @Value("${default.vip.photo.man}") + String defaultMan; + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + ScoreVipDetailService scoreVipDetailService; + + @Autowired + private SysOrderDao sysOrderDao; + + /** * 新增会员储值卡 * @param vipId * @return */ @Override - public int addVipDefaultCard(Long vipId){ + public MoneyCardUse addVipDefaultCard(Long vipId){ MoneyCardUse defaultCardUse=new MoneyCardUse(); defaultCardUse.setVipId(vipId); defaultCardUse.setCardName("储值卡"); @@ -72,17 +98,18 @@ defaultCardUse.setGiftMoney(0D); defaultCardUse.setSource("-"); defaultCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); - return moneyCardUseDao.insert(defaultCardUse); + moneyCardUseDao.insert(defaultCardUse); + return defaultCardUse; } @Override public int add(SysVipInfo sysVipInfo) { - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if (sysVipInfo.getVipNo() != null && (!sysVipInfo.getVipNo().equals(""))) { if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", sysVipInfo.getVipNo(), - "company_id",user.getCompanyId())) { + "company_id",sysVipInfo.getCompanyId())) { throw new GlobleException("编号已存在!"); } } @@ -91,20 +118,26 @@ throw new GlobleException("请输入手机号!"); } if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", sysVipInfo.getPhone(), - "company_id",user.getCompanyId() )) { - throw new GlobleException("手机已被注册!"); + "company_id",sysVipInfo.getCompanyId() )) { + throw new GlobleException(sysVipInfo.getPhone()+"手机已被注册!"); } } - - - sysVipInfo.setShopId(user.getShopId()); - sysVipInfo.setCompanyId(user.getCompanyId()); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if(user!=null){ + sysVipInfo.setCompanyId(user.getCompanyId()); + } sysVipInfo.setCreateTime(new Date()); sysVipInfo.setPointAll(0); - sysVipInfo.setIsDeal(SysVipInfo.DEAL_VIP); - sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); + sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); + if(StringUtils.isNotBlank(sysVipInfo.getVipName())){ + sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); + } + if(Dictionary.SEX_MAN.equals(sysVipInfo.getSex())){ + sysVipInfo.setPhoto(defaultMan); + }else{ + sysVipInfo.setPhoto(defaultWoman); + } int i=sysVipInfoDao.insert(sysVipInfo); - modifyVipWithOtherInfo(sysVipInfo); //创建用户默认储值卡 addVipDefaultCard(sysVipInfo.getId()); return i; @@ -196,8 +229,7 @@ @Override public List<SysVipInfo> findByVipNoOrTel(String key) { - SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - return sysVipInfoDao.selectByVipNoOrTel(key, users.getShopId()); + return sysVipInfoDao.selectByVipNoOrTel(key); } @@ -239,31 +271,7 @@ } - //如果会员id不为空则表示是修改,删除原有的绑定关系,建立新的关系 - if(vipInfo.getId()!=null && !vipInfo.getId().equals("")){ - MyBeatician query=new MyBeatician(); - query.setVipId(vipInfo.getId()); - List<MyBeatician> listDel= myBeaticianDao.selectByModel(query); - if(listDel!=null && listDel.size()>0){ - List<Long> delIds=new ArrayList<>(); - for (int i = 0; i < listDel.size(); i++) { - delIds.add(listDel.get(i).getId()); - } - myBeaticianDao.deleteByIds(delIds); - } - } - //添加客户的美疗师 - List<MyBeatician> list=vipInfo.getBeauticains(); - if(list!=null && list.size()>0){ - List<MyBeatician> saveList=new ArrayList<>(); - //此处由于前台传递过来list中的下标可能是不连续的。因此要过滤掉空的,即要过滤掉美疗师的id为空的数据 - for (MyBeatician temp:list) { - if(temp.getBeauticainId()!=null && !temp.getBeauticainId().equals("")){ - saveList.add(temp); - } - } - myBeaticianDao.insertAll(saveList,vipInfo.getId()); - } + } @@ -278,8 +286,8 @@ @Override public List<SysVipInfo> findUserByKey(String keyWord) { - SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - return sysVipInfoDao.selectUserByKey(keyWord, users.getShopId()); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + return sysVipInfoDao.selectUserByKey(keyWord,user.getCompanyId()); } @@ -335,6 +343,11 @@ SysUsers users = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); sysVipInfo.setCompanyId(users.getCompanyId()); sysVipInfo.setShopId(users.getShopId()); + if(sysVipInfo.getSex().equals(Dictionary.SEX_MAN)){ + sysVipInfo.setPhoto(defaultMan); + }else{ + sysVipInfo.setPhoto(defaultWoman); + } int i=sysVipInfoDao.insert(sysVipInfo); modifyVipWithOtherInfo(sysVipInfo); return i; @@ -393,7 +406,7 @@ SysVipInfo vipInfo = new SysVipInfo(); vipInfo.setVipNo(objects.get(0).toString()); - SysVipInfo exist = sysVipInfoDao.selectByPhone(objects.get(3).toString()); + SysVipInfo exist = sysVipInfoDao.selectByPhone(objects.get(3).toString(),sysUsers.getCompanyId()); if (exist != null) { continue; } @@ -417,5 +430,257 @@ return result; } + @Override + public List<VipInfoListVo> findVipAddressBook(VipInfoListDto vipInfoListDto) { + //todo 会员查询单独做控制 + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if (!DataAuthUtil.hasAllCustomerAuth()) { + vipInfoListDto.setShopId(sysUsers.getShopId()); + } + QueryUtil.setQueryLimitCom(vipInfoListDto); + return sysVipInfoDao.selectVipAddressBookByList(vipInfoListDto); + } + @Override + public com.matrix.system.app.vo.VipInfoVo findApiVipInfoById(Long id) { + com.matrix.system.app.vo.VipInfoVo result = sysVipInfoDao.selectVipInfoById(id); + result.setArrears(sysOrderDao.selectArrearsByVipId(id)); + return result; + } + + @Override + @Transactional + public int apiAddVip(AddVipDto addVipDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + if (StringUtils.isNotBlank(addVipDto.getVipNo())) { + if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", addVipDto.getVipNo(), + "company_id", user.getCompanyId())) { + throw new GlobleException("编号已存在!"); + } + } + + if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", addVipDto.getPhone(), + "company_id",user.getCompanyId() )) { + throw new GlobleException("手机已被注册!"); + } + + SysVipInfo vipInfo = new SysVipInfo(); + + vipInfo.setPhoto(addVipDto.getPhoto()); + vipInfo.setVipName(addVipDto.getVipName()); + vipInfo.setVipNo(addVipDto.getVipNo()); + vipInfo.setSex(addVipDto.getSex()); + vipInfo.setArrivalWay(addVipDto.getArrivalWay()); + vipInfo.setPhone(addVipDto.getPhone()); + vipInfo.setAddr(addVipDto.getAddress()); + vipInfo.setRemark(addVipDto.getRemark()); + vipInfo.setBirthday1(addVipDto.getBirthday()); + vipInfo.setPassWord(addVipDto.getPassword()); + vipInfo.setRecommendId(addVipDto.getRecommendId()); + + if (StringUtils.isNotBlank(addVipDto.getAreas())) { + String[] areas = addVipDto.getAreas().split("-"); + vipInfo.setProvince(areas[0]); + vipInfo.setCity(areas[1]); + vipInfo.setArea(areas[2]); + } + + vipInfo.setInDate(new Date()); + vipInfo.setPointAll(0); + vipInfo.setVipState(Dictionary.VIP_STATE_HY); + vipInfo.setStaffId(user.getSuId()); + vipInfo.setShopId(user.getShopId()); + vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); + vipInfo.setShopId(user.getShopId()); + vipInfo.setCompanyId(user.getCompanyId()); + vipInfo.setCreateTime(new Date()); + vipInfo.setPointAll(0); + vipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); + vipInfo.setZjm(StringUtils.toHanyuPinyin(vipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(vipInfo.getVipName())); + if(vipInfo.getSex().equals(Dictionary.SEX_MAN)){ + vipInfo.setPhoto(defaultMan); + }else{ + vipInfo.setPhoto(defaultWoman); + } + int i=sysVipInfoDao.insert(vipInfo); + + if (CollectionUtils.isNotEmpty(addVipDto.getLabels())) { + batchInsertLabel(addVipDto.getLabels(), vipInfo.getId()); + } + //添加推荐人积分 + addReferrerVipScore(vipInfo); + + //创建用户默认储值卡 + addVipDefaultCard(vipInfo.getId()); + return i; + } + + /** + * 添加推荐人积分 + * @param vipInfo + */ + public void addReferrerVipScore(SysVipInfo vipInfo) { + if(vipInfo.getRecommendId()!=null){ + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + BusParameterSettings referrerScoreSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.REFERRALS_CONSUMPTION, user.getCompanyId()); + //推荐注册老带新积分奖励 + SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); + + if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue())){ + + scoreVipDetailService.addScore( + referrerVip.getId(), + user.getSuId(), + vipInfo.getShopId(), + Integer.parseInt(referrerScoreSetting.getParamValue()), + vipInfo.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_REFERRER, + "推荐会员" + ); + } + + //推荐注册二级带新积分奖励 + + if(referrerVip.getRecommendId()!=null){ + + SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); + + + if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue1())){ + scoreVipDetailService.addScore( + topVipInfo.getId(), + user.getSuId(), + vipInfo.getShopId(), + Integer.parseInt(referrerScoreSetting.getParamValue1()), + vipInfo.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_REFERRER, + "间接推荐会员" + ); + } + } + + } + } + + @Override + public int apiModifyVip(ModifyVipDto modifyVipDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + SysVipInfo vipInfo = sysVipInfoDao.selectById(modifyVipDto.getVipId()); + if (vipInfo == null) { + throw new GlobleException("用户不存在"); + } + + if (StringUtils.isNotBlank(modifyVipDto.getVipNo())) { + if (!modifyVipDto.getVipNo().equals(vipInfo.getVipNo())) { + if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", modifyVipDto.getVipNo(), + "company_id", user.getCompanyId())) { + throw new GlobleException("编号已存在!"); + } + } + } + + if (!vipInfo.getPhone().equals(modifyVipDto.getPhone())) { + if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", modifyVipDto.getPhone(), + "company_id", user.getCompanyId())) { + throw new GlobleException("手机已被注册!"); + } + } + + if (StringUtils.isNotBlank(modifyVipDto.getAreas())) { + String[] areas = modifyVipDto.getAreas().split("-"); + vipInfo.setProvince(areas[0]); + vipInfo.setCity(areas[1]); + vipInfo.setArea(areas[2]); + } + + vipInfo.setVipName(modifyVipDto.getVipName()); + vipInfo.setSex(modifyVipDto.getSex()); + vipInfo.setArrivalWay(modifyVipDto.getArrivalWay()); + vipInfo.setPhone(modifyVipDto.getPhone()); + vipInfo.setAddr(modifyVipDto.getAddress()); + vipInfo.setRemark(modifyVipDto.getRemark()); + vipInfo.setPassWord(modifyVipDto.getPassword()); + vipInfo.setBirthday1(modifyVipDto.getBirthday()); + vipInfo.setRecommendId(modifyVipDto.getRecommendId()); + vipInfo.setPhoto(modifyVipDto.getPhoto()); + int i = sysVipInfoDao.update(vipInfo); + + if (CollectionUtils.isNotEmpty(modifyVipDto.getLabels())) { + sysVipLabelDao.deleteRelateByVipId(modifyVipDto.getVipId()); + batchInsertLabel(modifyVipDto.getLabels(), vipInfo.getId()); + } + return i; + } + + private void batchInsertLabel(List<String> labelList, Long id) { + Set<String> labels = new HashSet<>(labelList); + Iterator<String> iterator = labels.iterator(); + while (iterator.hasNext()) { + SysVipLabelRelate relate = new SysVipLabelRelate(); + relate.setLabelId(Long.parseLong(iterator.next())); + relate.setVipId(id); + sysVipLabelDao.insertRelate(relate); + } + } + + @Override + public VipInfoDetailVo findVipInfoDetail(Long id) { + SysVipInfo sysVipInfo = sysVipInfoDao.selectById(id); + if (sysVipInfo == null) { + throw new GlobleException("用户不存在"); + } + + VipInfoDetailVo vipInfoDetailVo = new VipInfoDetailVo(); + vipInfoDetailVo.setVipName(sysVipInfo.getVipName()); + vipInfoDetailVo.setAddress(sysVipInfo.getAddr()); + vipInfoDetailVo.setPhone(sysVipInfo.getPhone()); + vipInfoDetailVo.setSex(sysVipInfo.getSex()); + vipInfoDetailVo.setArrivalWay(sysVipInfo.getArrivalWay()); + vipInfoDetailVo.setRecommendId(sysVipInfo.getRecommendId()); + vipInfoDetailVo.setId(sysVipInfo.getId()); + vipInfoDetailVo.setProvince(sysVipInfo.getProvince()); + vipInfoDetailVo.setCity(sysVipInfo.getCity()); + vipInfoDetailVo.setArea(sysVipInfo.getArea()); + vipInfoDetailVo.setRemark(sysVipInfo.getRemark()); + vipInfoDetailVo.setBirthday(sysVipInfo.getBirthday1()); + vipInfoDetailVo.setPassword(sysVipInfo.getPassWord()); + vipInfoDetailVo.setPhoto(sysVipInfo.getPhoto()); + vipInfoDetailVo.setVipNo(sysVipInfo.getVipNo()); + + List<SysVipLabel> labels = sysVipLabelDao.selectByVipId(sysVipInfo.getId()); + vipInfoDetailVo.setLabels(labels); + return vipInfoDetailVo; + } + + @Override + public SysVipInfo findByOpenId(String openId) { + return sysVipInfoDao.findByOpenId(openId); + } + + /** + * 设置成为推广员 + * @param invitationId + */ + @Override + public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId) { + SysVipInfo sysVipInfo=sysVipInfoDao.selectById(userId); + sysVipInfo.setIsSales(SysVipInfo.IS_SALES); + sysVipInfo.setRecommendId(invitationId); + sysVipInfo.setBindingParentTime(new Date()); + sysVipInfo.setSalesmanGrade(gradeId); + return sysVipInfoDao.update(sysVipInfo); + } + + + @Override + public List<Map<String, Object>> findVipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo) { + return sysVipInfoDao.selectVipArrearsStatistics(sysVipInfo, pageVo); + } + + @Override + public Integer findVipArrearsStatisticsTotal(SysVipInfo sysVipInfo) { + return sysVipInfoDao.selectVipArrearsStatisticsTotal(sysVipInfo); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysWorktimeServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysWorktimeServiceImpl.java index 081934e..793ae96 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysWorktimeServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysWorktimeServiceImpl.java @@ -97,16 +97,25 @@ @Override public boolean isInWorkTime(Long shopId, Date beginTime, Date endTime) { - Date minTime = findMinTime(shopId); - Date maxTime = findMaxTime(shopId); - minTime.setYear(beginTime.getYear()); - minTime.setMonth(beginTime.getMonth()); - minTime.setDate(beginTime.getDate()); - maxTime.setYear(beginTime.getYear()); - maxTime.setMonth(beginTime.getMonth()); - maxTime.setDate(beginTime.getDate()); - return ( - (DateUtil.isDuringDate(minTime, maxTime, beginTime) || minTime.getTime()==beginTime.getTime() ) - && DateUtil.isDuringDate(minTime, maxTime, endTime) || maxTime.getTime()==endTime.getTime() ); + if(beginTime!=null){ + Date minTime = findMinTime(shopId); + if(minTime!=null){ + Date maxTime = findMaxTime(shopId); + minTime.setYear(beginTime.getYear()); + minTime.setMonth(beginTime.getMonth()); + minTime.setDate(beginTime.getDate()); + maxTime.setYear(beginTime.getYear()); + maxTime.setMonth(beginTime.getMonth()); + maxTime.setDate(beginTime.getDate()); + return ( + (DateUtil.isDuringDate(minTime, maxTime, beginTime) || minTime.getTime()==beginTime.getTime() ) + && DateUtil.isDuringDate(minTime, maxTime, endTime) || maxTime.getTime()==endTime.getTime() ); + }else { + return false; + } + + }else{ + return false; + } } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java index 2d8435e..9901970 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java @@ -1,5 +1,7 @@ package com.matrix.system.hive.statistics; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; @@ -7,14 +9,24 @@ import com.matrix.core.tools.WebUtil; import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelVersion; +import com.matrix.system.common.bean.CustomerDataDictionary; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.CustomerDataDictionaryDao; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.dao.AchieveNewDao; +import com.matrix.system.hive.dto.AchieveNewStatisticsDto; +import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.service.AchieveNewService; +import com.matrix.system.hive.vo.AchieveNewStatisticsVo; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -37,15 +49,36 @@ @Resource private AchieveNewService achieveNewService; + @Autowired + private AchieveNewDao achieveNewDao; + + + + /** + * 员工业绩统计 + */ + @PostMapping(value = "/achieveNewStatistics") + public @ResponseBody + AjaxResult achieveNewStatistics(@RequestBody AchieveNewStatisticsDto queryDto){ + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + + queryDto.setCompanyId(sysUsers.getCompanyId()); + + Page<AchieveNewStatisticsVo> page = new Page(queryDto.getPageNum(), queryDto.getPageSize()); + IPage<AchieveNewStatisticsVo> rows = achieveNewDao.achieveNewStatistics(page,queryDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); + return result; + } + /** * 门店每日单据明细表 */ @RequestMapping(value = "/findSumDailyInfoNew") public @ResponseBody - AjaxResult findSumDailyInfoNew(AchieveNew achieveNew, PaginationVO pageVo) { + AjaxResult findSumDailyInfoNew(@RequestBody AchieveNew achieveNew) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { achieveNew.setShopId(sysUsers.getShopId()); } AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, achieveNewService.findSumDailyInfoNew(achieveNew, null), @@ -59,11 +92,16 @@ */ @RequestMapping(value = "/findDailyInfoNew") public @ResponseBody - AjaxResult findDailyInfoNew(AchieveNew achieveNew, PaginationVO pageVo) { + AjaxResult findDailyInfoNew(@RequestBody AchieveNew achieveNew) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + achieveNew.setCompanyId(sysUsers.getCompanyId()); + if (!DataAuthUtil.hasAllShopAuth()) { achieveNew.setShopId(sysUsers.getShopId()); } + PaginationVO pageVo = new PaginationVO(); + + pageVo.setOffset(achieveNew.getOffset()); + pageVo.setLimit(achieveNew.getLimit()); pageVo.setSort("datatime"); pageVo.setOrder("desc"); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, achieveNewService.findDayFlow(achieveNew, pageVo), @@ -71,18 +109,96 @@ return result; } - @RequestMapping(value = "/exportDailyInfoNew") - public void exportDailyInfoNew(ModelMap model, HttpServletRequest request, HttpServletResponse response, AchieveNew achieveNew) throws IOException { + @RequestMapping(value = "/exportAchieveNewStatisticsExcel") + public void exportAchieveNewStatisticsExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response, AchieveNewStatisticsDto queryDto) throws IOException { //这里是从数据库里查数据并组装成我们想要的数据结构的过程 List<ExcelSheetPO> res = new ArrayList<>(); ExcelSheetPO orderSheet = new ExcelSheetPO(); - String title = "每日单据明细"; + String title = "员工业绩统计"; orderSheet.setSheetName(title); orderSheet.setTitle(title); - String[] header = {"年", "月", "日", "订单类型", "订单编号", "会员级别", "姓名", "项目名称", "总金额", "卡项", "现金单次", "现金产品", "划扣", "本金消耗", "赠消", "提成", "顾问", "美疗师", "人头", "项目个数", "项目时间", "门店"}; + String[] header = {"规则名称", "门店名称", "业绩归属人", "业绩创建人", "订单金额", "现金", "划扣", "本金消耗", "赠送消耗" + , "服务提成", "人头", "项目个数", "服务时间", "订单类型"}; orderSheet.setHeaders(header); SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { + queryDto.setShopId(sysUsers.getShopId()); + } + queryDto.setCompanyId(sysUsers.getCompanyId()); + Page<AchieveNewStatisticsVo> page = new Page(1, Long.MAX_VALUE); + IPage<AchieveNewStatisticsVo> rows = achieveNewDao.achieveNewStatistics(page,queryDto); + List<AchieveNewStatisticsVo> dataList = rows.getRecords(); + List<List<Object>> list = new ArrayList<>(); + if (dataList.size() > 0) { + for (AchieveNewStatisticsVo item : dataList) { + List<Object> temp = new ArrayList<>(); + temp.add(item.getRuleName()); + temp.add(item.getShopName()); + temp.add(item.getGuwen()); + temp.add(item.getCreateBy()); + temp.add(item.getZkTotal()); + temp.add(item.getGoodsCash()); + temp.add(item.getCardCash()); + temp.add(item.getHisConsume()); + temp.add(item.getFreeConsume()); + temp.add(item.getProjPercentage()); + temp.add(item.getNumberOfPeople()); + temp.add(item.getProjNum()); + temp.add(item.getProjTime()); + temp.add(item.getOrderType()); + list.add(temp); + } + } + orderSheet.setDataList(list); + res.add(orderSheet); + response = ResponseHeadUtil.setExcelHead(response); + response.setHeader("Content-Disposition", + "attachment;filename=" + java.net.URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8")); + OutputStream os = response.getOutputStream(); + com.matrix.core.tools.excl.ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); + } + + @Autowired + CustomerDataDictionaryDao dataDictionaryDao; + + @RequestMapping(value = "/exportDailyInfoNew") + public void exportDailyInfoNew(ModelMap model, HttpServletRequest request, HttpServletResponse response, AchieveNew achieveNew) throws IOException { + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + List<CustomerDataDictionary> achieveTyps = dataDictionaryDao.selectByParentCode("YJLX", sysUsers.getCompanyId()); + + List<ExcelSheetPO> res = new ArrayList<>(); + ExcelSheetPO orderSheet = new ExcelSheetPO(); + String title = "员工业绩报表"; + orderSheet.setSheetName(title); + orderSheet.setTitle(title); + List<String> headerList =new ArrayList(); + headerList.add("订单时间"); + headerList.add("订单编号"); + headerList.add("订单类型"); + headerList.add("会员姓名"); + headerList.add("产品"); + headerList.add("业绩规则"); + headerList.add("产品分类"); + headerList.add("订单金额"); + headerList.add("现金"); + headerList.add("划扣"); + headerList.add("员工"); + achieveTyps.forEach(item->{headerList.add(item.getValue());}); + headerList.add("本金消耗"); + headerList.add("赠消"); + headerList.add("提成"); + headerList.add("人头"); + headerList.add("项目个数"); + headerList.add("项目时间"); + headerList.add("顾问"); + headerList.add("门店"); + + String[] header = headerList.toArray(new String[headerList.size()]); + + + orderSheet.setHeaders(header); + if (!DataAuthUtil.hasAllShopAuth()) { achieveNew.setShopId(sysUsers.getShopId()); } @@ -92,27 +208,32 @@ if (dataList.size() > 0) { for (AchieveNew item : dataList) { List<Object> temp = new ArrayList<>(); - temp.add(item.getYear()); - temp.add(item.getMonth()); - temp.add(item.getDay()); - temp.add(item.getOrderType()); + temp.add(DateUtil.dateFormatStr(item.getDatatime(), DateUtil.DATE_FORMAT_MM)); temp.add(item.getOrderNo()); - temp.add(item.getLevelName()); + temp.add(item.getOrderType()); temp.add(item.getVipName()); temp.add(item.getProName()); + temp.add(item.getAchieveRuleName()); + temp.add(item.getCateName()); temp.add(item.getZkTotal()); - temp.add(item.getCardCash()); - temp.add(item.getProjCash()); temp.add(item.getGoodsCash()); - temp.add(item.getConsume()); + temp.add(item.getCardCash()); + temp.add(item.getMeiliao()); + //动态导出列---- + achieveTyps.forEach(item2->{ + if(item2.getValue().equals(item.getAchieveType())){ + temp.add(item.getGoodsCash()); + }else{ + temp.add(""); + } + }); temp.add(item.getHisConsume()); temp.add(item.getFreeConsume()); temp.add(item.getProjPercentage()); - temp.add(item.getGuwen()); - temp.add(item.getMeiliao()); temp.add(item.getNumberOfPeople()); temp.add(item.getProjNum()); temp.add(item.getProjTime()); + temp.add(item.getGuwen()); temp.add(item.getShopName()); list.add(temp); } @@ -126,6 +247,45 @@ com.matrix.core.tools.excl.ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); } + @RequestMapping(value = "/del") + @ResponseBody + public AjaxResult del(Long id) { + int i = achieveNewService.removeById(id); + if (i > 0) { + return AjaxResult.buildSuccessInstance("删除成功"); + } + return AjaxResult.buildFailInstance("删除失败"); + } + + @RequestMapping(value = "/add") + @ResponseBody + @Transactional + public AjaxResult add(@RequestBody List<AchieveNew> list) { + if (CollectionUtils.isNotEmpty(list)) { + //删除原业绩 + achieveNewDao.deleteByOrderId(list.get(0).getOrderId()); + //插入新业绩 + achieveNewDao.batchInsert(list); + return AjaxResult.buildSuccessInstance("保存成功"); + } else { + return AjaxResult.buildFailInstance("未找到业绩数据"); + } + } + + @RequestMapping(value = "/findDailyBeautyList") + @ResponseBody + public AjaxResult findDailyBeautyList(@RequestBody AchieveNew achieveNew) { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + achieveNew.setCompanyId(sysUsers.getCompanyId()); + if (!DataAuthUtil.hasAllShopAuth()) { + achieveNew.setShopId(sysUsers.getShopId()); + } + PaginationVO pageVo = new PaginationVO(); + + pageVo.setOffset(achieveNew.getOffset()); + pageVo.setLimit(achieveNew.getLimit()); + return AjaxResult.buildSuccessInstance(achieveNewService.findDailyBeautyList(achieveNew, pageVo), achieveNewService.findDailyBeautyListTotal(achieveNew)); + } } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/DailySaleVo.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/DailySaleVo.java new file mode 100644 index 0000000..dabb87f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/DailySaleVo.java @@ -0,0 +1,412 @@ +package com.matrix.system.hive.statistics; + +import com.matrix.core.anotations.Extend; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author wzy + * @date 2021-01-15 + **/ +public class DailySaleVo { + + private String dataTime; + + private String shopName; + + private BigDecimal shouldPay; + + private BigDecimal totalPay; + + private BigDecimal cashPay; + + private BigDecimal cardPay; + + private BigDecimal arrearsPay; + + private BigDecimal refundCashPay; + + private BigDecimal refundCardPay; + + private BigDecimal productAchieve; + + private BigDecimal cardAchieve; + + private BigDecimal refund; + + private BigDecimal perCustomCnt; + + private BigDecimal customGoodsCnt; + + private BigDecimal perCustomPrice; + + private BigDecimal cost; + + private BigDecimal grossProfit; + + private BigDecimal grossProfitRate; + + private BigDecimal consumePay; + + private BigDecimal freeConsumePay; + + private BigDecimal peopleCnt; + + private BigDecimal projConsumeCnt; + + private BigDecimal timeLength; + + /** + * 当天销售总数量 + */ + private Integer totalSaleCnt; + + /** + * 家居产品成本 + */ + private BigDecimal goodsCost; + + /** + * 除家具产品以外成本 + */ + private BigDecimal otherCost; + + private BigDecimal wechat; + + private BigDecimal alipay; + + private BigDecimal cash; + + private BigDecimal bankCard; + + private BigDecimal tuan; + + private BigDecimal cardBj; + + private BigDecimal cardFree; + + private BigDecimal arrears; + + @Extend + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) + + private Date beginTime; + + @Extend + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) + private Date endTime; + + private Long shopId; + + public BigDecimal getShouldPay() { + return shouldPay; + } + + public void setShouldPay(BigDecimal shouldPay) { + this.shouldPay = shouldPay; + } + + public BigDecimal getWechat() { + return wechat; + } + + public void setWechat(BigDecimal wechat) { + this.wechat = wechat; + } + + public BigDecimal getAlipay() { + return alipay; + } + + public void setAlipay(BigDecimal alipay) { + this.alipay = alipay; + } + + public BigDecimal getCash() { + return cash; + } + + public void setCash(BigDecimal cash) { + this.cash = cash; + } + + public BigDecimal getBankCard() { + return bankCard; + } + + public void setBankCard(BigDecimal bankCard) { + this.bankCard = bankCard; + } + + public BigDecimal getTuan() { + return tuan; + } + + public void setTuan(BigDecimal tuan) { + this.tuan = tuan; + } + + public BigDecimal getCardBj() { + return cardBj; + } + + public void setCardBj(BigDecimal cardBj) { + this.cardBj = cardBj; + } + + public BigDecimal getCardFree() { + return cardFree; + } + + public void setCardFree(BigDecimal cardFree) { + this.cardFree = cardFree; + } + + public BigDecimal getArrears() { + return arrears; + } + + public void setArrears(BigDecimal arrears) { + this.arrears = arrears; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public Date getBeginTime() { + return beginTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Integer getTotalSaleCnt() { + return totalSaleCnt; + } + + public void setTotalSaleCnt(Integer totalSaleCnt) { + this.totalSaleCnt = totalSaleCnt; + } + + public BigDecimal getGoodsCost() { + return goodsCost; + } + + public void setGoodsCost(BigDecimal goodsCost) { + this.goodsCost = goodsCost; + } + + public BigDecimal getOtherCost() { + return otherCost; + } + + public void setOtherCost(BigDecimal otherCost) { + this.otherCost = otherCost; + } + + public String getDataTime() { + return DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.DATE_FORMAT_DD),DateUtil.DATE_FORMAT_DD); + } + + public void setDataTime(String dataTime) { + this.dataTime = dataTime; + } + + public BigDecimal getTotalPay() { + return totalPay; + } + + public void setTotalPay(BigDecimal totalPay) { + this.totalPay = totalPay; + } + + public BigDecimal getCashPay() { + return cashPay; + } + + public void setCashPay(BigDecimal cashPay) { + this.cashPay = cashPay; + } + + public BigDecimal getCardPay() { + return cardPay; + } + + public void setCardPay(BigDecimal cardPay) { + this.cardPay = cardPay; + } + + public BigDecimal getArrearsPay() { + return arrearsPay; + } + + public void setArrearsPay(BigDecimal arrearsPay) { + this.arrearsPay = arrearsPay; + } + + public BigDecimal getFreeConsumePay() { + return freeConsumePay; + } + + public void setFreeConsumePay(BigDecimal freeConsumePay) { + this.freeConsumePay = freeConsumePay; + } + + public BigDecimal getConsumePay() { + return consumePay; + } + + public void setConsumePay(BigDecimal consumePay) { + this.consumePay = consumePay; + } + + public BigDecimal getRefundCashPay() { + return refundCashPay; + } + + public void setRefundCashPay(BigDecimal refundCashPay) { + this.refundCashPay = refundCashPay; + } + + public BigDecimal getRefundCardPay() { + return refundCardPay; + } + + public void setRefundCardPay(BigDecimal refundCardPay) { + this.refundCardPay = refundCardPay; + } + + public BigDecimal getProductAchieve() { + return productAchieve; + } + + public void setProductAchieve(BigDecimal productAchieve) { + this.productAchieve = productAchieve; + } + + public BigDecimal getCardAchieve() { + return cardAchieve; + } + + public void setCardAchieve(BigDecimal cardAchieve) { + this.cardAchieve = cardAchieve; + } + + public BigDecimal getRefund() { + return refund; + } + + public void setRefund(BigDecimal refund) { + this.refund = refund; + } + + public BigDecimal getPerCustomCnt() { + return perCustomCnt; + } + + public void setPerCustomCnt(BigDecimal perCustomCnt) { + this.perCustomCnt = perCustomCnt; + } + + public BigDecimal getCustomGoodsCnt() { + if (BigDecimal.ZERO.compareTo(perCustomCnt) != 0) { + return new BigDecimal(totalSaleCnt).divide(perCustomCnt, 2, BigDecimal.ROUND_DOWN); + } else { + return BigDecimal.ZERO; + } + } + + public void setCustomGoodsCnt(BigDecimal customGoodsCnt) { + this.customGoodsCnt = customGoodsCnt; + } + + public BigDecimal getPerCustomPrice() { + if (perCustomCnt.compareTo(BigDecimal.ZERO) != 0) { + return totalPay.divide(perCustomCnt, 2, BigDecimal.ROUND_DOWN); + } else { + return BigDecimal.ZERO; + } + } + + public void setPerCustomPrice(BigDecimal perCustomPrice) { + this.perCustomPrice = perCustomPrice; + } + + public BigDecimal getCost() { + return goodsCost.add(otherCost); + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public BigDecimal getGrossProfit() { + return totalPay.subtract(getCost()); + } + + public void setGrossProfit(BigDecimal grossProfit) { + this.grossProfit = grossProfit; + } + + public BigDecimal getGrossProfitRate() { + if (totalPay.compareTo(BigDecimal.ZERO) != 0) { + return getGrossProfit().divide(totalPay, 2, BigDecimal.ROUND_DOWN); + } else { + return BigDecimal.ZERO; + } + } + + public void setGrossProfitRate(BigDecimal grossProfitRate) { + this.grossProfitRate = grossProfitRate; + } + + public BigDecimal getPeopleCnt() { + return peopleCnt; + } + + public void setPeopleCnt(BigDecimal peopleCnt) { + this.peopleCnt = peopleCnt; + } + + public BigDecimal getProjConsumeCnt() { + return projConsumeCnt; + } + + public void setProjConsumeCnt(BigDecimal projConsumeCnt) { + this.projConsumeCnt = projConsumeCnt; + } + + public BigDecimal getTimeLength() { + return timeLength; + } + + public void setTimeLength(BigDecimal timeLength) { + this.timeLength = timeLength; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java new file mode 100644 index 0000000..c77023d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java @@ -0,0 +1,138 @@ +package com.matrix.system.hive.statistics; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.excl.ExcelSheetPO; +import com.matrix.core.tools.excl.ExcelUtil; +import com.matrix.core.tools.excl.ExcelVersion; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.dao.SysOrderFlowDao; +import com.matrix.system.hive.dto.OrderFlowListDto; +import com.matrix.system.hive.vo.OrderFlowVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 交易流水统计 + */ +@CrossOrigin(origins = "*") +@Api(value = "OrderFlowAction", tags = "交易流水") +@RestController +@RequestMapping(value = "/admin/orderFlow") +public class OrderFlowAction { + + @Resource + private SysOrderFlowDao orderFlowDao; + /** + * 交易流水查询 + */ + + @ApiOperation(value = "查询交易流水") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = OrderFlowListDto.class) + }) + @PostMapping(value = "/findOrderFlow") + public @ResponseBody + AjaxResult findOrderFlow(@RequestBody OrderFlowListDto orderFlowListDto) { + if(StringUtils.isBlank(orderFlowListDto.getSort())){ + orderFlowListDto.setSort("createTime"); + orderFlowListDto.setOrder("desc"); + } + if (!DataAuthUtil.hasAllShopAuth()) { + QueryUtil.setQueryLimit(orderFlowListDto); + } else { + QueryUtil.setQueryLimitCom(orderFlowListDto); + } + List<OrderFlowVo> rows = orderFlowDao.selectInPage(orderFlowListDto); + Integer total = orderFlowDao.selectTotal(orderFlowListDto); + AjaxResult result = AjaxResult.buildSuccessInstance(rows, total); + return result; + } + + /** + * 导出Excel + */ + @GetMapping(value = "/exportOrderFlowExcel") + public void exportOrderFlowExcel(OrderFlowListDto orderFlowListDto, HttpServletResponse res) { + OutputStream os = null; + try { + if (!DataAuthUtil.hasAllShopAuth()) { + QueryUtil.setQueryLimit(orderFlowListDto); + } else { + QueryUtil.setQueryLimitCom(orderFlowListDto); + } + orderFlowListDto.setLimit(null); + List<OrderFlowVo> rows = orderFlowDao.selectInPage(orderFlowListDto); + res.setCharacterEncoding("UTF-8"); + res.setHeader("content-type", "application/octet-stream;charset=UTF-8"); + res.setContentType("application/octet-stream;charset=UTF-8"); + + Date date = new Date(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss"); + res.setHeader("Content-Disposition", "attachment;filename=" + + java.net.URLEncoder.encode("交易流水" + dateFormat.format(date) + ".xlsx".trim(), "UTF-8")); + os = res.getOutputStream(); + ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, disPoseExcelData(rows), os, true); + } catch (Exception e) { + LogUtil.error("交易流水导出异常", e); + } finally { + if (os != null) { + try { + os.close(); + } catch (IOException e) { + LogUtil.error("关闭资源异常", e); + } + } + } + } + + private List<ExcelSheetPO> disPoseExcelData(List<OrderFlowVo> orderFlowVos) { + List<ExcelSheetPO> res = new ArrayList<>(); + ExcelSheetPO orderSheet = new ExcelSheetPO(); + orderSheet.setSheetName("交易流水"); + orderSheet.setTitle("交易流水"); + String[] header = new String[]{"订单编号", "交易内容", "交易时间", "交易类型", "交易金额", "会员姓名", + "支付方式","储值卡名称", "支付流水号", "操作人", "门店名称"}; + orderSheet.setHeaders(header); + List<List<Object>> body = new ArrayList<>(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); + for (OrderFlowVo flowVo : orderFlowVos) { + List<Object> bodyItem = new ArrayList<>(); + bodyItem.add(flowVo.getOrderNo()); + bodyItem.add(flowVo.getFlowContent()); + bodyItem.add(DateUtil.dateFormatStr(flowVo.getCreateTime(),DateUtil.DATE_FORMAT_MM)); + bodyItem.add(flowVo.getFlowType()); + bodyItem.add(flowVo.getAmount()); + bodyItem.add(flowVo.getVipName()); + bodyItem.add(flowVo.getPayMethod()); + bodyItem.add(flowVo.getCardName()); + bodyItem.add(flowVo.getFlowNo()); + bodyItem.add(flowVo.getStaffName()); + bodyItem.add(flowVo.getShopName()); + body.add(bodyItem); + } + orderSheet.setDataList(body); + res.add(orderSheet); + return res; + } + + + + +} + diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java index 162b40c..5439672 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java @@ -2,9 +2,13 @@ import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.WebUtil; +import com.matrix.core.tools.excl.ExcelSheetPO; +import com.matrix.core.tools.excl.ExcelVersion; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.hive.dao.SysOrderItemDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -12,6 +16,11 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.servlet.http.HttpServletResponse; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.Map; /** @@ -31,28 +40,83 @@ */ @RequestMapping(value = "/showList") public @ResponseBody - AjaxResult showList( @RequestParam Map<String , Object> param) { + AjaxResult showList(@RequestParam Map<String, Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } return AjaxResult.buildSuccessInstance(orderItemDao.selectItemDetail(param), orderItemDao.selectItemDetailTotal(param)); } + @RequestMapping(value = "/exportShowList") + public void exportShowList(@RequestParam Map<String, Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "产品销售明细统计"; + String[] header = {"门店", "销售日期", "订单号", "商品名称", "分类", "客户名", "购买数量", "单价","小计", "健康顾问", "支付方式", "状态"}; + String[] column = {"SHOP_NAME", "pay_time", "ORDER_NO", "goodsName", "cateName", "VIP_NAME", "COUNT", "ZK_PRICE", "total","su_name", "pay_method", "statu"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = orderItemDao.selectItemDetail(param); + exportExcel(title, header,column, dataList, response); + } + /** * 产品销售明细统计 */ @RequestMapping(value = "/summaryItemDetail") public @ResponseBody - AjaxResult summaryItemDetail( @RequestParam Map<String , Object> param) { + AjaxResult summaryItemDetail(@RequestParam Map<String, Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } return AjaxResult.buildSuccessInstance(orderItemDao.summaryItemDetail(param), orderItemDao.summaryItemDetailTotal(param)); } + @RequestMapping(value = "/exportSummaryItemDetail") + public void exportSummaryItemDetail(@RequestParam Map<String, Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "产品销售明细统计"; + String[] header = {"门店", "商品名称", "分类", "销售数量", "销售总额"}; + String[] column = {"SHOP_NAME", "goodsName", "cateName", "COUNT", "ZK_PRICE"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = orderItemDao.summaryItemDetail(param); + exportExcel(title, header,column, dataList, response); + } + + + public static void exportExcel(String title, String[] header,String[] column, List<Map<String, Object>> dataList, HttpServletResponse response) throws Exception { + //这里是从数据库里查数据并组装成我们想要的数据结构的过程 + List<ExcelSheetPO> res = new ArrayList<>(); + ExcelSheetPO orderSheet = new ExcelSheetPO(); + orderSheet.setSheetName(title); + orderSheet.setTitle(title); + orderSheet.setHeaders(header); + List<List<Object>> list = new ArrayList<>(); + if (dataList.size() > 0) { + for (Map<String, Object> item : dataList) { + List<Object> temp = new ArrayList<>(); + Arrays.stream(column).forEach(key-> temp.add(item.get(key))); + list.add(temp); + } + } + orderSheet.setDataList(list); + res.add(orderSheet); + response = ResponseHeadUtil.setExcelHead(response); + response.setHeader("Content-Disposition", + "attachment;filename=" + java.net.URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8")); + OutputStream os = response.getOutputStream(); + com.matrix.core.tools.excl.ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); + } + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/ProjUseStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/ProjUseStatisticsAction.java index 8c6133c..75a215f 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/ProjUseStatisticsAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/ProjUseStatisticsAction.java @@ -4,7 +4,7 @@ import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.dao.SysProjUseDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.servlet.http.HttpServletResponse; +import java.util.List; import java.util.Map; /** @@ -33,12 +35,29 @@ public @ResponseBody AjaxResult showList( @RequestParam Map<String , Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } return AjaxResult.buildSuccessInstance(projUseDao.selectItemDetail(param), projUseDao.selectItemDetailTotal(param)); } + + @RequestMapping(value = "/exportShowList") + public void exportShowList( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "项目剩余次数明细"; + String[] header = {"客户名", "客户所属门店", "服务名称", "到期日期", "剩余次数", "单价", "项目类型", "套餐类型", "是否使用完成", "备注", "来源", "订单号"}; + String[] column = {"VIP_NAME", "SHOP_NAME", "PROJ_NAME", "FAIL_TIME", "SURPLUS_COUNT", "PRICE", "TYPE_NAME", "type", "IS_OVER", "remark", "SOURCE", "ORDER_NO"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = projUseDao.selectItemDetail(param); + OrderStatisticsAction.exportExcel(title, header,column, dataList, response); + } + + + /** * 项目剩余次数统计 @@ -47,12 +66,26 @@ public @ResponseBody AjaxResult summaryItemDetail( @RequestParam Map<String , Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } return AjaxResult.buildSuccessInstance(projUseDao.summaryItemDetail(param), projUseDao.summaryItemDetailTotal(param)); } + @RequestMapping(value = "/exportSummaryItemDetail") + public void exportSummaryItemDetail( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "项目剩余次数统计"; + String[] header = {"服务名称", "项目类型", "剩余次数", "剩余消耗总额"}; + String[] column = {"PROJ_NAME", "TYPE_NAME", "SURPLUS_COUNT", "PRICE"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = projUseDao.summaryItemDetail(param); + OrderStatisticsAction.exportExcel(title, header,column, dataList, response); + } + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/ServiceStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/ServiceStatisticsAction.java index 532662d..f77a707 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/ServiceStatisticsAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/ServiceStatisticsAction.java @@ -4,7 +4,7 @@ import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.dao.SysBeauticianStateDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.servlet.http.HttpServletResponse; +import java.util.List; import java.util.Map; /** @@ -33,12 +35,29 @@ public @ResponseBody AjaxResult showList( @RequestParam Map<String , Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } + return AjaxResult.buildSuccessInstance(beauticianStateDao.selectItemDetail(param), beauticianStateDao.selectItemDetailTotal(param)); } + + + @RequestMapping(value = "/exportShowList") + public void exportShowList( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "项目服务明细"; + String[] header = {"门店", "预约时间","划扣时间","服务单号","服务名称","分类","客户名","次数","划扣单价","提成","美疗师","来源"}; + String[] column = {"SHOP_NAME", "yy_time", "consume_time", "SERVICE_NO", "PROJ_NAME", "TYPE_NAME", "VIP_NAME", "COUNT", "PRICE", "extract", "su_name", "SOURCE"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = beauticianStateDao.selectItemDetail(param); + OrderStatisticsAction.exportExcel(title, header,column, dataList, response); + } + /** * 项目服务明细统计 @@ -47,12 +66,27 @@ public @ResponseBody AjaxResult summaryItemDetail( @RequestParam Map<String , Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } return AjaxResult.buildSuccessInstance(beauticianStateDao.summaryItemDetail(param), beauticianStateDao.summaryItemDetailTotal(param)); } + @RequestMapping(value = "/exportSummaryItemDetail") + public void exportSummaryItemDetail( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "项目服务明细统计"; + String[] header = {"门店", "服务名称","分类","总次数","消耗金额"}; + String[] column = {"SHOP_NAME", "PROJ_NAME", "TYPE_NAME", "COUNT", "PRICE"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = beauticianStateDao.summaryItemDetail(param); + OrderStatisticsAction.exportExcel(title, header,column, dataList, response); + } + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/StatisticsBusinessDataJob.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/StatisticsBusinessDataJob.java index 3d537da..257600e 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/StatisticsBusinessDataJob.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/StatisticsBusinessDataJob.java @@ -18,11 +18,9 @@ import static com.matrix.system.hive.statistics.BusinessDataTypeEnum.*; /** - * 定时任务测试类 + * 业绩统计报表定时任务 * - * @author zhangheng - * @email 512061637@qq.com - * @date 2019年1月15日 + * @author jyy */ @Component public class StatisticsBusinessDataJob { @@ -48,7 +46,7 @@ */ public boolean executeExt2() { - Date today = DateUtil.stringToDate("2020-11-01",DateUtil.DATE_FORMAT_DD); + Date today = DateUtil.stringToDate("2020-11-27",DateUtil.DATE_FORMAT_DD); Date now=new Date(); while (DateUtil.isBeforeDate(now,today)){ LogUtil.info("日期:"+DateUtil.dateFormatStr(today,DateUtil.DATE_FORMAT_DD)); @@ -72,14 +70,14 @@ } - @Scheduled(cron = "0 0 0 1/1 * ?") + @Scheduled(cron = "1 0 0 1/1 * ?") public boolean executeExt() { LogUtil.info("业绩统计定时任务开始运行*******************"); Date today = new Date(); SysBusinessData sysBusinessData = new SysBusinessData(); - sysBusinessData.setTime(today); + sysBusinessData.setTime(DateUtil.getDateBefore(today,1)); businessDataDao.deleteByModel(sysBusinessData); List<SysShopInfo> sysShopInfos = shopInfoDao.selectShopInfo(null); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java index 1cd802f..a0e5f4f 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java @@ -1,17 +1,27 @@ package com.matrix.system.hive.statistics; +import cn.hutool.core.util.StrUtil; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.BusinessesDto; +import com.matrix.system.app.vo.BusinessesDataShowVo; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.bean.SysBusinessData; import com.matrix.system.hive.dao.SysBusinessDataDao; +import com.matrix.system.hiveErp.analysUtil.StatisticsTimeDaoParam; +import com.matrix.system.hiveErp.analysUtil.StatisticsTimeUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; import java.util.List; /** @@ -33,7 +43,7 @@ public @ResponseBody AjaxResult showList(BusinessDataShowVo businessDataShowVo, PaginationVO pageVo) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { businessDataShowVo.setShopId(sysUsers.getShopId()+""); } pageVo.setSort("createTime"); @@ -44,5 +54,96 @@ return result; } + /** + * 日销售汇总 + * + * @param dailySaleVo + * @param pageVo + * @return + */ + @RequestMapping(value = "/findDailySaleData") + @ResponseBody + public AjaxResult findDailySaleData(DailySaleVo dailySaleVo, PaginationVO pageVo) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Calendar calendar = Calendar.getInstance(); + int total = 999; + + Date endDate = new Date(); + if (dailySaleVo.getEndTime() != null) { + if (!dailySaleVo.getEndTime().after(new Date())) { + calendar.setTime(dailySaleVo.getEndTime()); + endDate = DateUtil.nextNDate(dailySaleVo.getEndTime(), 1); + } + } + + calendar.add(Calendar.DATE, 1); + calendar.add(Calendar.DATE, -pageVo.getOffset()); + String endTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + calendar.add(Calendar.DATE, -pageVo.getLimit()); + String startTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + + if (dailySaleVo.getBeginTime() != null) { + Date startDate = DateUtil.stringToDate(startTime, DateUtil.DATE_FORMAT_DD); + if(dailySaleVo.getBeginTime().after(startDate)) { + startTime = DateUtil.dateFormatStr(dailySaleVo.getBeginTime(), DateUtil.DATE_FORMAT_DD); + } + long sub = DateUtil.getTimeSpan(dailySaleVo.getBeginTime(), endDate, null); + Long l = sub / (1000 * 3600 * 24); + total = l.intValue(); + } + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(startTime, endTime, "日"); + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + List<StatisticsTimeDaoParam> statisticsTimeDaoParams = timeSpaceParam.subList(0, timeSpaceParam.size() - 2); + + if (dailySaleVo.getShopId() == null) { + dailySaleVo.setShopId(user.getShopId()); + } + List<DailySaleVo> dailySaleVos = sysBusinessDataDao.selectDailySaleData(statisticsTimeDaoParams, dailySaleVo.getShopId()); + List<DailySaleVo> result = new ArrayList<>(); + for (int i = dailySaleVos.size() - 1; i >= 0; i--) { + result.add(dailySaleVos.get(i)); + } + return AjaxResult.buildSuccessInstance(result, total); + } + + @RequestMapping(value = "/findShopBusinessesData") + @ResponseBody + public AjaxResult findShopBusinessesData(BusinessDataShowVo businessDataShowVo, PaginationVO pageVo) { + int start = pageVo.getOffset(); + int size = pageVo.getLimit(); + int calenderUnit = Calendar.DATE; + Long shopId = null; + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + + if (StrUtil.isNotBlank(businessDataShowVo.getShopId())) { + shopId = Long.parseLong(businessDataShowVo.getShopId()); + } else { + shopId = sysUsers.getShopId(); + } + Calendar calendar = Calendar.getInstance(); + if (businessDataShowVo.getBeginTime() != null) { + calendar.setTime(businessDataShowVo.getBeginTime()); + } + calendar.add(calenderUnit, 1); + calendar.add(calenderUnit, -start); + String endTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + calendar.add(calenderUnit, -size); + String startTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(startTime, endTime, "日"); + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + List<StatisticsTimeDaoParam> statisticsTimeDaoParams = timeSpaceParam.subList(0, timeSpaceParam.size() - 2); + List<BusinessesDataShowVo> list = sysBusinessDataDao.selectApiBusinessData(statisticsTimeDaoParams, shopId, sysUsers.getCompanyId()); + + + List<BusinessesDataShowVo> result = new ArrayList<>(); + for (int i = list.size() - 1; i >= 0; i--) { + BusinessesDataShowVo item = list.get(i); + String dataTime = item.getDataTime(); + item.setDataTime(DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.DATE_FORMAT_DD), DateUtil.DATE_FORMAT_DD)); + result.add(item); + } + return AjaxResult.buildSuccessInstance(result, 100); + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java new file mode 100644 index 0000000..94aad6a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java @@ -0,0 +1,60 @@ +package com.matrix.system.hive.statistics; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.service.AchieveNewService; +import com.matrix.system.hive.service.SysVipInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; +import java.util.Map; + +/** + * 客户数据统计 + * + * @author wzy + * @date 2020-12-18 + **/ +@Controller +@RequestMapping(value = "/admin/vipStatistics") +public class VipStatisticsAction { + + @Autowired + private AchieveNewService achieveNewService; + + @Autowired + private SysVipInfoService sysVipInfoService; + + @RequestMapping(value = "/vipConsumeStatistics") + @ResponseBody + public AjaxResult vipConsumeStatistics(AchieveNew achieveNew, PaginationVO pageVo) { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + if (!DataAuthUtil.hasAllShopAuth()) { + achieveNew.setShopId(sysUsers.getShopId()); + } + List<Map<String, Object>> list = achieveNewService.findVipConsumeStatisticsList(achieveNew, pageVo); + int total = achieveNewService.findVipConsumeStatisticsTotal(achieveNew); + return AjaxResult.buildSuccessInstance(list, total); + } + + @RequestMapping(value = "/vipArrearsStatistics") + @ResponseBody + public AjaxResult vipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo) { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + if (!DataAuthUtil.hasAllShopAuth()) { + sysVipInfo.setShopId(sysUsers.getShopId()); + } + + int total = sysVipInfoService.findVipArrearsStatisticsTotal(sysVipInfo); + return AjaxResult.buildSuccessInstance(sysVipInfoService.findVipArrearsStatistics(sysVipInfo, pageVo), total); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/moneyCardUseStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/moneyCardUseStatisticsAction.java index 51305d5..cab77c6 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/moneyCardUseStatisticsAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/moneyCardUseStatisticsAction.java @@ -4,7 +4,7 @@ import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.dao.MoneyCardUseDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.servlet.http.HttpServletResponse; +import java.util.List; import java.util.Map; /** @@ -33,11 +35,25 @@ public @ResponseBody AjaxResult showList( @RequestParam Map<String , Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } return AjaxResult.buildSuccessInstance(moneyCardUseDao.selectItemDetail(param), moneyCardUseDao.selectItemDetailTotal(param)); + } + + @RequestMapping(value = "/exportShowList") + public void exportShowList( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "客户充值卡明细"; + String[] header = {"客户名", "充值卡名称","到期日期","剩余本金","剩余赠送金额","是否使用完成","是否为会籍卡","备注","来源","订单号"}; + String[] column = {"VIP_NAME", "card_name","FAIL_TIME","real_money","gift_money","isOver","is_vip_car","remark","SOURCE","ORDER_NO"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = moneyCardUseDao.selectItemDetail(param); + OrderStatisticsAction.exportExcel(title, header,column, dataList, response); } /** @@ -47,12 +63,26 @@ public @ResponseBody AjaxResult summaryItemDetail( @RequestParam Map<String , Object> param) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ - param.put("shopId",sysUsers.getShopId()); + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); } return AjaxResult.buildSuccessInstance(moneyCardUseDao.summaryItemDetail(param), moneyCardUseDao.summaryItemDetailTotal(param)); } + @RequestMapping(value = "/exportSummaryItemDetail") + public void exportSummaryItemDetail( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + String title = "客户充值卡统计"; + String[] header = {"充值卡名称", "剩余总本金", "剩余总赠送金额"}; + String[] column = {"card_name", "real_money", "gift_money"}; + + if(!DataAuthUtil.hasAllShopAuth()){ + param.put("shopId", sysUsers.getShopId()); + } + List<Map<String, Object>> dataList = moneyCardUseDao.summaryItemDetail(param); + OrderStatisticsAction.exportExcel(title, header,column, dataList, response); + } + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/vo/AchieveNewStatisticsVo.java b/zq-erp/src/main/java/com/matrix/system/hive/vo/AchieveNewStatisticsVo.java new file mode 100644 index 0000000..b48a597 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/vo/AchieveNewStatisticsVo.java @@ -0,0 +1,42 @@ +package com.matrix.system.hive.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class AchieveNewStatisticsVo { + //规则名称 + String ruleName; + //业绩归属人 + String guwen; + //业绩归属人id + Long gwid; + //订单创建人 + String createBy; + //创建人id + Long createId; + //订单金额 + BigDecimal zkTotal; + //消耗金额 + BigDecimal hisConsume; + //赠送消耗 + BigDecimal freeConsume; + //项目提成 + BigDecimal projPercentage; + // 人头数 + Double numberOfPeople; + //项目数 + Double projNum; + //项目时长 + Integer projTime; + //现金支付 + BigDecimal goodsCash; + //卡项支付 + BigDecimal cardCash; + //门店名称 + String shopName; + //订单类型 + String orderType; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/vo/BjOrderVo.java b/zq-erp/src/main/java/com/matrix/system/hive/vo/BjOrderVo.java new file mode 100644 index 0000000..3128721 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/vo/BjOrderVo.java @@ -0,0 +1,13 @@ +package com.matrix.system.hive.vo; + +import lombok.Data; + +/** + * 补交订单费用vo + */ +@Data +public class BjOrderVo { + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/vo/DailyBeautyListVo.java b/zq-erp/src/main/java/com/matrix/system/hive/vo/DailyBeautyListVo.java new file mode 100644 index 0000000..37a969d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/vo/DailyBeautyListVo.java @@ -0,0 +1,50 @@ +package com.matrix.system.hive.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class DailyBeautyListVo { + + @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") + private Date datatime; + + private String beautyName; + + private String vipName; + + private Long vipId; + + private int isAppoint; + + private String arrivalWay; + + private int orderCnt; + + private int arriveCnt; + + private String payMethods; + + private BigDecimal teamPay; + + private BigDecimal tcAndProjCash; + + private BigDecimal productCash; + + private BigDecimal cardCash; + + private BigDecimal cardPay; + + private BigDecimal cashPay; + + private BigDecimal consume; + + private Integer projCnt; + + private BigDecimal ticheng; + + private String projInfo; +} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java b/zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java new file mode 100644 index 0000000..2a0c4f4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java @@ -0,0 +1,60 @@ +package com.matrix.system.hive.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author jyy + * @date 2021-01-27 + **/ +@Data +@ApiModel(value = "OrderFlowVo", description = "订单流水返回参数类") +public class OrderFlowVo { + + @ApiModelProperty(value = "流水id") + private Long id; + + @ApiModelProperty(value = "订单ID") + private String orderId; + + @ApiModelProperty(value = "订单号") + private String orderNo; + + @ApiModelProperty(value = "交易类型") + private String flowType; + + @ApiModelProperty(value = "支付方式") + private String payMethod; + + @ApiModelProperty(value = "会员姓名") + private String vipName; + + @ApiModelProperty(value = "交易内容") + private String flowContent; + + @ApiModelProperty(value = "交易金额") + private BigDecimal amount; + + @ApiModelProperty(value = "操作人姓名") + private String staffName; + + @ApiModelProperty(value = "支付流水号") + private String flowNo; + + @ApiModelProperty(value = "门店名称") + private String shopName; + + @ApiModelProperty(value = "支付卡名称") + private String cardName; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_SS, timezone = "GMT+8") + @ApiModelProperty(value = "创建时间") + private Date createTime; +} + diff --git a/zq-erp/src/main/java/com/matrix/system/hive/vo/ServiceOrderInfoVo.java b/zq-erp/src/main/java/com/matrix/system/hive/vo/ServiceOrderInfoVo.java new file mode 100644 index 0000000..a43e901 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/vo/ServiceOrderInfoVo.java @@ -0,0 +1,69 @@ +package com.matrix.system.hive.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * 简单服务单信息展示对象不含明细 + */ +@Data +public class ServiceOrderInfoVo { + + /** + * id + */ + private Long id; + + /** + * 编号 + */ + private String serviceNo; + + /** + * 服务单金额 + */ + private Double money; + /** + * 预约时间 + */ + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) + private Date yyTime; + + /** + * 订单创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date createTime; + /** + * 订单划扣时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date consumeTime; + + /** + * 开始时间 + */ + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) + private Date startTime; + /** + * 结束时间 + */ + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) + private Date endTime; + /** + * 超时时间 + */ + private String isOverTime; + + /** + * 服务状态 0.待预约 1.预约失败,2预约成功待处理,3需配料,4配料中,5配料完成,6,服务中,7服务完成 + */ + private String state; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/AchieveRuleAction.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/AchieveRuleAction.java new file mode 100644 index 0000000..ee9deaf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/AchieveRuleAction.java @@ -0,0 +1,129 @@ +package com.matrix.system.hiveErp.action; + +import cn.hutool.core.date.DateTime; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.BasePageQueryDto; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.SysUsersDao; +import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.hive.bean.AchieveRule; +import com.matrix.system.hive.dao.AchieveRuleDao; +import com.matrix.system.hiveErp.pojo.AchieveRuleItem; +import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 业绩规则Api + * + * @author jiangyouyao + * @date 2021-06-03 + **/ +@RestController +@AllArgsConstructor +@RequestMapping(value = "/admin/achieveRule") +public class AchieveRuleAction { + + private AchieveRuleDao achieveRuleDao; + + + private SysUsersDao sysUsersDao; + + + /** + * 新增业绩规则 + * @param achieveRule + * @return + */ + @PostMapping("/add") + public AjaxResult add(@RequestBody @Validated AchieveRule achieveRule) { + + + + String rules = JSONUtil.toJsonStr(achieveRule.getRuleItemList()); + achieveRule.setRules(rules); + + QueryUtil.setQueryLimitCom(achieveRule); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + achieveRule.setCreateTime(DateTime.now()); + achieveRule.setUpdateTime(DateTime.now()); + achieveRule.setCreateBy(user.getSuName()); + achieveRule.setUpdateBy(user.getSuName()); + achieveRuleDao.insert(achieveRule); + return AjaxResult.buildSuccessInstance("新增成功"); + } + + /** + * 修改业绩规则 + * + * @param achieveRule + * @return + */ + @PostMapping("/update") + public AjaxResult update(@RequestBody @Validated AchieveRule achieveRule) { + + if (achieveRule.getId() == null) { + return AjaxResult.buildFailInstance("id不能为空"); + } + + String rules = JSONUtil.toJsonStr(achieveRule.getRuleItemList()); + achieveRule.setRules(rules); + + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + achieveRule.setUpdateBy(user.getSuName()); + achieveRule.setUpdateTime(DateTime.now()); + achieveRuleDao.updateById(achieveRule); + return AjaxResult.buildSuccessInstance("修改成功"); + } + + /** + * 删除id + * + * @param id + * @return + */ + @GetMapping("/removeById/{id}") + public AjaxResult removeById(@PathVariable Long id) { + achieveRuleDao.deleteById(id); + return AjaxResult.buildSuccessInstance("删除成功"); + } + + + /** + * 分页查询规则 + * + * @param pageDto + * @return + */ + @PostMapping("/selectList") + public AjaxResult selectList(@RequestBody BasePageQueryDto pageDto) { + + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Page<AchieveRule> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); + LambdaQueryWrapper<AchieveRule> lambdaQueryWrapper = new LambdaQueryWrapper<AchieveRule>() + .eq(AchieveRule::getCompanyId, user.getCompanyId()); + if (StringUtils.isNotBlank(pageDto.getKeywords())) { + lambdaQueryWrapper.like(AchieveRule::getName, pageDto.getKeywords()); + } + IPage<AchieveRule> achieveRuleIPage = achieveRuleDao.selectPage(page, lambdaQueryWrapper); + achieveRuleIPage.getRecords().stream().forEach(item->{ + item.setRuleItemList(JSONUtil.toList(JSONUtil.parseArray(item.getRules()), AchieveRuleItem.class)); + item.setRules(null); + }); + + AjaxResult result = AjaxResult.buildSuccessInstance(achieveRuleIPage.getRecords(), achieveRuleIPage.getTotal()); + return result; + } + + @PostMapping("/selectListForm") + public AjaxResult selectListForm(BasePageQueryDto pageDto) { + return selectList(pageDto); + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/DataAnalysisCustomer.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/DataAnalysisCustomer.java index 69a4dc0..5fc7ecb 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/DataAnalysisCustomer.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/DataAnalysisCustomer.java @@ -1,5 +1,6 @@ package com.matrix.system.hiveErp.action; +import com.matrix.component.redis.RedisClient; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.WebUtil; @@ -7,9 +8,9 @@ import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.service.imp.DataAnalysisCustomerServiceImpl; import com.matrix.system.hiveErp.analysUtil.*; import com.matrix.system.hiveErp.dao.TjVipSumDao; -import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -31,7 +32,8 @@ @Autowired SysShopInfoDao shopInfoDao; - + @Autowired + DataAnalysisCustomerServiceImpl dataAnalysisCustomerService; /** * 会员人头数统计 @@ -43,9 +45,9 @@ */ @RequestMapping(value = "/customerHeadCompare") public @ResponseBody AjaxResult customerHeadCompare(StatisticsParamVo statisticsParam) { - return getAnalysisResult(statisticsParam, new Caculate() { + return dataAnalysisCustomerService.getAnalysisResult(statisticsParam, new Caculate<Integer>() { @Override - public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId) { + public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { //从员工业绩统计表中,按时间段,门店的维度统计人头数 return tjVipSumDao.customerHeadCompare(timeSpaceParam,shopId); } @@ -61,9 +63,9 @@ */ @RequestMapping(value = "/customerEnterCountCompare") public @ResponseBody AjaxResult customerEnterCountCompare(StatisticsParamVo statisticsParam) { - return getAnalysisResult(statisticsParam, new Caculate() { + return dataAnalysisCustomerService.getAnalysisResult(statisticsParam, new Caculate<Integer>() { @Override - public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId) { + public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { //从员工业绩统计表中,按时间段,门店的维度统计人次 return tjVipSumDao.customerEnterCountCompare(timeSpaceParam,shopId); } @@ -80,9 +82,9 @@ */ @RequestMapping(value = "/customerEnterRateCompare") public @ResponseBody AjaxResult customerEnterRateCompare(StatisticsParamVo statisticsParam) { - return getAnalysisResult(statisticsParam, new Caculate() { + return dataAnalysisCustomerService.getAnalysisResult(statisticsParam, new Caculate<Integer>() { @Override - public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId) { + public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam, Long shopId, Long companyId) { //从员工业绩统计表中,按时间段,门店的维度统计人次 return tjVipSumDao.customerEnterRateCompare(timeSpaceParam,shopId); } @@ -93,64 +95,6 @@ - - - /** - * 按店铺查询数据通用格式执行方法,支持时、日、月、年维度 - * 如: A店铺 B店铺 - * 2020-01-01 12 13 - * 2020-02-02 10 11 - * @param statisticsParam 时间条件 - * @param caculate 循环调用caculate计算该店的数据 - * 查询的数据需满足 只有一个门店只有一行 列名称为 t0,t1,t2 - * @return - */ - private AjaxResult getAnalysisResult(StatisticsParamVo statisticsParam, Caculate caculate) { - AjaxResult result = new AjaxResult(); - - //根据计算横坐标 - List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(statisticsParam.getBeginTime(), statisticsParam.getEndTime(), statisticsParam.getStatisticsUnit()); - - //获取所有门店 - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - List<SysShopInfo> shops=null; - if(DataAuthUtil.hasAllShopAuth()){ - shops= shopInfoDao.selectShopInfo(user.getCompanyId()); - }else{ - shops=Arrays.asList(shopInfoDao.selectById(user.getShopId())); - } - //定义数据项内容 - List<SeriesVo> series=new ArrayList<>(); - - //定义数据主体 - String[] legendData=new String[shops.size()]; - - int i=0; - - //按门店统计数据 - List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); - for(SysShopInfo shop: shops){ - - legendData[i++]=shop.getShopName(); - //数据项内容 - SeriesVo storeInfoSeries=new SeriesVo(); - storeInfoSeries.setName(shop.getShopName()); - //调用计算器获取数据库统计的结果 - Map<String, Integer> yAxisMap = caculate.exec(timeSpaceParam,shop.getId()); - //把统计结果转成数组格式 - storeInfoSeries.setData(StatisticsTimeUtil.getSeries(yAxisMap)); - series.add(storeInfoSeries); - - } - //构造返回对象 - Map<Object,Object> data=new HashMap<>(); - data.put("legendData",legendData); - data.put("series",series); - data.put("xAxis", StatisticsTimeUtil.getFormartDateList(xAxis,statisticsParam)); - result.setMapInfo(data); - result.setStatus(AjaxResult.STATUS_SUCCESS); - return result; - } diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpOrderController.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpOrderController.java index 9badbd1..49064d1 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpOrderController.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpOrderController.java @@ -18,7 +18,6 @@ import com.matrix.system.hive.bean.SysOrderItem; import com.matrix.system.hive.dao.SysOrderDao; import com.matrix.system.hive.dao.SysOrderItemDao; -import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.service.AchieveNewService; import com.matrix.system.hive.service.MoneyCardUseService; import com.matrix.system.hive.service.SysOrderItemService; @@ -85,35 +84,27 @@ //=======================================页面转发================================== + /** * 跳转 消费流水详情页面 * * @author jyy */ @RequestMapping(value = "/orderItem") - public String orderItem(Long id, HttpServletRequest request) { - // 根据id查到对应的订单信息 - SysOrder order = orderService.findById(id); - List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(id); - order.setItems(sysOrderItems); + public String orderItem(SysOrder orderVo) { - WebUtil.getRequest().setAttribute("order", order); - // 根据会员Id查到会员有效的会员卡 - // 根据订单号查找订单条目 - SysOrderItem orderItem = new SysOrderItem(); - orderItem.setOrderId(id); - List<SysOrderItem> orderItems = orderItemService.findByModel(orderItem); - WebUtil.getRequest().setAttribute("orderItems", orderItems); - - MoneyCardUse moneyCardUse = new MoneyCardUse(); - moneyCardUse.setVipId(order.getVipId()); - List<MoneyCardUse> cards = cardUseService.findByModel(moneyCardUse); - - WebUtil.getRequest().setAttribute("cards", cards); + if(orderVo.getId()!=null){ + WebUtil.getRequest().setAttribute("orderParam", orderVo.getId()); + WebUtil.getRequest().setAttribute("orderId", orderVo.getId()); + }else if(StringUtils.isNotBlank(orderVo.getOrderNo())){ + WebUtil.getRequest().setAttribute("orderParam", orderVo.getOrderNo()); + WebUtil.getRequest().setAttribute("orderNo", orderVo.getOrderNo()); + } return "admin/hive-erp/order/orderXq-form"; } + /** * 取消订单 */ diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java index 97fdc58..0146ff7 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShopInfoController.java @@ -11,11 +11,12 @@ import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.constance.Dictionary; -import com.matrix.system.constance.SystemConstance; import com.matrix.system.hive.action.BaseController; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.service.SysShopInfoService; +import com.matrix.system.shopXcx.api.WeChatApiTools; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PathVariable; @@ -39,6 +40,9 @@ @Resource private SysShopInfoService shopInfoService; // 店铺Service + + @Autowired + WeChatApiTools weChatApiTools; @RequestMapping(value = "/showList") @ResponseBody @@ -91,7 +95,8 @@ AjaxResult creteSohopQrcode(@PathVariable("shopId") Long shopId) { SysShopInfo shopInfo = shopInfoService.findById(shopId); try { - String qrcodeSavePath = WxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "")); + String qrcodeSavePath = WxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "") + ,weChatApiTools.getAppid(shopInfo.getCompanyId()),weChatApiTools.getSecret(shopInfo.getCompanyId())); LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); // 图片保存目录路径 String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java index e0e3f79..6e78a24 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java @@ -4,6 +4,7 @@ import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelVersion; @@ -66,8 +67,10 @@ @RequestMapping(value = "/showList") public @ResponseBody AjaxResult showList(ShoppingGoods shoppingGoods, PaginationVO pageVo) { - pageVo.setOrder("desc"); - pageVo.setSort("createTime"); + if(StringUtils.isBlank(pageVo.getSort())){ + pageVo.setOrder("desc"); + pageVo.setSort("createTime"); + } QueryUtil.setQueryLimitCom(shoppingGoods); shoppingGoods.setIsDel(ShoppingGoods.NORMAL); List<ShoppingGoods> dataList = shoppingGoodsService.findInPage(shoppingGoods, pageVo); diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpVipInfoController.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpVipInfoController.java index 2b18447..20c9780 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpVipInfoController.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpVipInfoController.java @@ -2,6 +2,7 @@ import com.matrix.core.anotations.RemoveRequestToken; import com.matrix.core.anotations.SaveRequestToken; +import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.DateUtil; @@ -11,24 +12,27 @@ import com.matrix.core.tools.excl.ExcelSheetPO; import com.matrix.core.tools.excl.ExcelUtil; import com.matrix.core.tools.excl.ExcelVersion; -import com.matrix.system.common.bean.SystemDictionary; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.service.SystemDictionaryService; +import com.matrix.system.common.bean.SystemDictionary; import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.common.service.SystemDictionaryService; import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.constance.Dictionary; -import com.matrix.system.constance.SystemConstance; import com.matrix.system.hive.action.BaseController; import com.matrix.system.hive.action.util.QueryUtil; -import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.bean.Question; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.bean.SysVipLevel; +import com.matrix.system.hive.bean.VipAnswer; import com.matrix.system.hive.dao.MoneyCardUseDao; import com.matrix.system.hive.dao.VipAnswerDao; -import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.pojo.RegisterInfo; -import com.matrix.system.hive.service.*; +import com.matrix.system.hive.service.MoneyCardUseService; +import com.matrix.system.hive.service.QuestionSerivce; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.hive.service.SysVipLevelService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -39,10 +43,12 @@ import java.io.IOException; import java.io.OutputStream; import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.net.URLEncoder; import java.security.NoSuchAlgorithmException; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.List; /** @@ -104,48 +110,7 @@ @RequestMapping(value = "/showVipInfo") public @ResponseBody AjaxResult findByModel(String keyWord) { - LinkedList<SysVipInfo> userList = null; - // 获取最近查询客户 - if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { - userList = new LinkedList<SysVipInfo>(); - WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); - } else { - userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); - } List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); - if (vips.size() > 0) { - // 在session存放当前查询的客户 - MoneyCardUse cardUseInfo = cardUseService.findByVipId(vips.get(0).getId()); - if (cardUseInfo == null) { - cardUseInfo = new MoneyCardUse(); - cardUseInfo.setVipId(vips.get(0).getId()); - cardUseInfo.setCardName("储值卡"); - cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); - cardUseInfo.setRealMoney(0D); - cardUseInfo.setGiftMoney(0D); - cardUseInfo.setSource("-"); - cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); - cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); - moneyCardUseDao.insert(cardUseInfo); - } - vips.get(0).setLevelCard(cardUseInfo); - WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); - // 满20后删除一个 - if (userList.size() == 20) { - userList.poll(); - } - // 去重标志 - boolean isNoRepeat = true; - for (SysVipInfo sysVipInfo : userList) { - if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { - isNoRepeat = false; - } - } - if (isNoRepeat) { - userList.add(vips.get(0)); - } - } - return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); } @@ -257,7 +222,8 @@ public @ResponseBody AjaxResult getVipQuestions(Long id, HttpServletRequest request) { // 获取会员所有的答案,分类型 - List<Question> questions = questionSerivce.findByVipId(id); + SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + List<Question> questions=questionSerivce.findByVipId(id,user.getCompanyId()); request.setAttribute("questions", questions); AjaxResult result = new AjaxResult(); result.putInMap("questions", questions); @@ -406,35 +372,8 @@ @RequestMapping(value = "/findUserByPhoneOrNo") public @ResponseBody AjaxResult findUserByPhoneOrNo(String keyWord) { - LinkedList<SysVipInfo> userList = null; - // 获取最近查询客户 - if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { - userList = new LinkedList<SysVipInfo>(); - WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); - } else { - userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); - } List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); - if (vips.size() > 0) { - // 在session存放当前查询的客户 - WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); - // 满20后删除一个 - if (userList.size() == 20) { - userList.poll(); - } - // 去重标志 - boolean isNoRepeat = true; - for (SysVipInfo sysVipInfo : userList) { - if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { - isNoRepeat = false; - } - } - if (isNoRepeat) { - userList.add(vips.get(0)); - } - } return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); - } @RequestMapping(value = "/getBirthday") @@ -460,26 +399,16 @@ } @RequestMapping(value = "/exportExcel") - public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response, + public void report(HttpServletResponse response, SysVipInfo vipInfo) throws IOException { + QueryUtil.setQueryLimitCom(vipInfo ); - if (vipInfo.getVipType() != null && !(vipInfo.getVipType().equals(""))) { - vipInfo.setVipType(URLDecoder.decode(vipInfo.getVipType(), "UTF-8")); - } - if (vipInfo.getVipName() != null && !"".equals(vipInfo.getVipName())) { - vipInfo.setVipName(URLDecoder.decode(vipInfo.getVipName(), "UTF-8")); - } - if (vipInfo.getArrivalWay() != null && !"".equals(vipInfo.getArrivalWay())) { - vipInfo.setArrivalWay(URLDecoder.decode(vipInfo.getArrivalWay(), "UTF-8")); - } - if (vipInfo.getVipState() != null && !"".equals(vipInfo.getVipState())) { - vipInfo.setVipState(URLDecoder.decode(vipInfo.getVipState(), "UTF-8")); - } + List<ExcelSheetPO> res = new ArrayList<>(); ExcelSheetPO orderSheet = new ExcelSheetPO(); - String title = "每日单据明细"; + String title = "会员资料"; orderSheet.setSheetName(title); orderSheet.setTitle(title); String[] header = {"会员编号", "姓名", "性别", "手机号码", "会员类型", "会员活跃度", "到店途径", "健康顾问", "所属门店"}; diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/Caculate.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/Caculate.java index 27e6cdf..193b9d0 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/Caculate.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/Caculate.java @@ -5,6 +5,6 @@ /** * 明细数值计算器 */ -public interface Caculate { - public Map<String, Integer> exec(List<StatisticsTimeDaoParam> timeSpaceParam , Long shopId); +public interface Caculate<T> { + public Map<String, T> exec(List<StatisticsTimeDaoParam> timeSpaceParam , Long shopId, Long companyId); } diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/StatisticsParamVo.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/StatisticsParamVo.java index dba0746..8bd9e7a 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/StatisticsParamVo.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/StatisticsParamVo.java @@ -1,33 +1,62 @@ package com.matrix.system.hiveErp.analysUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + /** * 统计查询条件 * @author jyy */ +@ApiModel(value = "StatisticsParamVo", description = "专项统计接收参数类") public class StatisticsParamVo { + + public static final String COMPANY = "1"; + + public static final String SHOP = "2"; /** * 开始时间 */ + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "开始时间", example = "2020-12-01") private String beginTime; /** *结束时间 */ + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "结束时间", example = "2020-12-31") private String endTime; /** *统计单位 */ + @NotBlank(message = "参数错误") + @ApiModelProperty(value = "统计单位", example = "日") private String statisticsUnit; /** *对比单位 */ + @ApiModelProperty(hidden = true) private String contrastUnit; /** * 门店id */ - private String shopId; + @ApiModelProperty(value = "门店ID, 不传默认统计整个公司") + private Long shopId; + + @ApiModelProperty(value = "类型 1-营业收入 2-现金收入 3-余额划扣 4-本金消耗 5-赠送消耗 6-现金退款 7-卡项退款 8-欠款", example = "1") + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } public String getBeginTime() { return beginTime; @@ -61,11 +90,11 @@ this.contrastUnit = contrastUnit; } - public String getShopId() { + public Long getShopId() { return shopId; } - public void setShopId(String shopId) { + public void setShopId(Long shopId) { this.shopId = shopId; } } diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java index 3e27576..3f1d10e 100644 --- a/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java @@ -1,9 +1,13 @@ package com.matrix.system.hiveErp.dao; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.app.vo.VipAchieveDataShowVo; +import com.matrix.system.hive.bean.AchieveNew; import com.matrix.system.hiveErp.analysUtil.StatisticsTimeDaoParam; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -16,4 +20,96 @@ Map<String, Integer> customerEnterCountCompare(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId); Map<String, Integer> customerEnterRateCompare(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId); + + // 营业收入 + Map<String, BigDecimal> selectBusinessInCome(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 现金收款 + Map<String, BigDecimal> selectCashIncome(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 储值卡收款 + Map<String, BigDecimal> selectCardUse(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 欠款 + Map<String, BigDecimal> selectArrears(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 卡项退款 + Map<String, BigDecimal> selectCardRefund(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 现金退款 + Map<String, BigDecimal> selectCashRefund(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 产品业绩 + Map<String, BigDecimal> selectProductAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 卡项业绩 + Map<String, BigDecimal> selectCardAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 还款 + Map<String, BigDecimal> selectRepayment(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 客单数 + Map<String, BigDecimal> selectPerCustomCnt(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 客品数 + Map<String, BigDecimal> selectCustomGoodsCnt(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 客单价 + Map<String, BigDecimal> selectPerCustomPrice(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 成本 + Map<String, BigDecimal> selectCost(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 毛利 + Map<String, BigDecimal> selectGrossProfit(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 毛利率 + Map<String, BigDecimal> selectGrossProfitRate(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 本金消耗 + Map<String, BigDecimal> selectHisConsume(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 赠送消耗 + Map<String, BigDecimal> selectFreeConsume(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 人头数 + Map<String, BigDecimal> selectPeopleCnt(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 项目消耗数 + Map<String, BigDecimal> selectProjConsumeCnt(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 服务时长 + Map<String, BigDecimal> selectTimeLength(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 储值卡本金扣款 + Map<String, BigDecimal> selectCardAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + // 储值卡赠金扣款 + Map<String, BigDecimal> selectFreeAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); + + List<VipAchieveDataShowVo> selectVipAchieveInPage(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("userId") Long userId); + + // 订单业绩 + Map<String, BigDecimal> selectStaffOrderAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 现金业绩 + Map<String, BigDecimal> selectStaffCashAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 划扣业绩 + Map<String, BigDecimal> selectStaffCardAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 订单提成 + Map<String, BigDecimal> selectStaffGoodsAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 本金消耗 + Map<String, BigDecimal> selectStaffHisConsumeAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 赠送消耗 + Map<String, BigDecimal> selectStaffFreeConsumeAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 服务提成 + Map<String, BigDecimal> selectStaffCommissionAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 人头数目 + Map<String, BigDecimal> selectStaffPeopleNum(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 项目数 + Map<String, BigDecimal> selectStaffProjNum(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + // 服务时长 + Map<String, BigDecimal> selectStaffProjTime(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + + Map<String, BigDecimal> selectStaffCardUseAchieve(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("staffId") Long staffId); + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/pojo/AchieveRuleItem.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/pojo/AchieveRuleItem.java new file mode 100644 index 0000000..8eec4db --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/pojo/AchieveRuleItem.java @@ -0,0 +1,56 @@ +package com.matrix.system.hiveErp.pojo; + +import lombok.Data; + +/** + * 绩效规则明细 + * @author JIANGYOUYAO + * @date 2021/6/3 0003 + */ +@Data +public class AchieveRuleItem { + /** + * 类型,1本金消耗 + */ + public static final int ACHIEVE_TYPE_BJ=1; + /** + * 类型,2赠送消耗 + */ + public static final int ACHIEVE_TYPE_ZS =2; + /** + * 计算类型 1 固定值 + */ + public static final int ACHIEVE_TYPE_FIXED=1; + /** + * 计算类型 2百分比 + */ + public static final int ACHIEVE_TYPE_PERCENTAGE=2; + + + /** + * 类型,1本金消耗,2赠送消耗 + */ + private Integer achieveType; + + /** + * 计算类型 1 固定值,2百分比 + */ + private Integer calculationType; + + /** + * 区间-低 + */ + private Double Lower ; + + /** + * 区间-高 + */ + private Double upper ; + + /** + * 业绩值 + */ + private Double achieve; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java b/zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java new file mode 100644 index 0000000..9a71f5b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java @@ -0,0 +1,41 @@ +package com.matrix.system.job; + +import com.matrix.core.tools.LogUtil; +import com.matrix.system.hive.dao.MoneyCardUseDao; +import com.matrix.system.hive.dao.ShoppingGoodsDao; +import com.matrix.system.hive.dao.SysProjUseDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +/** + * @author wzy19 + */ +@Component +public class InvalidTimeJob { + + @Autowired + private SysProjUseDao sysProjUseDao; + + @Autowired + private MoneyCardUseDao moneyCardUseDao; + + @Autowired + private ShoppingGoodsDao shoppingGoodsDao; + + @Scheduled(cron = "0 0 0 * * ?") + public void setProjUseToInvalid() { + LogUtil.info("#项目,套餐失效任务处理#"); + sysProjUseDao.updateInvalidProjUse(); + moneyCardUseDao.updateInvalidMoneyCardUse(); + } + + + @Scheduled(cron = "0 0 0 * * ?") + public void setProductAutoSoldOut() { + LogUtil.info("#商品自动下架任务处理#"); + shoppingGoodsDao.updateInvalidProduct(); + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/job/ServiceOvertimeNoticeJob.java b/zq-erp/src/main/java/com/matrix/system/job/ServiceOvertimeNoticeJob.java new file mode 100644 index 0000000..e12431a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/job/ServiceOvertimeNoticeJob.java @@ -0,0 +1,59 @@ +package com.matrix.system.job; + +import com.matrix.component.asyncmessage.AsyncMessageManager; +import com.matrix.component.rabbitmq.RabiitMqTemplate; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.dao.SysProjServicesDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import com.matrix.system.wechart.templateMsg.UniformMsgParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 预约服务到时提醒 + * @author 姜友瑶 + */ +@Component +public class ServiceOvertimeNoticeJob { + + @Autowired + private SysProjServicesDao projServicesDao; + + @Value("${evn}") + private String evn; + + + @Autowired + private AsyncMessageManager asyncMessageManager; + /** + * 每分钟执行一次 + */ + @Scheduled(cron = "0/30 * * * * ?") + public void serviceOvertimeNotice() { + + List<SysProjServices> needNoticeService=projServicesDao.selectNeedNoticeService(); + if(CollectionUtils.isNotEmpty(needNoticeService)){ + LogUtil.debug("执行服务单预约到时提醒任务,本次通知对象"+ needNoticeService.stream().map(SysProjServices::getVipName).collect(Collectors.joining(","))); + for(SysProjServices projServices : needNoticeService){ + //发送微信公众号提醒 + UniformMsgParam uniformMsgParam=new UniformMsgParam(projServices.getCompanyId(),UniformMsgParam.GZH_YYDS); + uniformMsgParam.put("serviceId",projServices.getId()); + asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); + } + List<Long> noticedIds = needNoticeService.stream().map(SysProjServices::getId).collect(Collectors.toList()); + projServicesDao.updateNoticeTimes(noticedIds); + }else{ + LogUtil.debug("暂无需要提醒的服务单"); + } + + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/oa/actions/OaFixedAssetsAction.java b/zq-erp/src/main/java/com/matrix/system/oa/actions/OaFixedAssetsAction.java index befc7c8..546bb82 100644 --- a/zq-erp/src/main/java/com/matrix/system/oa/actions/OaFixedAssetsAction.java +++ b/zq-erp/src/main/java/com/matrix/system/oa/actions/OaFixedAssetsAction.java @@ -8,134 +8,193 @@ import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; +import com.matrix.core.tools.excl.ExcelSheetPO; +import com.matrix.core.tools.excl.ExcelUtil; +import com.matrix.core.tools.excl.ExcelVersion; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.oa.bean.OaFixedAssets; import com.matrix.system.oa.dao.OaFixedAssetsDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.ArrayList; import java.util.List; import java.util.Map; /** + * @author * @description 固定资产 - * @author * @date 2019-12-13 07:19 */ @Controller @RequestMapping(value = "admin/oaFixedAssets") public class OaFixedAssetsAction { - @Autowired - private OaFixedAssetsDao oaFixedAssetsDao; - - //记录编辑前的值Before_Edit_Value - public static final String BEV="OaFixedAssets_BEV"; - - - /** - * 列表显示 - */ - @RequestMapping(value = "/showList") - public @ResponseBody AjaxResult showList(OaFixedAssets oaFixedAssets, PaginationVO pageVo) { - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - oaFixedAssets.setCompanyId(user.getCompanyId()); - List<OaFixedAssets> dataList = oaFixedAssetsDao.selectInPage(oaFixedAssets, pageVo); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, - oaFixedAssetsDao.selectTotalRecord(oaFixedAssets)); - return result; - } - - /** - * 新增 - */ - @RemoveRequestToken - @RequestMapping(value = "/addOaFixedAssets") - public @ResponseBody AjaxResult addOaFixedAssets(OaFixedAssets oaFixedAssets) { - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - oaFixedAssets.setCreateBy(user.getSuName()); - oaFixedAssets.setUpdateBy(user.getSuName()); - oaFixedAssets.setCompanyId(user.getCompanyId()); - int i=oaFixedAssetsDao.insert(oaFixedAssets); - if(i > 0){ - return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, "固定资产"); - }else { - throw new GlobleException(SystemErrorCode.DATA_ADD_FAIL); - } - } - - - - - - /** - * 修改 - */ - @RemoveRequestToken - @RequestMapping(value = "/modifyOaFixedAssets") - public @ResponseBody AjaxResult modifyOaFixedAssets(OaFixedAssets newOaFixedAssets) { - OaFixedAssets oldOaFixedAssets = WebUtil.getSessionAttribute(BEV); - int i = 0; - Map<String, Object> modifyMap = null; - try { - if (!ModelUtils.isModified(oldOaFixedAssets, newOaFixedAssets)) { - i = MatrixConstance.DML_SUCCESSS; - } - modifyMap = ModelUtils.comparePojo2Map(oldOaFixedAssets, newOaFixedAssets); - } catch (Exception e) { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newOaFixedAssets); - } - if (modifyMap.size() > 0) { - modifyMap.put("id", oldOaFixedAssets.getId()); - oaFixedAssetsDao.updateByMap(modifyMap); - } - i = MatrixConstance.DML_SUCCESSS; - WebUtil.removeSessionAttribute(BEV); - if (i > 0) { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.UPDATE_SUCCES, "固定资产"); - } else { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL); - } - } - - - - - /** - * 进入修改界面 - */ - @SaveRequestToken - @RequestMapping(value = "/editForm") - public ModelAndView editForm(String id) { - OaFixedAssets oaFixedAssets = new OaFixedAssets(); - ModelAndView modelAndView = new ModelAndView("admin/oa/assets/fixeAssets-form"); - if (id != null) { - oaFixedAssets = oaFixedAssetsDao.selectById(id); - WebUtil.setSessionAttribute(BEV, oaFixedAssets); - } - modelAndView.addObject("obj",oaFixedAssets); - return modelAndView; - } - - - /** - * 删除 - */ - @RequestMapping(value = "/del") - public @ResponseBody AjaxResult del(String keys) { - List<String> ids = StringUtils.strToCollToString(keys, ","); - int i = oaFixedAssetsDao.deleteByIds(ids); - if (i > 0) { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES, i); - } else { - throw new GlobleException(SystemErrorCode.DATA_DELETE_FAIL); - } - } - + @Autowired + private OaFixedAssetsDao oaFixedAssetsDao; + + //记录编辑前的值Before_Edit_Value + public static final String BEV = "OaFixedAssets_BEV"; + + + /** + * 列表显示 + */ + @RequestMapping(value = "/showList") + public @ResponseBody + AjaxResult showList(OaFixedAssets oaFixedAssets, PaginationVO pageVo) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + oaFixedAssets.setCompanyId(user.getCompanyId()); + List<OaFixedAssets> dataList = oaFixedAssetsDao.selectInPage(oaFixedAssets, pageVo); + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, + oaFixedAssetsDao.selectTotalRecord(oaFixedAssets)); + return result; + } + + /** + * 新增 + */ + @RemoveRequestToken + @RequestMapping(value = "/addOaFixedAssets") + public @ResponseBody + AjaxResult addOaFixedAssets(OaFixedAssets oaFixedAssets) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + oaFixedAssets.setCreateBy(user.getSuName()); + oaFixedAssets.setUpdateBy(user.getSuName()); + oaFixedAssets.setCompanyId(user.getCompanyId()); + int i = oaFixedAssetsDao.insert(oaFixedAssets); + if (i > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, "固定资产"); + } else { + throw new GlobleException(SystemErrorCode.DATA_ADD_FAIL); + } + } + + + /** + * 修改 + */ + @RemoveRequestToken + @RequestMapping(value = "/modifyOaFixedAssets") + public @ResponseBody + AjaxResult modifyOaFixedAssets(OaFixedAssets newOaFixedAssets) { + OaFixedAssets oldOaFixedAssets = WebUtil.getSessionAttribute(BEV); + int i = 0; + Map<String, Object> modifyMap = null; + try { + if (!ModelUtils.isModified(oldOaFixedAssets, newOaFixedAssets)) { + i = MatrixConstance.DML_SUCCESSS; + } + modifyMap = ModelUtils.comparePojo2Map(oldOaFixedAssets, newOaFixedAssets); + } catch (Exception e) { + throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newOaFixedAssets); + } + if (modifyMap.size() > 0) { + modifyMap.put("id", oldOaFixedAssets.getId()); + oaFixedAssetsDao.updateByMap(modifyMap); + } + i = MatrixConstance.DML_SUCCESSS; + WebUtil.removeSessionAttribute(BEV); + if (i > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.UPDATE_SUCCES, "固定资产"); + } else { + throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL); + } + } + + + /** + * 进入修改界面 + */ + @SaveRequestToken + @RequestMapping(value = "/editForm") + public ModelAndView editForm(String id) { + OaFixedAssets oaFixedAssets = new OaFixedAssets(); + ModelAndView modelAndView = new ModelAndView("admin/oa/assets/fixeAssets-form"); + if (id != null) { + oaFixedAssets = oaFixedAssetsDao.selectById(id); + WebUtil.setSessionAttribute(BEV, oaFixedAssets); + } + modelAndView.addObject("obj", oaFixedAssets); + return modelAndView; + } + + + /** + * 删除 + */ + @RequestMapping(value = "/del") + public @ResponseBody + AjaxResult del(String keys) { + List<String> ids = StringUtils.strToCollToString(keys, ","); + int i = oaFixedAssetsDao.deleteByIds(ids); + if (i > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES, i); + } else { + throw new GlobleException(SystemErrorCode.DATA_DELETE_FAIL); + } + } + + /** + * 总部导出服务单导出,不限门店 + */ + @RequestMapping(value = "/exportExcel") + public void erpExportExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response, OaFixedAssets oaFixedAssets) throws Exception { + + + doExportServiceOrder(response, oaFixedAssets); + } + + + private void doExportServiceOrder(HttpServletResponse response, OaFixedAssets oaFixedAssets) throws IOException { + + List<ExcelSheetPO> res = new ArrayList<>(); + ExcelSheetPO orderSheet = new ExcelSheetPO(); + String title = "固定资产明细"; + orderSheet.setSheetName(title); + orderSheet.setTitle(title); + String[] header = {"资产类型", "资产编号", "资产型号", "所在部门", "成本价", "数量", "往来单位", "使用人"}; + orderSheet.setHeaders(header); + + List<OaFixedAssets> dataList = oaFixedAssetsDao.selectByModel(oaFixedAssets); + List<List<Object>> list = new ArrayList<>(); + if (dataList.size() > 0) { + for (OaFixedAssets item : dataList) { + List<Object> temp = new ArrayList<>(); + temp.add(item.getAssetsType()); + temp.add(item.getName()); + temp.add(item.getNumber()); + temp.add(item.getModel()); + temp.add(item.getDepartment()); + temp.add(item.getPrice()); + temp.add(item.getCount()); + temp.add(item.getSupplier()); + temp.add(item.getUser()); + list.add(temp); + } + } + orderSheet.setDataList(list); + res.add(orderSheet); + response = ResponseHeadUtil.setExcelHead(response); + response.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8")); + OutputStream os = response.getOutputStream(); + ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); + } + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java new file mode 100644 index 0000000..25a2ee1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java @@ -0,0 +1,133 @@ +package com.matrix.system.score.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.service.ScoreRuleSettingService; +import com.matrix.system.score.vo.ScoreRuleSettingsVo; + +import cn.hutool.core.util.StrUtil; + +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author wzy + * @date 2021-02-22 + **/ +@RestController +@RequestMapping(value = "/score/ruleSetting") +public class ScoreRuleSettingAction { + + @Autowired + private ScoreRuleSettingService scoreRuleSettingService; + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + + /** + *查询积分规则配置 + */ + @RequestMapping(value = "/selectScoreRule") + public AjaxResult selectScoreRule() { + + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + + //积分有效期 + String[] jfyxqArrayCode={ScoreSettingConstant.VALID_PERIOD_POINTS}; + String[] jfyxqArrayName={"积分有效期:从获得开始 到"}; + List<ScoreRuleSettingsVo> jfyxqRuleSettingsVo = getRuleSettingsVo(jfyxqArrayCode,jfyxqArrayName,companyId); + result.putInMap("jfyxq", jfyxqRuleSettingsVo); + //积分抵扣现金 + String[] jfdxjArrayCode={ScoreSettingConstant.CREDIT_POINTS_CASH}; + String[] jfdxjArrayName={"积分抵扣现金"}; + List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(jfdxjArrayCode), companyId); + List<ScoreRuleSettingsVo> jfdxjRuleSettingsVo=new ArrayList<ScoreRuleSettingsVo>(); + int index=0; + for (BusParameterSettings item:dataList){ + ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); + BeanUtils.copyProperties(item,paramVo); + paramVo.setParamName(jfdxjArrayName[index]); + String paramValue = paramVo.getParamValue(); + if(StrUtil.isNotEmpty(paramValue)) { + paramVo.setParamSwitch(Boolean.TRUE); + }else { + paramVo.setParamSwitch(Boolean.FALSE); + } + jfdxjRuleSettingsVo.add(paramVo); + index++; + } + result.putInMap("jfdxj", jfdxjRuleSettingsVo); + //门店积分规则 + String[] mdjfArrayCode={ + ScoreSettingConstant.CASH_CONSUMPTION, + ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, + ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, + ScoreSettingConstant.PRINCIPAL_CONSUMPTION, + ScoreSettingConstant.GIVE_CONSUMPTION, + ScoreSettingConstant.REFERRALS_CONSUMPTION}; + String[] mdjfArrayName={ + "现金消费", + "本金余额消费", + "赠金余额消费", + "本金消耗", + "赠送消耗", + "转介客户"}; + List<ScoreRuleSettingsVo> mdjfRuleSettingsVo = getRuleSettingsVo(mdjfArrayCode,mdjfArrayName,companyId); + result.putInMap("mdjf", mdjfRuleSettingsVo); + //商城积分规则 + String[] scjfArrayCode={ + ScoreSettingConstant.CASH_CONSUMPTION_SHOP, + ScoreSettingConstant.RESERVATION_SERVICE_SHOP, + ScoreSettingConstant.EVALUATUIN_ORDER_SHOP}; + String[] scjfArrayName={ + "现金消费", + "预约服务", + "评价订单"}; + List<ScoreRuleSettingsVo> scjfRuleSettingsVo =getRuleSettingsVo(scjfArrayCode,scjfArrayName,companyId); + result.putInMap("scjf", scjfRuleSettingsVo); + return result; + } + + /** + *获取对应的积分规则设置数据 + * @param ArrayCode + * @param ArrayName + * @param companyId + * @return + */ + private List<ScoreRuleSettingsVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ + List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); + List<ScoreRuleSettingsVo> scoreRuleSettingsVos=new ArrayList<ScoreRuleSettingsVo>(); + int index=0; + for (BusParameterSettings item:dataList){ + ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); + BeanUtils.copyProperties(item,paramVo); + paramVo.setParamName(ArrayName[index]); + scoreRuleSettingsVos.add(paramVo); + index++; + } + return scoreRuleSettingsVos; + } + + /** + * 修改公司维度的积分规则 + */ + @PostMapping(value = "/updateScoreRule") + public @ResponseBody + AjaxResult updateScoreRule(@RequestBody List<BusParameterSettings> busParameterSettings) { + return scoreRuleSettingService.updateScoreRuleByCompanyId(busParameterSettings); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/constant/ScoreSettingConstant.java b/zq-erp/src/main/java/com/matrix/system/score/constant/ScoreSettingConstant.java new file mode 100644 index 0000000..134eeae --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/constant/ScoreSettingConstant.java @@ -0,0 +1,66 @@ +package com.matrix.system.score.constant; + +public class ScoreSettingConstant { + + /** + * 积分有效期 + */ + public final static String VALID_PERIOD_POINTS = "VALID_PERIOD_POINTS"; + public final static String VALID_PERIOD_POINTS_NAME = "积分有效期:从获得开始 到"; + /** + * 积分抵扣现金 + */ + public final static String CREDIT_POINTS_CASH = "CREDIT_POINTS_CASH"; + public final static String CREDIT_POINTS_CASH_NAME = "积分抵扣现金"; + + //门店设置 + /** + * 现金消费 + */ + public final static String CASH_CONSUMPTION = "CASH_CONSUMPTION"; + public final static String CASH_CONSUMPTION_NAME = "现金消费"; + /** + * 本金余额消费 + */ + public final static String PRINCIPAL_BALANCE_CONSUMPTION = "PRINCIPAL_BALANCE_CONSUMPTION"; + public final static String PRINCIPAL_BALANCE_CONSUMPTION_NAME = "本金余额消费"; + /** + * 赠金余额消费 + */ + public final static String BONUS_BALANCE_CONSUMPTION = "BONUS_BALANCE_CONSUMPTION"; + public final static String BONUS_BALANCE_CONSUMPTION_NAME = "赠金余额消费"; + /** + * 本金消耗 + */ + public final static String PRINCIPAL_CONSUMPTION = "PRINCIPAL_CONSUMPTION"; + public final static String PRINCIPAL_CONSUMPTION_NAME = "本金消耗"; + /** + * 赠送消耗 + */ + public final static String GIVE_CONSUMPTION = "GIVE_CONSUMPTION"; + public final static String GIVE_CONSUMPTION_NAME = "赠送消耗"; + /** + * 转介客户 + */ + public final static String REFERRALS_CONSUMPTION = "REFERRALS_CONSUMPTION"; + public final static String REFERRALS_CONSUMPTION_NAME = "转介客户"; + + + //商城设置 + /** + * 现金消费 + */ + public final static String CASH_CONSUMPTION_SHOP = "CASH_CONSUMPTION_SHOP"; + public final static String CASH_CONSUMPTION_SHOP_NAME = "现金消费"; + /** + * 预约服务 + */ + public final static String RESERVATION_SERVICE_SHOP = "RESERVATION_SERVICE_SHOP"; + public final static String RESERVATION_SERVICE_SHOP_NAME = "预约服务"; + /** + * 评价订单 + */ + public final static String EVALUATUIN_ORDER_SHOP = "EVALUATUIN_ORDER_SHOP"; + public final static String EVALUATUIN_ORDER_SHOP_NAME = "评价订单"; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreUseRecordDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreUseRecordDao.java new file mode 100644 index 0000000..dae783a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreUseRecordDao.java @@ -0,0 +1,25 @@ +package com.matrix.system.score.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.score.entity.ScoreUseRecord; +import com.matrix.system.shopXcx.api.dto.ScoreFlowDto; +import com.matrix.system.shopXcx.api.vo.ScoreUseRecordVo; +import org.apache.ibatis.annotations.Param; + +/** + * @description 积分记录表 + * @author jyy + * @date 2021-02-26 15:26 + */ +public interface ScoreUseRecordDao extends BaseMapper<ScoreUseRecord> { + + /** + * 查询收支记录 + * @param page + * @param scoreFlowDto + * @return + */ + IPage<ScoreUseRecordVo> selectFlowList(Page<ScoreUseRecordVo> page, @Param("record")ScoreFlowDto scoreFlowDto); +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java new file mode 100644 index 0000000..26be27d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java @@ -0,0 +1,34 @@ +package com.matrix.system.score.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.score.entity.ScoreVipDetail; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @description 客户积分余额 + * @author jyy + * @date 2021-02-26 15:26 + */ +public interface ScoreVipDetailDao extends BaseMapper<ScoreVipDetail> { + + /** + * 查询用户总积分 + * @param openId + * @param vipId + * @return + */ + int selectUserTotalScore(@Param("vipId")Long vipId); + + /** + * 查询用户有效的积分,按时间顺序排 + * @param + * @return + */ + List<ScoreVipDetail> selectEffectiveScore(@Param("vipId")Long vipId); + + List<ScoreVipDetail> selectInvalidaVipScore(); + + int invalidVipScore(); +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dto/ScoreRuleSettingDto.java b/zq-erp/src/main/java/com/matrix/system/score/dto/ScoreRuleSettingDto.java new file mode 100644 index 0000000..0b31eff --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/dto/ScoreRuleSettingDto.java @@ -0,0 +1,8 @@ +package com.matrix.system.score.dto; + +/** + * @author wzy + * @date 2021-02-22 + **/ +public class ScoreRuleSettingDto { +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/dto/SocreRuleDto.java b/zq-erp/src/main/java/com/matrix/system/score/dto/SocreRuleDto.java new file mode 100644 index 0000000..ce7666e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/dto/SocreRuleDto.java @@ -0,0 +1,5 @@ +package com.matrix.system.score.dto; + +public class SocreRuleDto { + +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/BaseEntity.java b/zq-erp/src/main/java/com/matrix/system/score/entity/BaseEntity.java new file mode 100644 index 0000000..3e1a1e0 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/entity/BaseEntity.java @@ -0,0 +1,69 @@ +package com.matrix.system.score.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author wzy + * @date 2020-04-24 14:58 + **/ +public class BaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "id",type = IdType.AUTO) + private Long id; + + private String createBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + private String updateBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java new file mode 100644 index 0000000..075e21c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java @@ -0,0 +1,92 @@ +package com.matrix.system.score.entity; + +import com.matrix.core.anotations.Extend; +import com.baomidou.mybatisplus.annotation.TableName; + +import lombok.Data; + +/** + * @description 积分记录表 + * @author jyy + * @date 2021-02-26 15:26 + */ +@Data +@TableName("score_use_record") +public class ScoreUseRecord extends BaseEntity{ + @Extend + private static final long serialVersionUID = 1L; + + + + + + /** + * 记录类型(1:现金消费2:员工划扣3赠送等) + */ + + + private Integer type; + + /** + * 数量 + */ + + + private Integer recNum; + + /** + * 业务记录ID + */ + + + private Long businessId; + /** + * 操作人id + */ + Long oprationUserId; + /** + * 积分卡ID + */ + + + private Long scoreVipDetailId; + + /** + * 原积分 + */ + + + private Integer preScore; + + /** + * 现积分 + */ + + + private Integer nowScore; + + /** + * 操作人ID + */ + private Long vipId; + + private Long shopId; + + /** + * 备注 + */ + + + private String remarks; + + /** + * 所属公司_id + */ + + + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java new file mode 100644 index 0000000..b32fe45 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java @@ -0,0 +1,131 @@ +package com.matrix.system.score.entity; + +import com.matrix.core.anotations.Extend; +import com.baomidou.mybatisplus.annotation.TableName; + +import lombok.Data; + +import java.util.Date; + +/** + * @description 客户积分余额 + * @author jyy + * @date 2021-02-26 15:26 + */ +@Data +@TableName("score_vip_detail") +public class ScoreVipDetail extends BaseEntity{ + @Extend + private static final long serialVersionUID = 1L; + + /** + * 获取类型(1:现金消费) + */ + public static final int SCORE_VIP_TYPE_CASH=1; + + + /** + * 获取类型(2:赠送等) + */ + public static final int SCORE_VIP_TYPE_CONSUME=2; + /** + * 获取类型(3推荐客户) + */ + public static final int SCORE_VIP_TYPE_REFERRER=3; + /** + * 获取类型(4参加活动) + */ + public static final int SCORE_VIP_TYPE_JOIN_ACTIVE=4; + + + /** + * 获取类型(4人工调整) + */ + public static final int SCORE_VIP_TYPE_USERCHANGE=4; + /** + * 获取类型(5积分失效) + */ + public static final int SCORE_OVER_TIME=5; + + /** 有效*/ + public static final int SCORE_STATUS_YX=1; + /** 无效*/ + public static final int SCORE_STATUS_WX=2; + + + + + + /** + * erp用户Id + */ + private Long vipId; + + + /** + * 获取类型(1:现金消费2:赠送等) + */ + + + private Integer type; + + /** + * 积分总数 + */ + + + private Integer allScore; + + /** + * 已使用积分 + */ + + + private Integer usedScore; + + /** + * 剩余积分 + */ + + + private Integer remainScore; + + /** + * 获取时间 + */ + + + private Date gainTime; + + /** + * 到期时间 + */ + + + private Date validiteTime; + + /** + * 有效状态(1:有效 2:无效) + */ + + + private Integer state; + + /** + * 原始单据ID + */ + + + private Long businessId; + + /** + * 所属公司_id + */ + + + private Long companyId; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/mapper/ScoreRuleSettingMapper.java b/zq-erp/src/main/java/com/matrix/system/score/mapper/ScoreRuleSettingMapper.java new file mode 100644 index 0000000..deb3e80 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/mapper/ScoreRuleSettingMapper.java @@ -0,0 +1,8 @@ +package com.matrix.system.score.mapper; + +/** + * @author wzy + * @date 2021-02-22 + **/ +public class ScoreRuleSettingMapper { +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/scheduledJob/ScoreScheduledJob.java b/zq-erp/src/main/java/com/matrix/system/score/scheduledJob/ScoreScheduledJob.java new file mode 100644 index 0000000..edef129 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/scheduledJob/ScoreScheduledJob.java @@ -0,0 +1,64 @@ +package com.matrix.system.score.scheduledJob; + + +import cn.hutool.core.date.DateTime; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.score.dao.ScoreUseRecordDao; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.score.entity.ScoreUseRecord; +import com.matrix.system.score.entity.ScoreVipDetail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 用户积分相关定时任务 + * + * @author jyy + */ +@Component +public class ScoreScheduledJob { + + + @Autowired + ScoreVipDetailDao scoreVipDetailDao; + + @Autowired + ScoreUseRecordDao scoreUseRecordDao; + + @Scheduled(cron = "1 0 0 1/1 * ?") + public boolean invalidVipScore() { + + LogUtil.info("计算无效积分定时任务开始运行****************"); + + //获取所有失效的积分,生成失效记录 + List<ScoreVipDetail> invalidavipScoreList = scoreVipDetailDao.selectInvalidaVipScore(); + + for (ScoreVipDetail scoreVipDetail : invalidavipScoreList) { + ScoreUseRecord scoreUseRecord=new ScoreUseRecord(); + scoreUseRecord.setCreateBy(AppConstance.SYSTEM_USER); + scoreUseRecord.setUpdateBy(AppConstance.SYSTEM_USER); + scoreUseRecord.setCreateTime(DateTime.now()); + scoreUseRecord.setUpdateTime(DateTime.now()); + scoreUseRecord.setNowScore(0); + scoreUseRecord.setCompanyId(scoreVipDetail.getCompanyId()); + scoreUseRecord.setScoreVipDetailId(scoreVipDetail.getId()); + scoreUseRecord.setBusinessId(0L); + scoreUseRecord.setRecNum(-scoreVipDetail.getRemainScore()); + scoreUseRecord.setType(ScoreVipDetail.SCORE_OVER_TIME); + scoreUseRecord.setVipId(scoreVipDetail.getVipId()); + scoreUseRecord.setPreScore(scoreVipDetail.getRemainScore()); + scoreUseRecord.setRemarks("积分失效"); + scoreUseRecordDao.insert(scoreUseRecord); + } + //更新失效积分记录状态 + scoreVipDetailDao.invalidVipScore(); + LogUtil.info("计算无效积分定时任务结束*******************"); + return true; + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java new file mode 100644 index 0000000..4e91105 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java @@ -0,0 +1,55 @@ +package com.matrix.system.score.service; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wzy + * @date 2021-02-22 + **/ +@Service +public class ScoreRuleSettingService{ + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + @Autowired + private SysVipInfoDao sysVipInfoDao; + + public AjaxResult updateScoreRuleByCompanyId(List<BusParameterSettings> busParameterSettings) { + //获取当前登录人员信息 + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + for (BusParameterSettings busParameterSetting:busParameterSettings ) { + String paramCode = busParameterSetting.getParamCode(); + if(StringUtils.isNotBlank(paramCode)){ + //删除原有code + BusParameterSettings delParanm=new BusParameterSettings(); + delParanm.setCompanyId(user.getCompanyId()); + delParanm.setParamCode(paramCode); + busParameterSettingsDao.deleteByModel(delParanm); + //添加新的code + BusParameterSettings newParam=new BusParameterSettings(); + newParam.setParamCode(paramCode); + newParam.setCompanyId(user.getCompanyId()); + newParam.setParamValue(busParameterSetting.getParamValue()); + newParam.setParamValue1(busParameterSetting.getParamValue1()); + newParam.setParamValue2(busParameterSetting.getParamValue2()); + busParameterSettingsDao.insert(newParam); + }else{ + return AjaxResult.buildFailInstance("code不能为空"); + } + } + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "更新成功"); + return result; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java new file mode 100644 index 0000000..7c27a80 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java @@ -0,0 +1,287 @@ +package com.matrix.system.score.service; + +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.dao.SysUsersDao; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.dao.ScoreUseRecordDao; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.score.entity.ScoreUseRecord; +import com.matrix.system.score.entity.ScoreVipDetail; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * @author jyy + * @description 客户积分余额 + * @date 2021-02-26 15:26 + */ +@Service +public class ScoreVipDetailService extends ServiceImpl<ScoreVipDetailDao, ScoreVipDetail> { + + @Autowired + ScoreVipDetailDao scoreVipDetailDao; + + @Autowired + ScoreUseRecordDao scoreUseRecordDao; + + @Autowired + SysVipInfoDao sysVipInfoDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + SysUsersDao sysUsersDao; + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + /** + * 扣除用户积分 + */ + @Transactional(rollbackFor = Exception.class) + public void deductionScore(Long vipId, Long oprationUserId, Long shopId, Integer score, Long businessId, int type, String remark) { + Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); + + String createBy = MatrixConstance.SYSTEM_USER; + if (oprationUserId != null) { + createBy = sysUsersDao.selectById(oprationUserId).getSuName(); + } + + List<ScoreVipDetail> effectiveScoreList = scoreVipDetailDao.selectEffectiveScore(vipId); + + for (ScoreVipDetail scoreVipDetail : effectiveScoreList) { + + ScoreUseRecord scoreUseRecord = new ScoreUseRecord(); + scoreUseRecord.setPreScore(scoreVipDetail.getRemainScore()); + + int surplus = scoreVipDetail.getRemainScore() - score; + int currentDedution = 0; + if (surplus > 0 || surplus == 0) { + //余额充足 + currentDedution = score; + scoreVipDetail.setRemainScore(surplus); + if (surplus == 0) { + scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_WX); + } + scoreVipDetailDao.updateById(scoreVipDetail); + score = 0; + } else { + currentDedution = scoreVipDetail.getRemainScore(); + scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_WX); + scoreVipDetail.setRemainScore(0); + scoreVipDetailDao.updateById(scoreVipDetail); + score = Math.abs(surplus); + } + + + //新增扣除记录 + scoreUseRecord.setCreateBy(createBy); + scoreUseRecord.setUpdateBy(createBy); + scoreUseRecord.setCreateTime(DateTime.now()); + scoreUseRecord.setUpdateTime(DateTime.now()); + scoreUseRecord.setNowScore(scoreVipDetail.getRemainScore()); + scoreUseRecord.setCompanyId(companyId); + scoreUseRecord.setScoreVipDetailId(scoreVipDetail.getId()); + scoreUseRecord.setBusinessId(businessId); + scoreUseRecord.setRecNum(-currentDedution); + scoreUseRecord.setType(type); + scoreUseRecord.setShopId(shopId); + scoreUseRecord.setVipId(vipId); + scoreUseRecord.setRemarks(remark); + scoreUseRecord.setOprationUserId(oprationUserId); + scoreUseRecordDao.insert(scoreUseRecord); + + if (surplus > 0 || surplus == 0) { + break; + } + } + if (score > 0) { + throw new GlobleException("积分不足"); + } + } + + /** + * 新增用户积分 + */ + @Transactional(rollbackFor = Exception.class) + public void addScore(Long vipId, Long oprationUserId, Long shopId, Integer score, Long businessId, int type, String remark) { + Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); + + if (score < 0) { + throw new IllegalArgumentException("score必须有为大于零的数"); + } + + String createBy = MatrixConstance.SYSTEM_USER; + if (oprationUserId != null) { + createBy = sysUsersDao.selectById(oprationUserId).getSuName(); + } + + //计算过期时间 + BusParameterSettings yxqSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId); + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + int sxYear = year + (Integer.parseInt(yxqSetting.getParamValue()) - 1); + Date sxys = DateUtil.stringToDate(sxYear + "-12-31 23:59", DateUtil.DATE_FORMAT_MM); + + ScoreVipDetail scoreVipDetail = new ScoreVipDetail(); + + scoreVipDetail.setCreateBy(createBy); + scoreVipDetail.setUpdateBy(createBy); + scoreVipDetail.setCreateTime(DateTime.now()); + scoreVipDetail.setUpdateTime(DateTime.now()); + scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_YX); + scoreVipDetail.setRemainScore(score); + scoreVipDetail.setUsedScore(0); + scoreVipDetail.setBusinessId(businessId); + scoreVipDetail.setValiditeTime(sxys); + scoreVipDetail.setVipId(vipId); + scoreVipDetail.setGainTime(DateTime.now()); + scoreVipDetail.setAllScore(score); + scoreVipDetail.setType(type); + scoreVipDetail.setCompanyId(companyId); + scoreVipDetailDao.insert(scoreVipDetail); + + //新增添加记录 + ScoreUseRecord scoreUseRecord = new ScoreUseRecord(); + scoreUseRecord.setPreScore(score); + scoreUseRecord.setCreateBy(createBy); + scoreUseRecord.setUpdateBy(createBy); + scoreUseRecord.setCreateTime(DateTime.now()); + scoreUseRecord.setUpdateTime(DateTime.now()); + scoreUseRecord.setNowScore(score); + scoreUseRecord.setCompanyId(companyId); + scoreUseRecord.setScoreVipDetailId(scoreVipDetail.getId()); + scoreUseRecord.setBusinessId(businessId); + scoreUseRecord.setRecNum(score); + scoreUseRecord.setType(type); + scoreUseRecord.setVipId(vipId); + scoreUseRecord.setShopId(shopId); + scoreUseRecord.setOprationUserId(oprationUserId); + scoreUseRecord.setRemarks(remark); + scoreUseRecordDao.insert(scoreUseRecord); + + + } + + /** + * 根据固定等级规则新增用户积分 + */ + @Transactional(rollbackFor = Exception.class) + public void addScoreByParamSetting(Long vipId, Long oprationUserId, Long shopId, Long businessId, int type, String remark, BusParameterSettings parameterSetting) { + + if (parameterSetting != null) { + SysVipInfo vipInfo = sysVipInfoDao.selectById(vipId); + //添加自己的积分 + if (StringUtils.isNotBlank(parameterSetting.getParamValue())) { + Integer firstScore = new Integer(parameterSetting.getParamValue()); + if (firstScore > 0) { + addScore( + vipInfo.getId(), + oprationUserId, + shopId, + firstScore, + businessId, + type, + remark + ); + } + } + + if (StringUtils.isNotBlank(parameterSetting.getParamValue1()) + && vipInfo.getRecommendId() != null) { + //推荐注册老带新积分奖励 + SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); + Integer secondScore = new Integer(parameterSetting.getParamValue1()); + if (secondScore > 0) { + addScore( + referrerVip.getId(), + oprationUserId, + shopId, + secondScore, + businessId, + type, + remark + ); + } + //推荐注册二级带新积分奖励 + if (StringUtils.isNotBlank(parameterSetting.getParamValue2()) + && referrerVip.getRecommendId() != null) { + Integer threeScore = new Integer(parameterSetting.getParamValue2()); + if (threeScore > 0) { + addScore( + referrerVip.getRecommendId(), + oprationUserId, + shopId, + threeScore, + businessId, + type, + remark + ); + } + } + } + } + } + + + /** + * 退积分 + */ + public void refundScore(Long vipId, Integer score, Long oldBusinessId, int type) { + + Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); + + if (score < 0) { + throw new IllegalArgumentException("score必须有为大于零的数"); + } + //查询原始使用记录 + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("business_id", oldBusinessId); + queryWrapper.eq("company_id", companyId); + queryWrapper.eq("type", type); + List<ScoreUseRecord> scoreUseRecordList = scoreUseRecordDao.selectList(queryWrapper); + scoreUseRecordList.forEach(scoreUseRecord -> { + ScoreVipDetail scoreVipDetail = scoreVipDetailDao.selectById(scoreUseRecord.getScoreVipDetailId()); + if (scoreVipDetail != null) { + if (DateTime.now().isAfter(scoreVipDetail.getValiditeTime())) { + //积分还有效 + scoreVipDetail.setRemainScore(scoreVipDetail.getRemainScore() + score); + scoreVipDetail.setUsedScore(scoreVipDetail.getUsedScore() - score); + scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_YX); + scoreVipDetailDao.updateById(scoreVipDetail); + scoreUseRecordDao.deleteById(scoreUseRecord.getId()); + } + } + + }); + } + + public void removeByBusinessId(Long vipId, Long oldBusinessId) { + Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); + + if (oldBusinessId == null) { + throw new IllegalArgumentException("oldBusinessId必须有"); + } + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("business_id", oldBusinessId); + queryWrapper.eq("company_id", companyId); + scoreVipDetailDao.delete(queryWrapper); + scoreUseRecordDao.delete(queryWrapper); + } +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/vo/ScoreRuleSettingsVo.java b/zq-erp/src/main/java/com/matrix/system/score/vo/ScoreRuleSettingsVo.java new file mode 100644 index 0000000..0aeb028 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/score/vo/ScoreRuleSettingsVo.java @@ -0,0 +1,139 @@ +package com.matrix.system.score.vo; + +import com.matrix.core.anotations.Extend; + +public class ScoreRuleSettingsVo { + @Extend + private static final long serialVersionUID = 1L; + + + private Long paramId; + /** + * 参数名称 + */ + private String paramName; + /** + * 参数编码 + */ + private String paramCode; + + /** + * switch按钮 + */ + private Boolean paramSwitch; + + + /** + * 参数值 + */ + private String paramValue; + + + /** + * 值1 + */ + private String paramValue1; + + + /** + * 值2 + */ + private String paramValue2; + + + /** + * 值3 + */ + private String paramValue3; + + private Long companyId; + + private Long shopId; + + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getParamId() { + return paramId; + } + + public void setParamId(Long paramId) { + this.paramId = paramId; + } + + + public String getParamCode() { + return paramCode; + } + + public void setParamCode(String paramCode) { + this.paramCode = paramCode; + } + + + public String getParamValue() { + return paramValue; + } + + public void setParamValue(String paramValue) { + this.paramValue = paramValue; + } + + + public String getParamValue1() { + return paramValue1; + } + + public void setParamValue1(String paramValue1) { + this.paramValue1 = paramValue1; + } + + + public String getParamValue2() { + return paramValue2; + } + + public void setParamValue2(String paramValue2) { + this.paramValue2 = paramValue2; + } + + + public String getParamValue3() { + return paramValue3; + } + + public void setParamValue3(String paramValue3) { + this.paramValue3 = paramValue3; + } + + public String getParamName() { + return paramName; + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } + + public Boolean getParamSwitch() { + return paramSwitch; + } + + public void setParamSwitch(Boolean paramSwitch) { + this.paramSwitch = paramSwitch; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopActivitiesAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopActivitiesAction.java index ae33fac..a0b3313 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopActivitiesAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopActivitiesAction.java @@ -1,29 +1,32 @@ package com.matrix.system.shopXcx.action; -import com.matrix.core.constance.MatrixConstance; -import com.matrix.core.constance.SystemMessageCode; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.*; -import com.matrix.core.web.BaseAction; -import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.anotations.RemoveRequestToken; +import com.matrix.core.anotations.SaveRequestToken; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.constance.SystemErrorCode; +import com.matrix.core.constance.SystemMessageCode; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.ModelUtils; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; import com.matrix.system.shopXcx.dto.SalonDTO; import com.matrix.system.shopXcx.dto.SecKillDTO; -import org.springframework.stereotype.Controller; -import com.matrix.core.exception.GlobleException; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; -import com.matrix.core.anotations.SaveRequestToken; -import com.matrix.core.pojo.AjaxResult; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; -import java.math.BigDecimal; -import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Map; @@ -308,13 +311,8 @@ shopActivitiesDao.deleteById(actId); shopActivitiesGroupInfoDao.deleteByActId(actId); - int i = shopActivitiesGroupPriceDao.deleteByActId(actId); - - if (i > 0) { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES, i); - } else { - throw new GlobleException(SystemErrorCode.DATA_DELETE_FAIL); - } + shopActivitiesGroupPriceDao.deleteByActId(actId); + return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES); } @RequestMapping(value = "/closeAct") diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopAdvertisTypeAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopAdvertisTypeAction.java index 3057829..d07aa26 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopAdvertisTypeAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopAdvertisTypeAction.java @@ -103,6 +103,7 @@ public @ResponseBody AjaxResult modifyShopAdvertisType(@RequestBody ShopAdvertisType newShopAdvertisType) { SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + if (StringUtils.isNotBlank(newShopAdvertisType.getNodeStyle())) { String style = newShopAdvertisType.getNodeStyle(); style = style.replaceAll("px", "rpx") @@ -116,7 +117,7 @@ newShopAdvertisType.setCreateBy(user.getSuName()); newShopAdvertisType.setUpdateBy(user.getSuName()); - + newShopAdvertisType.setCompanyId(user.getCompanyId()); shopAdvertisTypeDao.insert(newShopAdvertisType); } else { shopAdvertisTypeDao.updateByModel(newShopAdvertisType); @@ -135,6 +136,7 @@ collect.forEach(ad -> { ad.setCreateBy(user.getSuName()); ad.setUpdateBy(user.getSuName()); + ad.setCompanyId(user.getCompanyId()); ad.setTypeId(newShopAdvertisType.getAdtId()); }); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java index 186022e..9e074ae 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java @@ -1,25 +1,10 @@ package com.matrix.system.shopXcx.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.service.BizUserService; -import com.matrix.core.anotations.RemoveRequestToken; -import com.matrix.core.anotations.SaveRequestToken; -import com.matrix.core.constance.MatrixConstance; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.StringUtils; -import com.matrix.core.tools.WebUtil; -import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.shopXcx.bean.ShopScoreExchange; +import com.matrix.system.hive.service.SysVipInfoService; import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao; -import com.matrix.system.shopXcx.pojo.ExchangeScorePOJO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import java.util.Date; /** @@ -32,7 +17,7 @@ public class ShopBizUserScoreAction { @Autowired - private BizUserService bizUserService; + private SysVipInfoService sysVipInfoService; @Autowired private ShopScoreExchangeDao shopScoreExchangeDao; @@ -40,75 +25,6 @@ * 记录编辑前的值Before_Edit_Value */ public static final String BEV = "ShopBizUserScore_BEV"; - - - /** - * 进入积分兑换界面 - */ - @SaveRequestToken - @RequestMapping(value = "/intoExchangePage") - public ModelAndView exchangeScore(String userId) { - BizUser bizUser = new BizUser(); - ModelAndView modelAndView = new ModelAndView("admin/shop/user-score-exchange"); - if (StringUtils.isNotBlank(userId)) { - bizUser = bizUserService.findById(userId); - if (bizUser.getCurrentScore() == null) { - bizUser.setCurrentScore(0); - } - } - modelAndView.addObject("obj", bizUser); - return modelAndView; - } - - - /** - * 兑换积分 - */ - @Transactional(rollbackFor = Exception.class) - @RemoveRequestToken - @RequestMapping(value = "/exchangeScore") - public @ResponseBody - AjaxResult exchangeScore(ExchangeScorePOJO pojo) { - //校验参数中用户ID和用户兑换积分是否有效 - if (pojo == null || StringUtils.isBlank(pojo.getUserId()) - || pojo.getScore() == null || pojo.getScore() == 0) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "提交参数有误!"); - } - //兑换积分用户信息 - BizUser bizUser = bizUserService.findById(pojo.getUserId()); - if (bizUser == null) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "没有查询到相应用户!"); - } - if (bizUser.getCurrentScore() == null) { - bizUser.setCurrentScore(0); - } - //如果兑换积分大于用户当前积分 - if (pojo.getScore() > bizUser.getCurrentScore()) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "兑换积分大于用户当前积分!"); - } - //剩余积分 = 当前积分 - 兑换积分 - Integer remainScore = bizUser.getCurrentScore() - pojo.getScore(); - //当前操作用户信息 - SysUsers loginUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - //修改用户剩余积分 - BizUser updateModel = new BizUser(); - updateModel.setUserId(bizUser.getUserId()); - updateModel.setCurrentScore(remainScore); - updateModel.setUpdateBy(loginUser.getSuName()); - updateModel.setUpdateTime(new Date()); - bizUserService.modifyByModel(updateModel); - //添加积分兑换记录 - ShopScoreExchange insertExchange = new ShopScoreExchange(); - insertExchange.setCreateBy(loginUser.getSuName()); - insertExchange.setUpdateBy(loginUser.getSuName()); - insertExchange.setUserId(bizUser.getOpenId()); - insertExchange.setExchangeScore(pojo.getScore()); - insertExchange.setOperateId(loginUser.getSuId()); - insertExchange.setRemark(pojo.getRemarks()); - shopScoreExchangeDao.insert(insertExchange); - - return new AjaxResult(AjaxResult.STATUS_SUCCESS, "兑换成功!"); - } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopCouponAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopCouponAction.java index b08d002..d60a263 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopCouponAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopCouponAction.java @@ -14,7 +14,6 @@ import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.shopXcx.bean.ShopCoupon; import com.matrix.system.shopXcx.bean.ShopProduct; import com.matrix.system.shopXcx.dao.ShopCouponDao; @@ -269,6 +268,7 @@ * @param shopCoupon */ private void productLabeling(ShopCoupon shopCoupon) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); Date now = new Date(); Boolean needUpdate = false; //优惠券处于可用状态 @@ -279,6 +279,7 @@ if (shopCoupon.getIsAll() == 1) { ShopProduct productQuery = new ShopProduct(); productQuery.setDelFlag(2); + productQuery.setCompanyId(user.getCompanyId()); shopProductList = shopProductDao.selectByModel(productQuery); } else { if (StringUtils.isNotBlank(shopCoupon.getProductIds())) { diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopDeliveryInfoAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopDeliveryInfoAction.java index 9e1504a..82954ed 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopDeliveryInfoAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopDeliveryInfoAction.java @@ -1,6 +1,6 @@ package com.matrix.system.shopXcx.action; -import com.matrix.component.rabbitmq.RabiitMqTemplate; +import com.matrix.component.asyncmessage.AsyncMessageManager; import com.matrix.core.anotations.RemoveRequestToken; import com.matrix.core.anotations.SaveRequestToken; import com.matrix.core.constance.MatrixConstance; @@ -12,21 +12,19 @@ import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; -import com.matrix.system.common.bean.CustomerDataDictionary; -import com.matrix.system.common.bean.SystemDictionary; -import com.matrix.system.common.dao.CustomerDataDictionaryDao; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.bean.SystemDictionary; import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.CustomerDataDictionaryDao; import com.matrix.system.common.dao.SystemDictionaryDao; -import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.action.BaseController; +import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; import com.matrix.system.shopXcx.bean.ShopOrder; import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; import com.matrix.system.shopXcx.dao.ShopLogisticsInfoDao; import com.matrix.system.shopXcx.dao.ShopOrderDao; -import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; -import com.matrix.system.shopXcx.mqTask.MQTaskRouting; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -61,14 +59,14 @@ @Autowired SystemDictionaryDao systemDictionaryDao; + @Autowired + private AsyncMessageManager asyncMessageManager; @Autowired private WxShopOrderUtil wxShopOrderUtil; @Autowired private ShopLogisticsInfoDao shopLogisticsInfoDao; - @Autowired - private RabiitMqTemplate rabiitMqTemplate; //记录编辑前的值Before_Edit_Value public static final String BEV = "ShopDeliveryInfo_BEV"; @@ -86,11 +84,7 @@ pageVo.setSort("create_time"); pageVo.setOrder("desc"); shopDeliveryInfo.setCompanyId(sysUsers.getCompanyId()); - if (getMe().getShopRole().equals(Dictionary.FLAG_NO_N)) { - shopDeliveryInfo.setShopId(sysUsers.getShopId()); - } - - +// shopDeliveryInfo.setShopId(sysUsers.getShopId()); List<ShopDeliveryInfo> dataList = shopDeliveryInfoDao.selectInPage(shopDeliveryInfo, pageVo); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, shopDeliveryInfoDao.selectTotalRecord(shopDeliveryInfo)); @@ -166,6 +160,7 @@ info.setRemarks(deliveryInfo.getRemarks()); info.setLogisticsStatus(AppConstance.LOGISTICS_STATUS_OF_RECEIVE); info.setDeliveryTime(new Date()); + info.setCompanyId(user.getCompanyId()); shopDeliveryInfoDao.updateByModel(info); //构建需要修改订单信息Map @@ -175,8 +170,8 @@ shopOrderDao.updateByMap(modifyMap); //发送创建订单的消息 - rabiitMqTemplate.sendMsg(MQTaskRouting.ORDER_OUT_SOTORE+evn, shopOrderDao.selectById(deliveryInfo.getOrderId()).getOrderNo()); - + String orderNo = shopOrderDao.selectById(deliveryInfo.getOrderId()).getOrderNo(); + asyncMessageManager.sendMsg(AsyncMessageRouting.ORDER_OUT_SOTORE ,"orderNo=%s",orderNo); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "发货成功"); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopOrderAction.java index 49d6d78..c318168 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopOrderAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopOrderAction.java @@ -1,7 +1,10 @@ package com.matrix.system.shopXcx.action; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import com.google.gson.Gson; +import com.matrix.component.asyncmessage.AsyncMessageManager; import com.matrix.core.anotations.RemoveRequestToken; import com.matrix.core.anotations.SaveRequestToken; import com.matrix.core.constance.MatrixConstance; @@ -16,25 +19,32 @@ import com.matrix.core.tools.excl.ExcelVersion; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; -import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.action.BaseController; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.service.SysVipInfoService; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; import com.matrix.system.shopXcx.dto.DiscountExplain; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; import com.matrix.system.shopXcx.pojo.ShopOrderQueryPOJO; import com.matrix.system.shopXcx.shopEnum.OrderStatusEnum; +import com.matrix.system.shopXcx.vo.LogisticsImportVo; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.math.BigDecimal; @@ -62,10 +72,195 @@ private WxApplyOrderRelateDao wxApplyOrderRelateDao; @Autowired private SysShopInfoDao sysShopInfoDao; + @Autowired + private SysVipInfoService vipInfoService; //记录编辑前的值Before_Edit_Value public static final String BEV = "ShopOrder_BEV"; + public static final List<LogisticsImportVo> logisticsImportVoLists = new ArrayList<>(); + @Autowired + private AsyncMessageManager asyncMessageManager; + + + /** + * 导入快递单 + */ + @RequestMapping(value = "/logisticsImport") + @ResponseBody + public AjaxResult logisticsImport(HttpServletResponse response, HttpServletRequest request, + @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { + + String fileName = file.getOriginalFilename(); + String dirPath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); +// String dirPath = "E:/xcshop"; + File fileDir = new File(dirPath); + LogUtil.info("#----->{}#", fileDir.exists()); + if (!fileDir.exists()) { + fileDir.mkdirs(); + } + File saveFile = new File(dirPath + "/" + fileName); + file.transferTo(saveFile); + + String infoRemind = "提示:"; + AjaxResult ajaxResult = new AjaxResult(); + List<LogisticsImportVo> logisticsImportVos = logisticsImportFile(saveFile); + if(CollUtil.isNotEmpty(logisticsImportVos)){ + ajaxResult = AjaxResult.buildSuccessInstance("部分数据导入失败"); + ajaxResult.setStatus(AjaxResult.STATUS_FAIL); + }else{ + ajaxResult = AjaxResult.buildSuccessInstance("导入成功"); + ajaxResult.setStatus(AjaxResult.STATUS_SUCCESS); + } + return ajaxResult; + } + + @RequestMapping(value = "/exportLogisticsImportExcel") + public void exportLogisticsImportExcel(HttpServletResponse res) { + OutputStream os = null; + try { + res.setCharacterEncoding("UTF-8"); + res.setHeader("content-type", "application/octet-stream;charset=UTF-8"); + res.setContentType("application/octet-stream;charset=UTF-8"); + Date date = new Date(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss"); + res.setHeader("Content-Disposition", "attachment;filename=" + + java.net.URLEncoder.encode("快递单导入列表" + dateFormat.format(date) + ".xls".trim(), "UTF-8")); + + os = res.getOutputStream(); + ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, disPoseLogisticsImportExcel(logisticsImportVoLists), os, true); + logisticsImportVoLists.clear(); + } catch (Exception e) { + LogUtil.error("快递单导入异常", e); + } finally { + if (os != null) { + try { + os.close(); + } catch (IOException e) { + LogUtil.error("关闭资源异常", e); + } + } + } + } + private List<ExcelSheetPO> disPoseLogisticsImportExcel(List<LogisticsImportVo> logisticsImportVos) { + List<ExcelSheetPO> res = new ArrayList<>(); + ExcelSheetPO orderSheet = new ExcelSheetPO(); + orderSheet.setSheetName("快递单导入"); + orderSheet.setTitle("快递单导入失败列表"); + String[] header = new String[]{"订单编号", "物流公司编码", "物流公司名称", "快递单号", "失败原因"}; + orderSheet.setHeaders(header); + List<List<Object>> body = new ArrayList<>(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); + if(CollUtil.isNotEmpty(logisticsImportVos)){ + for (LogisticsImportVo logisticsImportVo : logisticsImportVos) { + List<Object> bodyItem = new ArrayList<>(); + bodyItem.add(logisticsImportVo.getOrderNo()); + bodyItem.add(logisticsImportVo.getLogisticsCompanyCode()); + bodyItem.add(logisticsImportVo.getLogisticsCompany()); + bodyItem.add(logisticsImportVo.getWaybillNo()); + bodyItem.add(logisticsImportVo.getFailReason()); + body.add(bodyItem); + } + } + orderSheet.setDataList(body); + res.add(orderSheet); + return res; + } + + public List<LogisticsImportVo> logisticsImportFile(File file) throws IOException { + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + List<ExcelSheetPO> excelList = ExcelUtil.readExcel(file, null,null); + ArrayList<LogisticsImportVo> logisticsImportVos = new ArrayList<>(); + for (int i = 0; i < excelList.size(); i++) { + List<List<Object>> dataList = excelList.get(i).getDataList(); + List<SysVipInfo> vipInfos = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(dataList)) { + for (int j = 1; j < dataList.size(); j++) { + /** + * 订单处于【待付款】【待配送】【待收货】都可以导入 + * 其他状态生成一个提示 + */ + + LogisticsImportVo logisticsImportVo = new LogisticsImportVo(); + List<Object> objects = dataList.get(j); + //订单编号 + String orderNo = objects.get(0).toString(); + ShopOrder shopOrder = shopOrderDao.selectShopOrderByOrderNo(orderNo); + if(ObjectUtil.isNotEmpty(shopOrder) && + (shopOrder.getOrderStatus() == ShopOrder.ORDER_STATUS_WAIT_SEND || + shopOrder.getOrderStatus() == ShopOrder.ORDER_STATUS_WAIT_RECEIVE )){ + //物流公司编码 + String logisticsCompanyCode = objects.get(1).toString(); + //物流公司名称 + String logisticsCompany = objects.get(2).toString(); + //快递单号 + String waybillNo = objects.get(3).toString(); + + ShopDeliveryInfo shopDeliveryInfo = new ShopDeliveryInfo(); + shopDeliveryInfo.setOrderId(shopOrder.getId()); + List<ShopDeliveryInfo> infoList = shopDeliveryInfoDao.selectByModel(shopDeliveryInfo); + if (CollectionUtils.isEmpty(infoList)) { + logisticsImportVo.setOrderNo(objects.get(0).toString()); + logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); + logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); + logisticsImportVo.setWaybillNo(objects.get(3).toString()); + logisticsImportVo.setFailReason("未找到发货信息"); + logisticsImportVos.add(logisticsImportVo); + logisticsImportVoLists.add(logisticsImportVo); + }else{ + shopDeliveryInfo = infoList.get(0); + shopDeliveryInfo.setOrderNo(orderNo); + shopDeliveryInfo.setLogisticsCompanyCode(logisticsCompanyCode); + shopDeliveryInfo.setLogisticsCompany(logisticsCompany); + shopDeliveryInfo.setWaybillNo(waybillNo); + shopDeliveryInfo.setUpdateBy(sysUsers.getSuName()); + shopDeliveryInfo.setLogisticsStatus(AppConstance.LOGISTICS_STATUS_OF_RECEIVE); + shopDeliveryInfo.setDeliveryTime(new Date()); + shopDeliveryInfoDao.updateByModel(shopDeliveryInfo); + + //构建需要修改订单信息Map + Map<String, Object> modifyMap = new HashMap<>(); + modifyMap.put("id", shopOrder.getId()); + modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_RECEIVE); + shopOrderDao.updateByMap(modifyMap); + + //发送创建订单的消息 + asyncMessageManager.sendMsg(AsyncMessageRouting.ORDER_OUT_SOTORE ,"orderNo=%s"); + + } + }else{ + if(ObjectUtil.isEmpty(shopOrder)){ + logisticsImportVo.setOrderNo(objects.get(0).toString()); + logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); + logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); + logisticsImportVo.setWaybillNo(objects.get(3).toString()); + logisticsImportVo.setFailReason("未找到订单信息"); + logisticsImportVos.add(logisticsImportVo); + logisticsImportVoLists.add(logisticsImportVo); + }else if(shopOrder.getOrderStatus() != ShopOrder.ORDER_STATUS_WAIT_SEND || + shopOrder.getOrderStatus() != ShopOrder.ORDER_STATUS_WAIT_RECEIVE ){ + logisticsImportVo.setOrderNo(objects.get(0).toString()); + logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); + logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); + logisticsImportVo.setWaybillNo(objects.get(3).toString()); + logisticsImportVo.setFailReason("订单状态不允许发货"); + logisticsImportVos.add(logisticsImportVo); + logisticsImportVoLists.add(logisticsImportVo); + }else{ + logisticsImportVo.setOrderNo(objects.get(0).toString()); + logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); + logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); + logisticsImportVo.setWaybillNo(objects.get(3).toString()); + logisticsImportVo.setFailReason("导入失败"); + logisticsImportVos.add(logisticsImportVo); + logisticsImportVoLists.add(logisticsImportVo); + } + } + } + } + } + return logisticsImportVos; + } /** * 导出Excel @@ -108,8 +303,8 @@ ExcelSheetPO orderSheet = new ExcelSheetPO(); orderSheet.setSheetName("订单列表"); orderSheet.setTitle("订单列表"); - String[] header = new String[]{"订单编号", "客户姓名", "客户电话", "收货地址", "下单时间", "订单金额", - "优惠总金额", "优惠说明", "订单状态", "配送方式", "门店名称", "商品名称", "规格", "生产企业", "单价", "购买数量"}; + String[] header = new String[]{"订单编号", "客户姓名", "客户电话", "收货地址", "店铺名称","订单状态","下单时间", "购买商品","订单金额", + "优惠总金额", "配送方式"}; orderSheet.setHeaders(header); List<List<Object>> body = new ArrayList<>(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); @@ -133,42 +328,26 @@ } else { bodyItem.add(""); } - //下单时间 - bodyItem.add(dateFormat.format(shopOrder.getOrderTime())); - //购买数量 -// bodyItem.add(shopOrder.getPurchaseQuantity()); - //订单金额 - bodyItem.add(shopOrder.getOrderMoney()); - //优惠总金额 - bodyItem.add(shopOrder.getDiscountAmount()); - //优惠说明 - bodyItem.add(shopOrder.getDiscountExplain()); + //店铺名称 + bodyItem.add(shopOrder.getStoreName()); //订单状态 bodyItem.add(OrderStatusEnum.getNameByCode(shopOrder.getOrderStatus())); - //配送方式 门店 - bodyItem.add("物流"); - bodyItem.add(""); - - //商品名称 + //下单时间 + bodyItem.add(dateFormat.format(shopOrder.getOrderTime())); + //购买商品 + ShopSku shopSku = shopOrderDetails.getShopSku(); ShopProduct shopProduct = shopOrderDetails.getShopProduct(); if (shopProduct == null) { bodyItem.add(""); } else { - bodyItem.add(shopProduct.getTitle()); + bodyItem.add(shopProduct.getTitle()+ "(" +shopSku.getName()+ ")*" + shopOrderDetails.getCount()); } - //规格名称、生产企业、单价 - ShopSku shopSku = shopOrderDetails.getShopSku(); - if (shopSku == null) { - bodyItem.add(""); - bodyItem.add(shopOrderDetails.getProductionEnterprise()); - bodyItem.add(""); - } else { - bodyItem.add(shopSku.getName()); - bodyItem.add(shopOrderDetails.getProductionEnterprise()); - bodyItem.add(shopSku.getPrice()); - } - //购买数量 - bodyItem.add(shopOrderDetails.getCount()); + //订单金额 + bodyItem.add(shopOrder.getOrderMoney()); + //优惠总金额 + bodyItem.add(shopOrder.getDiscountAmount()); + //配送方式 门店 + bodyItem.add("物流"); body.add(bodyItem); } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopPageAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopPageAction.java index 6de4994..7dfe412 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopPageAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopPageAction.java @@ -1,34 +1,33 @@ package com.matrix.system.shopXcx.action; +import com.matrix.core.anotations.RemoveRequestToken; +import com.matrix.core.anotations.SaveRequestToken; import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.constance.SystemMessageCode; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.StringUtils; -import com.matrix.core.web.BaseAction; -import com.matrix.core.constance.SystemErrorCode; -import com.matrix.core.anotations.RemoveRequestToken; +import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.tools.ServiceUtil; import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.shopXcx.bean.ShopPage; import com.matrix.system.shopXcx.dao.ShopPageDao; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import com.matrix.core.exception.GlobleException; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import com.matrix.core.anotations.SaveRequestToken; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.WebUtil; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.servlet.ModelAndView; import java.util.List; import java.util.Map; -import com.matrix.system.shopXcx.bean.ShopPage; -import org.springframework.web.servlet.ModelAndView; /** * @description 小程序页面 - * @author yourName + * @author jyy * @date 2020-04-03 14:56 */ @Controller @@ -77,10 +76,11 @@ @RemoveRequestToken @RequestMapping(value = "/addShopPage") public @ResponseBody AjaxResult addShopPage(ShopPage shopPage) { - if (serviceUtil.addCheckRepeat("shop_page", "code", shopPage.getCode())) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if (serviceUtil.addCheckRepeatTowColumn("shop_page", "code", shopPage.getCode(),"company_id", user.getCompanyId())) { throw new GlobleException("code重复"); } - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + shopPage.setCreateBy(user.getSuName()); shopPage.setUpdateBy(user.getSuName()); shopPage.setCompanyId(user.getCompanyId()); @@ -103,9 +103,10 @@ @RequestMapping(value = "/modifyShopPage") public @ResponseBody AjaxResult modifyShopPage(ShopPage newShopPage) { ShopPage oldShopPage = WebUtil.getSessionAttribute(BEV); - + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); // 校验去重 - if (serviceUtil.updateCheckRepeat("shop_page", + if (serviceUtil.updateCheckRepeatTowColumn("shop_page", + "company_id", user.getCompanyId(), "code", newShopPage.getCode(), "id",newShopPage.getId())) { throw new GlobleException("编号" + newShopPage.getCode() + "重复"); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopProductAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopProductAction.java index be2d489..b35a588 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopProductAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopProductAction.java @@ -2,33 +2,32 @@ import com.alibaba.fastjson.JSON; +import com.matrix.core.anotations.RemoveRequestToken; +import com.matrix.core.anotations.SaveRequestToken; import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.constance.SystemMessageCode; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.StringUtils; -import com.matrix.core.constance.SystemErrorCode; -import com.matrix.core.anotations.RemoveRequestToken; +import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.tools.ServiceUtil; -import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.action.BaseController; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import com.matrix.core.exception.GlobleException; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import com.matrix.core.anotations.SaveRequestToken; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.WebUtil; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.*; - import org.springframework.web.servlet.ModelAndView; + +import java.util.ArrayList; +import java.util.List; /** * @description 产品表 @@ -171,7 +170,10 @@ shopProductParamRef.setUpdateBy(user.getSuName()); newShopProductParamRefs.add(shopProductParamRef); } - shopProductParamRefDao.batchInsert(newShopProductParamRefs); + if(CollectionUtils.isNotEmpty(newShopProductParamRefs)){ + + shopProductParamRefDao.batchInsert(newShopProductParamRefs); + } } return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, "产品表"); }else { diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java index 4b25528..b17b449 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java @@ -1,6 +1,7 @@ package com.matrix.system.shopXcx.action; -import com.matrix.component.wechat.externalInterface.common.WechatConfigure; +import com.matrix.component.asyncmessage.AsyncMessageManager; +import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; import com.matrix.core.anotations.RemoveRequestToken; import com.matrix.core.anotations.SaveRequestToken; import com.matrix.core.constance.MatrixConstance; @@ -9,21 +10,22 @@ import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.*; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.ModelUtils; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; - -import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; +import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.hive.action.util.QueryUtil; +import com.matrix.system.shopXcx.api.service.WXShopOrderService; import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; import com.matrix.system.shopXcx.dao.ShopOrderDao; import com.matrix.system.shopXcx.dao.ShopRefundRecordDao; -import com.matrix.component.tools.WxTempLateMsgUtil; -import com.matrix.system.shopXcx.api.service.WXShopOrderService; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -60,8 +62,7 @@ @Autowired private ShopDeliveryInfoDao shopDeliveryInfoDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; - + private AsyncMessageManager asyncMessageManager; @Autowired private ShopCouponRecordDao shopCouponRecordDao; @@ -73,6 +74,12 @@ @Value("${wx_pay_debug_onoff}") private boolean isDebug; + @Value("${evn}") + private String evn; + + + @Autowired + BusParameterSettingsDao parameterSettingsDao; /** * 列表显示 @@ -133,9 +140,6 @@ modifyMap.put("handingTime", new Date()); int i = shopRefundRecordDao.updateByMap(modifyMap); if (i > 0) { - //同意退款后发送微信提醒填写物流单号 - ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(shopRefundRecord.getId()); - sendRefundLogisticsInfoToUser(fundRecord); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表"); } else { throw new GlobleException("操作失败"); @@ -182,8 +186,6 @@ modifyOrder.put("id", record.getOrderId()); shopOrderDao.updateByMap(modifyOrder); } - //退款拒绝后发送微信提醒 - sendFailedRefundInfoToUser(record); if (i > 0) { return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表"); } else { @@ -246,7 +248,7 @@ if(flag){ //退款成功后发送微信提醒 ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId()); - sendRefundInfoToUser(fundRecord); + } } @@ -270,7 +272,7 @@ if(flag){ //退款成功后发送微信提醒 ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId()); - sendRefundInfoToUser(fundRecord); + } } @@ -390,7 +392,7 @@ if(flag){ //退款成功后发送微信提醒 ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id)); - sendRefundInfoToUser(fundRecord); + refundRecordService.updateGroupBuyStatus(Long.parseLong(id)); } } @@ -416,7 +418,7 @@ if(flag){ //退款成功后发送微信提醒 ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id)); - sendRefundInfoToUser(fundRecord); + refundRecordService.updateGroupBuyStatus(Long.parseLong(id)); } } @@ -464,16 +466,14 @@ int reMoney = b1.multiply(bb).intValue(); LogUtil.info("退款退款金额{}", reMoney); - //Double refundMoney = 0.1 * 100; - //用户ID - String userId = WechatConfigure.mchID; + if (isDebug) { - boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, 1, 1, userId); + boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, 1, 1, null); flag = b; } else { LogUtil.info("开始调用退款接口。。。退款编号为{}", refundNo); - boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, orMoney, reMoney, userId); + boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, orMoney, reMoney, null); flag = b; } @@ -490,8 +490,7 @@ //退款成功后同时把优惠券退回到用户的账号中 if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) == 0) { ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); - String userIds = shopRefundRecord.getUserId(); - shopCouponRecord.setUserId(userIds); + shopCouponRecord.setUserId(shopRefundRecord.getUserId()); shopCouponRecord.setOrderId(shopOrder.getId()); List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); if (CollectionUtils.isNotEmpty(recordList)) { @@ -524,6 +523,9 @@ modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_MONEYBACK_SUCCESS); modifyMap.put("refundCharge", shopRefundRecord.getRefundMoney()); shopOrderDao.updateByMap(modifyMap); + + asyncMessageManager.sendMsg(AsyncMessageRouting.SHOP_ORDER_REFUND ,"orderId=%s", shopRefundRecord.getOrderId()); + }catch (Exception e){ LogUtil.debug("退款成功,修改退款表和订单表状态出错。。。", id); e.printStackTrace(); @@ -532,73 +534,6 @@ return flag; } - //退款成功后发送微信提醒 - private int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord) { - ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); - if (order == null) { - throw new GlobleException("没有找到需要退款的订单信息"); - } - List<String> msg = new ArrayList<>(); - //退款说明 - String refundExplain = "退款已经原路返回,具体到账时间可能会有1-3天延迟"; - msg.add(order.getOrderNo()); - msg.add(DateUtil.dateToString(shopRefundRecord.getRefundTime(),DateUtil.DATE_FORMAT_SS)); - msg.add(refundExplain); - msg.add("商品名称"); - String formId = null; - if(AppConstance.REFUND_GOODS.equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ - formId = shopRefundRecord.getRefundTransactionNo(); - }else { - formId = order.getWxOrderNo().split("=")[1]; - } - String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=1" + "&&inform=1"; - int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), - page, WxTempLateMsgUtil.REFUND_SUCCESS, formId); - return res; - } - //退款拒绝后发送微信提醒 - private int sendFailedRefundInfoToUser(ShopRefundRecord shopRefundRecord) { - ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); - if (order == null) { - throw new GlobleException("没有找到拒绝退款的订单信息"); - } - List<String> msg = new ArrayList<>(); - //退款说明 - String remarks = "如有疑问请联系客服"; - msg.add(order.getOrderNo()); - msg.add("商品名称"); - msg.add(shopRefundRecord.getRefundRefuseReason()); - msg.add(shopRefundRecord.getRefundCause()); - String formId = null; - if(AppConstance.REFUND_GOODS .equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ - formId = shopRefundRecord.getRefundTransactionNo(); - }else { - formId = order.getWxOrderNo().split("=")[1]; - } - String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=2" + "&&inform=1"; - int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), - page, WxTempLateMsgUtil.REFUND_FAILED, formId); - return res; - } - //同意退款后发送微信提醒填写物流单号 - private int sendRefundLogisticsInfoToUser(ShopRefundRecord shopRefundRecord) { - ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); - if (order == null) { - throw new GlobleException("没有找到发送微信提醒的订单信息"); - } - List<String> msg = new ArrayList<>(); - //退款说明 - String remarks = "申请退款已审核通过,请尽快填写退货物流信息"; - msg.add(order.getOrderNo()); - msg.add("商品名称"); - msg.add("待退回"); - msg.add(remarks); - String formId = order.getWxOrderNo().split("=")[1]; - String page = "pages/refunding/refunding?id=" + shopRefundRecord.getId() + "&&inform=1"; - int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), - page, WxTempLateMsgUtil.WRITE_LOGISTICS, formId); - return res; - } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopShoppingCartAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopShoppingCartAction.java deleted file mode 100644 index c7e50a8..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopShoppingCartAction.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.matrix.system.shopXcx.action; - -import com.matrix.core.constance.MatrixConstance; -import com.matrix.core.constance.SystemMessageCode; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.ModelUtils; -import com.matrix.core.tools.StringUtils; -import com.matrix.core.constance.SystemErrorCode; -import com.matrix.core.anotations.RemoveRequestToken; -import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.hive.action.util.QueryUtil; -import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; -import org.springframework.stereotype.Controller; -import com.matrix.core.exception.GlobleException; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.matrix.core.anotations.SaveRequestToken; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.WebUtil; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.List; -import java.util.Map; -import com.matrix.system.shopXcx.bean.ShopShoppingCart; -import org.springframework.web.servlet.ModelAndView; - -/** - * @description 购物车 - * @author jiangyouyao - * @date 2019-06-12 19:09 - */ -@Controller -@RequestMapping(value = "admin/shopShoppingCart") -public class ShopShoppingCartAction { - - @Autowired - private ShopShoppingCartDao shopShoppingCartDao; - - //记录编辑前的值Before_Edit_Value - public static final String BEV="ShopShoppingCart_BEV"; - - - /** - * 列表显示 - */ - @RequestMapping(value = "/showList") - public @ResponseBody AjaxResult showList(ShopShoppingCart shopShoppingCart, PaginationVO pageVo) { - QueryUtil.setQueryLimitCom(shopShoppingCart); - List<ShopShoppingCart> dataList = shopShoppingCartDao.selectInPage(shopShoppingCart, pageVo); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, - shopShoppingCartDao.selectTotalRecord(shopShoppingCart)); - return result; - } - - /** - * 新增 - */ - @RemoveRequestToken - @RequestMapping(value = "/addShopShoppingCart") - public @ResponseBody AjaxResult addShopShoppingCart(ShopShoppingCart shopShoppingCart) { - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - shopShoppingCart.setCreateBy(user.getSuName()); - shopShoppingCart.setUpdateBy(user.getSuName()); - shopShoppingCart.setCompanyId(user.getCompanyId()); - int i=shopShoppingCartDao.insert(shopShoppingCart); - if(i > 0){ - return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, "购物车"); - }else { - throw new GlobleException(SystemErrorCode.DATA_ADD_FAIL); - } - } - - - - - - /** - * 修改 - */ - @RemoveRequestToken - @RequestMapping(value = "/modifyShopShoppingCart") - public @ResponseBody AjaxResult modifyShopShoppingCart(ShopShoppingCart newShopShoppingCart) { - ShopShoppingCart oldShopShoppingCart = WebUtil.getSessionAttribute(BEV); - int i = 0; - Map<String, Object> modifyMap = null; - try { - if (!ModelUtils.isModified(oldShopShoppingCart, newShopShoppingCart)) { - i = MatrixConstance.DML_SUCCESSS; - } - modifyMap = ModelUtils.comparePojo2Map(oldShopShoppingCart, newShopShoppingCart); - } catch (Exception e) { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newShopShoppingCart); - } - if (modifyMap.size() > 0) { - modifyMap.put("cartId", oldShopShoppingCart.getCartId()); - shopShoppingCartDao.updateByMap(modifyMap); - } - i = MatrixConstance.DML_SUCCESSS; - WebUtil.removeSessionAttribute(BEV); - if (i > 0) { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.UPDATE_SUCCES, "购物车"); - } else { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL); - } - } - - - - - /** - * 进入修改界面 - */ - @SaveRequestToken - @RequestMapping(value = "/editForm") - public ModelAndView editForm(Integer id) { - ShopShoppingCart shopShoppingCart = new ShopShoppingCart(); - ModelAndView modelAndView = new ModelAndView("admin/shopShoppingCart-form"); - if (id != null) { - shopShoppingCart = shopShoppingCartDao.selectById(id); - WebUtil.setSessionAttribute(BEV, shopShoppingCart); - } - modelAndView.addObject("obj",shopShoppingCart); - return modelAndView; - } - - - /** - * 删除 - */ - @RequestMapping(value = "/del") - public @ResponseBody AjaxResult del(String keys) { - List<String> ids = StringUtils.strToCollToString(keys, ","); - int i = shopShoppingCartDao.deleteByIds(ids); - if (i > 0) { - return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES, i); - } else { - throw new GlobleException(SystemErrorCode.DATA_DELETE_FAIL); - } - } - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopWxtemplateMsgAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopWxtemplateMsgAction.java index ec600ff..4252a42 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopWxtemplateMsgAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopWxtemplateMsgAction.java @@ -81,22 +81,8 @@ @RequestMapping(value = "/modifyShopWxtemplateMsg") public @ResponseBody AjaxResult modifyShopWxtemplateMsg(ShopWxtemplateMsg newShopWxtemplateMsg) { - ShopWxtemplateMsg oldShopWxtemplateMsg = WebUtil.getSessionAttribute(BEV); - int i = 0; - Map<String, Object> modifyMap = null; - try { - if (!ModelUtils.isModified(oldShopWxtemplateMsg, newShopWxtemplateMsg)) { - i = MatrixConstance.DML_SUCCESSS; - } - modifyMap = ModelUtils.comparePojo2Map(oldShopWxtemplateMsg, newShopWxtemplateMsg); - } catch (Exception e) { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newShopWxtemplateMsg); - } - if (modifyMap.size() > 0) { - modifyMap.put("id", oldShopWxtemplateMsg.getId()); - shopWxtemplateMsgDao.updateByMap(modifyMap); - } - i = MatrixConstance.DML_SUCCESSS; + + int i = shopWxtemplateMsgDao.updateByModel(newShopWxtemplateMsg); WebUtil.removeSessionAttribute(BEV); if (i > 0) { return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.UPDATE_SUCCES, "微信模板消息"); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java index 7f5344c..e055e95 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java @@ -1,23 +1,24 @@ package com.matrix.system.shopXcx.api; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.PropertiesUtil; -import com.matrix.core.tools.StringUtils; import com.matrix.component.tools.HttpRequest; import com.matrix.component.tools.HttpResponse; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.PropertiesUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; import net.sf.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import java.io.IOException; +@Service public class WeChatApiTools { - /** - * 小程序秘钥 - */ - private static final String XCX_SECRET = "xcx_secret"; - /** - * 小程序appid - */ - private static final String XCX_APPID = "xcx_appid"; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + /** * 微信登录url */ @@ -33,8 +34,6 @@ */ private static String accessToken = ""; - private static String appid = ""; - private static String secret = ""; /** @@ -46,34 +45,43 @@ * @param code * @return */ - public static String getXcxLoginUrl(String code) { + public String getXcxLoginUrl(String code,Long companyId) { String wechatLoginUrl = PropertiesUtil.getString(WECHAT_LOGIN_URL); - return String.format(wechatLoginUrl, getAppid(), getSecret(), code); + + return String.format(wechatLoginUrl, getAppid(companyId), getSecret(companyId), code); + } + + /** + * 获取管理端小程序登录地址 + * + * @param code + * @return + */ + public String getManagerXcxLoginUrl(String code) { + String wechatLoginUrl = PropertiesUtil.getString(WECHAT_LOGIN_URL); + String appId = PropertiesUtil.getString(AppConstance.MINI_PROGRAM_MANAGER_APP_ID); + String secret = PropertiesUtil.getString(AppConstance.MINI_PROGRAM_MANAGER_SECRET); + + return String.format(wechatLoginUrl, appId, secret, code); } /** * 获取小程序APPId * @return */ - public static String getAppid(){ - if(StringUtils.isBlank(appid)){ - appid = PropertiesUtil.getString(XCX_APPID); - } - return appid; + public String getAppid(Long companyId){ + BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); + return appId.getParamValue(); } /** * 获取小程序秘钥 * @return */ - public static String getSecret(){ - if(StringUtils.isBlank(secret)){ - secret = PropertiesUtil.getString(XCX_SECRET); - } - return secret; + public String getSecret(Long companyId){ + BusParameterSettings secret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_SECRET, companyId); + return secret.getParamValue(); } - - /** * 清空token @@ -83,7 +91,7 @@ accessToken = ""; } - public static String getAccessToken() throws IOException { + public String getAccessToken(Long companyId) throws IOException { if (isTokenInvalid()) { synchronized (accessToken) { @@ -93,7 +101,7 @@ HttpResponse result = null; result = reqObj .sendHttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" - + getAppid() + "&secret=" + getSecret(), null); + + getAppid(companyId) + "&secret=" + getSecret(companyId), null); JSONObject json = JSONObject.fromObject(result.getDataString()); String access_token = json.getString("access_token"); accessToken = access_token; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatGzhApiTools.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatGzhApiTools.java new file mode 100644 index 0000000..7c74df6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatGzhApiTools.java @@ -0,0 +1,134 @@ +package com.matrix.system.shopXcx.api; + +import com.matrix.component.tools.HttpRequest; +import com.matrix.component.tools.HttpResponse; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.PropertiesUtil; +import com.matrix.core.tools.StringUtils; +import net.sf.json.JSONObject; + +import java.io.IOException; + +/*** + * 公众号api工具 + */ +public class WeChatGzhApiTools { + /** + * 公众号秘钥 + */ + private static final String GZH_SECRET = "gzh_secret"; + /** + * 公众号appid + */ + private static final String GZH_APPID = "gzh_appid"; + /** + * 微信登录url + */ + private static final String WECHAT_LOGIN_URL = "wechar_login_url"; + + /** + * 上一次获取时间 + */ + private static Long preTime; + + /** + * 当前有效的微信token + */ + private static String accessToken = ""; + + private static String appid = ""; + private static String secret = ""; + + + + + /** + * 获取公众号APPId + * @return + */ + public static String getAppid(){ + if(StringUtils.isBlank(appid)){ + appid = PropertiesUtil.getString(GZH_APPID); + } + return appid; + } + + /** + * 获取公众号秘钥 + * @return + */ + public static String getSecret(){ + if(StringUtils.isBlank(secret)){ + secret = PropertiesUtil.getString(GZH_SECRET); + } + return secret; + } + + + + /** + * 清空token + */ + public static void cleanAccessToken() { + preTime = null; + accessToken = ""; + } + + public static String getAccessToken(String gzhAppId, String gzhSecret) { + + if (isTokenInvalid()) { + synchronized (accessToken) { + if (isTokenInvalid()) { + LogUtil.info("刷新微信accessToken"); + HttpRequest reqObj = new HttpRequest(); + HttpResponse result = null; + try { + result = reqObj + .sendHttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + + gzhAppId+ "&secret=" + gzhSecret, null); + } catch (IOException e) { + LogUtil.error("获取公众号accessToken失败"+e.getMessage(),e); + throw new GlobleException(e.getMessage()); + } + JSONObject json = JSONObject.fromObject(result.getDataString()); + + if(json.has("errmsg")){ + throw new GlobleException("获取返回刷新的accessToken失败"+json.toString()); + }else{ + String access_token = json.getString("access_token"); + accessToken = access_token; + preTime = System.currentTimeMillis(); + LogUtil.info("返回刷新的accessToken={}", accessToken); + return access_token; + } + + } else { + return accessToken; + } + } + } else { + LogUtil.info("返回现有accessToken={}", accessToken); + return accessToken; + } + } + + /** + * token是否无效 + * TODO 由于现在有多个环境,为了防止冲突每次都获取新的token + * @return + */ + private static boolean isTokenInvalid() { + /** if (StringUtils.isNotBlank(accessToken) && preTime != null) { + Long now = System.currentTimeMillis() / 1000; + Long pre = preTime / 1000; + boolean invalid = (now - pre) > 6200; + return invalid; + } else { + return true; + }*/ + return true; + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WxUserAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WxUserAction.java deleted file mode 100644 index 81ddb1d..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/WxUserAction.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.matrix.system.shopXcx.api; - -import com.alibaba.fastjson.JSON; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.biz.service.BizUserService; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.component.tools.HttpCurlUtil; -import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.StringUtils; -import com.matrix.core.web.BaseAction; -import com.matrix.system.common.constance.AppConstance; -import net.sf.json.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.Collections; -import java.util.Date; - -/** - * @description (用户表) - * @author jyy - * @date 2019-05-31 10:03 - */ -@Controller -@RequestMapping(value = "wxapi/user") -public class WxUserAction extends BaseAction { - - @Autowired - private BizUserService bizUserService; - - - @Autowired - private RedisUserLoginUtils redisUserLoginUtils; - @Autowired - private BizUserDao bizUserDao; - - - - - - @Autowired - private WeixinServiceUtil weixinServiceUtil; - - @Value("${debug}") - private String isDebug; - - /** - * 小程序登录 - * - * @author JIANGYOUYAO - * @email 935090232@qq.com - * @date 2018年5月23日 - * @param code - * @return - * @throws Exception - */ - @RequestMapping(value = "/login/{keys}") - public @ResponseBody - AjaxResult wxLogin(@PathVariable("keys") String code) throws Exception { - AjaxResult res = new AjaxResult(); - LogUtil.info("code:{}" + code); - if (StringUtils.isNotBlank(code)) { - String requrl = WeChatApiTools.getXcxLoginUrl(code); - String reslutData = HttpCurlUtil.sendGetHttp(requrl, null); - JSONObject json = JSONObject.fromObject(reslutData); - LogUtil.debug("微信登录获取到登录信息={}", json); - - if(json.containsKey("errcode")){ - res.setStatus(AjaxResult.STATUS_FAIL); - res.setInfo("自动登录失败"); - LogUtil.debug("微信登录获取到异常信息errcode"); - return res; - } - - String openId = json.getString("openid"); - String sessionKey = json.getString("session_key"); - LogUtil.debug("openId={},sessionKey={}", openId, sessionKey); - // 查询用户是否存在 - BizUser bizUser = null; - synchronized(this){ - bizUser = bizUserService.findByOpenId(openId); - if (bizUser == null) { - // 新增用户 - bizUser = new BizUser(); - bizUser.setSessionKey(sessionKey); - bizUser.setOpenId(openId); - bizUser.setLastLoginTime(new Date()); - bizUser.setUserType(AppConstance.USER_TYPE_CUSTOMER); - bizUserService.add(bizUser); - - } else { - bizUser.setSessionKey(sessionKey); - bizUser.setLastLoginTime(new Date()); - // 更新用户sessionKey - bizUserService.modifyByModel(bizUser); - } - } - // 存放redis - String token = redisUserLoginUtils.saveUserInfo(bizUser); - LogUtil.info("用户token={}", token); - res.putInMap("token", token); - res.putInMap("userInfo", bizUser); - res.setStatus(AjaxResult.STATUS_SUCCESS); - } else { - res.setStatus(AjaxResult.STATUS_FAIL); - res.setInfo("自动登录失败"); - } - return res; - } - - /** - * 查询用户信息 - */ - @RequestMapping(value = "/findUserInfo") - public @ResponseBody - AjaxResult findUserInfo() { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - String openId = loginUser.getOpenId(); - BizUser bizUser = bizUserService.findByOpenId(openId); - - //处理用户当前所在店铺 - /* - if(bizUser.getStaff()!=null){ - //当前用户是员工账号 - bizUser.setBusiness(bussinesssDao.selectById(bizUser.getStaff().getBusinessId())); - bizUser.setRole(bizUser.getStaff().getRole()); - }else{ - //当前用户是boss账号 - bizUser.setBusiness(bussinesssDao.findByUserOpenId(bizUser.getOpenId())); - bizUser.setRole(AppConstance.User_ROLE_BOSS); - }*/ - - AjaxResult res = new AjaxResult(); - res.putInMap("userInfo", bizUser); - res.setStatus(AjaxResult.STATUS_SUCCESS); - return res; - } - - /** - * 获取其他用户简化信息 - * @author JIANGYOUYAO - * @email 935090232@qq.com - * @date 2018年9月5日 - * @param openId - * @return - */ - @RequestMapping(value = "/getOtherUserInfo/{openId}") - public @ResponseBody - AjaxResult getOtherUserInfo(@PathVariable String openId) { - BizUser bizUser = bizUserService.findByOpenId(openId); - AjaxResult res = new AjaxResult(); - res.putInMap("userInfo", bizUser); - res.setStatus(AjaxResult.STATUS_SUCCESS); - return res; - } - - - /** - * 接收用户信息 - */ - @RequestMapping(value = "/saveUserInfo") - public @ResponseBody - AjaxResult saveUserInfo(@RequestBody BizUser bizUser) { - - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - bizUser.setUserId(loginUser.getUserId()); - // TODO 赋值操作 - int i = bizUserService.saveUserInfo(bizUser); - - if (i == 0) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败"); - } - return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(bizUser)); - } - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java index d940ea1..460abed 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java @@ -1,41 +1,42 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.component.tools.WxUtils; +import com.matrix.component.asyncmessage.AsyncMessageManager; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; -import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.LogUtil; import com.matrix.system.common.constance.AppConstance; -import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.ShoppingGoods; +import com.matrix.system.hive.bean.MoneyCardUse; +import com.matrix.system.hive.bean.MoneyCardUseFlow; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.MoneyCardUseDao; +import com.matrix.system.hive.dao.MoneyCardUseFlowDao; import com.matrix.system.hive.dao.ShoppingGoodsDao; -import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; -import com.matrix.system.shopXcx.api.pojo.CreateOrderDto; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.score.dao.ScoreVipDetailDao; import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO; +import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; +import com.matrix.system.shopXcx.api.service.OrderCouponGroupService; import com.matrix.system.shopXcx.api.service.ShoppingCartService; import com.matrix.system.shopXcx.api.service.WXShopOrderService; import com.matrix.system.shopXcx.api.service.WxShopCouponService; -import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; -import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; -import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; -import com.matrix.system.shopXcx.api.vo.ShopCartVo; -import com.matrix.system.shopXcx.bean.*; +import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; +import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoinUser; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.bean.ShopPayLog; import com.matrix.system.shopXcx.dao.*; -import com.matrix.system.shopXcx.dto.DiscountExplain; -import org.apache.commons.collections.CollectionUtils; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.*; /** @@ -53,19 +54,13 @@ @Autowired WxShopCouponService wxShopCouponService; - @Autowired - private ShopReceiveAddressDao shopReceiveAddressDao; @Autowired ShoppingCartService shoppingCartService; - @Autowired - private ShopCouponDao shopCouponDao; - @Autowired - private WxShopCouponUtil wxShopCouponUtil; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired ShopCouponRecordDao shopCouponRecordDao; @@ -75,278 +70,190 @@ @Autowired ShopProductDao shopProductDao; - @Autowired - private WxShopOrderUtil wxShopOrderUtil; @Autowired - private ShopOrderDetailsDao shopOrderDetailsDao; + OrderCouponGroupService orderCouponGroupService; + + @Autowired + private ShopPayLogDao shopPayLogDao; @Autowired ShopOrderDao shopOrderDao; + @Autowired + SysVipInfoDao sysVipInfoDao; + + @Autowired + private ShopActivitiesGroupJoinUserDao shopActivitiesGroupJoinUserDao; + + @Autowired + private ShopActivitiesGroupJoinDao shopActivitiesGroupJoinDao; + + @Autowired + private AsyncMessageManager asyncMessageManager; + + @Autowired + ShoppingGoodsDao shoppingGoodsDao; + + @Autowired + MoneyCardUseFlowDao moneyCardUseFlowDao; + + @Autowired + MoneyCardUseDao moneyCardUseDao; + + @Value("${evn}") + private String evn; + /** * 计算购物车订单价格 * - * @param addShopOrderPOJO + * @param shopOrderDto * @return * @throws Exception */ @PostMapping(value = "/calculationCartOrder") public @ResponseBody - AjaxResult calculationCartOrder(@RequestBody AddShopOrderPOJO addShopOrderPOJO) throws Exception { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); //计算购物车中物品的优惠信息 - - List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId()); - - - //取出购物车中选中的产品 - List<ShopShoppingCart> buyCart = new ArrayList<>(); - - //取出购物车中没有参加店铺活动的产品,和参加了店铺活动但是活动没有达到标准的产品,用来计算是否可以使用优惠券 - List<ShopShoppingCart> notCouponuyCart = new ArrayList<>(); - for (ShopCartVo shopCartVo : cartList) { - for (ShopShoppingCart shopShoppingCart : shopCartVo.getCartList()) { - if (shopShoppingCart.getIsSelected() == 1) { - buyCart.add(shopShoppingCart); - if (shopCartVo.getCoupon() == null || !shopCartVo.isSatisfactionCoupon()) { - notCouponuyCart.add(shopShoppingCart); - } - } - } - } - //获取当前购物车产品可用的优惠券 - List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(addShopOrderPOJO.getShopId(),notCouponuyCart); - - //获取用户使用的优惠券 - CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO(); - if (addShopOrderPOJO.getCouponReceiveId() == null) { - //如果用户没有选择优惠券则默认选优惠金额最高的 - //计算使用优惠券后的价格 - if (CollectionUtils.isNotEmpty(usefulCoupon)) { - //根据优惠券ID用户ID查询优惠券信息 - shopCoupon = usefulCoupon.get(0); - } - } else if (addShopOrderPOJO.getCouponReceiveId() != 1) { - //用户选择了优惠券 - shopCoupon = shopCouponRecordDao.selectMyCouponByReceiveId(addShopOrderPOJO.getCouponReceiveId()); - } else { - //用户不使用优惠券 - } - - - //计算收货地址: - - ShopReceiveAddress shopReceiveAddress = null; - if (addShopOrderPOJO.getReceiveAddrId() == null) { - //如果没有传收货地址则默认收货地址 - shopReceiveAddress = shopReceiveAddressDao.selectDefaultAddress(bizUser.getOpenId()); - if (shopReceiveAddress != null) { - addShopOrderPOJO.setReceiveAddrId(shopReceiveAddress.getAddrId()); - } - } else { - shopReceiveAddress = shopReceiveAddressDao.selectById(addShopOrderPOJO.getReceiveAddrId()); - addShopOrderPOJO.setReceiveAddrId(shopReceiveAddress.getAddrId()); - - } - - Integer addrId = null; - if (shopReceiveAddress != null) { - addrId = shopReceiveAddress.getAddrId(); - } - - //得到订单计价说明 - DiscountExplain discountExplain = shopOrderService.buildDiscountExplain(cartList, shopCoupon.getReceiveId(), addrId); - - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, buyCart, buyCart.size()); - //结算金额信息 - result.putInMap("discountExplain", discountExplain); - - - //用户优惠券 - result.putInMap("usefulCoupon", usefulCoupon); - //用户选中的优惠券 - result.putInMap("shopCoupon", shopCoupon); - - - //默认地址 - String deliverySelect = "立即配送"; - if (shopReceiveAddress != null) { - if (StringUtils.isNotBlank(shopReceiveAddress.getSchool())) { - deliverySelect = "立即配送"; - } else { - deliverySelect = "物流配送"; - } - } - result.putInMap("defaultAddress", shopReceiveAddress); - //配送方式 - result.putInMap("deliverySelect", deliverySelect); - - - result.setRows(buyCart); - return result; + AjaxResult calculationCartOrder(@RequestBody ShopOrderDto shopOrderDto) throws Exception { + return shopOrderService.buildDiscountExplain(shopOrderDto); } @Autowired - ShoppingGoodsDao shoppingGoodsDao; + private ScoreVipDetailDao scoreVipDetailDao; /** - * 新增订单 + * 新增微信支付订单 * - * @param addShopOrderPOJO + * @param shopOrderDto * @return */ @PostMapping(value = "/addShopOrder") public @ResponseBody - AjaxResult addShopOrder(@RequestBody AddShopOrderPOJO addShopOrderPOJO) throws Exception { - return shopOrderService.createShopOrder(addShopOrderPOJO); - } + AjaxResult addShopOrder(@RequestBody @Validated ShopOrderDto shopOrderDto) throws Exception { - - /** - * 新增订单 - * 本方法抛弃,不再使用,本方法是单单个产品购买 - * 在多产品的时候不适合 - * @return - */ - @Deprecated - @PostMapping(value = "/addShopOrder2") - public - @ResponseBody - AjaxResult addShopOrder2(@RequestBody CreateOrderDto createOrderDto) throws Exception { - - - //校验收货地址 - ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(createOrderDto.getReceiveAddrId()); - if (shopReceiveAddress == null) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择正确的收获地址"); - } - - - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - ShopSku shopSku = shopSkuDao.selectById(createOrderDto.getSkuId()); - ShopProduct shopProduct = shopProductDao.selectById(createOrderDto.getProductId()); - String stokCode = shopSku.getStockCode(); - - ShopOrder shopOrder = new ShopOrder(); - //查询绑定的产品是否为家居产品 - if (StringUtils.isNotBlank(stokCode)) { - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(Long.parseLong(stokCode)); - if (shoppingGoods != null) { - //根据购买的产品设置订单类型 - if (Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(shoppingGoods.getGoodType())) { - shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); - } else { - shopOrder.setOrderType(ShopOrder.ORDER_TYPE_SERVICE); - } - } else { - shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); - } - } - - List<ShopOrderDetails> details = new ArrayList<>(); - Integer cartCount = 0; - ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); - shopOrderDetails.setCreateBy(AppConstance.SYSTEM_USER); - shopOrderDetails.setUpdateBy(AppConstance.SYSTEM_USER); - shopOrderDetails.setpId(createOrderDto.getProductId()); - shopOrderDetails.setsId(createOrderDto.getSkuId()); - shopOrderDetails.setPrice(shopSku.getPrice()); - shopOrderDetails.setCount(createOrderDto.getNumber()); - shopOrderDetails.setsTitle(shopProduct.getTitle() + shopSku.getName()); - shopOrderDetails.setDiscountAmount(BigDecimal.ZERO); - shopOrderDetails.setTotalPrice(shopOrderDetails.getPrice().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); - details.add(shopOrderDetails); - cartCount += shopOrderDetails.getCount(); - - - //TODO 更新库存和销量[考虑和erp库存联动] - wxShopOrderUtil.updateProductAndSkuInfo(details); - - //用户openId - shopOrder.setUserId(bizUser.getOpenId()); - shopOrder.setCreateBy("微信小程序生成"); - shopOrder.setUpdateBy("微信小程序生成"); - shopOrder.setCommodityPrice(shopOrderDetails.getTotalPrice()); - shopOrder.setPurchaseQuantity(cartCount); - //购买方式 - shopOrder.setShippingMethod("物流配送"); - //生成订单号 - shopOrder.setOrderNo(WxUtils.getOrderNum()); - //设置支付状态 - shopOrder.setPayStatus(ShopOrder.ORDER_STATUS_WAIT_PAY); - //设置订单状态 - shopOrder.setOrderStatus(ShopOrder.ORDER_STATUS_WAIT_SEND); - - //设置退款费用(注:下次优化从数据字典表获取) - shopOrder.setRefundCharge(BigDecimal.ZERO); - //客户电话 - shopOrder.setUserTel(shopReceiveAddress.getAddrTelephone()); - //客户姓名 - shopOrder.setUserName(shopReceiveAddress.getAddrLiaisonman()); - //备注 - shopOrder.setRemarks(createOrderDto.getRemarks()); - //删除标识 - shopOrder.setDelFlag(AppConstance.DATA_USEABLE); - //微信订单号 - shopOrder.setWxOrderNo(""); - //微信支付结果 - shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY); - //如果没有提交购买方式或配送方式不是物流 - //获取邮费 - shopOrder.setOrderMoney(shopOrderDetails.getTotalPrice()); - shopOrder.setStoreId(createOrderDto.getShopId()); - - shopOrderDao.insert(shopOrder); - - wxShopOrderUtil.insertSendPackageInfo(shopOrder, "物流配送", shopReceiveAddress); - - //给订单详情表添加订单ID - shopOrderDetails.setOrderId(shopOrder.getId()); - - shopOrderDetailsDao.insert(shopOrderDetails); - - - BrandWCPayRequestData payData = startPayment(shopOrder); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(payData)); + ShopOrder shopOrder = shopOrderService.createShopOrder(shopOrderDto); + AjaxResult result = AjaxResult.buildSuccessInstance("订单创建成功"); result.putInMap("orderId", shopOrder.getId()); - + if (shopOrderDto.getPayMethod().equals(ShopOrder.SHOP_ORDER_PAY_METHOD_WX)) { + BrandWCPayRequestData payData = shopOrderService.startPayment(shopOrder); + result.setRows(Arrays.asList(payData)); + } return result; - - } - @Value("${wx_pay_debug_onoff}") - private boolean isDebug; - @Autowired - private WeixinServiceUtil weixinServiceUtil; + /** - * 开始付款 + * 余额支付确认 * - * @param shopOrder + * @param orderId * @return * @throws Exception */ - public BrandWCPayRequestData startPayment(ShopOrder shopOrder) throws Exception { - BigDecimal unit = new BigDecimal("100"); - BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString()); - BrandWCPayRequestData payData; - String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId()); - if (isDebug) { - payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(), - 1, shopOrder.getUserId(), String.valueOf(shopOrder.getId())); + @GetMapping(value = "/moneyCardPay/{orderId}") + @ResponseBody + @Transactional + public AjaxResult moneyCardPay(@PathVariable Integer orderId) throws Exception { + + ShopOrder order = shopOrderDao.selectById(orderId); + if (order != null + && ShopOrder.SHOP_ORDER_PAY_METHOD_VIPCARD == order.getPayMethod() + && ShopOrder.ORDER_PAY_STATUS_WAIT == order.getPayStatus()) { + + MoneyCardUse moneyCardUse = moneyCardUseDao.selectVipCard(order.getUserId()); + Double balance=moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney(); + if(balance>=order.getOrderMoney().doubleValue()){ + //扣减会员卡余额 + if(moneyCardUse.getRealMoney()>=order.getOrderMoney().doubleValue()){ + moneyCardUse.setRealMoney(moneyCardUse.getRealMoney()-order.getOrderMoney().doubleValue()); + }else{ + moneyCardUse.setGiftMoney(moneyCardUse.getGiftMoney()-(order.getOrderMoney().doubleValue()- moneyCardUse.getRealMoney() )); + moneyCardUse.setRealMoney(0D); + } + moneyCardUseDao.update(moneyCardUse); + //插入扣减记录 + MoneyCardUseFlow moneyCardUseFlow=new MoneyCardUseFlow(); + moneyCardUseFlow.setTotal(order.getOrderMoney().doubleValue()); + moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); + moneyCardUseFlow.setVipId(order.getUserId()); + moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CONSUMER); + moneyCardUseFlow.setOrderNo(order.getOrderNo()); + moneyCardUseFlow.setCreateTime(new Date()); + moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney()+moneyCardUse.getRealMoney()); + moneyCardUseFlow.setCardName(moneyCardUse.getCardName()); + moneyCardUseFlowDao.insert(moneyCardUseFlow); + + //构建需要修改订单信息Map + Map<String, Object> modifyMap = new HashMap<>(); + modifyMap.put("id", order.getId()); + //设置微信支付状态为已支付 + modifyMap.put("payResult", ShopOrder.ORDER_WX_STATUS_PAY_SUCCESS); + //设置支付状态为支付成功 + modifyMap.put("payStatus", ShopOrder.ORDER_PAY_STATUS_SUCCESS); + //如果是商品订单则进入待发货 + modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_SEND); + shopOrderDao.updateByMap(modifyMap); + + // 判断该订单是否为拼团产生的订单 + ShopActivitiesGroupJoinUser joinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByOrderId(order.getId().longValue()); + if (joinUser != null) { + joinUser.setIsHasPay(ShopActivitiesGroupJoinUser.IS_HAS_PAY_Y); + shopActivitiesGroupJoinUserDao.updateByModel(joinUser); + + ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectGroupAndPriceById(joinUser.getGjId()); + List<ShopActivitiesGroupJoinUser> joinUserList = shopActivitiesGroupJoinUserDao.selectGroupJoinUserListByGjId(joinUser.getGjId()); + LogUtil.info("#当前已支付完成:{}#", joinUserList.size()); + // 若拼团中已支付的数量等于几人团预设值,则更新拼团状态为拼团成功 + if (groupJoin.getGroupPrice().getGpCount() == joinUserList.size()) { + groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_SUCCESS); + } else { + if (joinUser.getUserId().equals(groupJoin.getGjHeadId())) { + groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_ING); + } + } + shopActivitiesGroupJoinDao.updateByModel(groupJoin); + + SysVipInfo sysVipInfo = sysVipInfoDao.selectByPhone(order.getUserTel(),order.getCompanyId()); + if (sysVipInfo != null) { + sysVipInfo.setIsDeal(SysVipInfo.DEAL_VIP); + sysVipInfoDao.update(sysVipInfo); + } + } + + // 根据订单类型创建不同的处理任务 + asyncMessageManager.sendMsg(AsyncMessageRouting.CREATE_ORDER ,"orderId=%s",orderId); + + //支付记录 + recordPayLog(Integer.valueOf(orderId), 1, order.getOrderNo(), order.getOrderMoney(), "会员卡余额支付成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); + + return AjaxResult.buildSuccessInstance("支付成功"); + + }else{ + return AjaxResult.buildFailInstance("会员卡余额不足"); + } + } else { - payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(), - unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId())); + LogUtil.info("订单状态不为待付款,order status=", order.getOrderStatus()); + return AjaxResult.buildFailInstance("订单不支持本次结算"); } - ShopOrder updateParam = new ShopOrder(); - updateParam.setId(shopOrder.getId()); - updateParam.setWxOrderNo(payData.getPrepay_id()); - shopOrderDao.updateByModel(updateParam); - return payData; + + } + + + private void recordPayLog(Integer orderId, Integer type, String orderNo, BigDecimal payMoney, String payRemark, int payStatus) { + //设置支付类型为收款 + ShopPayLog payLog = new ShopPayLog(); + payLog.setPayType(type); + payLog.setJoinId(orderId); + payLog.setPayMoney(payMoney); + payLog.setPayOrderNo(orderNo); + payLog.setPayRemark(payRemark); + payLog.setPayStatus(payStatus); + payLog.setCreateBy(AppConstance.SYSTEM_USER); + payLog.setUpdateBy(AppConstance.SYSTEM_USER); + shopPayLogDao.insert(payLog); } @@ -449,9 +356,9 @@ @GetMapping(value = "/getOrderStatusCount") @ResponseBody public AjaxResult getOrderStatusCount() { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); AjaxResult result = AjaxResult.buildSuccessInstance( - shopOrderDao.selectOrderStatusCount(bizUser.getOpenId())); + shopOrderDao.selectOrderStatusCount(sysVipInfo.getId())); return result; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java index 6b21617..ff3c95e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java @@ -1,18 +1,15 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.component.rabbitmq.RabiitMqTemplate; -import com.matrix.core.constance.MatrixConstance; +import com.matrix.component.tools.AES; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.component.tools.AES; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; import com.matrix.system.shopXcx.api.pojo.BindingPhoneNumberPOJO; import com.matrix.system.shopXcx.api.tools.SMSVerifiTools; import com.matrix.system.shopXcx.api.vo.DataDecipheringVo; -import com.matrix.system.shopXcx.mqTask.MQTaskRouting; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.RandomStringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -22,9 +19,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * @author jiangyouyao @@ -38,13 +33,11 @@ @Autowired private SMSVerifiTools sMSVerifiTools; @Autowired - private BizUserDao bizUserDao; + private SysVipInfoDao sysVipInfoDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; - @Autowired - private RabiitMqTemplate mqTemplate; @Value("${evn}") private String evn; @@ -62,9 +55,9 @@ if (StringUtils.isBlank(phoneNumber)) { return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空"); } - BizUser bizUser = new BizUser(); - bizUser.setPhoneNumber(phoneNumber); - List<BizUser> bizUsers = bizUserDao.selectByModel(bizUser); + SysVipInfo sysVipInfo = new SysVipInfo(); + sysVipInfo.setPhone(phoneNumber); + List<SysVipInfo> bizUsers = sysVipInfoDao.selectByModel(sysVipInfo); if (CollectionUtils.isNotEmpty(bizUsers) && bizUsers.size() > 0) { return new AjaxResult(AjaxResult.STATUS_FAIL, "该手机号已被绑定"); } @@ -101,17 +94,38 @@ if (StringUtils.isBlank(bindingPhoneNumber.getPhoneNumber())) { return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空"); } - //验证通过将手机号加入相应的用户数据中 - BizUser bizUser = new BizUser(); - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - bizUser.setUserId(loginUser.getUserId()); - bizUser.setPhoneNumber(bindingPhoneNumber.getPhoneNumber()); - bizUserDao.updateByModel(bizUser); + SysVipInfo loginUser = userCacheManager.getLoginUser(); - //绑定号码后同步到erp - mqTemplate.sendMsg(MQTaskRouting.CREATE_VIP + evn, loginUser.getOpenId()+","+bindingPhoneNumber.getShopId()); - return new AjaxResult(AjaxResult.STATUS_SUCCESS, "绑定成功"); + SysVipInfo oldeUser = sysVipInfoDao.selectByPhone(bindingPhoneNumber.getPhoneNumber(), loginUser.getCompanyId()); + if(oldeUser!=null){ + oldeUser.setIsSales(loginUser.getIsSales()); + oldeUser.setOpenId(loginUser.getOpenId()); + oldeUser.setSessionKey(loginUser.getSessionKey()); + oldeUser.setPhoto(loginUser.getAvatarUrl()); + oldeUser.setAvatarUrl(loginUser.getAvatarUrl()); + sysVipInfoDao.update(oldeUser); + sysVipInfoDao.deleteById(loginUser.getId()); + String token = userCacheManager.saveUserInfo(oldeUser); + AjaxResult result = AjaxResult.buildSuccessInstance("绑定成功"); + result.putInMap("token",token); + result.putInMap("userInfo",oldeUser); + return result; + }else{ + + //验证通过将手机号加入相应的用户数据中 + SysVipInfo sysVipInfo = new SysVipInfo(); + + sysVipInfo.setId(loginUser.getId()); + if(loginUser.getShopId()==null){ + sysVipInfo.setShopId(bindingPhoneNumber.getShopId()); + } + sysVipInfo.setPhone(bindingPhoneNumber.getPhoneNumber()); + sysVipInfoDao.update(sysVipInfo); + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "绑定成功"); + } + + } @@ -128,7 +142,7 @@ @RequestMapping(value = "/deciphering") public @ResponseBody AjaxResult deciphering(@RequestBody DataDecipheringVo dataDecipheringVo) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String session_key = loginUser.getSessionKey(); LogUtil.debug(dataDecipheringVo.toString()); String jsonResult = AES.wxDecrypt(dataDecipheringVo.getEncryptedData(), session_key, dataDecipheringVo.getIv()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java index fdbdbf6..7687443 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java @@ -1,9 +1,8 @@ package com.matrix.system.shopXcx.api.action; import com.matrix.core.pojo.AjaxResult; -import com.matrix.biz.bean.BizUser; - -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.shopXcx.bean.ShopCollection; import com.matrix.system.shopXcx.dao.ShopCollectionDao; import org.springframework.beans.factory.annotation.Autowired; @@ -27,7 +26,7 @@ @Autowired private ShopCollectionDao collectionDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; /** * 接收保存收藏数据 @@ -35,7 +34,7 @@ @PostMapping(value = "/saveCollection") public @ResponseBody AjaxResult saveCollection(@RequestBody ShopCollection collection) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); collection.setCreateBy(loginUser.getOpenId()); collection.setUpdateBy(loginUser.getOpenId()); collection.setCollUserid(loginUser.getOpenId()); @@ -72,7 +71,7 @@ @ResponseBody public AjaxResult deleteByProductId(@PathVariable("collProductid") Integer collProductid){ Map<String, Object> deleteMap = new HashMap<>(); - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String collUserid = loginUser.getOpenId(); deleteMap.put("collProductid", collProductid); deleteMap.put("collUserid", collUserid); @@ -91,7 +90,7 @@ @PostMapping("/findCollection") @ResponseBody public AjaxResult getCollectionByUserId(@RequestBody ShopCollection collection) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String userId = loginUser.getOpenId(); collection.setCollUserid(userId); List<ShopCollection> list = collectionDao.selectByUserId(collection); @@ -107,7 +106,7 @@ @PostMapping("/findByUserIdAndProid/{collProductid}") @ResponseBody public AjaxResult findByUserIdAndProid(@PathVariable("collProductid") Integer collProductid) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String userId = loginUser.getOpenId(); List<ShopCollection> list = collectionDao.selectByUserIdAndProid(collProductid,userId); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java index 568c875..1adc3d1 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java @@ -1,15 +1,21 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.component.rabbitmq.RabiitMqTemplate; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.LogUtil; +import com.matrix.component.asyncmessage.AsyncMessageManager; import com.matrix.component.wechat.externalInterface.common.Signature; import com.matrix.component.wechat.externalInterface.common.Util; import com.matrix.component.wechat.externalInterface.protocol.queryProtocol.NotifyData; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.hive.bean.MoneyCardUse; +import com.matrix.system.hive.bean.MoneyCardUseFlow; import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.MoneyCardUseDao; +import com.matrix.system.hive.dao.MoneyCardUseFlowDao; import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.score.service.ScoreVipDetailService; import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoinUser; import com.matrix.system.shopXcx.bean.ShopOrder; @@ -18,7 +24,8 @@ import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinUserDao; import com.matrix.system.shopXcx.dao.ShopOrderDao; import com.matrix.system.shopXcx.dao.ShopPayLogDao; -import com.matrix.system.shopXcx.mqTask.MQTaskRouting; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; @@ -26,12 +33,10 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import org.xml.sax.SAXException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; @@ -63,8 +68,6 @@ @Autowired private ShopPayLogDao shopPayLogDao; - @Autowired - private RabiitMqTemplate rabiitMqTemplate; @Autowired private ShopActivitiesGroupJoinUserDao shopActivitiesGroupJoinUserDao; @@ -75,18 +78,23 @@ @Autowired private SysVipInfoDao sysVipInfoDao; + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + ScoreVipDetailService scoreVipDetailService; + + @Autowired + AsyncMessageManager asyncMessageManager; + + @Value("${evn}") private String evn; /** * 微信支付回调接口 - * - * @param response - * @param request - * @throws IOException - * @throws Exception */ @Transactional(rollbackFor = Exception.class) - @RequestMapping(value = "/wxpayCallback") + @RequestMapping(value = "/wxapi/wxpayCallback") public void payCallBack(HttpServletResponse response, HttpServletRequest request) throws IOException { LogUtil.info("微信支付回调start...."); @@ -102,16 +110,26 @@ notityXml.append(inputLine); } request.getReader().close(); - // XMl转对象 - NotifyData data = (NotifyData) Util.getObjectFromXML(notityXml.toString(), NotifyData.class); - LogUtil.info(data.toString()); LogUtil.info("notityXml ---- :{} ", notityXml); + + + // XMl转对象 + Object bb = Util.getObjectFromXML(notityXml.toString(), NotifyData.class); + NotifyData data = new NotifyData(); + BeanUtils.copyProperties(bb,data); LogUtil.info("----return_code = {}", data.getReturn_code()); + // 返回状态码 SUCCESS/FAIL if (AppConstance.CODE_SUCCESS.equals(data.getReturn_code())) { + + orderId = data.getAttach(); + // 检验订单状态 + ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId)); + // 校验签名 - if (Signature.checkIsSignValidFromResponseString(notityXml.toString())) { + BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, order.getCompanyId()); + if (Signature.checkIsSignValidFromResponseString(notityXml.toString(),paySecret.getParamValue())) { // 校验业务结果 if (AppConstance.CODE_SUCCESS.equals(data.getResult_code())) { // 返回SUCCESS报文 @@ -120,14 +138,13 @@ Double total_fee = Double.parseDouble(data.getTotal_fee()); // 商户订单号 String payNum = data.getOut_trade_no(); - orderId = data.getAttach(); + LogUtil.info("支付回调关键信息---total_fee:{},payNum:{},orderId:{}", total_fee, payNum, orderId); // 订单ID BigDecimal payMoney = new BigDecimal(total_fee).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); - // 检验订单状态 - ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId)); + if (order != null && ShopOrder.ORDER_PAY_STATUS_WAIT == order.getPayStatus()) { ShopPayLog payLog = new ShopPayLog(); // TODO 校验支付金额 @@ -141,12 +158,12 @@ //设置支付状态为支付成功 modifyMap.put("payStatus", ShopOrder.ORDER_PAY_STATUS_SUCCESS); //设置订单状态 - if (ShopOrder.ORDER_TYPE_GOODS == order.getOrderType()) { + if (ShopOrder.SHIPPING_METHOD_WL == order.getShippingMethod()) { //如果是商品订单则进入待发货 modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_SEND); - } else { - //如果是服务订单则进入待评价 - modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_REMARK); + } else if (ShopOrder.SHIPPING_METHOD_MDZT == order.getShippingMethod()) { + //如果是门店自提则进入待收款 + modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_RECEIVE); } shopOrderDao.updateByMap(modifyMap); @@ -169,7 +186,7 @@ } shopActivitiesGroupJoinDao.updateByModel(groupJoin); - SysVipInfo sysVipInfo = sysVipInfoDao.selectByPhone(order.getUserTel()); + SysVipInfo sysVipInfo = sysVipInfoDao.selectByPhone(order.getUserTel(), order.getCompanyId()); if(sysVipInfo!=null){ sysVipInfo.setIsDeal(SysVipInfo.DEAL_VIP); sysVipInfoDao.update(sysVipInfo); @@ -178,14 +195,14 @@ } // 根据订单类型创建不同的处理任务 - rabiitMqTemplate.sendMsg(MQTaskRouting.CREATE_ORDER+evn, orderId); + asyncMessageManager.sendMsg(AsyncMessageRouting.CREATE_ORDER,"orderId=%s",orderId); threadResult.putInMap("status", "success"); resXml = AppConstance.RESULT_XML_SUCCESS; //支付记录 - recordPayLog(Integer.valueOf(orderId), payMoney, order, payLog, "支付成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); + recordPayLog(Integer.valueOf(orderId), 1, order.getOrderNo(), payMoney, "支付成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); } else { @@ -210,7 +227,7 @@ threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:003)"); resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "通信标识失败"); } - } catch (ParserConfigurationException | IOException | SAXException e) { + } catch (Exception e) { LogUtil.error("支付回调签名错误", e); threadResult.putInMap("status", "err"); threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:004)"); @@ -224,12 +241,137 @@ } - private void recordPayLog(Integer orderId, BigDecimal payMoney, ShopOrder order, ShopPayLog payLog, String payRemark, int payStatus) { + + @Autowired + MoneyCardUseFlowDao moneyCardUseFlowDao; + + @Autowired + MoneyCardUseDao moneyCardUseDao; + + /** + * 微信充值回调 + */ + @Transactional(rollbackFor = Exception.class) + @RequestMapping(value = "/wxapi/rechargeCallBack") + public void rechargeCallBack(HttpServletResponse response, HttpServletRequest request) throws IOException { + LogUtil.info("微信充值回调start...."); + + // 获取输入参数 + String inputLine; + StringBuffer notityXml = new StringBuffer(); + String resXml = ""; + String moneyCardUseFlowId = ""; + + AjaxResult threadResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, ""); + try { + while ((inputLine = request.getReader().readLine()) != null) { + notityXml.append(inputLine); + } + request.getReader().close(); + LogUtil.info("notityXml ---- :{} ", notityXml); + + + // XMl转对象 + Object bb = Util.getObjectFromXML(notityXml.toString(), NotifyData.class); + NotifyData data = new NotifyData(); + BeanUtils.copyProperties(bb,data); + LogUtil.info("----return_code = {}", data.getReturn_code()); + + + // 返回状态码 SUCCESS/FAIL + if (AppConstance.CODE_SUCCESS.equals(data.getReturn_code())) { + + moneyCardUseFlowId = data.getAttach(); + // 检验订单状态 + MoneyCardUseFlow moneyCardUseFlow = moneyCardUseFlowDao.selectById(Long.valueOf(moneyCardUseFlowId)); + SysVipInfo user=sysVipInfoDao.selectById(moneyCardUseFlow.getVipId()); + + // 校验签名 + BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, user.getCompanyId()); + if (Signature.checkIsSignValidFromResponseString(notityXml.toString(),paySecret.getParamValue())) { + // 校验业务结果 + if (AppConstance.CODE_SUCCESS.equals(data.getResult_code())) { + // 返回SUCCESS报文 + resXml = AppConstance.RESULT_XML_SUCCESS; + // 支付费用 + Double total_fee = Double.parseDouble(data.getTotal_fee()); + // 商户订单号 + String payNum = data.getOut_trade_no(); + + LogUtil.info("支付回调关键信息---total_fee:{},payNum:{},moneyCardUseFlowId:{}", total_fee, payNum, moneyCardUseFlowId); + // 订单ID + Double payMoney = new BigDecimal(total_fee).divide(new BigDecimal(100), 2, + BigDecimal.ROUND_HALF_DOWN).doubleValue(); + + if (moneyCardUseFlow.getCarUseId()==null) { + + if(payMoney.equals(moneyCardUseFlow.getTotal())){ + threadResult.putInMap("status", "success"); + resXml = AppConstance.RESULT_XML_SUCCESS; + MoneyCardUse moneyCardUse = moneyCardUseDao.selectVipCard(user.getId()); + moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); + moneyCardUseFlow.setCardName(moneyCardUse.getCardName()); + Double balance=moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney(); + moneyCardUseFlow.setBalance(balance==null?0:balance); + moneyCardUseFlowDao.update(moneyCardUseFlow); + + moneyCardUse.setRealMoney(moneyCardUse.getRealMoney()+payMoney.doubleValue()); + moneyCardUseDao.update(moneyCardUse); + + //充值记录 + recordPayLog(Integer.valueOf(moneyCardUseFlowId),2,moneyCardUseFlow.getPayNo(),new BigDecimal(payMoney), "充值成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); + }else{ + LogUtil.debug("支付金额不一致,检查支付金额payMoney={},order.getPayMoney()={}", payMoney, moneyCardUseFlow.getTotal()); + threadResult.putInMap("status", "err"); + threadResult.putInMap("msg", "支付金额不一致"); + resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "微信标识业务是失败"); + } + + } else { + LogUtil.info("充值已经确认"); + } + + } else { + LogUtil.info("微信标识业务是失败"); + threadResult.putInMap("status", "err"); + threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:001)"); + resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "微信标识业务是失败"); + } + } else { + LogUtil.info("无效签名"); + threadResult.putInMap("status", "err"); + threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:002)"); + resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "微信标识业务是失败"); + } + } else { + LogUtil.info("通信标识失败"); + threadResult.putInMap("status", "err"); + threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:003)"); + resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "通信标识失败"); + } + } catch (Exception e) { + LogUtil.error("支付回调签名错误", e); + threadResult.putInMap("status", "err"); + threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:004)"); + resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "支付回调签名错误"); + } finally { + // 通知线程消息 + PayThreadPool.notifyThread(Integer.valueOf(moneyCardUseFlowId), threadResult); + sendResultBack(response, resXml); + } + return; + + } + + + + private void recordPayLog(Integer orderId, Integer type,String orderNo, BigDecimal payMoney, String payRemark, int payStatus) { //设置支付类型为收款 - payLog.setPayType(1); + ShopPayLog payLog=new ShopPayLog(); + payLog.setPayType(type); payLog.setJoinId(orderId); payLog.setPayMoney(payMoney); - payLog.setPayOrderNo(order.getOrderNo()); + payLog.setPayOrderNo(orderNo); payLog.setPayRemark(payRemark); payLog.setPayStatus(payStatus); payLog.setCreateBy(AppConstance.SYSTEM_USER); @@ -262,4 +404,6 @@ return null; } + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java new file mode 100644 index 0000000..e127ce4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java @@ -0,0 +1,109 @@ +package com.matrix.system.shopXcx.api.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.system.app.authority.AppAuthorityManager; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.hive.bean.SysOrderFlow; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysOrderDao; +import com.matrix.system.hive.dao.SysOrderFlowDao; +import com.matrix.system.hive.dao.SysOrderItemDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.SysShopInfoService; +import com.matrix.system.shopXcx.api.dto.ErpOrderListDto; +import com.matrix.system.shopXcx.api.vo.ErpOrderDetailFlowVo; +import com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@Api(value = "WxErpOrderAction", tags = "小程序端Erp订单查询接口") +@RestController +@RequestMapping(value = "/wxapi/erpOrder") +public class WxErpOrderAction { + + @Autowired + private SysUsersService sysUsersService; + + @Autowired + private SysShopInfoService sysShopInfoService; + + @Autowired + private AppAuthorityManager authorityManager; + + + @Autowired + private SysVipInfoDao vipInfoDao; + + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + private SysOrderDao sysOrderDao; + + @Autowired + private SysOrderItemDao orderItemDao; + + @Autowired + private SysOrderFlowDao orderFlowDao; + + @Value("${file_storage_path}") + private String fileStoragePath; + @Value("${static_resource_url}") + private String nginxUrl; + + @ApiOperation(value = "查询用户所有在ERP中产生的订单") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) + }) + @PostMapping(value = "/findUserOrderList") + public AjaxResult findUserOrderList(@RequestBody @Validated ErpOrderListDto erpOrderListDto) { + SysVipInfo vipInfo = userCacheManager.getLoginUser(); + + erpOrderListDto.setVipId(vipInfo.getId()); + List<ErpOrderDetailVo> rows = sysOrderDao.selectErpOrderList(erpOrderListDto); + rows.forEach(item -> { + item.setItems(orderItemDao.selectErpOrderItemByOrderId(item.getOrderId())); + }); + return AjaxResult.buildSuccessInstance(rows, "查询成功"); + + + } + + @ApiOperation(value = "查询用户在ERP中的订单详情") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) + }) + @GetMapping(value = "/findUserOrderById/{orderId}") + public AjaxResult findUserOrderList(@PathVariable Long orderId) { + ErpOrderDetailVo order = sysOrderDao.findUserOrderById(orderId); + order.setItems(orderItemDao.selectErpOrderItemByOrderId(order.getOrderId())); + List<SysOrderFlow> sysOrderFlows = orderFlowDao.selectPayMethodsAmountByOrderId(orderId); + List<ErpOrderDetailFlowVo> flowVos = new ArrayList<>(); + sysOrderFlows.forEach(item -> { + ErpOrderDetailFlowVo erpOrderDetailFlowVo = new ErpOrderDetailFlowVo(); + BeanUtils.copyProperties(item, erpOrderDetailFlowVo); + flowVos.add(erpOrderDetailFlowVo); + }); + order.setFlow(flowVos); + AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); + result.putInMap("order", order); + return result; + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java index a416bb2..497ee2e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java @@ -1,11 +1,11 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.biz.bean.BizUser; - -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.system.shopXcx.bean.ShopWxAcode; import com.matrix.component.tools.WxacodeUtil; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.shopXcx.api.WeChatApiTools; +import com.matrix.system.shopXcx.bean.ShopWxAcode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -13,7 +13,7 @@ import java.util.Collections; /** - * @description 获取<link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">接口 + * @description 获取 * @author jiangyouyao * @date 2019-07-03 15:15 */ @@ -22,7 +22,9 @@ @RequestMapping(value = "wxapi/getAcode") public class WxGetAcodeAction { @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; + @Autowired + WeChatApiTools weChatApiTools; /** * 获取微信二维码 * @param @@ -31,11 +33,11 @@ @PostMapping("/getWxAcode") @ResponseBody public AjaxResult getWxAcode(@RequestBody ShopWxAcode wxAcode) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String openId = loginUser.getOpenId(); - //String openId = "omfv64kVgvGpz6D8p4J3WZYuT6M4"; try { - String wxacodeUrl = WxacodeUtil.getWxacode(wxAcode.getScene(), wxAcode.getPage(), wxAcode.getFileName()); + String wxacodeUrl = WxacodeUtil.getWxacode(wxAcode.getScene(), wxAcode.getPage(), wxAcode.getFileName(), + weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); String substring = wxacodeUrl.substring(0, 5); if("error".equals(substring)){ return new AjaxResult(AjaxResult.STATUS_FAIL, wxacodeUrl); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java index 89e9cf1..6175468 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java @@ -1,12 +1,11 @@ package com.matrix.system.shopXcx.api.action; import com.matrix.core.pojo.AjaxResult; -import com.matrix.biz.bean.BizUser; import com.matrix.system.common.bean.CustomerDataDictionary; -import com.matrix.system.common.dao.CustomerDataDictionaryDao; -import com.matrix.component.redis.RedisUserLoginUtils; import com.matrix.system.common.constance.AppConstance; - +import com.matrix.system.common.dao.CustomerDataDictionaryDao; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.shopXcx.bean.ShopInvoice; import com.matrix.system.shopXcx.dao.ShopInvoiceDao; import org.apache.commons.collections.CollectionUtils; @@ -30,7 +29,7 @@ @Autowired private ShopInvoiceDao invoiceDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; /** * 查询发票内容接口 @@ -51,7 +50,7 @@ @PostMapping(value = "/saveInvoice") public @ResponseBody AjaxResult saveInvoice(@RequestBody ShopInvoice shopInvoice) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); shopInvoice.setCreateBy(loginUser.getOpenId()); shopInvoice.setUpdateBy(loginUser.getOpenId()); shopInvoice.setUserId(loginUser.getOpenId()); @@ -82,7 +81,7 @@ @PostMapping("/findProductComment") @ResponseBody public AjaxResult getProductCommentByUserId(@RequestBody ShopInvoice shopInvoice) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String userId = loginUser.getOpenId(); shopInvoice.setUserId(userId); List<ShopInvoice> list = invoiceDao.selectByUserId(shopInvoice); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxMoneyCardUseAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxMoneyCardUseAction.java new file mode 100644 index 0000000..a00cfff --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxMoneyCardUseAction.java @@ -0,0 +1,171 @@ +package com.matrix.system.shopXcx.api.action; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; +import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.BasePageQueryDto; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.MoneyCardUse; +import com.matrix.system.hive.bean.MoneyCardUseFlow; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.MoneyCardUseFlowDao; +import com.matrix.system.hive.dao.MoneyCardUseV2Dao; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.shopXcx.api.dto.MoneyCardUseFlowDto; +import com.matrix.system.shopXcx.api.vo.WxMoneyCardUseVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author jyy + * @date 2021-04-09 + **/ +@Api(tags = "会员储值卡") +@RestController +@RequestMapping(value = "/wxapi/moneyCardUse") +public class WxMoneyCardUseAction { + + @Autowired + WeixinServiceUtil weixinServiceUtil; + + + @Autowired + private MoneyCardUseV2Dao moneyCardUseV2Dao; + + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + MoneyCardUseFlowDao moneyCardUseFlowDao; + + @Autowired + CodeService codeService; + + + + + @ApiOperation(value = "查询会员主卡", notes = "") + @GetMapping(value = "/getUserVipCard") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = WxMoneyCardUseVO.class) + }) + public AjaxResult getUserVipCard() { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("vip_id", sysVipInfo.getId()); + queryWrapper.eq("is_vip_car","Y"); + MoneyCardUse moneyCardUse = moneyCardUseV2Dao.selectOne(queryWrapper); + WxMoneyCardUseVO vo = new WxMoneyCardUseVO(); + BeanUtils.copyProperties(moneyCardUse, vo); + return AjaxResult.buildSuccessInstance(vo); + } + + + @ApiOperation(value = "查询会员储值卡", notes = "") + @PostMapping(value = "/getUserMoneyCardUseList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = WxMoneyCardUseVO.class) + }) + public AjaxResult getUserMoneyCardUseList(@RequestBody @Validated BasePageQueryDto pageDto) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("vip_id", sysVipInfo.getId()); + IPage<MoneyCardUse> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); + IPage pageList = moneyCardUseV2Dao.selectPage(page, queryWrapper); + List<WxMoneyCardUseVO> rows = (List<WxMoneyCardUseVO>) pageList.getRecords().stream().map(item -> { + WxMoneyCardUseVO vo = new WxMoneyCardUseVO(); + BeanUtils.copyProperties(item, vo); + return vo; + }).collect(Collectors.toList()); + System.out.println(rows.get(0).getId()); + return AjaxResult.buildSuccessInstance(rows); + } + + + + + @ApiOperation(value = "创建储值卡充值预付单", notes = "传入参数 {rechargeAmount:10} 最少充值1元,最多2位小数 ") + @PostMapping(value = "/createRechargeOrder") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + public AjaxResult createRechargeOrder(@RequestBody Map<String, String> param) throws Exception { + + String rechargeAmount = param.get("rechargeAmount"); + if (StringUtils.isBlank(rechargeAmount)) { + return AjaxResult.buildFailInstance("请输入充值金额"); + } + double total = new BigDecimal(rechargeAmount).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue(); + if (total < 0.02) { + return AjaxResult.buildFailInstance("充值金额最底1元"); + } + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); + moneyCardUseFlow.setVipId(sysVipInfo.getId()); + moneyCardUseFlow.setPayNo(codeService.get32LenNumberCode()); + moneyCardUseFlow.setTotal(total); + moneyCardUseFlow.setCreateTime(new Date()); + moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CZ); + moneyCardUseFlowDao.insert(moneyCardUseFlow); + moneyCardUseFlow.setContent("微信充值"); + BrandWCPayRequestData payData = weixinServiceUtil.createRechargeOrder("储值卡充值", moneyCardUseFlow.getPayNo(), + (int) (moneyCardUseFlow.getTotal() * 100), sysVipInfo.getOpenId(), String.valueOf(moneyCardUseFlow.getId())); + AjaxResult result = AjaxResult.buildSuccessInstance(payData); + result.putInMap("orderId", moneyCardUseFlow.getId()); + return result; + } + + @ApiOperation(value = "查询充值结果", notes = " ") + @GetMapping(value = "/getRechargePayStatus/{orderId}") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + public AjaxResult getRechargePayStatus(@PathVariable Long orderId) { + AjaxResult result =AjaxResult.buildSuccessInstance("查询成功"); + MoneyCardUseFlow moneyCardUseFlow = moneyCardUseFlowDao.selectById(orderId); + if (moneyCardUseFlow.getCarUseId() != null) { + result.putInMap("status", "success"); + result.putInMap("msg", "支付成功"); + } else { + LogUtil.debug("充值等待支付中={}。。。", orderId); + PayThreadPool.waitThread(orderId.intValue(), new Object()); + result = PayThreadPool.getThreadResult(orderId.intValue()); + LogUtil.debug("充值订单支付完成={}。。。", orderId); + } + return result; + } + + + + @ApiOperation(value = "查询会员储值卡充值使用记录", notes = "keywords 传入会员卡ID") + @PostMapping(value = "/getRechargeList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = MoneyCardUseFlow.class) + }) + public AjaxResult getRechargeList(@RequestBody @Validated MoneyCardUseFlowDto pageDto) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + pageDto.setCompanyId(sysVipInfo.getCompanyId()); + List<MoneyCardUseFlow> dataList = moneyCardUseFlowDao.selectForWxInPage(pageDto); + return AjaxResult.buildSuccessInstance(dataList); + } + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductAttributeAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductAttributeAction.java index 2adf5f8..07dbded 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductAttributeAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductAttributeAction.java @@ -28,9 +28,9 @@ @Autowired private ShopProductAttributeDao shopProductAttributeDao; - @RequestMapping("/getByCode/{shopId}/{attrCode}") + @RequestMapping("/getByCode/{attrCode}") @ResponseBody - public AjaxResult getProductAttributeByCode(@PathVariable("shopId") Long shopId, @PathVariable("attrCode") String attrCode){ + public AjaxResult getProductAttributeByCode(@PathVariable("attrCode") String attrCode){ if(!StringUtils.isNotBlank(attrCode)){ return new AjaxResult(AjaxResult.STATUS_FAIL,"属性编码不能为空"); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java index 9a13860..d4f04d6 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java @@ -1,10 +1,14 @@ package com.matrix.system.shopXcx.api.action; import com.matrix.core.pojo.AjaxResult; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.constance.AppConstance; - +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; import com.matrix.system.shopXcx.bean.ShopOrder; import com.matrix.system.shopXcx.bean.ShopProductComment; import com.matrix.system.shopXcx.dao.ShopOrderDao; @@ -30,10 +34,15 @@ @Autowired private ShopProductCommentDao productCommentDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopOrderDao shopOrderDao; + @Autowired + ScoreVipDetailService scoreVipDetailService; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; /** * 根据ID逻辑删除产品评价 * @param @@ -58,7 +67,7 @@ @PostMapping(value = "/saveProductComment") public @ResponseBody AjaxResult saveProductComment(@RequestBody List<ShopProductComment> commentList) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); int flag = 0; if(CollectionUtils.isNotEmpty(commentList)){ for(ShopProductComment productComment : commentList){ @@ -81,6 +90,13 @@ modifyMap.put("id", orderId); modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_ALREADY_REMARK); shopOrderDao.updateByMap(modifyMap); + + //添加用户积分 + BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP_NAME, loginUser.getCompanyId()); + scoreVipDetailService.addScoreByParamSetting(loginUser.getId(), null,null, commentList.get(0).getComId(), + ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"评价送积分", parameterSetting); + + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); } @@ -92,7 +108,7 @@ @PostMapping("/findProductComment") @ResponseBody public AjaxResult getProductCommentByUserId(@RequestBody ShopProductComment productComment) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String userId = loginUser.getOpenId(); productComment.setUserId(userId); List<ShopProductComment> list = productCommentDao.selectByUserId(productComment); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java index be633d2..889ac68 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java @@ -2,14 +2,13 @@ import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; import com.matrix.system.common.constance.AppConstance; - -import com.matrix.system.shopXcx.bean.ShopReceiveAddress; -import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.shopXcx.api.pojo.AddressUntilsPOJO; import com.matrix.system.shopXcx.api.tools.AddressUntils; +import com.matrix.system.shopXcx.bean.ShopReceiveAddress; +import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -30,14 +29,14 @@ private ShopReceiveAddressDao shopReceiveAddressDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; /** * 接收保存收货地址 */ @PostMapping(value = "/saveReceiveAddress") public @ResponseBody AjaxResult saveReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); receiveAddress.setCreateBy(loginUser.getOpenId()); receiveAddress.setUpdateBy(loginUser.getOpenId()); receiveAddress.setAddrUserid(loginUser.getOpenId()); @@ -94,7 +93,7 @@ @PostMapping("/findReceiveAddress") @ResponseBody public AjaxResult getByAddrUserId(@RequestBody ShopReceiveAddress receiveAddress) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String userId = loginUser.getOpenId(); receiveAddress.setAddrUserid(userId); List<ShopReceiveAddress> list = shopReceiveAddressDao.selectByModel(receiveAddress); @@ -110,7 +109,7 @@ @PostMapping("/findAddrByAddrId/{addrId}") @ResponseBody public AjaxResult getByAddrId(@PathVariable("addrId") Integer addrId) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); String userId = loginUser.getOpenId(); ShopReceiveAddress params = new ShopReceiveAddress(); params.setAddrUserid(userId); @@ -145,7 +144,7 @@ @PostMapping(value = "/updateReceiveAddress") public @ResponseBody AjaxResult updateReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); receiveAddress.setCreateBy(loginUser.getOpenId()); receiveAddress.setUpdateBy(loginUser.getOpenId()); receiveAddress.setAddrUserid(loginUser.getOpenId()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java index 9ad03ff..76de059 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java @@ -1,24 +1,22 @@ package com.matrix.system.shopXcx.api.action; +import com.matrix.component.tools.WxUtils; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.LogUtil; -import com.matrix.biz.bean.BizUser; -import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.CustomerDataDictionary; +import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.common.dao.CustomerDataDictionaryDao; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.system.common.constance.AppConstance; - +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; +import com.matrix.system.shopXcx.api.tools.SMSTools; import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; import com.matrix.system.shopXcx.bean.ShopOrder; import com.matrix.system.shopXcx.bean.ShopRefundRecord; import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; import com.matrix.system.shopXcx.dao.ShopOrderDao; import com.matrix.system.shopXcx.dao.ShopRefundRecordDao; -import com.matrix.component.tools.WxUtils; -import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; -import com.matrix.system.shopXcx.api.tools.SMSTools; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -40,7 +38,7 @@ @RequestMapping(value = "wxapi/RefundRecord") public class WxRefundRecordAction { @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopRefundRecordDao refundRecordDao; @Autowired @@ -105,6 +103,7 @@ return Double.valueOf(moneyStr); } + /** * 接收保存退款退货数据 */ @@ -112,10 +111,10 @@ @PostMapping(value = "/saveRefundRecord") public @ResponseBody AjaxResult saveRefundRecord(@RequestBody ShopRefundRecord refundRecord) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); refundRecord.setCreateBy(loginUser.getOpenId()); refundRecord.setUpdateBy(loginUser.getOpenId()); - refundRecord.setUserId(loginUser.getOpenId()); + refundRecord.setUserId(loginUser.getId()); refundRecord.setCompanyId(loginUser.getCompanyId()); refundRecord.setAuditStatus(AppConstance.REFUND_NOT_AUDITED); refundRecord.setRefundStatus(AppConstance.REFUND_PROCESSING); @@ -126,7 +125,7 @@ refundRecord.setApplyTime(new Date()); ShopRefundRecord record = new ShopRefundRecord(); - record.setUserId(loginUser.getOpenId()); + record.setUserId(loginUser.getId()); record.setOrderId(refundRecord.getOrderId()); List<ShopRefundRecord> shopRefundRecords = refundRecordDao.selectByModel(record); if(CollectionUtils.isNotEmpty(shopRefundRecords)){ @@ -137,13 +136,13 @@ if (i == 0) { return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); } - + ShopOrder order = shopOrderDao.selectById(refundRecord.getOrderId()); //未发货的订单取消订单不走后台审核直接退款 List<ShopRefundRecord> refundRecordsList = refundRecordDao.selectByModel(record); if(CollectionUtils.isNotEmpty(refundRecordsList)){ ShopRefundRecord shopRecord = refundRecordsList.get(0); Integer orderId = shopRecord.getOrderId(); - ShopOrder order = shopOrderDao.selectById(orderId); + if (order == null) { return new AjaxResult(AjaxResult.STATUS_FAIL, "未发货直接退款未找到订单信息"); } @@ -161,8 +160,11 @@ if(flag){ ShopRefundRecord fundRecord = refundRecordDao.selectById(shopRecord.getId()); - refundRecordService.sendRefundInfoToUser(fundRecord); refundRecordService.updateGroupBuyStatus(orderId.longValue()); + + + + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); } return new AjaxResult(AjaxResult.STATUS_FAIL, "退款失败"); @@ -175,25 +177,8 @@ modifyMap.put("id", orderId); modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_APPLY_MONEYBACK); shopOrderDao.updateByMap(modifyMap); - //从数据字典获取需要发送的手机号码和短信提醒内容 - BusParameterSettings busParameterSetting1 =busParameterSettingsDao.selectCompanyParamByCode("MSG_ALERT_CONTENT_REFUND",17L); - - String msg = busParameterSetting1.getParamValue(); - //TODO 写死微商城17L公司id - BusParameterSettings busParameterSetting= busParameterSettingsDao.selectCompanyParamByCode("MSG_ALERT_MOBILE",17L); - - - String phons = busParameterSetting.getParamValue(); - - phons.replace(',',','); - List<String> result = Arrays.asList(phons.split(",")); - if(CollectionUtils.isNotEmpty(result)){ - for(String phon : result){ - smsTools.sendMsg(phon, msg + "退订回T" ); - } - } return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); } @@ -207,9 +192,8 @@ @PostMapping("/findRefundRecord") @ResponseBody public AjaxResult getRefundRecordByUserId(@RequestBody ShopRefundRecord refundRecord) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - String userId = loginUser.getOpenId(); - refundRecord.setUserId(userId); + SysVipInfo loginUser = userCacheManager.getLoginUser(); + refundRecord.setUserId(loginUser.getId()); List<ShopRefundRecord> list = refundRecordDao.selectByRefundUserId(refundRecord); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); return result; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java new file mode 100644 index 0000000..3546918 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java @@ -0,0 +1,78 @@ +package com.matrix.system.shopXcx.api.action; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; +import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.shopXcx.api.dto.SaleOrderDto; +import com.matrix.system.shopXcx.vo.SalesOrderVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author jyy + * @date 2021-03-10 + **/ +@Api(tags = "分销订单接口类") +@RestController +@RequestMapping(value = "/wxapi/salesOrder") +public class WxSalesOrderAction { + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + ShopSalesmanApplyDao salesmanApplyDao; + + + @Autowired + ShopSalesmanApplyService shopSalesmanApplyService; + + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + private SysVipInfoDao sysVipInfoDao; + + @Autowired + private ShopSalesmanOrderDao shopSalesmanOrderDao; + + + @ApiOperation(value = "获取推广订单", notes = "") + @PostMapping(value = "/getOrderList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SalesOrderVo.class) + }) + AjaxResult getInvitationuserList(@RequestBody @Validated SaleOrderDto saleOrderDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Page<SalesOrderVo> page=new Page<>(saleOrderDto.getPageNum(),saleOrderDto.getPageSize()); + if(StringUtils.isBlank(saleOrderDto.getSort())){ + saleOrderDto.setSort("create_time"); + saleOrderDto.setOrder("desc"); + } + saleOrderDto.setUserId(loginUser.getId()); + IPage<SalesOrderVo> shopSalesmanApplyIPage = shopSalesmanOrderDao.selectSalesManOrder(page, saleOrderDto); + AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); + return result; + } + + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java new file mode 100644 index 0000000..3c51e23 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java @@ -0,0 +1,96 @@ +package com.matrix.system.shopXcx.api.action; + +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.shopXcx.api.dto.SaleProductDto; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.bean.ShopSku; +import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; +import com.matrix.system.shopXcx.dao.ShopProductDao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Objects; + +/** + * @author jyy + * @date 2021-03-10 + **/ +@Api(tags = "分销商品类") +@RestController +@RequestMapping(value = "/wxapi/salesProduct") +public class WxSalesProductAction { + + @Autowired + private ShopProductDao shopProductDao; + + @Autowired + private ShopProductAttributeDao shopProductAttributeDao; + @Autowired + private ShopSalesmanGradeDao shopSalesmanGradeDao; + @Autowired + private ShopSkuDao shopSkuDao; + @Autowired + private UserCacheManager userCacheManager; + + @ApiOperation(value = "查询推广商品", notes = "") + @PostMapping(value = "/getSalesProductList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response=SaleProductDto.class) + }) + public AjaxResult getShopProductShowList(@RequestBody @Validated SaleProductDto saleProductDto) { + ShopProduct shopProduct=new ShopProduct(); + shopProduct.setLimit(saleProductDto.getPageSize()); + shopProduct.setOffset((saleProductDto.getPageNum()-1)* saleProductDto.getPageSize()); + shopProduct.setCategoryId(saleProductDto.getCategoryId()); + shopProduct.setDelFlag(AppConstance.DATA_USEABLE); + shopProduct.setStatus(AppConstance.IS_PUTAWAY); + shopProduct.setAbleSales(ShopProduct.ABLE_SALES); + shopProduct.setCompanyId(HostInterceptor.getCompanyId()); + List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); + shopProducts.forEach(item->{ + List<ShopSku> shopSkus = shopSkuDao.selectByPid(item.getId()); + //计算产品佣金 + shopSkus.forEach(shopSku -> { + if(Objects.isNull(shopSku.getInvitationPrice())){ + shopSku.setInvitationPrice(shopSku.getPrice().multiply(BigDecimal.valueOf(shopSalesmanGrade.getInvitationCommission())).divide(BigDecimal.valueOf(100))); + } + if(Objects.isNull(shopSku.getSealesPrice())){ + shopSku.setSealesPrice(shopSku.getPrice().multiply(BigDecimal.valueOf(shopSalesmanGrade.getSealesCommission())).divide(BigDecimal.valueOf(100))); + } + if(Objects.isNull(shopSku.getSelfPrice())){ + shopSku.setSelfPrice(shopSku.getPrice().multiply(BigDecimal.valueOf(shopSalesmanGrade.getSelfCommission())).divide(BigDecimal.valueOf(100))); + } + }); + item.setSkus(shopSkus); + + }); + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopProducts); + return result; + } + + + + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java new file mode 100644 index 0000000..2c5cba2 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java @@ -0,0 +1,124 @@ +package com.matrix.system.shopXcx.api.action; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.BasePageQueryDto; +import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; +import com.matrix.system.fenxiao.entity.ShopRevenueFlow; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.shopXcx.api.dto.RevenueFlowDto; +import com.matrix.system.shopXcx.api.dto.WithdrawalCashDto; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + * @author jyy + * @date 2021-03-10 + **/ +@Api(tags = "提现接口类") +@RestController +@RequestMapping(value = "/wxapi/salesWithdrawal") +public class WxSalesWithdrawalAction { + + + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + private SysVipInfoDao sysVipInfoDao; + + @Autowired + private ShopRevenueFlowDao revenueFlowDao; + + + @Autowired + private ShopRevenueFlowDao shopRevenueFlowDao; + @Autowired + WeixinServiceUtil weixinServiceUtil; + + @Autowired + CodeService codeService; + + @ApiOperation(value = "获取收支明细", notes = "") + @PostMapping(value = "/getRevenueFlow") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ShopRevenueFlow.class) + }) + AjaxResult getInvitationuserList(@RequestBody @Validated RevenueFlowDto revenueFlowDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Page<ShopRevenueFlow> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize()); + revenueFlowDto.setUserId(loginUser.getId()); + IPage<ShopRevenueFlow> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page, revenueFlowDto); + AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); + return result; + } + + + @ApiOperation(value = "提现", notes = "") + @PostMapping(value = "/withdrawalCash") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = BasePageQueryDto.class) + }) + @Transactional + AjaxResult withdrawalCash(@RequestBody @Validated WithdrawalCashDto withdrawalCashDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + loginUser=sysVipInfoDao.selectById(loginUser.getId()); + if(withdrawalCashDto.getAmount()<1){ + return AjaxResult.buildFailInstance("最小提现金额为1元"); + }else if(withdrawalCashDto.getAmount()>20000){ + return AjaxResult.buildFailInstance("最大提现金额为2万元"); + }else{ + if(loginUser.getWithdrawalCash()==null || loginUser.getWithdrawalCash()<withdrawalCashDto.getAmount()){ + return AjaxResult.buildFailInstance("余额不足"); + }else{ + + String txNo = codeService.get32LenNumberCode(); + + /*调试注释 + weixinServiceUtil.comPay("提现", txNo,Integer.parseInt((withdrawalCashDto.getAmount()*1000)+""), + loginUser.getOpenId(),loginUser.getCompanyId()); + */ + //记录收益流水 + ShopRevenueFlow invitationRevenueFlow=new ShopRevenueFlow(); + invitationRevenueFlow.setCompanyId(loginUser.getCompanyId()); + invitationRevenueFlow.setCreateBy(MatrixConstance.SYSTEM_USER); + invitationRevenueFlow.setUpdateBy(txNo); + invitationRevenueFlow.setCreateTime(new Date()); + invitationRevenueFlow.setUpdateTime(new Date()); + invitationRevenueFlow.setAmount(-withdrawalCashDto.getAmount()); + invitationRevenueFlow.setUserId(loginUser.getId()); + invitationRevenueFlow.setRevenueContent("提现"); + shopRevenueFlowDao.insert(invitationRevenueFlow); + //扣除用户剩余提现金额 + loginUser.setWithdrawalCash(loginUser.getWithdrawalCash()-withdrawalCashDto.getAmount()); + sysVipInfoDao.update(loginUser); + userCacheManager.updateUserInfo(loginUser); + return AjaxResult.buildSuccessInstance("提现成功"); + } + } + + + } + + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java new file mode 100644 index 0000000..a2ecabf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java @@ -0,0 +1,310 @@ +package com.matrix.system.shopXcx.api.action; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.component.tools.ImageUtil; +import com.matrix.component.tools.WxacodeUtil; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.BasePageQueryDto; +import com.matrix.core.pojo.VerificationResult; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.MD5Util; +import com.matrix.core.tools.PropertiesUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanApply; +import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.shopXcx.api.WeChatApiTools; +import com.matrix.system.shopXcx.dao.ShopProductDao; +import com.matrix.system.shopXcx.vo.SalesmanApplyCondition; +import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; +import com.matrix.system.shopXcx.vo.SalesmanVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author wzy + * @date 2021-03-10 + **/ +@Api(tags = "推广员接口类") +@RestController +@RequestMapping(value = "/wxapi/salesman") +public class WxSalesmanAction { + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + ShopSalesmanApplyDao salesmanApplyDao; + + + @Autowired + ShopSalesmanApplyService shopSalesmanApplyService; + + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + private SysVipInfoDao sysVipInfoDao; + @Autowired + WeChatApiTools weChatApiTools; + + @Autowired + ShopProductDao shopProductDao; + + + @ApiOperation(value = "查询推广计划", notes = "") + @GetMapping(value = "/getTgPlan") + public AjaxResult getTgPlan() { + BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, HostInterceptor.getCompanyId()); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(busParameterSettings.getParamValue3()); + return ajaxResult; + } + + @ApiOperation(value = "查询分销商城开关", notes = "1开启分销,2关闭分销") + @GetMapping(value = "/getSalesMallSetting") + public AjaxResult getSalesMallSwith() { + BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId()); + BusParameterSettings fxModel = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_MODEL, HostInterceptor.getCompanyId()); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("查询成功"); + ajaxResult.putInMap("fxSwith", fxSwith.getParamValue()); + ajaxResult.putInMap("fxModel", fxModel.getParamValue()); + return ajaxResult; + } + + + @ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId ,非必填 例: {invitationId:openId}") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ShopSalesmanApply.class) + }) + @PostMapping(value = "/applyToBeAnSalesman") + @Transactional + public AjaxResult applyToBeAnSalesman(@RequestBody Map<String, String> param) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Long invitationId=null; + if(StringUtils.isNotBlank(param.get("invitationId"))){ + invitationId = Long.parseLong(param.get("invitationId")); + + SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId); + if (invitationUser != null && invitationUser.getId().equals(loginUser.getId())) { + return AjaxResult.buildFailInstance("不能邀请自己成为推广员"); + } + } + ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, invitationId, ShopSalesmanApply.APPLY_WAY_SELF); + loginUser = sysVipInfoDao.selectById(loginUser.getId()); + userCacheManager.updateUserInfo(loginUser); + return AjaxResult.buildSuccessInstance(shopSalesmanApply); + + + } + + + @ApiOperation(value = "查询审核进度", notes = "") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ShopSalesmanApply.class) + }) + @GetMapping(value = "/queryApplyProgress") + public AjaxResult queryApplyProgress() { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_id", loginUser.getId()); + queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH); + ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper); + return AjaxResult.buildSuccessInstance(shopSalesmanApply); + } + + + @ApiOperation(value = "绑定下级客户,当客户点击分销员分销的产品时调用", notes = "传入参数invitationId 必须 分销员userId例: {invitationId:userId}") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = Map.class) + }) + @PostMapping(value = "/bindingParentSalesman") + public AjaxResult bindingParentSalesman(@RequestBody Map<String, Long> param) { + Long invitationId = param.get("invitationId"); + + + + SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId); + if (invitationUser == null) { + return AjaxResult.buildFailInstance("请求参数错误"); + } + + SysVipInfo loginUser = userCacheManager.getLoginUser(); + if (invitationId.equals(loginUser.getId())) { + return AjaxResult.buildSuccessInstance("不能绑定自己"); + } + + loginUser = sysVipInfoDao.selectById(loginUser.getId()); + if (loginUser.getIsSales() == 1) { + return AjaxResult.buildSuccessInstance("只有非分销员才能被绑定成客户"); + } + if (loginUser.getRecommendId()!=null) { + return AjaxResult.buildSuccessInstance("已经被绑定"); + } else { + if (loginUser.getRecommendId()==null) { + sysVipInfoDao.bindingRecommend(invitationUser.getId(),loginUser.getId()); + return AjaxResult.buildSuccessInstance("绑定成功"); + } else { + return AjaxResult.buildSuccessInstance("已经存在上级"); + } + } + + + } + + + @ApiOperation(value = "生成邀请下级海报", notes = "") + @PostMapping(value = "/getInvitationPoster") + AjaxResult getInvitationPoster() { + try { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + + String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); + // 图片访问URL + String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL); + + //目标海报物理存储路径 + String targetImg = MD5Util.strToMD5(loginUser.getOpenId()) + "haibao.png"; + String targetImgPath = baseSavePath + "wxacode" + File.separatorChar + targetImg; + + String urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg; + + String qrcodeSavePath = WxacodeUtil.getWxacode(loginUser.getId() + "", "pages/distributorCenter/applyFor/applyFor", MD5Util.strToMD5(loginUser.getOpenId()) + "qrcode" + , weChatApiTools.getAppid(loginUser.getCompanyId()), weChatApiTools.getSecret(loginUser.getCompanyId())); + + BufferedImage qrcordImgBuf = ImageIO.read(new File(qrcodeSavePath)); + + //获取海报 + BusParameterSettings posterSetting = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, loginUser.getCompanyId()); + String posterPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "poster.png"; + ImageUtil.downloadPicture(posterSetting.getParamValue(), posterPath); + BufferedImage posterImgBuf = ImageIO.read(new File(posterPath)); + + //获取用户头像 + String userPhotoPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "userPhoto.png"; + ImageUtil.downloadPicture(loginUser.getAvatarUrl(), userPhotoPath); + BufferedImage userPhotoImgBuf = ImageIO.read(new File(userPhotoPath)); + + + BufferedImage backgroundImgBuf = new BufferedImage(700, 900, BufferedImage.TYPE_4BYTE_ABGR); + //绘制背景+产品 + Graphics2D g = backgroundImgBuf.createGraphics(); + g.setColor(Color.WHITE); + g.fillRect(0, 0, 700, 900); + g.drawImage(posterImgBuf, 0, 0, 700, 700, null); + + g.drawImage(userPhotoImgBuf, 20, 720, 80, 80, null); + + g.drawImage(qrcordImgBuf, 500, 720, 150, 150, null); + + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); + + g.setFont(new Font("WenQuanYi Micro Hei", Font.BOLD, 24)); + g.setColor(Color.BLACK); + g.drawString(loginUser.getNickName() + "邀请你一起推广赚佣金", 120, 750); + + g.dispose(); + ImageIO.write(backgroundImgBuf, "png", new File(targetImgPath)); + + return AjaxResult.buildSuccessInstance(urlPath); + } catch (Exception e) { + LogUtil.error("推广二维码生成错误:{}", e, ""); + return AjaxResult.buildFailInstance("二维码生成失败"); + } + + } + + + @ApiOperation(value = "获取下级列表", notes = "keywords=1 表示下级,keywords=2表示顾客") + @PostMapping(value = "/getInvitationuserList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SalesmanVo.class) + }) + AjaxResult getInvitationuserList(@RequestBody BasePageQueryDto pageDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Page<SalesmanVo> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); + IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getId(), pageDto.getKeywords()); + AjaxResult result = AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); + return result; + } + + + @ApiOperation(value = "查询分销员中心信息", notes = "") + @PostMapping(value = "/getSalesmanCenterInfo") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SalesmanCenterInfo.class) + }) + AjaxResult getSalesmanCenterInfo() { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + SalesmanCenterInfo salesmanCenterInfo = salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getId()); + return AjaxResult.buildSuccessInstance(salesmanCenterInfo); + } + + @ApiOperation(value = "查询分销员申请条件", notes = "") + @PostMapping(value = "/getSalesmanApplyCondition") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class) + }) + AjaxResult getSalesmanApplyCondition() { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getId(), loginUser.getCompanyId()); + SalesmanApplyCondition applyConditionInfo = new SalesmanApplyCondition(); + applyConditionInfo.setIsAbleApply(ableToBeAnSalesman.isJudgeResult()); + applyConditionInfo.setMsg(ableToBeAnSalesman.getMsg()); + + //申请条件 + BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, loginUser.getCompanyId()); + switch (applyCondition.getParamValue()) { + case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: + applyConditionInfo.setCondition("您已满足申请条件"); + break; + case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: + applyConditionInfo.setCondition("消费指定产品并确认收货"); + List<String> strings = StringUtils.strToColl(applyCondition.getParamValue1(), ","); + List<Integer> ids = strings.stream().filter(i -> StringUtils.isNotBlank(i)).map(i -> Integer.parseInt(i + "")).distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(ids)) { + applyConditionInfo.setProductList(shopProductDao.selectByIds(ids)); + } else { + return AjaxResult.buildFailInstance("未配置消费产品,请联系管理员"); + } + + break; + case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: + //判断用户是否有确认收货的产品 + applyConditionInfo.setCondition("消费任意产品并确认收货"); + break; + case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: + Double zdje = Double.parseDouble(applyCondition.getParamValue2()); + applyConditionInfo.setCondition("消费满" + zdje + "元确认收货"); + applyConditionInfo.setMinAmount(zdje); + } + + return AjaxResult.buildSuccessInstance(applyConditionInfo); + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java new file mode 100644 index 0000000..ebdc64d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java @@ -0,0 +1,72 @@ +package com.matrix.system.shopXcx.api.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.shopXcx.api.dto.SaleProductDto; +import com.matrix.system.shopXcx.api.dto.ScoreProductDto; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.bean.ShopProductAttribute; +import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; +import com.matrix.system.shopXcx.dao.ShopProductDao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author jyy + * @date 2021-03-10 + **/ +@Api(tags = "积分商品类") +@RestController +@RequestMapping(value = "/wxapi/scoreProduct") +public class WxScoreProductAction { + + @Autowired + private ShopProductDao shopProductDao; + + @Autowired + private ShopSkuDao shopSkuDao; + + @Autowired + ShopProductAttributeDao shopProductAttributeDao; + + @ApiOperation(value = "查询积分商品", notes = "") + @PostMapping(value = "/getScoreProductList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response=SaleProductDto.class) + }) + public AjaxResult getShopProductShowList(@RequestBody @Validated ScoreProductDto scoreProductDto) { + ShopProduct shopProduct=new ShopProduct(); + shopProduct.setLimit(scoreProductDto.getPageSize()); + shopProduct.setOffset((scoreProductDto.getPageNum()-1)* scoreProductDto.getPageSize()); + shopProduct.setScoreCategoryId(scoreProductDto.getScoreCategoryId()); + shopProduct.setDelFlag(AppConstance.DATA_USEABLE); + shopProduct.setStatus(AppConstance.IS_PUTAWAY); + shopProduct.setAbleScorePay(ShopProduct.PAYFOR_SCORE); + shopProduct.setCompanyId(HostInterceptor.getCompanyId()); + //根据属性查询 + if(StringUtils.isNotBlank(scoreProductDto.getAttrCode())){ + ShopProductAttribute jfscrmtj = shopProductAttributeDao.selectByCode("jfscrmtj", HostInterceptor.getCompanyId()); + if(jfscrmtj!=null){ + shopProduct.setAttrs(jfscrmtj.getAttrId()+""); + } + } + List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); + shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId()))); + return AjaxResult.buildSuccessInstance(shopProducts); + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java index dbf53bc..5232255 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java @@ -1,23 +1,22 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.component.tools.ImageUtil; import com.matrix.component.tools.WxacodeUtil; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.DateUtil; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.PropertiesUtil; -import com.matrix.core.tools.UUIDUtil; +import com.matrix.core.tools.*; import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.dao.SysVipInfoDao; import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.shopXcx.api.WeChatApiTools; import com.matrix.system.shopXcx.api.pojo.QrcodeImgParam; import com.matrix.system.shopXcx.api.vo.QrcodeVo; import com.matrix.system.shopXcx.api.vo.WxActivitiesGroupBuyVO; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; -import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; @@ -45,22 +44,21 @@ @CrossOrigin(origins = "*", maxAge = 3600) public class WxShareProductAction { - + @Autowired + WeChatApiTools weChatApiTools; @Autowired private ShopProductDao shopProductDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopShareQrcordDao shareQrcordDao; @Autowired private SysShopInfoDao shopInfoDao; - @Value(value = "${qrcodeBackgroundImgPath}") private String qrcodeBackgroundImgPath; - @Value(value = "${qrcodeFrontImgPath}") private String qrcodeFrontImgPath; @@ -69,7 +67,7 @@ ShopActivitiesGroupInfoDao shopActivitiesGroupInfoDao; @Autowired - BizUserDao bizUserDao; + SysVipInfoDao sysVipInfoDao; @Autowired @@ -81,6 +79,9 @@ @Autowired ShopActivitiesSeckillInfoDao shopActivitiesSeckillInfoDao; + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + /** * 生成二维码 */ @@ -88,8 +89,8 @@ @RequestMapping(value = "/getProductShareQrcode") public @ResponseBody AjaxResult getwxacode1(@RequestBody QrcodeVo qrcodeVo) throws Exception { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - loginUser = bizUserDao.selectById(loginUser.getUserId()); + SysVipInfo loginUser = userCacheManager.getLoginUser(); + loginUser = sysVipInfoDao.selectById(loginUser.getId()); //活动类型 ShopActivities activities=null; //是否为拼团分享 @@ -99,7 +100,7 @@ } ShopShareQrcord queryOrcode = new ShopShareQrcord(); queryOrcode.setProductId(qrcodeVo.getProductId()); - queryOrcode.setUserId(loginUser.getOpenId()); + queryOrcode.setUserId(loginUser.getId()); if (isGroupProduct ) { queryOrcode.setProductId(Integer.parseInt(qrcodeVo.getActId() + "")); @@ -114,7 +115,7 @@ //如果未查询到就先插入数据再更新数据 shareQrcord.setCreateBy(loginUser.getOpenId()); shareQrcord.setUpdateBy(loginUser.getOpenId()); - shareQrcord.setUserId(loginUser.getOpenId()); + shareQrcord.setUserId(loginUser.getId()); shareQrcord.setShopId(qrcodeVo.getShopId()); //拼团活动 if (isGroupProduct ) { @@ -137,7 +138,7 @@ qrcodeImgParam = getQrcodeImgParam(loginUser, qrcodeVo); shareQrcord.setProductId(qrcodeVo.getProductId()); } - + qrcodeImgParam.logo=""; //绘制二维码 drawQrcode(qrcodeImgParam); @@ -160,13 +161,14 @@ * @param qrcodeVo * @return */ - private QrcodeImgParam getSeckillQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { + private QrcodeImgParam getSeckillQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(qrcodeVo.getSkillId()); ShopProduct shopProduct = shopProductDao.selectById(seckillInfo.getGoodsId().intValue()); - String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()); + String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID() + ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); // 图片保存目录路径 @@ -186,8 +188,8 @@ qrcodeImgParam.targetImg = baseSavePath + "/" + "wxacode" + "/" + targetImg; qrcodeImgParam.title = "【秒杀】" + shopProduct.getTitle(); qrcodeImgParam.price = "¥" +seckillInfo.getSiPrice(); - qrcodeImgParam.logo = "深圳肽妍"; - qrcodeImgParam.couponName = loginUser.getNickName() + "邀您体验肽妍产品"; + + qrcodeImgParam.couponName = loginUser.getNickName() + "邀您体验"; return qrcodeImgParam; } @@ -198,13 +200,14 @@ * @param qrcodeVo * @return */ - private QrcodeImgParam getGroupQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { + private QrcodeImgParam getGroupQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { WxActivitiesGroupBuyVO groupBuyVO = shopActivitiesGroupInfoDao.selectGroupInfoWithPriceByActId(qrcodeVo.getActId()); ShopProduct shopProduct = shopProductDao.selectById(groupBuyVO.getGoodsId().intValue()); - String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()); + String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID() + ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); // 图片保存目录路径 @@ -224,17 +227,19 @@ qrcodeImgParam.targetImg = baseSavePath + "/" + "wxacode" + "/" + targetImg; qrcodeImgParam.title = "【拼团】" + shopProduct.getTitle(); qrcodeImgParam.price = "¥" + price.getGpPrice(); - qrcodeImgParam.logo = "深圳肽妍"; - qrcodeImgParam.couponName = loginUser.getNickName() + "邀您体验肽妍产品"; + + qrcodeImgParam.couponName = loginUser.getNickName() + "邀您体验"; return qrcodeImgParam; } - @NotNull - private QrcodeImgParam getQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { + private QrcodeImgParam getQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { ShopProduct shopProduct = shopProductDao.selectById(qrcodeVo.getProductId()); - String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()); + + + String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID() + ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); // 图片保存目录路径 @@ -242,7 +247,9 @@ // 图片访问URL String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL); String productImg = shopProduct.getImgMobile(); - productImg = productImg.replace(baseSaveUrl, baseSavePath); + String productPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "poster.png"; + ImageUtil.downloadPicture(productImg, productPath); +// productImg = productImg.replace(baseSaveUrl, baseSavePath); String targetImg = UUIDUtil.getRandomID() + ".png"; QrcodeImgParam qrcodeImgParam = new QrcodeImgParam(); @@ -250,14 +257,14 @@ qrcodeImgParam.qrcodeSavePath = qrcodeSavePath; qrcodeImgParam.qrcodeBackgroundImgPath = qrcodeBackgroundImgPath; qrcodeImgParam.qrcodeFrontImgPath = qrcodeFrontImgPath; - qrcodeImgParam.productImgPath = productImg; + qrcodeImgParam.productImgPath = productPath; qrcodeImgParam.urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg; qrcodeImgParam.targetImg = baseSavePath + "/" + "wxacode" + "/" + targetImg; qrcodeImgParam.title = shopProduct.getTitle(); qrcodeImgParam.price = "¥" + shopProduct.getPrice().toString(); - qrcodeImgParam.logo = "深圳肽妍"; + ShopCoupon shopCoupon = shopProduct.getShopCoupon(); - qrcodeImgParam.couponName = loginUser.getNickName() + "邀您体验肽妍产品"; + qrcodeImgParam.couponName = loginUser.getNickName() + "邀您体验"; if (shopCoupon != null) { String beginTiem = DateUtil.dateFormatStr(shopCoupon.getBeginTime(), DateUtil.DATE_FORMAT_SPLITE_DD); String endTiem = DateUtil.dateFormatStr(shopCoupon.getEndTime(), DateUtil.DATE_FORMAT_SPLITE_DD); @@ -303,7 +310,7 @@ g = b2Img.createGraphics(); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1)); g.drawImage(qrcordImgBuf, 320, 550, 140, 140, null); - g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); //标题 g.setColor(new Color(0xF10D0A0A, true)); Font font = new Font("微软雅黑", Font.PLAIN, 24); @@ -328,10 +335,11 @@ public static void main(String[] args) throws Exception { QrcodeImgParam qrcodeImgParam = new QrcodeImgParam(); - qrcodeImgParam.qrcodeSavePath = "C:\\Users\\Administrator\\Desktop\\dd\\ewm.png"; + qrcodeImgParam.qrcodeSavePath = "C:\\Users\\Administrator\\Desktop\\ewm.png"; qrcodeImgParam.qrcodeBackgroundImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\bj1.png"; qrcodeImgParam.qrcodeFrontImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\qj2.png"; - qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\banner.jpg"; +// qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\banner.jpg"; + qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\6cbfee5df0474fe0b864be142bc474ab.jpg"; qrcodeImgParam.targetImg = "C:\\Users\\Administrator\\Desktop\\dd\\banner111.jpg"; qrcodeImgParam.title = "盐酸米多君片"; qrcodeImgParam.price = "¥30"; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java index b33e744..2178071 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java @@ -1,10 +1,9 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.pojo.AjaxResult; import com.matrix.system.common.interceptor.HostInterceptor; -import com.matrix.system.hive.dao.SysVipInfoDao; import com.matrix.system.shopXcx.api.service.WXShopOrderService; import com.matrix.system.shopXcx.api.service.WxShopActivitiesGroupService; import com.matrix.system.shopXcx.api.vo.WxActivitiesGroupBuyVO; @@ -17,8 +16,6 @@ import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; -import java.util.Calendar; -import java.util.Date; import java.util.List; /** @@ -62,7 +59,7 @@ private ShopProductDao shopProductDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private WxShopActivitiesGroupService wxShopActivitiesGroupService; @@ -125,10 +122,10 @@ */ @GetMapping(value = "/findOwnerGroupBuyInfo/{actId}") public AjaxResult findOwnerGroupBuyInfo(@PathVariable("actId") Long actId) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); // 1、判断该用户在该活动中有没有正在拼团 若有,则返回正在拼团的用户列表,若没有则返回gruoping=1且返回正在拼团的拼团列表, 若加入了团未完成付款,则需要再做设置 - ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, bizUser.getOpenId()); + ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, sysVipInfo.getOpenId()); AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); if (isExsit == null) { ajaxResult.putInMap("grouping", 2); @@ -137,7 +134,7 @@ } else { ajaxResult.putInMap("grouping", 1); ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfoWithNoPay(isExsit.getId()); - ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(bizUser.getOpenId(), groupJoin.getId()); + ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(sysVipInfo.getOpenId(), groupJoin.getId()); ShopActivitiesGroupPrice price = shopActivitiesGroupPriceDao.selectById(groupJoin.getGpId()); int theLast = price.getGpCount() - groupJoin.getJoinUserList().size(); groupJoin.setTheLast(theLast); @@ -157,12 +154,12 @@ */ @GetMapping(value = "/findGroupJoinInfo/{gjId}") public AjaxResult findGroupJoinInfo(@PathVariable Long gjId) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfo(gjId); int isExist = 2; for (ShopActivitiesGroupJoinUser joinUser : groupJoin.getJoinUserList()) { - if (bizUser.getOpenId().equals(joinUser.getUserId())) { + if (sysVipInfo.getOpenId().equals(joinUser.getUserId())) { isExist = 1; } } @@ -201,6 +198,7 @@ @PostMapping(value = "/calPrice") public AjaxResult calPrice(@RequestBody CreateGroupBuyDTO createGroupBuyDTO) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); // 判断参数中gjId是否为空,若为空则为团长开团。再判断团长价是否为空,如果不为空则拥有团长价 if (createGroupBuyDTO.getGjId() == null) { @@ -212,7 +210,7 @@ } else { createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); } - BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getAddressId(), createGroupBuyDTO.getPrice()); + BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),sysVipInfo.getCompanyId()); BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(postage); AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); ajaxResult.putInMap("billPrice", createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount()))); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesLuckydrawAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesLuckydrawAction.java new file mode 100644 index 0000000..6cc7a00 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesLuckydrawAction.java @@ -0,0 +1,542 @@ +package com.matrix.system.shopXcx.api.action; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.activity.dao.ActivitySignAwardSetDao; +import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; +import com.matrix.system.activity.dao.ActivitySignRecordDao; +import com.matrix.system.activity.dao.ActivitySignWriteoffDao; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import com.matrix.system.activity.entity.ActivitySignReceiveRecord; +import com.matrix.system.activity.entity.ActivitySignRecord; +import com.matrix.system.activity.entity.ActivitySignWriteoff; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; +import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; +import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo; +import com.matrix.system.shopXcx.api.vo.LuckyDrawBasicInfoJsonVo; +import com.matrix.system.shopXcx.api.vo.LuckyDrawInfoVo; +import com.matrix.system.shopXcx.api.vo.LuckyDrawSuccessVo; +import com.matrix.system.shopXcx.bean.ShopActivities; +import com.matrix.system.shopXcx.bean.ShopCoupon; +import com.matrix.system.shopXcx.bean.ShopCouponRecord; +import com.matrix.system.shopXcx.dao.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Api(tags = "转盘抽奖活动接口类") +@RestController +@RequestMapping(value = "/wxapi/luckydraw") +public class WxShopActivitiesLuckydrawAction { + + @Autowired + private ShopActivitiesDao shopActivitiesDao; + + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + private ActivitySignAwardSetDao activitySignAwardSetDao; + + @Autowired + private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; + + @Autowired + private ActivitySignWriteoffDao activitySignWriteoffDao; + + @Autowired + private ActivitySignRecordDao activitySignRecordDao; + + @Autowired + ShopDeliveryInfoDao shopDeliveryInfoDao; + + @Autowired + private ShopLogisticsInfoDao shopLogisticsInfoDao; + @Autowired + private ShopReceiveAddressDao shopReceiveAddressDao; + + @Autowired + private WxShopLogisticsQueryService wxShopLogisticsQueryService; + @Autowired + private ScoreVipDetailService scoreVipDetailService; + @Autowired + private ShopCouponDao shopCouponDao; + @Autowired + private WxShopCouponUtil wxShopCouponUtil; + @Autowired + private ShopCouponRecordDao shopCouponRecordDao; + @Autowired + private ScoreVipDetailDao scoreVipDetailDao; + + @ApiOperation(value = "获取抽奖基本信息", notes = "") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = LuckyDrawInfoVo.class) + }) + @GetMapping(value = "/getLuckydrawBasicInfo") + public AjaxResult getLuckydrawBasicInfo() { + //获取登录人信息 + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Long companyId = loginUser.getCompanyId(); + Long userId = loginUser.getId(); + //获取抽奖活动的信息 + LuckyDrawInfoVo luckyDrawInfoVo = new LuckyDrawInfoVo(); + AjaxResult ajaxResult = new AjaxResult(); + + ShopActivities shopActivities = shopActivitiesDao.selectOneByCompanyIdAndActTypeAndActStatus(companyId,ShopActivities.ACTIVITIES_TYPE_LUCKYDRAW,ShopActivities.ACTSTATUS_STATUS_ING); + if(ObjectUtil.isEmpty(shopActivities)){ + ajaxResult = AjaxResult.buildFailInstance("活动还没有开始"); + ajaxResult.setData(luckyDrawInfoVo); + return ajaxResult; + } + Long actId = shopActivities.getId(); + luckyDrawInfoVo.setActName(shopActivities.getActName()); + luckyDrawInfoVo.setActCode(shopActivities.getActCode()); + luckyDrawInfoVo.setId(shopActivities.getId()); + String actContent = shopActivities.getActContent(); + LuckyDrawBasicInfoJsonVo luckyDrawBasicInfoJsonVo = JSON.parseObject(actContent, LuckyDrawBasicInfoJsonVo.class); + luckyDrawInfoVo.setLuckyDrawBasicInfoJsonVo(luckyDrawBasicInfoJsonVo); + + List<ActivitySignAwardSetVo> activitySignAwardSetVos = activitySignAwardSetDao + .selectListByActIDAndCompanyId(actId,companyId, ActivitySignAwardSet.AWARDSTATE_WORK); + luckyDrawInfoVo.setActivitySignAwardSetVos(activitySignAwardSetVos); + + /** + * 今日是否能参与 + * 用户今日剩余抽奖次数 + * 今日参与次数<每日允许最大参与次数都可以抽奖 + */ + //获取活动设置的参与次数 + Integer wmkcjjh = luckyDrawBasicInfoJsonVo.getWmkcjjh(); + //获取今日参与次数 + List<ActivitySignRecord> activityRecords = activitySignRecordDao.selectListByActIdAndUserIdLikesignTime(actId,userId,new Date()); + if(CollUtil.isNotEmpty(activityRecords)){ + if(activityRecords.size() >= wmkcjjh){ + luckyDrawInfoVo.setJoinState(LuckyDrawInfoVo.JOINSTATE_NOT); + luckyDrawInfoVo.setLuckyDrawTime(0); + }else{ + luckyDrawInfoVo.setJoinState(LuckyDrawInfoVo.JOINSTATE_YES); + luckyDrawInfoVo.setLuckyDrawTime(wmkcjjh-activityRecords.size()); + } + }else{ + luckyDrawInfoVo.setJoinState(LuckyDrawInfoVo.JOINSTATE_YES); + luckyDrawInfoVo.setLuckyDrawTime(wmkcjjh); + } + + //获取用户当前积分 + int totalScore = scoreVipDetailDao.selectUserTotalScore(userId); + luckyDrawInfoVo.setTotalScore(totalScore); + ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawInfoVo); + return ajaxResult; + } + + /** + * 点击抽奖 + * + */ + @ApiOperation(value = "点击抽奖", notes = "") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = LuckyDrawSuccessVo.class) + }) + + @GetMapping(value = "/clickLuckyDraw/{actId}") + @ResponseBody + @Transactional + public AjaxResult clickLuckyDraw(@PathVariable("actId") long actId) { + SysVipInfo user = userCacheManager.getLoginUser(); + Long userId = user.getId(); + Long companyId = user.getCompanyId(); + /** + * 活动是否存在 + * 活动是否已经开始 + * 免费抽奖还是积分抽奖 + * 积分抽奖一次一次换 + * 减少积分 + * 是否中奖 + * 中奖规则 + * 奖品处理 + * + */ + //活动是否存在 + ShopActivities shopActivities = shopActivitiesDao.selectById(actId); + if (ObjectUtil.isEmpty(shopActivities)) { + return AjaxResult.buildFailInstance("活动不存在"); + } + //活动是否已经开始 + Integer actStatus = shopActivities.getActStatus(); + if(ShopActivities.ACTSTATUS_STATUS_ING != actStatus) { + return AjaxResult.buildFailInstance("活动未开始"); + } + //获取今日抽奖总次数 + String actContent = shopActivities.getActContent(); + LuckyDrawBasicInfoJsonVo luckyDrawBasicInfoJsonVo = JSON.parseObject(actContent, LuckyDrawBasicInfoJsonVo.class); + List<ActivitySignRecord> activityRecords = activitySignRecordDao.selectListByActIdAndUserIdLikesignTime(actId,userId, DateUtil.date()); + if(CollUtil.isNotEmpty(activityRecords)){ + Integer wmkcjjh = luckyDrawBasicInfoJsonVo.getWmkcjjh(); + Integer jfdhcs = luckyDrawBasicInfoJsonVo.getJfdhcs(); + if(activityRecords.size() >= (wmkcjjh+jfdhcs)){ + return AjaxResult.buildFailInstance("明天再来抽奖吧"); + } + } + + //生成抽奖记录 + ActivitySignRecord activitySignRecordAdd = new ActivitySignRecord(); + activitySignRecordAdd.setCompanyId(companyId); + activitySignRecordAdd.setCreateBy(user.getVipName()); + activitySignRecordAdd.setCreateTime(DateUtil.date()); + activitySignRecordAdd.setUpdateBy(user.getVipName()); + activitySignRecordAdd.setUpdateTime(DateUtil.date()); + activitySignRecordAdd.setActivityId(actId); + activitySignRecordAdd.setSignTime(DateUtil.date()); + activitySignRecordAdd.setUserId(userId); + activitySignRecordDao.insert(activitySignRecordAdd); + + /** + 获取中奖概率 + 中奖了获取奖品ID + 没有中奖则获取谢谢参与的奖品ID + 每个人最多中奖次数 + */ + + List<LuckyDrawSuccessVo> luckyDrawSuccessVos = new ArrayList<>(); + + //获取谢谢参与奖 + QueryWrapper<ActivitySignAwardSet> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("award_rule",ActivitySignAwardSet.AWARDRULE_NORMAL); + queryWrapper.eq("company_id",companyId); + queryWrapper.eq("activity_id",actId); + ActivitySignAwardSet activitySignAwardSetNormal = activitySignAwardSetDao.selectOne(queryWrapper); + //每个人最多中奖次数 + Integer zzjcs = luckyDrawBasicInfoJsonVo.getZzjcs(); + QueryWrapper<ActivitySignReceiveRecord> queryWrapperActivitySignReceiveRecord = new QueryWrapper<>(); + queryWrapperActivitySignReceiveRecord.eq("company_id", companyId); + queryWrapperActivitySignReceiveRecord.eq("activity_id", actId); + queryWrapperActivitySignReceiveRecord.eq("user_id", userId); + queryWrapperActivitySignReceiveRecord.ne("award_id", activitySignAwardSetNormal.getId()); + List<ActivitySignReceiveRecord> activitySignReceiveRecordDone = activitySignReceiveRecordDao.selectList(queryWrapperActivitySignReceiveRecord); + if(CollUtil.isNotEmpty(activitySignReceiveRecordDone)){ + if(activitySignReceiveRecordDone.size() >= zzjcs){ + //生成领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(1); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetNormal.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetNormal.getIntroduceImg()); + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + return ajaxResult; + } + } + //总中奖率 + int zzjl = luckyDrawBasicInfoJsonVo.getZzjl(); + int randomInt = RandomUtil.randomInt(1, 100); + //不中奖的分界线 + int failureScope = 100 - zzjl; + if(failureScope >= randomInt){ + //生成领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(1); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetNormal.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetNormal.getIntroduceImg()); + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + return ajaxResult; + } + //中奖 + if(failureScope < randomInt){ + //获取奖品 + ActivitySignAwardSet activitySignAwardSetCumulativeDay = updateShopActivityAndAwardSet(actId); + + if(ObjectUtil.isNotEmpty(activitySignAwardSetCumulativeDay)){ + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(2); + luckyDrawSuccessVo.setAwardType(activitySignAwardSetCumulativeDay.getAwardType()); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetCumulativeDay.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetCumulativeDay.getIntroduceImg()); + luckyDrawSuccessVo.setAwardState(activitySignAwardSetCumulativeDay.getAwardState()); + //新增奖品领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetCumulativeDay.getId()); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + /** + * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) + * + * todo:4:店铺商品 + */ + //1:自定义产品 + if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_ING); + String randomString = StringUtils.getRandomString(8); + activitySignReceiveRecord.setWriteOffCode(randomString); + + /** + * 获取对应奖品的领取方式(兑奖方式(1:线下兑换2:物流配送3:客服兑换) + */ + luckyDrawSuccessVo.setWriteOffCode(randomString); + luckyDrawSuccessVo.setAwardWay(activitySignAwardSetCumulativeDay.getAwardWay()); + //2:物流配送 + luckyDrawSuccessVo.setOperationTip(activitySignAwardSetCumulativeDay.getOperationTip()); + //1:线下兑换 + if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay()) { + luckyDrawSuccessVo.setIntroduceTip(activitySignAwardSetCumulativeDay.getIntroduceTip()); + luckyDrawSuccessVo.setPrizeAddress(activitySignAwardSetCumulativeDay.getPrizeAddress()); + luckyDrawSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); + luckyDrawSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); + } + //3:客服兑换 + if(ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { + luckyDrawSuccessVo.setWechatImg(activitySignAwardSetCumulativeDay.getWechatImg()); + luckyDrawSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); + luckyDrawSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); + } + } + //2:积分 + if(ActivitySignAwardSet.AWARDTYPE_SCORE == activitySignAwardSetCumulativeDay.getAwardType()) { + luckyDrawSuccessVo.setScoreCnt(activitySignAwardSetCumulativeDay.getScoreCnt()); + } + //3:优惠券 + if(ActivitySignAwardSet.AWARDTYPE_COUPON == activitySignAwardSetCumulativeDay.getAwardType()) { + luckyDrawSuccessVo.setCouponName(activitySignAwardSetCumulativeDay.getCouponName()); + //获取优惠券 + int couponId = Integer.parseInt(activitySignAwardSetCumulativeDay.getCouponId()); + ShopCoupon shopCoupon = shopCouponDao.selectById(couponId); + // 如果没有找到该优惠券 + if (shopCoupon == null) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "没有找到该优惠券!"); + } + // 如果优惠券有数量限制并且已经领完 + if (shopCoupon.getMaxQuantity() >= 0 && (shopCoupon.getMaxQuantity() <= shopCoupon.getQuantityReceive())) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券已领完!"); + } + boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(userId); + // 如果改券是新人专属且当前用户不是新人 + if (AppConstance.COUPON_GET_LIMT_NEW.equals(shopCoupon.getGetLimit()) && !newPeople) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "该优惠券为新人专享优惠券!"); + } + ShopCouponRecord insertRecord = new ShopCouponRecord(); + insertRecord.setCreateBy(AppConstance.SYSTEM_USER); + insertRecord.setUpdateBy(AppConstance.SYSTEM_USER); + insertRecord.setCId(couponId); + insertRecord.setUserId(userId); + insertRecord.setIsUsing(2); + int i = shopCouponRecordDao.insert(insertRecord); + // 如果插入领取记录表失败 + if (i < 0) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券领取失败!"); + } + shopCoupon.setQuantityReceive(shopCoupon.getQuantityReceive() + 1); + shopCouponDao.updateByModel(shopCoupon); + } + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + //累计奖励积分,对应用户积分加减 + if(ActivitySignAwardSet.AWARDTYPE_SCORE == activitySignAwardSetCumulativeDay.getAwardType()) { + int awardType = activitySignAwardSetCumulativeDay.getAwardType(); + if(ActivitySignAwardSet.AWARDTYPE_SCORE == awardType){ + int scoreCnt = activitySignAwardSetCumulativeDay.getScoreCnt(); + if(scoreCnt > 0){ + scoreVipDetailService.addScore(userId,null,null,scoreCnt, + activitySignReceiveRecord.getId(), ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"积分"); + } + } + } + //生成核销记录 + if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { + ActivitySignWriteoff activitySignWriteoff = new ActivitySignWriteoff(); + //线下兑换和客服兑换 + if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay() + || ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { + activitySignWriteoff.setWriteoffCode(activitySignReceiveRecord.getWriteOffCode()); + } + activitySignWriteoff.setActId(actId); + activitySignWriteoff.setAwardId(activitySignAwardSetCumulativeDay.getId()); + activitySignWriteoff.setWinTime(DateUtil.date()); + if(ActivitySignAwardSet.AWARDWAY_TWO == activitySignAwardSetCumulativeDay.getAwardWay()) { + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_TWO); + }else { + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_ONE); + } + activitySignWriteoff.setUserId(userId); + activitySignWriteoff.setCompanyId(companyId); + activitySignWriteoff.setReceiveId(activitySignReceiveRecord.getId()); + activitySignWriteoff.setCreateBy(user.getVipName()); + activitySignWriteoff.setCreateTime(new Date()); + activitySignWriteoff.setUpdateBy(user.getVipName()); + activitySignWriteoff.setUpdateTime(new Date()); + activitySignWriteoffDao.insert(activitySignWriteoff); + } + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + }else{ + //生成领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(1); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetNormal.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetNormal.getIntroduceImg()); + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + return ajaxResult; + } + } + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + return ajaxResult; + } + + //获取奖品并索引+1 已领取+1 + public synchronized ActivitySignAwardSet updateShopActivityAndAwardSet(Long actId){ + //通过活动ID获取对应的活动 + ShopActivities shopActivities = shopActivitiesDao.selectById(actId); + String actContent = shopActivities.getActContent(); + LuckyDrawBasicInfoJsonVo luckyDrawBasicInfoJsonVo = JSON.parseObject(actContent, LuckyDrawBasicInfoJsonVo.class); + + //中奖索引 + Integer awrdLineIndex = luckyDrawBasicInfoJsonVo.getAwrdLineIndex(); + //中奖序列 + String awardLine = luckyDrawBasicInfoJsonVo.getAwardLine(); + ActivitySignAwardSet activitySignAwardSet = null; + if(awardLine.length() > 0) { + String substring = awardLine.substring(1, awardLine.length() - 1); + List<String> awardList = StrUtil.splitTrim(substring, ","); + if(awrdLineIndex < awardList.size()){ + //中奖 + Long awardId = Long.parseLong(awardList.get(awrdLineIndex + 1)); + ActivitySignAwardSet activitySignAwardSetGet = activitySignAwardSetDao.selectById(awardId); + //奖项库存数量 + int awardInventoryCnt = activitySignAwardSetGet.getAwardInventoryCnt(); + //已派发数量 + int awardDistributeCnt = activitySignAwardSetGet.getAwardDistributeCnt(); + if(awardDistributeCnt < awardInventoryCnt){ + activitySignAwardSet = activitySignAwardSetGet; + activitySignAwardSetGet.setAwardDistributeCnt(awardDistributeCnt +1); + activitySignAwardSetDao.updateById(activitySignAwardSetGet); + + //将基本信息转换成JSON字符串存储到活动主表的act_content字段 + luckyDrawBasicInfoJsonVo.setAwrdLineIndex(awrdLineIndex + 1); + String json= JSON.toJSONString(luckyDrawBasicInfoJsonVo); + shopActivities.setActContent(json); + shopActivitiesDao.updateByModel(shopActivities); + } + } + } + return activitySignAwardSet; + } + + /** + * 是否可以积分兑换 + * + * @param + * @return + */ + @ApiOperation(value = "是否可以积分兑换", notes = "") + @GetMapping(value = "scoreLuckyDraw/{actId}") + @ResponseBody + public AjaxResult logisticsInsureById(@PathVariable("actId") Long actId) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Long userId = loginUser.getId(); + Long companyId = loginUser.getCompanyId(); + //获取用户总积分 + int scoreAll = scoreVipDetailDao.selectUserTotalScore(userId); + //获取活动的积分换取 + ShopActivities shopActivities = shopActivitiesDao.selectById(actId); + String actContent = shopActivities.getActContent(); + LuckyDrawBasicInfoJsonVo luckyDrawBasicInfoJsonVo = JSON.parseObject(actContent, LuckyDrawBasicInfoJsonVo.class); + Integer dhycjfs = luckyDrawBasicInfoJsonVo.getDhycjfs(); + if(dhycjfs == 0){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "积分兑换不能兑换抽奖次数"); + } + if(scoreAll < dhycjfs){ + return new AjaxResult(AjaxResult.STATUS_FAIL, "积分不足"); + } + //获取今日抽奖总次数 + List<ActivitySignRecord> activityRecords = activitySignRecordDao.selectListByActIdAndUserIdLikesignTime(actId,userId, DateUtil.date()); + if(CollUtil.isNotEmpty(activityRecords)){ + Integer wmkcjjh = luckyDrawBasicInfoJsonVo.getWmkcjjh(); + Integer jfdhcs = luckyDrawBasicInfoJsonVo.getJfdhcs(); + if(activityRecords.size() >= (wmkcjjh+jfdhcs)){ + return AjaxResult.buildFailInstance("明天再来抽奖吧"); + } + } + //换取次数,减去积分 + scoreVipDetailService.deductionScore(userId,null,null,dhycjfs, + null, ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"兑换抽奖机会"); + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "兑换成功!"); + } + + + + + +} + diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java index ae9288b..6a3cd63 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java @@ -1,12 +1,12 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.LogUtil; import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.shopXcx.api.vo.SalonVO; import com.matrix.system.shopXcx.bean.ShopActivities; @@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.*; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; @@ -44,7 +43,7 @@ private ShopActivitiesSalonAttributeDao shopActivitiesSalonAttributeDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopActivitiesSalonRecordDao shopActivitiesSalonRecordDao; @@ -82,7 +81,7 @@ */ @GetMapping(value = "/findSalonInfoById/{id}") public AjaxResult findSalonInfoById(@PathVariable("id") Long id) { - BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo user = userCacheManager.getLoginUser(); ShopActivities shopActivities = shopActivitiesDao.selectSalonActivityById(id); ShopActivitiesSalonRecord salonRecord = shopActivitiesSalonRecordDao.selectSalonRecordByUserIdAndActId(user.getOpenId(), id); AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); @@ -105,7 +104,7 @@ @PostMapping(value = "/joinSalonActivity") @Transactional public AjaxResult joinSalonActivity(@RequestBody CreateSalonDTO salonDTO) { - BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo user = userCacheManager.getLoginUser(); ShopActivities shopActivities = shopActivitiesDao.selectById(salonDTO.getActId()); if (shopActivities == null) { @@ -128,7 +127,7 @@ ShopActivitiesSalonRecord salonRecord = new ShopActivitiesSalonRecord(); salonRecord.setActId(salonDTO.getActId()); - salonRecord.setUserId(user.getOpenId()); + salonRecord.setUserId(user.getId()); salonRecord.setCreateBy(user.getNickName()); salonRecord.setUpdateBy(user.getNickName()); salonRecord.setStatus(ShopActivitiesSalonRecord.JOIN_STATUS_ING); @@ -173,7 +172,7 @@ */ @RequestMapping(value = "/findSalonListByUser") public AjaxResult findSalonListByUser(@RequestBody SalonVO salonVO) { - BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo user = userCacheManager.getLoginUser(); salonVO.setUserId(user.getOpenId()); List<ShopActivities> list = shopActivitiesDao.selectSalonActivityByUser(salonVO); return AjaxResult.buildSuccessInstance(list); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java index af6cc71..4ddba04 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java @@ -1,5 +1,7 @@ package com.matrix.system.shopXcx.api.action; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.pojo.AjaxResult; import com.matrix.system.shopXcx.api.service.WXShopOrderService; import com.matrix.system.shopXcx.api.service.WxShopActivitiesSecKillService; @@ -37,7 +39,10 @@ @Autowired private WXShopOrderService wxShopOrderService; @Autowired - private WxShopActivitiesSecKillService wxShopActivitiesSecKillService; + private WxShopActivitiesSecKillService wxShopActvitiesSecKillService; + + @Autowired + private UserCacheManager userCacheManager; /** @@ -106,12 +111,13 @@ */ @PostMapping(value = "/calSecKillPrice") public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillVO.getId()); if (seckillInfo == null) { return AjaxResult.buildFailInstance("参数有误"); } - BigDecimal postage = wxShopOrderService.calculationPostage(secKillVO.getAddressId(), seckillInfo.getSiPrice()); + BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),sysVipInfo.getCompanyId()); BigDecimal payPrice = seckillInfo.getSiPrice().multiply(BigDecimal.valueOf(secKillVO.getCount())).add(postage); AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); ajaxResult.putInMap("totalPrice", payPrice); @@ -128,6 +134,6 @@ */ @PostMapping(value = "/createSecKill") public AjaxResult createSecKill(@RequestBody CreateSecKillDTO secKillDTO) throws Exception { - return wxShopActivitiesSecKillService.createSecKillOrder(secKillDTO); + return wxShopActvitiesSecKillService.createSecKillOrder(secKillDTO); } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java new file mode 100644 index 0000000..2385215 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java @@ -0,0 +1,700 @@ +package com.matrix.system.shopXcx.api.action; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUnit; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.activity.dao.ActivitySignAwardSetDao; +import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; +import com.matrix.system.activity.dao.ActivitySignRecordDao; +import com.matrix.system.activity.dao.ActivitySignWriteoffDao; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import com.matrix.system.activity.entity.ActivitySignReceiveRecord; +import com.matrix.system.activity.entity.ActivitySignRecord; +import com.matrix.system.activity.entity.ActivitySignWriteoff; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.api.dto.SeeAwardTextDto; +import com.matrix.system.shopXcx.api.dto.SignAwardDto; +import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; +import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; +import com.matrix.system.shopXcx.api.vo.*; +import com.matrix.system.shopXcx.bean.*; +import com.matrix.system.shopXcx.dao.*; +import com.matrix.system.shopXcx.vo.SalesOrderVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +@Api(tags = "签到活动接口类") +@RestController +@RequestMapping(value = "/wxapi/sign") +public class WxShopActivitiesSignAction { + + @Autowired + private ShopActivitiesDao shopActivitiesDao; + + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + private ActivitySignAwardSetDao activitySignAwardSetDao; + + @Autowired + private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; + + @Autowired + private ActivitySignWriteoffDao activitySignWriteoffDao; + + @Autowired + private ActivitySignRecordDao activitySignRecordDao; + + @Autowired + ShopDeliveryInfoDao shopDeliveryInfoDao; + + @Autowired + private ShopLogisticsInfoDao shopLogisticsInfoDao; + @Autowired + private ShopReceiveAddressDao shopReceiveAddressDao; + + @Autowired + private WxShopLogisticsQueryService wxShopLogisticsQueryService; + @Autowired + private ScoreVipDetailService scoreVipDetailService; + @Autowired + private ShopCouponDao shopCouponDao; + @Autowired + private WxShopCouponUtil wxShopCouponUtil; + @Autowired + private ShopCouponRecordDao shopCouponRecordDao; + + @ApiOperation(value = "获取签到基本信息", notes = "") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SignBasicInfoVo.class) + }) + @GetMapping(value = "/getSignBasicInfo") + public AjaxResult getSignBasicInfo() { + //获取登录人信息 + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Long companyId = loginUser.getCompanyId(); + Long userId = loginUser.getId(); + //获取签到活动的信息 + SignBasicInfoVo signBasicInfoVo = new SignBasicInfoVo(); + AjaxResult ajaxResult = new AjaxResult(); + + ShopActivities shopActivities = shopActivitiesDao.selectOneByCompanyIdAndActTypeAndActStatus(companyId,ShopActivities.ACTIVITIES_TYPE_SIGN,ShopActivities.ACTSTATUS_STATUS_ING); + if(ObjectUtil.isEmpty(shopActivities)){ + ajaxResult = AjaxResult.buildFailInstance("活动还没有开始"); + ajaxResult.setData(signBasicInfoVo); + return ajaxResult; + } + Long actId = shopActivities.getId(); + signBasicInfoVo.setActName(shopActivities.getActName()); + signBasicInfoVo.setActCode(shopActivities.getActCode()); + signBasicInfoVo.setId(shopActivities.getId()); + String actContent = shopActivities.getActContent(); + SignBasicInfoJsonVo signBasicInfoJsonVo = JSON.parseObject(actContent, SignBasicInfoJsonVo.class); + signBasicInfoVo.setSignBasicInfoJsonVo(signBasicInfoJsonVo); + + List<ActivitySignAwardSetVo> activitySignAwardSetVos = activitySignAwardSetDao + .selectListByActIDAndCompanyId(actId,companyId,ActivitySignAwardSet.AWARDSTATE_WORK); + signBasicInfoVo.setActivitySignAwardSetVos(activitySignAwardSetVos); + + //今日是否已经参与 + ActivitySignRecord activitySignRecord = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,new Date()); + if(ObjectUtil.isNotEmpty(activitySignRecord)) { + signBasicInfoVo.setJoinState(SignBasicInfoVo.JOINSTATE_SIGN); + }else { + signBasicInfoVo.setJoinState(SignBasicInfoVo.JOINSTATE_NOTSIGN); + } + /** + * 默认获取当前月份 + * 获取当前月份的天数 + */ + List<ActivitySignRecordVo> activitySignRecordVos = new ArrayList<>(); + //获取当前月的第一天是星期几 + DateTime dateTime = DateUtil.beginOfMonth(DateUtil.date()); + int i = DateUtil.dayOfWeek(dateTime); + for(int j = 1;j<i;j++){ + ActivitySignRecordVo activitySignRecordVoNull = new ActivitySignRecordVo(); + activitySignRecordVos.add(activitySignRecordVoNull); + } + List<String> monthFullDays = getMonthFullDay(DateUtil.year(DateUtil.date()), DateUtil.month(DateUtil.date()) + 1); + for(String monthFullDay : monthFullDays){ + ActivitySignRecordVo activitySignRecordVo = new ActivitySignRecordVo(); + activitySignRecordVo.setSignTime(monthFullDay); + activitySignRecordVo.setActivityId(actId); + activitySignRecordVo.setCompanyId(companyId); + //对应日期是否已签到 + Date date = DateUtil.parse(monthFullDay); + ActivitySignRecord activitySignRecordDone = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,date); + if(ObjectUtil.isNotEmpty(activitySignRecordDone)){ + activitySignRecordVo.setState(1); + }else{ + activitySignRecordVo.setState(2); + } + activitySignRecordVos.add(activitySignRecordVo); + } + signBasicInfoVo.setActivitySignRecords(activitySignRecordVos); + + //累计签到日期 + int cumulativeDay = getCumulativeDay(actId, userId, DateUtil.date(), 0); + signBasicInfoVo.setActAumulativeDay(cumulativeDay); + ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(signBasicInfoVo); + return ajaxResult; + } + + /** + * 查看历史签到记录 + * + * @param + * @return + */ + @ApiOperation(value = "查看历史签到记录", notes = "") + @GetMapping(value = "getSignRecord/{actId}/{month}") + @ResponseBody + public AjaxResult getSignRecord(@PathVariable("actId") long actId,@PathVariable("month") String dateStr) { + //获取登录人信息 + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Long companyId = loginUser.getCompanyId(); + Long userId = loginUser.getId(); + Date date = DateUtil.parse(dateStr); + /** + * 默认获取当前月份 + * 获取当前月份的天数 + */ + List<ActivitySignRecordVo> activitySignRecordVos = new ArrayList<>(); + //获取当前月的第一天是星期几 + DateTime dateTime = DateUtil.beginOfMonth(date); + int i = DateUtil.dayOfWeek(dateTime); + for(int j = 1;j<i;j++){ + ActivitySignRecordVo activitySignRecordVoNull = new ActivitySignRecordVo(); + activitySignRecordVos.add(activitySignRecordVoNull); + } + List<String> monthFullDays = getMonthFullDay(DateUtil.year(dateTime), DateUtil.month(dateTime) + 1); + for(String monthFullDay : monthFullDays){ + ActivitySignRecordVo activitySignRecordVo = new ActivitySignRecordVo(); + activitySignRecordVo.setSignTime(monthFullDay); + activitySignRecordVo.setActivityId(actId); + activitySignRecordVo.setCompanyId(companyId); + //对应日期是否已签到 + Date dateSign = DateUtil.parse(monthFullDay); + ActivitySignRecord activitySignRecordDone = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,dateSign); + if(ObjectUtil.isNotEmpty(activitySignRecordDone)){ + activitySignRecordVo.setState(1); + }else{ + activitySignRecordVo.setState(2); + } + activitySignRecordVos.add(activitySignRecordVo); + } + AjaxResult ajaxResult = new AjaxResult(); + ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(activitySignRecordVos); + return ajaxResult; + } + + /** + * java 获取 获取某年某月 所有日期(yyyy-mm-dd格式字符串) + * @param year + * @param month + * @return + */ + public List<String> getMonthFullDay(int year , int month){ + SimpleDateFormat dateFormatYYYYMMDD = new SimpleDateFormat("yyyy-MM-dd"); + List<String> fullDayList = new ArrayList<>(32); + // 获得当前日期对象 + Calendar cal = Calendar.getInstance(); + cal.clear();// 清除信息 + cal.set(Calendar.YEAR, year); + // 1月从0开始 + cal.set(Calendar.MONTH, month-1 ); + // 当月1号 + cal.set(Calendar.DAY_OF_MONTH,1); + int count = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + for (int j = 1; j <= count ; j++) { + fullDayList.add(dateFormatYYYYMMDD.format(cal.getTime())); + cal.add(Calendar.DAY_OF_MONTH,1); + } + return fullDayList; + } + + /** + * 获取当月的 天数 + * */ + public static int getCurrentMonthDay(Date date) { + Date beginOfMonth = DateUtil.beginOfMonth(date); + Date endOfMonth = DateUtil.endOfMonth(date); + long betweenDay = DateUtil.between(beginOfMonth, endOfMonth, DateUnit.DAY); + return Integer.parseInt(String.valueOf(betweenDay))+1; + } + + /** + * 点击签到 + * + */ + @ApiOperation(value = "点击签到", notes = "") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SignSuccessVo.class) + }) + + @GetMapping(value = "/clickSign/{actId}") + @ResponseBody + @Transactional + public AjaxResult clickSign(@PathVariable("actId") long actId) { + SysVipInfo user = userCacheManager.getLoginUser(); + Long userId = user.getId(); + Long companyId = user.getCompanyId(); + /** + * 活动是否存在 + * 活动是否已经开始 + * 今日是否已经参与 + * 新增签到记录表 + * 判断累计连续签到天数是否+1 + * 是否已领取 + * 查询是否有签到奖品 + * 日常奖励和自定义奖品 + * 生成核销记录 + */ + //活动是否存在 + ShopActivities shopActivities = shopActivitiesDao.selectById(actId); + if (ObjectUtil.isEmpty(shopActivities)) { + return AjaxResult.buildFailInstance("活动不存在"); + } + //活动是否已经开始 + Integer actStatus = shopActivities.getActStatus(); + if(ShopActivities.ACTSTATUS_STATUS_ING != actStatus) { + return AjaxResult.buildFailInstance("活动未开始"); + } + //今日是否已经参与 + ActivitySignRecord activitySignRecord = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,new Date()); + if (ObjectUtil.isNotEmpty(activitySignRecord)) { + return AjaxResult.buildFailInstance("今日用户已经签到成功"); + } + //前一天是否签到 + Date date = new Date(); + DateTime offsetDay = DateUtil.offsetDay(date, -1); + ActivitySignRecord activitySignRecordOld = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,offsetDay); + ActivitySignRecord activitySignRecordAdd = new ActivitySignRecord(); + activitySignRecordAdd.setCompanyId(companyId); + activitySignRecordAdd.setCreateBy(user.getVipName()); + activitySignRecordAdd.setCreateTime(new Date()); + activitySignRecordAdd.setUpdateBy(user.getVipName()); + activitySignRecordAdd.setUpdateTime(new Date()); + activitySignRecordAdd.setActivityId(actId); + activitySignRecordAdd.setSignTime(date); + activitySignRecordAdd.setUserId(userId); + if(ObjectUtil.isEmpty(activitySignRecordOld)) { + //新增签到记录表,累计连续签到天数是1 + activitySignRecordAdd.setCumulativeDay(1); + }else { + Integer cumulativeDay = activitySignRecordOld.getCumulativeDay(); + //新增签到记录表,累计连续签到天数是否+1 + activitySignRecordAdd.setCumulativeDay(cumulativeDay+1); + } + activitySignRecordDao.insert(activitySignRecordAdd); + /** + * 查询是否有签到奖品 + * 日常奖励和自定义奖品 + */ + List<SignSuccessVo> signSuccessVos = new ArrayList<>(); + //日常奖励,新增奖品领取记录 + QueryWrapper<ActivitySignAwardSet> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("award_rule",ActivitySignAwardSet.AWARDRULE_NORMAL); + queryWrapper.eq("company_id",companyId); + queryWrapper.eq("activity_id",actId); + ActivitySignAwardSet activitySignAwardSetNormal = activitySignAwardSetDao.selectOne(queryWrapper); + if(ObjectUtil.isNotEmpty(activitySignAwardSetNormal)) { + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(date); + activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + + SignSuccessVo signSuccessVo = new SignSuccessVo(); + signSuccessVo.setType(1); + signSuccessVo.setScoreCnt(activitySignAwardSetNormal.getScoreCnt()); + signSuccessVo.setAwardName(activitySignAwardSetNormal.getAwardName()); + signSuccessVo.setAwardImg(activitySignAwardSetNormal.getIntroduceImg()); + signSuccessVos.add(signSuccessVo); + + //日常奖励积分,对应用户积分加减 + int awardType = activitySignAwardSetNormal.getAwardType(); + if(ActivitySignAwardSet.AWARDTYPE_SCORE == awardType){ + int scoreCnt = activitySignAwardSetNormal.getScoreCnt(); + if(scoreCnt > 0){ + scoreVipDetailService.addScore(userId,null,null,scoreCnt, + activitySignReceiveRecord.getId(), ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"签到积分"); + } + } + //获取优惠券 + if(ActivitySignAwardSet.AWARDTYPE_COUPON == awardType){ + //获取优惠券 + int couponId = Integer.parseInt(activitySignAwardSetNormal.getCouponId()); + ShopCoupon shopCoupon = shopCouponDao.selectById(couponId); + // 如果没有找到该优惠券 + if (shopCoupon == null) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "没有找到该优惠券!"); + } + // 如果优惠券有数量限制并且已经领完 + if (shopCoupon.getMaxQuantity() >= 0 && (shopCoupon.getMaxQuantity() <= shopCoupon.getQuantityReceive())) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券已领完!"); + } + boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(userId); + // 如果改券是新人专属且当前用户不是新人 + if (AppConstance.COUPON_GET_LIMT_NEW.equals(shopCoupon.getGetLimit()) && !newPeople) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "该优惠券为新人专享优惠券!"); + } + ShopCouponRecord insertRecord = new ShopCouponRecord(); + insertRecord.setCreateBy(AppConstance.SYSTEM_USER); + insertRecord.setUpdateBy(AppConstance.SYSTEM_USER); + insertRecord.setCId(couponId); + insertRecord.setUserId(userId); + insertRecord.setIsUsing(2); + int i = shopCouponRecordDao.insert(insertRecord); + // 如果插入领取记录表失败 + if (i < 0) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券领取失败!"); + } + shopCoupon.setQuantityReceive(shopCoupon.getQuantityReceive() + 1); + shopCouponDao.updateByModel(shopCoupon); + } + } + //获取当前累计天数 + int cumulativeDay = getCumulativeDay(actId, userId, date, 0); + //自定义奖励 + QueryWrapper<ActivitySignAwardSet> queryWrapperCumulativeDay = new QueryWrapper<>(); + queryWrapperCumulativeDay.eq("award_rule",ActivitySignAwardSet.AWARDRULE_CUMULATIVEDAY); + queryWrapperCumulativeDay.eq("cumulative_day",cumulativeDay); + queryWrapperCumulativeDay.eq("company_id",companyId); + queryWrapperCumulativeDay.eq("activity_id",actId); +// ActivitySignAwardSet activitySignAwardSetCumulativeDay = activitySignAwardSetDao.selectOne(queryWrapperCumulativeDay); + List<ActivitySignAwardSet> activitySignAwardSetCumulativeDays = activitySignAwardSetDao.selectList(queryWrapperCumulativeDay); + if(CollUtil.isNotEmpty(activitySignAwardSetCumulativeDays)){ + for(ActivitySignAwardSet activitySignAwardSetCumulativeDay : activitySignAwardSetCumulativeDays){ + if(ObjectUtil.isNotEmpty(activitySignAwardSetCumulativeDay)) { + //是否已领取 + Long id = activitySignAwardSetCumulativeDay.getId(); + QueryWrapper<ActivitySignReceiveRecord> queryWrapperActivitySignReceiveRecord = new QueryWrapper<>(); + queryWrapperActivitySignReceiveRecord.eq("award_id", id); + queryWrapperActivitySignReceiveRecord.eq("company_id", companyId); + queryWrapperActivitySignReceiveRecord.eq("activity_id", actId); + queryWrapperActivitySignReceiveRecord.eq("user_id", userId); + ActivitySignReceiveRecord activitySignReceiveRecordDone = activitySignReceiveRecordDao.selectOne(queryWrapperActivitySignReceiveRecord); + if (ObjectUtil.isNotEmpty(activitySignReceiveRecordDone)) { + String awardNameCumulativeDay = activitySignAwardSetCumulativeDay.getAwardName(); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(awardNameCumulativeDay+"已经领取过了"); + ajaxResult.setData(signSuccessVos); + return ajaxResult; + } + + SignSuccessVo signSuccessVo = new SignSuccessVo(); + signSuccessVo.setType(2); + signSuccessVo.setAwardType(activitySignAwardSetCumulativeDay.getAwardType()); + signSuccessVo.setAwardName(activitySignAwardSetCumulativeDay.getAwardName()); + signSuccessVo.setAwardImg(activitySignAwardSetCumulativeDay.getIntroduceImg()); + signSuccessVo.setAwardState(activitySignAwardSetCumulativeDay.getAwardState()); + //新增奖品领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(date); + activitySignReceiveRecord.setAwardId(activitySignAwardSetCumulativeDay.getId()); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + /** + * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) + * + * todo:4:店铺商品 + */ + //1:自定义产品 + if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_ING); + String randomString = StringUtils.getRandomString(8); + activitySignReceiveRecord.setWriteOffCode(randomString); + + /** + * 获取对应奖品的领取方式(兑奖方式(1:线下兑换2:物流配送3:客服兑换) + */ + signSuccessVo.setWriteOffCode(randomString); + signSuccessVo.setAwardWay(activitySignAwardSetCumulativeDay.getAwardWay()); + //2:物流配送 + signSuccessVo.setOperationTip(activitySignAwardSetCumulativeDay.getOperationTip()); + //1:线下兑换 + if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay()) { + signSuccessVo.setIntroduceTip(activitySignAwardSetCumulativeDay.getIntroduceTip()); + signSuccessVo.setPrizeAddress(activitySignAwardSetCumulativeDay.getPrizeAddress()); + signSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); + signSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); + } + //3:客服兑换 + if(ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { + signSuccessVo.setWechatImg(activitySignAwardSetCumulativeDay.getWechatImg()); + signSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); + signSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); + } + } + //2:积分 + if(ActivitySignAwardSet.AWARDTYPE_SCORE == activitySignAwardSetCumulativeDay.getAwardType()) { + signSuccessVo.setScoreCnt(activitySignAwardSetCumulativeDay.getScoreCnt()); + } + //3:优惠券 + if(ActivitySignAwardSet.AWARDTYPE_COUPON == activitySignAwardSetCumulativeDay.getAwardType()) { + signSuccessVo.setCouponName(activitySignAwardSetCumulativeDay.getCouponName()); + //获取优惠券 + int couponId = Integer.parseInt(activitySignAwardSetCumulativeDay.getCouponId()); + ShopCoupon shopCoupon = shopCouponDao.selectById(couponId); + // 如果没有找到该优惠券 + if (shopCoupon == null) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "没有找到该优惠券!"); + } + // 如果优惠券有数量限制并且已经领完 + if (shopCoupon.getMaxQuantity() >= 0 && (shopCoupon.getMaxQuantity() <= shopCoupon.getQuantityReceive())) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券已领完!"); + } + boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(userId); + // 如果改券是新人专属且当前用户不是新人 + if (AppConstance.COUPON_GET_LIMT_NEW.equals(shopCoupon.getGetLimit()) && !newPeople) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "该优惠券为新人专享优惠券!"); + } + ShopCouponRecord insertRecord = new ShopCouponRecord(); + insertRecord.setCreateBy(AppConstance.SYSTEM_USER); + insertRecord.setUpdateBy(AppConstance.SYSTEM_USER); + insertRecord.setCId(couponId); + insertRecord.setUserId(userId); + insertRecord.setIsUsing(2); + int i = shopCouponRecordDao.insert(insertRecord); + // 如果插入领取记录表失败 + if (i < 0) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券领取失败!"); + } + shopCoupon.setQuantityReceive(shopCoupon.getQuantityReceive() + 1); + shopCouponDao.updateByModel(shopCoupon); + } + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + //累计奖励积分,对应用户积分加减 + if(ActivitySignAwardSet.AWARDTYPE_SCORE == activitySignAwardSetCumulativeDay.getAwardType()) { + int awardType = activitySignAwardSetCumulativeDay.getAwardType(); + if(ActivitySignAwardSet.AWARDTYPE_SCORE == awardType){ + int scoreCnt = activitySignAwardSetCumulativeDay.getScoreCnt(); + if(scoreCnt > 0){ + scoreVipDetailService.addScore(userId,null,null,scoreCnt, + activitySignReceiveRecord.getId(), ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"签到积分"); + } + } + } + //生成核销记录 + if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { + ActivitySignWriteoff activitySignWriteoff = new ActivitySignWriteoff(); + //线下兑换和客服兑换 + if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay() + || ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { + activitySignWriteoff.setWriteoffCode(activitySignReceiveRecord.getWriteOffCode()); + } + activitySignWriteoff.setActId(actId); + activitySignWriteoff.setAwardId(activitySignAwardSetCumulativeDay.getId()); + activitySignWriteoff.setWinTime(date); + if(ActivitySignAwardSet.AWARDWAY_TWO == activitySignAwardSetCumulativeDay.getAwardWay()) { + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_TWO); + }else { + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_ONE); + } + activitySignWriteoff.setUserId(userId); + activitySignWriteoff.setCompanyId(companyId); + activitySignWriteoff.setReceiveId(activitySignReceiveRecord.getId()); + activitySignWriteoff.setCreateBy(user.getVipName()); + activitySignWriteoff.setCreateTime(new Date()); + activitySignWriteoff.setUpdateBy(user.getVipName()); + activitySignWriteoff.setUpdateTime(new Date()); + activitySignWriteoffDao.insert(activitySignWriteoff); + } + signSuccessVos.add(signSuccessVo); + } + } + } + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("签到成功"); + ajaxResult.setData(signSuccessVos); + return ajaxResult; + } + /** + * 获取累计签到天数 + * @param actId + * @param userId + * @param date + * @return + */ + public int getCumulativeDay(long actId, long userId,Date date, int i) { + ActivitySignRecord activitySignRecordOld = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,date); + if(ObjectUtil.isEmpty(activitySignRecordOld)) { + return i; + } + i++; + DateTime offsetDay = DateUtil.offsetDay(date, -i); + return getCumulativeDay(actId,userId,offsetDay,i); + } + + + /** + * 获取累计的签到奖品 + * + * @return + */ + @ApiOperation(value = "获取累计的签到奖品", notes = "") + @PostMapping(value = "/getSignAwardList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SignAwardListVo.class) + }) + public AjaxResult getSignAwardList(@RequestBody @Validated SignAwardDto signAwardDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Page<SalesOrderVo> page=new Page<>(signAwardDto.getPageNum(),signAwardDto.getPageSize()); + if(StringUtils.isBlank(signAwardDto.getSort())){ + signAwardDto.setSort("create_time"); + signAwardDto.setOrder("desc"); + } + signAwardDto.setUserId(loginUser.getId()); + signAwardDto.setCompanyId(loginUser.getCompanyId()); + IPage<SignAwardListVo> signAwardListVos = activitySignReceiveRecordDao.selectSignAwardList(page,signAwardDto); + AjaxResult result=AjaxResult.buildSuccessInstance(signAwardListVos); + return result; + } + + /** + * 查看劵码 + * + * @return + */ + @ApiOperation(value = "查看劵码", notes = "") + @PostMapping(value = "/seeAwardText") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SeeAwardTextVo.class) + }) + public AjaxResult seeAwardText(@RequestBody @Validated SeeAwardTextDto seeAwardTextDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + seeAwardTextDto.setUserId(loginUser.getId()); + seeAwardTextDto.setCompanyId(loginUser.getCompanyId()); + SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); + AjaxResult result=AjaxResult.buildSuccessInstance(seeAwardTextVO); + return result; + } + + /** + * 物流配送信息查看 + * + * @return + */ + @ApiOperation(value = "物流配送信息查看", notes = "") + @PostMapping(value = "/logisticsInsure") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SeeAwardTextVo.class) + }) + public AjaxResult logisticsInsure(@RequestBody @Validated SeeAwardTextDto seeAwardTextDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + seeAwardTextDto.setUserId(loginUser.getId()); + seeAwardTextDto.setCompanyId(loginUser.getCompanyId()); + SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); + if(ObjectUtil.isEmpty(seeAwardTextVO)){ + return AjaxResult.buildFailInstance("奖品无法查看物流配送信息"); + } + long receiveId = seeAwardTextVO.getId(); + + //获取核销记录的ID + ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectActivitySignWriteoffByUserIDAndReceiveId(loginUser.getId(),receiveId); + if(ObjectUtil.isNotEmpty(activitySignWriteoff)){ + Integer logisticsId = activitySignWriteoff.getLogisticsId(); + ShopDeliveryInfo shopDeliveryInfo = shopDeliveryInfoDao.selectById(logisticsId); + if(ObjectUtil.isNotEmpty(shopDeliveryInfo)){ + //查看物流信息 + wxShopLogisticsQueryService.selectLogisticsInfo(shopDeliveryInfo); + List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); + seeAwardTextVO.setShopLogisticsInfos(shopLogisticsInfos); + } + } + AjaxResult result=AjaxResult.buildSuccessInstance(seeAwardTextVO); + return result; + } + + /** + * 物流配送收货地址保存 + * + * @param + * @return + */ + @ApiOperation(value = "物流配送收货地址保存", notes = "") + @GetMapping(value = "logisticsInsureAddress/{addressId}/{receiveId}") + @ResponseBody + public AjaxResult logisticsInsureAddress(@PathVariable("addressId") int addressId,@PathVariable("receiveId") long receiveId) { + ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(addressId); + if(ObjectUtil.isEmpty(shopReceiveAddress)){ + return AjaxResult.buildFailInstance("收货地址无效"); + } + ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(receiveId); + //该奖品不是待领取状态 + if (ActivitySignReceiveRecord.STATE_DONE == activitySignReceiveRecord.getState() + || ActivitySignReceiveRecord.STATE_FOUR == activitySignReceiveRecord.getState() + || ActivitySignReceiveRecord.STATE_FIVE == activitySignReceiveRecord.getState()) { + return AjaxResult.buildFailInstance("无法修改收货信息"); + } + activitySignReceiveRecord.setConsigneeAddress(shopReceiveAddress.getAddrRegion()+"-"+shopReceiveAddress.getAddrDetailaddr()+"-"+shopReceiveAddress.getDormitory()); + activitySignReceiveRecord.setConsignee(shopReceiveAddress.getAddrLiaisonman()); + activitySignReceiveRecord.setConsigneePhone(shopReceiveAddress.getAddrTelephone()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_THREE); + activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "设置成功!"); + } + + /** + * 物流配送确认收货 + * + * @param + * @return + */ + @ApiOperation(value = "物流配送确认收货", notes = "") + @GetMapping(value = "logisticsInsureById/{receiveId}") + @ResponseBody + public AjaxResult logisticsInsureById(@PathVariable("receiveId") long receiveId) { + ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(receiveId); + //如果不是待收货状态 + if (ActivitySignReceiveRecord.STATE_FOUR != activitySignReceiveRecord.getState()) { + return AjaxResult.buildFailInstance("该奖品不是待收货状态"); + } + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "收货成功!"); + } + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java index 25d3e4c..f460fc3 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java @@ -1,11 +1,11 @@ package com.matrix.system.shopXcx.api.action; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; - -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.system.shopXcx.dao.ShopCouponDao; +import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.shopXcx.api.service.WxShopCouponService; +import com.matrix.system.shopXcx.dao.ShopCouponDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -25,7 +25,7 @@ @Autowired private ShopCouponDao shopCouponDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; /** * 获取可以领取的优惠券 @@ -58,11 +58,11 @@ * * @return */ - @RequestMapping(value = "getMyCouponInfoByStatus/{shopId}/{status}") + @RequestMapping(value = "getMyCouponInfoByStatus/{status}") @ResponseBody - public AjaxResult getMyCouponInfo(@PathVariable("shopId") Long shopId,@PathVariable("status") Integer status, @RequestBody PaginationVO pageVo) { + public AjaxResult getMyCouponInfo(@PathVariable("status") Integer status, @RequestBody PaginationVO pageVo) { - return shopCouponService.getMyCouponInfoByStatus(shopId,status, pageVo); + return shopCouponService.getMyCouponInfoByStatus(HostInterceptor.getCompanyId(),status, pageVo); } /** @@ -76,10 +76,10 @@ return new AjaxResult(AjaxResult.STATUS_SUCCESS, shopCouponService.getCouponListByProductId(productId)); } - @GetMapping(value = "getCouponListByTag/{shopId}/{tag}") + @GetMapping(value = "getCouponListByTag/{tag}") @ResponseBody - public AjaxResult getCouponListByTag(@PathVariable("tag") String tag,@PathVariable("shopId") Long shopId) { - return shopCouponService.getCouponListByTag(tag,shopId); + public AjaxResult getCouponListByTag(@PathVariable("tag") String tag) { + return shopCouponService.getCouponListByTag(tag, HostInterceptor.getCompanyId()); } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopLogisticsQueryAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopLogisticsQueryAction.java index bf3e8a1..c77ba64 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopLogisticsQueryAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopLogisticsQueryAction.java @@ -68,6 +68,8 @@ } logisticsInfo.put("isShipments",AppConstance.IS_SHIPMENTS); logisticsInfo.put("logisticsStatus",shopDeliveryInfo.getLogisticsStatus()==null?"0":String.valueOf(shopDeliveryInfo.getLogisticsStatus())); + logisticsInfo.put("logisticsCompany", shopDeliveryInfo.getLogisticsCompany()); + logisticsInfo.put("waybillNo", shopDeliveryInfo.getWaybillNo()); logisticsInfo.put("describe",describe); result.setStatus(AjaxResult.STATUS_SUCCESS); result.putInMap("logisticsInfo",logisticsInfo); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java index 2b06093..96b7711 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java @@ -1,26 +1,27 @@ package com.matrix.system.shopXcx.api.action; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.StringUtils; -import com.matrix.biz.bean.BizUser; -import com.matrix.system.common.bean.CustomerDataDictionary; -import com.matrix.system.common.dao.CustomerDataDictionaryDao; -import com.matrix.component.redis.RedisUserLoginUtils; import com.matrix.system.common.constance.AppConstance; - +import com.matrix.system.common.dao.CustomerDataDictionaryDao; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.shopXcx.api.service.WxShopCouponService; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; -import com.matrix.system.shopXcx.api.service.WxShopCouponService; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Objects; /** * @author pengliang @@ -64,7 +65,7 @@ private ShopArticleDao shopArticleDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired WxShopCouponService shopCouponService; @@ -75,6 +76,9 @@ @Autowired private ShopProductCommentDao productCommentDao; + @Autowired + private ShopSalesmanGradeDao shopSalesmanGradeDao; + /** * 根据id查询商品信息 * @@ -84,16 +88,29 @@ @RequestMapping(value = "/getProductById/{shopId}/{id}") @ResponseBody public AjaxResult getProductById(@PathVariable Long shopId, @PathVariable("id") Integer id) { - + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); ShopProduct shopProduct = shopProductDao.selectById(id); if (shopProduct == null) { return new AjaxResult(AjaxResult.STATUS_FAIL, "没有查询到商品"); } - List<ShopProductAttrRef> shopProductAttrRefs = shopProductAttrRefDao.selectByPid(id); List<ShopProductImg> shopProductImgs = shopProductImgDao.selectByPid(id); List<ShopSku> shopSkus = shopSkuDao.selectByPid(id); -// List<ShopSku> shopSkus = shopSkuDao.selectByPidAndShopid(id, shopId); + if(SysVipInfo.IS_SALES==sysVipInfo.getIsSales()){ + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); + //计算产品佣金 + shopSkus.forEach(shopSku -> { + if(Objects.isNull(shopSku.getInvitationPrice())){ + shopSku.setInvitationPrice(shopSku.getPrice().multiply(BigDecimal.valueOf(shopSalesmanGrade.getInvitationCommission())).divide(BigDecimal.valueOf(100))); + } + if(Objects.isNull(shopSku.getSealesPrice())){ + shopSku.setSealesPrice(shopSku.getPrice().multiply(BigDecimal.valueOf(shopSalesmanGrade.getSealesCommission())).divide(BigDecimal.valueOf(100))); + } + if(Objects.isNull(shopSku.getSelfPrice())){ + shopSku.setSelfPrice(shopSku.getPrice().multiply(BigDecimal.valueOf(shopSalesmanGrade.getSelfCommission())).divide(BigDecimal.valueOf(100))); + } + }); + } List<ShopProductParamRef> shopProductParamRefs = shopProductParamRefDao.selectByPid(id); shopProduct.setAttrRefs(shopProductAttrRefs); shopProduct.setProductImgs(shopProductImgs); @@ -111,11 +128,12 @@ - if (redisUserLoginUtils.isUserLogin()) { + if (userCacheManager.isUserLogin()) { //查询产品适配的优惠券 result.putInMap("couponList", shopCouponService.getCouponListByProductId(id)); //查询产品是否被用户收藏 - result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(BizUser.class).getOpenId()))); + SysVipInfo user=userCacheManager.getLoginUser(); + result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, user.getOpenId()))); } else { result.putInMap("checkCollect", false); } @@ -150,7 +168,6 @@ @ResponseBody public AjaxResult getShopProductShowList(@RequestBody ShopProduct shopProduct) { List<ShopProduct> shopProducts = null; - //查询是否匹配优惠条件 ShopCoupon shopCoupon = shopCouponDao.getCouponByTitle(shopProduct.getTitle(),HostInterceptor.getCompanyId()); if (shopCoupon != null && shopProduct.getOffset() < 1) { @@ -161,9 +178,6 @@ if (CollectionUtils.isEmpty(shopProducts)) { shopProduct.setDelFlag(AppConstance.DATA_USEABLE); shopProduct.setStatus(AppConstance.IS_PUTAWAY); - if(shopProduct.getIsService()==null){ - shopProduct.setIsService(2); - } shopProduct.setCompanyId(HostInterceptor.getCompanyId()); shopProducts = shopProductDao.selectByModelWx(shopProduct); } @@ -217,13 +231,13 @@ * @param shopProduct */ private void saveSearchHistroy(@RequestBody ShopProduct shopProduct) { - BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo bigUser = userCacheManager.getLoginUser(); ShopSearchRecord searchBean = new ShopSearchRecord(); if (StringUtils.isNotBlank(shopProduct.getTitle())) { searchBean.setSearchType(AppConstance.SEARCH_TYPE); searchBean.setSearchContent(shopProduct.getTitle()); } - searchBean.setUserId(bigUser.getOpenId()); + searchBean.setUserId(bigUser.getId()); searchBean.setSearchPriceStart(shopProduct.getStartPrice()); searchBean.setSearchPriceEnd(shopProduct.getEndPrice()); searchBean.setSearchDel(AppConstance.DATA_USEABLE); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java index 5fc88e7..f729baf 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java @@ -1,104 +1,67 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.service.BizUserService; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.system.shopXcx.bean.ShopScoreExchange; -import com.matrix.system.shopXcx.bean.ShopScoreRecord; -import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao; -import com.matrix.system.shopXcx.dao.ShopScoreRecordDao; +import com.matrix.system.score.dao.ScoreUseRecordDao; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.shopXcx.api.dto.ScoreFlowDto; +import com.matrix.system.shopXcx.api.vo.ScoreUseRecordVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.List; +import org.springframework.web.bind.annotation.RestController; /** - * @description 用户积分控制器 * @author jyy - * @date 2019-08-09 15:10 + * @date 2021-03-22 15:10 */ -@Controller -@RequestMapping(value="/wxapi/shopScoreRecord") -@CrossOrigin(origins = "*", maxAge = 3600) +@Api(tags = "用户积分接口类") +@RestController +@RequestMapping(value = "/wxapi/score") public class WxShopScoreAction { - @Autowired - private ShopScoreRecordDao shopScoreRecordDao; - @Autowired - private ShopScoreExchangeDao shopScoreExchangeDao; - @Autowired - private RedisUserLoginUtils redisUserLoginUtils; - @Autowired - private BizUserService bizUserService; + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + ScoreUseRecordDao scoreUseRecordDao; + + @Autowired + ScoreVipDetailDao scoreVipDetailDao; + + @ApiOperation(value = "获取积分流水", notes = "") + @PostMapping(value = "/getFlowList") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ScoreUseRecordVo.class) + }) + AjaxResult getFlowList(@RequestBody @Validated ScoreFlowDto scoreFlowDto) { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize()); + scoreFlowDto.setVipId(loginUser.getId()); + IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page, scoreFlowDto); + AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords()); + return result; + } + + @ApiOperation(value = "获取用户积分", notes = "") + @PostMapping(value = "/getUserScore") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + AjaxResult getUserScore() { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(loginUser.getId())); + return result; + } - /** - * 查询我的获得积分列表 - * @return - */ - @RequestMapping(value = "/getRecordList") - @ResponseBody - public AjaxResult getRecordList(@RequestBody PaginationVO pageVo) { - - pageVo.setSort("create_time"); - pageVo.setOrder("desc"); - BizUser loginBizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - ShopScoreRecord params = new ShopScoreRecord(); - params.setBeneficiaryId(loginBizUser.getOpenId()); - List<ShopScoreRecord> dataList = shopScoreRecordDao.selectInPage(params, pageVo); - int total = shopScoreRecordDao.selectTotalRecord(params); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, total); - //查询用户总积分 - BizUser user = bizUserService.findById(loginBizUser.getUserId()); - Integer totalScore = 0; - if (user != null && user.getTotalScore() != null) { - totalScore = user.getTotalScore(); - } - result.putInMap("totalScore", totalScore); - //查询下级总人数 - BizUser peopleSumParams = new BizUser(); - peopleSumParams.setParentOpenId(loginBizUser.getOpenId()); - int peopleSum = bizUserService.findTotal(peopleSumParams); - result.putInMap("peopleSum", peopleSum); - return result; - } - - - /** - * 查询我的积分兑换列表 - * @return - */ - @RequestMapping(value = "/getChangeRecordList") - @ResponseBody - public AjaxResult getChangeRecordList(@RequestBody PaginationVO pageVo) { - - //不分页 - pageVo.setOffset(null); - pageVo.setLimit(null); - //按生成时间倒序排列 - pageVo.setSort("create_time"); - pageVo.setOrder("desc"); - BizUser loginBizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - ShopScoreExchange params = new ShopScoreExchange(); - params.setUserId(loginBizUser.getOpenId()); - List<ShopScoreExchange> dataList = shopScoreExchangeDao.selectInPage(params, pageVo); - int total = shopScoreExchangeDao.selectTotalRecord(params); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, total); - //查询用户当前积分 - BizUser user = bizUserService.findById(loginBizUser.getUserId()); - Integer currentScore = 0; - if (user != null && user.getCurrentScore() != null) { - currentScore = user.getCurrentScore(); - } - result.putInMap("currentScore", currentScore); - return result; - } - } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java index 1afabd6..8dfbbd1 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java @@ -1,25 +1,27 @@ package com.matrix.system.shopXcx.api.action; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.constance.SystemMessageCode; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.StringUtils; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; import com.matrix.system.common.constance.AppConstance; - -import com.matrix.system.shopXcx.bean.ShopShoppingCart; -import com.matrix.system.shopXcx.bean.ShopSku; -import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; -import com.matrix.system.shopXcx.dao.ShopSkuDao; +import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.shopXcx.api.service.OrderCouponGroupService; import com.matrix.system.shopXcx.api.service.ShoppingCartService; import com.matrix.system.shopXcx.api.service.WxShopCouponService; import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; import com.matrix.system.shopXcx.api.vo.ShopCartVo; +import com.matrix.system.shopXcx.bean.ShopShoppingCart; +import com.matrix.system.shopXcx.bean.ShopSku; +import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import java.util.HashMap; @@ -32,13 +34,14 @@ * @date 2019-06-12 19:15 */ @CrossOrigin(origins = "*", maxAge = 3600) -@Controller +@Api(tags = "购物车类") +@RestController @RequestMapping(value = "wxapi/ShoppingCart") public class WxShoppingCartAction { @Autowired private ShopShoppingCartDao shoppingCartDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired WxShopCouponService shopCouponService; @@ -49,13 +52,10 @@ @Autowired ShopSkuDao skuDao; + @Autowired + OrderCouponGroupService orderCouponGroupService; - /** - * 根据ID删除购物车 - * - * @param - * @return - */ + @ApiOperation(value = "根据ID删除购物车", notes = "") @PostMapping("/deleteByCartId/{cartId}") @ResponseBody public AjaxResult deleteByCartId(@PathVariable("cartId") Integer cartId) { @@ -66,18 +66,16 @@ return new AjaxResult(AjaxResult.STATUS_SUCCESS, "删除成功"); } - /** - * 根据用户ID查询购物车 没有分页 - * - * @param - * @return - */ + + @ApiOperation(value = "根据用户ID查询购物车 没有分页", notes = "") @PostMapping("/findShoppingCart") @ResponseBody public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) { - List<ShopCartVo> cartList = shoppingCartService.findUserCartList(shoppingCart.getShopId()); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, cartList, cartList.size()); - ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(cartList); + SysVipInfo loginUser = userCacheManager.getLoginUser(); + List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),loginUser.getId()); + List<ShopCartVo> shopCartVoList = shoppingCartService.buildShopCart(list); + AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopCartVoList, shopCartVoList.size()); + ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(shopCartVoList); result.putInMap("billTotal", shopCartBill.getBillTotal().stripTrailingZeros().toPlainString()); result.putInMap("selectCount", shopCartBill.getSelectCount()); result.putInMap("cartCount", shopCartBill.getCartCount()); @@ -86,9 +84,8 @@ return result; } - /** - * 批量删除 - */ + + @ApiOperation(value = "批量删除", notes = "") @PostMapping(value = "/delShoppingCart/{keys}") public @ResponseBody @@ -102,12 +99,13 @@ } } + @ApiOperation(value = "查询微商城购物车数量", notes = "") @PostMapping(value = "/getUserCartCount/{shopId}") public @ResponseBody AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId()); + SysVipInfo loginUser = userCacheManager.getLoginUser(); + Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getId()); if (userCartCount == null) { userCartCount = 0; } @@ -125,17 +123,18 @@ AjaxResult saveShoppingCart(@RequestBody ShopShoppingCart shoppingCart) { //查询到sku设置对应的产品id - ShopSku sku= skuDao.selectById(shoppingCart.getCartSkuId()); - if(sku==null){ - return new AjaxResult(AjaxResult.STATUS_FAIL,"无效的产品id"); + ShopSku sku = skuDao.selectById(shoppingCart.getCartSkuId()); + if (sku == null) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "无效的产品id"); } shoppingCart.setCartProductId(sku.getpId()); - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo loginUser = userCacheManager.getLoginUser(); shoppingCart.setCreateBy(loginUser.getOpenId()); shoppingCart.setUpdateBy(loginUser.getOpenId()); - shoppingCart.setCartUserId(loginUser.getOpenId()); + shoppingCart.setCartUserId(loginUser.getId()); + shoppingCart.setCompanyId(HostInterceptor.getCompanyId()); ShopShoppingCart shoppCartLimt = shoppingCartDao.selectBuyLimit(shoppingCart.getCartProductId(), shoppingCart.getCartSkuId()); // Integer buyLimitNum = 0; @@ -161,7 +160,7 @@ ShopShoppingCart shopShoppingCart = new ShopShoppingCart(); shopShoppingCart.setCartProductId(cartProductId); shopShoppingCart.setCartSkuId(cartSkuId); - shopShoppingCart.setCartUserId(loginUser.getOpenId()); + shopShoppingCart.setCartUserId(loginUser.getId()); shopShoppingCart.setShopId(shoppingCart.getShopId()); List<ShopShoppingCart> shopShoppingCarts = shoppingCartDao.selectByModel(shopShoppingCart); int i = 0; @@ -194,7 +193,7 @@ return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); } int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(), - loginUser.getOpenId()); + loginUser.getId()); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); result.putInMap("userCartCount", userCartCount); return result; @@ -258,7 +257,7 @@ * @param * @return */ - @RequestMapping("/updateCartSelected") + @PostMapping("/updateCartSelected") @ResponseBody public AjaxResult updateCartSelected(@RequestBody ShopShoppingCart shoppingCart) { Map<String, Object> modifyMap = new HashMap<>(); @@ -274,13 +273,12 @@ * @param * @return */ - @RequestMapping("/updateCartAllSelected/{shopId}/{isSelected}") + @PostMapping("/updateCartAllSelected/{shopId}/{isSelected}") @ResponseBody public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected, @PathVariable("shopId") Long shopId) { - Map<String, Object> modifyMap = new HashMap<>(); - BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); - shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected); + SysVipInfo user = userCacheManager.getLoginUser(); + shoppingCartDao.updateAllSelected(user.getOpenId(), shopId, isSelected); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java index 2730fb1..78429ad 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java @@ -1,10 +1,10 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.hive.bean.SysSkinCheckRecord; import com.matrix.system.hive.bean.SysSkinDetail; import com.matrix.system.hive.bean.SysVipInfo; @@ -41,19 +41,19 @@ private SysVipInfoDao vipInfoDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopProductDao shopProductDao; @RequestMapping(value = "/showSkinList") public @ResponseBody AjaxResult showSkinList(@RequestBody SkinCheckDTO skinCheckDTO) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); PaginationVO pageVo = new PaginationVO(); pageVo.setLimit(skinCheckDTO.getLimit()); pageVo.setOffset(skinCheckDTO.getOffset()); SysSkinCheckRecord skinCheckRecord = new SysSkinCheckRecord(); - skinCheckRecord.setTelphone(bizUser.getPhoneNumber()); + skinCheckRecord.setTelphone(sysVipInfo.getPhone()); List<SysSkinCheckRecord> dataList = sysSkinCheckRecordDao.selectInPage(skinCheckRecord, pageVo); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, sysSkinCheckRecordDao.selectTotalRecord(skinCheckRecord)); @@ -78,7 +78,7 @@ }); sysSkinCheckRecord.setSkinDetails(detailList); - SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysSkinCheckRecord.getTelphone()); + SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysSkinCheckRecord.getTelphone(), HostInterceptor.getCompanyId()); AjaxResult result=AjaxResult.buildSuccessInstance(Arrays.asList(sysSkinCheckRecord)); result.putInMap("vipInfo",vipInfo); return result; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java new file mode 100644 index 0000000..e07d511 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java @@ -0,0 +1,247 @@ +package com.matrix.system.shopXcx.api.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.component.tools.HttpCurlUtil; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.web.BaseAction; +import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.constance.Dictionary; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanApply; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.MoneyCardUseDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.shopXcx.api.WeChatApiTools; +import com.matrix.system.shopXcx.api.dto.XcxUserSaveUserInfoDto; +import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; +import net.sf.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.Collections; + +/** + * @author jyy + * @description (用户表) + * @date 2019-05-31 10:03 + */ +@Controller +@RequestMapping(value = "wxapi/user") +public class WxUserAction extends BaseAction { + + @Autowired + private SysVipInfoService sysVipInfoService; + + @Autowired + private SysVipInfoDao sysVipInfoDao; + + @Autowired + private ShopSalesmanApplyService shopSalesmanApplyService; + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + @Autowired + private UserCacheManager userCacheManager; + @Autowired + ShopSalesmanApplyDao salesmanApplyDao; + + @Autowired + WeChatApiTools weChatApiTools; + + @Autowired + private ScoreVipDetailDao scoreVipDetailDao; + + @Autowired + private MoneyCardUseDao moneyCardUseDao; + + @Autowired + ShopCouponRecordDao shopCouponRecordDao; + + @Autowired + ActivitySignReceiveRecordDao activitySignReceiveRecordDao; + @Value("${debug}") + private String isDebug; + + /** + * 小程序登录 + * + * @param code + * @return + * @throws Exception + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2018年5月23日 + */ + @RequestMapping(value = "/login/{keys}") + public @ResponseBody + AjaxResult wxLogin(@PathVariable("keys") String code) throws Exception { + AjaxResult res = new AjaxResult(); + LogUtil.info("code:{}" + code); + if (StringUtils.isNotBlank(code)) { + String requrl = weChatApiTools.getXcxLoginUrl(code, HostInterceptor.getCompanyId()); + String reslutData = HttpCurlUtil.sendGetHttp(requrl, null); + JSONObject json = JSONObject.fromObject(reslutData); + LogUtil.debug("微信登录获取到登录信息={}", json); + + if (json.containsKey("errcode")) { + res.setStatus(AjaxResult.STATUS_FAIL); + res.setInfo("自动登录失败"); + LogUtil.debug("微信登录获取到异常信息errcode"); + return res; + } + + String openId = json.getString("openid"); + String sessionKey = json.getString("session_key"); + LogUtil.debug("openId={},sessionKey={}", openId, sessionKey); + // 查询用户是否存在 + SysVipInfo sysVipInfo = null; + synchronized (this) { + sysVipInfo = sysVipInfoService.findByOpenId(openId); + if (sysVipInfo == null) { + // 新增用户 + sysVipInfo = new SysVipInfo(); + sysVipInfo.setIsSales(SysVipInfo.NOT_SALES); + sysVipInfo.setOpenId(openId); + sysVipInfo.setSessionKey(sessionKey); + sysVipInfo.setCompanyId(HostInterceptor.getCompanyId()); + sysVipInfo.setArrivalWay("微商城"); + sysVipInfo.setVipName("微信用户"); + sysVipInfo.setVipState(Dictionary.VIP_STATE_HY); + sysVipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); + sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); + sysVipInfo.setVipNo(openId); + sysVipInfoService.add(sysVipInfo); + + } else { + sysVipInfo.setSessionKey(sessionKey); + sysVipInfoDao.update(sysVipInfo); + } + } + // 存放redis + sysVipInfo.setLevelCard(null); + String token = userCacheManager.saveUserInfo(sysVipInfo); + LogUtil.info("用户token={}", token); + res.putInMap("token", token); + res.putInMap("userInfo", sysVipInfo); + res.setStatus(AjaxResult.STATUS_SUCCESS); + } else { + res.setStatus(AjaxResult.STATUS_FAIL); + res.setInfo("自动登录失败"); + } + return res; + } + + + @Autowired + ShopSalesmanGradeDao shopSalesmanGradeDao; + + /** + * 查询用户信息 + */ + @RequestMapping(value = "/findUserInfo") + public @ResponseBody + AjaxResult findUserInfo() { + SysVipInfo loginUser = userCacheManager.getLoginUser(); + SysVipInfo sysVipInfo = sysVipInfoService.findById(loginUser.getId()); + sysVipInfo.setPointAll(scoreVipDetailDao.selectUserTotalScore(loginUser.getId())); + sysVipInfo.setBalance(moneyCardUseDao.selectVipCardTotalMoney(loginUser.getId())); + AjaxResult res = new AjaxResult(); + res.putInMap("couponCount", shopCouponRecordDao.countUnuseCouponRecord(loginUser.getId())); + res.putInMap("prizeCount", activitySignReceiveRecordDao.getSignAwardReceiveCount(loginUser.getId(), loginUser.getCompanyId())); + res.putInMap("userInfo", sysVipInfo); + //查询会员等级 + if (sysVipInfo.getSalesmanGrade() != null) { + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); + res.putInMap("vipLevel", shopSalesmanGrade.getName()); + } else if (sysVipInfo.getVipLevel() != null) { + res.putInMap("vipLevel", sysVipInfo.getVipLevel().getLevelName()); + } else { + res.putInMap("vipLevel", "初级会员"); + } + res.setStatus(AjaxResult.STATUS_SUCCESS); + return res; + } + + /** + * 根据OpenID查询用户信息 + */ + @GetMapping(value = "/findUserInfo/{openId}") + public @ResponseBody + AjaxResult findUserInfo(@PathVariable String openId) { + SysVipInfo sysVipInfo = sysVipInfoService.findByOpenId(openId); + SysVipInfo bizUserQuery = new SysVipInfo(); + bizUserQuery.setNickName(sysVipInfo.getNickName()); + bizUserQuery.setAvatarUrl(sysVipInfo.getAvatarUrl()); + bizUserQuery.setOpenId(openId); + return AjaxResult.buildSuccessInstance(bizUserQuery); + } + + + /** + * 接收用户信息 + */ + @PostMapping(value = "/saveUserInfo") + public @ResponseBody + AjaxResult saveUserInfo(@RequestBody XcxUserSaveUserInfoDto xcxUserSaveUserInfoDto) { + + SysVipInfo loginUser = userCacheManager.getLoginUser(); + SysVipInfo sysVipInfo = new SysVipInfo(); + sysVipInfo.setId(loginUser.getId()); + + BeanUtil.copyProperties(xcxUserSaveUserInfoDto, sysVipInfo); + sysVipInfo.setPhone(xcxUserSaveUserInfoDto.getPhoneNumber()); + if (StringUtils.isBlank(loginUser.getVipName()) || loginUser.getVipName().equals("微信用户")) { + sysVipInfo.setVipName(xcxUserSaveUserInfoDto.getNickName()); + } + if (StringUtils.isBlank(loginUser.getSex())) { + sysVipInfo.setSex(xcxUserSaveUserInfoDto.getGender() == 1 ? "男" : "女"); + } + + int i = sysVipInfoDao.update(sysVipInfo); + + checkNeedToBeSalesman(sysVipInfo, loginUser); + if (i == 0) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败"); + } + return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(sysVipInfo)); + } + + + void checkNeedToBeSalesman(SysVipInfo sysVipInfo, SysVipInfo loginUser) { + //查询是否需要自动成为分销员 + if ((loginUser.getIsSales() == null || loginUser.getIsSales() == 2) + && StringUtils.isNotBlank(sysVipInfo.getNickName())) {//目前还不是分销员 + BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId()); + if (fxSwith!=null && fxSwith.getParamValue().equals("1")) {//开启分销 + BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, loginUser.getCompanyId()); + if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) {//自动成为分销员 + QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_id", loginUser.getId()); + queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH); + ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper); + if (shopSalesmanApply == null) {//没有待审核记录 + shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, null, 2); + } + } + } + } + } + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java index 84aedfb..99786fa 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java @@ -1,9 +1,9 @@ package com.matrix.system.shopXcx.api.action; import com.matrix.core.pojo.AjaxResult; -import com.matrix.biz.bean.BizUser; +import com.matrix.system.hive.bean.SysVipInfo; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.system.shopXcx.dao.ShopSearchRecordDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -30,7 +30,7 @@ private ShopSearchRecordDao shopSearchRecordDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; /** * 查询搜索记录 @@ -39,7 +39,7 @@ @RequestMapping(value = "/getSearchRecordList") @ResponseBody public AjaxResult getSearchRecordList(){ - BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo bigUser = userCacheManager.getLoginUser(); if(bigUser == null){ return new AjaxResult(AjaxResult.STATUS_FAIL,"用户未授权"); } @@ -54,7 +54,7 @@ @RequestMapping(value = "/deleteSearchRecord") @ResponseBody public AjaxResult deleteSearchRecord(){ - BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo bigUser = userCacheManager.getLoginUser(); shopSearchRecordDao.deleteByUserId(bigUser.getOpenId()); return new AjaxResult(AjaxResult.STATUS_SUCCESS,"删除成功"); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java index efcd693..4e958b3 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java @@ -1,42 +1,50 @@ package com.matrix.system.shopXcx.api.action; -import com.alibaba.fastjson.JSONObject; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.component.rabbitmq.RabiitMqTemplate; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.VerifyResult; import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.StringUtils; +import com.matrix.system.app.mapper.SysProjUseMapper; +import com.matrix.system.app.vo.ServiceProductListVo; +import com.matrix.system.app.vo.ServiceProjVo; +import com.matrix.system.app.vo.ServiceTcVo; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.common.dao.SysUsersDao; import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.common.tools.LocationUtil; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.*; -import com.matrix.system.hive.plugin.message.StringUtil; import com.matrix.system.hive.plugin.util.CollectionUtils; -import com.matrix.core.tools.DateUtil; -import com.matrix.system.hive.service.CodeService; -import com.matrix.system.hive.service.SysProjUseService; -import com.matrix.system.hive.service.SysWorkBeatuistaffService; -import com.matrix.system.hive.service.SysWorktimeService; -import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.hive.service.*; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; +import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; +import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; import com.matrix.system.shopXcx.dao.ShopProductDao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; import com.matrix.system.shopXcx.dto.YYDayOfWeek; import com.matrix.system.shopXcx.dto.YYmonth; -import com.matrix.system.shopXcx.mqTask.DTO.UserProjInfo; -import com.matrix.system.shopXcx.mqTask.MQTaskRouting; -import com.matrix.system.shopXcx.shopEnum.TemplateMsgType; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; /** * @author jiangyouyao @@ -52,13 +60,21 @@ SysShopInfoDao shopInfoDao; @Autowired - private SysVipInfoDao vipDap; + private SysVipInfoDao vipInfoDao; @Autowired private OnlinebookingDao onlinebookingDao; + @Autowired + private SysProjServicesService projServicesService; @Autowired - RedisUserLoginUtils redisUserLoginUtils; + private SysProjServicesDao projServicesDao; + + @Autowired + private SysBeauticianStateService sysBeauticianStateService; + + @Autowired + private UserCacheManager userCacheManager; @Autowired ShopProductDao productDao; @@ -67,18 +83,25 @@ SysUsersDao staffInfoDao; @Autowired - BizUserDao bizUserDao; + SysVipInfoDao sysVipInfoDao; + @Autowired - RabiitMqTemplate rabiitMqTemplate; + SysProjUseDao projUseDao; - + @Autowired + ShopSkuDao skuDao; @Autowired ShoppingGoodsAssembleDao shoppingGoodsAssembleDao; @Autowired ShoppingGoodsDao shoppingGoodsDao; + @Autowired + ScoreVipDetailService scoreVipDetailService; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; @Value("${evn}") private String evn; @@ -194,48 +217,44 @@ * @return */ @RequestMapping(value = "/getUserPro/{phone}") - public @ResponseBody + @ResponseBody + public AjaxResult getUserPro(@PathVariable String phone) { - SysVipInfo vipInfo = vipDap.selectByPhone(phone); - // 根据时间获取一段排班码 - Map<Object, Object> taocanProjMap = new HashMap<>(); - List<UserProjInfo> userProjInfoList = new ArrayList(); - SysProjUse sysProjUse = new SysProjUse(); - sysProjUse.setVipId(vipInfo.getId()); - sysProjUse.setIsOver(Dictionary.DELETED_N); - sysProjUse.setIsOver(Dictionary.DELETED_N); - sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_YX); - // 查询出该会员的所有可消耗的选择 - List<SysProjUse> sysProjUseList = projUseService.findByModel(sysProjUse); - for (int i = 0; i < sysProjUseList.size(); i++) { - if (sysProjUseList.get(i).getTaocanId() != null) { - String flag = sysProjUseList.get(i).getPlatformFlag(); - if (taocanProjMap.keySet().contains(flag)) { - ((UserProjInfo) taocanProjMap.get(flag)).getChildPro().add(coversion(sysProjUseList.get(i))); - } else { - SysProjUse pru = sysProjUseList.get(i); - UserProjInfo taocan = new UserProjInfo(); - taocan.setId(pru.getId()); - taocan.setName(pru.getProjName()); - taocan.setType(pru.getType()); - if (pru.getSurplusCount() > 10000) { - taocan.setSurplusCount("不限"); - } else { - taocan.setSurplusCount(pru.getSurplusCount() + ""); - } - taocan.setChildPro(new ArrayList<UserProjInfo>()); - taocan.getChildPro().add(coversion(pru)); - taocanProjMap.put(flag, taocan); - } - } else { - userProjInfoList.add(coversion(sysProjUseList.get(i))); - } + SysVipInfo vipInfo = vipInfoDao.selectByPhone(phone,HostInterceptor.getCompanyId()); + + if (vipInfo == null) { + throw new GlobleException("会员不存在"); } - AjaxResult result = new AjaxResult(); - result.setStatus("200"); - result.setMapInfo(taocanProjMap); - result.setRows(userProjInfoList); - return result; + ServiceProductListVo productListVo = new ServiceProductListVo(); + productListVo.setName(vipInfo.getVipName()); + productListVo.setVipId(vipInfo.getId()); + + SysProjUse queryUse = new SysProjUse(); + queryUse.setVipId(vipInfo.getId()); + queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); + queryUse.setTaocanId(-1L); + queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); + List<SysProjUse> projList = projUseService.findInPage(queryUse, null); + List<ServiceProjVo> serviceProjVos = SysProjUseMapper.INSTANCE.entityListToProjVoList(projList); + + queryUse.setTaocanId(null); + queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); + List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null); + List<ServiceTcVo> serviceTcVos = SysProjUseMapper.INSTANCE.entityListToTcVoList(taoCanList); + + if (CollectionUtils.isNotEmpty(serviceTcVos)) { + serviceTcVos.forEach(item -> { + List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()); + List<ServiceProjVo> taocanProj = SysProjUseMapper.INSTANCE.entityListToProjVoList(sysProjUses); + item.setProj(taocanProj); + }); + } + + productListVo.setProj(serviceProjVos); + productListVo.setComposeProj(serviceTcVos); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("proj", productListVo); + return ajaxResult; } @@ -251,23 +270,60 @@ @RequestMapping(value = "/createServiceOrder") public @ResponseBody AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - bizUser = bizUserDao.findByOpenId(bizUser.getOpenId()); - SysVipInfo vipInfo = vipDap.selectByPhone(bizUser.getPhoneNumber()); - onlinebooking.setOrderNo(codeService.getServiceOrderCode()); - onlinebooking.setVipName(vipInfo.getVipName()); - onlinebooking.setVipId(vipInfo.getId()); - onlinebooking.setBizUserId(bizUser.getOpenId()); - onlinebooking.setStatus(Dictionary.ONLINEBOOKING_DFW); - onlinebooking.setCreateTime(new Date()); - onlinebooking.setTime(DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM)); - onlinebookingDao.insert(onlinebooking); - //发送消息通知 - JSONObject msg = new JSONObject(); - msg.put("templateMsgType", TemplateMsgType.APPOINTMENT_SUCCESS.getCode()); - msg.put("content", onlinebooking.getId()); - rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_TEMPLATE_MSG+evn, msg.toJSONString()); - return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(onlinebooking)); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysVipInfo.getPhone(),HostInterceptor.getCompanyId()); + SysProjUse sysProjUse = projUseDao.selectById(Long.parseLong(onlinebooking.getProductId() + "")); + Date yyTime = DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM); + SysProjServices sysProjServices = new SysProjServices(); + sysProjServices.setCompanyId(vipInfo.getCompanyId()); + sysProjServices.setShopId(onlinebooking.getShopId()); + sysProjServices.setVipId(vipInfo.getId()); + sysProjServices.setYyTime(yyTime); + sysProjServices.setRemark(onlinebooking.getRemark()); + + List<SysBeauticianState> sysBeauticianStates = new ArrayList<>(); + + SysBeauticianState sysBeauticianState = new SysBeauticianState(); + sysBeauticianState.setPuseId(sysProjUse.getId()); + sysBeauticianState.setProjUse(sysProjUse); + sysBeauticianState.setCount(1); + sysBeauticianState.setBeginTime(yyTime); + int timeLength=30; + if(sysProjUse.getTimeLength()!=null){ + timeLength=sysProjUse.getTimeLength(); + } + sysBeauticianState.setEndTime(DateUtil.getDateAfterMinute(yyTime, timeLength)); + if(onlinebooking.getStaffId()!=null){ + sysBeauticianState.setStaffId(Long.parseLong(onlinebooking.getStaffId()+"")); + } + + sysBeauticianStates.add(sysBeauticianState); + sysProjServices.setServiceItems(sysBeauticianStates); + + //检测欠款 + VerifyResult arrearsVerifyResult = projServicesService.checkArrears(sysProjServices); + if (arrearsVerifyResult.isError()) { + return new AjaxResult(AjaxResult.STATUS_FAIL, arrearsVerifyResult.getMsg()); + } + //检测余次 + VerifyResult balanceverifyResult = projServicesService.checkBalance(sysProjServices); + if (balanceverifyResult.isError()) { + return new AjaxResult(AjaxResult.STATUS_FAIL, balanceverifyResult.getMsg()); + } + sysProjServices.setState(Dictionary.SERVICE_STATU_DQR); + SysProjServices newSysProjServices = projServicesService.addSysProjServices(sysProjServices); + if (newSysProjServices != null) { + + //添加用户积分 + BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, sysVipInfo.getCompanyId()); + scoreVipDetailService.addScoreByParamSetting(sysVipInfo.getId(), null,null, newSysProjServices.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"预约送积分", parameterSetting); + + + return AjaxResult.buildSuccessInstance("下单成功"); + } else { + return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); + } } @@ -277,52 +333,42 @@ * @param id * @return */ + @ApiOperation(value = " 根据id查询预约订单的详情", notes = " 根据id查询预约订单的详情") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ErpServiceOrderListVo.class) + }) @RequestMapping(value = "/getServiceOrderById/{id}") public @ResponseBody - AjaxResult getServiceOrderById(@PathVariable Long id) { - - Onlinebooking onlinebooking = onlinebookingDao.selectById(id); - ShopProduct shopProduct = productDao.selectById(onlinebooking.getProductId()); - onlinebooking.setShopProduct(shopProduct); - if (onlinebooking.getStaffId() != null) { - SysUsers shopstaffInfo = staffInfoDao.selectById(Long.parseLong(onlinebooking.getStaffId() + "")); - onlinebooking.setStaffInfo(shopstaffInfo); + AjaxResult getServiceOrderById(@PathVariable("id") Long id) { + SysProjServices projServices = projServicesService.findById(id); + if (projServices == null) { + return AjaxResult.buildFailInstance("服务单不存在"); } - SysShopInfo shopInfo = shopInfoDao.selectById(onlinebooking.getShopId()); - onlinebooking.setShopInfo(shopInfo); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "查询成功"); - result.putInMap("serviceOrder", onlinebooking); - return result; - + ErpServiceOrderListVo serviceOrder = projServicesDao.findWxServiceOrderById(id); + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); + ajaxResult.putInMap("detail", serviceOrder); + return ajaxResult; } + + /** - * 订单列表查询 - * + * 查询服务单 + * @param orderListDto * @return */ - @RequestMapping(value = "/getServiceOrderList") - public @ResponseBody - AjaxResult getServiceOrderList(@RequestBody Onlinebooking onlinebooking) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - onlinebooking.setBizUserId(bizUser.getOpenId()); - List<Onlinebooking> list = onlinebookingDao.selectInPageForWx(onlinebooking); - //相关数据赋值 - list.stream().forEach(order -> { - ShopProduct shopProduct = productDao.selectById(order.getProductId()); - order.setShopProduct(shopProduct); - if (order.getStaffId() != null) { - SysUsers shopstaffInfo = staffInfoDao.selectById(Long.parseLong(order.getStaffId() + "")); - order.setStaffInfo(shopstaffInfo); - } - SysShopInfo shopInfo = shopInfoDao.selectById(order.getShopId()); - order.setShopInfo(shopInfo); - }); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "查询成功"); - result.setRows(list); - return result; + @ApiOperation(value = "查询服务单列表", notes = "查询服务单列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ErpServiceOrderListVo.class) + }) + @PostMapping(value = "/getServiceOrderList") + @ResponseBody + public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + orderListDto.setVipId(sysVipInfo.getId()); + List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto); + return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功"); } - /** * 取消预约订单 @@ -330,53 +376,38 @@ * @param * @return */ - @RequestMapping(value = "/cancelOrderById") + @ApiOperation(value = "取消预约", notes = "取消预约") + @GetMapping(value = "/cancelOrderById/{id}") public @ResponseBody - AjaxResult cancelOrderById(@RequestBody Onlinebooking onlinebooking) { - - AjaxResult result = new AjaxResult(); - if (onlinebooking.getId() == null) { - result.setStatus(AjaxResult.STATUS_FAIL); - result.setInfo("请求参数错误"); + AjaxResult cancelOrderById(@PathVariable Long id) { + SysProjServices services = new SysProjServices(); + services.setId(id); + int i = projServicesService.modifyCancelProjServices(services); + if (i > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "取消预约成功"); } else { - onlinebooking.setStatus(Dictionary.ONLINEBOOKING_YQX); - onlinebookingDao.update(onlinebooking); - result.setStatus(AjaxResult.STATUS_SUCCESS); - result.setInfo("订单取消成功"); + return new AjaxResult(AjaxResult.STATUS_FAIL, "取消预约失败"); } - return result; } - /** - * 删除订单 - * - * @param - * @return - */ - @RequestMapping(value = "/removeOrderById/{id}") + + @ApiOperation(value = "服务单评论", notes = "服务单评论") + @PostMapping(value = "/commentService") public @ResponseBody - AjaxResult removeOrderById(@PathVariable Long id) { - onlinebookingDao.deleteById(id); - AjaxResult result = new AjaxResult(); - result.setStatus(AjaxResult.STATUS_SUCCESS); - result.setInfo("删除成功"); - return result; + AjaxResult commentService(@RequestBody @Validated ErpServiceCommentDto commentDto) { + SysProjServices services = new SysProjServices(); + services.setId(commentDto.getId()); + services.setComment(commentDto.getComment()); + int i = projServicesDao.update(services); + if (i > 0) { + return new AjaxResult(AjaxResult.STATUS_SUCCESS, "评论成功"); + } else { + return new AjaxResult(AjaxResult.STATUS_FAIL, "评论失败"); + } } - private UserProjInfo coversion(SysProjUse pUse) { - UserProjInfo projInfo = new UserProjInfo(); - projInfo.setId(pUse.getId()); - projInfo.setName(shoppingGoodsDao.selectById(pUse.getProjId()).getName()); - projInfo.setSurplusCount(pUse.getSurplusCount() + ""); - projInfo.setType(pUse.getType()); - return projInfo; - } - - private int dateToCodeInt(Date date) { - return Integer.parseInt(DateUtil.dateToString(date, DateUtil.HHmm)); - } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ApplyToBeAnSalesmanDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ApplyToBeAnSalesmanDto.java new file mode 100644 index 0000000..1e59168 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ApplyToBeAnSalesmanDto.java @@ -0,0 +1,16 @@ +package com.matrix.system.shopXcx.api.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotBlank; + +@ApiModel(value = "AddVipDto", description = "添加会员接收参数类") +public class ApplyToBeAnSalesmanDto { + + @NotBlank(message = "性别不能为空") + @ApiModelProperty(value = "性别", example = "男/女") + private String sex; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ClickSignDTO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ClickSignDTO.java new file mode 100644 index 0000000..b8a7a6b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ClickSignDTO.java @@ -0,0 +1,17 @@ +package com.matrix.system.shopXcx.api.dto; + +import javax.validation.constraints.NotBlank; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@ApiModel(value = "ClickSignDTO", description = "点击签到接收参数类") +@Data +public class ClickSignDTO { + + @NotBlank(message = "签到活动ID不能为空") + @ApiModelProperty(value = "签到活动ID", example = "1") + private long actId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpOrderListDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpOrderListDto.java new file mode 100644 index 0000000..a3dea39 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpOrderListDto.java @@ -0,0 +1,78 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.PaginationDto; +import com.matrix.system.app.dto.BasePageDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author jyy + * @date 2020-12-23 + **/ +@ApiModel(value = "ErpOrderListDto", description = "订单列表接收参数类") +public class ErpOrderListDto extends PaginationDto { + + @ApiModelProperty(value = "订单状态 0-全部 1-待付款 2-已付款 3-欠款 4-已取消 全部默认传空字符串", example = "1") + private Integer orderStatus; + + @ApiModelProperty(hidden = true) + private String status; + + @ApiModelProperty(value = "查询字段") + private String queryKey; + + @ApiModelProperty(hidden = true) + private Long vipId; + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + public Integer getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(Integer orderStatus) { + this.orderStatus = orderStatus; + switch (orderStatus) { + case 0 : + this.status = ""; + break; + case 1: + this.status = "待付款"; + break; + case 2: + this.status = "已付款"; + break; + case 3: + this.status = "欠款"; + break; + case 4: + this.status = "已取消"; + break; + default: + this.status = ""; + break; + } + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceCommentDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceCommentDto.java new file mode 100644 index 0000000..25dbf57 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceCommentDto.java @@ -0,0 +1,41 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.PaginationDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @author jyy + * @date 2020-12-23 + **/ +@ApiModel(value = "ErpServiceCommentDto", description = "服务评价") +public class ErpServiceCommentDto { + + + @NotNull(message = "评论内容不能为空") + @ApiModelProperty(value = "评论内容") + private String comment; + + @NotNull(message = "服务单id不能为空") + @ApiModelProperty(value = "服务单id") + private Long id; + + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceOrderListDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceOrderListDto.java new file mode 100644 index 0000000..ceba6b0 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceOrderListDto.java @@ -0,0 +1,50 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.PaginationDto; +import com.matrix.system.app.dto.BasePageDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @author jyy + * @date 2020-12-24 + **/ +@ApiModel(value = "ErpServiceOrderListDto", description = "服务单列表参数接收类") +public class ErpServiceOrderListDto extends PaginationDto { + + @ApiModelProperty(value = "查询参数") + private String queryKey; + + @ApiModelProperty(value = "客户视角状态 0/全部 1/待确认 2进行中(待排班/待配料/待服务/服务中) 3/待评价(已完成/服务结束) 4/已评价 5/已取消 ") + private String vipStatus; + + @ApiModelProperty(value = "客户ID") + private Long vipId; + + public String getVipStatus() { + return vipStatus; + } + + public void setVipStatus(String vipStatus) { + this.vipStatus = vipStatus; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public String getQueryKey() { + return queryKey; + } + + public void setQueryKey(String queryKey) { + this.queryKey = queryKey; + } + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/MoneyCardUseFlowDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/MoneyCardUseFlowDto.java new file mode 100644 index 0000000..138cabb --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/MoneyCardUseFlowDto.java @@ -0,0 +1,34 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(value = "MoneyCardUseFlowDto", description = "储值卡流水查询参数接收类") +public class MoneyCardUseFlowDto extends BasePageQueryDto { + + + @NotEmpty(message = "请选择查询时间") + @ApiModelProperty(value = "查询月份",example = "2021-03") + private String queryTime; + + + @ApiModelProperty(value = "收支类型 不传全部,1,收入,2支出", example = "1") + private Integer revenueType; + + @NotNull(message = "请选择要查询的储值卡ID") + @ApiModelProperty(value = "储值卡id", example = "1") + private Long carUseId; + + @ApiModelProperty(hidden = true) + private Long companyId; + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java new file mode 100644 index 0000000..7b21018 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java @@ -0,0 +1,26 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(value = "RevenueFlowDto", description = "收益流水查询参数接收类") +public class RevenueFlowDto extends BasePageQueryDto { + + @NotNull(message = "查询月份不能为空") + @ApiModelProperty(value = "查询月份",example = "2021-03") + private String queryTime; + + + @ApiModelProperty(value = "收益类型 不传全部,1,收入,2支出", example = "1") + private Integer revenueType; + + @ApiModelProperty(hidden = true) + private Long userId; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java new file mode 100644 index 0000000..d8593f4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java @@ -0,0 +1,27 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(value = "SaleOrderDto", description = "分销订单查询参数接收类") +public class SaleOrderDto extends BasePageQueryDto { + + @NotNull(message = "订单类型不能为空") + @ApiModelProperty(value = "订单类型1推广订单,2邀请订单", example = "1") + private Integer revenueType; + + + @ApiModelProperty(value = "结算状态1,待结算,2,已结算,3已退款", example = "1") + private Integer orderStatus; + + @ApiModelProperty(hidden = true) + private Long userId; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java new file mode 100644 index 0000000..ffd1375 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleProductDto.java @@ -0,0 +1,18 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SaleProductDto", description = "分销产品查询参数接收类") +public class SaleProductDto extends BasePageQueryDto { + + @ApiModelProperty(value = "产品分类", example = "1") + private Integer categoryId; + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java new file mode 100644 index 0000000..ed2d87b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java @@ -0,0 +1,41 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.pojo.BasePageQueryDto; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +@ApiModel(value = "ScoreFlowDto", description = "积分流水查询参数接收类") +public class ScoreFlowDto extends BasePageQueryDto { + + + @ApiModelProperty(value = "查询月份",example = "2021-03") + private String queryTime; + + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) + @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") + private Date beginTime; + + @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) + @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") + private Date endTime; + + + @ApiModelProperty(value = "收支类型 不传全部,1,收入,2支出", example = "1") + private Integer revenueType; + + + @ApiModelProperty(value = "会员id", example = "1") + private Long vipId; + + @ApiModelProperty(value = "备注", example = "1") + private String remarks; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java new file mode 100644 index 0000000..cbb8a51 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java @@ -0,0 +1,20 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.BasePageQueryDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ScoreProductDto", description = "积分产品查询参数接收类") +public class ScoreProductDto extends BasePageQueryDto { + + @ApiModelProperty(value = "产品分类", example = "1") + private Integer scoreCategoryId; + + + @ApiModelProperty(value = "属性编码", example = "jfscrmtj") + private String attrCode; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SeeAwardTextDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SeeAwardTextDto.java new file mode 100644 index 0000000..0549ec2 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SeeAwardTextDto.java @@ -0,0 +1,24 @@ +package com.matrix.system.shopXcx.api.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(value = "SeeAwardTextDto", description = "查询参数接收类") +public class SeeAwardTextDto { + + + @NotNull(message = "奖品记录ID不能为空") + @ApiModelProperty(value = "奖品记录ID", example = "1") + private Long awardId; + + @ApiModelProperty(hidden = true) + private Long userId; + + @ApiModelProperty(hidden = true) + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SignAwardDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SignAwardDto.java new file mode 100644 index 0000000..89196d2 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SignAwardDto.java @@ -0,0 +1,20 @@ +package com.matrix.system.shopXcx.api.dto; + +import com.matrix.core.pojo.BasePageQueryDto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +@Data +@ApiModel(value = "SignAwardDto", description = "查询参数接收类") +public class SignAwardDto extends BasePageQueryDto { + + @ApiModelProperty(hidden = true) + private Long userId; + + @ApiModelProperty(hidden = true) + private Long companyId; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/WithdrawalCashDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/WithdrawalCashDto.java new file mode 100644 index 0000000..0502904 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/WithdrawalCashDto.java @@ -0,0 +1,20 @@ +package com.matrix.system.shopXcx.api.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +@ApiModel(value = "WithdrawalCashDto", description = "提现参数接收类") +public class WithdrawalCashDto { + + @NotNull(message = "提现金额不能为空") + @ApiModelProperty(value = "提现金额", example = "1") + private Double amount; + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java new file mode 100644 index 0000000..c870683 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java @@ -0,0 +1,46 @@ +package com.matrix.system.shopXcx.api.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "XcxUserSaveUserInfoDto", description = "小程序用户授权信息保存接收类") +public class XcxUserSaveUserInfoDto { + + @ApiModelProperty(value = "手机号码" ) + private String phoneNumber; + + @ApiModelProperty(value = "昵称" ) + private String nickName; + + + @ApiModelProperty(value = "头像" ) + private String avatarUrl; + + + @ApiModelProperty(value = "性别" ) + private Integer gender; + + + /** + * 用户所在国家 + */ + private String country; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/AddShopOrderPOJO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/AddShopOrderPOJO.java deleted file mode 100644 index 3398072..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/AddShopOrderPOJO.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.matrix.system.shopXcx.api.pojo; - -import java.util.List; - -/** - * @author jyy - */ -public class AddShopOrderPOJO { - - - /** - * 收货地址ID - */ - private Integer receiveAddrId; - - /** - * 配送方式(1=物流,2=门店自取) - */ - private String deliverySelect; - - /** - * 配送门店ID - */ - private Long shopId; - - /** - * 优惠券记录id - */ - private Integer couponReceiveId; - - - - /** - * 订单备注 - */ - private String remarks; - - /** - * 购买商品规格列表详情 - */ - private List<OrderProductSkuPOJO> skuList; - - - public Integer getReceiveAddrId() { - return receiveAddrId; - } - - public void setReceiveAddrId(Integer receiveAddrId) { - this.receiveAddrId = receiveAddrId; - } - - public String getDeliverySelect() { - return deliverySelect; - } - - public void setDeliverySelect(String deliverySelect) { - this.deliverySelect = deliverySelect; - } - - public Long getShopId() { - return shopId; - } - - public void setShopId(Long shopId) { - this.shopId = shopId; - } - - public Integer getCouponReceiveId() { - return couponReceiveId; - } - - public void setCouponReceiveId(Integer couponReceiveId) { - this.couponReceiveId = couponReceiveId; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public List<OrderProductSkuPOJO> getSkuList() { - return skuList; - } - - public void setSkuList(List<OrderProductSkuPOJO> skuList) { - this.skuList = skuList; - } -} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/CalculatePostagePOJO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/CalculatePostagePOJO.java index ca95377..ccf8fef 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/CalculatePostagePOJO.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/CalculatePostagePOJO.java @@ -19,7 +19,7 @@ /** * 购买规格信息列表 */ - private List<OrderProductSkuPOJO> skuList; + private List<OrderItemDto> skuList; public Integer getAddrId() { @@ -38,11 +38,11 @@ this.couponId = couponId; } - public List<OrderProductSkuPOJO> getSkuList() { + public List<OrderItemDto> getSkuList() { return skuList; } - public void setSkuList(List<OrderProductSkuPOJO> skuList) { + public void setSkuList(List<OrderItemDto> skuList) { this.skuList = skuList; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderCouponGroup.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderCouponGroup.java new file mode 100644 index 0000000..7de34e4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderCouponGroup.java @@ -0,0 +1,43 @@ +package com.matrix.system.shopXcx.api.pojo; + +import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; +import com.matrix.system.shopXcx.bean.ShopCoupon; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 购物车前台展示对象 + */ +@Data +public class OrderCouponGroup { + + private ShopCoupon coupon; + + //是否满足优惠 + private boolean satisfactionCoupon; + + private List<OrderItemDto> orderItemDtos; + + //提示语 + private String msg=""; + + //优惠小计金额 + private BigDecimal subtotal=BigDecimal.ZERO; + + //原价 + private BigDecimal srcPrice=BigDecimal.ZERO; + + //优惠金额 + private BigDecimal couponPrice=BigDecimal.ZERO; + /** + * 抵用积分 + */ + private BigDecimal scorePay = BigDecimal.ZERO; + + private CouponReceiveInfoVO couponReceiveInfoVO; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderItemDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderItemDto.java new file mode 100644 index 0000000..de86b06 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderItemDto.java @@ -0,0 +1,47 @@ +package com.matrix.system.shopXcx.api.pojo; + +import com.matrix.system.shopXcx.bean.ShopCoupon; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.bean.ShopSku; +import lombok.Data; + +import java.util.List; + +/** + * @author jyy + */ +@Data +public class OrderItemDto { + /** + * 产品ID + */ + private Integer productId; + /** + * 产品规格ID + */ + private Integer skuId; + + private ShopProduct shopProduct; + + private ShopSku shopSku; + + /** + * 购买数量 + */ + private Integer count; + + /** + * 支付方式1 直接购买 2,积分兑换 + */ + private Integer payType; + + /** + * 购物车id + */ + private Integer cartId; + + + private List<ShopCoupon> shopCoupons; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderProductSkuPOJO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderProductSkuPOJO.java deleted file mode 100644 index 3e0b92b..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/OrderProductSkuPOJO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.matrix.system.shopXcx.api.pojo; - -/** - * @author jyy - */ -public class OrderProductSkuPOJO { - - /** - * 产品规格ID - */ - private Integer skuId; - - /** - * 购买数量 - */ - private Integer count; - - - public Integer getSkuId() { - return skuId; - } - - public void setSkuId(Integer skuId) { - this.skuId = skuId; - } - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } -} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/ShopOrderDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/ShopOrderDto.java new file mode 100644 index 0000000..af5865f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/pojo/ShopOrderDto.java @@ -0,0 +1,58 @@ +package com.matrix.system.shopXcx.api.pojo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @author jyy + */ +@Data +public class ShopOrderDto { + + + public static final Integer JOIN_ACTIVE = 1; + /** + * 收货地址ID + */ + @NotNull(message = "请选择正确的收获地址") + private Integer receiveAddrId; + + /** + * 配送方式(1=物流,2=门店自取) + */ + private Integer deliverySelect; + + /** + * 配送门店ID + */ + private Long shopId; + + /** + * 优惠券记录id + */ + private Integer couponReceiveId; + + /** + * 参加店铺活动 1参加 2不参加 + */ + private Integer joinActive; + + /** + * 支付方式1微信,2 vipCard余额 + */ + @NotNull(message = "请选择支付方式") + private Integer payMethod; + + /** + * 订单备注 + */ + private String remarks; + + /** + * 购买商品规格列表详情 + */ + private List<OrderItemDto> orderItemList; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/OrderCouponGroupService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/OrderCouponGroupService.java new file mode 100644 index 0000000..63c7c47 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/OrderCouponGroupService.java @@ -0,0 +1,282 @@ +package com.matrix.system.shopXcx.api.service; + +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.shopXcx.api.pojo.OrderCouponGroup; +import com.matrix.system.shopXcx.api.pojo.OrderItemDto; +import com.matrix.system.shopXcx.bean.ShopCoupon; +import com.matrix.system.shopXcx.bean.ShopShoppingCart; +import com.matrix.system.shopXcx.dao.ShopProductDao; +import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.*; + +/** + * 购物车前台展示对象 + */ +@Service +public class OrderCouponGroupService { + @Autowired + private ShopShoppingCartDao shoppingCartDao; + @Autowired + private UserCacheManager userCacheManager; + + @Autowired + WxShopCouponService shopCouponService; + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + ShopProductDao shopProductDao; + + @Autowired + ShopSkuDao shopSkuDao; + + /** + * 初始化OrderCouponElement + * @param skuId + * @param count + * @param payType + * @return + */ + public OrderItemDto buildOrderCouponElement(OrderItemDto orderItemDto){ + orderItemDto.setShopSku(shopSkuDao.selectById(orderItemDto.getSkuId())); + orderItemDto.setShopProduct(shopProductDao.selectById(orderItemDto.getProductId())); + return orderItemDto; + } + + /** + * 计算用户的产品可以参与的店铺优惠活动分组 + */ + public List<OrderCouponGroup> buildOrderCouponGroupList(List<OrderItemDto> list) { + + //定义购物车优惠分组 + List<OrderCouponGroup> orderCouponGroupList = new ArrayList<>(); + // 1表示没有优惠的默认分组 + OrderCouponGroup def = new OrderCouponGroup(); + def.setSatisfactionCoupon(true); + def.setMsg("商城"); + def.setOrderItemDtos(new ArrayList<>()); + // 组合默认分组 + orderCouponGroupList.add(def); + + // 记录所有优惠券,一个优惠券(活动)表示一组 + Map<Integer, ShopCoupon> shopCouponMap = new HashMap<>(); + + //查询购物车中的产品匹配上的所有优惠活动 + for (OrderItemDto orderItemDto : list) { + + if(orderItemDto.getPayType()== ShopShoppingCart.CAR_TYPE_SCORE){ + // 积分兑换产品不参加优惠 + def.getOrderItemDtos().add(orderItemDto); + }else{ + List<ShopCoupon> shopCouponList = shopCouponService.getHdListByProductId(orderItemDto.getProductId()); + if (CollectionUtils.isNotEmpty(shopCouponList)) { + // 把所有的优惠券和购物车条目先关联一下,后续可以计算优惠升级的情况 + orderItemDto.setShopCoupons(shopCouponList); + for (ShopCoupon shopCoupon : shopCouponList) { + shopCouponMap.put(shopCoupon.getId(), shopCoupon); + } + } else { + // 该产品没有参加优惠券 + def.getOrderItemDtos().add(orderItemDto); + } + } + + } + + //计算没有优惠组的价格 + countPrice(def); + + + /* + * 计算优惠券分组 1、获取到所有的优惠券,从最高满减开始,找寻合适的产品,找到后加入对应的购物车组 + * 2、计算组内价格 + */ + Set<Integer> keys = shopCouponMap.keySet(); + List<ShopCoupon> allShopCoupons = new ArrayList<>(); + for (Integer key : keys) { + allShopCoupons.add(shopCouponMap.get(key)); + } + + //根据优惠力度排序,优惠力度大的先参与计算 + Collections.sort(allShopCoupons, new Comparator() { + @Override + public int compare(Object o1, Object o2) { + ShopCoupon e1 = (ShopCoupon) o1; + ShopCoupon e2 = (ShopCoupon) o2; + return e2.getMinAmount().compareTo(e1.getMinAmount()); + } + }); + + + // 进行购物车和优惠券的匹配,匹配成功的加入到优惠组中, + for (int i = 0; i < allShopCoupons.size(); i++) { + ShopCoupon shopCoupon = allShopCoupons.get(i); + OrderCouponGroup shopCarVo = new OrderCouponGroup(); + shopCarVo.setCoupon(shopCoupon); + shopCarVo.setOrderItemDtos(new ArrayList<>()); + orderCouponGroupList.add(i, shopCarVo); + + // 获取所有购物车条目 + for (OrderItemDto orderItemDto : list) { + // 如果匹配到的产品已经出现在其他优惠组中,则需要判断是否移除之前的组 + boolean needRemove = false; + + // 判断当前购物车条目是否已经在合适的组里了 + if (isInGroupAndSatisfaction(orderItemDto, orderCouponGroupList)) { + continue; + + } else if (isInGroupNotSatisfaction(orderItemDto, orderCouponGroupList)) { + needRemove = true; + } + + List<ShopCoupon> cartCouons = orderItemDto.getShopCoupons(); + if (cartCouons != null) { + // 获取每个购物车条目满足的优惠 + for (ShopCoupon cartCouon : cartCouons) { + if (cartCouon.getId().equals(shopCoupon.getId())) { + //匹配成功,加入本组 + LogUtil.debug("购物车" + orderItemDto.getProductId() + "和优惠券" + cartCouon.getCName() + "匹配"); + if (needRemove) { + removeNotSatisfaction(orderItemDto, orderCouponGroupList); + } + shopCarVo.getOrderItemDtos().add(orderItemDto); + break; + } + } + } + + } + + // 计算本组优惠券是否已经满足优惠条件 + countPrice(shopCarVo); + } + + + // 因为有些优惠中可能没有产品,所以要去除cartList中没有产品的分组 + List<OrderCouponGroup> cartListCopy = new ArrayList<>(); + for (OrderCouponGroup orderCouponGroup : orderCouponGroupList) { + if (CollectionUtils.isNotEmpty(orderCouponGroup.getOrderItemDtos())) { + cartListCopy.add(orderCouponGroup); + } + } + return cartListCopy; + } + + + /** + * 购车条目在组中并且组是否已经满足优惠的 + * + * @param cartList + * @return + */ + private boolean isInGroupAndSatisfaction(OrderItemDto orderItemDto, List<OrderCouponGroup> cartList) { + boolean result = false; + for (OrderCouponGroup cartVo : cartList) { + if (cartVo.isSatisfactionCoupon() && cartVo.getOrderItemDtos().contains(orderItemDto)) { + result = true; + } + } + return result; + } + + /** + * 购物车条目在组中,但是组中产品没有达到优惠条件 + * @param cartList + * @return + */ + private boolean isInGroupNotSatisfaction(OrderItemDto orderItemDto, List<OrderCouponGroup> cartList) { + boolean result = false; + for (OrderCouponGroup cartVo : cartList) { + if (!cartVo.isSatisfactionCoupon() && cartVo.getOrderItemDtos().contains(orderItemDto)) { + result = true; + } + } + return result; + } + + /** + * 删除购物车条目所在分组中的引用 + * + * @param cartList + */ + private void removeNotSatisfaction(OrderItemDto orderItemDto, List<OrderCouponGroup> cartList) { + for (OrderCouponGroup cartVo : cartList) { + if (cartVo.getOrderItemDtos().remove(orderItemDto)) { + LogUtil.debug("删除购物车所在组" + cartVo.getCoupon().getCName() + "," + orderItemDto.getProductId()); + } + } + } + + /** + * 计算购物车价格和优惠信息 + * + * @author JIANGYOUYAO + * @email 935090232@qq.com + * @date 2019年8月27日 + */ + private void countPrice(OrderCouponGroup orderCouponGroup) { + List<OrderItemDto> orderItemDtoList = orderCouponGroup.getOrderItemDtos(); + // 计算总价 + BigDecimal sum = BigDecimal.ZERO; + //抵扣总积分 + BigDecimal scoreSum = BigDecimal.ZERO; + + for (OrderItemDto orderCouponElement : orderItemDtoList) { + if(ShopShoppingCart.CAR_TYPE_MICRO==orderCouponElement.getPayType()){ + //直接购买 + sum = sum.add(orderCouponElement.getShopSku().getPrice().multiply(BigDecimal.valueOf(orderCouponElement.getCount()))); + + }else if(ShopShoppingCart.CAR_TYPE_SCORE==orderCouponElement.getPayType()){ + //积分兑换 + sum = sum.add(orderCouponElement.getShopSku().getScorePrice().multiply(BigDecimal.valueOf(orderCouponElement.getCount()))); + scoreSum = scoreSum.add(new BigDecimal(orderCouponElement.getShopSku().getScoreCount() * orderCouponElement.getCount())); + }else{ + throw new GlobleException("参数错误"); + } + } + + if (orderCouponGroup.getCoupon() != null) { + // 存在优惠券 + if (sum.compareTo(orderCouponGroup.getCoupon().getMinAmount()) >= 0) { + //标记为合理分组 + orderCouponGroup.setSatisfactionCoupon(true); + if (sum.compareTo(orderCouponGroup.getCoupon().getMinAmount()) >= 0) { + orderCouponGroup.setSubtotal(sum.subtract(orderCouponGroup.getCoupon().getOffsetAmount())); + orderCouponGroup.setSrcPrice(sum); + orderCouponGroup.setCouponPrice(orderCouponGroup.getCoupon().getOffsetAmount()); + orderCouponGroup.setMsg(orderCouponGroup.getCoupon().getCName() + ",已优惠" + + orderCouponGroup.getCoupon().getOffsetAmount().stripTrailingZeros().toPlainString() + "元"); + } + } + if (sum.compareTo(orderCouponGroup.getCoupon().getMinAmount()) < 0) { + orderCouponGroup.setSatisfactionCoupon(false); + orderCouponGroup.setSubtotal(sum); + orderCouponGroup.setSrcPrice(sum); + orderCouponGroup.setMsg(orderCouponGroup.getCoupon().getCName()); + if (sum.doubleValue() > 0) { + orderCouponGroup.setMsg(orderCouponGroup.getCoupon().getCName() + ",再买" + + (orderCouponGroup.getCoupon().getMinAmount().subtract(sum)).stripTrailingZeros() + .toPlainString() + + "元立减" + orderCouponGroup.getCoupon().getOffsetAmount().stripTrailingZeros().toPlainString() + + "元"); + } + } + } else { + orderCouponGroup.setSubtotal(sum); + orderCouponGroup.setSrcPrice(sum); + orderCouponGroup.setSatisfactionCoupon(true); + } + orderCouponGroup.setScorePay(scoreSum); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java index 4f9f35a..aed6be7 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java @@ -1,19 +1,13 @@ package com.matrix.system.shopXcx.api.service; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.tools.LogUtil; -import com.matrix.biz.bean.BizUser; -import com.matrix.system.common.bean.BusParameterSettings; -import com.matrix.system.common.bean.CustomerDataDictionary; import com.matrix.system.common.dao.BusParameterSettingsDao; -import com.matrix.system.common.dao.CustomerDataDictionaryDao; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.system.common.constance.AppConstance; - +import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; +import com.matrix.system.shopXcx.api.vo.ShopCartVo; import com.matrix.system.shopXcx.bean.ShopCoupon; import com.matrix.system.shopXcx.bean.ShopShoppingCart; import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; -import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; -import com.matrix.system.shopXcx.api.vo.ShopCartVo; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -27,7 +21,7 @@ @Autowired private ShopShoppingCartDao shoppingCartDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired WxShopCouponService shopCouponService; @@ -37,15 +31,11 @@ @Autowired BusParameterSettingsDao busParameterSettingsDao; - + //计算购车选中项总价以及优惠金额 public ShopCartBillVo buildShopCartBillVo(List<ShopCartVo> cartList) { ShopCartBillVo shopCartBillVo = new ShopCartBillVo(); - //计算购车选中项总价以及优惠金额 - BigDecimal billTotal = BigDecimal.ZERO; - BigDecimal billCouponTotal = BigDecimal.ZERO; - //未优惠之前的金额 - BigDecimal srcTotal = BigDecimal.ZERO; + //计算是否存在选中的产品 Integer selectCount = 0; @@ -64,8 +54,6 @@ shopCartBillVo.setBillCouponTotal(shopCartBillVo.getBillCouponTotal().add(shopCartVo.getCouponPrice())); } } - - for (ShopShoppingCart shopCart : shopCartVo.getCartList()) { if (shopCart.getIsSelected() == 1) { selectCount += shopCart.getCartNumber(); @@ -78,19 +66,7 @@ return shopCartBillVo; } - /** - * 计算用户的购物车产品优惠分组 - * - * @return - * @param shopId - */ - public List<ShopCartVo> findUserCartList(Long shopId) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - String userId = loginUser.getOpenId(); - List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shopId,userId); - List<ShopCartVo> cartList = buildShopCart(list); - return cartList; - } + /** @@ -100,7 +76,7 @@ * @return */ @SuppressWarnings("unchecked") - private List<ShopCartVo> buildShopCart(List<ShopShoppingCart> list) { + public List<ShopCartVo> buildShopCart(List<ShopShoppingCart> list) { //定义购物车优惠分组 @@ -108,13 +84,9 @@ // 1表示没有优惠的默认分组 ShopCartVo def = new ShopCartVo(); - /** - * 同城配送标题 - * //DataDictionary qsfy = dataDictionaryDao.selectByTypeCode(AppConstance.QSFY); - * //def.setMsg("2公里内满" + qsfy.getValue() + "元免配送费"); - */ - def.setMsg("肽研官方商城"); + + def.setMsg("商城"); def.setCartList(new ArrayList<>()); // 组合默认分组 cartList.add(def); @@ -284,8 +256,14 @@ for (ShopShoppingCart shopShoppingCart : cartList) { sum = sum.add(shopShoppingCart.getPrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); if (shopShoppingCart.getIsSelected() == 1) { - selectSum = selectSum - .add(shopShoppingCart.getPrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); + if(shopShoppingCart.getCartType()==ShopShoppingCart.CAR_TYPE_MICRO){ + selectSum = selectSum + .add(shopShoppingCart.getPrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); + }else { + selectSum = selectSum + .add(shopShoppingCart.getScorePrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); + } + } } @@ -316,15 +294,9 @@ } } } else { - BusParameterSettings qsfy= busParameterSettingsDao.selectCompanyParamByCode(AppConstance.IN_PROVINCE_PACKAGE_LIST,17L); - shopCartVo.setSubtotal(selectSum); shopCartVo.setSrcPrice(selectSum); - if (selectSum.compareTo(new BigDecimal(qsfy.getParamValue())) < 0) { - shopCartVo.setSatisfactionCoupon(false); - } else { - shopCartVo.setSatisfactionCoupon(true); - } + shopCartVo.setSatisfactionCoupon(true); } } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WXShopOrderService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WXShopOrderService.java index ac90aef..8430dc5 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WXShopOrderService.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WXShopOrderService.java @@ -1,15 +1,12 @@ package com.matrix.system.shopXcx.api.service; -import com.matrix.core.pojo.AjaxResult; import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; -import com.matrix.system.shopXcx.bean.ShopOrder; -import com.matrix.system.shopXcx.dto.DiscountExplain; -import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; +import com.matrix.core.pojo.AjaxResult; import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO; -import com.matrix.system.shopXcx.api.vo.ShopCartVo; +import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; +import com.matrix.system.shopXcx.bean.ShopOrder; import java.math.BigDecimal; -import java.util.List; /** * @author jyy @@ -18,15 +15,15 @@ - BigDecimal calculationPostage(Integer addressId, BigDecimal payPrice); + BigDecimal calculationPostage(BigDecimal payPrice,Long companyId); /** * 创建订单 - * @param addShopOrderPOJO + * @param shopOrderDto * @return * @throws Exception */ - AjaxResult createShopOrder(AddShopOrderPOJO addShopOrderPOJO) throws Exception; + ShopOrder createShopOrder(ShopOrderDto shopOrderDto) throws Exception; /** * 订单结算 @@ -93,5 +90,5 @@ */ AjaxResult updateStockAndVolumeById(Integer orderId); - DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer id, Integer addrId); + AjaxResult buildDiscountExplain(ShopOrderDto shopOrderDto); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java index b406cb6..fd92862 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java @@ -2,9 +2,9 @@ import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.shopXcx.bean.ShopCoupon; -import com.matrix.system.shopXcx.bean.ShopShoppingCart; +import com.matrix.system.shopXcx.api.pojo.OrderItemDto; import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; +import com.matrix.system.shopXcx.bean.ShopCoupon; import java.util.List; @@ -18,7 +18,7 @@ * 根据购物车选中的产品 * @return */ - public List<CouponReceiveInfoVO> getCartVoCouponList(Long shopId,List<ShopShoppingCart> shopShoppingCarts); + public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<OrderItemDto> OrderItemDtos); /** @@ -42,12 +42,12 @@ * 根据状态获取我的优惠券 * * - * @param shopId + * @param companyId * @param status * @param pageVo * @return */ - AjaxResult getMyCouponInfoByStatus(Long shopId, Integer status, PaginationVO pageVo); + AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo); /** * 根据产品ID获取优惠券列表 @@ -62,10 +62,10 @@ * 根据标签获取优惠券列表 * * @param tag - * @param shopId + * @param companyId * @return */ - AjaxResult getCouponListByTag(String tag, Long shopId); + AjaxResult getCouponListByTag(String tag, Long companyId); /** * 根据产品id查询该产品符合的优惠活动 diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java index d473bbf..916994d 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java @@ -13,12 +13,6 @@ */ Boolean refundToUser(String id, ShopRefundRecord shopRefundRecord); - /** - * 退款成功后发送微信提醒 - * @param shopRefundRecord - * @return - */ - int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord); void updateGroupBuyStatus(Long orderId); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java index 4b74dbb..dee24d6 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java @@ -1,37 +1,35 @@ package com.matrix.system.shopXcx.api.service.impl; +import cn.hutool.core.collection.CollUtil; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.matrix.biz.bean.BizUser; -import com.matrix.system.common.bean.BusParameterSettings; -import com.matrix.system.common.bean.CustomerDataDictionary; -import com.matrix.system.common.dao.BusParameterSettingsDao; -import com.matrix.system.common.dao.CustomerDataDictionaryDao; -import com.matrix.component.rabbitmq.RabiitMqTemplate; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.component.tools.WxUtils; import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.dao.CustomerDataDictionaryDao; import com.matrix.system.common.interceptor.HostInterceptor; -import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.ShoppingGoods; +import com.matrix.system.hive.bean.SysVipInfo; import com.matrix.system.hive.dao.ShoppingGoodsDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.score.dao.ScoreVipDetailDao; import com.matrix.system.shopXcx.api.action.PayThreadPool; -import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; +import com.matrix.system.shopXcx.api.pojo.OrderCouponGroup; import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO; +import com.matrix.system.shopXcx.api.pojo.OrderItemDto; +import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; +import com.matrix.system.shopXcx.api.service.OrderCouponGroupService; import com.matrix.system.shopXcx.api.service.ShoppingCartService; import com.matrix.system.shopXcx.api.service.WXShopOrderService; import com.matrix.system.shopXcx.api.service.WxShopCouponService; -import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; -import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; -import com.matrix.system.shopXcx.api.vo.ShopCartVo; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; import com.matrix.system.shopXcx.dto.DiscountExplain; @@ -43,6 +41,7 @@ import java.math.BigDecimal; import java.util.*; +import java.util.stream.Collectors; /** * @author jyy @@ -54,9 +53,7 @@ @Autowired private WxShopOrderUtil wxShopOrderUtil; @Autowired - private WxShopCouponUtil wxShopCouponUtil; - @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private WeixinServiceUtil weixinServiceUtil; @Autowired @@ -67,8 +64,6 @@ private ShopOrderDao shopOrderDao; @Autowired private ShopOrderDetailsDao shopOrderDetailsDao; - @Autowired - private ShopCouponDao shopCouponDao; @Autowired private ShopProductDao shopProductDao; @Autowired @@ -91,6 +86,9 @@ private ShopActivitiesGroupJoinUserDao shopActivitiesGroupJoinUserDao; @Autowired + OrderCouponGroupService orderCouponGroupService; + + @Autowired CustomerDataDictionaryDao dataDictionaryDao; @Value("${wx_pay_debug_onoff}") private boolean isDebug; @@ -98,156 +96,123 @@ @Autowired private BusParameterSettingsDao busParameterSettingsDao; + @Autowired + private ScoreVipDetailDao scoreVipDetailDao; + + + @Autowired + private SysVipInfoDao sysVipInfoDao; @Override - public BigDecimal calculationPostage(Integer addressId, BigDecimal payPrice) { + public BigDecimal calculationPostage(BigDecimal payPrice, Long companyId) { BigDecimal postage = BigDecimal.ZERO; - if (addressId != null) { - ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(addressId); - - - BusParameterSettings sn= busParameterSettingsDao.selectCompanyParamByCode(AppConstance.IN_PROVINCE_PACKAGE_LIST,17L); - - - BusParameterSettings pydq= busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SECOND_PROVINCE_PACKAGE_LIST,17L); - - - - if (sn.getParamValue().indexOf(shopReceiveAddress.getAddrProvince()) > -1) { - //省内邮费计算 - postage = getPostageByDataBictionary(AppConstance.IN_PROVINCE_PACKAGE_PRICE, payPrice); - } else if (pydq.getParamValue().indexOf(shopReceiveAddress.getAddrProvince()) > -1) { - //偏远地区 - postage = getPostageByDataBictionary(AppConstance.SECOND_OUT_PROVINCE_PACKAGE_PRICE, payPrice); - } else { - //其他地区 - postage = getPostageByDataBictionary(AppConstance.FIRST_OUT_PROVINCE_PACKAGE_PRICE, payPrice); + BusParameterSettings yf = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.PACKAGE_PRICE, companyId); + BusParameterSettings myje = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.FREE_PACKAGE_PRICE, companyId); + if (yf != null && myje != null) { + if (Double.parseDouble(myje.getParamValue()) > payPrice.doubleValue()) { + postage = new BigDecimal(yf.getParamValue()); } - } return postage; - } - - //todo 根据数据字典计算运费 运费设置为0 后面再改配置在改计算规则 - private BigDecimal getPostageByDataBictionary(String code, BigDecimal payPrice) { - - /*CustomerDataDictionary dd = dataDictionaryDao.selectByTypeCode(code); - - - BigDecimal postage = BigDecimal.ZERO; - if (StringUtils.isNotBlank(dd.getValue())) { - if (StringUtils.isNotBlank(dd.getExtValue()) - && payPrice.compareTo(new BigDecimal(dd.getExtValue())) >= 0) { - //达到条件免邮 - postage = BigDecimal.ZERO; - } else { - postage = new BigDecimal(dd.getValue()); - } - }*/ - return BigDecimal.ZERO; } /** * 创建订单 * - * @param addShopOrderPOJO + * @param shopOrderDto * @return * @throws Exception */ @Transactional(rollbackFor = Exception.class) @Override - public AjaxResult createShopOrder(AddShopOrderPOJO addShopOrderPOJO) throws Exception { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + public ShopOrder createShopOrder(ShopOrderDto shopOrderDto) throws Exception { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); - //校验收货地址 - ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(addShopOrderPOJO.getReceiveAddrId()); - if (shopReceiveAddress == null) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择正确的收获地址"); - } + ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(shopOrderDto.getReceiveAddrId()); - List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId()); - //购物车不能为空 - if (CollectionUtils.isEmpty(cartList)) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择您需要购买的产品"); - } - - - //取出购物车中选中的产品 - List<ShopShoppingCart> buyCart = new ArrayList<>(); - //取出购物车中没有参加店铺活动的产品,和参加了店铺活动但是活动没有达到标准的产品,用来计算是否可以使用优惠券 - List<ShopShoppingCart> notCouponuyCart = new ArrayList<>(); - for (ShopCartVo shopCartVo : cartList) { - for (ShopShoppingCart shopShoppingCart : shopCartVo.getCartList()) { - if (shopShoppingCart.getIsSelected() == 1) { - buyCart.add(shopShoppingCart); - if (shopCartVo.getCoupon() == null || !shopCartVo.isSatisfactionCoupon()) { - notCouponuyCart.add(shopShoppingCart); - } - } - } - } //计算订单优惠信息 - DiscountExplain discountExplain = buildDiscountExplain(cartList, addShopOrderPOJO.getCouponReceiveId(), shopReceiveAddress.getAddrId()); + AjaxResult caculateResult= buildDiscountExplain(shopOrderDto); + DiscountExplain discountExplain= (DiscountExplain) caculateResult.getMapInfo().get("discountExplain"); + if(discountExplain.getScorePay()!=null){ + //校验用户积分是否够用 + int score=scoreVipDetailDao.selectUserTotalScore(sysVipInfo.getId()); + if(score<discountExplain.getScorePay()){ + throw new GlobleException("积分不足"); + } + } ShopOrder shopOrder = new ShopOrder(); - shopOrder.setCompanyId(bizUser.getCompanyId()); - shopOrder.setStoreId(Integer.parseInt(addShopOrderPOJO.getShopId().toString())); - shopOrder.setOrderType(ShopOrder.ORDER_TYPE_SERVICE); + shopOrder.setCompanyId(sysVipInfo.getCompanyId()); + shopOrder.setStoreId(Integer.parseInt(shopOrderDto.getShopId().toString())); + //默认设置为产品类型 + shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); List<ShopOrderDetails> details = new ArrayList<>(); - Integer cartCount = 0; - for (ShopShoppingCart shopShoppingCart : buyCart) { + // 是否包含实物商品 + boolean hasRealGoods = false; + + Integer orderCount = 0; + for (OrderItemDto orderItemDto : shopOrderDto.getOrderItemList()) { ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); shopOrderDetails.setCreateBy(AppConstance.SYSTEM_USER); shopOrderDetails.setUpdateBy(AppConstance.SYSTEM_USER); - shopOrderDetails.setpId(shopShoppingCart.getCartProductId()); - shopOrderDetails.setsId(shopShoppingCart.getCartSkuId()); - shopOrderDetails.setPrice(shopShoppingCart.getPrice()); - shopOrderDetails.setCount(shopShoppingCart.getCartNumber()); - shopOrderDetails.setsTitle(shopShoppingCart.getTitle() + shopShoppingCart.getName()); - shopOrderDetails.setDiscountAmount(BigDecimal.ZERO); - shopOrderDetails.setTotalPrice(shopOrderDetails.getPrice().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); - details.add(shopOrderDetails); - cartCount += shopOrderDetails.getCount(); + shopOrderDetails.setpId(orderItemDto.getProductId()); - //查询绑定的产品是否为家居产品,如果已经含家具产品则不再比较 - if (ShopOrder.ORDER_TYPE_GOODS != shopOrder.getOrderType()) { - ShopSku shopSku = shopSkuDao.selectById(shopShoppingCart.getCartSkuId()); - String stokCode = shopSku.getStockCode(); - if (StringUtils.isNotBlank(stokCode)) { - ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(Long.parseLong(stokCode)); - if (shoppingGoods != null) { - //根据购买的产品设置订单类型 - if (Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(shoppingGoods.getGoodType())) { - shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); - } else { - - } - } else { - shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); - } + if (!hasRealGoods) { + ShopProduct shopProduct = shopProductDao.selectById(orderItemDto.getProductId()); + if (shopProduct.getIsUnrealProduct() == 2) { + hasRealGoods = true; } } + shopOrderDetails.setsId(orderItemDto.getSkuId()); + shopOrderDetails.setCount(orderItemDto.getCount()); + if(ShopOrderDetails.PAYTYPE_MICRO==orderItemDto.getPayType()){ + shopOrderDetails.setPrice(orderItemDto.getShopSku().getPrice()); + }else{ + shopOrderDetails.setPrice(orderItemDto.getShopSku().getScorePrice()); + shopOrderDetails.setScoreCount(BigDecimal.valueOf(orderItemDto.getShopSku().getScoreCount())); + shopOrderDetails.setTotalScoreCount(shopOrderDetails.getScoreCount().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); + } + shopOrderDetails.setTotalPrice(shopOrderDetails.getPrice().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); + + shopOrderDetails.setPayType(orderItemDto.getPayType()); + + shopOrderDetails.setsTitle(orderItemDto.getShopProduct().getTitle() + orderItemDto.getShopSku().getName()); + + shopOrderDetails.setDiscountAmount(BigDecimal.ZERO); + + details.add(shopOrderDetails); + orderCount += shopOrderDetails.getCount(); + if(orderItemDto.getCartId()!=null){ + //删除用户购物车选中的产品 + shoppingCartDao.deleteById(orderItemDto.getCartId()); + } } //校验商品是否限购 - wxShopOrderUtil.verifyProductLimitInfo(details, bizUser.getOpenId()); + wxShopOrderUtil.verifyProductLimitInfo(details, sysVipInfo.getOpenId()); //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] wxShopOrderUtil.updateProductAndSkuInfo(details); //用户openId - shopOrder.setUserId(bizUser.getOpenId()); + shopOrder.setUserId(sysVipInfo.getId()); shopOrder.setCreateBy("微信小程序生成"); shopOrder.setUpdateBy("微信小程序生成"); + shopOrder.setPayMethod(shopOrderDto.getPayMethod()); shopOrder.setCommodityPrice(discountExplain.getBillPrice()); - shopOrder.setPurchaseQuantity(cartCount); + shopOrder.setPurchaseQuantity(orderCount); + shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); //购买方式 - shopOrder.setShippingMethod(addShopOrderPOJO.getDeliverySelect()); + shopOrder.setShippingMethod(shopOrderDto.getDeliverySelect()); + // 客户选择的物流配送,且没有实物产品(全是虚拟产品), 则直接门店自提,无需填写配送单 + if (ShopOrder.SHIPPING_METHOD_WL == shopOrderDto.getDeliverySelect() && !hasRealGoods) { + shopOrder.setShippingMethod(ShopOrder.SHIPPING_METHOD_MDZT); + } //生成订单号 shopOrder.setOrderNo(WxUtils.getOrderNum()); //设置支付状态 @@ -262,7 +227,7 @@ //客户姓名 shopOrder.setUserName(shopReceiveAddress.getAddrLiaisonman()); //备注 - shopOrder.setRemarks(addShopOrderPOJO.getRemarks()); + shopOrder.setRemarks(shopOrderDto.getRemarks()); //删除标识 shopOrder.setDelFlag(AppConstance.DATA_USEABLE); //微信订单号 @@ -273,13 +238,14 @@ //获取邮费 shopOrder.setPostage(discountExplain.getPostage()); shopOrder.setOrderMoney(discountExplain.getPayPrice()); + shopOrder.setScorePay(discountExplain.getScorePay()); Gson g = new GsonBuilder().create(); shopOrder.setDiscountExplain(g.toJson(discountExplain)); - shopOrder.setDiscountAmount(discountExplain.getActivity().add(discountExplain.getCoupon())); + shopOrder.setDiscountAmount(discountExplain.getActivityPrice().add(discountExplain.getCouponPrice())); shopOrder.setCompanyId(HostInterceptor.getCompanyId()); shopOrderDao.insert(shopOrder); - wxShopOrderUtil.insertSendPackageInfo(shopOrder, addShopOrderPOJO.getDeliverySelect(), shopReceiveAddress); + wxShopOrderUtil.insertSendPackageInfo(shopOrder, shopOrderDto.getDeliverySelect(), shopReceiveAddress); //给订单详情表添加订单ID for (ShopOrderDetails shopOrderDetails : details) { shopOrderDetails.setOrderId(shopOrder.getId()); @@ -288,48 +254,138 @@ shopOrderDetailsDao.batchInsert(details); } //更新使用的优惠券状态 - if (addShopOrderPOJO.getCouponReceiveId() != null) { + if (shopOrderDto.getCouponReceiveId() != null) { ShopCouponRecord record = new ShopCouponRecord(); record.setIsUsing(AppConstance.MY_COUPON_USE); record.setOrderId(shopOrder.getId()); - record.setId(addShopOrderPOJO.getCouponReceiveId()); + record.setId(shopOrderDto.getCouponReceiveId()); shopCouponRecordDao.updateByModel(record); } - //删除用户购物车选中的产品 - shoppingCartDao.deleteUserSelectCart(bizUser.getOpenId()); - BrandWCPayRequestData payData = startPayment(shopOrder); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(payData)); - result.putInMap("orderId", shopOrder.getId()); - return result; + return shopOrder; } @Override - public DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer receiveId, Integer receiveAddrId) { - ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(cartList); - DiscountExplain discountExplain = new DiscountExplain(); - discountExplain.setActivity(shopCartBill.getBillCouponTotal()); - discountExplain.setBillPrice(shopCartBill.getSrcTotal()); - discountExplain.setPayPrice(shopCartBill.getBillTotal()); - //计算优惠券 - if (receiveId != null) { - CouponReceiveInfoVO couponReceiveInfoVO = shopCouponRecordDao.selectMyCouponByReceiveId(receiveId); - if (couponReceiveInfoVO != null) { - BigDecimal payPrice = discountExplain.getPayPrice().subtract(couponReceiveInfoVO.getOffsetAmount()); - payPrice = payPrice.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : payPrice; - discountExplain.setPayPrice(payPrice); - discountExplain.setCoupon(couponReceiveInfoVO.getOffsetAmount()); - } + public AjaxResult buildDiscountExplain(ShopOrderDto shopOrderDto) { + + if(CollUtil.isEmpty(shopOrderDto.getOrderItemList())){ + return AjaxResult.buildFailInstance("请选择购买的明细"); } - discountExplain.setPostage(calculationPostage(receiveAddrId, discountExplain.getPayPrice())); + //订单计价说明 + DiscountExplain discountExplain = new DiscountExplain(); + //账单总金额 + BigDecimal billPrice = BigDecimal.ZERO; + //活动优惠金额 + BigDecimal activityTotal = BigDecimal.ZERO; + //优惠券惠金额 + BigDecimal couponPrice = BigDecimal.ZERO; + //支付总积分 + Integer scoreCount=0; - //计算实际支付 - discountExplain.setPayPrice(discountExplain.getPayPrice().add(discountExplain.getPostage())); - return discountExplain; + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + + //计算购物车中物品的优惠信息 + List<OrderItemDto> orderItemDtos = shopOrderDto.getOrderItemList() + .stream().map(orderItemDto -> { + return orderCouponGroupService.buildOrderCouponElement(orderItemDto); + }) + .collect(Collectors.toList()); + //计算未优惠的总金额 + for (OrderItemDto orderItemDto :orderItemDtos ){ + if(orderItemDto.getPayType()==ShopShoppingCart.CAR_TYPE_MICRO){ + billPrice=billPrice.add(orderItemDto.getShopSku().getPrice().multiply(new BigDecimal(orderItemDto.getCount()))); + }else{ + billPrice=billPrice.add(orderItemDto.getShopSku().getScorePrice().multiply(new BigDecimal(orderItemDto.getCount()))); + scoreCount+=orderItemDto.getShopSku().getScoreCount()*orderItemDto.getCount(); + } + } + discountExplain.setScorePay(scoreCount); + + + //计算用户的产品可以参与的店铺优惠活动分组 + List<ShopCoupon> shopActiveList = new ArrayList<>();//记录用户可以参与的门店活动 + List<OrderCouponGroup> orderCouponGroupList = new ArrayList<>(); + int conditionsGroupCount = 0; + if (shopOrderDto.getJoinActive() == ShopOrderDto.JOIN_ACTIVE) {//用户参与优惠活动 + orderCouponGroupList = orderCouponGroupService.buildOrderCouponGroupList(orderItemDtos); + conditionsGroupCount = orderCouponGroupList.stream().map(orderCouponGroup -> { + if (orderCouponGroup.isSatisfactionCoupon()&&orderCouponGroup.getCoupon()!=null) { + shopActiveList.add(orderCouponGroup.getCoupon()); + return 1; + } else { + return 0; + } + }).mapToInt(Integer::intValue).sum(); + } + if(CollUtil.isNotEmpty(shopActiveList)){ + activityTotal=shopActiveList.stream().map(ShopCoupon:: getOffsetAmount).reduce(BigDecimal.ZERO,BigDecimal::add); + } + + //门店活动优惠金额 + discountExplain.setActivityPrice(activityTotal); + + + List<CouponReceiveInfoVO> usefulCoupon = new ArrayList<>(); + CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO(); + //满足店铺活动的订单不能使用优惠券 + if (conditionsGroupCount <= 0) { + //计算可用优惠券 + usefulCoupon = wxShopCouponService.getCartVoCouponList(sysVipInfo.getCompanyId(), orderItemDtos); + //获取用户使用的优惠券 + if (shopOrderDto.getCouponReceiveId() == null) { + //如果用户没有选择优惠券则默认选优惠金额最高的 + //计算使用优惠券后的价格 + if (CollectionUtils.isNotEmpty(usefulCoupon)) { + //根据优惠券ID用户ID查询优惠券信息 + shopCoupon = usefulCoupon.get(0); + } + } else if (shopOrderDto.getCouponReceiveId() != 1) { + //用户选择了优惠券 + shopCoupon = shopCouponRecordDao.selectMyCouponByReceiveId(shopOrderDto.getCouponReceiveId()); + } else { + //用户不使用优惠券 + } + //计算优惠券 + if (shopCoupon.getCouponId() != null) { + couponPrice=shopCoupon.getOffsetAmount(); + } + //优惠券金额 + discountExplain.setCouponPrice(couponPrice); + } + + + + //计算运费 + if(ShopOrder.SHIPPING_METHOD_WL==shopOrderDto.getDeliverySelect()){ + discountExplain.setPostage(calculationPostage(billPrice, HostInterceptor.getCompanyId())); + }else{ + discountExplain.setPostage(BigDecimal.ZERO); + } + + //账单总金额 + discountExplain.setBillPrice(billPrice.add(discountExplain.getPostage())); + + BigDecimal payPrice=discountExplain.getBillPrice().subtract(activityTotal).subtract(couponPrice); + //应付金额 + discountExplain.setPayPrice(payPrice.doubleValue()>0?payPrice:BigDecimal.ONE); + + AjaxResult result = AjaxResult.buildSuccessInstance(""); + //结算金额信息 + result.putInMap("discountExplain", discountExplain); + //用户优惠券 + result.putInMap("usefulCoupon", usefulCoupon); + //用户选中的优惠券 + result.putInMap("shopCoupon", shopCoupon); + + //店铺优惠活动 + result.putInMap("shopActiveList", shopActiveList); + + return result; + } @@ -343,12 +399,25 @@ @Override public AjaxResult orderSettlement(int orderId) throws Exception { ShopOrder shopOrder = shopOrderDao.selectById(orderId); + if (shopOrder == null) { - throw new GlobleException("订单不存在!"); + return AjaxResult.buildFailInstance("订单不存在!"); + } + if (ShopOrder.SHOP_ORDER_PAY_METHOD_WX != shopOrder.getPayMethod()) { + return AjaxResult.buildFailInstance("支付方式错误"); } if (!shopOrder.getPayResult().equals(ShopOrder.ORDER_PAY_STATUS_WAIT)) { - throw new GlobleException("该订单不是待支付状态!"); + return AjaxResult.buildFailInstance("该订单不是待支付状态!"); } + + if(shopOrder.getScorePay()!=null){ + //校验用户积分是否够用 + int score=scoreVipDetailDao.selectUserTotalScore(shopOrder.getUserId()); + if(score<shopOrder.getScorePay()){ + return AjaxResult.buildFailInstance("积分不足"); + } + } + BrandWCPayRequestData payData = startPayment(shopOrder); AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(payData)); result.putInMap("orderId", shopOrder.getId()); @@ -368,13 +437,15 @@ BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString()); BrandWCPayRequestData payData; String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId()); + SysVipInfo vipInfo=sysVipInfoDao.selectById(shopOrder.getUserId()); + LogUtil.debug(String.valueOf(isDebug)); if (isDebug) { payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(), - 1, shopOrder.getUserId(), String.valueOf(shopOrder.getId())); + 1, vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); } else { payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(), - unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId())); + unit.multiply(money).intValue(),vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); } ShopOrder updateParam = new ShopOrder(); updateParam.setId(shopOrder.getId()); @@ -391,12 +462,12 @@ */ @Override public AjaxResult getMyOrderInfo(OrderInfoQueryPOJO orderInfoQueryPOJO) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); orderInfoQueryPOJO.setSort("update_time"); if (orderInfoQueryPOJO.getOffset() >= 1) { orderInfoQueryPOJO.setOffset((orderInfoQueryPOJO.getOffset() - 1) * orderInfoQueryPOJO.getLimit()); } - List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(bizUser.getOpenId(), orderInfoQueryPOJO); + List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(sysVipInfo.getId(), orderInfoQueryPOJO); return new AjaxResult(AjaxResult.STATUS_SUCCESS, result); } @@ -408,8 +479,8 @@ */ @Override public AjaxResult getOrderInfoById(Integer orderId) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(bizUser.getOpenId(), orderId); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(sysVipInfo.getId(), orderId); return new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(shopOrder)); } @@ -430,8 +501,8 @@ } if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) > 0) { ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - shopCouponRecord.setUserId(bizUser.getOpenId()); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + shopCouponRecord.setUserId(sysVipInfo.getId()); shopCouponRecord.setOrderId(orderId); List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); if (CollectionUtils.isNotEmpty(recordList)) { @@ -556,8 +627,6 @@ * @param orderId * @return */ - @Autowired - RabiitMqTemplate rabiitMqTemplate; @Override public AjaxResult findOrderPayStatus(Integer orderId) { diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java index be14cdf..5cdb27c 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java @@ -2,13 +2,11 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.component.tools.WxUtils; import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.constance.Dictionary; @@ -44,7 +42,7 @@ private ShopActivitiesGroupInfoDao shopActivitiesGroupInfoDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopActivitiesGroupPriceDao shopActivitiesGroupPriceDao; @@ -91,7 +89,7 @@ @Override @Transactional(rollbackFor = Exception.class) public AjaxResult createGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); ShopActivitiesGroupInfo groupInfo = shopActivitiesGroupInfoDao.selectGroupInfoByActId(groupPrice.getActId()); @@ -103,7 +101,7 @@ // 判断最大开团数量 if (groupInfo.getGiHeadDiscount() != null && groupInfo.getGiHeadDiscount() != 0) { - int createCnt = shopActivitiesGroupJoinDao.selectCreateGroupBuyCount(shopActivities.getId(), bizUser.getOpenId()); + int createCnt = shopActivitiesGroupJoinDao.selectCreateGroupBuyCount(shopActivities.getId(), sysVipInfo.getOpenId()); if (createCnt > groupInfo.getGiHeadDiscount()) { return AjaxResult.buildFailInstance("达到最大开团数量"); } @@ -114,14 +112,14 @@ return AjaxResult.buildFailInstance("达到最大限购数量"); } - int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), bizUser.getOpenId()); + int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), sysVipInfo.getOpenId()); if (count + createGroupBuyDTO.getCount() > groupInfo.getGiLimitBuy()) { return AjaxResult.buildFailInstance("达到最大限购数量"); } } // 判断该用户在这个活动中是否存在拼团,并判断该拼团订单是否已付款 - ShopActivitiesGroupJoin existGroupJoin = shopActivitiesGroupJoinDao.selectExistGroupingJoinByUser(groupPrice.getActId(), bizUser.getOpenId()); + ShopActivitiesGroupJoin existGroupJoin = shopActivitiesGroupJoinDao.selectExistGroupingJoinByUser(groupPrice.getActId(), sysVipInfo.getOpenId()); if (existGroupJoin != null) { if (existGroupJoin.getGjStatus() == ShopActivitiesGroupJoin.ACTIVITIES_JOIN_WAIT_PAY) { return new AjaxResult(AjaxResult.STATUS_FAIL, "您该活动有个订单未付款"); @@ -129,7 +127,7 @@ return new AjaxResult(AjaxResult.STATUS_FAIL, "该活动已存在拼团"); } - boolean isOld = isOldUser(bizUser.getPhoneNumber()); + boolean isOld = isOldUser(sysVipInfo.getPhone()); // 老用户和老带新的开团都必须是老用户 if (ShopActivitiesGroupInfo.GROUP_TYPE_ALL_OLD == groupInfo.getGiType() || ShopActivitiesGroupInfo.GROUP_TYPE_OLD_AND_NEW == groupInfo.getGiType()) { if (!isOld) { @@ -146,7 +144,7 @@ createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); createGroupBuyDTO.setGoodsId(groupInfo.getGoodsId().intValue()); - createGroupBuyDTO.setOpenId(bizUser.getOpenId()); + createGroupBuyDTO.setUserId(sysVipInfo.getId()); ShopOrder shopOrder = createOrderByGroupBuy(createGroupBuyDTO); ShopActivitiesGroupJoin groupJoin = new ShopActivitiesGroupJoin(); @@ -158,19 +156,19 @@ groupJoin.setGjEndTime(gjEndTime.getTime()); groupJoin.setGiId(groupInfo.getId()); groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_WAIT_PAY); - groupJoin.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); - groupJoin.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); - groupJoin.setGjHeadId(bizUser.getOpenId()); + groupJoin.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); + groupJoin.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); + groupJoin.setGjHeadId(sysVipInfo.getId()); groupJoin.setCompanyId(shopActivities.getCompanyId()); shopActivitiesGroupJoinDao.insert(groupJoin); ShopActivitiesGroupJoinUser joinUser = new ShopActivitiesGroupJoinUser(); joinUser.setGjId(groupJoin.getId()); joinUser.setGiId(groupInfo.getId()); - joinUser.setUserId(bizUser.getOpenId()); + joinUser.setUserId(sysVipInfo.getId()); joinUser.setIsHead(ShopActivitiesGroupJoinUser.USER_IS_HEAD_Y); - joinUser.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); - joinUser.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); + joinUser.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); + joinUser.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); joinUser.setIsHasPay(ShopActivitiesGroupJoinUser.IS_HAS_PAY_N); joinUser.setIsHasCancel(ShopActivitiesGroupJoinUser.IS_HAS_CANCEL_N); Calendar payEndTime = Calendar.getInstance(); @@ -193,7 +191,7 @@ @Transactional(rollbackFor = Exception.class) @Override public AjaxResult joinGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); // TODO 需判断拼团结束时间以及当前拼团是否已满员 @@ -202,7 +200,7 @@ return AjaxResult.buildFailInstance("该拼团不存在"); } - if (groupJoin.getGjHeadId().equals(bizUser.getOpenId())) { + if (groupJoin.getGjHeadId().equals(sysVipInfo.getOpenId())) { return AjaxResult.buildFailInstance("您是拼团团长,无法加入拼团"); } @@ -210,7 +208,7 @@ return AjaxResult.buildFailInstance("该拼团时间已结束"); } - ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(bizUser.getOpenId(), groupJoin.getId()); + ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(sysVipInfo.getOpenId(), groupJoin.getId()); if (groupJoinUser != null) { return AjaxResult.buildFailInstance("您已加入了该拼团"); } @@ -228,7 +226,7 @@ return AjaxResult.buildFailInstance("达到最大限购数量"); } - int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), bizUser.getOpenId()); + int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), sysVipInfo.getOpenId()); if (count + createGroupBuyDTO.getCount() > groupInfo.getGiLimitBuy()) { return AjaxResult.buildFailInstance("达到最大限购数量"); } @@ -243,7 +241,7 @@ return AjaxResult.buildFailInstance("该拼团已满员"); } - boolean isOld = isOldUser(bizUser.getPhoneNumber()); + boolean isOld = isOldUser(sysVipInfo.getPhone()); // 老用户 -- 加入拼团的都必须是老用户 if (ShopActivitiesGroupInfo.GROUP_TYPE_ALL_OLD == groupInfo.getGiType()) { if (!isOld) { @@ -272,7 +270,7 @@ createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); createGroupBuyDTO.setGoodsId(groupInfo.getGoodsId().intValue()); - createGroupBuyDTO.setOpenId(bizUser.getOpenId()); + createGroupBuyDTO.setUserId(sysVipInfo.getId()); ShopOrder shopOrder = createOrderByGroupBuy(createGroupBuyDTO); ShopActivitiesGroupJoinUser joinUser = new ShopActivitiesGroupJoinUser(); @@ -281,12 +279,12 @@ Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MINUTE, Integer.parseInt(payTimeLimit)); joinUser.setPayEndTime(calendar.getTime()); - joinUser.setUserId(bizUser.getOpenId()); + joinUser.setUserId(sysVipInfo.getId()); joinUser.setGiId(groupInfo.getId()); joinUser.setGjId(groupJoin.getId()); joinUser.setIsHead(ShopActivitiesGroupJoinUser.USER_IS_HEAD_N); - joinUser.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); - joinUser.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); + joinUser.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); + joinUser.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); joinUser.setIsNewUser(isOld ? 2 : 1); joinUser.setIsHasCancel(ShopActivitiesGroupJoinUser.IS_HAS_CANCEL_N); joinUser.setCompanyId(groupJoin.getCompanyId()); @@ -318,8 +316,9 @@ if (shopReceiveAddress == null) { throw new GlobleException("请选择正确的收获地址"); } - + SysVipInfo user=userCacheManager.getLoginUser(); ShopOrder shopOrder = new ShopOrder(); + shopOrder.setCompanyId(user.getCompanyId()); shopOrder.setStoreId(Integer.parseInt(createGroupBuyDTO.getShopId().toString())); shopOrder.setOrderType(ShopOrder.ORDER_TYPE_SERVICE); @@ -360,7 +359,7 @@ //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] wxShopOrderUtil.updateProductAndSkuInfo(details); - shopOrder.setUserId(createGroupBuyDTO.getOpenId()); + shopOrder.setUserId(createGroupBuyDTO.getUserId()); shopOrder.setCreateBy("微信小程序生成"); shopOrder.setUpdateBy("微信小程序生成"); shopOrder.setCommodityPrice(createGroupBuyDTO.getPrice()); @@ -389,15 +388,15 @@ shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY); //如果没有提交购买方式或配送方式不是物流 //获取邮费 - BigDecimal postPrice = wxShopOrderService.calculationPostage(createGroupBuyDTO.getAddressId(), createGroupBuyDTO.getPrice()); + BigDecimal postPrice = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),user.getCompanyId()); shopOrder.setPostage(postPrice); BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(shopOrder.getPostage()); shopOrder.setOrderMoney(payPrice); DiscountExplain discountExplain = new DiscountExplain(); discountExplain.setPayPrice(payPrice); discountExplain.setPostage(postPrice); - discountExplain.setActivity(BigDecimal.ZERO); - discountExplain.setCoupon(BigDecimal.ZERO); + discountExplain.setActivityPrice(BigDecimal.ZERO); + discountExplain.setCouponPrice(BigDecimal.ZERO); discountExplain.setBillPrice(payPrice); Gson g = new GsonBuilder().create(); shopOrder.setDiscountExplain(g.toJson(discountExplain)); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java index bf2e433..b7f8f78 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java @@ -2,8 +2,8 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.component.tools.WxUtils; import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; import com.matrix.core.exception.GlobleException; @@ -55,13 +55,13 @@ @Autowired private ShopOrderDetailsDao shopOrderDetailsDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopActivitiesSeckillRecordDao shopActivitiesSeckillRecordDao; @Override public AjaxResult createSecKillOrder(CreateSecKillDTO secKillDTO) throws Exception { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillDTO.getId()); if (seckillInfo == null) { return AjaxResult.buildFailInstance("秒杀不存在"); @@ -86,7 +86,7 @@ return AjaxResult.buildFailInstance("购买数量超过最大限购数量"); } - int count = shopActivitiesSeckillRecordDao.selectCountSecKill(seckillInfo.getId(), bizUser.getOpenId()); + int count = shopActivitiesSeckillRecordDao.selectCountSecKill(seckillInfo.getId(), sysVipInfo.getOpenId()); if (secKillDTO.getCount() + count > seckillInfo.getSiLimitCnt()) { return AjaxResult.buildFailInstance("购买数量超过最大限购数量"); } @@ -94,15 +94,15 @@ secKillDTO.setPrice(seckillInfo.getSiPrice()); secKillDTO.setGoodsId(seckillInfo.getGoodsId().intValue()); - secKillDTO.setOpenId(bizUser.getOpenId()); + secKillDTO.setOpenId(sysVipInfo.getOpenId()); ShopOrder shopOrder = createOrder(secKillDTO); ShopActivitiesSeckillRecord seckillRecord = new ShopActivitiesSeckillRecord(); seckillRecord.setOrderId(shopOrder.getId().longValue()); seckillRecord.setSiId(seckillInfo.getId()); - seckillRecord.setUserId(bizUser.getOpenId()); - seckillRecord.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); - seckillRecord.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); + seckillRecord.setUserId(sysVipInfo.getId()); + seckillRecord.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); + seckillRecord.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); seckillRecord.setCompanyId(seckillInfo.getCompanyId()); // 同步锁 @@ -126,6 +126,7 @@ } private ShopOrder createOrder(CreateSecKillDTO secKillDTO) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(secKillDTO.getAddressId()); if (shopReceiveAddress == null) { throw new GlobleException("请选择正确的收获地址"); @@ -172,11 +173,12 @@ //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] wxShopOrderUtil.updateProductAndSkuInfo(details); - shopOrder.setUserId(secKillDTO.getOpenId()); + shopOrder.setUserId(secKillDTO.getId()); shopOrder.setCreateBy("微信小程序生成"); shopOrder.setUpdateBy("微信小程序生成"); shopOrder.setCommodityPrice(secKillDTO.getPrice()); shopOrder.setPurchaseQuantity(1); + shopOrder.setCompanyId(sysVipInfo.getCompanyId()); //购买方式 shopOrder.setShippingMethod(secKillDTO.getShippingMethod()); //生成订单号 @@ -201,15 +203,15 @@ shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY); //如果没有提交购买方式或配送方式不是物流 //获取邮费 - BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getAddressId(), secKillDTO.getPrice()); + BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getPrice(),sysVipInfo.getCompanyId()); shopOrder.setPostage(postPrice); BigDecimal payPrice = secKillDTO.getPrice().multiply(BigDecimal.valueOf(secKillDTO.getCount())).add(shopOrder.getPostage()); shopOrder.setOrderMoney(payPrice); DiscountExplain discountExplain = new DiscountExplain(); discountExplain.setPayPrice(payPrice); discountExplain.setPostage(postPrice); - discountExplain.setActivity(BigDecimal.ZERO); - discountExplain.setCoupon(BigDecimal.ZERO); + discountExplain.setActivityPrice(BigDecimal.ZERO); + discountExplain.setCouponPrice(BigDecimal.ZERO); discountExplain.setBillPrice(payPrice); Gson g = new GsonBuilder().create(); shopOrder.setDiscountExplain(g.toJson(discountExplain)); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java index e9fd5af..c00c91a 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java @@ -1,26 +1,20 @@ package com.matrix.system.shopXcx.api.service.impl; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.common.init.UserCacheManager; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; -import com.matrix.biz.bean.BizUser; -import com.matrix.component.redis.RedisUserLoginUtils; import com.matrix.system.common.constance.AppConstance; - -import com.matrix.system.shopXcx.bean.ShopCoupon; -import com.matrix.system.shopXcx.bean.ShopCouponRecord; -import com.matrix.system.shopXcx.bean.ShopProductAttrRef; -import com.matrix.system.shopXcx.bean.ShopShoppingCart; -import com.matrix.system.shopXcx.dao.ShopCouponDao; -import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; -import com.matrix.system.shopXcx.dao.ShopProductAttrRefDao; -import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; +import com.matrix.system.shopXcx.api.pojo.OrderCouponGroup; +import com.matrix.system.shopXcx.api.pojo.OrderItemDto; import com.matrix.system.shopXcx.api.service.WxShopCouponService; import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; -import com.matrix.system.shopXcx.api.vo.ShopCartVo; +import com.matrix.system.shopXcx.bean.*; +import com.matrix.system.shopXcx.dao.*; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,7 +33,7 @@ @Autowired private WxShopOrderUtil wxShopOrderUtil; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopCouponDao shopCouponDao; @Autowired @@ -51,21 +45,25 @@ @Autowired private WxShopCouponUtil wxShopCouponUtil; + @Autowired + private ShopProductDao productDao; + /** * 根据购物车选中的产品,计算合适的优惠券 * * @return */ - public List<CouponReceiveInfoVO> getCartVoCouponList(Long shopId,List<ShopShoppingCart> shopShoppingCarts) { + public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<OrderItemDto> OrderItemDtos){ - //可用优惠券列表 + + //可用优惠券列表 List<CouponReceiveInfoVO> shopCoupons = new ArrayList<>(); - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); //1.找到用户所有的优惠券 - List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(shopId, bizUser.getOpenId(), AppConstance.MY_COUPON_NOT_USE, + List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, sysVipInfo.getId(), AppConstance.MY_COUPON_NOT_USE, null); if (CollectionUtils.isNotEmpty(userAllCoupon)) { //根据优惠力度排序,优惠力度大的先参与计算 @@ -80,7 +78,7 @@ //定义购物车优惠分组 - List<ShopCartVo> cartList = new ArrayList<>(); + List<OrderCouponGroup> cartList = new ArrayList<>(); // 记录所有优惠券,一个优惠券(活动)表示一组 Map<Integer, ShopCoupon> shopCouponMap = new HashMap<>(); @@ -89,24 +87,24 @@ for (int i = 0; i < userAllCoupon.size(); i++) { CouponReceiveInfoVO couponReceiveInfoVO = userAllCoupon.get(i); - ShopCartVo shopCarVo = new ShopCartVo(); + OrderCouponGroup shopCarVo = new OrderCouponGroup(); shopCarVo.setCouponReceiveInfoVO(couponReceiveInfoVO); - shopCarVo.setCartList(new ArrayList<>()); + shopCarVo.setOrderItemDtos(new ArrayList<>()); cartList.add(i, shopCarVo); - for (ShopShoppingCart shoppingCart : shopShoppingCarts) { + for (OrderItemDto orderItemDto : OrderItemDtos) { // 如果匹配到的产品已经出现在其他优惠组中,则需要判断是否移除之前的组 boolean needRemove = false; //找到产品所有的优惠券 - List<ShopCoupon> productShopCoupons = getCouponListByProductId(shoppingCart.getCartProductId()); + List<ShopCoupon> productShopCoupons = getCouponListByProductId(orderItemDto.getProductId()); for (ShopCoupon productShopCoupon : productShopCoupons) { if (couponReceiveInfoVO.getCouponId().equals(productShopCoupon.getId())) { - LogUtil.debug("购物车" + shoppingCart.getName() + "和优惠券" + couponReceiveInfoVO.getcName() + "匹配"); - shopCarVo.getCartList().add(shoppingCart); + LogUtil.debug("购物车" + orderItemDto.getProductId() + "和优惠券" + couponReceiveInfoVO.getcName() + "匹配"); + shopCarVo.getOrderItemDtos().add(orderItemDto); break; } } @@ -116,9 +114,9 @@ } //3.计算各组的金额是否满足,把满足的优惠券全部返回 - for (ShopCartVo shopCartVo : cartList) { - if (shopCartVo.isSatisfactionCoupon() && CollectionUtils.isNotEmpty(shopCartVo.getCartList())) { - shopCoupons.add(shopCartVo.getCouponReceiveInfoVO()); + for (OrderCouponGroup orderCouponGroup : cartList) { + if (orderCouponGroup.isSatisfactionCoupon() && CollectionUtils.isNotEmpty(orderCouponGroup.getOrderItemDtos())) { + shopCoupons.add(orderCouponGroup.getCouponReceiveInfoVO()); } } } @@ -128,19 +126,19 @@ - private void countPrice(ShopCartVo shopCartVo) { - List<ShopShoppingCart> cartList = shopCartVo.getCartList(); + private void countPrice(OrderCouponGroup orderCouponGroup) { + List<OrderItemDto> orderItemDtoList = orderCouponGroup.getOrderItemDtos(); // 计算总价 BigDecimal sum = BigDecimal.ZERO; - for (ShopShoppingCart shopShoppingCart : cartList) { - sum = sum.add(shopShoppingCart.getPrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); + for (OrderItemDto orderItemDto : orderItemDtoList) { + sum = sum.add(orderItemDto.getShopSku().getPrice().multiply(BigDecimal.valueOf(orderItemDto.getCount()))); } // 存在优惠券 - if (sum.compareTo(shopCartVo.getCouponReceiveInfoVO().getMinAmount()) >= 0) { + if (sum.compareTo(orderCouponGroup.getCouponReceiveInfoVO().getMinAmount()) >= 0) { //标记为合理分组 - shopCartVo.setSatisfactionCoupon(true); + orderCouponGroup.setSatisfactionCoupon(true); } else { - shopCartVo.setSatisfactionCoupon(false); + orderCouponGroup.setSatisfactionCoupon(false); } } @@ -152,14 +150,14 @@ */ @Override public AjaxResult getUsableCoupon(PaginationVO pageVo) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId()); - List<ShopCoupon> list = shopCouponDao.selectUsableCoupon(newPeople, bizUser.getOpenId(), pageVo); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); + List<ShopCoupon> list = shopCouponDao.selectUsableCoupon(newPeople, sysVipInfo.getOpenId(), pageVo); return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); } /** - * 领取优惠券 + * * * @param couponId * @return @@ -168,7 +166,7 @@ @Override public AjaxResult receiveCoupon(Integer couponId) { ShopCoupon shopCoupon = shopCouponDao.selectById(couponId); - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); // 如果没有找到该优惠券 if (shopCoupon == null) { @@ -180,7 +178,7 @@ return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券已领完!"); } - boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId()); + boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); // 如果改券是新人专属且当前用户不是新人 if (AppConstance.COUPON_GET_LIMT_NEW.equals(shopCoupon.getGetLimit()) && !newPeople) { @@ -188,7 +186,7 @@ } ShopCouponRecord param = new ShopCouponRecord(); - param.setUserId(bizUser.getOpenId()); + param.setUserId(sysVipInfo.getId()); param.setCId(couponId); List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(param); // 如果已经领取改优惠券 @@ -199,7 +197,7 @@ insertRecord.setCreateBy(AppConstance.SYSTEM_USER); insertRecord.setUpdateBy(AppConstance.SYSTEM_USER); insertRecord.setCId(couponId); - insertRecord.setUserId(bizUser.getOpenId()); + insertRecord.setUserId(sysVipInfo.getId()); insertRecord.setIsUsing(2); int i = shopCouponRecordDao.insert(insertRecord); // 如果插入领取记录表失败 @@ -215,20 +213,20 @@ * 根据订单状态查询优惠券列表 * * - * @param shopId + * @param companyId * @param status 1=已使用;2=未使用;3=过期 * @return */ @Override - public AjaxResult getMyCouponInfoByStatus(Long shopId, Integer status, PaginationVO pageVo) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + public AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); // 如果查询使用或未使用状态的优惠券列表 if (AppConstance.MY_COUPON_USE.equals(status) || AppConstance.MY_COUPON_NOT_USE.equals(status)) { - List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(shopId,bizUser.getOpenId(), status, + List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,sysVipInfo.getId(), status, pageVo); return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); } - List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(shopId,bizUser.getOpenId(), pageVo); + List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(companyId,sysVipInfo.getId(), pageVo); return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); } @@ -258,8 +256,8 @@ attrIds.addAll(ids); } } - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - List<ShopCoupon> list = shopCouponDao.selectUsableCouponByProductInfo(bizUser.getOpenId(), productId, + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + List<ShopCoupon> list = shopCouponDao.selectUsableCouponByProductInfo(sysVipInfo.getOpenId(), productId, attrIds); return list; } @@ -290,7 +288,8 @@ attrIds.addAll(ids); } } - List<ShopCoupon> list = shopCouponDao.selectHdListByProductId(productId, attrIds); + ShopProduct shopProduct = productDao.selectById(productId); + List<ShopCoupon> list = shopCouponDao.selectHdListByProductId(productId, attrIds,shopProduct.getCompanyId()); return list; } @@ -301,14 +300,13 @@ * 通过优惠券标签获取优惠券列表 * * @param tag 标签名称 - * @param shopId * @return */ @Override - public AjaxResult getCouponListByTag(String tag, Long shopId) { - BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId()); - List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, bizUser.getOpenId(), tag,shopId); + public AjaxResult getCouponListByTag(String tag, Long companyId) { + SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); + boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); + List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, sysVipInfo.getOpenId(), tag,companyId); AjaxResult res = new AjaxResult(AjaxResult.STATUS_SUCCESS, couponList); res.putInMap("isNewPeople", newPeople); return res; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopLogisticsQueryServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopLogisticsQueryServiceImpl.java index c5c1514..d5fc4b5 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopLogisticsQueryServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopLogisticsQueryServiceImpl.java @@ -1,20 +1,18 @@ package com.matrix.system.shopXcx.api.service.impl; import com.alibaba.fastjson.JSON; -import com.matrix.core.constance.SystemErrorCode; +import com.matrix.component.tools.HttpCurlUtil; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; +import com.matrix.system.shopXcx.api.vo.LogisticsInfoVo; import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; import com.matrix.system.shopXcx.bean.ShopLogisticsInfo; import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; import com.matrix.system.shopXcx.dao.ShopLogisticsInfoDao; -import com.matrix.component.tools.HttpCurlUtil; -import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; -import com.matrix.system.shopXcx.api.vo.LogisticsInfoVo; -import com.matrix.system.shopXcx.api.vo.SfLogisticsInfoVo; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -81,77 +79,72 @@ List<ShopLogisticsInfo> shopLogisticsList = new ArrayList<ShopLogisticsInfo>(); AjaxResult result = new AjaxResult(); Map<String, String> logisticsInfo = new HashMap<String, String>(); - try { - if (shopDeliveryInfo == null) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "找不到发货信息"); - } - if (!StringUtils.isNotBlank(shopDeliveryInfo.getWaybillNo()) || !StringUtils.isNotBlank(shopDeliveryInfo.getLogisticsCompanyCode())) { - return new AjaxResult(AjaxResult.STATUS_FAIL, "物流公司信息为空"); - } - logisticsInfo.put("logisticsCompany", shopDeliveryInfo.getLogisticsCompany()); - logisticsInfo.put("waybillNo", shopDeliveryInfo.getWaybillNo()); - //如果已经签收直接查数据库 - if (AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR.equals(shopDeliveryInfo.getLogisticsStatus())) { - - List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); - logisticsInfo.put("logisticsStatus", String.valueOf(AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR)); - result.setStatus(AjaxResult.STATUS_SUCCESS); - result.setRows(shopLogisticsInfos); - result.putInMap("logisticsInfo", logisticsInfo); - return result; - } - Map<String, String> param = new HashMap<String, String>(); - param.put("ShipperCode", shopDeliveryInfo.getLogisticsCompanyCode()); - param.put("LogisticCode", shopDeliveryInfo.getWaybillNo()); - Map<String, String> paramsUrl = getparams(param); - LogUtil.info("物流查询参数" + paramsUrl); - String logisticsResult = HttpCurlUtil.sendPost(logisticsUrl, paramsUrl); - LogUtil.info("查询物流返回信息" + logisticsResult); - LogisticsInfoVo logisticsInfoVo = JSON.parseObject(logisticsResult, LogisticsInfoVo.class); - if (logisticsInfoVo.isSuccess()) { - ShopDeliveryInfo shopDelivery = new ShopDeliveryInfo(); - shopDelivery.setLogisticsStatus(Integer.valueOf(logisticsInfoVo.getState())); - shopDelivery.setId(shopDeliveryInfo.getId()); - logisticsInfo.put("logisticsStatus", logisticsInfoVo.getState()); - //更新物流状态 - shopDeliveryInfoDao.updateByModel(shopDelivery); - if (CollectionUtils.isNotEmpty(logisticsInfoVo.getTraces())) { - List<Map<String, String>> mapTraces = logisticsInfoVo.getTraces(); - for (int i = 0; i < mapTraces.size(); i++) { - ShopLogisticsInfo shopLogisticsInfo = new ShopLogisticsInfo(); - shopLogisticsInfo.setCreateBy(AppConstance.SYSTEM_USER); - shopLogisticsInfo.setUpdateBy(AppConstance.SYSTEM_USER); - shopLogisticsInfo.setLogisticsTime(mapTraces.get(i).get("AcceptTime")); - String acceptStation = mapTraces.get(i).get("AcceptStation"); - shopLogisticsInfo.setDescribe(acceptStation); - shopLogisticsInfo.setDelieryId(shopDeliveryInfo.getId()); - if (acceptStation.indexOf(AppConstance.KDN_IS_SIGN) != -1) { - shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR); - } else if (acceptStation.indexOf(AppConstance.KDN_IS_RECEIVE) != -1) { - shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_RECEIVE); - } else if (acceptStation.indexOf(AppConstance.KDN_IS_ON_WAY) != -1) { - shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_ON_WAY); - } else if (acceptStation.indexOf(AppConstance.KDN_IS_MISTAKE) != -1) { - shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_MISTAKE); - } else { - shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_NONE); - } - shopLogisticsList.add(shopLogisticsInfo); - } - shopLogisticsInfoDao.deleteByDelieryId(shopDeliveryInfo.getId()); - if (CollectionUtils.isNotEmpty(shopLogisticsList)) { - shopLogisticsInfoDao.batchInsert(shopLogisticsList); - } - } - } else { - throw new GlobleException(SystemErrorCode.REQUEST_INVALID, logisticsInfoVo.getReason()); - } - - } catch (Exception e) { - LogUtil.error("物流信息查询失败", e); - throw new GlobleException(SystemErrorCode.REQUEST_INVALID); + if (shopDeliveryInfo == null) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "找不到发货信息"); } + if (!StringUtils.isNotBlank(shopDeliveryInfo.getWaybillNo()) || !StringUtils.isNotBlank(shopDeliveryInfo.getLogisticsCompanyCode())) { + return new AjaxResult(AjaxResult.STATUS_FAIL, "物流公司信息为空"); + } + logisticsInfo.put("logisticsCompany", shopDeliveryInfo.getLogisticsCompany()); + logisticsInfo.put("waybillNo", shopDeliveryInfo.getWaybillNo()); + + //如果已经签收直接查数据库 + if (AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR.equals(shopDeliveryInfo.getLogisticsStatus())) { + + List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); + logisticsInfo.put("logisticsStatus", String.valueOf(AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR)); + result.setStatus(AjaxResult.STATUS_SUCCESS); + result.setRows(shopLogisticsInfos); + result.putInMap("logisticsInfo", logisticsInfo); + return result; + } + Map<String, String> param = new HashMap<String, String>(); + param.put("ShipperCode", shopDeliveryInfo.getLogisticsCompanyCode()); + param.put("LogisticCode", shopDeliveryInfo.getWaybillNo()); + Map<String, String> paramsUrl = getparams(param); + LogUtil.info("物流查询参数" + paramsUrl); + String logisticsResult = HttpCurlUtil.sendPost(logisticsUrl, paramsUrl); + LogUtil.info("查询物流返回信息" + logisticsResult); + LogisticsInfoVo logisticsInfoVo = JSON.parseObject(logisticsResult, LogisticsInfoVo.class); + if (logisticsInfoVo.isSuccess()) { + ShopDeliveryInfo shopDelivery = new ShopDeliveryInfo(); + shopDelivery.setLogisticsStatus(Integer.valueOf(logisticsInfoVo.getState())); + shopDelivery.setId(shopDeliveryInfo.getId()); + logisticsInfo.put("logisticsStatus", logisticsInfoVo.getState()); + //更新物流状态 + shopDeliveryInfoDao.updateByModel(shopDelivery); + if (CollectionUtils.isNotEmpty(logisticsInfoVo.getTraces())) { + List<Map<String, String>> mapTraces = logisticsInfoVo.getTraces(); + for (int i = 0; i < mapTraces.size(); i++) { + ShopLogisticsInfo shopLogisticsInfo = new ShopLogisticsInfo(); + shopLogisticsInfo.setCreateBy(AppConstance.SYSTEM_USER); + shopLogisticsInfo.setUpdateBy(AppConstance.SYSTEM_USER); + shopLogisticsInfo.setLogisticsTime(mapTraces.get(i).get("AcceptTime")); + String acceptStation = mapTraces.get(i).get("AcceptStation"); + shopLogisticsInfo.setDescribe(acceptStation); + shopLogisticsInfo.setDelieryId(shopDeliveryInfo.getId()); + if (acceptStation.indexOf(AppConstance.KDN_IS_SIGN) != -1) { + shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR); + } else if (acceptStation.indexOf(AppConstance.KDN_IS_RECEIVE) != -1) { + shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_RECEIVE); + } else if (acceptStation.indexOf(AppConstance.KDN_IS_ON_WAY) != -1) { + shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_ON_WAY); + } else if (acceptStation.indexOf(AppConstance.KDN_IS_MISTAKE) != -1) { + shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_MISTAKE); + } else { + shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_NONE); + } + shopLogisticsList.add(shopLogisticsInfo); + } + shopLogisticsInfoDao.deleteByDelieryId(shopDeliveryInfo.getId()); + if (CollectionUtils.isNotEmpty(shopLogisticsList)) { + shopLogisticsInfoDao.batchInsert(shopLogisticsList); + } + } + } + + List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); result.setStatus(AjaxResult.STATUS_SUCCESS); result.setRows(shopLogisticsInfos); @@ -190,14 +183,18 @@ * @param map * @return */ - private Map<String, String> getparams(Map<String, String> map) throws Exception { + private Map<String, String> getparams(Map<String, String> map) { String params = JSON.toJSONString(map); Map<String, String> paramsUrl = new HashMap<String, String>(); - paramsUrl.put("RequestData", URLEncoder.encode(params, "UTF-8")); + try { + paramsUrl.put("RequestData", URLEncoder.encode(params, "UTF-8")); + String dataSign = encrypt(params, appKey, "UTF-8"); + paramsUrl.put("DataSign", URLEncoder.encode(dataSign, "UTF-8")); + } catch (Exception e) { + throw new GlobleException(e.getMessage()); + } paramsUrl.put("EBusinessID", eBusinessID); paramsUrl.put("RequestType", requestType); - String dataSign = encrypt(params, appKey, "UTF-8"); - paramsUrl.put("DataSign", URLEncoder.encode(dataSign, "UTF-8")); paramsUrl.put("DataType", AppConstance.DATATYPE); return paramsUrl; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java index 807ab9d..6365343 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java @@ -1,23 +1,25 @@ package com.matrix.system.shopXcx.api.service.impl; -import com.matrix.component.wechat.externalInterface.common.WechatConfigure; -import com.matrix.core.exception.GlobleException; -import com.matrix.core.tools.DateUtil; -import com.matrix.core.tools.LogUtil; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.component.asyncmessage.AsyncMessageManager; import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; -import com.matrix.system.shopXcx.bean.*; -import com.matrix.system.shopXcx.dao.*; -import com.matrix.component.tools.WxTempLateMsgUtil; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.tools.DingDingRobotUtil; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.shopXcx.api.service.WXShopOrderService; import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; +import com.matrix.system.shopXcx.bean.*; +import com.matrix.system.shopXcx.dao.*; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -47,8 +49,17 @@ @Autowired private ShopActivitiesGroupJoinDao shopActivitiesGroupJoinDao; + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + private AsyncMessageManager asyncMessageManager; + @Value("${wx_pay_debug_onoff}") private boolean isDebug; + + + @Override public Boolean refundToUser(String id, ShopRefundRecord shopRefundRecord) { LogUtil.debug("进入退款接口进行退款。。。", id); @@ -78,14 +89,13 @@ //Double refundMoney = 0.1 * 100; //用户ID - String userId = WechatConfigure.mchID; if (isDebug) { - boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, 1, 1, userId); + boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, 1, 1, null); flag = b; } else { LogUtil.info("开始调用退款接口。。。退款编号为", refundNo); - boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, orMoney, reMoney, userId); + boolean b = weixinServiceUtil.comRefund(orderNo, refundNo, orMoney, reMoney, null); flag = b; } @@ -102,7 +112,7 @@ //退款成功后同时把优惠券退回到用户的账号中 if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) >0) { ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); - String userIds = shopRefundRecord.getUserId(); + Long userIds = shopRefundRecord.getUserId(); shopCouponRecord.setUserId(userIds); shopCouponRecord.setOrderId(shopOrder.getId()); List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); @@ -135,6 +145,21 @@ modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_MONEYBACK_SUCCESS); modifyMap.put("refundCharge", shopRefundRecord.getRefundMoney()); shopOrderDao.updateByMap(modifyMap); + + asyncMessageManager.sendMsg(AsyncMessageRouting.SHOP_ORDER_REFUND ,"orderId=%s" , shopRefundRecord.getOrderId()); + + + //发送退款通知 + BusParameterSettings wxOrderNoticeDingdingToken = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WX_ORDER_NOTICE_DINGDING_TOKEN, shopOrder.getCompanyId()); + if (wxOrderNoticeDingdingToken != null && StringUtils.isNotBlank(wxOrderNoticeDingdingToken.getParamValue())) { + DingDingRobotUtil.sendText(wxOrderNoticeDingdingToken.getParamValue(), + "订单退款,微商城订单编号 "+shopOrder.getOrderNo() + +"; 订单金额:¥"+shopOrder.getOrderMoney() + +";收货电话:"+ shopOrder.getUserTel()+",收货人:"+ shopOrder.getUserName() + ,""); + } + + }catch (Exception e){ LogUtil.debug("退款成功,修改退款表和订单表状态出错。。。", id); e.printStackTrace(); @@ -143,34 +168,7 @@ return flag; } - /** - * 退款成功后发送微信提醒 - * @param shopRefundRecord - * @return - */ - @Override - public int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord) { - ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); - if (order == null) { - throw new GlobleException("没有找到需要退款的订单信息"); - } - List<String> msg = new ArrayList<>(); - //退款说明 - String refundExplain = "退款已经原路返回,具体到账时间可能会有1-3天延迟"; - msg.add(order.getOrderNo()); - msg.add(DateUtil.dateToString(shopRefundRecord.getRefundTime(),DateUtil.DATE_FORMAT_SS)); - msg.add(refundExplain); - String formId = null; - if(AppConstance.REFUND_GOODS.equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ - formId = shopRefundRecord.getRefundTransactionNo(); - }else { - formId = order.getWxOrderNo().split("=")[1]; - } - String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=1" + "&&inform=1"; - int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), - page, WxTempLateMsgUtil.REFUND_SUCCESS, formId); - return res; - } + @Override public void updateGroupBuyStatus(Long orderId) { diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java index 99cacaa..3e0595f 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java @@ -1,13 +1,11 @@ package com.matrix.system.shopXcx.api.tools; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.system.common.constance.AppConstance; - +import com.matrix.system.common.init.UserCacheManager; +import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; import com.matrix.system.shopXcx.bean.ShopOrder; import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; import com.matrix.system.shopXcx.dao.ShopOrderDao; import com.matrix.system.shopXcx.dao.ShopSkuDao; -import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -24,7 +22,7 @@ @Autowired private ShopOrderDao shopOrderDao; @Autowired - private RedisUserLoginUtils redisUserLoginUtils; + private UserCacheManager userCacheManager; @Autowired private ShopCouponRecordDao shopCouponRecordDao; @Autowired @@ -39,7 +37,7 @@ * @param userId 用户ID * @return true = 新人 */ - public boolean verifyIsNewPeople(String userId) { + public boolean verifyIsNewPeople(Long userId) { ShopOrder orderParam = new ShopOrder(); orderParam.setPayResult(ShopOrder.ORDER_WX_STATUS_PAY_SUCCESS); orderParam.setUserId(userId); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java index 7c9a66b..d4d7785 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java @@ -1,16 +1,14 @@ package com.matrix.system.shopXcx.api.tools; -import com.matrix.system.common.bean.CustomerDataDictionary; -import com.matrix.system.common.dao.CustomerDataDictionaryDao; -import com.matrix.biz.service.BizUserService; -import com.matrix.component.tools.WxTempLateMsgUtil; import com.matrix.core.exception.GlobleException; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.CustomerDataDictionary; import com.matrix.system.common.constance.AppConstance; -import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.shopXcx.api.pojo.OrderItemDto; import com.matrix.system.shopXcx.api.pojo.OrderPostageInfoPOJO; -import com.matrix.system.shopXcx.api.pojo.OrderProductSkuPOJO; +import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; @@ -21,7 +19,10 @@ import java.math.BigDecimal; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author jyy @@ -46,9 +47,7 @@ @Autowired private WxShopMemberDayService wxShopMemberDayService; @Autowired - private BizUserService bizUserService; - @Autowired - private ShopScoreRecordDao shopScoreRecordDao; + private SysVipInfoService sysVipInfoService; private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日"); @@ -95,12 +94,12 @@ /** * 处理产品规格信息 - * @param addShopOrderPOJO + * @param shopOrderDto */ - public List<ShopOrderDetails> processProductSkuInfo(ShopOrder shopOrder, AddShopOrderPOJO addShopOrderPOJO, + public List<ShopOrderDetails> processProductSkuInfo(ShopOrder shopOrder, ShopOrderDto shopOrderDto, ShopCoupon shopCoupon) { List<ShopOrderDetails> resList = new ArrayList<>(); - List<OrderProductSkuPOJO> skuList = addShopOrderPOJO.getSkuList(); + List<OrderItemDto> skuList = shopOrderDto.getOrderItemList(); if (CollectionUtils.isEmpty(skuList)) { return resList; } @@ -108,9 +107,9 @@ //设置购买数量 int total = 0; BigDecimal commodityMoney = new BigDecimal("0"); - for (OrderProductSkuPOJO orderProductSkuPOJO : skuList) { - ids.add(orderProductSkuPOJO.getSkuId()); - total += orderProductSkuPOJO.getCount(); + for (OrderItemDto orderItemDto : skuList) { + ids.add(orderItemDto.getSkuId()); + total += orderItemDto.getCount(); } shopOrder.setPurchaseQuantity(total); List<ShopSku> contrastList = shopSkuDao.selectByIds(ids); @@ -131,10 +130,10 @@ BigDecimal couponTotalMoney = new BigDecimal("0"); Double discountRate = wxShopMemberDayService.getMemberDay(); - for (OrderProductSkuPOJO orderProductSkuPOJO : skuList) { + for (OrderItemDto orderItemDto : skuList) { boolean isExist = false; for (ShopSku shopSku : contrastList) { - if (shopSku.getId().equals(orderProductSkuPOJO.getSkuId())) { + if (shopSku.getId().equals(orderItemDto.getSkuId())) { isExist = true; ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); shopOrderDetails.setCreateBy(AppConstance.SYSTEM_USER); @@ -142,9 +141,9 @@ shopOrderDetails.setpId(shopSku.getPId()); shopOrderDetails.setsId(shopSku.getId()); shopOrderDetails.setPrice(shopSku.getPrice()); - shopOrderDetails.setCount(orderProductSkuPOJO.getCount()); + shopOrderDetails.setCount(orderItemDto.getCount()); BigDecimal price = new BigDecimal(shopSku.getPrice().toString()); - BigDecimal count = new BigDecimal(orderProductSkuPOJO.getCount().toString()); + BigDecimal count = new BigDecimal(orderItemDto.getCount().toString()); shopOrderDetails.setsTitle(shopSku.getName()); resList.add(shopOrderDetails); @@ -217,15 +216,21 @@ /** * 新增发货信息 */ - public int insertSendPackageInfo(ShopOrder shopOrder, String shippingMethod, ShopReceiveAddress receiveAddress) { + public int insertSendPackageInfo(ShopOrder shopOrder, Integer shippingMethod, ShopReceiveAddress receiveAddress) { ShopDeliveryInfo shopDeliveryInfo = new ShopDeliveryInfo(); shopDeliveryInfo.setCreateBy(AppConstance.SYSTEM_USER); shopDeliveryInfo.setUpdateBy(AppConstance.SYSTEM_USER); shopDeliveryInfo.setOrderId(shopOrder.getId()); shopDeliveryInfo.setOrderNo(shopOrder.getOrderNo()); shopDeliveryInfo.setUserId(shopOrder.getUserId()); - shopDeliveryInfo.setDeliveryWay(shippingMethod); + if(ShopOrder.SHIPPING_METHOD_WL==shippingMethod){ + shopDeliveryInfo.setDeliveryWay("物流配送"); + }else{ + shopDeliveryInfo.setDeliveryWay("门店自提"); + } + shopDeliveryInfo.setShopId(shopOrder.getStoreId().longValue()); + shopDeliveryInfo.setCompanyId(shopOrder.getCompanyId()); StringBuffer receiveAddrStr = new StringBuffer(); if (receiveAddress != null) { receiveAddrStr.append(receiveAddress.getAddrProvince()); @@ -349,53 +354,13 @@ } /** - * 发货后给客户发送微信提醒 - * @param deliveryInfo - * @return - */ - public int deliverSuccessSendWxMsgToUser(ShopDeliveryInfo deliveryInfo) { - ShopOrder order = shopOrderDao.selectById(deliveryInfo.getOrderId()); - if (order == null) { - throw new GlobleException("没有找到需要发货的订单信息"); - } - List<String> msg = new ArrayList<>(); - msg.add(order.getOrderNo()); - //设置商品名称 - msg.add(getProductNames(order.getUserId(), order.getId())); - msg.add(deliveryInfo.getReceiveAddress()); - msg.add(deliveryInfo.getLogisticsCompany()); - msg.add(deliveryInfo.getWaybillNo()); - String formId = order.getWxOrderNo().split("=")[1]; - String page = "pages/logistics/logistics?inform=1&id=" + order.getId(); - int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), - page, WxTempLateMsgUtil.ORDER_DELIVERY, formId); - return res; - } - - /** - * 订单付款成功后给客户发送微信提醒 - * @param order - * @return - */ - public int paySuccessSendWxMsgToUser(ShopOrder order) { - List<String> msg = new ArrayList<>(); - msg.add(order.getOrderNo()); - msg.add(new BigDecimal(order.getOrderMoney().toString()).toString() + "元"); - msg.add(dateFormat.format(order.getOrderTime())); - msg.add(getProductNames(order.getUserId(), order.getId())); - String formId = order.getWxOrderNo().split("=")[1]; - String page = "pages/orderDetails/orderDetails?inform=1&id=" + order.getId(); - return WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), page, WxTempLateMsgUtil.ORDER_PAY_SUCCESS, formId); - } - - /** * 根据用户ID和订单ID获取所购买商品名称 * @param openId 用户openId * @param orderId 订单ID * @return 所含商品名称(多个以","隔开) */ - public String getProductNames(String openId, Integer orderId) { - ShopOrder orderDetail = shopOrderDao.selectOrderInfoById(openId, orderId); + public String getProductNames(Long userId, Integer orderId) { + ShopOrder orderDetail = shopOrderDao.selectOrderInfoById(userId, orderId); List<ShopOrderDetails> details = orderDetail.getDetails(); if (CollectionUtils.isEmpty(details)) { return ""; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignAwardSetVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignAwardSetVo.java new file mode 100644 index 0000000..32b87ab --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignAwardSetVo.java @@ -0,0 +1,174 @@ +package com.matrix.system.shopXcx.api.vo; + +import java.util.Date; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ActivitySignAwardSetVo", description = "奖品明细") +public class ActivitySignAwardSetVo{ + + private Long id; + + /** + * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) + */ + + @ApiModelProperty(value ="奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)") + private int awardType; + + /** + * 奖项规则(1:每日奖励(默认)2:累计签到天数) + */ + + + @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") + private int awardRule; + + /** + * 签到累计天数 + */ + + @ApiModelProperty(value ="签到累计天数") + private int cumulativeDay; + + /** + * 奖项名称 + */ + + @ApiModelProperty(value ="奖项名称") + private String awardName; + + /** + * 图片介绍 + */ + + @ApiModelProperty(value ="图片介绍") + private String introduceImg; + + /** + * 文字介绍 + */ + + + @ApiModelProperty(value ="文字介绍") + private String introduceTip; + + /** + * 奖项库存数量 + */ + + + @ApiModelProperty(value ="奖项库存数量") + private int awardInventoryCnt; + + /** + * 已派发数量 + */ + + + @ApiModelProperty(value ="已派发数量") + private int awardDistributeCnt; + + /** + * 兑奖方式(1:线下兑换2:物流配送3:客服兑换) + */ + + + @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") + private int awardWay; + + /** + * 奖品是否有效(1:有效 2:无效) + */ + @ApiModelProperty(value ="奖品是否有效(1:有效 2:无效)") + private int awardState; + public static final int AWARDSTATE_WORK = 1; + public static final int AWARDSTATE_UNWORK = 2; + + /** + * 操作提示 + */ + + @ApiModelProperty(value ="操作提示") + private String operationTip; + + /** + * 兑奖地址 + */ + + @ApiModelProperty(value ="兑奖地址") + private String prizeAddress; + + /** + * 兑奖期限开始日期 + */ + + + @ApiModelProperty(value ="兑奖期限开始日期") + private Date prizeStartTime; + + /** + * 兑奖期限结束日期 + */ + + @ApiModelProperty(value ="兑奖期限结束日期") + private Date prizeEndTime; + + /** + * 客服微信 + */ + + @ApiModelProperty(value ="客服微信") + private String wechatImg; + + /** + * 积分数量 + */ + + + @ApiModelProperty(value ="积分数量") + private int scoreCnt; + + /** + * 优惠券ID + */ + + @ApiModelProperty(value ="优惠券") + private String couponName; + + @ApiModelProperty(value ="优惠券ID") + private String couponId; + + /** + * 商品ID + */ + + @ApiModelProperty(value ="商品") + private String goodsName; + + @ApiModelProperty(value ="商品ID") + private String goodsId; + + /** + * 活动主表ID + */ + + + @ApiModelProperty(value ="活动主表ID") + private Long activityId; + + /** + * 公司ID + */ + + + @ApiModelProperty(value ="公司ID") + private Long companyId; + + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignRecordVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignRecordVo.java new file mode 100644 index 0000000..5a903a2 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignRecordVo.java @@ -0,0 +1,39 @@ +package com.matrix.system.shopXcx.api.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ActivitySignRecordVo", description = "签到明细") +public class ActivitySignRecordVo { + + @ApiModelProperty(value ="签到状态 1:已签到 2:未签到") + private int state; + /** + * 签到时间 + */ + + + + @ApiModelProperty(value ="签到时间") + private String signTime; + + /** + * 活动主表ID + */ + + + + @ApiModelProperty(value ="活动主表ID") + private Long activityId; + + /** + * 公司ID + */ + + + + @ApiModelProperty(value ="公司ID") + private Long companyId; +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailFlowVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailFlowVo.java new file mode 100644 index 0000000..c2787f7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailFlowVo.java @@ -0,0 +1,37 @@ +package com.matrix.system.shopXcx.api.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; + +/** + * @author jyy + * @date 2020-12-23 + **/ +@ApiModel(value = "ErpOrderDetailFlowVo", description = "订单支付方式") +public class ErpOrderDetailFlowVo { + + + @ApiModelProperty(value = "支付方式") + private String payMethod; + + @ApiModelProperty(value = "支付金额") + private BigDecimal amount; + + public String getPayMethod() { + return payMethod; + } + + public void setPayMethod(String payMethod) { + this.payMethod = payMethod; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailItemVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailItemVo.java new file mode 100644 index 0000000..a9980f3 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailItemVo.java @@ -0,0 +1,63 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.matrix.system.app.vo.OrderDetailAchieveItemVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author jyy + * @date 2020-12-23 + **/ +@ApiModel(value = "ErpOrderDetailItemVo", description = "订单详情明细表") +public class ErpOrderDetailItemVo { + + + @ApiModelProperty(value = "商品名称") + private String goodsName; + + @ApiModelProperty(value = "数量") + private String count; + + + @ApiModelProperty(value = "原价") + private BigDecimal price; + + @ApiModelProperty(value = "折扣价格") + private BigDecimal zkPrice; + + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public BigDecimal getZkPrice() { + return zkPrice; + } + + public void setZkPrice(BigDecimal zkPrice) { + this.zkPrice = zkPrice; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailVo.java new file mode 100644 index 0000000..05189d6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailVo.java @@ -0,0 +1,158 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.app.vo.OrderDetailItemVo; +import com.matrix.system.hive.bean.SysOrderFlow; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * @author jyy + * @date 2020-12-23 + **/ +@ApiModel(value = "ErpOrderDetailVo", description = "订单详情返回参数类") +public class ErpOrderDetailVo { + + @ApiModelProperty(value = "订单ID") + private String orderId; + + @ApiModelProperty(value = "门店名称") + private String shopName; + + @ApiModelProperty(value = "订单号") + private String orderNo; + + @ApiModelProperty(value = "顾问姓名") + private String staffName; + + + @ApiModelProperty(value = "应付金额") + private BigDecimal needPay; + + @ApiModelProperty(value = "实付金额") + private BigDecimal realPay; + + @ApiModelProperty(value = "优惠金额") + private BigDecimal discount; + + @ApiModelProperty(value = "订单明细") + private List<ErpOrderDetailItemVo> items; + + @ApiModelProperty(value = "支付流水") + private List<ErpOrderDetailFlowVo> flow; + + @ApiModelProperty(value = "订单状态") + private String orderStatus; + + @ApiModelProperty(value = "欠款") + private BigDecimal arrears; + + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_SS, timezone = "GMT+8") + @ApiModelProperty(value = "下单时间") + private Date orderTime; + + + public List<ErpOrderDetailFlowVo> getFlow() { + return flow; + } + + public void setFlow(List<ErpOrderDetailFlowVo> flow) { + this.flow = flow; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getStaffName() { + return staffName; + } + + public void setStaffName(String staffName) { + this.staffName = staffName; + } + + public BigDecimal getNeedPay() { + return needPay; + } + + public void setNeedPay(BigDecimal needPay) { + this.needPay = needPay; + } + + public BigDecimal getRealPay() { + return realPay; + } + + public void setRealPay(BigDecimal realPay) { + this.realPay = realPay; + } + + public BigDecimal getDiscount() { + return discount; + } + + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + public List<ErpOrderDetailItemVo> getItems() { + return items; + } + + public void setItems(List<ErpOrderDetailItemVo> items) { + this.items = items; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public BigDecimal getArrears() { + return arrears; + } + + public void setArrears(BigDecimal arrears) { + this.arrears = arrears; + } + + public Date getOrderTime() { + return orderTime; + } + + public void setOrderTime(Date orderTime) { + this.orderTime = orderTime; + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListProjVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListProjVo.java new file mode 100644 index 0000000..dc2ddd9 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListProjVo.java @@ -0,0 +1,45 @@ +package com.matrix.system.shopXcx.api.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "ErpServiceOrderListProjVo", description = "服务单列表项目返回参数类") +public class ErpServiceOrderListProjVo { + + + @ApiModelProperty(value = "项目名称") + private String projName; + + @ApiModelProperty(value = "项目图片") + private String imgMobile; + + @ApiModelProperty(value = "美疗师") + private String beautyName=""; + + public String getImgMobile() { + return imgMobile; + } + + public void setImgMobile(String imgMobile) { + this.imgMobile = imgMobile; + } + + public String getProjName() { + return projName; + } + + public void setProjName(String projName) { + this.projName = projName; + } + + public String getBeautyName() { + return beautyName; + } + + public void setBeautyName(String beautyName) { + this.beautyName = beautyName; + } + } + + + diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListVo.java new file mode 100644 index 0000000..b33ca23 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListVo.java @@ -0,0 +1,147 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.app.vo.ServiceOrderListProjVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@ApiModel(value = "ServiceOrderListVo", description = "服务单列表返回参数类") +public class ErpServiceOrderListVo { + + @ApiModelProperty(value = "服务单Id") + private Long id; + + @ApiModelProperty(value = "服务单编号") + private String serviceNo; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + @ApiModelProperty(value = "预约时间") + private Date time; + + @ApiModelProperty(value = "服务时长") + private Integer timeLength; + + @ApiModelProperty(value = "状态 待预约 待派单 待配料 待服务 服务中 服务完成 服务单结束") + private String status; + + @ApiModelProperty(value = "门店名称") + private String shopName; + + @ApiModelProperty(value = "门店地址") + private String shopAddr; + + + + @ApiModelProperty(value = "床位") + private String bed; + + @ApiModelProperty(value = "客户评论") + private String comment=""; + + @ApiModelProperty(value = "员工回复") + private String reply; + + + + @ApiModelProperty(value = "服务项目信息") + private List<ErpServiceOrderListProjVo> projs; + + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getReply() { + return reply; + } + + public void setReply(String reply) { + this.reply = reply; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getServiceNo() { + return serviceNo; + } + + public void setServiceNo(String serviceNo) { + this.serviceNo = serviceNo; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public String getShopAddr() { + return shopAddr; + } + + public void setShopAddr(String shopAddr) { + this.shopAddr = shopAddr; + } + + public Integer getTimeLength() { + return timeLength; + } + + public void setTimeLength(Integer timeLength) { + this.timeLength = timeLength; + } + + public String getBed() { + return bed; + } + + public void setBed(String bed) { + this.bed = bed; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public List<ErpServiceOrderListProjVo> getProjs() { + return projs; + } + + public void setProjs(List<ErpServiceOrderListProjVo> projs) { + this.projs = projs; + } + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawBasicInfoJsonVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawBasicInfoJsonVo.java new file mode 100644 index 0000000..2501f29 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawBasicInfoJsonVo.java @@ -0,0 +1,60 @@ +package com.matrix.system.shopXcx.api.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LuckyDrawBasicInfoJsonVo", description = "活动") +public class LuckyDrawBasicInfoJsonVo { + + @ApiModelProperty(value ="头部图片") + private String imageUrlHead; + @ApiModelProperty(value ="开始按钮") + private String imageUrlTitle; + @ApiModelProperty(value ="转盘背景") + private String imageUrlButton; + @ApiModelProperty(value ="状态图片") + private String imageUrlState; + @ApiModelProperty(value ="奖品划分线") + private String imageLine; + + @ApiModelProperty(value ="规则内容") + private String ruleExplain; + @ApiModelProperty(value ="字体颜色") + private String typographyColor; + @ApiModelProperty(value ="背景颜色") + private String backgroundColor; + @ApiModelProperty(value ="字体大小") + private Integer typographyNum; + @ApiModelProperty(value ="字体透明度") + private Integer typographyLight; + + + //@ApiModelProperty(value ="中奖顺序") + private String awardLine; + //@ApiModelProperty(value ="中奖顺序索引") + private Integer awrdLineIndex; + + /** + * 抽奖规则 + */ + //每人每日有10次无门槛抽奖机会 + private Integer wmkcjjh; + //可用积分兑换1次抽奖机会, + private Integer dhycjfs; + // 每日最多兑换 + //10 + //次抽奖机会 + private Integer jfdhcs; + // 每人最多可中奖 + //10 + //次 + private Integer zzjcs; + // 总中奖率 + //10 + //% + private Integer zzjl; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawInfoVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawInfoVo.java new file mode 100644 index 0000000..31f40da --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawInfoVo.java @@ -0,0 +1,44 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data + +@ApiModel(value = "LuckyDrawInfoVo", description = "抽奖活动") +public class LuckyDrawInfoVo { + /** + * 主键 + */ + private Long id; + @ApiModelProperty(value ="活动今日是否可参与 1:是 2:否") + private int joinState; + @ApiModelProperty(value ="用户总积分") + private int totalScore; + + @ApiModelProperty(value ="用户今日剩余抽奖次数") + private int luckyDrawTime; + + public static final int JOINSTATE_YES = 1; + public static final int JOINSTATE_NOT = 2; + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date endTime; + @ApiModelProperty(value ="活动基本参数") + private LuckyDrawBasicInfoJsonVo luckyDrawBasicInfoJsonVo; + @ApiModelProperty(value ="奖品信息") + private List<ActivitySignAwardSetVo> activitySignAwardSetVos; +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawSuccessVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawSuccessVo.java new file mode 100644 index 0000000..3e2573e --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/LuckyDrawSuccessVo.java @@ -0,0 +1,150 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +@Data + +@ApiModel(value = "LuckyDrawSuccessVo", description = "抽奖活动") +public class LuckyDrawSuccessVo { + + @ApiModelProperty(value ="奖励类型 1:日常奖励 2:累计奖励") + private int type; + + @ApiModelProperty(value ="累计奖励名称") + private String awardName; + @ApiModelProperty(value ="累计奖励图片") + private String awardImg; + @ApiModelProperty(value ="累计奖励核销码") + private String writeOffCode; + + @ApiModelProperty(value ="奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)") + private int awardType; + + + public static final int AWARDTYPE_CUSTOMIZE = 1; + public static final int AWARDTYPE_SCORE = 2; + public static final int AWARDTYPE_COUPON = 3; + public static final int AWARDTYPE_GOODS = 4; + + @ApiModelProperty(value ="文字介绍") + private String introduceTip; + + /** + * 奖项库存数量 + */ + + + @ApiModelProperty(value ="奖项库存数量") + private int awardInventoryCnt; + + /** + * 已派发数量 + */ + + + @ApiModelProperty(value ="已派发数量") + private int awardDistributeCnt; + + /** + * 兑奖方式(1:线下兑换2:物流配送3:客服兑换) + */ + + + @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") + private int awardWay; + + /** + * 奖品是否有效(1:有效 2:无效) + */ + @ApiModelProperty(value ="奖品是否有效(1:有效 2:无效)") + private int awardState; + public static final int AWARDSTATE_WORK = 1; + public static final int AWARDSTATE_UNWORK = 2; + + /** + * 操作提示 + */ + + @ApiModelProperty(value ="操作提示") + private String operationTip; + + /** + * 兑奖地址 + */ + + @ApiModelProperty(value ="兑奖地址") + private String prizeAddress; + + /** + * 兑奖期限开始日期 + */ + + + @ApiModelProperty(value ="兑奖期限开始日期") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date prizeStartTime; + + /** + * 兑奖期限结束日期 + */ + + @ApiModelProperty(value ="兑奖期限结束日期") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date prizeEndTime; + + /** + * 客服微信 + */ + + @ApiModelProperty(value ="客服微信") + private String wechatImg; + + /** + * 积分数量 + */ + + + @ApiModelProperty(value ="积分数量") + private int scoreCnt; + + /** + * 优惠券ID + */ + + @ApiModelProperty(value ="优惠券") + private String couponName; + + @ApiModelProperty(value ="优惠券ID") + private String couponId; + + /** + * 商品ID + */ + + @ApiModelProperty(value ="商品") + private String goodsName; + + @ApiModelProperty(value ="商品ID") + private String goodsId; + + /** + * 活动主表ID + */ + + + @ApiModelProperty(value ="活动主表ID") + private Long activityId; + + /** + * 公司ID + */ + + + @ApiModelProperty(value ="公司ID") + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ScoreUseRecordVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ScoreUseRecordVo.java new file mode 100644 index 0000000..c687093 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ScoreUseRecordVo.java @@ -0,0 +1,56 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.anotations.Extend; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @description 积分记录表页面展示对象 + */ +@Data +@ApiModel(value = "ScoreUseRecordVo", description = "积分记录") +public class ScoreUseRecordVo { + + @Extend + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + private Integer id; + + @ApiModelProperty(value = "记录类型(1:现金消费2:员工划扣3赠送等)") + private Integer recType; + + @ApiModelProperty(value = "调整时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8") + private Date createTime; + + + @ApiModelProperty(value = "调整数量") + private Integer recNum; + + @ApiModelProperty(value = "业务记录ID") + private Long businessId; + + + + @ApiModelProperty(value = "调整后余额") + private Integer nowScore; + + @ApiModelProperty(value = "操作人") + private String optionName; + + @ApiModelProperty(value = "调整门店") + private String shopName; + + + @ApiModelProperty(value = "备注") + private String remarks; + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SeeAwardTextVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SeeAwardTextVo.java new file mode 100644 index 0000000..c5733d6 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SeeAwardTextVo.java @@ -0,0 +1,76 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.system.shopXcx.bean.ShopLogisticsInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "SeeAwardTextVo", description = "劵码信息") +public class SeeAwardTextVo { + + @ApiModelProperty(value ="中奖记录ID") + private long id; + + @ApiModelProperty(value ="奖项名称") + private String awardName; + + @ApiModelProperty(value ="图片介绍") + private String introduceImg; + + @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") + private int awardWay; + + @ApiModelProperty(value ="数量") + private int total; + + @ApiModelProperty(value ="兑奖期限开始日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") + private Date prizeStartTime; + + @ApiModelProperty(value ="兑奖期限结束日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") + private Date prizeEndTime; + + @ApiModelProperty(value =" 核销码") + private String writeOffCode; + + @ApiModelProperty(value ="兑奖须知") + private String operationTip; + + @ApiModelProperty(value ="兑奖地址") + private String prizeAddress; + + @ApiModelProperty(value ="客服微信") + private String wechatImg; + + @ApiModelProperty(value ="客服电话") + private String customerPhone ; + + @ApiModelProperty(value =" 是否已领取(1:待领取2:已领取 3:待配送 4:待收货 5:已失效)") + private Integer state; + + /** + * 收货人 + */ + @ApiModelProperty(value ="收货人") + private String consignee; + /** + * 联系电话 + */ + @ApiModelProperty(value ="联系电话") + private String consigneePhone; + /** + * 收货地址 + */ + @ApiModelProperty(value =" 收货地址") + private String consigneeAddress; + + @ApiModelProperty(value ="物流信息记录") + private List<ShopLogisticsInfo> shopLogisticsInfos; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartBillVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartBillVo.java index 6e5c3c1..fca4eb3 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartBillVo.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartBillVo.java @@ -26,6 +26,18 @@ * 未优惠之前的总金额 */ private BigDecimal srcTotal = BigDecimal.ZERO; + /** + * 抵用积分 + */ + private BigDecimal scorePay = BigDecimal.ZERO; + + public BigDecimal getScorePay() { + return scorePay; + } + + public void setScorePay(BigDecimal scorePay) { + this.scorePay = scorePay; + } public BigDecimal getBillTotal() { return billTotal; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartGroupVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartGroupVo.java new file mode 100644 index 0000000..0658267 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartGroupVo.java @@ -0,0 +1,46 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.matrix.system.shopXcx.bean.ShopCoupon; +import com.matrix.system.shopXcx.bean.ShopShoppingCart; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * 购物车前台展示对象 + */ +@Data +public class ShopCartGroupVo { + + private ShopCoupon coupon; + + //是否满足优惠 + private boolean satisfactionCoupon; + + + private List<ShopShoppingCart> cartList=new ArrayList<>(); + + + //提示语 + private String msg=""; + + //优惠小计金额 + private BigDecimal subtotal=BigDecimal.ZERO; + + //原价 + private BigDecimal srcPrice=BigDecimal.ZERO; + + //优惠金额 + private BigDecimal couponPrice=BigDecimal.ZERO; + /** + * 抵用积分 + */ + private BigDecimal scorePay = BigDecimal.ZERO; + + private CouponReceiveInfoVO couponReceiveInfoVO; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartVo.java index 185f984..6d1733e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartVo.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartVo.java @@ -2,6 +2,7 @@ import com.matrix.system.shopXcx.bean.ShopCoupon; import com.matrix.system.shopXcx.bean.ShopShoppingCart; +import lombok.Data; import java.math.BigDecimal; import java.util.List; @@ -9,90 +10,33 @@ /** * 购物车前台展示对象 */ +@Data public class ShopCartVo { - private ShopCoupon coupon; + private ShopCoupon coupon; - private CouponReceiveInfoVO couponReceiveInfoVO; + private CouponReceiveInfoVO couponReceiveInfoVO; - public CouponReceiveInfoVO getCouponReceiveInfoVO() { - return couponReceiveInfoVO; - } - public void setCouponReceiveInfoVO(CouponReceiveInfoVO couponReceiveInfoVO) { - this.couponReceiveInfoVO = couponReceiveInfoVO; - } + //是否满足优惠 + private boolean satisfactionCoupon; - //是否满足优惠 - private boolean satisfactionCoupon; + private List<ShopShoppingCart> cartList; - private List<ShopShoppingCart> cartList; + //提示语 + private String msg = ""; - //提示语 - private String msg=""; + //优惠小计金额 + private BigDecimal subtotal = BigDecimal.ZERO; - //优惠小计金额 - private BigDecimal subtotal=BigDecimal.ZERO; + //原价 + private BigDecimal srcPrice = BigDecimal.ZERO; - //原价 - private BigDecimal srcPrice=BigDecimal.ZERO; + //优惠金额 + private BigDecimal couponPrice = BigDecimal.ZERO; + /** + * 抵用积分 + */ + private BigDecimal scorePay = BigDecimal.ZERO; - //优惠金额 - private BigDecimal couponPrice=BigDecimal.ZERO; - - public ShopCoupon getCoupon() { - return coupon; - } - - public void setCoupon(ShopCoupon coupon) { - this.coupon = coupon; - } - - public boolean isSatisfactionCoupon() { - return satisfactionCoupon; - } - - public void setSatisfactionCoupon(boolean satisfactionCoupon) { - this.satisfactionCoupon = satisfactionCoupon; - } - - public List<ShopShoppingCart> getCartList() { - return cartList; - } - - public void setCartList(List<ShopShoppingCart> cartList) { - this.cartList = cartList; - } - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } - - public BigDecimal getSubtotal() { - return subtotal; - } - - public void setSubtotal(BigDecimal subtotal) { - this.subtotal = subtotal; - } - - public BigDecimal getSrcPrice() { - return srcPrice; - } - - public void setSrcPrice(BigDecimal srcPrice) { - this.srcPrice = srcPrice; - } - - public BigDecimal getCouponPrice() { - return couponPrice; - } - - public void setCouponPrice(BigDecimal couponPrice) { - this.couponPrice = couponPrice; - } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignAwardListVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignAwardListVo.java new file mode 100644 index 0000000..daa0144 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignAwardListVo.java @@ -0,0 +1,37 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "SignAwardListVo", description = "奖品列表") +public class SignAwardListVo { + /** + * 主键 + */ + private Long id; + + @ApiModelProperty(value ="奖项名称") + private String awardName; + + @ApiModelProperty(value ="图片介绍") + private String introduceImg; + + @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") + private int awardWay; + + @ApiModelProperty(value ="数量") + private int total; + + @ApiModelProperty(value ="是否已领取(1:待领取2:已领取 3:待配送 4:待收货 5:已失效)") + private Integer state; + + @ApiModelProperty(value ="领取时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date receiveTime; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoJsonVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoJsonVo.java new file mode 100644 index 0000000..1ca4b36 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoJsonVo.java @@ -0,0 +1,31 @@ +package com.matrix.system.shopXcx.api.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SignBasicInfoJsonVo", description = "签到活动") +public class SignBasicInfoJsonVo { + + @ApiModelProperty(value ="标题图片") + private String imageUrlTitle; + @ApiModelProperty(value ="头部图片") + private String imageUrlHead; + @ApiModelProperty(value ="按钮图片") + private String imageUrlButton; + @ApiModelProperty(value ="状态图片") + private String imageUrlState; + + @ApiModelProperty(value ="规则内容") + private String ruleExplain; + @ApiModelProperty(value ="字体颜色") + private String typographyColor; + @ApiModelProperty(value ="背景颜色") + private String backgroundColor; + @ApiModelProperty(value ="字体大小") + private Integer typographyNum; + @ApiModelProperty(value ="字体透明度") + private Integer typographyLight; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoVo.java new file mode 100644 index 0000000..fd0e48d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoVo.java @@ -0,0 +1,46 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data + +@ApiModel(value = "SignBasicInfoVo", description = "签到活动") +public class SignBasicInfoVo { + + /** + * 主键 + */ + private Long id; + @ApiModelProperty(value ="活动今日是否已参与 1:未参与 2:已参与") + private int joinState; + + public static final int JOINSTATE_NOTSIGN = 1; + public static final int JOINSTATE_SIGN = 2; + + @ApiModelProperty(value ="当前累计签到天数") + private int actAumulativeDay; + + @ApiModelProperty(value ="活动名称") + private String actName; + @ApiModelProperty(value ="活动编码") + private String actCode; + @ApiModelProperty(value ="活动开始时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date beginTime; + @ApiModelProperty(value ="活动结束时间") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date endTime; + @ApiModelProperty(value ="活动基本参数") + private SignBasicInfoJsonVo signBasicInfoJsonVo; + @ApiModelProperty(value ="奖品信息") + private List<ActivitySignAwardSetVo> activitySignAwardSetVos; + @ApiModelProperty(value ="签到天数") + private List<ActivitySignRecordVo> activitySignRecords; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignSuccessVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignSuccessVo.java new file mode 100644 index 0000000..de570bf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignSuccessVo.java @@ -0,0 +1,151 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data + +@ApiModel(value = "SignSuccessVo", description = "签到活动") +public class SignSuccessVo { + + @ApiModelProperty(value ="奖励类型 1:日常奖励 2:累计奖励") + private int type; + + @ApiModelProperty(value ="累计奖励名称") + private String awardName; + @ApiModelProperty(value ="累计奖励图片") + private String awardImg; + @ApiModelProperty(value ="累计奖励核销码") + private String writeOffCode; + + @ApiModelProperty(value ="奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)") + private int awardType; + + + public static final int AWARDTYPE_CUSTOMIZE = 1; + public static final int AWARDTYPE_SCORE = 2; + public static final int AWARDTYPE_COUPON = 3; + public static final int AWARDTYPE_GOODS = 4; + + @ApiModelProperty(value ="文字介绍") + private String introduceTip; + + /** + * 奖项库存数量 + */ + + + @ApiModelProperty(value ="奖项库存数量") + private int awardInventoryCnt; + + /** + * 已派发数量 + */ + + + @ApiModelProperty(value ="已派发数量") + private int awardDistributeCnt; + + /** + * 兑奖方式(1:线下兑换2:物流配送3:客服兑换) + */ + + + @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") + private int awardWay; + + /** + * 奖品是否有效(1:有效 2:无效) + */ + @ApiModelProperty(value ="奖品是否有效(1:有效 2:无效)") + private int awardState; + public static final int AWARDSTATE_WORK = 1; + public static final int AWARDSTATE_UNWORK = 2; + + /** + * 操作提示 + */ + + @ApiModelProperty(value ="操作提示") + private String operationTip; + + /** + * 兑奖地址 + */ + + @ApiModelProperty(value ="兑奖地址") + private String prizeAddress; + + /** + * 兑奖期限开始日期 + */ + + + @ApiModelProperty(value ="兑奖期限开始日期") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date prizeStartTime; + + /** + * 兑奖期限结束日期 + */ + + @ApiModelProperty(value ="兑奖期限结束日期") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") + private Date prizeEndTime; + + /** + * 客服微信 + */ + + @ApiModelProperty(value ="客服微信") + private String wechatImg; + + /** + * 积分数量 + */ + + + @ApiModelProperty(value ="积分数量") + private int scoreCnt; + + /** + * 优惠券ID + */ + + @ApiModelProperty(value ="优惠券") + private String couponName; + + @ApiModelProperty(value ="优惠券ID") + private String couponId; + + /** + * 商品ID + */ + + @ApiModelProperty(value ="商品") + private String goodsName; + + @ApiModelProperty(value ="商品ID") + private String goodsId; + + /** + * 活动主表ID + */ + + + @ApiModelProperty(value ="活动主表ID") + private Long activityId; + + /** + * 公司ID + */ + + + @ApiModelProperty(value ="公司ID") + private Long companyId; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/WxMoneyCardUseVO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/WxMoneyCardUseVO.java new file mode 100644 index 0000000..f5d9b25 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/WxMoneyCardUseVO.java @@ -0,0 +1,56 @@ +package com.matrix.system.shopXcx.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author jyy + * @date 2020-04-21 11:36 + **/ +@Data +@ApiModel(value = "WxMoneyCardUseVO", description = "储值卡展示类") +public class WxMoneyCardUseVO { + + @ApiModelProperty(value ="储值卡ID") + private Long id; + + + @ApiModelProperty(value ="储值卡名称") + private String cardName; + + @ApiModelProperty(value ="失效时间") + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @DateTimeFormat(pattern= DateUtil.DATE_FORMAT_DD) + private Date failTime; + + @ApiModelProperty(value ="状态,有效,无效,转让,冻结,退款") + private String status; + + + @ApiModelProperty(value ="总次数") + private Integer useTotal; + + @ApiModelProperty(value ="剩余次数") + private Integer lastCount; + + @ApiModelProperty(value ="来源,购买,转让,赠送") + private String source; + + + @ApiModelProperty(value ="本金") + private Double realMoney; + + + @ApiModelProperty(value ="赠送金额") + private Double giftMoney; + + @ApiModelProperty(value ="是会籍卡? Y 是,N否") + private String isVipCar; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivities.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivities.java index 2028111..84d0d00 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivities.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivities.java @@ -30,6 +30,14 @@ * 活动类型 沙龙 */ public static final int ACTIVITIES_TYPE_SALON = 3; + /** + * 活动类型 签到 + */ + public static final int ACTIVITIES_TYPE_SIGN = 4; + /** + * 活动类型转盘抽奖 + */ + public static final int ACTIVITIES_TYPE_LUCKYDRAW = 5; /** * 活动状态 开启 @@ -50,6 +58,10 @@ * 活动名称 */ private String actName; + /** + * 活动编码 + */ + private String actCode; /** @@ -76,6 +88,17 @@ * 活动状态 */ private Integer actStatus; + + //未发布 + public static final int ACTSTATUS_STATUS_RELEASE = 1; + //未开始 + public static final int ACTSTATUS_STATUS_READY = 2; + //进行中 + public static final int ACTSTATUS_STATUS_ING = 3; + //已结束 + public static final int ACTSTATUS_STATUS_END = 4; + //已删除 + public static final int ACTSTATUS_STATUS_DEL = 5; /** @@ -285,4 +308,12 @@ public void setSalonRecord(ShopActivitiesSalonRecord salonRecord) { this.salonRecord = salonRecord; } + + public String getActCode() { + return actCode; + } + + public void setActCode(String actCode) { + this.actCode = actCode; + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java index bbaeb9f..071cf97 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java @@ -81,7 +81,7 @@ /** * 团长ID */ - private String gjHeadId; + private Long gjHeadId; private String headName; @@ -200,11 +200,11 @@ this.gjStatus=gjStatus; } - public String getGjHeadId() { + public Long getGjHeadId() { return gjHeadId; } - public void setGjHeadId(String gjHeadId) { + public void setGjHeadId(Long gjHeadId) { this.gjHeadId = gjHeadId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java index 54a5b95..a6ab143 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java @@ -71,7 +71,7 @@ /** * 用户Id */ - private String userId; + private Long userId; /** @@ -198,11 +198,11 @@ } - public String getUserId() { + public Long getUserId() { return userId; } - public void setUserId(String userId) { + public void setUserId(Long userId) { this.userId = userId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java index 13a92b3..055fbe9 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java @@ -45,7 +45,7 @@ /** * 用户主键 */ - private String userId; + private Long userId; /** @@ -102,11 +102,11 @@ this.actId=actId; } - public String getUserId() { + public Long getUserId() { return userId; } - public void setUserId(String userId) { + public void setUserId(Long userId) { this.userId = userId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java index 597c73d..9d8a9e0 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java @@ -36,7 +36,7 @@ /** * 用户主键 */ - private String userId; + private Long userId; private Long actId; @@ -94,11 +94,11 @@ this.orderId=orderId; } - public String getUserId() { + public Long getUserId() { return userId; } - public void setUserId(String userId) { + public void setUserId(Long userId) { this.userId = userId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopAdvertis.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopAdvertis.java index 7e42075..daec16c 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopAdvertis.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopAdvertis.java @@ -63,12 +63,25 @@ */ private String linkUrl; + /**连接的页面id */ + private Long pageId; + /** * 所属分类 */ @Extend private String adtName; + private Long companyId; + + public Long getPageId() { + return pageId; + } + + public void setPageId(Long pageId) { + this.pageId = pageId; + } + public Long getCompanyId() { return companyId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java index ff51f0e..33ed315 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java @@ -24,7 +24,7 @@ /** * 用户ID */ - private String userId; + private Long userId; /** @@ -59,11 +59,11 @@ } - public String getUserId() { + public Long getUserId() { return userId; } - public void setUserId(String userId) { + public void setUserId(Long userId) { this.userId=userId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryDetail.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryDetail.java index 08b9e4c..707e272 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryDetail.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryDetail.java @@ -5,7 +5,7 @@ /** * @description 发货明细 - * @author yourName + * @author jyy * @date 2019-10-21 15:02 */ public class ShopDeliveryDetail extends EntityDTO{ diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java index 75f2487..28519b6 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java @@ -61,7 +61,7 @@ /** * 用户ID */ - private String userId; + private Long userId; /** @@ -129,6 +129,7 @@ private Long shopId; private Long companyId; + private Long receiveId; public Long getCompanyId() { return companyId; } @@ -196,16 +197,14 @@ public void setOrderId(Integer orderId) { this.orderId=orderId; } - - public String getUserId() { + public Long getUserId() { return userId; } - - public void setUserId(String userId) { - this.userId=userId; + + public void setUserId(Long userId) { + this.userId = userId; } - public String getOrderNo() { return orderNo; @@ -304,4 +303,12 @@ public void setShopId(Long shopId) { this.shopId = shopId; } + + public Long getReceiveId() { + return receiveId; + } + + public void setReceiveId(Long receiveId) { + this.receiveId = receiveId; + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java index 46da7f2..e19d5f5 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java @@ -3,6 +3,7 @@ import com.matrix.core.pojo.EntityDTO; import com.matrix.core.anotations.Extend; import com.matrix.core.tools.DateUtil; +import io.swagger.models.auth.In; import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; @@ -17,9 +18,22 @@ public class ShopOrder extends EntityDTO { /** + * 支付方式-微信支付 + */ + public static final int SHOP_ORDER_PAY_METHOD_WX = 1; + + /** + * 支付方式-vip会籍卡 + */ + public static final int SHOP_ORDER_PAY_METHOD_VIPCARD = 2; + + + + /** * 订单微信支付状态(待支付) */ public static final int ORDER_WX_STATUS_WAIT_PAY = 1; + /** * 订单微信支付状态(支付成功) */ @@ -113,6 +127,18 @@ public static final int ACTIVITY_TYPE_SECKILL = 3; /** + * 物流配送 + */ + public static final int SHIPPING_METHOD_WL = 1; + + /** + * 门店自提 + */ + public static final int SHIPPING_METHOD_MDZT = 2; + + + + /** * 主键 */ private Integer id; @@ -140,8 +166,11 @@ /** * 用户ID */ - private String userId; - + private Long userId; + /** + * 支付积分 + */ + private Integer scorePay; /** * 下单时间 @@ -159,7 +188,10 @@ * 支付状态(1=待支付,2=支付成功,3=支付失败) */ private Integer payStatus; - + /** + * 支付方式1微信,2 vipCard余额 + */ + private Integer payMethod; /** * 优惠说明 @@ -206,7 +238,7 @@ /** * 配送方式(1=物流,2=门店自取) */ - private String shippingMethod; + private Integer shippingMethod; /** * 配送门店ID @@ -336,6 +368,13 @@ return orderNo; } + public Integer getScorePay() { + return scorePay; + } + + public void setScorePay(Integer scorePay) { + this.scorePay = scorePay; + } public void setOrderNo(String orderNo) { this.orderNo = orderNo; @@ -357,11 +396,11 @@ this.commodityPrice = commodityPrice; } - public String getUserId() { + public Long getUserId() { return userId; } - public void setUserId(String userId) { + public void setUserId(Long userId) { this.userId = userId; } @@ -441,11 +480,11 @@ this.remarks = remarks; } - public String getShippingMethod() { + public Integer getShippingMethod() { return shippingMethod; } - public void setShippingMethod(String shippingMethod) { + public void setShippingMethod(Integer shippingMethod) { this.shippingMethod = shippingMethod; } @@ -481,10 +520,21 @@ this.delFlag = delFlag; } + + public Integer getPayMethod() { + return payMethod; + } + + public void setPayMethod(Integer payMethod) { + this.payMethod = payMethod; + } + public String getWxOrderNo() { return wxOrderNo; } + + public void setWxOrderNo(String wxOrderNo) { this.wxOrderNo = wxOrderNo; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java index f250956..073eb07 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java @@ -1,7 +1,7 @@ package com.matrix.system.shopXcx.bean; -import com.matrix.core.pojo.EntityDTO; import com.matrix.core.anotations.Extend; +import com.matrix.core.pojo.EntityDTO; import java.math.BigDecimal; @@ -10,9 +10,18 @@ * @author jyy * @date 2019-06-10 10:58 */ + public class ShopOrderDetails extends EntityDTO{ @Extend - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + /** + *支付方式-直接购买 + */ + public static final int PAYTYPE_MICRO = 1; + /** + *支付方式-积分兑换 + */ + public static final int PAYTYPE_SCORE=2; /** @@ -43,19 +52,33 @@ * 单价 */ private BigDecimal price; - + + /** + * 总价 + */ + private BigDecimal totalPrice; + + /** + * 支付积分单价 + */ + private BigDecimal scoreCount; + + /** + * 支付总积分 + */ + private BigDecimal totalScoreCount; + /** * 数量 */ private Integer count; - - /** - * 总价 + * 支付方式1 直接购买 2,积分兑换 */ - private BigDecimal totalPrice; - + private Integer payType; + + /** * 规格标题 @@ -132,6 +155,30 @@ this.price = price; } + public BigDecimal getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) { + this.totalPrice = totalPrice; + } + + public BigDecimal getScoreCount() { + return scoreCount; + } + + public void setScoreCount(BigDecimal scoreCount) { + this.scoreCount = scoreCount; + } + + public BigDecimal getTotalScoreCount() { + return totalScoreCount; + } + + public void setTotalScoreCount(BigDecimal totalScoreCount) { + this.totalScoreCount = totalScoreCount; + } + public Integer getCount() { return count; } @@ -140,12 +187,12 @@ this.count = count; } - public BigDecimal getTotalPrice() { - return totalPrice; + public Integer getPayType() { + return payType; } - public void setTotalPrice(BigDecimal totalPrice) { - this.totalPrice = totalPrice; + public void setPayType(Integer payType) { + this.payType = payType; } public String getsTitle() { diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopPage.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopPage.java index 1491fe8..fec783a 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopPage.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopPage.java @@ -6,7 +6,7 @@ /** * @description 小程序页面 - * @author yourName + * @author jyy * @date 2020-04-03 14:56 */ public class ShopPage extends EntityDTO{ diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java index 29865be..73ef54d 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java @@ -2,6 +2,7 @@ import com.matrix.core.anotations.Extend; import com.matrix.system.common.bean.EntityDTOExt; +import lombok.Data; import java.util.List; @@ -10,13 +11,27 @@ * @author jyy * @date 2019-06-10 10:58 */ +@Data public class ShopProduct extends EntityDTOExt { + /** + * 可用积分 + */ + public static final int PAYFOR_SCORE =1; + /** + * 不用积分 + */ + public static final int NOT_PAYFOR_SCORE =2; /** - * 产品类型-服务 + * 可分销 */ - public static final int IS_SERVICE_Y=1; - public static final int IS_SERVICE_N=2; + public static final int ABLE_SALES =1; + /** + * 不可分销 + */ + public static final int NOT_ABLE_SALES=2; + + /** * 主键 @@ -28,7 +43,12 @@ * 分类ID */ private Integer categoryId; - + + /** + * 积分商城分类ID + */ + private Integer scoreCategoryId; + /** * 标题 @@ -58,10 +78,17 @@ * 手机端封面 */ private String imgMobile; - - - + /** + * 是否可用积分支付 1是,2不是 + */ + private Integer ableScorePay; + + + /** + * 是否为分销产品 1是2不是 + */ + private Integer ableSales; /** * 原价 @@ -161,6 +188,7 @@ */ @Extend private String paramRefs; + @Extend private List<ShopProductParamRef> params; @@ -244,366 +272,9 @@ private Long companyId; - public Long getCompanyId() { - return companyId; - } - - public void setCompanyId(Long companyId) { - this.companyId = companyId; - } - - public String getBrand() { - return brand; - } - - public void setBrand(String brand) { - this.brand = brand; - } - - public String getShopIds() { - return shopIds; - } - - public void setShopIds(String shopIds) { - this.shopIds = shopIds; - } - - public ShopCoupon getShopCoupon() { - return shopCoupon; - } - - public void setShopCoupon(ShopCoupon shopCoupon) { - this.shopCoupon = shopCoupon; - } - - public Integer getCouponId() { - return couponId; - } - - public void setCouponId(Integer couponId) { - this.couponId = couponId; - } - - public String getStockNum() { - return stockNum; - } - - public void setStockNum(String stockNum) { - this.stockNum = stockNum; - } - - public Integer getIsService() { - return isService; - } - - public void setIsService(Integer isService) { - this.isService = isService; - } - - public Integer getIsSpecialPrice() { - return isSpecialPrice; - } - - public void setIsSpecialPrice(Integer isSpecialPrice) { - this.isSpecialPrice = isSpecialPrice; - } - - public Double getMarkedPrice() { - return markedPrice; - } - - public void setMarkedPrice(Double markedPrice) { - this.markedPrice = markedPrice; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id=id; - } - - - public Integer getCategoryId() { - return categoryId; - } - - public void setCategoryId(Integer categoryId) { - this.categoryId=categoryId; - } - - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title=title; - } - - - public String getBriefIntroduction() { - return briefIntroduction; - } - - public void setBriefIntroduction(String briefIntroduction) { - this.briefIntroduction=briefIntroduction; - } - - - public Integer getCarriage() { - return carriage; - } - - public void setCarriage(Integer carriage) { - this.carriage=carriage; - } - - - public String getImgPc() { - return imgPc; - } - - public void setImgPc(String imgPc) { - this.imgPc=imgPc; - } - - - public String getImgMobile() { - return imgMobile; - } - - public void setImgMobile(String imgMobile) { - this.imgMobile=imgMobile; - } - - - - public Double getPrice() { - return price; - } - - public void setPrice(Double price) { - this.price=price; - } - - - public String getPcDetails() { - return pcDetails; - } - - public void setPcDetails(String pcDetails) { - this.pcDetails=pcDetails; - } - - - public String getMobileDetails() { - return mobileDetails; - } - - public void setMobileDetails(String mobileDetails) { - this.mobileDetails=mobileDetails; - } - - - public Integer getBuyLimit() { - return buyLimit; - } - - public void setBuyLimit(Integer buyLimit) { - this.buyLimit=buyLimit; - } - - - public Integer getLimitCycle() { - return limitCycle; - } - - public void setLimitCycle(Integer limitCycle) { - this.limitCycle=limitCycle; - } - - - public Integer getIsCanComment() { - return isCanComment; - } - - public void setIsCanComment(Integer isCanComment) { - this.isCanComment=isCanComment; - } - - - public String getMnemonicCode() { - return mnemonicCode; - } - - public void setMnemonicCode(String mnemonicCode) { - this.mnemonicCode=mnemonicCode; - } - - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status=status; - } - - - public Integer getDsVolume() { - return dsVolume; - } - - public void setDsVolume(Integer dsVolume) { - this.dsVolume=dsVolume; - } - - - public Integer getRsVolume() { - return rsVolume; - } - - public void setRsVolume(Integer rsVolume) { - this.rsVolume=rsVolume; - } - - - public Integer getDelFlag() { - return delFlag; - } - - public void setDelFlag(Integer delFlag) { - this.delFlag=delFlag; - } - - - public String getParamRefs() { - return paramRefs; - } - - public void setParamRefs(String paramRefs) { - this.paramRefs = paramRefs; - } - - public String getAttrs() { - return attrs; - } - - public void setAttrs(String attrs) { - this.attrs = attrs; - } - - public String getShopSku() { - return shopSku; - } - - public void setShopSku(String shopSku) { - this.shopSku = shopSku; - } - - public String getShopProductImg() { - return shopProductImg; - } - - public void setShopProductImg(String shopProductImg) { - this.shopProductImg = shopProductImg; - } - - public List<ShopProductParamRef> getParams() { - return params; - } - - public void setParams(List<ShopProductParamRef> params) { - this.params = params; - } - - public List<ShopProductAttrRef> getAttrRefs() { - return attrRefs; - } - - public void setAttrRefs(List<ShopProductAttrRef> attrRefs) { - this.attrRefs = attrRefs; - } - - public List<ShopSku> getSkus() { - return skus; - } - - public void setSkus(List<ShopSku> skus) { - this.skus = skus; - } - - public List<ShopProductImg> getProductImgs() { - return productImgs; - } - - public void setProductImgs(List<ShopProductImg> productImgs) { - this.productImgs = productImgs; - } - - public Integer getStartPrice() { - return startPrice; - } - - public void setStartPrice(Integer startPrice) { - this.startPrice = startPrice; - } - - public Integer getEndPrice() { - return endPrice; - } - - public void setEndPrice(Integer endPrice) { - this.endPrice = endPrice; - } - - public String getSortType() { - return sortType; - } - - public void setSortType(String sortType) { - this.sortType = sortType; - } - - public String getQueryType() { - return queryType; - } - - public void setQueryType(String queryType) { - this.queryType = queryType; - } - - public String getAttrValues() { - return attrValues; - } - - public void setAttrValues(String attrValues) { - this.attrValues = attrValues; - } - - public String getAtrid() { - return atrid; - } - - public void setAtrid(String atrid) { - this.atrid = atrid; - } - - public String getScore() { - return score; - } - - public Integer getServiceTime() { - return serviceTime; - } - - public void setServiceTime(Integer serviceTime) { - this.serviceTime = serviceTime; - } + /** + * 是否虚拟产品 1/是 2/否 + */ + private Integer isUnrealProduct; - public void setScore(String score) { - this.score = score; - } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProductComment.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProductComment.java index 811dd40..77e678d 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProductComment.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProductComment.java @@ -3,6 +3,7 @@ import com.matrix.core.anotations.Extend; import com.matrix.core.tools.DateUtil; import com.matrix.system.common.bean.EntityDTOExt; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -19,7 +20,7 @@ /** * 主键 */ - private Integer comId; + private Long comId; /** @@ -130,14 +131,14 @@ /** * 开始时间 */ - @Extend - private String commentBeginTime; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date commentBeginTime; /** * 结束时间 */ - @Extend - private String commentEndTime; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date commentEndTime; private Long companyId; public Long getCompanyId() { return companyId; @@ -157,19 +158,19 @@ this.dateToStrTime = dateToStrTime; } - public String getCommentBeginTime() { + public Date getCommentBeginTime() { return commentBeginTime; } - public void setCommentBeginTime(String commentBeginTime) { + public void setCommentBeginTime(Date commentBeginTime) { this.commentBeginTime = commentBeginTime; } - public String getCommentEndTime() { + public Date getCommentEndTime() { return commentEndTime; } - public void setCommentEndTime(String commentEndTime) { + public void setCommentEndTime(Date commentEndTime) { this.commentEndTime = commentEndTime; } @@ -181,14 +182,13 @@ auditStatus = auditStatus; } - public Integer getComId() { + public Long getComId() { return comId; } - - public void setComId(Integer comId) { - this.comId=comId; + + public void setComId(Long comId) { + this.comId = comId; } - public String getUserId() { return userId; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java index 60bb61e..b557b04 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java @@ -40,7 +40,7 @@ /** * 用户ID */ - private String userId; + private Long userId; /** @@ -301,11 +301,11 @@ } - public String getUserId() { + public Long getUserId() { return userId; } - public void setUserId(String userId) { + public void setUserId(Long userId) { this.userId=userId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopScoreRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopScoreRecord.java deleted file mode 100644 index 59de19f..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopScoreRecord.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.matrix.system.shopXcx.bean; - -import com.matrix.core.pojo.EntityDTO; -import com.matrix.core.anotations.Extend; -import com.matrix.core.tools.DateUtil; - -import java.math.BigDecimal; - -/** - * @description 用户积分获取记录 - * @author jyy - * @date 2019-08-09 15:10 - */ -public class ShopScoreRecord extends EntityDTO{ - @Extend - private static final long serialVersionUID = 1L; - - - /** - * 主键 - */ - private Integer id; - - - /** - * 受益人openID - */ - private String beneficiaryId; - - - /** - * 购买人openID - */ - private String buyerId; - - - /** - * 购买人名称 - */ - private String buyerName; - - - /** - * 购买人头像地址 - */ - private String buyerAvatarUrl; - - - /** - * 订单ID - */ - private Integer orderId; - - - /** - * 订单金额 - */ - private BigDecimal amount; - - - /** - * 获得积分 - */ - private Integer score; - - - /** - * 创建时间格式化成字符串 - */ - @Extend - private String createTimeStr; - - - public String getCreateTimeStr() { - if (this.getCreateTime() == null) { - return ""; - } - return DateUtil.dateToString(this.getCreateTime(), DateUtil.DATE_FORMAT_DD); - } - - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id=id; - } - - - public String getBeneficiaryId() { - return beneficiaryId; - } - - public void setBeneficiaryId(String beneficiaryId) { - this.beneficiaryId=beneficiaryId; - } - - - public String getBuyerId() { - return buyerId; - } - - public void setBuyerId(String buyerId) { - this.buyerId=buyerId; - } - - - public String getBuyerName() { - return buyerName; - } - - public void setBuyerName(String buyerName) { - this.buyerName=buyerName; - } - - - public String getBuyerAvatarUrl() { - return buyerAvatarUrl; - } - - public void setBuyerAvatarUrl(String buyerAvatarUrl) { - this.buyerAvatarUrl = buyerAvatarUrl; - } - - public Integer getOrderId() { - return orderId; - } - - public void setOrderId(Integer orderId) { - this.orderId=orderId; - } - - - public BigDecimal getAmount() { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount=amount; - } - - - public Integer getScore() { - return score; - } - - public void setScore(Integer score) { - this.score=score; - } - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java index d9a1283..a3196af 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java @@ -22,7 +22,7 @@ /** * 用户id */ - private String userId; + private Long userId; /** @@ -84,11 +84,11 @@ } - public String getUserId() { + public Long getUserId() { return userId; } - public void setUserId(String userId) { + public void setUserId(Long userId) { this.userId=userId; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShareQrcord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShareQrcord.java index 84e645b..0fdbf69 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShareQrcord.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShareQrcord.java @@ -1,10 +1,12 @@ package com.matrix.system.shopXcx.bean; import com.matrix.system.common.bean.EntityDTOExt; +import lombok.Data; /** * 分享二维码 */ +@Data public class ShopShareQrcord extends EntityDTOExt { @@ -23,7 +25,7 @@ /** * 用户ID */ - private String userId; + private Long userId; /** @@ -55,69 +57,4 @@ */ private Long shopId; - public Long getShopId() { - return shopId; - } - - public void setShopId(Long shopId) { - this.shopId = shopId; - } - - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Integer getProductId() { - return productId; - } - - public void setProductId(Integer productId) { - this.productId = productId; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Integer getVisitorCount() { - return visitorCount; - } - - public void setVisitorCount(Integer visitorCount) { - this.visitorCount = visitorCount; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getQrcodeUrl() { - return qrcodeUrl; - } - - public void setQrcodeUrl(String qrcodeUrl) { - this.qrcodeUrl = qrcodeUrl; - } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java index 7259104..4f27e07 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java @@ -14,33 +14,42 @@ */ public class ShopShoppingCart extends EntityDTOExt { @Extend - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + /** + *购物车类型-直接购买 + */ + public static final int CAR_TYPE_MICRO =1; + /** + *购物车类型-积分兑换 + */ + public static final int CAR_TYPE_SCORE=2; - + + /** * 主键 */ private Integer cartId; - - + + /** * 用户ID */ - private String cartUserId; - - + private Long cartUserId; + + /** * 产品ID */ private Integer cartProductId; - - + + /** * 规格ID */ private Integer cartSkuId; - - + + /** * 数量 */ @@ -50,6 +59,12 @@ * 用户是否选中 1选中 2未选中 */ private Integer isSelected; + /** + * 购物车类型 1直接支付 2积分兑换 + */ + private Integer cartType; + + /** * 门店id @@ -67,6 +82,16 @@ */ @Extend private BigDecimal price; + /** + * 积分兑换所需支付金额 + */ + @Extend + private BigDecimal scorePrice; + /** + * 积分兑换所需支付积分 + */ + @Extend + private Integer scoreCount; /** * 产品手机端封面地址 @@ -165,6 +190,22 @@ this.increaseAndDecrease = increaseAndDecrease; } + public BigDecimal getScorePrice() { + return scorePrice; + } + + public void setScorePrice(BigDecimal scorePrice) { + this.scorePrice = scorePrice; + } + + public Integer getScoreCount() { + return scoreCount; + } + + public void setScoreCount(Integer scoreCount) { + this.scoreCount = scoreCount; + } + public Integer getModifyCartNumber() { return modifyCartNumber; } @@ -251,44 +292,44 @@ public Integer getCartId() { return cartId; } - - public void setCartId(Integer cartId) { + + public void setCartId(Integer cartId) { this.cartId=cartId; } - - public String getCartUserId() { + + public Long getCartUserId() { return cartUserId; } - - public void setCartUserId(String cartUserId) { + + public void setCartUserId(Long cartUserId) { this.cartUserId=cartUserId; } - + public Integer getCartProductId() { return cartProductId; } - - public void setCartProductId(Integer cartProductId) { + + public void setCartProductId(Integer cartProductId) { this.cartProductId=cartProductId; } - + public Integer getCartSkuId() { return cartSkuId; } - - public void setCartSkuId(Integer cartSkuId) { + + public void setCartSkuId(Integer cartSkuId) { this.cartSkuId=cartSkuId; } - + public Integer getCartNumber() { return cartNumber; } - - public void setCartNumber(Integer cartNumber) { + + public void setCartNumber(Integer cartNumber) { this.cartNumber=cartNumber; } @@ -318,12 +359,18 @@ public void setShopCoupons(List<ShopCoupon> shopCoupons) { this.shopCoupons=shopCoupons; - + } public List<ShopCoupon> getShopCoupons() { return shopCoupons; } - - + + public Integer getCartType() { + return cartType; + } + + public void setCartType(Integer cartType) { + this.cartType = cartType; + } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java index 5b504d2..5597740 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java @@ -12,7 +12,7 @@ */ public class ShopSku extends EntityDTO{ @Extend - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; /** @@ -51,9 +51,32 @@ private BigDecimal price; /** - * 积分 + *自购提成 + */ + private BigDecimal selfPrice; + /** + *推广提成 + */ + private BigDecimal sealesPrice; + /** + *邀请提成 + */ + private BigDecimal invitationPrice; + + /** + * 消费可得积分 */ private Integer score; + + /** + * 积分兑换所需支付金额 + */ + private BigDecimal scorePrice; + /** + * 积分兑换所需支付积分 + */ + private Integer scoreCount; + /** * 排序 @@ -81,6 +104,31 @@ @Extend private String goodsName; + + + public Integer getScoreCount() { + return scoreCount; + } + + public void setScoreCount(Integer scoreCount) { + this.scoreCount = scoreCount; + } + + public BigDecimal getSealesPrice() { + return sealesPrice; + } + + public void setSealesPrice(BigDecimal sealesPrice) { + this.sealesPrice = sealesPrice; + } + + public BigDecimal getInvitationPrice() { + return invitationPrice; + } + + public void setInvitationPrice(BigDecimal invitationPrice) { + this.invitationPrice = invitationPrice; + } public Long getCompanyId() { return companyId; @@ -225,10 +273,26 @@ this.goodsName = goodsName; } + public BigDecimal getScorePrice() { + return scorePrice; + } + + public void setScorePrice(BigDecimal scorePrice) { + this.scorePrice = scorePrice; + } + @Override public boolean equals(Object obj) { //这里以name为判定标准。 return id.equals(((ShopSku) obj).getId()); } + public BigDecimal getSelfPrice() { + return selfPrice; + } + + public void setSelfPrice(BigDecimal selfPrice) { + this.selfPrice = selfPrice; + } + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopWxtemplateMsg.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopWxtemplateMsg.java index 4c5e2d4..390f897 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopWxtemplateMsg.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopWxtemplateMsg.java @@ -40,8 +40,15 @@ */ private Integer status; + /** + * 模板类型 1,公众号,2,小程序 + */ + private Integer tempType; - + /** + * 取数模板类 + */ + private String templateClass; /** * 模板备注 @@ -86,24 +93,76 @@ } } - public void buildDicMap(Object value) { - if (value != null) { - STATUS[] statusArray = STATUS.values(); - for (STATUS s : statusArray) { - if (s.getCode().equals(value)) { - getDicMap().put("status", s.getName()); - } - } - } - } + public enum TempType { + + MP("公众号", 1), + + APP("小程序", 2); + + private TempType(String name, int code) { + this.name = name; + this.code = code; + } + + private String name; + private Integer code; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + } + + + public void setStatus(Integer status) { - buildDicMap(status); - - buildDicMap("status"); - + if (status != null) { + STATUS[] statusArray = STATUS.values(); + for (STATUS s : statusArray) { + if (s.getCode().equals(status)) { + getDicMap().put("status", s.getName()); + } + } + } this.status = status; } + public String getTemplateClass() { + return templateClass; + } + + public void setTemplateClass(String templateClass) { + + this.templateClass = templateClass; + } + + public Integer getTempType() { + + return tempType; + } + + public void setTempType(Integer tempType) { + if (tempType != null) { + TempType[] statusArray = TempType.values(); + for (TempType s : statusArray) { + if (s.getCode().equals(tempType)) { + getDicMap().put("tempType", s.getName()); + } + } + } + this.tempType = tempType; + } public Integer getId() { return id; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopActivitiesDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopActivitiesDao.java index fc86fc5..913bfc7 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopActivitiesDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopActivitiesDao.java @@ -1,11 +1,16 @@ package com.matrix.system.shopXcx.dao; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.activity.dto.ActivitiesListDto; +import com.matrix.system.activity.vo.ActivitiesListVo; import com.matrix.system.shopXcx.api.vo.SalonVO; +import com.matrix.system.shopXcx.bean.ShopActivities; import org.apache.ibatis.annotations.Param; + import java.util.List; import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.shopXcx.bean.ShopActivities; /** * @description 活动主表 @@ -49,4 +54,11 @@ public ShopActivities selectSalonActivityById(@Param("id") Long id); public List<ShopActivities> selectSalonActivityByUser(@Param("record") SalonVO salonVO); + + public IPage<ActivitiesListVo> findActivitiesList(Page<ActivitiesListVo> page, @Param("record")ActivitiesListDto activitiesListDto); + + public ShopActivities selectOneByCompanyIdAndActTypeAndActStatus(@Param("companyId")Long companyId, @Param("activitiesTypeSign")int activitiesTypeSign, + @Param("actstatusStatusIng")int actstatusStatusIng); + + List<ShopActivities> selectOneByCompanyIdAndActType(@Param("companyId")Long companyId,@Param("activitiesTypeSign") int activitiesTypeSign); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponDao.java index 084115a..f92e198 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponDao.java @@ -45,7 +45,7 @@ @Param("productId") Integer productId, @Param("attrIds") List<String> attrIds); List<ShopCoupon> selectCouponListByTag(@Param("isNewPeople") boolean isNewPeople, @Param("userId") String userId, - @Param("tag") String tag,@Param("shopId") Long shopId); + @Param("tag") String tag,@Param("companyId") Long companyId); public int updateStateByStateAndIds(@Param("list") List<String> list, @Param("state") int state); @@ -55,7 +55,8 @@ ShopCoupon selectByIdAndUserId(@Param("id") Integer id, @Param("userId") String userId); - public List<ShopCoupon> selectHdListByProductId(@Param("productId") Integer productId, @Param("attrIds") List<String> attrIds); + public List<ShopCoupon> selectHdListByProductId(@Param("productId") Integer productId, @Param("attrIds") List<String> attrIds, @Param("companyId")Long companyId); ShopCoupon getCouponByTitle(@Param("title")String title, @Param("companyId")Long companyId); + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java index 6d46836..0f316fc 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java @@ -39,13 +39,14 @@ public ShopCouponRecord selectForUpdate(Integer id); - List<CouponReceiveInfoVO> selectMyCouponByUserId(@Param("userId") String userId); + List<CouponReceiveInfoVO> selectMyCouponByUserId(@Param("userId") Long userId); CouponReceiveInfoVO selectMyCouponByReceiveId(@Param("receiveId") Integer receiveId); - List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("shopId") Long shopId, @Param("userId") String userId, @Param("status") Integer status, + List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("companyId") Long shopId, @Param("userId") Long userId, @Param("status") Integer status, @Param("pageVo") PaginationVO pageVo); - List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("shopId")Long shopId, @Param("userId") String userId, @Param("pageVo") PaginationVO pageVo); + List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("companyId")Long shopId, @Param("userId") Long userId, @Param("pageVo") PaginationVO pageVo); + int countUnuseCouponRecord(Long id); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopDeliveryDetailDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopDeliveryDetailDao.java index d9860f1..96bed1a 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopDeliveryDetailDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopDeliveryDetailDao.java @@ -8,7 +8,7 @@ /** * @description 发货明细 - * @author yourName + * @author jyy * @date 2019-10-21 15:02 */ public interface ShopDeliveryDetailDao{ diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java index 5b4c41c..a161313 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java @@ -44,9 +44,9 @@ public ShopOrder selectForUpdate(Integer id); - List<ShopOrder> selectMyOrderByStatus(@Param("userId") String userId, @Param("params") OrderInfoQueryPOJO orderInfoQueryPOJO); + List<ShopOrder> selectMyOrderByStatus(@Param("userId") Long userId, @Param("params") OrderInfoQueryPOJO orderInfoQueryPOJO); - ShopOrder selectOrderInfoById(@Param("userId") String userId, @Param("id") Integer id); + ShopOrder selectOrderInfoById(@Param("userId") Long userId, @Param("id") Integer id); public ShopOrder selectMyOrderById(Integer id); @@ -58,12 +58,7 @@ */ List<ShopOrder> selectInPageByQueryOfExcel(@Param("record") ShopOrderQueryPOJO orderQuery, @Param("pageVo") PaginationVO pageVo); - /** - * 根据用户openID查询消费金额 - * @param userId - * @return - */ - Double selectConsumptionSumByUserId(@Param("userId") String userId); + public List<ShopOrder> selectOrdersByIds(@Param("shopId") Long shopId,@Param("comId") Long comId, @Param("list") List<String> list); @@ -75,7 +70,11 @@ public int selectShopOrderTotalByApplyId(@Param("applyId") Long applyId); - public List<Map<String,Object>> selectOrderStatusCount(String openId); + public List<Map<String,Object>> selectOrderStatusCount(Long userId); public int batchUpdateOrderStatus(@Param("list") List<ShopOrder> list); + + public ShopOrder selectShopOrderByOrderNo(@Param("orderNo")String orderNo); + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java new file mode 100644 index 0000000..b49ab03 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java @@ -0,0 +1,20 @@ +package com.matrix.system.shopXcx.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.matrix.system.shopXcx.bean.ShopOrder; +import org.apache.ibatis.annotations.Param; + +/** + * @description 订单表 + */ +public interface ShopOrderV2Dao extends BaseMapper<ShopOrder> { + + /** 统计已收货订单数 */ + int selectReceivedOrderCount(Long userId); + /** 统计已收货订单金额 */ + Double countOrderAmount(Long userId); + + /** 统计是否消费过了指定产品 */ + int countBuyZdcp(@Param("userId") Long userId, @Param("productIds")String productIds); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopPageDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopPageDao.java index af81228..62a630e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopPageDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopPageDao.java @@ -8,7 +8,7 @@ /** * @description 小程序页面 - * @author yourName + * @author jyy * @date 2020-04-03 14:56 */ public interface ShopPageDao{ diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopProductDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopProductDao.java index 176f9c0..653bfde 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopProductDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopProductDao.java @@ -53,6 +53,8 @@ */ List<ShopProduct> selectByIds(@Param("ids") List<Integer> ids); + List<String> selectProductNameByIds(@Param("ids") List<Integer> ids); + List<ShopProduct> selectProductByAttrid(@Param("attrId") String attrId,@Param("shopId") Long shopId); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopQrcordVisitorDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopQrcordVisitorDao.java index 2248fd1..52b5a34 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopQrcordVisitorDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopQrcordVisitorDao.java @@ -8,7 +8,7 @@ /** * @description 二维码访问记录 - * @author yourName + * @author jyy * @date 2019-09-18 09:42 */ public interface ShopQrcordVisitorDao{ diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopScoreRecordDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopScoreRecordDao.java deleted file mode 100644 index 9475abe..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopScoreRecordDao.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.matrix.system.shopXcx.dao; - -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.shopXcx.bean.ShopScoreRecord; - -/** - * @description 用户积分获取记录 - * @author jyy - * @date 2019-08-09 15:10 - */ -public interface ShopScoreRecordDao{ - - public int insert(@Param("item") ShopScoreRecord shopScoreRecord); - - public int batchInsert(@Param("list") List<ShopScoreRecord> shopScoreRecordList); - - public int updateByMap(Map<String, Object> modifyMap); - - public int updateByModel(@Param("record") ShopScoreRecord shopScoreRecord); - - public int deleteByIds(@Param("list") List<String> list); - - public int deleteById(Integer id); - - public int deleteByModel(@Param("record") ShopScoreRecord shopScoreRecord); - - public List<ShopScoreRecord> selectInPage(@Param("record") ShopScoreRecord shopScoreRecord, @Param("pageVo") PaginationVO pageVo); - - public List<ShopScoreRecord> selectByModel(@Param("record") ShopScoreRecord shopScoreRecord); - - public int selectTotalRecord(@Param("record") ShopScoreRecord shopScoreRecord); - - public ShopScoreRecord selectById(Integer id); - - public ShopScoreRecord selectForUpdate(Integer id); - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShareQrcordDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShareQrcordDao.java index 70f5611..785fc05 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShareQrcordDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShareQrcordDao.java @@ -9,7 +9,7 @@ /** * @description 分享二维码 - * @author yourName + * @author jyy * @date 2019-09-18 09:42 */ public interface ShopShareQrcordDao{ diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java index bc4a432..b31b054 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java @@ -36,15 +36,15 @@ public ShopShoppingCart selectById(Integer cartId); - public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") String cartUserId); + public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") Long cartUserId); public ShopShoppingCart selectForUpdate(Integer cartId); public ShopShoppingCart selectBuyLimit(@Param("cartProductId") Integer cartProductId,@Param("cartSkuId") Integer cartSkuId); - public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("openId")String openId); + public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("userId")Long userId); - public int updateAllSelected(@Param("openId") String openId,@Param("shopId") Long shopId, @Param("isSelected") Integer isSelected); + public int updateAllSelected(@Param("openId") String openId, @Param("shopId") Long shopId, @Param("isSelected") Integer isSelected); /** * 删除用户选中的购物车明细 diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopWxtemplateMsgDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopWxtemplateMsgDao.java index 96f20f4..92b583b 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopWxtemplateMsgDao.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopWxtemplateMsgDao.java @@ -26,7 +26,7 @@ public int deleteById(Integer id); - public ShopWxtemplateMsg selectByCode(Integer code); + public ShopWxtemplateMsg selectByCode(@Param("code") Integer code, @Param("companyId") Long companyId); public int deleteByModel(@Param("record") ShopWxtemplateMsg shopWxtemplateMsg); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java index 3f5f706..450560e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java @@ -1,7 +1,10 @@ package com.matrix.system.shopXcx.dto; +import lombok.Data; + import java.math.BigDecimal; +@Data public class CreateGroupBuyDTO { /** @@ -37,7 +40,7 @@ /** * 配送方式 */ - private String shippingMethod; + private Integer shippingMethod; /** * 拼团ID @@ -54,111 +57,9 @@ private BigDecimal price; - private String openId; + private Long userId; private int goodsId; - public String getOpenId() { - return openId; - } - public void setOpenId(String openId) { - this.openId = openId; - } - - public int getGoodsId() { - return goodsId; - } - - public void setGoodsId(int goodsId) { - this.goodsId = goodsId; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public int getJoinType() { - return joinType; - } - - public void setJoinType(int joinType) { - this.joinType = joinType; - } - - public Long getGpId() { - return gpId; - } - - public void setGpId(Long gpId) { - this.gpId = gpId; - } - - public Long getActId() { - return actId; - } - - public void setActId(Long actId) { - this.actId = actId; - } - - public Integer getAddressId() { - return addressId; - } - - public void setAddressId(Integer addressId) { - this.addressId = addressId; - } - - public Long getShopId() { - return shopId; - } - - public void setShopId(Long shopId) { - this.shopId = shopId; - } - - public String getShippingMethod() { - return shippingMethod; - } - - public void setShippingMethod(String shippingMethod) { - this.shippingMethod = shippingMethod; - } - - public Long getGjId() { - return gjId; - } - - public void setGjId(Long gjId) { - this.gjId = gjId; - } - - public Integer getSkuId() { - return skuId; - } - - public void setSkuId(Integer skuId) { - this.skuId = skuId; - } - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateSecKillDTO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateSecKillDTO.java index ad70120..5d479bd 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateSecKillDTO.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateSecKillDTO.java @@ -1,11 +1,14 @@ package com.matrix.system.shopXcx.dto; +import lombok.Data; + import java.math.BigDecimal; /** * @author wzy * @date 2020-04-09 15:49 **/ +@Data public class CreateSecKillDTO { /** @@ -31,7 +34,7 @@ /** * 配送方式 */ - private String shippingMethod; + private Integer shippingMethod; private BigDecimal price; @@ -39,67 +42,4 @@ private String openId; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Integer getAddressId() { - return addressId; - } - - public void setAddressId(Integer addressId) { - this.addressId = addressId; - } - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - public Long getShopId() { - return shopId; - } - - public void setShopId(Long shopId) { - this.shopId = shopId; - } - - public String getShippingMethod() { - return shippingMethod; - } - - public void setShippingMethod(String shippingMethod) { - this.shippingMethod = shippingMethod; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public Integer getGoodsId() { - return goodsId; - } - - public void setGoodsId(Integer goodsId) { - this.goodsId = goodsId; - } - - public String getOpenId() { - return openId; - } - - public void setOpenId(String openId) { - this.openId = openId; - } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/DiscountExplain.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/DiscountExplain.java index fb48cdf..a9519aa 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/DiscountExplain.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/DiscountExplain.java @@ -1,10 +1,13 @@ package com.matrix.system.shopXcx.dto; +import lombok.Data; + import java.math.BigDecimal; /** * 订单优惠说明 */ +@Data public class DiscountExplain { /** @@ -15,13 +18,13 @@ /** * 优惠券金额 */ - private BigDecimal coupon=BigDecimal.ZERO; + private BigDecimal couponPrice =BigDecimal.ZERO; /** * 活动满减金额 */ - private BigDecimal activity=BigDecimal.ZERO; + private BigDecimal activityPrice =BigDecimal.ZERO; /** * 运费 @@ -32,44 +35,9 @@ * 最终支付金额 */ private BigDecimal payPrice=BigDecimal.ZERO; + /** + * 最终支付积分 + */ + private Integer scorePay; - public BigDecimal getBillPrice() { - return billPrice; - } - - public void setBillPrice(BigDecimal billPrice) { - this.billPrice = billPrice; - } - - public BigDecimal getCoupon() { - return coupon; - } - - public void setCoupon(BigDecimal coupon) { - this.coupon = coupon; - } - - public BigDecimal getActivity() { - return activity; - } - - public void setActivity(BigDecimal activity) { - this.activity = activity; - } - - public BigDecimal getPostage() { - return postage; - } - - public void setPostage(BigDecimal postage) { - this.postage = postage; - } - - public BigDecimal getPayPrice() { - return payPrice; - } - - public void setPayPrice(BigDecimal payPrice) { - this.payPrice = payPrice; - } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/AsyncMessageRouting.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/AsyncMessageRouting.java new file mode 100644 index 0000000..6001400 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/AsyncMessageRouting.java @@ -0,0 +1,32 @@ +package com.matrix.system.shopXcx.mqTask; + +/** + * 异步任务名称 + */ +public interface AsyncMessageRouting { + + String CREATE_VIP = "CREATE_VIP"; + + String CREATE_ORDER = "CREATE_ORDER"; + String SALES_ORDER = "SALES_ORDER"; + String SCORE_ORDER = "SCORE_ORDER"; + String DINGDING_NOTICE = "DINGDING_NOTICE" ; + /** + * 发送微信消息 + */ + String SEND_TEMPLATE_MSG = "SEND_TEMPLATE_MSG"; + + /** + * 发送小程序统一模板消息 + */ + String SEND_UNIFORM_TEMPLATE_MSG = "SEND_UNIFORM_TEMPLATE_MSG"; + /** + * 订单退款 + */ + String SHOP_ORDER_REFUND = "SHOP_ORDER_REFUND"; + + /** + * 订单出库 + */ + String ORDER_OUT_SOTORE = "ORDER_OUT_SOTORE"; +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java index 68c94d1..99d77a6 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java @@ -8,10 +8,23 @@ String CREATE_VIP = "CREATE_VIP"; String CREATE_ORDER = "CREATE_ORDER"; + String SALES_ORDER = "SALES_ORDER"; + String SCORE_ORDER = "SCORE_ORDER"; + String DINGDING_NOTICE = "DINGDING_NOTICE" ; /** * 发送微信消息 */ String SEND_TEMPLATE_MSG = "SEND_TEMPLATE_MSG"; + + /** + * 发送小程序统一模板消息 + */ + String SEND_UNIFORM_TEMPLATE_MSG = "SEND_UNIFORM_TEMPLATE_MSG"; + /** + * 订单退款 + */ + String SHOP_ORDER_REFUND = "SHOP_ORDER_REFUND"; + /** * 订单出库 */ diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderDingDingNoticeTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderDingDingNoticeTask.java new file mode 100644 index 0000000..daf35f5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderDingDingNoticeTask.java @@ -0,0 +1,93 @@ +package com.matrix.system.shopXcx.mqTask; + + +import com.matrix.component.asyncmessage.MessageHandler; +import com.matrix.core.tools.DingDingRobotUtil; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.bean.ShopOrderDetails; +import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; +import com.matrix.system.shopXcx.dao.ShopOrderDao; +import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; +import com.rabbitmq.client.DeliverCallback; +import com.rabbitmq.client.Delivery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 微商城订单同步到erp系统 + */ +@Component +public class OrderDingDingNoticeTask implements MessageHandler { + + + @Autowired + ShopOrderDao shopOrderDao; + + @Autowired + ShopOrderDetailsDao shopOrderDetailsDao; + + + @Autowired + BusParameterSettingsDao parameterSettingsDao; + + @Autowired + SysVipInfoDao sysVipInfoDao; + + @Autowired + ShopDeliveryInfoDao shopDeliveryInfoDao; + + @Override + public String getName() { + return "创建订单通知任务"; + } + + @Override + public String getRouteKey() { + return AsyncMessageRouting.CREATE_ORDER; + } + + + @Override + public void handle(Map<String,Object> param){ + String orderIdStr = (String) param.get("orderId"); + Integer orderId=Integer.valueOf(orderIdStr); + //获取订单信息 + ShopOrder order = shopOrderDao.selectById(orderId); + LogUtil.debug("收到创建订单通知任务orderId={}", orderId); + BusParameterSettings wxOrderNoticeDingdingToken = parameterSettingsDao.selectCompanyParamByCode(AppConstance.WX_ORDER_NOTICE_DINGDING_TOKEN, order.getCompanyId()); + if (wxOrderNoticeDingdingToken != null && StringUtils.isNotBlank(wxOrderNoticeDingdingToken.getParamValue())) { + //获取订单详情 + List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); + StringBuilder content = new StringBuilder(); + orderDetails.stream().forEach(i -> content.append(i.getsTitle()).append("*").append( + i.getCount()).append(";")); + ShopDeliveryInfo addInfo = shopDeliveryInfoDao.selectByOrderId(orderId); + + String shippingMethod="物流配送"; + if(AppConstance.SHIPPING_METHOD_SELF .equals(order.getShippingMethod())){ + shippingMethod="门店自提"; + } + DingDingRobotUtil.sendText(wxOrderNoticeDingdingToken.getParamValue(), + "新订单,微商城订单编号 "+order.getOrderNo() + +"; 订单金额:¥"+order.getOrderMoney() + +";订单内容:"+ content.toString() + +";收货电话:"+ order.getUserTel()+",收货人:"+ order.getUserName()+",收货地址:"+ addInfo.getReceiveAddress() + +"配送方式:"+shippingMethod + ,""); + }else{ + LogUtil.debug("未配置订单钉钉提醒"); + } + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderOutSotoreTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderOutSotoreTask.java index 65a7d18..612f4f9 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderOutSotoreTask.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderOutSotoreTask.java @@ -1,6 +1,7 @@ package com.matrix.system.shopXcx.mqTask; +import com.matrix.component.asyncmessage.MessageHandler; import com.matrix.core.tools.LogUtil; import com.matrix.system.hive.bean.SysOrder; import com.matrix.system.hive.dao.SysOrderDao; @@ -12,11 +13,12 @@ import java.io.IOException; import java.util.List; +import java.util.Map; /** * 微商城发货后erp出库 */ -public class OrderOutSotoreTask implements DeliverCallback { +public class OrderOutSotoreTask implements MessageHandler { @Autowired SysOrderDao sysOrderDao; @@ -25,9 +27,19 @@ SysOrderService orderService; @Override - public void handle(String consumerTag, Delivery message) throws IOException { + public String getName() { + return "微商城发货后erp出库"; + } - String orderNo = new String(message.getBody(), "UTF-8"); + @Override + public String getRouteKey() { + return AsyncMessageRouting.ORDER_OUT_SOTORE; + } + + @Override + public void handle(Map<String,Object> param){ + + String orderNo = (String) param.get("orderNo"); LogUtil.debug("收到出库订单orderNo={}", orderNo); //获取订单信息 SysOrder sourceOrder = new SysOrder(); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java index 944bb09..c885d81 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java @@ -1,23 +1,20 @@ package com.matrix.system.shopXcx.mqTask; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.service.BizUserService; +import com.matrix.component.asyncmessage.MessageHandler; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.StringUtils; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.ShoppingGoods; -import com.matrix.system.hive.bean.SysOrder; -import com.matrix.system.hive.bean.SysOrderItem; -import com.matrix.system.hive.bean.SysVipInfo; -import com.matrix.system.hive.dao.SysOrderDao; -import com.matrix.system.hive.dao.SysOrderItemDao; -import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.*; import com.matrix.system.hive.service.CodeService; import com.matrix.system.hive.service.ShoppingGoodsService; import com.matrix.system.hive.service.SysOrderService; +import com.matrix.system.hive.service.SysVipInfoService; import com.matrix.system.shopXcx.bean.ShopOrder; import com.matrix.system.shopXcx.bean.ShopOrderDetails; import com.matrix.system.shopXcx.bean.ShopSku; @@ -26,17 +23,21 @@ import com.matrix.system.shopXcx.dao.ShopSkuDao; import com.rabbitmq.client.DeliverCallback; import com.rabbitmq.client.Delivery; +import org.apache.logging.log4j.message.Message; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import java.io.IOException; import java.util.Date; import java.util.List; +import java.util.Map; /** * 微商城订单同步到erp系统 */ -public class OrderTask implements DeliverCallback { +@Component +public class OrderTask implements MessageHandler { @Autowired @@ -45,7 +46,7 @@ ShopOrderDetailsDao shopOrderDetailsDao; @Autowired - BizUserService bizUserService; + SysVipInfoService sysVipInfoService; @Autowired @@ -75,140 +76,186 @@ @Autowired BusParameterSettingsDao parameterSettingsDao; + @Autowired + private SysOrderFlowDao sysOrderFlowDao; + + @Autowired + private ShoppingGoodsDao shoppingGoodsDao; + + @Autowired + private ShopSalesmanOrderDao shopSalesmanOrderDao; + + @Autowired + private ShopSalesmanGradeDao shopSalesmanGradeDao; + @Transactional(rollbackFor = Exception.class) - public void createOrder(ShopOrder orderDto) { + public void synchronizationOrderToErp(ShopOrder orderDto) { - BizUser bizUser = bizUserService.findByOpenId(orderDto.getUserId()); - SysOrder order = new SysOrder(); - SysVipInfo vipInfo = vipDao.selectByPhone(bizUser.getPhoneNumber()); - if(SysVipInfo.UNDEAL_VIP==vipInfo.getIsDeal()){ - //非成交客户下单更新客户为成交客户 - vipInfo.setIsDeal(SysVipInfo.DEAL_VIP); - vipDao.update(vipInfo); - } - - //获取订单归属门店 - order.setShopId(Long.parseLong(orderDto.getStoreId()+"")); - //同步的订单订单编号保持一致 - order.setOrderNo(orderDto.getOrderNo()); - order.setVipId(vipInfo.getId()); - order.setOrderTime(new Date()); - order.setRemark(AppConstance.WX_ORDER_FLAG); - order.setStaffId(vipInfo.getStaffId()); - order.setIsCross(2 + ""); - order.setStatu(Dictionary.ORDER_STATU_YFK); - order.setCardPay(0.00); - order.setCashPay(orderDto.getOrderMoney().doubleValue()); - order.setTotal(orderDto.getOrderMoney().doubleValue()); - order.setZkTotal(orderDto.getOrderMoney().doubleValue()); - order.setArrears(0); - int i = sysOrderDao.insert(order); - // 创建订单明细,并计算总价与折扣总价 - // 总价 - double total = 0; - double zkTotal = 0; - int count = 0; - // 设置订单条目 + //判断是否存在需要同步的产品,只有绑定了erp中产品的才同步 + boolean needTb=false; for (ShopOrderDetails orderItemDto : orderDto.getDetails()) { - - ShopSku shopSku = shopSkuDao.selectById(orderItemDto.getsId()); - - if (StringUtils.isBlank(shopSku.getStockCode())) { - LogUtil.warn("销售产品未绑定erp中的产品,无法进行同步"); - } - - String goodsCode =shopSku.getStockCode(); - ShoppingGoods shoppingGoods = shoppingGoodsService.findById(Long.parseLong(goodsCode)); - - if (shoppingGoods == null) { - LogUtil.warn("无效的商品id{}", shopSku.getAtrid()); - } - SysOrderItem orderItem = new SysOrderItem(); - orderItem.setOrderId(order.getId()); - orderItem.setCount(orderItemDto.getCount()); - orderItem.setIsFree(orderItemDto.getPrice().doubleValue() > 0 ? "否" : "是"); - orderItem.setType(shoppingGoods.getGoodType()); - orderItem.setStatus(Dictionary.ORDER_STATU_YFK); - orderItem.setPrice(orderItemDto.getPrice().doubleValue()); - orderItem.setZkPrice(orderItemDto.getPrice().doubleValue()); - orderItem.setGoodsId(shoppingGoods.getId()); - if (shoppingGoods.getGoodType().equals(Dictionary.SHOPPING_GOODS_TYPE_JJCP)) { - orderItem.setAssembleId(shoppingGoods.getAssembleGoods().get(0).getId()); - } else if (shoppingGoods.getGoodType().equals(Dictionary.SHOPPING_GOODS_TYPE_XM)) { - orderItem.setAssembleId(shoppingGoods.getAssembleProj().get(0).getId()); - } - - // 设置对应产品的id - switch (shoppingGoods.getGoodType()) { - case Dictionary.SHOPPING_GOODS_TYPE_JJCP: - orderItemDao.insert(orderItem); - break; - // 购买的是单个项目 - case Dictionary.SHOPPING_GOODS_TYPE_XM: - orderItemDao.insert(orderItem); - break; - case Dictionary.SHOPPING_GOODS_TYPE_TC: - // 每一个套餐都看成一个单独的订单条目 - count = orderItem.getCount(); - for (int j = 0; j < count; j++) { - orderItem.setCount(1); - orderItem.setId(null); - orderItemDao.insert(orderItem); - } - break; - case Dictionary.SHOPPING_GOODS_TYPE_CZK: - // 新增明细 - orderItem.setGoodsId(shoppingGoods.getId()); - // 每一个充值卡都看成一个单独的订单条目 - count = orderItem.getCount(); - for (int j = 0; j < count; j++) { - orderItem.setCount(1); - orderItem.setId(null); - orderItemDao.insert(orderItem); - } - break; - case Dictionary.SHOPPING_GOODS_TYPE_ZHK: - // 新增明细 - orderItem.setGoodsId(shoppingGoods.getId()); - // 每一个充值卡都看成一个单独的订单条目 - count = orderItem.getCount(); - for (int j = 0; j < count; j++) { - orderItem.setCount(1); - orderItem.setId(null); - orderItemDao.insert(orderItem); - } - break; + if (StringUtils.isNotBlank(shopSku.getStockCode())) { + needTb=true; } } - // 处理收款逻辑 - SysOrder sourceOrder = sysOrderDao.selectById(order.getId()); - sourceOrder.setItems(orderItemDao.selectByOrderId(order.getId())); - // 设置会员充值卡使用情况 - orderService.addMoneyCardUse(sourceOrder); + if(needTb){ - // 改变客户项目套餐使用情况 - orderService.addTaocanProj(sourceOrder); + SysVipInfo vipInfo = sysVipInfoService.findById(orderDto.getUserId()); + SysOrder order = new SysOrder(); + if(SysVipInfo.UNDEAL_VIP==vipInfo.getIsDeal()){ + //非成交客户下单更新客户为成交客户 + vipInfo.setIsDeal(SysVipInfo.DEAL_VIP); + vipDao.update(vipInfo); + } - // 设置销量 - orderService.setShopSelCount(sourceOrder); + //获取订单归属门店 + order.setCompanyId(orderDto.getCompanyId()); + order.setShopId(Long.parseLong(orderDto.getStoreId()+"")); + //同步的订单订单编号保持一致 + order.setOrderNo(orderDto.getOrderNo()); + order.setVipId(vipInfo.getId()); + order.setOrderTime(new Date()); + order.setRemark(AppConstance.WX_ORDER_FLAG); + order.setStaffId(vipInfo.getStaffId()); + order.setIsCross(2 + ""); + order.setStatu(Dictionary.ORDER_STATU_YFK); + order.setCardPay(0.00); + order.setCashPay(orderDto.getOrderMoney().doubleValue()); + order.setTotal(orderDto.getOrderMoney().doubleValue()); + order.setZkTotal(orderDto.getOrderMoney().doubleValue()); + order.setPayTime(new Date()); + order.setArrears(0D); + int i = sysOrderDao.insert(order); + // 创建订单明细,并计算总价与折扣总价 + int count = 0; + // 设置订单条目 + for (ShopOrderDetails orderItemDto : orderDto.getDetails()) { + + + ShopSku shopSku = shopSkuDao.selectById(orderItemDto.getsId()); + + if (StringUtils.isBlank(shopSku.getStockCode())) { + LogUtil.warn("销售产品未绑定erp中的产品,无法进行同步"); + } + + String goodsCode =shopSku.getStockCode(); + ShoppingGoods shoppingGoods = shoppingGoodsService.findById(Long.parseLong(goodsCode)); + + if (shoppingGoods == null) { + LogUtil.warn("无效的商品id{}", shopSku.getAtrid()); + } + SysOrderItem orderItem = new SysOrderItem(); + orderItem.setOrderId(order.getId()); + orderItem.setCount(orderItemDto.getCount()); + orderItem.setIsFree(orderItemDto.getPrice().doubleValue() > 0 ? "否" : "是"); + orderItem.setType(shoppingGoods.getGoodType()); + orderItem.setStatus(Dictionary.ORDER_STATU_YFK); + orderItem.setPrice(orderItemDto.getPrice().doubleValue()); + orderItem.setZkPrice(orderItemDto.getPrice().doubleValue()); + orderItem.setGoodsId(shoppingGoods.getId()); + + // 设置对应产品的id + switch (shoppingGoods.getGoodType()) { + case Dictionary.SHOPPING_GOODS_TYPE_JJCP: + orderItemDao.insert(orderItem); + break; + // 购买的是单个项目 + case Dictionary.SHOPPING_GOODS_TYPE_XM: + orderItemDao.insert(orderItem); + break; + case Dictionary.SHOPPING_GOODS_TYPE_TC: + // 每一个套餐都看成一个单独的订单条目 + count = orderItem.getCount(); + for (int j = 0; j < count; j++) { + orderItem.setCount(1); + orderItem.setId(null); + orderItemDao.insert(orderItem); + } + break; + case Dictionary.SHOPPING_GOODS_TYPE_CZK: + // 新增明细 + orderItem.setGoodsId(shoppingGoods.getId()); + // 每一个充值卡都看成一个单独的订单条目 + count = orderItem.getCount(); + for (int j = 0; j < count; j++) { + orderItem.setCount(1); + orderItem.setId(null); + orderItemDao.insert(orderItem); + } + break; + case Dictionary.SHOPPING_GOODS_TYPE_ZHK: + // 新增明细 + orderItem.setGoodsId(shoppingGoods.getId()); + // 每一个充值卡都看成一个单独的订单条目 + count = orderItem.getCount(); + for (int j = 0; j < count; j++) { + orderItem.setCount(1); + orderItem.setId(null); + orderItemDao.insert(orderItem); + } + break; + } + } + // 处理收款逻辑 + SysOrder sourceOrder = sysOrderDao.selectById(order.getId()); + sourceOrder.setItems(orderItemDao.selectByOrderId(order.getId())); + // 设置会员充值卡使用情况 + orderService.addMoneyCardUse(sourceOrder); + + // 改变客户项目套餐使用情况 + orderService.addTaocanProj(sourceOrder); + + // 设置销量 + orderService.setShopSelCount(sourceOrder); + + SysOrderFlow flow = new SysOrderFlow(); + flow.setFlowNo(codeService.getFlowCode() + "-" + i); + Long goodsId = sourceOrder.getItems().get(0).getGoodsId(); + ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); + flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); + + flow.setOrderId(sourceOrder.getId()); + flow.setVipId(sourceOrder.getVipId()); + flow.setFlowType(SysOrderFlow.FLOW_TYPE_BUY); + + flow.setAmount(orderDto.getOrderMoney()); + flow.setPayMethod("微信"); + + flow.setShopId(sourceOrder.getShopId()); + flow.setCompanyId(sourceOrder.getCompanyId()); + sysOrderFlowDao.insert(flow); + }else{ + LogUtil.info("不存在需要同步的产品"); + } + } - - @Override - public void handle(String consumerTag, Delivery message) throws IOException { + public String getName() { + return "微商城订单同步到erp系统"; + } - String orderId = new String(message.getBody(), "UTF-8"); - LogUtil.debug("收到创建订单任务orderId={}", orderId); - //获取订单信息 - ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId)); - //获取订单详情 - List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); - order.setDetails(orderDetails); - createOrder(order); + @Override + public String getRouteKey() { + return AsyncMessageRouting.CREATE_ORDER; + } + + @Override + public void handle(Map<String,Object> param) { + + String orderId = (String) param.get("orderId"); + LogUtil.debug("收到创建订单任务orderId={}", orderId); + //获取订单信息 + ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId)); + //获取订单详情 + List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); + order.setDetails(orderDetails); + //同步订单到erp + synchronizationOrderToErp(order); } + } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java new file mode 100644 index 0000000..9daaf4c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java @@ -0,0 +1,87 @@ +package com.matrix.system.shopXcx.mqTask; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.matrix.component.asyncmessage.MessageHandler; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.dao.ShopOrderDao; +import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; +import com.rabbitmq.client.DeliverCallback; +import com.rabbitmq.client.Delivery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 分销订单退款 + */ +@Component +public class SalesOrderRefundTask implements MessageHandler { + + + @Autowired + private ShopSalesmanOrderDao shopSalesmanOrderDao; + + @Autowired + private ShopOrderDao shopOrderDao; + + @Autowired + private ScoreVipDetailService scoreVipDetailService; + + @Autowired + ShopOrderDetailsDao shopOrderDetailsDao; + + + @Override + public String getName() { + return "分销订单退款"; + } + + @Override + public String getRouteKey() { + return AsyncMessageRouting.SHOP_ORDER_REFUND; + } + + @Override + public void handle(Map<String,Object> param){ + + String orderId = (String) param.get("orderId"); + LogUtil.debug("收到分销订单退款任务orderId={}", orderId); + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("order_id",orderId); + List<ShopSalesmanOrder> list = shopSalesmanOrderDao.selectList(queryWrapper); + + list.forEach(shopSalesmanOrder->{ + + if(shopSalesmanOrder!=null){ + shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YTK); + shopSalesmanOrderDao.updateById(shopSalesmanOrder); + }else{ + LogUtil.debug("改订单为生成分销订单={}", orderId); + } + + + }); + ShopOrder order=shopOrderDao.selectById(Integer.parseInt(orderId)); + + //如果是积分支付则需要返还积分 + if(order.getScorePay()!=null && order.getScorePay()>0){ + LogUtil.debug("处理积分退款={}", orderId); + scoreVipDetailService.refundScore(order.getUserId(),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH); + } + + //消费获得积分返还,如果本订单获得了积分则要扣除获得积分 + scoreVipDetailService.removeByBusinessId(order.getUserId(),Long.parseLong(order.getId()+"")); + + + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java new file mode 100644 index 0000000..3383a03 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java @@ -0,0 +1,252 @@ +package com.matrix.system.shopXcx.mqTask; + + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.matrix.component.asyncmessage.MessageHandler; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysOrderDao; +import com.matrix.system.hive.dao.SysOrderItemDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.hive.service.ShoppingGoodsService; +import com.matrix.system.hive.service.SysOrderService; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.bean.ShopOrderDetails; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.dao.ShopOrderDao; +import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; +import com.rabbitmq.client.DeliverCallback; +import com.rabbitmq.client.Delivery; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.io.IOException; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 分销订单创建 + */ +@Component +public class SalesOrderTask implements MessageHandler { + + + @Autowired + ShopOrderDao shopOrderDao; + @Autowired + ShopOrderDetailsDao shopOrderDetailsDao; + + @Autowired + SysVipInfoService sysVipInfoService; + + + @Autowired + private SysVipInfoDao vipDap; + + @Autowired + SysVipInfoDao vipDao; + + @Autowired + CodeService codeService; + + @Autowired + SysOrderDao sysOrderDao; + + @Autowired + ShoppingGoodsService shoppingGoodsService; + + @Autowired + SysOrderItemDao orderItemDao; + + @Autowired + SysOrderService orderService; + + @Autowired + ShopSkuDao shopSkuDao; + + @Autowired + BusParameterSettingsDao parameterSettingsDao; + + + @Autowired + private ShopSalesmanOrderDao shopSalesmanOrderDao; + + @Autowired + private ShopSalesmanGradeDao shopSalesmanGradeDao; + + + @Override + public String getName() { + return "分销订单创建事件"; + } + + @Override + public String getRouteKey() { + return AsyncMessageRouting.CREATE_ORDER; + } + + @Override + public void handle(Map<String,Object> param){ + + String orderId = (String) param.get("orderId"); + LogUtil.debug("收到分销订单任务orderId={}", orderId); + //获取订单信息 + ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId)); + //获取订单详情 + List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); + order.setDetails(orderDetails); + //处理分销订单 + handleExtensionOrder(order); + + } + + /** + * 处理分销订单 + * @param order + */ + @Transactional + void handleExtensionOrder(ShopOrder order) { + //判读客户是否存在上级,存在则产生上级的收益 + SysVipInfo sysVipInfo = sysVipInfoService.findById(order.getUserId()); + LogUtil.debug("处理分销订单userOpid={}",sysVipInfo.getOpenId()); + //判断是否重复生成 + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("order_id",order.getId()); + Integer orderCount = shopSalesmanOrderDao.selectCount(queryWrapper); + if(orderCount==0){ + ShopSalesmanOrder salesmanOrder=new ShopSalesmanOrder(); + salesmanOrder.setCompanyId(order.getCompanyId()); + salesmanOrder.setCreateBy(MatrixConstance.SYSTEM_USER); + salesmanOrder.setUpdateBy(MatrixConstance.SYSTEM_USER); + salesmanOrder.setCreateTime(new Date()); + salesmanOrder.setUpdateTime(new Date()); + salesmanOrder.setOrderId(Long.parseLong(order.getId()+"")); + salesmanOrder.setUserId(order.getUserId()); + salesmanOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_SALES); + salesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_DJS); + Double selfAmount=0D; + Double zk=1D; + //分销订单总额 + Double orderTotal=0D; + for (ShopOrderDetails item:order.getDetails() ){ + if(item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + orderTotal+=item.getTotalPrice().doubleValue(); + } + } + //自购返佣 + Integer isSales = sysVipInfo.getIsSales(); + if(SysVipInfo.IS_SALES == isSales){ + for (ShopOrderDetails item:order.getDetails() ){ + if(item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + //分销规则是否开启自购返佣 + BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, sysVipInfo.getCompanyId()); + //按分销等级计算 + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); + if(ObjectUtil.isNotEmpty(zgfy)) { + //获取商品的自购返佣价格,如果没有设置,在去获取当前推广人的等级的自购返佣比例 + if(StrUtil.isNotEmpty(zgfy.getParamValue()) && + FenxiaoSettingConstant.FX_ZGFY_YES.equals(zgfy.getParamValue())) { + if(item.getShopSku().getSelfPrice() == null + ||item.getShopSku().getSealesPrice().doubleValue() == 0){ + selfAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSelfCommission()/100); + }else { + //按产品设置的自购返佣金额计算 + selfAmount+=item.getShopSku().getSelfPrice().doubleValue()*item.getCount(); + } + } + } + } + } + //自购返佣记录 + if(selfAmount > 0) { + //整体的优惠金额折算成折扣,* 佣金 + zk=order.getOrderMoney().doubleValue()/orderTotal; + selfAmount=selfAmount*zk; + salesmanOrder.setAmount(selfAmount); + salesmanOrder.setSalesUserId(order.getUserId()); + shopSalesmanOrderDao.insert(salesmanOrder); + } + } + + //存在上级 + if(sysVipInfo.getRecommendId()!=null) { + SysVipInfo salesMan=sysVipInfoService.findById(sysVipInfo.getRecommendId()); + Double salesAmount=0D; + Double invitationAmount=0D; + SysVipInfo invitationMan=null; + ShopSalesmanOrder invitationOrder=null; + boolean hasInvitationMan=salesMan.getRecommendId()!=null; + //判断推广员是否还存在上级,存在则计算邀请收益 + if(hasInvitationMan){ + invitationMan=sysVipInfoService.findById(salesMan.getRecommendId()); + invitationOrder=new ShopSalesmanOrder(); + BeanUtils.copyProperties(salesmanOrder,invitationOrder); + invitationOrder.setSalesUserId(invitationMan.getId()); + invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION); + } + //收益计算 + for (ShopOrderDetails item:order.getDetails() ){ + if(item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + //按分销等级计算 + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(salesMan.getSalesmanGrade()); + //推广提成,按分销等级计算或者按产品设置的推广金额计算 + if(item.getShopSku().getSealesPrice()==null + ||item.getShopSku().getSealesPrice().doubleValue()==0){ + salesAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSealesCommission()/100); + }else{ + salesAmount+=item.getShopSku().getSealesPrice().doubleValue()*item.getCount(); + } + //邀请提成,获取商品的邀请提成价格和是否有上级推广人,如果没有设置,在去获取当前推广人的等级的自购返佣比例 + if(hasInvitationMan) { + if(item.getShopSku().getInvitationPrice() == null + ||item.getShopSku().getInvitationPrice().doubleValue() == 0){ + //获取上级的推广等级设置 + ShopSalesmanGrade invitationManGrade = shopSalesmanGradeDao.selectById(invitationMan.getSalesmanGrade()); + invitationAmount+=item.getTotalPrice().doubleValue()*(invitationManGrade.getInvitationCommission()/100); + }else { + //按产品设置的邀请提成价格计算 + invitationAmount+=item.getShopSku().getInvitationPrice().doubleValue()*item.getCount(); + } + } + } + } + //推广提成记录 + if(salesAmount>0){ + //整体的优惠金额折算成折扣,* 佣金 + zk=order.getOrderMoney().doubleValue()/orderTotal; + salesAmount=salesAmount*zk; + salesmanOrder.setAmount(salesAmount); + salesmanOrder.setSalesUserId(sysVipInfo.getRecommendId()); + shopSalesmanOrderDao.insert(salesmanOrder); + } + //邀请提成记录 + if(invitationAmount > 0) { + //整体的优惠金额折算成折扣,* 佣金 + invitationAmount=invitationAmount*zk; + invitationOrder.setAmount(invitationAmount); + shopSalesmanOrderDao.insert(invitationOrder); + } + }else{ + LogUtil.debug("不存在父级userOpid={}",sysVipInfo.getOpenId()); + } + }else{ + LogUtil.debug("重复订单id={}",order.getId()); + } + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java new file mode 100644 index 0000000..41ead5a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java @@ -0,0 +1,153 @@ +package com.matrix.system.shopXcx.mqTask; + + +import com.matrix.component.asyncmessage.MessageHandler; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.bean.ShopOrderDetails; +import com.matrix.system.shopXcx.dao.ShopOrderDao; +import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; +import com.rabbitmq.client.DeliverCallback; +import com.rabbitmq.client.Delivery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +/** + * 订单创建积分事件处理 + */ +@Component +public class ScoreOrderTask implements MessageHandler { + + + @Autowired + ShopOrderDao shopOrderDao; + @Autowired + ShopOrderDetailsDao shopOrderDetailsDao; + + @Autowired + SysVipInfoService sysVipInfoService; + + + @Autowired + ScoreVipDetailService scoreVipDetailService; + + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + SysVipInfoDao sysVipInfoDao; + + @Override + public String getName() { + return "订单创建积分事件"; + } + + @Override + public String getRouteKey() { + return AsyncMessageRouting.CREATE_ORDER; + } + + @Override + public void handle(Map<String,Object> param) { + + String orderId = (String) param.get("orderId"); + LogUtil.debug("收到订单积分任务orderId={}", orderId); + //获取订单信息 + ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId)); + //获取订单详情 + List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); + order.setDetails(orderDetails); + //扣除积分 + if (order.getScorePay() != null && order.getScorePay() > 0) { + scoreVipDetailService.deductionScore(order.getUserId(), null, + Long.parseLong(order.getStoreId() + ""), order.getScorePay(), + Long.parseLong(order.getId() + ""), ScoreVipDetail.SCORE_VIP_TYPE_CASH, "商城积分抵扣"); + } else { + + //消费获得积分 + int addScore = 0; + BusParameterSettings cashConsumptionShop = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, order.getCompanyId()); + for (ShopOrderDetails shopOrderDetail : orderDetails) { + if (shopOrderDetail.getPayType() == ShopOrderDetails.PAYTYPE_MICRO) { + Integer xfkdScore = shopOrderDetail.getShopSku().getScore(); + if (xfkdScore != null && xfkdScore > 0) { + addScore += xfkdScore; + } else { + if (StringUtils.isNotBlank(cashConsumptionShop.getParamValue())) { + addScore += shopOrderDetail.getTotalPrice().divide(new BigDecimal(cashConsumptionShop.getParamValue())).intValue(); + } + } + } + } + if (addScore > 0) { + //插入新的积分 + scoreVipDetailService.addScore( + order.getUserId(), + null, + Long.parseLong(order.getStoreId() + ""), + addScore, + Long.parseLong(orderId + ""), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "微商城消费"); + + //插入上级积分 + SysVipInfo vipInfo = sysVipInfoService.findById(order.getUserId()); + + + if (vipInfo.getRecommendId() != null) { + //推荐注册老带新积分奖励 + SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); + if (StringUtils.isNotBlank(cashConsumptionShop.getParamValue1())) { + + int parentScore = order.getOrderMoney().divide(new BigDecimal(cashConsumptionShop.getParamValue1())).intValue(); + if (parentScore > 0) { + scoreVipDetailService.addScore( + referrerVip.getId(), + null, + Long.parseLong(order.getStoreId() + ""), + parentScore, + Long.parseLong(order.getId() + ""), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "推荐消费奖励" + ); + } + } + + //推荐注册二级带新积分奖励 + if (referrerVip.getRecommendId() != null && StringUtils.isNotBlank(cashConsumptionShop.getParamValue2())) { + SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); + int topParentScore = order.getOrderMoney().divide(new BigDecimal(cashConsumptionShop.getParamValue2())).intValue(); + if (topParentScore > 0) { + scoreVipDetailService.addScore( + topVipInfo.getId(), + null, + Long.parseLong(order.getStoreId() + ""), + topParentScore, + Long.parseLong(order.getId() + ""), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "推荐消费奖励" + ); + } + } + } + } + } + + + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/TemplateMsgTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/TemplateMsgTask.java index eeda3e1..1d1c80d 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/TemplateMsgTask.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/TemplateMsgTask.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSONObject; +import com.matrix.component.asyncmessage.MessageHandler; import com.matrix.system.hive.dao.OnlinebookingDao; import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.system.shopXcx.dao.ShopProductDao; @@ -13,11 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired; import java.io.IOException; +import java.util.Map; /** * 发送预约成功提醒消息 */ -public class TemplateMsgTask implements DeliverCallback { +public class TemplateMsgTask implements MessageHandler { @Autowired OnlinebookingDao onlinebookingDao; @@ -34,12 +36,20 @@ @Override - public void handle(String consumerTag, Delivery message) throws IOException { + public String getName() { + return "发送预约成功提醒消息"; + } - String msg = new String(message.getBody(), "UTF-8"); - JSONObject object = JSONObject.parseObject(msg); - Integer templateMsgType = (Integer) object.get("templateMsgType"); - String content = object.get("content") + ""; + @Override + public String getRouteKey() { + return AsyncMessageRouting.ORDER_OUT_SOTORE; + } + + @Override + public void handle(Map<String,Object> param){ + + Integer templateMsgType = (Integer) param.get("templateMsgType"); + String content = param.get("content") + ""; if (TemplateMsgType.APPOINTMENT_SUCCESS.getCode().equals(templateMsgType)) { appointmentSuccess.sendTemplateMsg(content); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java deleted file mode 100644 index 5d59638..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.matrix.system.shopXcx.mqTask; - - -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.service.BizUserService; -import com.matrix.component.rabbitmq.MqTask; -import com.matrix.core.tools.LogUtil; -import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.SysShopInfo; -import com.matrix.system.hive.bean.SysVipInfo; -import com.matrix.system.hive.dao.SysShopInfoDao; -import com.matrix.system.hive.dao.SysVipInfoDao; -import com.matrix.system.hive.plugin.util.CollectionUtils; -import com.rabbitmq.client.DeliverCallback; -import com.rabbitmq.client.Delivery; -import org.springframework.beans.factory.annotation.Autowired; - -import java.io.IOException; -import java.util.List; - -public class VipCreateTask implements DeliverCallback { - - @Autowired - BizUserService bizUserService; - - @Autowired - SysShopInfoDao shopInfoDao; - - @Autowired - private SysVipInfoDao vipDap; - - //TODO 用户可以都归属一个电商店铺,发货的时候指定仓库出货,微商城的产品可以绑定仓库库存 - - @Override - public void handle(String consumerTag, Delivery message) throws IOException { - try { - String messages = new String(message.getBody(), "UTF-8"); - - String userId=messages.split(",")[0]; - Long shopId=Long.parseLong(messages.split(",")[1]); - - BizUser userInfo = bizUserService.findByOpenId(userId); - - // TODO 校验用户是否已存在 , 公司id不能写死 - SysVipInfo vip = vipDap.selectByPhone(userInfo.getPhoneNumber()); - if (vip != null) { - LogUtil.warn("会员{}已经存在", userInfo.getPhoneNumber()); - } else { - SysVipInfo vipInfo = new SysVipInfo(); - //在备注记下微商城的用户id - vipInfo.setRemark(userInfo.getOpenId()); - vipInfo.setAddr(userInfo.getProvince() + " " + userInfo.getCity()); - vipInfo.setPhone(userInfo.getPhoneNumber()); - if (userInfo.getGender() != null) { - vipInfo.setSex(userInfo.getGender().equals("1") ? "男" : "女"); - } - vipInfo.setVipName(userInfo.getNickName()); - vipInfo.setShopId(shopId); - vipInfo.setArrivalWay("微商城"); - vipInfo.setVipState(Dictionary.VIP_STATE_HY); - vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); - vipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); - vipDap.insert(vipInfo); - } - } catch (Exception e) { - LogUtil.error("消费者执行异常", e); - } - - } -} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/templateMsg/AppointmentSuccess.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/templateMsg/AppointmentSuccess.java index 69ae1e6..3dbd6f4 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/templateMsg/AppointmentSuccess.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/templateMsg/AppointmentSuccess.java @@ -48,7 +48,7 @@ SysShopInfo shopInfo = shopInfoDao.selectById(onlinebooking.getShopId()); //获取模板id - ShopWxtemplateMsg wxtemplateMsg = wxtemplateMsgDao.selectByCode(TemplateMsgType.APPOINTMENT_SUCCESS.getCode()); + ShopWxtemplateMsg wxtemplateMsg = wxtemplateMsgDao.selectByCode(TemplateMsgType.APPOINTMENT_SUCCESS.getCode(), 17L); String page = "pages/yuyue/yyInfo?id=" + orderId + "&model=1"; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/pojo/ShopOrderQueryPOJO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/pojo/ShopOrderQueryPOJO.java index 83cdfcd..db93b0b 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/pojo/ShopOrderQueryPOJO.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/pojo/ShopOrderQueryPOJO.java @@ -19,6 +19,10 @@ * 开始时间 */ private String orderBeginTime; + /** + * 开始时间 + */ + private String orderTime; /** * 结束时间 diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityGroupJoinTimeOutQuartz.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityGroupJoinTimeOutQuartz.java index 07927b5..fd0d99e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityGroupJoinTimeOutQuartz.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityGroupJoinTimeOutQuartz.java @@ -1,19 +1,14 @@ package com.matrix.system.shopXcx.quartz; import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.WebUtil; - import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.shopXcx.bean.ShopActivities; import com.matrix.system.shopXcx.bean.ShopActivitiesGroupInfo; import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; import com.matrix.system.shopXcx.dao.ShopActivitiesDao; import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinDao; - import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import java.util.List; @@ -24,7 +19,6 @@ * @author wzy */ @Configuration -@EnableScheduling public class ShopActivityGroupJoinTimeOutQuartz { @Autowired @@ -33,13 +27,11 @@ @Autowired private ShopActivitiesDao shopActivitiesDao ; - @Value("${scheduling.enabled}") - private boolean taskSwitch; + @Scheduled(cron = "0 */1 * * * ?") public boolean executeExt() { - if (taskSwitch) { LogUtil.info("#开团时间超时任务处理#"); List<ShopActivitiesGroupJoin> groupJoins = shopActivitiesGroupJoinDao.selectGroupJoinWithEnd(); ShopActivityTimeOutQuartz timeOutQuartz = new ShopActivityTimeOutQuartz(); @@ -53,7 +45,6 @@ timeOutQuartz.doUnVirtualGroup(groupJoin); } } - } } return true; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityPayTimeOutQuartz.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityPayTimeOutQuartz.java index 143a2d2..3f85cd5 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityPayTimeOutQuartz.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityPayTimeOutQuartz.java @@ -1,7 +1,6 @@ package com.matrix.system.shopXcx.quartz; import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.WebUtil; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoinUser; @@ -9,11 +8,8 @@ import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinDao; import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinUserDao; import com.matrix.system.shopXcx.dao.ShopOrderDao; - import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import java.util.List; @@ -24,7 +20,6 @@ * @author wzy */ @Configuration -@EnableScheduling public class ShopActivityPayTimeOutQuartz { @Autowired @@ -36,13 +31,11 @@ @Autowired private ShopActivitiesGroupJoinDao shopActivitiesGroupJoinDao; - @Value("${scheduling.enabled}") - private boolean taskSwitch; @Scheduled(cron = "0 */1 * * * ?") public void executeExt() { - if (taskSwitch) { + LogUtil.info("#拼团支付超时处理任务#"); List<ShopActivitiesGroupJoinUser> joinUserList = shopActivitiesGroupJoinUserDao.selectGroupJoinUserEnd(); if (CollectionUtils.isNotEmpty(joinUserList)) { @@ -63,7 +56,7 @@ shopOrder.setOrderStatus(ShopOrder.ORDER_STATUS_CANCEL); shopOrderDao.updateByModel(shopOrder); } - } + } } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java index ae48bc2..865fb65 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java @@ -1,19 +1,17 @@ package com.matrix.system.shopXcx.quartz; import com.matrix.component.tools.WxUtils; +import com.matrix.core.constance.MatrixConstance; import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.WebUtil; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; import com.matrix.system.shopXcx.bean.*; import com.matrix.system.shopXcx.dao.*; - import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; @@ -25,7 +23,6 @@ * @author wzy */ @Configuration -@EnableScheduling public class ShopActivityTimeOutQuartz { @Autowired @@ -41,13 +38,11 @@ @Autowired private ShopActivitiesGroupJoinUserDao shopActivitiesGroupJoinUserDao; - @Value("${scheduling.enabled}") - private boolean taskSwitch; @Scheduled(cron = "0 */1 * * * ?") public void executeExt() { - if (taskSwitch) { + LogUtil.info("#拼团活动自动结束任务#"); List<ShopActivities> actList = shopActivitiesDao.selectShopActivitiesHasEnd(); if (CollectionUtils.isNotEmpty(actList)) { @@ -66,7 +61,7 @@ } } } - } + } /** @@ -104,6 +99,7 @@ * * @param groupJoin */ + @Transactional public void doUnVirtualGroup(ShopActivitiesGroupJoin groupJoin) { LogUtil.info("#非虚拟拼团逻辑处理#"); groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_FAIL); @@ -121,8 +117,8 @@ if (joinUser.getIsHasPay() == ShopActivitiesGroupJoinUser.IS_HAS_PAY_Y) { LogUtil.info("#已付款退款逻辑#"); ShopRefundRecord refundRecord = new ShopRefundRecord(); - refundRecord.setCreateBy(joinUser.getUserId()); - refundRecord.setUpdateBy(joinUser.getUserId()); + refundRecord.setCreateBy(MatrixConstance.SYSTEM_USER); + refundRecord.setUpdateBy(MatrixConstance.SYSTEM_USER); refundRecord.setUserId(joinUser.getUserId()); refundRecord.setRefundNo(WxUtils.getOrderNum()); refundRecord.setOrderId(joinUser.getOrderId().intValue()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopAutomaticReceiveQuartz.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopAutomaticReceiveQuartz.java index bcf6a1a..a842add 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopAutomaticReceiveQuartz.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopAutomaticReceiveQuartz.java @@ -1,18 +1,15 @@ package com.matrix.system.shopXcx.quartz; import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.WebUtil; import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; import com.matrix.system.shopXcx.bean.ShopOrder; import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; import com.matrix.system.shopXcx.dao.ShopOrderDao; import org.apache.commons.collections.CollectionUtils; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import java.util.HashMap; @@ -24,11 +21,7 @@ * 15天自动确认收货定时任务 */ @Configuration -@EnableScheduling public class ShopAutomaticReceiveQuartz { - - @Value("${scheduling.enabled}") - private boolean taskSwitch; @Autowired private ShopDeliveryInfoDao shopDeliveryInfoDao; @@ -41,9 +34,9 @@ @Scheduled(cron = "0/30 * * * * ?") public void executeExt() { - if(taskSwitch) { + LogUtil.info("#15天自动收货任务处理#"); List<ShopDeliveryInfo> shopDeliveryInfos = shopDeliveryInfoDao.selectAutomaticReceive(); int flag = 0; @@ -59,7 +52,7 @@ } } LogUtil.info("自动确认收货更新条数:" + flag); - } + } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopCouponQuartz.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopCouponQuartz.java index 25e4314..22dac6b 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopCouponQuartz.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopCouponQuartz.java @@ -1,13 +1,9 @@ package com.matrix.system.shopXcx.quartz; import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.WebUtil; import com.matrix.system.shopXcx.dao.ShopCouponDao; - import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; /** @@ -15,24 +11,18 @@ * 优惠券定时任务 */ @Configuration -@EnableScheduling public class ShopCouponQuartz { - @Value("${scheduling.enabled}") - private boolean taskSwitch; @Autowired private ShopCouponDao shopCouponDao; @Scheduled(cron = "0 */1 * * * ?") public void executeExt() { - if(taskSwitch){ - int i = shopCouponDao.updateAllCouponStatus(); - LogUtil.info("优惠券状态更新条数:" + i); - } - + int i = shopCouponDao.updateAllCouponStatus(); + LogUtil.info("优惠券状态更新条数:" + i); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/LogisticsImportVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/LogisticsImportVo.java new file mode 100644 index 0000000..5630c47 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/LogisticsImportVo.java @@ -0,0 +1,20 @@ +package com.matrix.system.shopXcx.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "LogisticsImportVo", description = "信息返回类") +public class LogisticsImportVo { + @ApiModelProperty(value = "订单号") + private String orderNo; + @ApiModelProperty(value = "快递公司编码") + private String logisticsCompanyCode; + @ApiModelProperty(value = "快递公司名称") + private String logisticsCompany; + @ApiModelProperty(value = "快递单号") + private String waybillNo; + @ApiModelProperty(value = "失败原因") + private String failReason; +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java new file mode 100644 index 0000000..69de0e7 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java @@ -0,0 +1,47 @@ +package com.matrix.system.shopXcx.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.Date; + +@Data +@ApiModel(value = "SalesOrderVo", description = " 推广订单信息返回类") +public class SalesOrderVo { + + + @ApiModelProperty(value = "订单id") + private Long orderId ; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + @ApiModelProperty(value = "昵称") + private String nickName; + + @ApiModelProperty(value = "头像") + private String avatarUrl; + + @ApiModelProperty(value = "订单编号") + private String orderNo; + + @ApiModelProperty(value = "收益金额") + private Double amount; + + @ApiModelProperty(value = "订单金额") + private Double orderMoney; + + + @ApiModelProperty(value = " 收益类型1,推广收益,2邀请收益") + private Integer revenueType; + + @ApiModelProperty(value = " 结算状态1,待结算,2,已结算,3已退款") + private Integer orderStatus; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanApplyCondition.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanApplyCondition.java new file mode 100644 index 0000000..6444d14 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanApplyCondition.java @@ -0,0 +1,35 @@ +package com.matrix.system.shopXcx.vo; + +import com.matrix.system.shopXcx.bean.ShopProduct; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel(value = "SalesmanApplyCondition", description = " 销售员申请条件") +public class SalesmanApplyCondition { + + @ApiModelProperty(value = "是否满足申请条件") + private Boolean isAbleApply; + + + + @ApiModelProperty(value = "申请条件") + private String condition; + + @ApiModelProperty(value = "条件验证结果") + private String msg; + + + @ApiModelProperty(value = "产品信息") + private List<ShopProduct> productList; + + + @ApiModelProperty(value = "最底消费金额") + private Double minAmount ; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanCenterInfo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanCenterInfo.java new file mode 100644 index 0000000..7d41aee --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanCenterInfo.java @@ -0,0 +1,45 @@ +package com.matrix.system.shopXcx.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SalesmanCenterInfo", description = " 销售员中心返回参数") +public class SalesmanCenterInfo { + + @ApiModelProperty(value = "累计收益") + private String totalRevenue; + + + @ApiModelProperty(value = "分销佣金") + private String salesRevenue; + + @ApiModelProperty(value = "邀请奖励") + private String invitationRevenue; + + + + @ApiModelProperty(value = "待结算收益") + private String djsRevenue; + + + @ApiModelProperty(value = "可提现金额") + private String withdrawalCash; + + + @ApiModelProperty(value = "邀请订单数") + private String invitationOrderCount; + + @ApiModelProperty(value = "推广订单数") + private String salesorderCount; + + + @ApiModelProperty(value = "客户数") + private Double customerCount; + + @ApiModelProperty(value = "邀请下级数") + private Double invitationCount; + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java new file mode 100644 index 0000000..02d7fbb --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java @@ -0,0 +1,31 @@ +package com.matrix.system.shopXcx.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "SalesmanVo", description = " 销售员信息返回参数类") +public class SalesmanVo { + + @ApiModelProperty(value = "昵称") + private String nickName; + + + @ApiModelProperty(value = "头像") + private String avatarUrl; + + + @ApiModelProperty(value = "手机号码") + private String phone; + + @ApiModelProperty(value = "贡献订单数") + private String orderCount; + + + @ApiModelProperty(value = "贡献收益") + private Double revenueAmount; + + + +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/GzhTemplateMessagePojo.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/GzhTemplateMessagePojo.java new file mode 100644 index 0000000..d6c6517 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/GzhTemplateMessagePojo.java @@ -0,0 +1,134 @@ +package com.matrix.system.wechart.templateMsg; + +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.utils.HttpsUtils; +import org.apache.commons.collections.map.HashedMap; + +import java.util.Map; + +/** + * 公众号模板消息对象 + */ +public class GzhTemplateMessagePojo { + + private String appid; + private String touser; + private String template_id; + private String url; + private Miniprogram miniprogram; + public static class Miniprogram{ + private String appid; + private String pagepath; + + public Miniprogram(String appid, String pagepath) { + this.appid = appid; + this.pagepath = pagepath; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getPagepath() { + return pagepath; + } + + public void setPagepath(String pagepath) { + this.pagepath = pagepath; + } + } + public Map<String ,Item> data=new HashedMap(); + public static class Item{ + private String value; + private String color; + + public Item(String value, String color) { + this.value = value; + this.color = color; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + } + + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public void setMiniprogram(String appid, String url){ + this.setMiniprogram(new Miniprogram(appid,url)); + } + public void setFirst(String value, String color){ + this.data.put("first",new Item(value,color)); + } + + public void setKeyWord(String value, String color){ + this.data.put("keyword"+(this.data.size()),new Item(value,color)); + } + public void setRemark(String value, String color){ + this.data.put("remark",new Item(value,color)); + } + + public Miniprogram getMiniprogram() { + return miniprogram; + } + + public void setMiniprogram(Miniprogram miniprogram) { + this.miniprogram = miniprogram; + } + + public Map<String, Item> getData() { + return data; + } + + public void setData(Map<String, Item> data) { + this.data = data; + } + + public String getTouser() { + return touser; + } + + public void setTouser(String touser) { + this.touser = touser; + } + + public String getTemplate_id() { + return template_id; + } + + public void setTemplate_id(String template_id) { + this.template_id = template_id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/TemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/TemplateMessageBulder.java new file mode 100644 index 0000000..4c0bafa --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/TemplateMessageBulder.java @@ -0,0 +1,19 @@ +package com.matrix.system.wechart.templateMsg.Task; + +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; + +import java.util.Map; + +/** + * 动态构建消息主体内容 + * @author jyy + * + */ +public interface TemplateMessageBulder { + /** + * * 返回的map中 如果包含错误消息用error属性来表示 + * @param param + * @return + */ + Map buildMsg(Map param); +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java new file mode 100644 index 0000000..9680fbb --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java @@ -0,0 +1,111 @@ +package com.matrix.system.wechart.templateMsg.Task; + + +import com.alibaba.fastjson.JSONObject; +import com.matrix.component.asyncmessage.MessageHandler; +import com.matrix.component.tools.HttpClientUtil; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.rr.GlueFactory; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.shopXcx.api.WeChatGzhApiTools; +import com.matrix.system.shopXcx.bean.ShopWxtemplateMsg; +import com.matrix.system.shopXcx.dao.ShopWxtemplateMsgDao; +import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 小程序统一消息模板消息发送提醒 + * @author jyy + */ +@Component +public class UniformMsgSentTask implements MessageHandler { + + @Autowired + private ShopWxtemplateMsgDao shopWxtemplateMsgDao; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + @Override + public String getName() { + return "小程序统一消息模板消息发送提醒"; + } + + @Override + public String getRouteKey() { + return AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG; + } + + /** + * 发送模板消息需要传JSONO字符串作为格式 + * 例如:{"companyId":17} + * companyId 是必须属性 + * @throws IOException + */ + @Override + public void handle(Map<String,Object> param){ + try { + + + if(!param.containsKey("companyId")||(!param.containsKey("templateCode"))){ + LogUtil.error("小程序消息推送参数格式异常发送模板消息需要传JSONO字符串作为格式 例如:{\"companyId\":17,\"templateCode\":10000} companyId 、templateCode 是必须属性"); + return; + } + Long companyId = Long.parseLong( param.get("companyId").toString()); + Integer templateCode = Integer.parseInt( param.get("templateCode").toString()); + + //获取公司微信配置参数 + BusParameterSettings xcxAppId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); + BusParameterSettings xcxSecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_SECRET, companyId); + BusParameterSettings gzhAppid = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.GZH_APPID, companyId); + //获取消息模板 + ShopWxtemplateMsg template = shopWxtemplateMsgDao.selectByCode(templateCode,companyId); + //校验参数 + if(xcxAppId==null||xcxSecret==null||gzhAppid==null||template==null){ + LogUtil.error("小程序消息推送配置缺失xcxAppId="+xcxAppId+";xcxSecret="+xcxSecret+";gzhAppid="+gzhAppid+";template="+template); + return; + } + //获取模板动态构建类 + TemplateMessageBulder templateMessageBulder = (TemplateMessageBulder) GlueFactory.getInstance().loadInstance(template.getTemplateClass()); + //为模板动态类装备必要的参数 + Map<String, Object> bulderParam = new HashedMap(); + bulderParam.put("xcxAppId", xcxAppId.getParamValue()); + bulderParam.put("gzhAppid", gzhAppid.getParamValue()); + bulderParam.put("template_id", template.getUuid()); + bulderParam.put("messageJsonParam", param); + //调用模板计算出消息体 + Map msgResult = templateMessageBulder.buildMsg(bulderParam); + + if(msgResult.containsKey("error")){ + //错误消息处理 + LogUtil.error("模板消息发送内容:"+msgResult.get("error")); + return; + }else{ + //正常返回消息 + List msgList = (List) msgResult.get("msgList"); + //获取acceToken + String ACCESS_TOKEN = WeChatGzhApiTools.getAccessToken(xcxAppId.getParamValue(), xcxSecret.getParamValue()); + String url = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN".replaceAll("ACCESS_TOKEN", ACCESS_TOKEN); + for (Object msg : msgList) { + UniformMsgPojo uniformMsgPojo = (UniformMsgPojo) msg; + LogUtil.debug("微信小程序模板消息推送:" + JSONObject.toJSON(uniformMsgPojo).toString()); + //推送消息到微信 + JSONObject result = HttpClientUtil.sendPostWithJson(url, JSONObject.toJSON(uniformMsgPojo).toString()); + //微信返回值 + LogUtil.debug("微信小程序模板消息推送结果:" + result.toString()); + } + } + } catch (Exception e) { + LogUtil.error("消费者执行异常", e); + } + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/CzcgTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/CzcgTemplateMessageBulder.java new file mode 100644 index 0000000..44428c8 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/CzcgTemplateMessageBulder.java @@ -0,0 +1,110 @@ +package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.SysOrder; +import com.matrix.system.hive.bean.SysOrderItem; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.*; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.Task.TemplateMessageBulder; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 充值成功提醒 + */ +@Component +public class CzcgTemplateMessageBulder implements TemplateMessageBulder { + + @Autowired + SysOrderDao orderDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + @Autowired + private SysShopInfoDao shopInfoDao; + + @Autowired + private SysOrderItemDao orderItemDao; + + + + @Override + public Map buildMsg(Map param) { + + //返回参数 + Map builParam=new HashedMap(); + //获取基础公共参数 + String gzhAppid= (String) param.get("gzhAppid"); + String template_id= (String) param.get("template_id"); + String xcxAppId= (String) param.get("xcxAppId"); + //模板消息列表 + List msgList=new ArrayList(); + + //触发点传送的json参数 + JSONObject messageJsonParam= (JSONObject) param.get("messageJsonParam"); + //构建消息主体 + Long orderId= (Long) messageJsonParam.get("orderId"); + SysOrder sysOrder = orderDao.selectById(orderId); + List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(orderId); + + //校验客户openId (必须) + SysVipInfo vipInfo=vipInfoDao.selectById(sysOrder.getVipId()); + String touser= vipInfo.getOpenId(); + if(StringUtils.isBlank(touser)){ + builParam.put("error","未获取到"+vipInfo.getVipName()+"用户小程序openid"); + return builParam; + } + + + //自定义信息区START========================================================================================================= + SysShopInfo sysShopInfo = shopInfoDao.selectById(sysOrder.getShopId()); + String time= DateUtil.dateFormatStr(sysOrder.getPayTime(),DateUtil.DATE_FORMAT_MM); + + //如果一个项目存在多个护理项目则发送多次消息 + String first="您好!充值余额成功"; + for (SysOrderItem orderItem:sysOrderItems){ + first+=orderItem.getShoppingGoods().getName()+"x"+orderItem.getCount()+","; + } + first=first.substring(0,first.length()); + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser(touser); + messagePojo.setTemplate_id(template_id); + messagePojo.setAppid(gzhAppid); + //个性参数设置 + messagePojo.setFirst(first,"#453454"); + messagePojo.setKeyWord(sysShopInfo.getShopName(),"#453454"); + messagePojo.setKeyWord(vipInfo.getVipNo(),"#453454"); + messagePojo.setKeyWord(time,"#453454"); + messagePojo.setKeyWord(sysOrder.getZkTotal()+"","#453454"); + messagePojo.setRemark("点击【详情】可查询订单明细,若非本人或授权操作,请及时与门店联系","#453454"); + + //小程序配置 + GzhTemplateMessagePojo.Miniprogram miniprogram=new GzhTemplateMessagePojo.Miniprogram(xcxAppId, + "pages/purchaseRecords/detail?id="+orderId); + messagePojo.setMiniprogram(miniprogram); + + + uniformMsgPojo.setMp_template_msg(messagePojo); + //自定义信息区END========================================================================================================= + + //返回调用者使用的参数(必须) + msgList.add(uniformMsgPojo); + builParam.put("msgList",msgList); + return builParam; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DdqxTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DdqxTemplateMessageBulder.java new file mode 100644 index 0000000..03efc5b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DdqxTemplateMessageBulder.java @@ -0,0 +1,110 @@ +package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.SysOrder; +import com.matrix.system.hive.bean.SysOrderItem; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.*; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.Task.TemplateMessageBulder; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 订单取消提醒 + */ +@Component +public class DdqxTemplateMessageBulder implements TemplateMessageBulder { + + @Autowired + SysOrderDao orderDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + @Autowired + private SysShopInfoDao shopInfoDao; + + @Autowired + private SysOrderItemDao orderItemDao; + + + + @Override + public Map buildMsg(Map param) { + + //返回参数 + Map builParam=new HashedMap(); + //获取基础公共参数 + String gzhAppid= (String) param.get("gzhAppid"); + String template_id= (String) param.get("template_id"); + String xcxAppId= (String) param.get("xcxAppId"); + //模板消息列表 + List msgList=new ArrayList(); + + //触发点传送的json参数 + JSONObject messageJsonParam= (JSONObject) param.get("messageJsonParam"); + //构建消息主体 + Long orderId= (Long) messageJsonParam.get("orderId"); + SysOrder sysOrder = orderDao.selectById(orderId); + List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(orderId); + + //校验客户openId (必须) + SysVipInfo vipInfo=vipInfoDao.selectById(sysOrder.getVipId()); + String touser= vipInfo.getOpenId(); + if(StringUtils.isBlank(touser)){ + builParam.put("error","未获取到"+vipInfo.getVipName()+"用户小程序openid"); + return builParam; + } + + + //自定义信息区START========================================================================================================= + SysShopInfo sysShopInfo = shopInfoDao.selectById(sysOrder.getShopId()); + String time= DateUtil.dateFormatStr(sysOrder.getPayTime(),DateUtil.DATE_FORMAT_MM); + + //如果一个项目存在多个护理项目则发送多次消息 + String first="您好!您的订单已取消!"; + String goodsName=""; + for (SysOrderItem orderItem:sysOrderItems){ + goodsName+=orderItem.getShoppingGoods().getName()+"x"+orderItem.getCount()+","; + } + goodsName=goodsName.substring(0,first.length()); + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser(touser); + messagePojo.setTemplate_id(template_id); + messagePojo.setAppid(gzhAppid); + //个性参数设置 + messagePojo.setFirst(first,"#453454"); + messagePojo.setKeyWord(sysOrder.getOrderNo(),"#453454"); + messagePojo.setKeyWord(goodsName,"#453454"); + messagePojo.setKeyWord(time,"#453454"); + messagePojo.setRemark("如有需要,请重新下单 ,点击【详情】可查询订单明细,若非本人或授权操作,请及时与门店联系","#453454"); + + //小程序配置 + GzhTemplateMessagePojo.Miniprogram miniprogram=new GzhTemplateMessagePojo.Miniprogram(xcxAppId, + "pages/purchaseRecords/detail?id="+orderId); + messagePojo.setMiniprogram(miniprogram); + + + uniformMsgPojo.setMp_template_msg(messagePojo); + //自定义信息区END========================================================================================================= + + //返回调用者使用的参数(必须) + msgList.add(uniformMsgPojo); + builParam.put("msgList",msgList); + return builParam; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java new file mode 100644 index 0000000..acc9a64 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java @@ -0,0 +1,99 @@ +package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysBeauticianStateDao; +import com.matrix.system.hive.dao.SysProjServicesDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.Task.TemplateMessageBulder; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import io.swagger.models.auth.In; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 某个公司客户的定制消息模板 + */ +@Component +public class DefaultTemplateMessageBulder implements TemplateMessageBulder { + + @Autowired + SysProjServicesDao projServicesDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + + + @Override + public Map buildMsg(Map param) { + + //返回参数 + Map builParam=new HashedMap(); + + + //获取基础公共参数 + String gzhAppid= (String) param.get("gzhAppid"); + String template_id= (String) param.get("template_id"); + //触发点传送的json参数 + JSONObject messageJsonParam= (JSONObject) param.get("messageJsonParam"); + + Long serviceId= (Long) messageJsonParam.get("serviceId"); + + + //构建消息主体 + SysProjServices sysProjServices = projServicesDao.selectById(serviceId); + + + //补充服务单扩展信息=============== + List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(sysProjServices.getId()); + + SysVipInfo vipInfo=vipInfoDao.selectById(sysProjServices.getVipId()); + String touser= vipInfo.getOpenId(); + if(StringUtils.isBlank(touser)){ + builParam.put("error","未获取到"+vipInfo.getVipName()+"用户小程序openid"); + return builParam; + } + + String time= DateUtil.dateFormatStr(sysProjServices.getConsumeTime(),DateUtil.DATE_FORMAT_MM); + List msgList=new ArrayList(); + //如果一个项目存在多个护理项目则发送多次消息 + for (SysBeauticianState beauticianState:beauticianStateList){ + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser(touser); + messagePojo.setTemplate_id(template_id); + messagePojo.setAppid(gzhAppid); + + + //个性参数设置 + Integer suplerTimes= beauticianState.getProjUse().getSurplusCount(); + messagePojo.setFirst("尊敬的:"+vipInfo.getVipName(),"#453454"); + messagePojo.setKeyWord(beauticianState.getProjInfo().getName(),"#453454"); + messagePojo.setKeyWord(time,"#453454"); + messagePojo.setRemark("您的护理项目剩余"+suplerTimes+"次。","#453454"); + uniformMsgPojo.setMp_template_msg(messagePojo); + + + msgList.add(uniformMsgPojo); + } + + builParam.put("msgList",msgList); + return builParam; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/FwwcTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/FwwcTemplateMessageBulder.java new file mode 100644 index 0000000..86b2ddc --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/FwwcTemplateMessageBulder.java @@ -0,0 +1,109 @@ +package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysBeauticianStateDao; +import com.matrix.system.hive.dao.SysProjServicesDao; +import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.Task.TemplateMessageBulder; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 服务完成提醒 + */ +@Component +public class FwwcTemplateMessageBulder implements TemplateMessageBulder { + + @Autowired + SysProjServicesDao projServicesDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + @Autowired + private SysShopInfoDao shopInfoDao; + + + + @Override + public Map buildMsg(Map param) { + + //返回参数 + Map builParam=new HashedMap(); + //获取基础公共参数 + String gzhAppid= (String) param.get("gzhAppid"); + String template_id= (String) param.get("template_id"); + String xcxAppId= (String) param.get("xcxAppId"); + //模板消息列表 + List msgList=new ArrayList(); + + //触发点传送的json参数 + JSONObject messageJsonParam= (JSONObject) param.get("messageJsonParam"); + //构建消息主体 + Long serviceId= (Long) messageJsonParam.get("serviceId"); + SysProjServices sysProjServices = projServicesDao.selectById(serviceId); + + + //校验客户openId (必须) + SysVipInfo vipInfo=vipInfoDao.selectById(sysProjServices.getVipId()); + String touser= vipInfo.getOpenId(); + if(StringUtils.isBlank(touser)){ + builParam.put("error","未获取到"+vipInfo.getVipName()+"用户小程序openid"); + return builParam; + } + + + //自定义信息区START========================================================================================================= + SysShopInfo sysShopInfo = shopInfoDao.selectById(sysProjServices.getShopId()); + List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(sysProjServices.getId()); + String time= DateUtil.dateFormatStr(sysProjServices.getConsumeTime(),DateUtil.DATE_FORMAT_MM); + + //如果一个项目存在多个护理项目则发送多次消息 + String first="您好!您预约的"; + for (SysBeauticianState beauticianState:beauticianStateList){ + first+=beauticianState.getProjInfo().getName()+beauticianState.getCount()+"次,"; + } + first=first.substring(0,first.length())+"服务已完成"; + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser(touser); + messagePojo.setTemplate_id(template_id); + messagePojo.setAppid(gzhAppid); + //个性参数设置 + messagePojo.setFirst(first,"#453454"); + messagePojo.setKeyWord(sysShopInfo.getShopName(),"#453454"); + messagePojo.setKeyWord(time,"#453454"); + messagePojo.setRemark("点击【详情】可查询订单明细,若非本人或授权操作,请及时与门店联系","#453454"); + + //小程序配置 + GzhTemplateMessagePojo.Miniprogram miniprogram=new GzhTemplateMessagePojo.Miniprogram(xcxAppId, + "pages/yuyue/showYyInfo?id="+serviceId); + messagePojo.setMiniprogram(miniprogram); + + + uniformMsgPojo.setMp_template_msg(messagePojo); + //自定义信息区END========================================================================================================= + + //返回调用者使用的参数(必须) + msgList.add(uniformMsgPojo); + builParam.put("msgList",msgList); + return builParam; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/GmcgTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/GmcgTemplateMessageBulder.java new file mode 100644 index 0000000..ee42c62 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/GmcgTemplateMessageBulder.java @@ -0,0 +1,106 @@ +package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.*; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.Task.TemplateMessageBulder; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 购买成功提醒 + */ +@Component +public class GmcgTemplateMessageBulder implements TemplateMessageBulder { + + @Autowired + SysOrderDao orderDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + @Autowired + private SysShopInfoDao shopInfoDao; + + @Autowired + private SysOrderItemDao orderItemDao; + + + + @Override + public Map buildMsg(Map param) { + + //返回参数 + Map builParam=new HashedMap(); + //获取基础公共参数 + String gzhAppid= (String) param.get("gzhAppid"); + String template_id= (String) param.get("template_id"); + String xcxAppId= (String) param.get("xcxAppId"); + //模板消息列表 + List msgList=new ArrayList(); + + //触发点传送的json参数 + JSONObject messageJsonParam= (JSONObject) param.get("messageJsonParam"); + //构建消息主体 + Long orderId= (Long) messageJsonParam.get("orderId"); + SysOrder sysOrder = orderDao.selectById(orderId); + List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(orderId); + + //校验客户openId (必须) + SysVipInfo vipInfo=vipInfoDao.selectById(sysOrder.getVipId()); + String touser= vipInfo.getOpenId(); + if(StringUtils.isBlank(touser)){ + builParam.put("error","未获取到"+vipInfo.getVipName()+"用户小程序openid"); + return builParam; + } + + + //自定义信息区START========================================================================================================= + SysShopInfo sysShopInfo = shopInfoDao.selectById(sysOrder.getShopId()); + String time= DateUtil.dateFormatStr(sysOrder.getPayTime(),DateUtil.DATE_FORMAT_MM); + + //如果一个项目存在多个护理项目则发送多次消息 + String first="您好!您购买了"; + for (SysOrderItem orderItem:sysOrderItems){ + first+=orderItem.getShoppingGoods().getName()+"x"+orderItem.getCount()+","; + } + first=first.substring(0,first.length()); + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser(touser); + messagePojo.setTemplate_id(template_id); + messagePojo.setAppid(gzhAppid); + //个性参数设置 + messagePojo.setFirst(first,"#453454"); + messagePojo.setKeyWord(sysShopInfo.getShopName(),"#453454"); + messagePojo.setKeyWord(vipInfo.getVipNo(),"#453454"); + messagePojo.setKeyWord(time,"#453454"); + messagePojo.setRemark("点击【详情】可查询订单明细,若非本人或授权操作,请及时与门店联系","#453454"); + + //小程序配置 + GzhTemplateMessagePojo.Miniprogram miniprogram=new GzhTemplateMessagePojo.Miniprogram(xcxAppId, + "pages/purchaseRecords/detail?id="+orderId); + messagePojo.setMiniprogram(miniprogram); + + + uniformMsgPojo.setMp_template_msg(messagePojo); + //自定义信息区END========================================================================================================= + + //返回调用者使用的参数(必须) + msgList.add(uniformMsgPojo); + builParam.put("msgList",msgList); + return builParam; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YycgTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YycgTemplateMessageBulder.java new file mode 100644 index 0000000..82a4a06 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YycgTemplateMessageBulder.java @@ -0,0 +1,113 @@ +package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysBeauticianStateDao; +import com.matrix.system.hive.dao.SysProjServicesDao; +import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.Task.TemplateMessageBulder; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; + +/** + * 预约成功提醒 + */ +@Component +public class YycgTemplateMessageBulder implements TemplateMessageBulder { + + @Autowired + SysProjServicesDao projServicesDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + @Autowired + private SysShopInfoDao shopInfoDao; + + + + @Override + public Map buildMsg(Map param) { + + //返回参数 + Map builParam=new HashedMap(); + //获取基础公共参数 + String gzhAppid= (String) param.get("gzhAppid"); + String template_id= (String) param.get("template_id"); + String xcxAppId= (String) param.get("xcxAppId"); + //模板消息列表 + List msgList=new ArrayList(); + + //触发点传送的json参数 + JSONObject messageJsonParam= (JSONObject) param.get("messageJsonParam"); + //构建消息主体 + Long serviceId= (Long) messageJsonParam.get("serviceId"); + SysProjServices sysProjServices = projServicesDao.selectById(serviceId); + + + //校验客户openId (必须) + SysVipInfo vipInfo=vipInfoDao.selectById(sysProjServices.getVipId()); + String touser= vipInfo.getOpenId(); + if(StringUtils.isBlank(touser)){ + builParam.put("error","未获取到"+vipInfo.getVipName()+"用户小程序openid"); + return builParam; + } + + + //自定义信息区START========================================================================================================= + SysShopInfo sysShopInfo = shopInfoDao.selectById(sysProjServices.getShopId()); + List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(sysProjServices.getId()); + String time= DateUtil.dateFormatStr(sysProjServices.getConsumeTime(),DateUtil.DATE_FORMAT_MM); + + //如果一个项目存在多个护理项目则发送多次消息 + String projectInfo=""; + Set<String> staffNames=new HashSet<>(); + for (SysBeauticianState beauticianState:beauticianStateList){ + projectInfo+=beauticianState.getProjInfo().getName()+beauticianState.getCount()+"次,"; + staffNames.add(beauticianState.getBeautiStaffInfo().getSuName()); + } + projectInfo=projectInfo.substring(0,projectInfo.length()-1); + String staffName=StringUtils.collToStr(staffNames,","); + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser(touser); + messagePojo.setTemplate_id(template_id); + messagePojo.setAppid(gzhAppid); + //个性参数设置 + messagePojo.setFirst("您好!您在"+sysShopInfo.getShopName()+"店的预约已经成功,期待您的光临","#453454"); + messagePojo.setKeyWord(time,"#453454"); + messagePojo.setKeyWord(staffName,"#453454"); + messagePojo.setKeyWord(projectInfo,"#453454"); + + + messagePojo.setRemark("点击【详情】可查询订单明细,若非本人或授权操作,请及时与门店联系","#453454"); + + //小程序配置 + GzhTemplateMessagePojo.Miniprogram miniprogram=new GzhTemplateMessagePojo.Miniprogram(xcxAppId, + "pages/yuyue/showYyInfo?id="+serviceId); + messagePojo.setMiniprogram(miniprogram); + + + uniformMsgPojo.setMp_template_msg(messagePojo); + //自定义信息区END========================================================================================================= + + //返回调用者使用的参数(必须) + msgList.add(uniformMsgPojo); + builParam.put("msgList",msgList); + return builParam; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YydsTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YydsTemplateMessageBulder.java new file mode 100644 index 0000000..0eac830 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YydsTemplateMessageBulder.java @@ -0,0 +1,116 @@ +package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.core.tools.DateUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.SysBeauticianState; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.bean.SysShopInfo; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysBeauticianStateDao; +import com.matrix.system.hive.dao.SysProjServicesDao; +import com.matrix.system.hive.dao.SysShopInfoDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.Task.TemplateMessageBulder; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.map.HashedMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.*; + +/** + * 预约到时提醒 + */ +@Component +public class YydsTemplateMessageBulder implements TemplateMessageBulder { + + @Autowired + SysProjServicesDao projServicesDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + private SysBeauticianStateDao beauticianStateDao; + + @Autowired + private SysShopInfoDao shopInfoDao; + + + + @Override + public Map buildMsg(Map param) { + + //返回参数 + Map builParam=new HashedMap(); + //获取基础公共参数 + String gzhAppid= (String) param.get("gzhAppid"); + String template_id= (String) param.get("template_id"); + String xcxAppId= (String) param.get("xcxAppId"); + //模板消息列表 + List msgList=new ArrayList(); + + //触发点传送的json参数 + JSONObject messageJsonParam= (JSONObject) param.get("messageJsonParam"); + //构建消息主体 + Long serviceId= (Long) messageJsonParam.get("serviceId"); + SysProjServices sysProjServices = projServicesDao.selectById(serviceId); + + + //校验客户openId (必须) + SysVipInfo vipInfo=vipInfoDao.selectById(sysProjServices.getVipId()); + String touser= vipInfo.getOpenId(); + if(StringUtils.isBlank(touser)){ + builParam.put("error","未获取到"+vipInfo.getVipName()+"用户小程序openid"); + return builParam; + } + + + //自定义信息区START========================================================================================================= + SysShopInfo sysShopInfo = shopInfoDao.selectById(sysProjServices.getShopId()); + List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(sysProjServices.getId()); + String time= DateUtil.dateFormatStr(sysProjServices.getConsumeTime(),DateUtil.DATE_FORMAT_MM); + + //如果一个项目存在多个护理项目则发送多次消息 + String projectInfo=""; + Set<String> staffNames=new HashSet<>(); + for (SysBeauticianState beauticianState:beauticianStateList){ + projectInfo+=beauticianState.getProjInfo().getName()+beauticianState.getCount()+"次,"; + staffNames.add(beauticianState.getBeautiStaffInfo().getSuName()); + } + projectInfo=projectInfo.substring(0,projectInfo.length()-1); + String staffName=StringUtils.collToStr(staffNames,","); + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser(touser); + messagePojo.setTemplate_id(template_id); + messagePojo.setAppid(gzhAppid); + //个性参数设置 + messagePojo.setFirst("您好!您在"+sysShopInfo.getShopName()+"店的预约将在1小时后开始,请准时到店。","#453454"); + messagePojo.setKeyWord(time,"#453454"); + + messagePojo.setKeyWord(sysShopInfo.getShopName(),"#453454"); + messagePojo.setKeyWord(sysShopInfo.getShopAddr(),"#453454"); + messagePojo.setKeyWord(projectInfo,"#453454"); + messagePojo.setKeyWord(staffName,"#453454"); + + messagePojo.setRemark("请记得准时前往,点击【详情】可查询服务详情。","#453454"); + + //小程序配置 + GzhTemplateMessagePojo.Miniprogram miniprogram=new GzhTemplateMessagePojo.Miniprogram(xcxAppId, + "pages/yuyue/showYyInfo?id="+serviceId); + messagePojo.setMiniprogram(miniprogram); + + + uniformMsgPojo.setMp_template_msg(messagePojo); + //自定义信息区END========================================================================================================= + + //返回调用者使用的参数(必须) + msgList.add(uniformMsgPojo); + builParam.put("msgList",msgList); + return builParam; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgParam.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgParam.java new file mode 100644 index 0000000..1db4733 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgParam.java @@ -0,0 +1,49 @@ +package com.matrix.system.wechart.templateMsg; + +import com.alibaba.fastjson.JSONObject; + +/** + * 统一消息参数体 + */ +public class UniformMsgParam extends JSONObject{ + + /** + * 公众号预约提醒 + */ + public static final Integer GZH_YYTX = 10000; + /** + * 购买成功通知 + */ + public static final Integer GZH_GMCG = 10001; + /** + * 预约变更通知 + */ + public static final Integer GZH_YYBG = 10002; + /** + * 预约到时提醒 + */ + public static final Integer GZH_YYDS = 10003; + /** + * 预约成功提醒 + */ + public static final Integer GZH_YYCG = 10004; + /** + * 充值成功通知 + */ + public static final Integer GZH_CZCG = 10005; + /** + * 服务完成通知 + */ + public static final Integer GZH_FWWC = 10006; + /** + * 订单取消通知 + */ + public static final Integer GZH_DDQX = 10007; + + + public UniformMsgParam(Long companyId, Integer templateCode){ + super.put("companyId",companyId); + super.put("templateCode",templateCode); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgPojo.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgPojo.java new file mode 100644 index 0000000..63678fc --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgPojo.java @@ -0,0 +1,32 @@ +package com.matrix.system.wechart.templateMsg; + +public class UniformMsgPojo { + + private String touser; + private GzhTemplateMessagePojo mp_template_msg; + private String weapp_template_msg; + + public String getTouser() { + return touser; + } + + public void setTouser(String touser) { + this.touser = touser; + } + + public GzhTemplateMessagePojo getMp_template_msg() { + return mp_template_msg; + } + + public void setMp_template_msg(GzhTemplateMessagePojo mp_template_msg) { + this.mp_template_msg = mp_template_msg; + } + + public String getWeapp_template_msg() { + return weapp_template_msg; + } + + public void setWeapp_template_msg(String weapp_template_msg) { + this.weapp_template_msg = weapp_template_msg; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java new file mode 100644 index 0000000..edbb168 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java @@ -0,0 +1,71 @@ +package com.matrix.system.wechart.templateMsg.demo; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.component.tools.HttpClientUtil; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.system.hive.plugin.util.HttpUtils; +import com.matrix.system.shopXcx.api.WeChatGzhApiTools; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +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.ResponseBody; + +@Controller +@RequestMapping(value = "test2") +public class MsgDemo2 { + + + String xcxAppId="wx5cc58f796224af61"; + + + String xcxSecret="facea088aae414e5c2ee86b459887721"; + + + @RequestMapping("/template") + @ResponseBody + public AjaxResult template() { + UniformMsgPojo uniformMsgPojo=new UniformMsgPojo(); + GzhTemplateMessagePojo messagePojo=new GzhTemplateMessagePojo(); + uniformMsgPojo.setTouser("oJkRK4yelehsY4S7I6Ee1ydWtQMI"); + messagePojo.setTemplate_id("Mqu9xPYj_JFhXNj7nLJS7LESQUy6Z7FoCOmVO66Oxe8"); + //messagePojo.setUrl("www.baidu.com"); + // messagePojo.setMiniprogram(gzhAppId,"/123/234123412"); + messagePojo.setAppid("wx57e6335559bdbda6"); + messagePojo.setFirst("尊敬的谭娅:","#453454"); + messagePojo.setKeyWord("活细胞肩部护理","#453454"); + messagePojo.setKeyWord("2014年7月21日 18:36","#453454"); + messagePojo.setRemark("您的护理课程剩余3次。","#453454"); + + String ACCESS_TOKEN=WeChatGzhApiTools.getAccessToken(xcxAppId,xcxSecret); + String url="https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN".replaceAll("ACCESS_TOKEN",ACCESS_TOKEN); + + uniformMsgPojo.setMp_template_msg(messagePojo); + + System.out.println(JSONObject.toJSON(uniformMsgPojo).toString()); + JSONObject result= HttpClientUtil.sendPostWithJson(url,JSONObject.toJSON(uniformMsgPojo).toString()); + System.out.println(result.toString()); + return AjaxResult.buildSuccessInstance("1"); + + + } + + + @RequestMapping("/getUserList") + @ResponseBody + public AjaxResult getUserList() { + + String ACCESS_TOKEN=WeChatGzhApiTools.getAccessToken(xcxAppId,xcxSecret); + + String url="https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID".replaceAll("ACCESS_TOKEN",ACCESS_TOKEN); + + + String result= HttpUtils.sendGet(url,""); + System.out.println(result.toString()); + return AjaxResult.buildSuccessInstance("1"); + + + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java new file mode 100644 index 0000000..812757a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java @@ -0,0 +1,29 @@ +package com.matrix.system.wechart.templateMsg.demo; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.system.wechart.templateMsg.Task.UniformMsgSentTask; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.io.IOException; + +@Controller +@RequestMapping(value = "test3") +public class MsgDemo3 { + + + @Autowired + UniformMsgSentTask uniformMsgSentTask; + + @RequestMapping("/template") + @ResponseBody + public AjaxResult template() throws IOException { + + return AjaxResult.buildSuccessInstance("1"); + + } + + +} diff --git a/zq-erp/src/main/java/fileMove.java b/zq-erp/src/main/java/fileMove.java new file mode 100644 index 0000000..c5a05a7 --- /dev/null +++ b/zq-erp/src/main/java/fileMove.java @@ -0,0 +1,158 @@ +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +/** + * 文件对比复制 + * + * @author JIANGYOUYAO + * @date 2021/6/7 0007 + */ +public class fileMove { + + static String[] youxiaoList= + {"fe4dbec04c2e4156939c0ac10daec2ce558271b018cb466aa572cb059b56ce9b.mp4", + "e3f179a3c54b4547b8337629c33fd817cad2abc24b134409b221454e5ebc8db8.mp4", + "334763376a724fb3a604da37c19884f6fb4fc13b7078465c8cc67743d430729a.mp4", + "18a18d29209e405cb07f5e7ec976e0f1293cbb203b4b4f44b90cf9eb2c4f1d6e.mp4", + "2487805ec0e14c00b1d0164151d61940380251ade835491a8e391a172e74e595.mp4", + "8160a63b59844c2d9bf058fa7a18f662cad81c0006e947b18ebcf8815da20206.mp4", + "9620b02a66334995a26c825d3c5164525cb7222861ed461aa0d973286a475e6e.mp4", + "88ed6d9041964d25877037aadeda77c7766de7b32ac2477cb5b920dcaf0008ac.mp4", + "ca6467b7685c49c3a7b31493b931f5ec321d3b500eb545b6966a0240b6f091b7.mp4", + "20a7cd07148546a8b57e5ef7c5eb84e881ed5e91f7244437b3d116047edb1a28.mp4", + "e3f1924ac68040f88ce13af0f166dde2a44e0aa1661f4540a7ee13d8207060de.mp4", + "36818e09cb0947ecb140c81a56207a38e3f1680fabe24131a29e52ed1dfe9eaf.mp4", + "1a3b0e0ca8774070b9a07cb3ab833e80941c5ae475cb4121aaa69976c08858cb.mp4", + "f5792c9f894b46758f3f667612aca934c1688c28614149929ccd5052a06c6a3e.mp4", + "38d5cf9058e145c4a10bf41ce96c7d686f87245e127c4dc394ab483f967f7dd5.mp4", + "f691ccc0072b443cbb1a2234968c88cb1ec2495fd0d14f7c83b700f7483f88f0.mp4", + "3acb86b0e60d476592617dde1556de37330d11d683ab4805a506516204fd1e77.mp4", + "0c485a189ed34a7cac769bf6377487ce7ce30ead9d954ea2a3d4b26a6f809b9e.mp4", + "442a3c32b5984734abd373f3986b2c9d3273b05a173745d89a53177bcd09a24d.mp4", + "aa91338d2f45414a84abf2a68fc831c29c58cbf3c44e4eb0974b27ce693d5839.mp4", + "a501e58233f447cbbe0c053efe900fb1ff13ed8644d54b9abea07422b8f2decf.mp4", + "26c625a7d96c4789b5e66de08c9301156a110168652e4026b0c8fb0c6e310aa9.mp4", + "dc2e98d3d98c47e3a54916ce04225d511ad9c9e2394e4c7cb7e7734da4cd49e1.mp4", + "dd9feb7445384df4b0dec27e446cfb6b2c7abe40309246a69ac36cb6ac753fd6.mp4", + "fc1f13a7a2c143caa4caa28db898efce0679bde086bd47f4a40ab920cdcdc292.mp4", + "3248d4d06af843f3a6451f32985b6042a696a2b382a24b0b9cc67f449d6d78a3.mp4", + "1f90088a1d0d49d892c8621af16651322b415d95d22a4adaad67cbae484c636a.mp4", + "2fc2f73bb99f47598c99676ad0bbeac3ba215afba69d40d5966bc48735fa1d1c.mp4", + "5defe3ba54c44834bcb05a0282491cd696186d37d7864581bbf53dc0572f638e.mp4", + "231e551437104babbbee22b5f514b63b38aba5a1ccd848cab333c84567b79c8b.mp4", + "60286e08075449f7b0ce9d170b78e3177ee5dea97b61456aa4b59154271b9335.mp4", + "52978eafd8b5448b9eb55595ccb84293f1fee9edcbdf46a9ae91e7c02ea846de.mp4", + "52c6f7f932044c28ad5d41260d1a711fb029892a39cb457692ea54a98a413680.mp4", + "4e66a4de590848b9a6e661a9e71947f564f6c99f4add40e68284410d932719b0.mp4", + "19a74c1ff0164a1ab9f5876a93d6451479ec6992203644da8297ad32deb08e35.mp4", + "427d10114693422694d5e2f634fdb9ab6ac57d620cc246ee92cda55f3156975f.mp4", + "b6c7012888a943c3bc4adb8e43a27c056416f8e902e14421be2e7f3a0e6627ac.mp4"}; + + static List<String> wlist= Arrays.asList(youxiaoList); + + static String targetFilePath = "C:\\Users\\Administrator\\Desktop\\webresource"; + + + public static void main(String[] args) throws IOException { + + + File sourceFile = new File(targetFilePath); + traverseFolder(sourceFile); + + + } + + + public static void traverseFolder(File file) throws IOException { + if (file.exists()) { + File[] files = file.listFiles(); + if (null == files || files.length == 0) { + System.out.println("文件夹是空的!"); + return; + } else { + for (File file2 : files) { + if (file2.isDirectory()) { + traverseFolder(file2); + } else { + if (file2.getName().endsWith(".mp4")) { + + + if(file2.getAbsolutePath().contains("weiqi.web.jyymatrix.cc") + && wlist.stream().anyMatch(item->item.equals(file2.getName())) ){ + + System.out.println("移动视频文件:" + file2.getAbsolutePath()); + FileInputStream in=new FileInputStream(file2); + FileOutputStream out=new FileOutputStream(new File("C:\\Users\\Administrator\\Desktop\\webresource\\vidos\\"+file2.getName())); + byte[] buff=new byte[1024]; + int length=in.read(buff); + while (length>0){ + out.write(buff,0,length); + length=in.read(buff); + } + out.close(); + in.close(); + }else if(file2.getAbsolutePath().contains("weiqi.web.jyymatrix.cc") + && !wlist.stream().anyMatch(item->item.equals(file2.getName())) ){ + // System.out.println("删除视频文件:" + file2.getAbsolutePath()); + //file2.delete(); + } + } else { + + } + } + } + } + } else { + System.out.println("文件不存在!"); + } + } + + +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/zq-erp/src/main/java/filecopy.java b/zq-erp/src/main/java/filecopy.java new file mode 100644 index 0000000..47baa32 --- /dev/null +++ b/zq-erp/src/main/java/filecopy.java @@ -0,0 +1,80 @@ +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; + +/** + * 文件对比复制 + * @author JIANGYOUYAO + * @date 2021/6/7 0007 + */ +public class filecopy { + + + static String targetFilePath="/mnt/sdc/webresource"; + + static String sourceFilePaht="C:\\Users\\Administrator\\Desktop\\webresource"; + + public static void main(String[] args) throws IOException { + + + File sourceFile=new File(sourceFilePaht); + traverseFolder(sourceFile); + + + } + + + public static void traverseFolder(File file) throws IOException { + + if (file.exists()) { + File[] files = file.listFiles(); + if (null == files || files.length == 0) { + System.out.println("文件夹是空的!"); + return; + } else { + for (File file2 : files) { + if (file2.isDirectory()) { + //对比target是否存在 + final String s = file2.getCanonicalPath().replaceAll("webresourceback", "webresource"); + File f=new File(s); + if(!f.exists()){ + System.out.println("复制文件:" + file2.getAbsolutePath()); + f.mkdir(); + }else{ + System.out.println("文件:" + file2.getAbsolutePath()+"存在"); + } + traverseFolder(file2); + } else { + + //对比target是否存在,不存在则copy + final String s = file2.getCanonicalPath().replaceAll("webresourceback", "webresource"); + File f=new File(s); + if(!f.exists()){ + System.out.println("复制文件:" + file2.getAbsolutePath()); + FileInputStream in=new FileInputStream(file2); + FileOutputStream out=new FileOutputStream(f); + byte[] buff=new byte[1024]; + int length=in.read(buff); + while (length>0){ + out.write(buff,0,length); + length=in.read(buff); + } + out.close(); + in.close(); + + }else{ + System.out.println("文件:" + file2.getAbsolutePath()+"存在"); + } + + } + } + } + } else { + System.out.println("文件不存在!"); + } + } + + + +} diff --git a/zq-erp/src/main/java/findC.java b/zq-erp/src/main/java/findC.java new file mode 100644 index 0000000..1c7fd6e --- /dev/null +++ b/zq-erp/src/main/java/findC.java @@ -0,0 +1,50 @@ +import java.io.File; +import java.io.IOException; + +/** + * 文件对比复制 + * @author JIANGYOUYAO + * @date 2021/6/7 0007 + */ +public class findC { + + + static String targetFilePath="C:/"; + static Long _1mb=1024L*1024L; + + public static void main(String[] args) throws IOException { + + + File sourceFile=new File(targetFilePath); + traverseFolder(sourceFile); + + + } + + + public static void traverseFolder(File file) throws IOException { + + if (file.exists()) { + File[] files = file.listFiles(); + if (null == files || files.length == 0) { + return; + } else { + for (File file2 : files) { + if (file2.isDirectory()) { + + traverseFolder(file2); + } else { + if(file2.length()>_1mb*50){ + System.out.println( file2.length()/_1mb+"MB"+"\t"+file2.getAbsolutePath()); + } + } + } + } + } else { + System.out.println("文件不存在!"); + } + } + + + +} diff --git a/zq-erp/src/main/resources/config/application.properties b/zq-erp/src/main/resources/config/application.properties index 5df391f..ee23831 100644 --- a/zq-erp/src/main/resources/config/application.properties +++ b/zq-erp/src/main/resources/config/application.properties @@ -3,11 +3,32 @@ #线上测试环境 +# +spring.datasource.username=ct_test +spring.datasource.password=123456 +spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 -spring.datasource.username=chuhuan -spring.datasource.password=chuhuan -spring.datasource.url=jdbc:mysql://119.3.52.84:3306/hive_plus_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +#spring.datasource.username=hive +#spring.datasource.password=hive123!@# +#spring.datasource.url=jdbc:mysql://124.70.222.34/hive_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +#spring.datasource.username=xc_shop +#spring.datasource.password=xc_shop123!@# +#spring.datasource.url=jdbc:mysql://124.70.222.34/xc_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + + +#spring.datasource.username=hive +#spring.datasource.password=hive123!@# +#spring.datasource.url=jdbc:mysql://124.70.222.34/hive_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + +#spring.datasource.username=meidu_data +#spring.datasource.password=meidu_4321#&@ +#spring.datasource.url=jdbc:mysql://47.111.134.136/db_meidu_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + + +#spring.datasource.username=root +#spring.datasource.password=root +#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/md_test_local?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource @@ -25,8 +46,6 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 spring.thymeleaf.prefix: classpath:/templates/views/ spring.thymeleaf.cache=false -mybatis.config-location=classpath:mybatis/mybatis-config.xml -mybatis.mapper-locations=classpath*:mybatis/mapper/*/*.xml #设置全局时间返回格式 第三行设置为true表示返回时间戳 #spring.jackson.date-format=yyyy-MM-dd #spring.jackson.time-zone=GMT+8 @@ -38,10 +57,10 @@ #rabbitMQ配置 -rabbitmq.host=47.111.134.136 -rabbitmq.port=5672 -rabbitmq.username=hivequeue -rabbitmq.password=hivequeueadmin +#rabbitmq.host=47.111.134.136 +#rabbitmq.port=5672 +#rabbitmq.username=hivequeue +#rabbitmq.password=hivequeueadmin useRabbit=false server.session.timeout=120 @@ -57,10 +76,16 @@ groupBuy.pay.timeLimit=30 #定时任务 -scheduling.enabled=false +scheduling.enabled=true -swagger.enable=false +swagger.enable=true swagger.security.username=admin swagger.security.password=admin +#默认头像 +default.vip.photo.woman=https://filehive2.jyymatrix.cc/uploadeFile/20210125/db53552e688040afb286686f081e1e68f3fe946f75624598828f01898635152e.png +default.vip.photo.man=https://filehive2.jyymatrix.cc/uploadeFile/20210125/3642f1d827c44c76832fea106c85e0f89e089c16cbcc4dd0a82bb52b9ac700f4.png +mybatis-plus.global-config.db-config.id-type=auto +mybatis-plus.config-location=classpath:mybatis/mybatis-config.xml +mybatis-plus.mapper-locations=classpath*:mybatis/mapper/**/*.xml diff --git a/zq-erp/src/main/resources/config/config.json b/zq-erp/src/main/resources/config/config.json index 1b5f059..e308302 100644 --- a/zq-erp/src/main/resources/config/config.json +++ b/zq-erp/src/main/resources/config/config.json @@ -8,7 +8,7 @@ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ "imageInsertAlign": "none", /* 插入的图片浮动方式 */ - "imageUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "imageUrlPrefix": "http://testfile.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ @@ -28,13 +28,13 @@ "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ - "scrawlUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "scrawlUrlPrefix": "http://testfile.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "scrawlInsertAlign": "none", /* 截图工具上传 */ "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "snapscreenUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "snapscreenUrlPrefix": "http://testfile.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ /* 抓取远程图片配置 */ @@ -42,7 +42,7 @@ "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ "catcherFieldName": "source", /* 提交的图片列表表单名称 */ "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "catcherUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "catcherUrlPrefix": "http://testfile.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ diff --git a/zq-erp/src/main/resources/config/db/increment/2021-04-20bug.sql b/zq-erp/src/main/resources/config/db/increment/2021-04-20bug.sql new file mode 100644 index 0000000..9484f88 --- /dev/null +++ b/zq-erp/src/main/resources/config/db/increment/2021-04-20bug.sql @@ -0,0 +1,5 @@ +update shop_order set shipping_method='1' where shipping_method='物流配送'; +update shop_order set shipping_method='2' where shipping_method='立即配送'; + +ALTER TABLE `shop_order` +MODIFY COLUMN `shipping_method` int(2) NULL DEFAULT NULL AFTER `remarks`; diff --git a/zq-erp/src/main/resources/config/db/increment/20210109.sql b/zq-erp/src/main/resources/config/db/increment/20210109.sql new file mode 100644 index 0000000..2f140ba --- /dev/null +++ b/zq-erp/src/main/resources/config/db/increment/20210109.sql @@ -0,0 +1,5 @@ +ALTER TABLE `shop_wxtemplate_msg` +ADD COLUMN `temp_type` int(2) NULL COMMENT ' 模板类型 1,公众号,2,小程序' AFTER `code`, +ADD COLUMN `template_class` longtext NULL COMMENT '取数模板类' AFTER `temp_type`; + + diff --git "a/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" "b/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" new file mode 100644 index 0000000..dd70f9d --- /dev/null +++ "b/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" @@ -0,0 +1,243 @@ +ALTER TABLE `biz_user` + ADD COLUMN `withdrawal_cash` double(20, 2) NULL COMMENT '可提现金额' AFTER `fenxiao_state`, + ADD COLUMN `salesman_grade` bigint(20) NULL COMMENT '推广员等级' AFTER `withdrawal_cash`; + +ALTER TABLE `shop_sku` + ADD COLUMN `seales_price` decimal(20, 2) NULL COMMENT '推广提成' AFTER `company_id`, +ADD COLUMN `invitation_price` decimal(20, 2) NULL COMMENT '邀请提成' AFTER `seales_price`; + +ALTER TABLE `bus_parameter_settings` + MODIFY COLUMN `param_value3` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `param_value2`; + + +/** + * 分销单明细 + * @author yourName + * @date 2021-03-12 13:17 + */ +CREATE TABLE shop_salesman_order_item( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + order_id bigint(20) COMMENT '订单id', + + salesman_order_id bigint(20) COMMENT '分销订单id', + + order_item_id bigint(20) COMMENT '订单明细id', + + amount double(20,2) COMMENT '收益金额', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分销单明细'; + +/** + * 收益流水 + * @author yourName + * @date 2021-03-10 17:34 + */ +CREATE TABLE shop_revenue_flow( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + user_id varchar(100) COMMENT '用户id', + + revenue_content varchar(40) COMMENT '收益说明', + + amount double(20,2) COMMENT '收益金额', + + business_id bigint(20) COMMENT '原始订单ID', + + company_id bigint(20) COMMENT '公司ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收益流水'; + + +/** + * 订单结算记录 + * @author yourName + * @date 2021-03-10 17:34 + */ +CREATE TABLE shop_saleman_settlement( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + order_no varchar(40) COMMENT '结算编号', + + settlement_way int(2) COMMENT '结算方式1,线下结算,2余额结算', + + man_count int(11) COMMENT '结算人数', + + order_count int(11) COMMENT '结算单数', + + amount double(20,2) COMMENT '结算金额', + + user_id int(11) COMMENT '结算人', + + remark varchar(400) COMMENT '备注', + + company_id bigint(20) COMMENT '公司ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单结算记录'; + + + +/** + * 推广员申请记录 + * @author yourName + * @date 2021-03-10 17:34 + */ +CREATE TABLE shop_salesman_apply( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + apply_way int(2) COMMENT '申请方式1、自主申请,2、自动添加,3上级邀请,4、手动添加', + + user_id varchar(100) COMMENT '申请用户id', + + parent_user_id varchar(100) COMMENT '邀请用户ID', + + apply_status int(2) COMMENT '申请状态1、待审核,2通过,3未通过', + + remark varchar(4000) COMMENT '备注', + + company_id bigint(20) COMMENT '公司ID', + + PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='推广员申请记录'; + + +/** + * 推广员等级 + * @author yourName + * @date 2021-03-10 17:34 + */ +CREATE TABLE shop_salesman_grade( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + name varchar(200) COMMENT '等级名称', + + seales_commission double(20,2) COMMENT '推广提成%', + + invitation_commission double(20,2) COMMENT '邀请提成 %', + + grade_condition double(20,2) COMMENT '等级条件(推广金额额)', + + is_default int(2) COMMENT '默认等级1是,2不是', + + company_id bigint(20) COMMENT '公司ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='推广员等级'; + + + +/** + * 分销订单 + * @author yourName + * @date 2021-03-10 17:34 + */ +CREATE TABLE shop_salesman_order( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + order_id bigint(20) COMMENT '订单id', + + user_id varchar(100) COMMENT '用户id', + + sales_user_id varchar(100) COMMENT '收益人id', + + revenue_type int(2) COMMENT '收益类型1,推广收益,2邀请收益', + + amount double(20,2) COMMENT '收益金额', + + order_status int(2) COMMENT '结算状态', + + settlement_id bigint(20) COMMENT '结算单ID', + + company_id bigint(20) COMMENT '公司ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分销订单'; + +biz_user原来的userId改成了自增长的bigint + + +ALTER TABLE `shop_sku` + ADD COLUMN `score_price` decimal(10, 2) NULL COMMENT '积分兑换价格' AFTER `invitation_price`; + +ALTER TABLE `shop_product` + ADD COLUMN `score_category_id` bigint(20) NULL COMMENT '积分商城分类ID' AFTER `company_id`, +ADD COLUMN `able_sales` int(2) NULL COMMENT '是否为分销产品1是2不是' AFTER `score_category_id`, +ADD COLUMN `able_score_pay` int(2) NULL COMMENT '是否可用积分支付1是2不是' AFTER `able_sales`; + +ALTER TABLE `shop_shopping_cart` + ADD COLUMN `cart_type` int(2) NOT NULL COMMENT '购物车类型 1微商城 2积分商城' AFTER `company_id`; + +update shop_product set able_score_pay=1; +update shop_product set able_sales=2; + +ALTER TABLE `shop_sku` + MODIFY COLUMN `score_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '兑换所需支付价格' AFTER `invitation_price`, + ADD COLUMN `score_count` decimal(10, 2) NULL COMMENT '兑换所需积分数量' AFTER `score_price`; + +ALTER TABLE `shop_order_details` + ADD COLUMN `pay_type` int(2) NULL COMMENT '支付方式1 直接购买 2,积分兑换' AFTER `company_id`, +ADD COLUMN `score_count` decimal(20, 2) NULL COMMENT '支付积分单价' AFTER `pay_type`, +ADD COLUMN `total_score_count` decimal(20, 2) NULL COMMENT '支付总积分' AFTER `score_count`; + +ALTER TABLE `shop_order` +ADD COLUMN `score_pay` int(20) NULL COMMENT '支付积分' AFTER `company_id`; + + +ALTER TABLE `shop_advertis` + ADD COLUMN `page_id` bigint(0) NULL COMMENT '连接页面' AFTER `company_id`; + +ALTER TABLE `shop_sku` +DROP COLUMN `self_price`, +ADD COLUMN `self_price` decimal(20,2) NULL AFTER `score_count`; + +ALTER TABLE `shop_salesman_grade` +DROP COLUMN `self_commission`, +ADD COLUMN `self_commission` double(20,2) NULL COMMENT '自购返佣比例%' AFTER `company_id`; + + +ALTER TABLE `money_card_use_flow` +ADD COLUMN `pay_no` varchar(32) NULL COMMENT '微信充值订单号'; + + +ALTER TABLE `shop_order` + ADD COLUMN `pay_method` int(2) NULL COMMENT '支付方式1微信,2 vipCard余额'; +update shop_order set pay_method=1; + +ALTER TABLE `sys_vip_info` + ADD COLUMN `fenxiao_state` int(11) NULL DEFAULT NULL COMMENT '分销审核状态' AFTER `recommend_id`, +ADD COLUMN `withdrawal_cash` double(20, 2) NULL DEFAULT NULL COMMENT '可提现金额' AFTER `fenxiao_state`, +ADD COLUMN `salesman_grade` bigint(20) NULL DEFAULT NULL COMMENT '推广员等级' AFTER `withdrawal_cash`, +ADD COLUMN `is_sales` int(1) NULL DEFAULT NULL AFTER `salesman_grade`, +ADD COLUMN `user_is_authorize` datetime(0) NULL DEFAULT NULL AFTER `is_sales`, +ADD COLUMN `binding_parent_time` datetime(0) NULL DEFAULT NULL AFTER `user_is_authorize`, +ADD COLUMN `country` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `binding_parent_time`, +ADD COLUMN `gender` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `country`, +ADD COLUMN `nick_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `gender`, +ADD COLUMN `avatar_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `nick_name`; diff --git "a/zq-erp/src/main/resources/config/db/increment/\347\255\276\345\210\260\346\264\273\345\212\250.sql" "b/zq-erp/src/main/resources/config/db/increment/\347\255\276\345\210\260\346\264\273\345\212\250.sql" new file mode 100644 index 0000000..f7b1b4a --- /dev/null +++ "b/zq-erp/src/main/resources/config/db/increment/\347\255\276\345\210\260\346\264\273\345\212\250.sql" @@ -0,0 +1,214 @@ + +/** + * 奖品设置表 + * @author yourName + * @date 2021-03-31 16:57 + */ + CREATE TABLE activity_sign_award_set( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + award_type int(4) COMMENT '奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)', + + award_rule int(4) COMMENT '奖项规则(1:每日奖励(默认)2:累计签到天数)', + + cumulative_day int(4) COMMENT '签到累计天数', + + award_name varchar(100) COMMENT '奖项名称', + + introduce_img varchar(500) COMMENT '图片介绍', + + introduce_tip varchar(500) COMMENT '文字介绍', + + award_inventory_cnt int(4) COMMENT '奖项库存数量', + + award_distribute_cnt int(4) COMMENT '已派发数量', + + award_way int(4) COMMENT '兑奖方式(1:线下兑换2:物流配送3:客服兑换)', + + operation_tip varchar(500) COMMENT '操作提示', + + prize_address varchar(500) COMMENT '兑奖地址', + + prize_start_time datetime COMMENT '兑奖期限开始日期', + + prize_end_time datetime COMMENT '兑奖期限结束日期', + + wechat_img varchar(500) COMMENT '客服微信', + + score_cnt int(4) COMMENT '积分数量', + + coupon_id varchar(100) COMMENT '优惠券ID', + + goods_id varchar(100) COMMENT '商品ID', + + activity_id bigint(20) COMMENT '活动主表ID', + + company_id bigint(20) COMMENT '公司ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='奖品设置表'; + + + +/** + * 领 + * @author yourName + * @date 2021-03-31 16:57 + */ + CREATE TABLE activity_sign_receive_record( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + open_id varchar(100) COMMENT 'openID', + + receive_time datetime COMMENT '领取时间', + + remark varchar(500) COMMENT '备注', + + award_id bigint(20) COMMENT '奖品设置表ID', + + state int(4) COMMENT '是否已领取(1:待领取2:已领取)', + + write_off_code varchar(100) COMMENT '核销码', + + activity_id bigint(20) COMMENT '活动主表ID', + + company_id bigint(20) COMMENT '公司ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='领取记录表'; + + + + +/** + * 签到记录表 + * @author yourName + * @date 2021-03-31 16:57 + */ + CREATE TABLE activity_sign_record( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + open_id varchar(100) COMMENT 'openID', + + sign_time datetime COMMENT '签到时间', + + cumulative_day int(4) COMMENT '累计签到天数', + + activity_id bigint(20) COMMENT '活动主表ID', + + company_id bigint(20) COMMENT '公司ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='签到记录表'; + +ALTER TABLE `shop_activities` + ADD COLUMN `act_code` varchar(200) NULL COMMENT '活动编码' AFTER `id`; + +ALTER TABLE `activity_sign_award_set` + ADD COLUMN `award_state` int(4) NULL COMMENT '奖品是否有效(1:有效 2:无效)' AFTER `company_id`; + +ALTER TABLE `activity_sign_award_set` + ADD COLUMN `goods_name` varchar(200) NULL COMMENT '产品名称' AFTER `coupon_id`; + +ALTER TABLE `activity_sign_award_set` + ADD COLUMN `coupon_name` varchar(200) NULL COMMENT '优惠券名' AFTER `score_cnt`; + +ALTER TABLE `activity_sign_record` + CHANGE COLUMN `open_id` `user_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'openID' AFTER `id`; + +ALTER TABLE `activity_sign_receive_record` + CHANGE COLUMN `open_id` `user_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'openID' AFTER `id`; + + /** + * 核销记录 + * @author yourName + * @date 2021-04-08 14:25 + */ + CREATE TABLE activity_sign_writeoff( + create_by varchar(100) NOT NULL COMMENT '创建人', + create_time datetime NOT NULL COMMENT '创建时间', + update_by varchar(100) NOT NULL COMMENT '更新人', + update_time datetime NOT NULL COMMENT '更新时间', + id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + + writeoff_time datetime COMMENT '核销时间', + + writeoff_user varchar(100) COMMENT '核销员', + + writeoff_code varchar(100) COMMENT '兑奖码', + + act_id bigint(20) COMMENT '活动ID', + + award_id bigint(20) COMMENT '奖品ID', + + win_time datetime COMMENT '中奖时间', + + state int(4) COMMENT '状态', + + user_id bigint(20) COMMENT '中奖者ID', + + logistics_id bigint(20) COMMENT '物流ID', + + receive_id bigint(20) COMMENT '中奖记录ID', + + company_id bigint(20) COMMENT '公司ID', + + shop_id bigint(20) COMMENT '店铺ID', + + writeoff_userid bigint(20) COMMENT '核销员ID', + +PRIMARY KEY(id) +)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='核销记录'; + +ALTER TABLE `activity_sign_receive_record` +ADD COLUMN `consignee` varchar(200) NULL COMMENT '收货人' AFTER `user_id`; + +ALTER TABLE `activity_sign_receive_record` +ADD COLUMN `consignee_phone` varchar(50) NULL COMMENT '联系电话' AFTER `user_id`; + +ALTER TABLE `activity_sign_receive_record` +ADD COLUMN `consignee_address` varchar(300) NULL COMMENT '收货地址' AFTER `consignee_phone`; + +ALTER TABLE `shop_delivery_info` +ADD COLUMN `receive_id` bigint(20) NULL COMMENT '奖品领取ID' AFTER `company_id`; + +ALTER TABLE `activity_sign_award_set` + ADD COLUMN `customer_phone` varchar(100) NULL COMMENT '客服电话' AFTER `company_id`; + +ALTER TABLE `shop_delivery_info` + MODIFY COLUMN `order_id` int(11) NULL AFTER `logistics_company`; + +ALTER TABLE `shop_delivery_info` + MODIFY COLUMN `order_no` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `user_id`; + + + + + + + + + + + + + + + + + + + + diff --git "a/zq-erp/src/main/resources/config/db/increment/\347\276\216\345\272\246\344\270\232\347\273\251\345\215\207\347\272\247.sql" "b/zq-erp/src/main/resources/config/db/increment/\347\276\216\345\272\246\344\270\232\347\273\251\345\215\207\347\272\247.sql" new file mode 100644 index 0000000..0a352f7 --- /dev/null +++ "b/zq-erp/src/main/resources/config/db/increment/\347\276\216\345\272\246\344\270\232\347\273\251\345\215\207\347\272\247.sql" @@ -0,0 +1,15 @@ +ALTER TABLE `achieve_new` + ADD COLUMN `achieveMoney` double(10, 0) NULL AFTER `company_id`; + + +ALTER TABLE `sys_order` + ADD COLUMN `orderType` int(2) NULL COMMENT '订单类型1,销售订单,2退款订单' AFTER `company_id`; + + +ALTER TABLE `achieve_new` + CHANGE COLUMN `t3` `achieveType` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `t2`; + +ALTER TABLE `sys_order_item` + ADD COLUMN `refundCount` int(11) NULL COMMENT '退款数量' AFTER `pay_method_detail`; + + diff --git a/zq-erp/src/main/resources/config/dev/config.json b/zq-erp/src/main/resources/config/dev/config.json index 1b5f059..09db45c 100644 --- a/zq-erp/src/main/resources/config/dev/config.json +++ b/zq-erp/src/main/resources/config/dev/config.json @@ -8,7 +8,7 @@ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ "imageInsertAlign": "none", /* 插入的图片浮动方式 */ - "imageUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "imageUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ @@ -28,13 +28,13 @@ "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ - "scrawlUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "scrawlUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "scrawlInsertAlign": "none", /* 截图工具上传 */ "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "snapscreenUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "snapscreenUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ /* 抓取远程图片配置 */ @@ -42,7 +42,7 @@ "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ "catcherFieldName": "source", /* 提交的图片列表表单名称 */ "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "catcherUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "catcherUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ diff --git a/zq-erp/src/main/resources/config/dev/system.properties b/zq-erp/src/main/resources/config/dev/system.properties index 78a6818..088c4a6 100644 --- a/zq-erp/src/main/resources/config/dev/system.properties +++ b/zq-erp/src/main/resources/config/dev/system.properties @@ -19,11 +19,11 @@ maxUploadSize=10485760 #Matser\u7684ip\u5730\u5740 -redis.hostname=118.31.227.147 +redis.hostname=120.27.238.55 #\u7AEF\u53E3\u53F7 redis.port=6379 #\u5982\u679C\u6709\u5BC6\u7801 -redis.password=123456 +redis.password=xcong123 #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 redis.timeout=10000 redis.database=7 @@ -58,6 +58,12 @@ xcx_appid =wx3836ab3c1490ff29 xcx_secret =39a3687ec5b2666ed68e7c8b83b26b47 +#公众号 +gzh_appid=wx57e6335559bdbda6 +gzh_secret=ecb408af170e3890e6544290cad33760 + + + #微信支付调试开关 wx_pay_debug_onoff = false diff --git a/zq-erp/src/main/resources/config/lhx/application.properties b/zq-erp/src/main/resources/config/lhx/application.properties index 3aead90..44b584e 100644 --- a/zq-erp/src/main/resources/config/lhx/application.properties +++ b/zq-erp/src/main/resources/config/lhx/application.properties @@ -41,7 +41,6 @@ rabbitmq.port=5672 rabbitmq.username=ct_rabbit rabbitmq.password=123456 -useRabbit=false server.session.timeout=120 @@ -57,4 +56,4 @@ #定时任务 scheduling.enabled=true -swagger.enable=false \ No newline at end of file +swagger.enable=true \ No newline at end of file diff --git a/zq-erp/src/main/resources/config/lhx/config.json b/zq-erp/src/main/resources/config/lhx/config.json index 1b5f059..09db45c 100644 --- a/zq-erp/src/main/resources/config/lhx/config.json +++ b/zq-erp/src/main/resources/config/lhx/config.json @@ -8,7 +8,7 @@ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ "imageInsertAlign": "none", /* 插入的图片浮动方式 */ - "imageUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "imageUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ @@ -28,13 +28,13 @@ "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ - "scrawlUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "scrawlUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "scrawlInsertAlign": "none", /* 截图工具上传 */ "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "snapscreenUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "snapscreenUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ /* 抓取远程图片配置 */ @@ -42,7 +42,7 @@ "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ "catcherFieldName": "source", /* 提交的图片列表表单名称 */ "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "catcherUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "catcherUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ diff --git a/zq-erp/src/main/resources/config/lhx/system.properties b/zq-erp/src/main/resources/config/lhx/system.properties index ffeb78d..d51c554 100644 --- a/zq-erp/src/main/resources/config/lhx/system.properties +++ b/zq-erp/src/main/resources/config/lhx/system.properties @@ -102,3 +102,6 @@ #hive仓库地址 hive.service=http://erp.hive.jyymatrix.cc/meidu-crm/ + +gzh_appid=wx57e6335559bdbda6 +gzh_secret=ecb408af170e3890e6544290cad33760 diff --git a/zq-erp/src/main/resources/config/mdprd/application.properties b/zq-erp/src/main/resources/config/mdprd/application.properties new file mode 100644 index 0000000..6b791af --- /dev/null +++ b/zq-erp/src/main/resources/config/mdprd/application.properties @@ -0,0 +1,72 @@ +evn=prd +server.port=8080 + + + +spring.datasource.username=meidu_data +spring.datasource.password=meidu_4321#&@ +spring.datasource.url=jdbc:mysql://47.111.134.136/db_meidu_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + + + + + +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +spring.datasource.initialSize=3 +spring.datasource.minIdle=3 +spring.datasource.maxActive=20 +spring.datasource.maxWait=60000 +spring.datasource.timeBetweenEvictionRunsMillis=60000 +spring.datasource.minEvictableIdleTimeMillis=300000 +spring.datasource.validationQuery=SELECT 1 FROM DUAL +spring.datasource.testWhileIdle=true +spring.datasource.testOnBorrow=true +spring.datasource.testOnReturn=true +spring.datasource.filters=stat,wall,log4j +spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 +spring.thymeleaf.prefix: classpath:/templates/views/ +spring.thymeleaf.cache=false +mybatis-plus.global-config.db-config.id-type=auto +mybatis-plus.config-location=classpath:mybatis/mybatis-config.xml +mybatis-plus.mapper-locations=classpath*:mybatis/mapper/**/*.xml +#设置全局时间返回格式 第三行设置为true表示返回时间戳 +#spring.jackson.date-format=yyyy-MM-dd +#spring.jackson.time-zone=GMT+8 +#spring.jackson.serialization.write-dates-as-timestamps=true +#文件上传时的大小限制 单位M +spring.servlet.multipart.max-file-size=300MB +spring.servlet.multipart.max-request-size=300MB +#-------------------------------------- + + + +#rabbitMQ配置 +rabbitmq.host=47.111.134.136 +rabbitmq.port=5672 +rabbitmq.username=hivequeue +rabbitmq.password=hivequeueadmin +useRabbit=true + +#指定消费者确认方式 当为manual时手动确认 不配置表示自动确认 +#spring.rabbitmq.listener.simple.acknowledge-mode=manual +server.session.timeout=120 + +ali.sms.accessKeyId=LTAI4FrjY9R9iDfC6YQTHfne +ali.sms.accessKeySecret=eSvQslpHpDSGlI9Hxm4y5MynNgLbCp +ali.sms.regionId=cn-hangzhou +ali.sms.signName=\u80bd\u598d + + +#hour +activities.groupBuy.limit=24 +#minute +groupBuy.pay.timeLimit=30 + +#定时任务 +scheduling.enabled=true +swagger.enable=false + +#默认头像 +default.vip.photo.woman=https://filehive2.jyymatrix.cc/uploadeFile/20210125/db53552e688040afb286686f081e1e68f3fe946f75624598828f01898635152e.png +default.vip.photo.man=https://filehive2.jyymatrix.cc/uploadeFile/20210125/3642f1d827c44c76832fea106c85e0f89e089c16cbcc4dd0a82bb52b9ac700f4.png + diff --git a/zq-erp/src/main/resources/config/mdprd/config.json b/zq-erp/src/main/resources/config/mdprd/config.json new file mode 100644 index 0000000..a5574dd --- /dev/null +++ b/zq-erp/src/main/resources/config/mdprd/config.json @@ -0,0 +1,94 @@ +/* 前后端通信相关的配置,注释只允许使用多行方式 */ +{ + /* 上传图片配置项 */ + "imageActionName": "uploadimage", /* 执行上传图片的action名称 */ + "imageFieldName": "upfile", /* 提交的图片表单名称 */ + "imageMaxSize": 2048000, /* 上传大小限制,单位B */ + "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */ + "imageCompressEnable": true, /* 是否压缩图片,默认是true */ + "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ + "imageInsertAlign": "none", /* 插入的图片浮动方式 */ + "imageUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile/md", /* 图片访问路径前缀 */ + "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ + /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ + /* {time} 会替换成时间戳 */ + /* {yyyy} 会替换成四位年份 */ + /* {yy} 会替换成两位年份 */ + /* {mm} 会替换成两位月份 */ + /* {dd} 会替换成两位日期 */ + /* {hh} 会替换成两位小时 */ + /* {ii} 会替换成两位分钟 */ + /* {ss} 会替换成两位秒 */ + /* 非法字符 \ : * ? " < > | */ + /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */ + + /* 涂鸦图片上传配置项 */ + "scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */ + "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ + "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ + "scrawlUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile/md", /* 图片访问路径前缀 */ + "scrawlInsertAlign": "none", + + /* 截图工具上传 */ + "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ + "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "snapscreenUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile/md", /* 图片访问路径前缀 */ + "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ + + /* 抓取远程图片配置 */ + "catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"], + "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ + "catcherFieldName": "source", /* 提交的图片列表表单名称 */ + "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "catcherUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile/md", /* 图片访问路径前缀 */ + "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ + "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ + + /* 上传视频配置 */ + "videoActionName": "uploadvideo", /* 执行上传视频的action名称 */ + "videoFieldName": "upfile", /* 提交的视频表单名称 */ + "videoPathFormat": "/ueditor/jsp/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "videoUrlPrefix": "http://127.0.0.1:1088/uploadeFile/", /* 视频访问路径前缀 */ + "videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */ + "videoAllowFiles": [ + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */ + + /* 上传文件配置 */ + "fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */ + "fileFieldName": "upfile", /* 提交的文件表单名称 */ + "filePathFormat": "/ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "fileUrlPrefix": "http://127.0.0.1:1088/uploadeFile/", /* 文件访问路径前缀 */ + "fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */ + "fileAllowFiles": [ + ".png", ".jpg", ".jpeg", ".gif", ".bmp", + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", + ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ], /* 上传文件格式显示 */ + + /* 列出指定目录下的图片 */ + "imageManagerActionName": "listimage", /* 执行图片管理的action名称 */ + "imageManagerListPath": "http://127.0.0.1:1088/uploadeFile/", /* 指定要列出图片的目录 */ + "imageManagerListSize": 20, /* 每次列出文件数量 */ + "imageManagerUrlPrefix": "", /* 图片访问路径前缀 */ + "imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */ + "imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */ + + /* 列出指定目录下的文件 */ + "fileManagerActionName": "listfile", /* 执行文件管理的action名称 */ + "fileManagerListPath": "http://127.0.0.1:1088/uploadeFile/", /* 指定要列出文件的目录 */ + "fileManagerUrlPrefix": "", /* 文件访问路径前缀 */ + "fileManagerListSize": 20, /* 每次列出文件数量 */ + "fileManagerAllowFiles": [ + ".png", ".jpg", ".jpeg", ".gif", ".bmp", + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", + ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ] /* 列出的文件类型 */ + +} \ No newline at end of file diff --git a/zq-erp/src/main/resources/config/mdprd/system.properties b/zq-erp/src/main/resources/config/mdprd/system.properties new file mode 100644 index 0000000..30d25c6 --- /dev/null +++ b/zq-erp/src/main/resources/config/mdprd/system.properties @@ -0,0 +1,105 @@ +#是否启用debug模式 +debug=false +# 日志文件保存地址 +log_path=/mnt/md-hive/log + +# 系统语言环境 zh中文,us英文 +system_language=zh + +# 错误密码允许输入的次数,大于五次后账号锁定,0表示不锁账号 +error_password_times=5 +# 默认密码 +default_password=123 + +#nginx静态资源访问地址 +static_resource_url=https://filehive2.jyymatrix.cc/uploadeFile/md/ +#文件保存地址 +file_storage_path=/mnt/hive/static/uploadeFile/md/ +#文件上传大小字节为单位 10MB +maxUploadSize=10485760 + +#Matser\u7684ip\u5730\u5740 +redis.hostname=120.27.238.55 +#\u7AEF\u53E3\u53F7 +redis.port=6379 +#\u5982\u679C\u6709\u5BC6\u7801 +redis.password=xcong123 +#\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 +redis.timeout=10000 +redis.database=1 +redis_time_out=1800000 + + +cookie_time_out=36000 + +#APP登录公钥 +login_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCWvK6UWCtSp/8qnTqyUfO0wbg4CuxOe7IeiDSAmATfHnWqBPnbZ73qQ4A90vGowB7mp5XnmBvgTwfXtDh08yd4btlHwSD3ShbRyGfGfV8lc47ZTLiJH0xuuN2iHfnfj8zQ5kcqijeotggo2rF8Uu7KSR3HxVyN9mO22C6p1r5wVQIDAQAB +#APP登录秘钥 +login_private_key=MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJa8rpRYK1Kn/yqdOrJR87TBuDgK7E57sh6INICYBN8edaoE+dtnvepDgD3S8ajAHuanleeYG+BPB9e0OHTzJ3hu2UfBIPdKFtHIZ8Z9XyVzjtlMuIkfTG643aId+d+PzNDmRyqKN6i2CCjasXxS7spJHcfFXI32Y7bYLqnWvnBVAgMBAAECgYBNzQFGq+NgfDllo1WCaG4jI8GTm3+wWoPq4l5G6S/KgYw1vu+/YOJTIZf1UQVOFitc3a6vpIDu25uup+Rj6IS8B4V8NDfc8P+iMNwdIKqqBj8wHu0/SaxYdW1uqlU5+XkJMxsNMgNRRGPSIQhla5OPHtBzIa7t4lmypETMZtXEmQJBAMsa1OIQzAKU05GweCnNNSoqo/nAQLqp8zfbJypxRx24uaCyS7C+KxN+O4FyaYmM9n0X+cgkr+RYHAIa7mg3gccCQQC9/nJvRBum8+4TINnz6QrvTmTlhi8QKW/CiRYpGgmo5PtQYw4BkRQbYO8ktFDM2yeO75XBv09qnGQaivDCeL0DAkEAisFg8LSy+4x7YcvivAQirxUEg2qRjjTvIZjKEBflkuuRfbRxO2Uf/qg9tPjaGwu/lcScc9yEggaj09hcSbyqHwJAN8QLiqUPCL3oTy0BTBpG316/Nq9f+Ppwl0TtgDroQu6S5VFttwACStb02m0imj5pKgcgibHBeaVVrITDjhEqSQJAaCHD/ytTzgtgLoVVyZZxOB272W7PI3mnzL8qQSldx1/QOBs1NmmEZuo7ELFMrfTmlxa1qR4gsq/ImfIdUdXewQ== + +#是否启用异常上报 +is_open_exception_report=true +showExcptionUrl=http://erp.hive.jyymatrix.cc/showException + +#异常上报地址 +exception_center_url =http://geek.xc.jyymatrix.cc/addException +#项目编号 +projNo=78 +#项目负责人 +owner=姜友瑶 + +#日志文件清理阈值 单位:MB +log_max=20 +#日志清理天数 +log_clear_day=5 + + + + +wechar_login_url =https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code +xcx_appid =wx3836ab3c1490ff29 +xcx_secret =39a3687ec5b2666ed68e7c8b83b26b47 +xcx_manager_appid=wx2948b3b914a9722e +xcx_manager_secret=1685dfd99a43e213ed8be07870b898ba +#微信支付调试开关 +wx_pay_debug_onoff = false + +#快递鸟用户id +logistics.eBusinessID=1530881 +#快递鸟密钥 +logistics.appKey=f1cf9777-26fb-4e3f-a14d-896075e6384e +#快递鸟接口地址 +logistics.url=http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx +#快递鸟接口指令 +logistics.requestType=1002 + +#丰桥顾客编码 +sf.logistics.clientCode=XCZHYF +#丰桥校验码 +sf.logistics.checkword=zqcjA2A5m6MIGa6mImMcnpKQ9ipYlbUW +#丰桥接口地址 +sf.logistics.url=https://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService + +#发送短信配置 +crm.request_url = http://192.168.1.248 +sms.request_url = http://smssh1.253.com +sms.login_account = M7315130 +sms.login_password = J7FAoehPkv63e3 +sms.login_accountNe = N4617160 +sms.login_passwordNe = rb1cxLitRB83e0 + +#接入统一登录平台配置 +platform_app_code = wx_shop +platform_secret_key = b21e309f07964e4fae5b156d74b5d66z +#platform_verity_url = http://localhost:8080/platform/getUserInfo +platform_verity_url = http://stg1-xcerp-ca.xc.jyymatrix.cc/platform/getUserInfo + +#微信支付回调地址 +pay_notify_url = https://xcxhive2.jyymatrix.cc/wxCommon/wxpayCallback + + +qrcodeBackgroundImgPath=/mnt/xcshop/webresource/static/xcxresource/bj1.png +qrcodeFrontImgPath=/mnt/xcshop/webresource/static/xcxresource/qj2.png + +#hive仓库地址 +hive.service=http://erp.hive.jyymatrix.cc/meidu-crm/ diff --git a/zq-erp/src/main/resources/config/prd/application.properties b/zq-erp/src/main/resources/config/prd/application.properties index a2a36d1..39f44e5 100644 --- a/zq-erp/src/main/resources/config/prd/application.properties +++ b/zq-erp/src/main/resources/config/prd/application.properties @@ -1,9 +1,12 @@ evn=prd server.port=8080 -spring.datasource.username=hive_data -spring.datasource.password=hive_4321#&@ -spring.datasource.url=jdbc:mysql://119.3.52.84:3306/hive_prd?useUnicode=true&characterEncoding=utf8mb4&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + + +spring.datasource.username=hive +spring.datasource.password=hive123!@# +spring.datasource.url=jdbc:mysql://124.70.222.34/hive_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + @@ -23,8 +26,9 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 spring.thymeleaf.prefix: classpath:/templates/views/ spring.thymeleaf.cache=false -mybatis.config-location=classpath:mybatis/mybatis-config.xml -mybatis.mapper-locations=classpath*:mybatis/mapper/*/*.xml +mybatis-plus.global-config.db-config.id-type=auto +mybatis-plus.config-location=classpath:mybatis/mybatis-config.xml +mybatis-plus.mapper-locations=classpath*:mybatis/mapper/**/*.xml #设置全局时间返回格式 第三行设置为true表示返回时间戳 #spring.jackson.date-format=yyyy-MM-dd #spring.jackson.time-zone=GMT+8 @@ -37,7 +41,7 @@ #rabbitMQ配置 -rabbitmq.host=127.0.0.1 +rabbitmq.host=47.111.134.136 rabbitmq.port=5672 rabbitmq.username=hivequeue rabbitmq.password=hivequeueadmin @@ -60,4 +64,9 @@ #定时任务 scheduling.enabled=true -swagger.enable=false \ No newline at end of file +swagger.enable=false + +#默认头像 +default.vip.photo.woman=https://filehive2.jyymatrix.cc/uploadeFile/20210125/db53552e688040afb286686f081e1e68f3fe946f75624598828f01898635152e.png +default.vip.photo.man=https://filehive2.jyymatrix.cc/uploadeFile/20210125/3642f1d827c44c76832fea106c85e0f89e089c16cbcc4dd0a82bb52b9ac700f4.png + diff --git a/zq-erp/src/main/resources/config/prd/config.json b/zq-erp/src/main/resources/config/prd/config.json index 1b5f059..09db45c 100644 --- a/zq-erp/src/main/resources/config/prd/config.json +++ b/zq-erp/src/main/resources/config/prd/config.json @@ -8,7 +8,7 @@ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ "imageInsertAlign": "none", /* 插入的图片浮动方式 */ - "imageUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "imageUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ @@ -28,13 +28,13 @@ "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ - "scrawlUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "scrawlUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "scrawlInsertAlign": "none", /* 截图工具上传 */ "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "snapscreenUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "snapscreenUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ /* 抓取远程图片配置 */ @@ -42,7 +42,7 @@ "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ "catcherFieldName": "source", /* 提交的图片列表表单名称 */ "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "catcherUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "catcherUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ diff --git a/zq-erp/src/main/resources/config/prd/system.properties b/zq-erp/src/main/resources/config/prd/system.properties index b9d6102..475b515 100644 --- a/zq-erp/src/main/resources/config/prd/system.properties +++ b/zq-erp/src/main/resources/config/prd/system.properties @@ -19,11 +19,11 @@ maxUploadSize=10485760 #Matser\u7684ip\u5730\u5740 -redis.hostname=118.31.227.147 +redis.hostname=120.27.238.55 #\u7AEF\u53E3\u53F7 redis.port=6379 #\u5982\u679C\u6709\u5BC6\u7801 -redis.password=123456 +redis.password=xcong123 #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 redis.timeout=10000 redis.database=1 @@ -59,7 +59,8 @@ wechar_login_url =https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code xcx_appid =wx3836ab3c1490ff29 xcx_secret =39a3687ec5b2666ed68e7c8b83b26b47 - +xcx_manager_appid=wx2948b3b914a9722e +xcx_manager_secret=1685dfd99a43e213ed8be07870b898ba #微信支付调试开关 wx_pay_debug_onoff = false diff --git a/zq-erp/src/main/resources/config/system.properties b/zq-erp/src/main/resources/config/system.properties index e008d06..e2c8614 100644 --- a/zq-erp/src/main/resources/config/system.properties +++ b/zq-erp/src/main/resources/config/system.properties @@ -17,20 +17,21 @@ #文件保存地址 #file_storage_path=/mnt/hive/static/uploadeFile/ -file_storage_path=/Users/jiangyouyao/java/webresources/ +file_storage_path=D:\\test\\ + #文件上传大小字节为单位 10MB maxUploadSize=10485760 #Matser\u7684ip\u5730\u5740 -redis.hostname=118.31.227.147 +#redis.hostname=120.27.238.55 #\u7AEF\u53E3\u53F7 -redis.port=6379 +#redis.port=6379 #\u5982\u679C\u6709\u5BC6\u7801 -redis.password=123456 +#redis.password=xcong123 #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 -redis.timeout=10000 -redis.database=1 -redis_time_out=1800000 +#redis.timeout=10000 +#redis.database=2 +#redis_time_out=1800000 cookie_time_out=36000 #APP登录公钥 @@ -48,8 +49,16 @@ wechar_login_url =https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code -xcx_appid =wx3836ab3c1490ff29 -xcx_secret =39a3687ec5b2666ed68e7c8b83b26b47 +xcx_appid =wx5cc58f796224af61 +xcx_secret =facea088aae414e5c2ee86b459887721 +xcx_manager_appid=wx2948b3b914a9722e +xcx_manager_secret=1685dfd99a43e213ed8be07870b898ba + +#公众号 +gzh_appid=wx57e6335559bdbda6 +gzh_secret=ecb408af170e3890e6544290cad33760 + + #微信支付调试开关 wx_pay_debug_onoff = false @@ -92,10 +101,9 @@ #是否启用异常上报 -is_open_exception_report=true -showExcptionUrl=http://erp.hive.jyymatrix.cc/showException +is_open_exception_report=false +showExcptionUrl=http://test.hive.jyymatrix.cc/showException -#异常信息查询接口 -showExcptionUrl=http://erp.hive.jyymatrix.cc/showException + diff --git a/zq-erp/src/main/resources/config/test/application.properties b/zq-erp/src/main/resources/config/test/application.properties index 7b4d979..cd48b66 100644 --- a/zq-erp/src/main/resources/config/test/application.properties +++ b/zq-erp/src/main/resources/config/test/application.properties @@ -1,11 +1,17 @@ -evn=dev +evn=test server.port=8080 #线上测试环境 -spring.datasource.username=chuhuan -spring.datasource.password=chuhuan -spring.datasource.url=jdbc:mysql://119.3.52.84:3306/hive_plus_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + +spring.datasource.username=ct_test +spring.datasource.password=123456 +spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + +#spring.datasource.username=chuhuan +#spring.datasource.password=chuhuan +#spring.datasource.url=jdbc:mysql://175.6.132.141:3306/hive_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + @@ -24,8 +30,9 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 spring.thymeleaf.prefix: classpath:/templates/views/ spring.thymeleaf.cache=false -mybatis.config-location=classpath:mybatis/mybatis-config.xml -mybatis.mapper-locations=classpath*:mybatis/mapper/*/*.xml +mybatis-plus.config-location=classpath:mybatis/mybatis-config.xml +mybatis-plus.mapper-locations=classpath*:mybatis/mapper/**/*.xml + #设置全局时间返回格式 第三行设置为true表示返回时间戳 #spring.jackson.date-format=yyyy-MM-dd #spring.jackson.time-zone=GMT+8 @@ -54,7 +61,15 @@ activities.groupBuy.limit=24 #minute groupBuy.pay.timeLimit=30 -#定时任务 -scheduling.enabled=true -swagger.enable=false \ No newline at end of file +#定时任务 +scheduling.enabled=false + +swagger.enable=true +swagger.security.username=admin +swagger.security.password=admin + + +#默认头像 +default.vip.photo.woman=https://filehive2.jyymatrix.cc/uploadeFile/20210125/db53552e688040afb286686f081e1e68f3fe946f75624598828f01898635152e.png +default.vip.photo.man=https://filehive2.jyymatrix.cc/uploadeFile/20210125/3642f1d827c44c76832fea106c85e0f89e089c16cbcc4dd0a82bb52b9ac700f4.png diff --git a/zq-erp/src/main/resources/config/test/config.json b/zq-erp/src/main/resources/config/test/config.json index 1b5f059..5b0e824 100644 --- a/zq-erp/src/main/resources/config/test/config.json +++ b/zq-erp/src/main/resources/config/test/config.json @@ -8,7 +8,7 @@ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ "imageInsertAlign": "none", /* 插入的图片浮动方式 */ - "imageUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "imageUrlPrefix": "http://testfile.hive.jyymatrix.cc", /* 图片访问路径前缀 */ "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ @@ -28,13 +28,13 @@ "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ - "scrawlUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "scrawlUrlPrefix": "http://testfile.hive.jyymatrix.cc", /* 图片访问路径前缀 */ "scrawlInsertAlign": "none", /* 截图工具上传 */ "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "snapscreenUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "snapscreenUrlPrefix": "http://testfile.hive.jyymatrix.cc", /* 图片访问路径前缀 */ "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ /* 抓取远程图片配置 */ @@ -42,7 +42,7 @@ "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ "catcherFieldName": "source", /* 提交的图片列表表单名称 */ "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "catcherUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "catcherUrlPrefix": "http://testfile.hive.jyymatrix.cc", /* 图片访问路径前缀 */ "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ diff --git a/zq-erp/src/main/resources/config/test/system.properties b/zq-erp/src/main/resources/config/test/system.properties index 22568ff..3f4c0ac 100644 --- a/zq-erp/src/main/resources/config/test/system.properties +++ b/zq-erp/src/main/resources/config/test/system.properties @@ -1,51 +1,103 @@ -evn=dev -server.port=8080 +#是否启用debug模式 +debug=false +# 日志文件保存地址 +log_path=/mnt/hive/log-test + +# 系统语言环境 zh中文,us英文 +system_language=zh + +# 错误密码允许输入的次数,大于五次后账号锁定,0表示不锁账号 +error_password_times=5 +# 默认密码 +default_password=123 + +#nginx静态资源访问地址 +static_resource_url=http://testfile.hive.jyymatrix.cc/ +#文件保存地址 +file_storage_path=/mnt/upload/ +#文件上传大小字节为单位 10MB +maxUploadSize=10485760 + + +#Matser\u7684ip\u5730\u5740 +redis.hostname=120.27.238.55 +#\u7AEF\u53E3\u53F7 +redis.port=6379 +#\u5982\u679C\u6709\u5BC6\u7801 +redis.password=xcong123 +#\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 +redis.timeout=10000 +redis.database=1 +redis_time_out=1800000 +cookie_time_out=36000 + +#APP登录公钥 +login_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCWvK6UWCtSp/8qnTqyUfO0wbg4CuxOe7IeiDSAmATfHnWqBPnbZ73qQ4A90vGowB7mp5XnmBvgTwfXtDh08yd4btlHwSD3ShbRyGfGfV8lc47ZTLiJH0xuuN2iHfnfj8zQ5kcqijeotggo2rF8Uu7KSR3HxVyN9mO22C6p1r5wVQIDAQAB +#APP登录秘钥 +login_private_key=MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJa8rpRYK1Kn/yqdOrJR87TBuDgK7E57sh6INICYBN8edaoE+dtnvepDgD3S8ajAHuanleeYG+BPB9e0OHTzJ3hu2UfBIPdKFtHIZ8Z9XyVzjtlMuIkfTG643aId+d+PzNDmRyqKN6i2CCjasXxS7spJHcfFXI32Y7bYLqnWvnBVAgMBAAECgYBNzQFGq+NgfDllo1WCaG4jI8GTm3+wWoPq4l5G6S/KgYw1vu+/YOJTIZf1UQVOFitc3a6vpIDu25uup+Rj6IS8B4V8NDfc8P+iMNwdIKqqBj8wHu0/SaxYdW1uqlU5+XkJMxsNMgNRRGPSIQhla5OPHtBzIa7t4lmypETMZtXEmQJBAMsa1OIQzAKU05GweCnNNSoqo/nAQLqp8zfbJypxRx24uaCyS7C+KxN+O4FyaYmM9n0X+cgkr+RYHAIa7mg3gccCQQC9/nJvRBum8+4TINnz6QrvTmTlhi8QKW/CiRYpGgmo5PtQYw4BkRQbYO8ktFDM2yeO75XBv09qnGQaivDCeL0DAkEAisFg8LSy+4x7YcvivAQirxUEg2qRjjTvIZjKEBflkuuRfbRxO2Uf/qg9tPjaGwu/lcScc9yEggaj09hcSbyqHwJAN8QLiqUPCL3oTy0BTBpG316/Nq9f+Ppwl0TtgDroQu6S5VFttwACStb02m0imj5pKgcgibHBeaVVrITDjhEqSQJAaCHD/ytTzgtgLoVVyZZxOB272W7PI3mnzL8qQSldx1/QOBs1NmmEZuo7ELFMrfTmlxa1qR4gsq/ImfIdUdXewQ== + + +#日志文件清理阈值 单位:MB +log_max=20 +#日志清理天数 +log_clear_day=5 -spring.datasource.type=com.alibaba.druid.pool.DruidDataSource -spring.datasource.initialSize=3 -spring.datasource.minIdle=3 -spring.datasource.maxActive=20 -spring.datasource.maxWait=60000 -spring.datasource.timeBetweenEvictionRunsMillis=60000 -spring.datasource.minEvictableIdleTimeMillis=300000 -spring.datasource.validationQuery=SELECT 1 FROM DUAL -spring.datasource.testWhileIdle=true -spring.datasource.testOnBorrow=true -spring.datasource.testOnReturn=true -spring.datasource.filters=stat,wall,log4j -spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 -spring.thymeleaf.prefix: classpath:/templates/views/ -spring.thymeleaf.cache=false -mybatis.config-location=classpath:mybatis/mybatis-config.xml -mybatis.mapper-locations=classpath*:mybatis/mapper/*/*.xml -#设置全局时间返回格式 第三行设置为true表示返回时间戳 -#spring.jackson.date-format=yyyy-MM-dd -#spring.jackson.time-zone=GMT+8 -#spring.jackson.serialization.write-dates-as-timestamps=true -#文件上传时的大小限制 单位M -spring.servlet.multipart.max-file-size=100MB -spring.servlet.multipart.max-request-size=100MB -#-------------------------------------- +wechar_login_url =https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code +xcx_appid =wx5cc58f796224af61 +xcx_secret =facea088aae414e5c2ee86b459887721 +xcx_manager_appid=wx2948b3b914a9722e +xcx_manager_secret=1685dfd99a43e213ed8be07870b898ba +gzh_appid=wx57e6335559bdbda6 +gzh_secret=ecb408af170e3890e6544290cad33760 + +#微信支付调试开关 +wx_pay_debug_onoff = false + +#快递鸟用户id +logistics.eBusinessID=1530881 +#快递鸟密钥 +logistics.appKey=f1cf9777-26fb-4e3f-a14d-896075e6384e +#快递鸟接口地址 +logistics.url=http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx +#快递鸟接口指令 +logistics.requestType=1002 -#rabbitMQ配置 -rabbitmq.host=47.111.134.136 -rabbitmq.port=5672 -rabbitmq.username=hivequeue -rabbitmq.password=hivequeueadmin -useRabbit=false -server.session.timeout=120 -ali.sms.accessKeyId=LTAI4FrjY9R9iDfC6YQTHfne -ali.sms.accessKeySecret=eSvQslpHpDSGlI9Hxm4y5MynNgLbCp -ali.sms.regionId=cn-hangzhou -ali.sms.signName=\u80bd\u598d +#发送短信配置 +crm.request_url = http://192.168.1.248 +sms.request_url = http://smssh1.253.com +sms.login_account = M7315130 +sms.login_password = J7FAoehPkv63e3 +sms.login_accountNe = N4617160 +sms.login_passwordNe = rb1cxLitRB83e0 -#hour -activities.groupBuy.limit=24 -#minute -groupBuy.pay.timeLimit=30 \ No newline at end of file +#接入统一登录平台配置 +platform_app_code = wx_shop +platform_secret_key = b21e309f07964e4fae5b156d74b5d66z +#platform_verity_url = http://localhost:8080/platform/getUserInfo +platform_verity_url = http://stg1-xcerp-ca.xc.jyymatrix.cc/platform/getUserInfo + +#微信支付回调地址 +pay_notify_url = https://xcxhive2.jyymatrix.cc/wxCommon/wxpayCallback + +qrcodeBackgroundImgPath=/mnt/xcshop/webresource/static/xcxresource/bj1.png +qrcodeFrontImgPath=/mnt/xcshop/webresource/static/xcxresource/qj2.png + +#hive仓库地址 +hive.service=http://localhost:8082/meidu-crm/ + + + +#是否启用异常上报 +is_open_exception_report=true +showExcptionUrl=http://test.hive.jyymatrix.cc/showException + + +#异常信息查询接口 +showExcptionUrl=http://test.hive.jyymatrix.cc/showException + diff --git a/zq-erp/src/main/resources/config/xcshop/application.properties b/zq-erp/src/main/resources/config/xcshop/application.properties new file mode 100644 index 0000000..d871e87 --- /dev/null +++ b/zq-erp/src/main/resources/config/xcshop/application.properties @@ -0,0 +1,75 @@ +evn=xcshop +server.port=8080 + + +#线上测试环境 + +spring.datasource.username=xc_shop +spring.datasource.password=xc_shop123!@# +spring.datasource.url=jdbc:mysql://124.70.222.34/xc_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + +#spring.datasource.username=chuhuan +#spring.datasource.password=chuhuan +#spring.datasource.url=jdbc:mysql://175.6.132.141:3306/hive_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + + + + +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +spring.datasource.initialSize=3 +spring.datasource.minIdle=3 +spring.datasource.maxActive=20 +spring.datasource.maxWait=60000 +spring.datasource.timeBetweenEvictionRunsMillis=60000 +spring.datasource.minEvictableIdleTimeMillis=300000 +spring.datasource.validationQuery=SELECT 1 FROM DUAL +spring.datasource.testWhileIdle=true +spring.datasource.testOnBorrow=true +spring.datasource.testOnReturn=true +spring.datasource.filters=stat,wall,log4j +spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 +spring.thymeleaf.prefix: classpath:/templates/views/ +spring.thymeleaf.cache=false +mybatis-plus.config-location=classpath:mybatis/mybatis-config.xml +mybatis-plus.mapper-locations=classpath*:mybatis/mapper/**/*.xml + +#设置全局时间返回格式 第三行设置为true表示返回时间戳 +#spring.jackson.date-format=yyyy-MM-dd +#spring.jackson.time-zone=GMT+8 +#spring.jackson.serialization.write-dates-as-timestamps=true +#文件上传时的大小限制 单位M +spring.servlet.multipart.max-file-size=100MB +spring.servlet.multipart.max-request-size=100MB +#-------------------------------------- + + +#rabbitMQ配置 +rabbitmq.host=47.111.134.136 +rabbitmq.port=5672 +rabbitmq.username=hivequeue +rabbitmq.password=hivequeueadmin +useRabbit=false + +server.session.timeout=120 + +ali.sms.accessKeyId=LTAI4FrjY9R9iDfC6YQTHfne +ali.sms.accessKeySecret=eSvQslpHpDSGlI9Hxm4y5MynNgLbCp +ali.sms.regionId=cn-hangzhou +ali.sms.signName=\u80bd\u598d + +#hour +activities.groupBuy.limit=24 +#minute +groupBuy.pay.timeLimit=30 + +#定时任务 +scheduling.enabled=false + +swagger.enable=true +swagger.security.username=admin +swagger.security.password=admin + + +#默认头像 +default.vip.photo.woman=https://filehive2.jyymatrix.cc/uploadeFile/20210125/db53552e688040afb286686f081e1e68f3fe946f75624598828f01898635152e.png +default.vip.photo.man=https://filehive2.jyymatrix.cc/uploadeFile/20210125/3642f1d827c44c76832fea106c85e0f89e089c16cbcc4dd0a82bb52b9ac700f4.png diff --git a/zq-erp/src/main/resources/config/xcshop/config.json b/zq-erp/src/main/resources/config/xcshop/config.json new file mode 100644 index 0000000..bffbd4a --- /dev/null +++ b/zq-erp/src/main/resources/config/xcshop/config.json @@ -0,0 +1,94 @@ +/* 前后端通信相关的配置,注释只允许使用多行方式 */ +{ + /* 上传图片配置项 */ + "imageActionName": "uploadimage", /* 执行上传图片的action名称 */ + "imageFieldName": "upfile", /* 提交的图片表单名称 */ + "imageMaxSize": 2048000, /* 上传大小限制,单位B */ + "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */ + "imageCompressEnable": true, /* 是否压缩图片,默认是true */ + "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ + "imageInsertAlign": "none", /* 插入的图片浮动方式 */ + "imageUrlPrefix": "http://xcshop.csxuncong.com/uploadfile", /* 图片访问路径前缀 */ + "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ + /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ + /* {time} 会替换成时间戳 */ + /* {yyyy} 会替换成四位年份 */ + /* {yy} 会替换成两位年份 */ + /* {mm} 会替换成两位月份 */ + /* {dd} 会替换成两位日期 */ + /* {hh} 会替换成两位小时 */ + /* {ii} 会替换成两位分钟 */ + /* {ss} 会替换成两位秒 */ + /* 非法字符 \ : * ? " < > | */ + /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */ + + /* 涂鸦图片上传配置项 */ + "scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */ + "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ + "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ + "scrawlUrlPrefix": "http://xcshop.csxuncong.com/uploadfile", /* 图片访问路径前缀 */ + "scrawlInsertAlign": "none", + + /* 截图工具上传 */ + "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ + "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "snapscreenUrlPrefix": "http://xcshop.csxuncong.com/uploadfile", /* 图片访问路径前缀 */ + "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ + + /* 抓取远程图片配置 */ + "catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"], + "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ + "catcherFieldName": "source", /* 提交的图片列表表单名称 */ + "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "catcherUrlPrefix": "http://xcshop.csxuncong.com/uploadfile", /* 图片访问路径前缀 */ + "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ + "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ + + /* 上传视频配置 */ + "videoActionName": "uploadvideo", /* 执行上传视频的action名称 */ + "videoFieldName": "upfile", /* 提交的视频表单名称 */ + "videoPathFormat": "/ueditor/jsp/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "videoUrlPrefix": "http://127.0.0.1:1088/uploadeFile/", /* 视频访问路径前缀 */ + "videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */ + "videoAllowFiles": [ + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */ + + /* 上传文件配置 */ + "fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */ + "fileFieldName": "upfile", /* 提交的文件表单名称 */ + "filePathFormat": "/ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "fileUrlPrefix": "http://127.0.0.1:1088/uploadeFile/", /* 文件访问路径前缀 */ + "fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */ + "fileAllowFiles": [ + ".png", ".jpg", ".jpeg", ".gif", ".bmp", + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", + ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ], /* 上传文件格式显示 */ + + /* 列出指定目录下的图片 */ + "imageManagerActionName": "listimage", /* 执行图片管理的action名称 */ + "imageManagerListPath": "http://127.0.0.1:1088/uploadeFile/", /* 指定要列出图片的目录 */ + "imageManagerListSize": 20, /* 每次列出文件数量 */ + "imageManagerUrlPrefix": "", /* 图片访问路径前缀 */ + "imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */ + "imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */ + + /* 列出指定目录下的文件 */ + "fileManagerActionName": "listfile", /* 执行文件管理的action名称 */ + "fileManagerListPath": "http://127.0.0.1:1088/uploadeFile/", /* 指定要列出文件的目录 */ + "fileManagerUrlPrefix": "", /* 文件访问路径前缀 */ + "fileManagerListSize": 20, /* 每次列出文件数量 */ + "fileManagerAllowFiles": [ + ".png", ".jpg", ".jpeg", ".gif", ".bmp", + ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", + ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", + ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ] /* 列出的文件类型 */ + +} \ No newline at end of file diff --git a/zq-erp/src/main/resources/config/xcshop/system.properties b/zq-erp/src/main/resources/config/xcshop/system.properties new file mode 100644 index 0000000..db3c494 --- /dev/null +++ b/zq-erp/src/main/resources/config/xcshop/system.properties @@ -0,0 +1,98 @@ +#是否启用debug模式 +debug=false +# 日志文件保存地址 +log_path=/mnt/xcshop/log + +# 系统语言环境 zh中文,us英文 +system_language=zh + +# 错误密码允许输入的次数,大于五次后账号锁定,0表示不锁账号 +error_password_times=5 +# 默认密码 +default_password=123 + +#nginx静态资源访问地址 +static_resource_url=http://xcshop.csxuncong.com/uploadfile/ +#文件保存地址 +file_storage_path=/mnt/xcshop/uploadfile/ +#文件上传大小字节为单位 10MB +maxUploadSize=10485760 + + +#Matser\u7684ip\u5730\u5740 +redis.hostname=120.27.238.55 +#\u7AEF\u53E3\u53F7 +redis.port=6379 +#\u5982\u679C\u6709\u5BC6\u7801 +redis.password=xcong123 +#\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 +redis.timeout=10000 +redis.database=2 +redis_time_out=1800000 +cookie_time_out=36000 + +#APP登录公钥 +login_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCWvK6UWCtSp/8qnTqyUfO0wbg4CuxOe7IeiDSAmATfHnWqBPnbZ73qQ4A90vGowB7mp5XnmBvgTwfXtDh08yd4btlHwSD3ShbRyGfGfV8lc47ZTLiJH0xuuN2iHfnfj8zQ5kcqijeotggo2rF8Uu7KSR3HxVyN9mO22C6p1r5wVQIDAQAB +#APP登录秘钥 +login_private_key=MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJa8rpRYK1Kn/yqdOrJR87TBuDgK7E57sh6INICYBN8edaoE+dtnvepDgD3S8ajAHuanleeYG+BPB9e0OHTzJ3hu2UfBIPdKFtHIZ8Z9XyVzjtlMuIkfTG643aId+d+PzNDmRyqKN6i2CCjasXxS7spJHcfFXI32Y7bYLqnWvnBVAgMBAAECgYBNzQFGq+NgfDllo1WCaG4jI8GTm3+wWoPq4l5G6S/KgYw1vu+/YOJTIZf1UQVOFitc3a6vpIDu25uup+Rj6IS8B4V8NDfc8P+iMNwdIKqqBj8wHu0/SaxYdW1uqlU5+XkJMxsNMgNRRGPSIQhla5OPHtBzIa7t4lmypETMZtXEmQJBAMsa1OIQzAKU05GweCnNNSoqo/nAQLqp8zfbJypxRx24uaCyS7C+KxN+O4FyaYmM9n0X+cgkr+RYHAIa7mg3gccCQQC9/nJvRBum8+4TINnz6QrvTmTlhi8QKW/CiRYpGgmo5PtQYw4BkRQbYO8ktFDM2yeO75XBv09qnGQaivDCeL0DAkEAisFg8LSy+4x7YcvivAQirxUEg2qRjjTvIZjKEBflkuuRfbRxO2Uf/qg9tPjaGwu/lcScc9yEggaj09hcSbyqHwJAN8QLiqUPCL3oTy0BTBpG316/Nq9f+Ppwl0TtgDroQu6S5VFttwACStb02m0imj5pKgcgibHBeaVVrITDjhEqSQJAaCHD/ytTzgtgLoVVyZZxOB272W7PI3mnzL8qQSldx1/QOBs1NmmEZuo7ELFMrfTmlxa1qR4gsq/ImfIdUdXewQ== + + +#日志文件清理阈值 单位:MB +log_max=20 +#日志清理天数 +log_clear_day=5 + + + + +wechar_login_url =https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code +xcx_appid =wx5cc58f796224af61 +xcx_secret =facea088aae414e5c2ee86b459887721 +gzh_appid=wx57e6335559bdbda6 +gzh_secret=ecb408af170e3890e6544290cad33760 + +#微信支付调试开关 +wx_pay_debug_onoff = false + +#快递鸟用户id +logistics.eBusinessID=1530881 +#快递鸟密钥 +logistics.appKey=f1cf9777-26fb-4e3f-a14d-896075e6384e +#快递鸟接口地址 +logistics.url=http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx +#快递鸟接口指令 +logistics.requestType=1002 + + + + +#发送短信配置 +crm.request_url = http://192.168.1.248 +sms.request_url = http://smssh1.253.com +sms.login_account = M7315130 +sms.login_password = J7FAoehPkv63e3 +sms.login_accountNe = N4617160 +sms.login_passwordNe = rb1cxLitRB83e0 + +#接入统一登录平台配置 +platform_app_code = wx_shop +platform_secret_key = b21e309f07964e4fae5b156d74b5d66z +#platform_verity_url = http://localhost:8080/platform/getUserInfo +platform_verity_url = http://stg1-xcerp-ca.xc.jyymatrix.cc/platform/getUserInfo + +qrcodeBackgroundImgPath=/mnt/xcshop/webresource/static/xcxresource/bj1.png +qrcodeFrontImgPath=/mnt/xcshop/webresource/static/xcxresource/qj2.png + +#hive仓库地址 +hive.service=http://localhost:8082/meidu-crm/ + + + +#是否启用异常上报 +is_open_exception_report=true +showExcptionUrl=http://xcshop.csxuncong.com/showException + + +#异常信息查询接口 +showExcptionUrl=http://xcshop.csxuncong.com/showException + diff --git a/zq-erp/src/main/resources/config/xcx/application.properties b/zq-erp/src/main/resources/config/xcx/application.properties index 20b3119..db72327 100644 --- a/zq-erp/src/main/resources/config/xcx/application.properties +++ b/zq-erp/src/main/resources/config/xcx/application.properties @@ -1,8 +1,17 @@ -evn=xcx +evn=xcxtest server.port=8080 -spring.datasource.username=chuhuan -spring.datasource.password=chuhuan -spring.datasource.url=jdbc:mysql://119.3.52.84:3306/hive_plus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + + +#线上测试环境 + +spring.datasource.username=ct_test +spring.datasource.password=123456 +spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 + + + + + spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.initialSize=3 spring.datasource.minIdle=3 @@ -25,21 +34,18 @@ #spring.jackson.time-zone=GMT+8 #spring.jackson.serialization.write-dates-as-timestamps=true #文件上传时的大小限制 单位M -spring.servlet.multipart.max-file-size=300MB -spring.servlet.multipart.max-request-size=300MB +spring.servlet.multipart.max-file-size=100MB +spring.servlet.multipart.max-request-size=100MB #-------------------------------------- - #rabbitMQ配置 -rabbitmq.host=127.0.0.1 +rabbitmq.host=47.111.134.136 rabbitmq.port=5672 rabbitmq.username=hivequeue rabbitmq.password=hivequeueadmin -useRabbit=true +useRabbit=false -#指定消费者确认方式 当为manual时手动确认 不配置表示自动确认 -#spring.rabbitmq.listener.simple.acknowledge-mode=manual server.session.timeout=120 ali.sms.accessKeyId=LTAI4FrjY9R9iDfC6YQTHfne @@ -47,12 +53,16 @@ ali.sms.regionId=cn-hangzhou ali.sms.signName=\u80bd\u598d - #hour activities.groupBuy.limit=24 #minute groupBuy.pay.timeLimit=30 -#定时任务 -scheduling.enabled=true -swagger.enable=false \ No newline at end of file +#定时任务 +scheduling.enabled=false + +swagger.enable=false +swagger.security.username=admin +swagger.security.password=admin + + diff --git a/zq-erp/src/main/resources/config/xcx/config.json b/zq-erp/src/main/resources/config/xcx/config.json index 1b5f059..09db45c 100644 --- a/zq-erp/src/main/resources/config/xcx/config.json +++ b/zq-erp/src/main/resources/config/xcx/config.json @@ -8,7 +8,7 @@ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 1600, /* 图片压缩最长边限制 */ "imageInsertAlign": "none", /* 插入的图片浮动方式 */ - "imageUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "imageUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "imagePathFormat": "/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ @@ -28,13 +28,13 @@ "scrawlFieldName": "upfile", /* 提交的图片表单名称 */ "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ "scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ - "scrawlUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "scrawlUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "scrawlInsertAlign": "none", /* 截图工具上传 */ "snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "snapscreenUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "snapscreenUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ /* 抓取远程图片配置 */ @@ -42,7 +42,7 @@ "catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ "catcherFieldName": "source", /* 提交的图片列表表单名称 */ "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ - "catcherUrlPrefix": "http://resource.hive.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ + "catcherUrlPrefix": "http://filehive2.jyymatrix.cc/uploadeFile", /* 图片访问路径前缀 */ "catcherMaxSize": 2048000, /* 上传大小限制,单位B */ "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ diff --git a/zq-erp/src/main/resources/config/xcx/system.properties b/zq-erp/src/main/resources/config/xcx/system.properties index ebc6e32..1a58898 100644 --- a/zq-erp/src/main/resources/config/xcx/system.properties +++ b/zq-erp/src/main/resources/config/xcx/system.properties @@ -1,7 +1,7 @@ #是否启用debug模式 debug=false # 日志文件保存地址 -log_path=/mnt/hive/log +log_path=/mnt/hive/log-test # 系统语言环境 zh中文,us英文 system_language=zh @@ -12,24 +12,23 @@ default_password=123 #nginx静态资源访问地址 -static_resource_url=https://filehive2.jyymatrix.cc/uploadeFile/ +static_resource_url=http://hwfile.jyymatrix.cc/ #文件保存地址 -file_storage_path=/mnt/hive/static/uploadeFile/ +file_storage_path=/mnt/sdc/webresource/ #文件上传大小字节为单位 10MB maxUploadSize=10485760 + #Matser\u7684ip\u5730\u5740 -redis.hostname=118.31.227.147 +redis.hostname=120.27.238.55 #\u7AEF\u53E3\u53F7 redis.port=6379 #\u5982\u679C\u6709\u5BC6\u7801 -redis.password=123456 +redis.password=xcong123 #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 redis.timeout=10000 redis.database=1 redis_time_out=1800000 - - cookie_time_out=36000 #APP登录公钥 @@ -37,16 +36,6 @@ #APP登录秘钥 login_private_key=MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJa8rpRYK1Kn/yqdOrJR87TBuDgK7E57sh6INICYBN8edaoE+dtnvepDgD3S8ajAHuanleeYG+BPB9e0OHTzJ3hu2UfBIPdKFtHIZ8Z9XyVzjtlMuIkfTG643aId+d+PzNDmRyqKN6i2CCjasXxS7spJHcfFXI32Y7bYLqnWvnBVAgMBAAECgYBNzQFGq+NgfDllo1WCaG4jI8GTm3+wWoPq4l5G6S/KgYw1vu+/YOJTIZf1UQVOFitc3a6vpIDu25uup+Rj6IS8B4V8NDfc8P+iMNwdIKqqBj8wHu0/SaxYdW1uqlU5+XkJMxsNMgNRRGPSIQhla5OPHtBzIa7t4lmypETMZtXEmQJBAMsa1OIQzAKU05GweCnNNSoqo/nAQLqp8zfbJypxRx24uaCyS7C+KxN+O4FyaYmM9n0X+cgkr+RYHAIa7mg3gccCQQC9/nJvRBum8+4TINnz6QrvTmTlhi8QKW/CiRYpGgmo5PtQYw4BkRQbYO8ktFDM2yeO75XBv09qnGQaivDCeL0DAkEAisFg8LSy+4x7YcvivAQirxUEg2qRjjTvIZjKEBflkuuRfbRxO2Uf/qg9tPjaGwu/lcScc9yEggaj09hcSbyqHwJAN8QLiqUPCL3oTy0BTBpG316/Nq9f+Ppwl0TtgDroQu6S5VFttwACStb02m0imj5pKgcgibHBeaVVrITDjhEqSQJAaCHD/ytTzgtgLoVVyZZxOB272W7PI3mnzL8qQSldx1/QOBs1NmmEZuo7ELFMrfTmlxa1qR4gsq/ImfIdUdXewQ== -#是否启用异常上报 -is_open_exception_report=true -showExcptionUrl=http://erp.hive.jyymatrix.cc/showException - -#异常上报地址 -exception_center_url =http://geek.xc.jyymatrix.cc/addException -#项目编号 -projNo=78 -#项目负责人 -owner=姜友瑶 #日志文件清理阈值 单位:MB log_max=20 @@ -57,8 +46,10 @@ wechar_login_url =https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code -xcx_appid =wx3836ab3c1490ff29 -xcx_secret =39a3687ec5b2666ed68e7c8b83b26b47 +xcx_appid =wx5cc58f796224af61 +xcx_secret =facea088aae414e5c2ee86b459887721 +gzh_appid=wx57e6335559bdbda6 +gzh_secret=ecb408af170e3890e6544290cad33760 #微信支付调试开关 wx_pay_debug_onoff = false @@ -72,12 +63,8 @@ #快递鸟接口指令 logistics.requestType=1002 -#丰桥顾客编码 -sf.logistics.clientCode=XCZHYF -#丰桥校验码 -sf.logistics.checkword=zqcjA2A5m6MIGa6mImMcnpKQ9ipYlbUW -#丰桥接口地址 -sf.logistics.url=https://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService + + #发送短信配置 crm.request_url = http://192.168.1.248 @@ -96,9 +83,19 @@ #微信支付回调地址 pay_notify_url = https://xcxhive2.jyymatrix.cc/wxCommon/wxpayCallback - qrcodeBackgroundImgPath=/mnt/xcshop/webresource/static/xcxresource/bj1.png qrcodeFrontImgPath=/mnt/xcshop/webresource/static/xcxresource/qj2.png #hive仓库地址 -hive.service=http://erp.hive.jyymatrix.cc/meidu-crm/ \ No newline at end of file +hive.service=http://localhost:8082/meidu-crm/ + + + +#是否启用异常上报 +is_open_exception_report=true +showExcptionUrl=http://erp.hive.jyymatrix.cc/showException + + +#异常信息查询接口 +showExcptionUrl=http://erp.hive.jyymatrix.cc/showException + diff --git a/zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/MoneyCardUseMapperImpl.java b/zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/MoneyCardUseMapperImpl.java new file mode 100644 index 0000000..460e41c --- /dev/null +++ b/zq-erp/src/main/resources/generated-sources/annotations/com/matrix/system/app/mapper/MoneyCardUseMapperImpl.java @@ -0,0 +1,52 @@ +package com.matrix.system.app.mapper; + +import com.matrix.system.app.vo.VipCardListVo; +import com.matrix.system.hive.bean.MoneyCardUse; + +import javax.annotation.Generated; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Generated( + value = "org.mapstruct.ap.MappingProcessor", + date = "2021-01-26T20:08:11+0800", + comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)" +) +public class MoneyCardUseMapperImpl extends MoneyCardUseMapper { + + @Override + public VipCardListVo entityToCardListVo(MoneyCardUse moneyCardUse) { + if ( moneyCardUse == null ) { + return null; + } + + VipCardListVo vipCardListVo = new VipCardListVo(); + + vipCardListVo.setCardName( moneyCardUse.getCardName() ); + if ( moneyCardUse.getRealMoney() != null ) { + vipCardListVo.setRealMoney( BigDecimal.valueOf( moneyCardUse.getRealMoney() ) ); + } + if ( moneyCardUse.getGiftMoney() != null ) { + vipCardListVo.setGiftMoney( BigDecimal.valueOf( moneyCardUse.getGiftMoney() ) ); + } + vipCardListVo.setStatus( moneyCardUse.getStatus() ); + vipCardListVo.setFailTime( moneyCardUse.getFailTime() ); + + return vipCardListVo; + } + + @Override + public List<VipCardListVo> entitiesToCardListVos(List<MoneyCardUse> list) { + if ( list == null ) { + return null; + } + + List<VipCardListVo> list1 = new ArrayList<VipCardListVo>( list.size() ); + for ( MoneyCardUse moneyCardUse : list ) { + list1.add( entityToCardListVo( moneyCardUse ) ); + } + + return list1; + } +} diff --git a/zq-erp/src/main/resources/log4j.properties b/zq-erp/src/main/resources/log4j.properties index ddcc0ef..bc5c1bb 100644 --- a/zq-erp/src/main/resources/log4j.properties +++ b/zq-erp/src/main/resources/log4j.properties @@ -15,39 +15,43 @@ log4j.appender.STDOUT = org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.Target = System.out log4j.appender.STDOUT.Threshold = DEBUG +log4j.appender.STDOUT.MaxFileSize = 100M log4j.appender.STDOUT.layout = org.apache.log4j.PatternLayout -log4j.appender.STDOUT.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n +log4j.appender.STDOUT.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n -### 输出DEBUG 级别以上的日志到=/error.log ### +# 输出DEBUG 级别以上的日志到=/error.log ### log4j.appender.DEBUG = com.matrix.core.tools.MatrixFileAppender log4j.appender.DEBUG.File = /debug.log log4j.appender.DEBUG.Append = true -log4j.appender.DEBUG.Threshold = DEBUG +log4j.appender.DEBUG.Threshold = DEBUG +log4j.appender.DEBUG.MaxFileSize = 100M +log4j.appender.DEBUG.MaxBackupIndex = 7 log4j.appender.DEBUG.layout = org.apache.log4j.PatternLayout log4j.appender.DEBUG.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n -log4j.appender.INFO = com.matrix.core.tools.MatrixFileAppender -log4j.appender.INFO.File = /info.log -log4j.appender.INFO.Append = true -log4j.appender.INFO.Threshold = INFO -log4j.appender.INFO.layout = org.apache.log4j.PatternLayout -log4j.appender.INFO.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n +#log4j.appender.INFO = com.matrix.core.tools.MatrixFileAppender +#log4j.appender.INFO.File = /info.log +#log4j.appender.INFO.Append = true +#log4j.appender.INFO.Threshold = INFO +#log4j.appender.INFO.MaxBackupIndex = 5 +#log4j.appender.INFO.layout = org.apache.log4j.PatternLayout +#log4j.appender.INFO.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n -log4j.appender.WARN = com.matrix.core.tools.MatrixFileAppender -log4j.appender.WARN.File = /warn.log -log4j.appender.WARN.Append = true -log4j.appender.WARN.Threshold = WARN -log4j.appender.WARN.layout = org.apache.log4j.PatternLayout -log4j.appender.WARN.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n - -### 输出ERROR 级别以上的日志到=/error.log ### -log4j.appender.ERROR = com.matrix.core.tools.MatrixFileAppender -log4j.appender.ERROR.File =/error.log -log4j.appender.ERROR.Append = true -log4j.appender.ERROR.Threshold = ERROR -log4j.appender.ERROR.layout = org.apache.log4j.PatternLayout -log4j.appender.ERROR.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n +#log4j.appender.WARN = com.matrix.core.tools.MatrixFileAppender +#log4j.appender.WARN.File = /warn.log +#log4j.appender.WARN.Append = true +#log4j.appender.WARN.Threshold = WARN +#log4j.appender.WARN.layout = org.apache.log4j.PatternLayout +#log4j.appender.WARN.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n +# +#### 输出ERROR 级别以上的日志到=/error.log ### +#log4j.appender.ERROR = com.matrix.core.tools.MatrixFileAppender +#log4j.appender.ERROR.File =/error.log +#log4j.appender.ERROR.Append = true +#log4j.appender.ERROR.Threshold = ERROR +#log4j.appender.ERROR.layout = org.apache.log4j.PatternLayout +#log4j.appender.ERROR.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss.SSS}-[ %X{Tr} ] [ %p ]-[ %t ] %m%n #mybatis log log4j.logger.druid.sql=INFO diff --git a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignAwardSetDao.xml b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignAwardSetDao.xml new file mode 100644 index 0000000..6d8b000 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignAwardSetDao.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.activity.dao.ActivitySignAwardSetDao"> + + <select id="selectListByActIDAndCompanyId" resultType="com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo"> + SELECT + * + FROM + activity_sign_award_set a + where + a.activity_id = #{actId} + and a.company_id = #{companyId} + and a.award_state = #{awardState} + </select> + + <select id="selectListByActIDAndCompanyIdAndAwardType" resultType="com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo"> + SELECT + * + FROM + activity_sign_award_set a + where + a.activity_id = #{actId} + and a.company_id = #{companyId} + and a.award_state = #{awardState} + and a.award_rule = #{awardRule} + </select> + + <select id="selectActivitySignAwardSetByActIDAndCompanyIdAndAwardType" resultType="com.matrix.system.activity.entity.ActivitySignAwardSet"> + SELECT + * + FROM + activity_sign_award_set a + where + a.activity_id = #{actId} + and a.company_id = #{companyId} + and a.award_state = #{awardState} + and a.award_rule = #{awardRule} + </select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml new file mode 100644 index 0000000..d15125a --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.activity.dao.ActivitySignReceiveRecordDao"> + + + <select id="findSignReceiveList" resultType="com.matrix.system.activity.vo.SignReceiveListVo"> + SELECT + a.id id, + b.nick_name nickName, + a.receive_time reciveTime, + a.state, + c.cumulative_day cumulativeDay, + c.award_type awardType, + c.award_name awardName, + c.coupon_name couponName, + c.score_cnt scoreCnt, + d.act_type actType, + c.award_rule awardRule + FROM + activity_sign_receive_record a + LEFT JOIN sys_vip_info b ON a.user_id = b.id + LEFT JOIN activity_sign_award_set c ON a.award_id = c.id + LEFT JOIN shop_activities d ON a.award_id = d.id + <where> + a.company_id = #{record.companyId} + and a.activity_id = #{record.actId} + <if test="record.yhmc != null and record.yhmc != ''"> + and b.nick_name like concat('%',#{record.yhmc},'%') + </if> + <if test="record.startTime != null "> + and a.receive_time >= #{record.startTime} + </if> + <if test="record.endTime != null"> + and #{record.endTime} >= a.receive_time + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="selectCouponList" resultType="com.matrix.system.activity.vo.CouponVo"> + SELECT + a.id id, + a.c_name cName, + a.end_time endTime + FROM + shop_coupon a + <where> + a.company_id = #{record.companyId} + <if test="record.yhjmc != null and record.yhjmc != ''"> + and a.c_name like concat('%',#{record.yhjmc},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="selectGoodsList" resultType="com.matrix.system.activity.vo.GoodsVo"> + SELECT + a.id id, + a.name name, + a.good_type goodType, + a.code code, + a.seal_pice sealPice + FROM + shopping_goods a + <where> + a.company_id = #{record.companyId} + <if test="record.cpmc != null and record.cpmc != ''"> + and a.name like concat('%',#{record.cpmc},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="getSignAwardReceiveCount" resultType="int"> + SELECT + count(a.id) + FROM + activity_sign_receive_record a + LEFT JOIN activity_sign_award_set b ON a.award_id = b.id + where + b.award_type = 1 + and a.company_id = #{companyId} + and a.user_id = #{userId} + + </select> + + <select id="selectSignAwardList" resultType="com.matrix.system.shopXcx.api.vo.SignAwardListVo"> + SELECT + a.id id, + a.state state, + 1 total, + a.receive_time receiveTime, + b.award_way awardWay, + b.introduce_img introduceImg, + b.award_name awardName + + FROM + activity_sign_receive_record a + LEFT JOIN activity_sign_award_set b ON a.award_id = b.id + WHERE + b.award_type = 1 + and a.company_id = #{record.companyId} + and a.user_id = #{record.userId} + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="selectSeeAwardTextVOById" resultType="com.matrix.system.shopXcx.api.vo.SeeAwardTextVo"> + SELECT + a.id id, + a.state state, + a.consignee_phone consigneePhone, + a.consignee_address consigneeAddress, + a.consignee, + a.receive_time receiveTime, + a.write_off_code writeOffCode, + 1 total, + b.wechat_img wechatImg, + b.prize_address prizeAddress, + b.operation_tip operationTip, + b.prize_end_time prizeEndTime, + b.prize_start_time prizeStartTime, + b.award_way awardWay, + b.introduce_img introduceImg, + b.customer_phone customerPhone, + b.award_name awardName + FROM + activity_sign_receive_record a + LEFT JOIN activity_sign_award_set b ON a.award_id = b.id + WHERE + a.id = #{record.awardId} + and a.company_id = #{record.companyId} + and a.user_id = #{record.userId} + </select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml new file mode 100644 index 0000000..140d8ff --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.activity.dao.ActivitySignRecordDao"> + <select id="selectOneByActIdAndUserIdLikesignTime" resultType="com.matrix.system.activity.entity.ActivitySignRecord"> + SELECT + * + FROM + activity_sign_record a + where + a.activity_id = #{actId} + and a.user_id = #{userId} + and a.sign_time like concat('%',DATE(#{format}),'%') + </select> + + <select id="selectRecordByMonth" resultType="com.matrix.system.shopXcx.api.vo.ActivitySignRecordVo"> + SELECT + * + FROM + activity_sign_record a + where a.sign_time like concat('%',DATE_FORMAT(#{date},'%Y-%m'),'%') + and a.activity_id = #{actId} + and a.user_id = #{userId} + </select> + + <select id="selectListByActIdAndUserIdLikesignTime" resultType="com.matrix.system.activity.entity.ActivitySignRecord"> + SELECT + * + FROM + activity_sign_record a + where + a.activity_id = #{actId} + and a.user_id = #{userId} + and a.sign_time like concat('%',DATE(#{format}),'%') +</select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignWriteoffDao.xml b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignWriteoffDao.xml new file mode 100644 index 0000000..748d06f --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignWriteoffDao.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.activity.dao.ActivitySignWriteoffDao"> + <!-- 定义ActivitySignWriteoff 的复杂关联map --> + <resultMap type="com.matrix.system.activity.entity.ActivitySignWriteoff" id="ActivitySignWriteoffMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="writeoffTime" column="writeoff_time" /> + <result property="writeoffUser" column="writeoff_user" /> + <result property="writeoffCode" column="writeoff_code" /> + <result property="actId" column="act_id" /> + <result property="awardId" column="award_id" /> + <result property="winTime" column="win_time" /> + <result property="state" column="state" /> + <result property="userId" column="user_id" /> + <result property="logisticsId" column="logistics_id" /> + <result property="receiveId" column="receive_id" /> + <result property="companyId" column="company_id" /> + <result property="shopId" column="shop_id" /> + <result property="writeoffUserid" column="writeoff_userid" /> + </resultMap> + + + <!-- 定义ActivitySignWriteoff 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.activity.entity.ActivitySignWriteoff" id="ActivitySignWriteoffSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="writeoffTime" column="writeoff_time" /> + <result property="writeoffUser" column="writeoff_user" /> + <result property="writeoffCode" column="writeoff_code" /> + <result property="actId" column="act_id" /> + <result property="awardId" column="award_id" /> + <result property="winTime" column="win_time" /> + <result property="state" column="state" /> + <result property="userId" column="user_id" /> + <result property="logisticsId" column="logistics_id" /> + <result property="receiveId" column="receive_id" /> + <result property="companyId" column="company_id" /> + <result property="shopId" column="shop_id" /> + <result property="writeoffUserid" column="writeoff_userid" /> + </resultMap> + + <select id="findSignWriteoffList" resultType="com.matrix.system.activity.vo.SignWriteoffListVo"> + SELECT + a.id id, + a.writeoff_time writeoffTime, + a.writeoff_user writeoffUser, + a.writeoff_code writeoffCode, + a.state state, + b.nick_name receiveName, + c.act_name actName, + d.award_way awardWay, + d.award_name awardName, + e.receive_time winTime, + f.receive_address receiveAddress + FROM + activity_sign_writeoff a + left join sys_vip_info b on a.user_id= b.id + left join shop_activities c on a.act_id= c.id + left join activity_sign_award_set d on a.award_id= d.id + left join activity_sign_receive_record e on a.receive_id= e.id + left join shop_delivery_info f on a.logistics_id= f.id + <where> + a.company_id = #{record.companyId} + <if test="record.zjzxm != null and record.zjzxm != ''"> + and b.nick_name like concat('%',#{record.zjzxm},'%') + </if> + <if test="record.hdmcbm != null and record.hdmcbm != ''"> + and (c.act_name like concat('%',#{record.hdmcbm},'%') or c.act_code like concat('%',#{record.hdmcbm},'%')) + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="selectUsernameByUserId" resultType="com.matrix.system.activity.vo.ZjrVo"> + SELECT + a.receive_time zjsj, + b.nick_name zjr + FROM + activity_sign_receive_record a + left join sys_vip_info b on a.user_id= b.id + where a.user_id = #{userId} and a.award_id = #{receiveId} + </select> + + <select id="selectShopDeliveryInfoByLogisticsId" resultType="com.matrix.system.shopXcx.bean.ShopDeliveryInfo"> + SELECT + * + FROM + shop_delivery_info a + where a.id = #{logisticsId} + </select> + + <select id="selectActivitySignWriteoffByUserIDAndReceiveId" resultType="com.matrix.system.activity.entity.ActivitySignWriteoff"> + SELECT + * + FROM + activity_sign_writeoff a + where a.receive_id = #{receiveId} + and a.user_id = #{userId} + </select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml index 7a0cfce..f6c6831 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml @@ -1,397 +1,407 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.common.dao.BusParameterSettingsDao"> - <!-- 定义BusParameterSettings 的复杂关联map --> - <resultMap type="com.matrix.system.common.bean.BusParameterSettings" id="BusParameterSettingsMap"> - <id property="paramId" column="param_id"/> - <result property="paramCode" column="param_code"/> - <result property="paramValue" column="param_value"/> - <result property="paramValue1" column="param_value1"/> - <result property="paramValue2" column="param_value2"/> - <result property="paramValue3" column="param_value3"/> - <result property="companyId" column="company_id"/> - <result property="shopId" column="shop_id"/> - </resultMap> - - - <!-- 定义BusParameterSettings 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.common.bean.BusParameterSettings" id="BusParameterSettingsSimpleMap"> - <id property="paramId" column="param_id"/> - <result property="paramCode" column="param_code"/> - <result property="paramValue" column="param_value"/> - <result property="paramValue1" column="param_value1"/> - <result property="paramValue2" column="param_value2"/> - <result property="paramValue3" column="param_value3"/> - <result property="companyId" column="company_id"/> - <result property="shopId" column="shop_id"/> - </resultMap> - - - <!-- 插入方法 --> - <insert id="insert" parameterType="com.matrix.system.common.bean.BusParameterSettings" - useGeneratedKeys="true" keyProperty="paramId"> - INSERT INTO bus_parameter_settings ( - param_id, - param_code, - param_value, - param_value1, - param_value2, - param_value3, - company_id, - shop_id - ) - VALUES ( - #{paramId}, - #{paramCode}, - #{paramValue}, - #{paramValue1}, - #{paramValue2}, - #{paramValue3}, - #{companyId}, - #{shopId} - ) - </insert> - - - <!-- 批量插入 --> - <insert id="batchInsert" parameterType="java.util.List"> - INSERT INTO bus_parameter_settings ( - param_id, - param_code, - param_value, - param_value1, - param_value2, - param_value3, - company_id, - shop_id - ) - VALUES - <foreach collection="list" item="item" index="index" separator=",">( - #{item.paramId}, - #{item.paramCode}, - #{item.paramValue}, - #{item.paramValue1}, - #{item.paramValue2}, - #{item.paramValue3}, - #{item.companyId}, - #{item.shopId} - ) - </foreach> - </insert> - - - <!-- 根据Map更新 部分更新 --> - <update id="updateByMap" parameterType="java.util.HashMap"> - UPDATE bus_parameter_settings - <set> - <if test="_parameter.containsKey('paramCode')"> - param_code = #{paramCode}, - </if> - <if test="_parameter.containsKey('paramValue')"> - param_value = #{paramValue}, - </if> - <if test="_parameter.containsKey('paramValue1')"> - param_value1 = #{paramValue1}, - </if> - <if test="_parameter.containsKey('paramValue2')"> - param_value2 = #{paramValue2}, - </if> - <if test="_parameter.containsKey('paramValue3')"> - param_value3 = #{paramValue3}, - </if> - <if test="_parameter.containsKey('companyId')"> - company_id = #{companyId}, - </if> - <if test="_parameter.containsKey('shopId')"> - shop_id = #{shopId}, - </if> - </set> - WHERE param_id=#{paramId} - </update> - - - <!-- 根据对象更新 部分更新 --> - <update id="updateByModel" parameterType="Long"> - UPDATE bus_parameter_settings - <set> - <if test="(paramCode!=null and paramCode!='') or (paramCode!='' and paramCode==0)"> - param_code = #{paramCode}, - </if> - <if test="(paramValue!=null and paramValue!='') or (paramValue!='' and paramValue==0)"> - param_value = #{paramValue}, - </if> - <if test="(paramValue1!=null and paramValue1!='') or (paramValue1!='' and paramValue1==0)"> - param_value1 = #{paramValue1}, - </if> - <if test="(paramValue2!=null and paramValue2!='') or (paramValue2!='' and paramValue2==0)"> - param_value2 = #{paramValue2}, - </if> - <if test="(paramValue3!=null and paramValue3!='') or (paramValue3!='' and paramValue3==0)"> - param_value3 = #{paramValue3}, - </if> - <if test="(companyId!=null and companyId!='') "> - company_id = #{companyId} - </if> - <if test="(shopId!=null and shopId!='') "> - shop_id = #{shopId} - </if> - </set> - WHERE param_id=#{paramId} - </update> - - <update id="updateParams" parameterType="java.util.List"> - <foreach collection="list" index="index" item="item" separator=";"> - UPDATE bus_parameter_settings - <set> - <if test="(item.paramValue!=null ) "> - param_value = #{item.paramValue}, - </if> - <if test="(item.paramValue1!=null) "> - param_value1 = #{item.paramValue1}, - </if> - <if test="(item.paramValue2!=null) "> - param_value2 = #{item.paramValue2}, - </if> - <if test="(item.paramValue3!=null ) "> - param_value3 = #{item.paramValue3}, - </if> - <if test="(item.shopId!=null ) "> - shop_id = #{item.shopId}, - </if> - </set> - where param_code = #{item.paramCode} and company_id = #{companyId} - </foreach> - </update> - - - <!-- 批量删除 --> - <delete id="deleteByIds" parameterType="java.util.List"> - delete from bus_parameter_settings where param_id in - <foreach collection="list" index="index" item="item" open="(" - separator="," close=")"> - #{item} - </foreach> - </delete> - - <!-- 根据id删除--> - <delete id="deleteById" parameterType="Long"> - DELETE FROM bus_parameter_settings - where param_id=#{paramId} - </delete> - - <!-- 根据对象删除--> - <delete id="deleteByModel" parameterType="Long"> - DELETE FROM bus_parameter_settings - where 1=1 - <if test="record!=null"> - <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> - and param_id = #{record.paramId} - </if> - <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> - and param_code = #{record.paramCode} - </if> - <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> - and param_value = #{record.paramValue} - </if> - <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> - and param_value1 = #{record.paramValue1} - </if> - <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> - and param_value2 = #{record.paramValue2} - </if> - <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> - and param_value3 = #{record.paramValue3} - </if> - <if test="(record.companyId!=null and record.companyId!='') "> - and company_id = #{record.companyId} - </if> - <if test="(record.shopId!=null and record.shopId!='') "> - and shop_id = #{record.shopId} - </if> - </if> - </delete> - - - <!-- 分页查询 --> - <select id="selectInPage" resultMap="BusParameterSettingsMap"> - select - param_id, - param_code, - param_value, - param_value1, - param_value2, - param_value3, - company_id, - shop_id - from bus_parameter_settings - where 1=1 - <if test="record!=null"> - <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> - and param_id = #{record.paramId} - </if> - <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> - and param_code = #{record.paramCode} - </if> - <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> - and param_value = #{record.paramValue} - </if> - <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> - and param_value1 = #{record.paramValue1} - </if> - <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> - and param_value2 = #{record.paramValue2} - </if> - <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> - and param_value3 = #{record.paramValue3} - </if> - <if test="(record.companyId!=null and record.companyId!='') "> - and company_id = #{record.companyId} - </if> - <if test="(record.shopId!=null and record.shopId!='') "> - and shop_id = #{record.shopId} - </if> - </if> - <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> - <if test="pageVo.sort !=null and pageVo.order !=null"> - order by - ${pageVo.sort} ${pageVo.order} - </if> - <if test="pageVo.offset >=0 and pageVo.limit >0"> - limit - #{pageVo.offset},#{pageVo.limit} - </if> - </if> - </select> - - <!-- 查询总条数 --> - <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> - select count(*) - from bus_parameter_settings - where 1=1 - <if test="record!=null"> - <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> - and param_id = #{record.paramId} - </if> - <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> - and param_code = #{record.paramCode} - </if> - <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> - and param_value = #{record.paramValue} - </if> - <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> - and param_value1 = #{record.paramValue1} - </if> - <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> - and param_value2 = #{record.paramValue2} - </if> - <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> - and param_value3 = #{record.paramValue3} - </if> - <if test="(record.companyId!=null and record.companyId!='') "> - and company_id = #{record.companyId} - </if> - - <if test="(record.shopId!=null and record.shopId!='') "> - and shop_id = #{record.shopId} - </if> - </if> - </select> - - <!-- 根据id查询--> - <select id="selectById" resultMap="BusParameterSettingsMap"> - select - param_id, - param_code, - param_value, - param_value1, - param_value2, - param_value3, - company_id, - shop_id - from bus_parameter_settings - where param_id=#{paramId} - </select> - - - <!-- 根据id 锁表查询--> - <select id="selectForUpdate" resultMap="BusParameterSettingsMap"> - select - param_id, - param_code, - param_value, - param_value1, - param_value2, - param_value3, - company_id, - shop_id - from bus_parameter_settings - where param_id=#{param_id} - for update - </select> - - - <!-- 根据对象查询--> - <select id="selectByModel" resultMap="BusParameterSettingsMap"> - select - param_id, - param_code, - param_value, - param_value1, - param_value2, - param_value3, - company_id, - shop_id - from bus_parameter_settings - where 1=1 - <if test="record!=null"> - <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> - and param_id = #{record.paramId} - </if> - <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> - and param_code = #{record.paramCode} - </if> - <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> - and param_value = #{record.paramValue} - </if> - <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> - and param_value1 = #{record.paramValue1} - </if> - <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> - and param_value2 = #{record.paramValue2} - </if> - <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> - and param_value3 = #{record.paramValue3} - </if> - <if test="(record.companyId!=null and record.companyId!='') "> - and company_id = #{record.companyId} - </if> - - <if test="(record.shopId!=null and record.shopId!='') "> - and shop_id = #{record.shopId} - </if> - </if> - </select> - - <select id="selectByCodes" resultMap="BusParameterSettingsMap"> - - select * from bus_parameter_settings where company_id=#{companyId} and shop_id=#{shopId} - and param_code in - <foreach collection="list" index="index" item="item" open="(" - separator="," close=")"> - #{item} - </foreach> - </select> - - <select id="selectByCode" resultMap="BusParameterSettingsMap"> - select * from bus_parameter_settings where - param_code=#{code} - and company_id=#{companyId} and shop_id=#{shopId} - </select> - <select id="selectCompanyParamByCode" resultMap="BusParameterSettingsMap"> - select * from bus_parameter_settings where - param_code=#{code} - and company_id=#{companyId} - </select> +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.common.dao.BusParameterSettingsDao"> + <!-- 定义BusParameterSettings 的复杂关联map --> + <resultMap type="com.matrix.system.common.bean.BusParameterSettings" id="BusParameterSettingsMap"> + <id property="paramId" column="param_id"/> + <result property="paramCode" column="param_code"/> + <result property="paramValue" column="param_value"/> + <result property="paramValue1" column="param_value1"/> + <result property="paramValue2" column="param_value2"/> + <result property="paramValue3" column="param_value3"/> + <result property="companyId" column="company_id"/> + <result property="shopId" column="shop_id"/> + </resultMap> + + + <!-- 定义BusParameterSettings 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.common.bean.BusParameterSettings" id="BusParameterSettingsSimpleMap"> + <id property="paramId" column="param_id"/> + <result property="paramCode" column="param_code"/> + <result property="paramValue" column="param_value"/> + <result property="paramValue1" column="param_value1"/> + <result property="paramValue2" column="param_value2"/> + <result property="paramValue3" column="param_value3"/> + <result property="companyId" column="company_id"/> + <result property="shopId" column="shop_id"/> + </resultMap> + + + <!-- 插入方法 --> + <insert id="insert" parameterType="com.matrix.system.common.bean.BusParameterSettings" + useGeneratedKeys="true" keyProperty="paramId"> + INSERT INTO bus_parameter_settings ( + param_id, + param_code, + param_value, + param_value1, + param_value2, + param_value3, + company_id, + shop_id + ) + VALUES ( + #{paramId}, + #{paramCode}, + #{paramValue}, + #{paramValue1}, + #{paramValue2}, + #{paramValue3}, + #{companyId}, + #{shopId} + ) + </insert> + + + <!-- 批量插入 --> + <insert id="batchInsert" parameterType="java.util.List"> + INSERT INTO bus_parameter_settings ( + param_id, + param_code, + param_value, + param_value1, + param_value2, + param_value3, + company_id, + shop_id + ) + VALUES + <foreach collection="list" item="item" index="index" separator=",">( + #{item.paramId}, + #{item.paramCode}, + #{item.paramValue}, + #{item.paramValue1}, + #{item.paramValue2}, + #{item.paramValue3}, + #{item.companyId}, + #{item.shopId} + ) + </foreach> + </insert> + + + <!-- 根据Map更新 部分更新 --> + <update id="updateByMap" parameterType="java.util.HashMap"> + UPDATE bus_parameter_settings + <set> + <if test="_parameter.containsKey('paramCode')"> + param_code = #{paramCode}, + </if> + <if test="_parameter.containsKey('paramValue')"> + param_value = #{paramValue}, + </if> + <if test="_parameter.containsKey('paramValue1')"> + param_value1 = #{paramValue1}, + </if> + <if test="_parameter.containsKey('paramValue2')"> + param_value2 = #{paramValue2}, + </if> + <if test="_parameter.containsKey('paramValue3')"> + param_value3 = #{paramValue3}, + </if> + <if test="_parameter.containsKey('companyId')"> + company_id = #{companyId}, + </if> + <if test="_parameter.containsKey('shopId')"> + shop_id = #{shopId}, + </if> + </set> + WHERE param_id=#{paramId} + </update> + + + <!-- 根据对象更新 部分更新 --> + <update id="updateByModel" parameterType="Long"> + UPDATE bus_parameter_settings + <set> + <if test="(paramCode!=null and paramCode!='') or (paramCode!='' and paramCode==0)"> + param_code = #{paramCode}, + </if> + <if test="(paramValue!=null and paramValue!='') or (paramValue!='' and paramValue==0)"> + param_value = #{paramValue}, + </if> + <if test="(paramValue1!=null and paramValue1!='') or (paramValue1!='' and paramValue1==0)"> + param_value1 = #{paramValue1}, + </if> + <if test="(paramValue2!=null and paramValue2!='') or (paramValue2!='' and paramValue2==0)"> + param_value2 = #{paramValue2}, + </if> + <if test="(paramValue3!=null and paramValue3!='') or (paramValue3!='' and paramValue3==0)"> + param_value3 = #{paramValue3}, + </if> + <if test="(companyId!=null and companyId!='') "> + company_id = #{companyId} + </if> + <if test="(shopId!=null and shopId!='') "> + shop_id = #{shopId} + </if> + </set> + WHERE param_id=#{paramId} + </update> + + <update id="updateParams" parameterType="java.util.List"> + <foreach collection="list" index="index" item="item" separator=";"> + UPDATE bus_parameter_settings + <set> + <if test="(item.paramValue!=null ) "> + param_value = #{item.paramValue}, + </if> + <if test="(item.paramValue1!=null) "> + param_value1 = #{item.paramValue1}, + </if> + <if test="(item.paramValue2!=null) "> + param_value2 = #{item.paramValue2}, + </if> + <if test="(item.paramValue3!=null ) "> + param_value3 = #{item.paramValue3}, + </if> + <if test="(item.shopId!=null ) "> + shop_id = #{item.shopId}, + </if> + </set> + where param_code = #{item.paramCode} and company_id = #{companyId} + </foreach> + </update> + + + <!-- 批量删除 --> + <delete id="deleteByIds" parameterType="java.util.List"> + delete from bus_parameter_settings where param_id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 根据id删除--> + <delete id="deleteById" parameterType="Long"> + DELETE FROM bus_parameter_settings + where param_id=#{paramId} + </delete> + + <!-- 根据对象删除--> + <delete id="deleteByModel" parameterType="Long"> + DELETE FROM bus_parameter_settings + where 1=1 + <if test="record!=null"> + <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> + and param_id = #{record.paramId} + </if> + <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> + and param_code = #{record.paramCode} + </if> + <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> + and param_value = #{record.paramValue} + </if> + <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> + and param_value1 = #{record.paramValue1} + </if> + <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> + and param_value2 = #{record.paramValue2} + </if> + <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> + and param_value3 = #{record.paramValue3} + </if> + <if test="(record.companyId!=null and record.companyId!='') "> + and company_id = #{record.companyId} + </if> + <if test="(record.shopId!=null and record.shopId!='') "> + and shop_id = #{record.shopId} + </if> + </if> + </delete> + + + <!-- 分页查询 --> + <select id="selectInPage" resultMap="BusParameterSettingsMap"> + select + param_id, + param_code, + param_value, + param_value1, + param_value2, + param_value3, + company_id, + shop_id + from bus_parameter_settings + where 1=1 + <if test="record!=null"> + <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> + and param_id = #{record.paramId} + </if> + <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> + and param_code = #{record.paramCode} + </if> + <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> + and param_value = #{record.paramValue} + </if> + <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> + and param_value1 = #{record.paramValue1} + </if> + <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> + and param_value2 = #{record.paramValue2} + </if> + <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> + and param_value3 = #{record.paramValue3} + </if> + <if test="(record.companyId!=null and record.companyId!='') "> + and company_id = #{record.companyId} + </if> + <if test="(record.shopId!=null and record.shopId!='') "> + and shop_id = #{record.shopId} + </if> + </if> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <!-- 查询总条数 --> + <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> + select count(*) + from bus_parameter_settings + where 1=1 + <if test="record!=null"> + <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> + and param_id = #{record.paramId} + </if> + <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> + and param_code = #{record.paramCode} + </if> + <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> + and param_value = #{record.paramValue} + </if> + <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> + and param_value1 = #{record.paramValue1} + </if> + <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> + and param_value2 = #{record.paramValue2} + </if> + <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> + and param_value3 = #{record.paramValue3} + </if> + <if test="(record.companyId!=null and record.companyId!='') "> + and company_id = #{record.companyId} + </if> + + <if test="(record.shopId!=null and record.shopId!='') "> + and shop_id = #{record.shopId} + </if> + </if> + </select> + + <!-- 根据id查询--> + <select id="selectById" resultMap="BusParameterSettingsMap"> + select + param_id, + param_code, + param_value, + param_value1, + param_value2, + param_value3, + company_id, + shop_id + from bus_parameter_settings + where param_id=#{paramId} + </select> + + + <!-- 根据id 锁表查询--> + <select id="selectForUpdate" resultMap="BusParameterSettingsMap"> + select + param_id, + param_code, + param_value, + param_value1, + param_value2, + param_value3, + company_id, + shop_id + from bus_parameter_settings + where param_id=#{param_id} + for update + </select> + + + <!-- 根据对象查询--> + <select id="selectByModel" resultMap="BusParameterSettingsMap"> + select + param_id, + param_code, + param_value, + param_value1, + param_value2, + param_value3, + company_id, + shop_id + from bus_parameter_settings + where 1=1 + <if test="record!=null"> + <if test="(record.paramId!=null and record.paramId!='') or (record.paramId!='' and record.paramId==0)"> + and param_id = #{record.paramId} + </if> + <if test="(record.paramCode!=null and record.paramCode!='') or (record.paramCode!='' and record.paramCode==0)"> + and param_code = #{record.paramCode} + </if> + <if test="(record.paramValue!=null and record.paramValue!='') or (record.paramValue!='' and record.paramValue==0)"> + and param_value = #{record.paramValue} + </if> + <if test="(record.paramValue1!=null and record.paramValue1!='') or (record.paramValue1!='' and record.paramValue1==0)"> + and param_value1 = #{record.paramValue1} + </if> + <if test="(record.paramValue2!=null and record.paramValue2!='') or (record.paramValue2!='' and record.paramValue2==0)"> + and param_value2 = #{record.paramValue2} + </if> + <if test="(record.paramValue3!=null and record.paramValue3!='') or (record.paramValue3!='' and record.paramValue3==0)"> + and param_value3 = #{record.paramValue3} + </if> + <if test="(record.companyId!=null and record.companyId!='') "> + and company_id = #{record.companyId} + </if> + + <if test="(record.shopId!=null and record.shopId!='') "> + and shop_id = #{record.shopId} + </if> + </if> + </select> + + <select id="selectByCodes" resultMap="BusParameterSettingsMap"> + + select * from bus_parameter_settings where company_id=#{companyId} and shop_id=#{shopId} + and param_code in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </select> + + <select id="selectByCodesAndCompanyId" resultMap="BusParameterSettingsMap"> + + select * from bus_parameter_settings where company_id=#{companyId} + and param_code in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </select> + + <select id="selectByCode" resultMap="BusParameterSettingsMap"> + select * from bus_parameter_settings where + param_code=#{code} + and company_id=#{companyId} and shop_id=#{shopId} + </select> + <select id="selectCompanyParamByCode" resultMap="BusParameterSettingsMap"> + select * from bus_parameter_settings where + param_code=#{code} + and company_id=#{companyId} + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml index c9afd1d..5c612dd 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysCompanyDao.xml @@ -231,6 +231,9 @@ <if test="_parameter.containsKey('comPlats')"> com_plats = #{comPlats}, </if> + <if test="_parameter.containsKey('comCode')"> + com_code = #{comCode}, + </if> </set> WHERE com_id=#{comId} </update> @@ -694,7 +697,8 @@ com_logo, com_valid, com_functions, - com_plats + com_plats, + com_code from sys_company where com_id=#{comId} </select> @@ -757,7 +761,8 @@ com_logo, com_valid, com_functions, - com_plats + com_plats, + com_code from sys_company <where> <if test="record!=null"> @@ -846,10 +851,17 @@ and com_functions = #{record.comFunctions} </if> <if - test="(record.comPlats!=null and record.comPlats!='') or (record.comPlats!='' and record.comPlats==0)"> + test="(record.comPlats!=null and record.comPlats!='') or (record.comPlats!='' and record.comPlats==0)"> and com_plats = #{record.comPlats} + </if> + <if + test="(record.comCode!=null and record.comCode!='') or (record.comCode!='' and record.comCode==0)"> + and com_code = #{record.comCode} </if> </if> </where> </select> + <select id="selectAll" resultMap="SysCompanyMap"> + select * from sys_company + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/SysRoleDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysRoleDao.xml index c4b7ee8..0a6530e 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysRoleDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysRoleDao.xml @@ -12,6 +12,7 @@ <result property="companyId" column="company_id" /> <result property="plates" column="plates" /> <result property="shopAble" column="shop_able" /> + <result property="customer" column="customer" /> </resultMap> @@ -31,6 +32,7 @@ company_id, plates, is_default, + customer, shop_able ) VALUES ( @@ -44,6 +46,7 @@ #{companyId}, #{plates}, #{isDefault}, + #{customer}, #{shopAble} ) </insert> @@ -63,6 +66,7 @@ company_id, plates, is_default, + customer, shop_able ) VALUES @@ -78,6 +82,7 @@ #{item.companyId}, #{item.plates}, #{item.isDefault}, + #{item.customer}, #{item.shopAble} ) </foreach> @@ -110,6 +115,9 @@ <if test="_parameter.containsKey('shopAble')"> shop_able = #{shopAble}, </if> + <if test="_parameter.containsKey('customer')"> + customer = #{customer}, + </if> </set> WHERE role_id=#{roleId} </update> @@ -141,6 +149,9 @@ </if> <if test="(shopAble!=null and shopAble!='') or (shopAble!='' and shopAble==0)"> shop_able = #{shopAble}, + </if> + <if test="(customer!=null and customer!='') or (customer!='' and customer==0)"> + customer = #{customer}, </if> </set> WHERE role_id=#{roleId} @@ -206,6 +217,7 @@ company_id, plates, is_default, + customer, shop_able from sys_role <where> @@ -291,6 +303,7 @@ company_id, plates, is_default, + customer, shop_able from sys_role where role_id=#{roleId} @@ -323,6 +336,7 @@ company_id, plates, is_default, + customer, shop_able from sys_role <where> diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/SysRolePwoerFnDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysRolePwoerFnDao.xml index 3c5c8b8..a1b0ef2 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysRolePwoerFnDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysRolePwoerFnDao.xml @@ -150,10 +150,21 @@ </if> </where> </delete> - - - - <!-- 分页查询 --> + <delete id="deleteByFns"> + DELETE a + FROM + sys_role_pwoer_fn a , sys_role b + WHERE + a.role_id = b.role_id + and b.company_id=#{companyId} + and a.fn_id in <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + + <!-- 分页查询 --> <select id="selectInPage" resultMap="SysRolePwoerFnMap"> select rpf_id, diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml index 05a7862..5027633 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml @@ -56,6 +56,7 @@ <result property="signOrder" column="SIGN_ORDER"/> <result property="signDate" column="SIGN_DATE"/> <result property="salarGrad" column="salarGrad"/> + <result property="allCustomer" column="allCustomer"/> <!-- 扩展属性 --> <result property="shopName" column="SHOP_NAME"/> @@ -323,7 +324,7 @@ <set> update_time=now(), <if test="updateBy!=null"> - update_by = #{btnKey}, + update_by = #{updateBy}, </if> <if test="(suName!=null and suName!='') or (suName!='' and suName==0)"> @@ -485,6 +486,9 @@ <if test="signDate != null and signDate !='' "> sign_date = #{signDate} </if> + <if test="openIds != null and openIds !='' "> + open_ids = #{openIds} + </if> </set> WHERE su_id=#{suId} @@ -496,19 +500,19 @@ </update> <!-- 批量删除 --> - <delete id="deleteByIds" parameterType="java.util.List"> - delete from sys_users where su_id in + <update id="deleteByIds" parameterType="java.util.List"> + update sys_users set su_valid='N' where su_id in <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> - </delete> + </update> <!-- 根据id删除 --> - <delete id="deleteById" parameterType="Long"> - DELETE FROM sys_users - where su_id=#{suId} - </delete> + <update id="deleteById" parameterType="Long"> + update sys_users set su_valid='N' + where su_id=#{suId} + </update> <!-- 根据对象删除 --> <delete id="deleteByModel" parameterType="Long"> @@ -655,6 +659,8 @@ select *, (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND role_remark ='是') shopRole, + (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND customer ='是') + allCustomer, (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName, (select com_name from sys_company where com_id=company_id) as company_name, (select shop_name from sys_shop_info where shop_id=id) as SHOP_NAME @@ -937,6 +943,8 @@ <select id="selectById" resultMap="SysUsersMap"> select *, (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND role_remark ='是') shopRole, + (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND customer ='是') + allCustomer, (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName, role_ids from sys_users @@ -949,6 +957,8 @@ select *, (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND role_remark ='是') shopRole, + (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND customer ='是') + allCustomer, (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName, role_ids from sys_users @@ -960,7 +970,7 @@ </if> <if test="(record.suName!=null and record.suName!='') or (record.suName!='' and record.suName==0)"> - and su_name like concat('%',#{record.suName},'%') + and (su_name like concat('%',concat(#{record.suName},'%')) or su_tel = #{record.suName}) </if> <if test="(record.suTel!=null and record.suTel!='') or (record.suTel!='' and record.suTel==0)"> @@ -1273,7 +1283,7 @@ <select id="selectByRoleName" resultMap="SysUsersMap"> SELECT - a.* + distinct a.* FROM sys_users a LEFT JOIN sys_role r ON FIND_IN_SET(r.role_id, a.role_ids) @@ -1290,7 +1300,6 @@ <if test="users.shopId !=null and users.shopId !=''"> AND a.SHOP_ID = #{users.shopId} </if> - ORDER BY a.SIGN_ORDER IS NULL, a.SIGN_ORDER @@ -1319,5 +1328,22 @@ where id=#{id} </update> + <select id="selectAppVersion" resultType="com.matrix.system.hive.bean.AppVersion"> + select * from app_version + </select> + <select id="selectUserByOpenId" resultMap="SysUsersMap"> + select *, + (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName + from sys_users where find_in_set(#{openId}, open_ids) + <if test="companyId != null"> + and company_id=#{companyId} + </if> + </select> + + <update id="updateUserOpenId"> + update sys_users + set open_ids=#{openId} + where su_id=#{suId} + </update> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/BizUserDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/BizUserDao.xml new file mode 100644 index 0000000..536b462 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/BizUserDao.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.fenxiao.dao.BizUserDao"> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopRevenueFlowDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopRevenueFlowDao.xml new file mode 100644 index 0000000..4e5490d --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopRevenueFlowDao.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.fenxiao.dao.ShopRevenueFlowDao"> + <!-- 定义ShopRevenueFlow 的复杂关联map --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopRevenueFlow" id="ShopRevenueFlowMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="userId" column="user_id" /> + <result property="revenueContent" column="revenue_content" /> + <result property="amount" column="amount" /> + <result property="businessId" column="business_id" /> + <result property="companyId" column="company_id" /> + </resultMap> + + + <!-- 定义ShopRevenueFlow 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopRevenueFlow" id="ShopRevenueFlowSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="userId" column="user_id" /> + <result property="revenueContent" column="revenue_content" /> + <result property="amount" column="amount" /> + <result property="businessId" column="business_id" /> + <result property="companyId" column="company_id" /> + </resultMap> + + + <select id="selectRevenuFlowList" resultType="com.matrix.system.fenxiao.entity.ShopRevenueFlow"> + select * from shop_revenue_flow + where user_id=#{record.userId} + and DATE_FORMAT(create_time,'%Y-%m')=#{record.queryTime} + <if test="record.revenueType==1"> + and amount>0 + </if> + <if test="record.revenueType==2"> + <![CDATA[ and amount<0 ]]> + </if> + order by create_time desc + </select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalemanSettlementDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalemanSettlementDao.xml new file mode 100644 index 0000000..d414a05 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalemanSettlementDao.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.fenxiao.dao.ShopSalemanSettlementDao"> + <!-- 定义ShopSalemanSettlement 的复杂关联map --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalemanSettlement" id="ShopSalemanSettlementMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="orderNo" column="order_no" /> + <result property="settlementWay" column="settlement_way" /> + <result property="manCount" column="man_count" /> + <result property="orderCount" column="order_count" /> + <result property="amount" column="amount" /> + <result property="userId" column="user_id" /> + <result property="remark" column="remark" /> + <result property="companyId" column="company_id" /> + </resultMap> + + + <!-- 定义ShopSalemanSettlement 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalemanSettlement" id="ShopSalemanSettlementSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="orderNo" column="order_no" /> + <result property="settlementWay" column="settlement_way" /> + <result property="manCount" column="man_count" /> + <result property="orderCount" column="order_count" /> + <result property="amount" column="amount" /> + <result property="userId" column="user_id" /> + <result property="remark" column="remark" /> + <result property="companyId" column="company_id" /> + </resultMap> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml new file mode 100644 index 0000000..1d001af --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml @@ -0,0 +1,300 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao"> + <!-- 定义ShopSalesmanApply 的复杂关联map --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanApply" id="ShopSalesmanApplyMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="applyWay" column="apply_way" /> + <result property="userId" column="user_id" /> + <result property="parentUserId" column="parent_user_id" /> + <result property="applyStatus" column="apply_status" /> + <result property="remark" column="remark" /> + <result property="companyId" column="company_id" /> + </resultMap> + + + <!-- 定义ShopSalesmanApply 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanApply" id="ShopSalesmanApplySimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="applyWay" column="apply_way" /> + <result property="userId" column="user_id" /> + <result property="parentUserId" column="parent_user_id" /> + <result property="applyStatus" column="apply_status" /> + <result property="remark" column="remark" /> + <result property="companyId" column="company_id" /> + </resultMap> + + <select id="selectInvitationuserInPage" resultType="com.matrix.system.shopXcx.vo.SalesmanVo"> + SELECT + a.nick_name, + a.avatar_url, + a.phone, + ( + SELECT + IFNULL(sum(IFNULL( b.amount, 0 )),0) + FROM + shop_salesman_order b + WHERE + b.user_id = a.id + and order_status=2 + AND b.sales_user_id = #{userId} + + ) AS revenueAmount, + ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.id AND c.sales_user_id = #{userId} ) AS orderCount + FROM + sys_vip_info a + WHERE + a.recommend_id = #{userId} + AND a.is_sales = #{isSales} + </select> + + <select id="findShopSalesmanApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo"> + SELECT + a.id id, + a.user_id userId, + b.avatar_url avatarUrl, + b.nick_name nickname, + (SELECT s.nick_name FROM sys_vip_info s + WHERE s.id = a.parent_user_id ) parentUser, + c.nick_name parentUserNow, + ( SELECT COUNT(*) FROM sys_vip_info + WHERE recommend_id = a.user_id AND is_sales != 1 ) lowerLevelNum, + ( SELECT COUNT(*) FROM sys_vip_info + WHERE recommend_id = a.user_id AND is_sales = 1 ) invitedNum, + ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order + WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue, + ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order + WHERE order_status = 1 AND sales_user_id = a.user_id ) balance, + g.NAME grade, + a.create_time createTime, + a.apply_status applyStatus, + a.apply_way applyWay + FROM + shop_salesman_apply a + LEFT JOIN sys_vip_info b ON a.user_id = b.id + LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id + LEFT JOIN sys_vip_info c ON c.id = b.recommend_id + <where> + a.company_id=#{record.companyId} + <if test="record.shenheState != null and record.shenheState != ''"> + and a.apply_status=#{record.shenheState} + </if> + <if test="record.salemanGrade != null and record.salemanGrade != ''"> + and a.grade_id=#{record.salemanGrade} + </if> + <if test="record.userName != null and record.userName != ''"> + and b.nick_name like concat('%',#{record.userName},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + <select id="findShopSalesmanAppliingList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo"> + SELECT + a.user_id userId, + b.nick_name nickName + FROM + shop_salesman_apply a + LEFT JOIN sys_vip_info b ON a.user_id = b.id + <where> + a.company_id = #{record.companyId} + and a.apply_status = #{record.applyStatus} + <if test="record.nickName != null and record.nickName != ''"> + and b.nick_name like concat('%',#{record.nickName},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + <select id="selectBizUserApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo"> + SELECT + a.id userId, + a.nick_name nickName, + a.avatar_url avatarUrl, + a.create_time createTime, + a.phone + FROM + sys_vip_info a + <where> + a.company_id = #{record.companyId} + and a.is_sales != 1 + <if test="record.nickName != null and record.nickName != ''"> + and a.nick_name like concat('%',#{record.nickName},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="selectSalesmanCenterInfo" resultType="com.matrix.system.shopXcx.vo.SalesmanCenterInfo"> + select + IFNULL(withdrawal_cash,0) as withdrawal_cash, + ( + SELECT + IFNULL(sum(IFNULL( b.amount, 0 )),0) + FROM + shop_salesman_order b + WHERE order_status=2 + AND b.sales_user_id = #{openId} + + ) AS totalRevenue, + ( + SELECT + IFNULL(sum(IFNULL( b.amount, 0 )),0) + FROM + shop_salesman_order b + WHERE order_status=2 and revenue_type=1 + AND b.sales_user_id = #{openId} + + ) AS salesRevenue, + ( + SELECT + IFNULL(sum(IFNULL( b.amount, 0 )),0) + FROM + shop_salesman_order b + WHERE order_status=2 and revenue_type=2 + AND b.sales_user_id = #{openId} + + ) AS invitationRevenue, + IFNULL(withdrawal_cash,0) as withdrawal_cash, + ( + SELECT + IFNULL(sum(IFNULL( b.amount, 0 )),0) + FROM + shop_salesman_order b + WHERE order_status=1 + AND b.sales_user_id = #{openId} + + ) AS djsRevenue, + + ( SELECT count( * ) FROM shop_salesman_order c WHERE c.sales_user_id = #{openId} and revenue_type =1 ) AS salesorderCount, + ( SELECT count( * ) FROM shop_salesman_order c WHERE c.sales_user_id = #{openId} and revenue_type =2 ) AS invitationOrderCount, + (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=1) as invitationCount, + (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=2) as customerCount + from sys_vip_info a where + a.id=#{id} + + </select> + + <select id="selectShopSalesmanDetailByOpenId" resultType="com.matrix.system.fenxiao.vo.SalesmanBasicDetailVo"> + SELECT + a.user_id userId, + b.avatar_url avatarUrl, + b.nick_name nickname, + g.NAME grade, + b.phone, + (SELECT s.nick_name FROM sys_vip_info s + WHERE s.id = a.parent_user_id ) parentUser, + ( SELECT COUNT(*) FROM sys_vip_info + WHERE recommend_id = a.user_id AND is_sales != 1 ) lowerLevelNum, + ( SELECT COUNT(*) FROM sys_vip_info + WHERE recommend_id = a.user_id AND is_sales = 1 ) invitedNum, + ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order + WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue, + ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order + WHERE order_status = 1 AND sales_user_id = a.user_id ) balance, + a.create_time createTime, + a.apply_status applyStatus, + a.apply_way applyWay + FROM + shop_salesman_apply a + LEFT JOIN sys_vip_info b ON a.user_id = b.id + LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id + where a.id = #{applyId} + </select> + + <select id="findCustomDetail" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo"> + SELECT + b.id userId, + b.avatar_url avatarUrl, + b.nick_name nickname, + b.binding_parent_time createTime, + (select COUNT(*) from shop_salesman_order c where c.order_status = 1 and c.sales_user_id = b.id) doneNum + FROM sys_vip_info b + <where> + b.company_id = #{record.companyId} + AND b.is_sales != 1 + and b.recommend_id = #{record.userId} + <if test="record.userName != null and record.userName != ''"> + and b.nick_name like concat('%',#{record.userName},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + b.${record.sort} ${record.order} + </if> + </select> + <select id="findCustomLow" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo"> + SELECT + b.id userId, + b.avatar_url avatarUrl, + b.nick_name nickname, + a.create_time createTime, + a.apply_way applyWay + FROM + shop_salesman_apply a + LEFT JOIN sys_vip_info b ON b.id = a.user_id + <where> + a.company_id = #{record.companyId} + AND b.is_sales = 1 + and b.recommend_id = #{record.userId} + and a.apply_status = 2 + <if test="record.userName != null and record.userName != ''"> + and b.nick_name like concat('%',#{record.userName},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="findShopOrderDetail" resultType="com.matrix.system.fenxiao.vo.ShopOrderDetailVo"> + select + a.order_id orderId, + a.create_time createTime, + a.amount amount, + a.revenue_type revenueType, + a.order_status orderStatus, + b.nick_name nickName, + b.avatar_url avatarUrl, + c.order_no orderNo, + c.order_money orderMoney, + c.order_status orderState, + f.shop_name storeName + from shop_salesman_order a + left join sys_vip_info b on b.id=a.user_id + left join shop_order c on a.order_id=c.id + LEFT JOIN sys_shop_info f on f.id = c.store_id + <where> + a.sales_user_id = #{record.userId} + <if test="record.orderType != null and record.orderType != ''"> + and a.order_status = #{record.orderType} + </if> + <if test="record.userName != null and record.userName != ''"> + and b.nick_name like concat('%',#{record.userName},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanGradeDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanGradeDao.xml new file mode 100644 index 0000000..3b3a30a --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanGradeDao.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao"> + <!-- 定义ShopSalesmanGrade 的复杂关联map --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanGrade" id="ShopSalesmanGradeMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="name" column="name" /> + <result property="sealesCommission" column="seales_commission" /> + <result property="invitationCommission" column="invitation_commission" /> + <result property="gradeCondition" column="grade_condition" /> + <result property="isDefault" column="is_default" /> + <result property="companyId" column="company_id" /> + </resultMap> + + + <!-- 定义ShopSalesmanGrade 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanGrade" id="ShopSalesmanGradeSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="name" column="name" /> + <result property="sealesCommission" column="seales_commission" /> + <result property="invitationCommission" column="invitation_commission" /> + <result property="gradeCondition" column="grade_condition" /> + <result property="isDefault" column="is_default" /> + <result property="companyId" column="company_id" /> + </resultMap> + + + <select id="getShopSalesmanGradeVo" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanGradeVo"> + SELECT + a.id, + a.name + FROM + shop_salesman_grade a + where + a.company_id = #{companyId} + </select> + + <select id="findFyfaManageList" resultType="com.matrix.system.fenxiao.vo.FyfaManageVo"> + SELECT + a.id id, + a.name name, + a.self_commission selfCommission, + a.seales_commission sealesCommission, + a.invitation_commission invitationCommission, + a.grade_condition gradeCondition, + a.is_default isDefault + FROM + shop_salesman_grade a + <where> + a.company_id = #{record.companyId} + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml new file mode 100644 index 0000000..84c0ede --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml @@ -0,0 +1,240 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao"> + <!-- 定义ShopSalesmanOrder 的复杂关联map --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanOrder" id="ShopSalesmanOrderMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="orderId " column="order_id " /> + <result property="userId" column="user_id" /> + <result property="salesUserId" column="sales_user_id" /> + <result property="revenueType" column="revenue_type" /> + <result property="amount" column="amount" /> + <result property="orderStatus" column="order_status" /> + <result property="settlementId" column="settlement_id" /> + <result property="companyId" column="company_id" /> + </resultMap> + + + <!-- 定义ShopSalesmanOrder 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanOrder" id="ShopSalesmanOrderSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="orderId " column="order_id " /> + <result property="userId" column="user_id" /> + <result property="salesUserId" column="sales_user_id" /> + <result property="revenueType" column="revenue_type" /> + <result property="amount" column="amount" /> + <result property="orderStatus" column="order_status" /> + <result property="settlementId" column="settlement_id" /> + <result property="companyId" column="company_id" /> + </resultMap> + + <select id="selectSalesManOrder" resultType="com.matrix.system.shopXcx.vo.SalesOrderVo"> + select + a.order_id, + a.create_time, + a.amount, + a.revenue_type, + a.order_status, + b.nick_name, + b.avatar_url, + c.order_no, + c.order_money + from shop_salesman_order a + left join sys_vip_info b on b.id=a.user_id + left join shop_order c on a.order_id=c.id + where + a.sales_user_id=#{record.userId} + and a.revenue_type=#{record.revenueType} + <if test="record.orderStatus!=null" > + and a.order_status=#{record.orderStatus} + </if> + <if test="record.sort!=null and record.order!=null" > + order by ${record.sort} ${record.order} + </if> + + </select> + + <select id="selectFenxiaoOrderBasicByCompanyId" resultType="com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo"> + SELECT + COUNT(*) num, + (SELECT IFNULL(sum(IFNULL(amount, 0)), 0) + FROM shop_salesman_order + WHERE order_status = 1 and company_id=#{companyId}) balance, + (SELECT COUNT(*) FROM + (SELECT DISTINCT user_id + FROM shop_salesman_order + WHERE order_status = 1 and company_id=#{companyId} ) a) waitNum, + (SELECT COUNT(*) + FROM shop_salesman_order + WHERE order_status = 1 and company_id=#{companyId}) waitOrderNum, + (select sum(order_money) from shop_salesman_order a + inner join shop_order b on a.order_id=b.ID + where a.company_id=#{companyId}) orderBalance + FROM + shop_salesman_order + where company_id=#{companyId} + </select> + + <select id="findFenxiaoOrderList" resultType="com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo"> + SELECT + a.id id, + d.order_no, + d.order_money actualBalance, + f.shop_name address, + d.order_status orderState, + b.nick_name custom, + b.id customUserId, + e.nick_name parentSale, + a.revenue_type profitType, + a.amount profitBalance, + a.order_status settleType, + c.order_no settleNo, + c.create_time settleTime, + g.su_name settler + FROM + shop_salesman_order a + LEFT JOIN sys_vip_info b on a.user_id = b.id + LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id + LEFT JOIN shop_order d on d.id = a.order_id + LEFT JOIN sys_vip_info e on a.sales_user_id = e.id + LEFT JOIN sys_shop_info f on f.id = d.store_id + LEFT JOIN sys_users g on c.user_id = g.su_id + <where> + a.company_id = #{record.companyId} + <if test="record.userName != null and record.userName != ''"> + and b.nick_name like concat('%',#{record.userName},'%') + </if> + <if test="record.ddType != null and record.ddType != ''"> + and d.order_status = #{record.ddType} + </if> + <if test="record.startTime != null "> + and a.create_time >= #{record.startTime} + </if> + <if test="record.endTime != null"> + and #{record.endTime} >= a.create_time + </if> + <if test="record.tgy != null and record.tgy != ''"> + and e.nick_name like concat('%',#{record.tgy},'%') + </if> + <if test="record.orderType != null and record.orderType != ''"> + and a.order_status = #{record.orderType} + </if> + <if test="record.jsbh != null and record.jsbh != ''"> + and c.order_no = #{record.jsbh} + </if> + <if test="record.ddh != null and record.ddh != ''"> + and d.order_no = #{record.ddh} + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="findSetOrderList" resultType="com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo"> + select + a.id id, + a.order_no orderNo, + a.amount actualBalance, + a.order_count setNum, + a.man_count setManNum, + a.create_time setTime, + b.su_name setMan, + a.settlement_way settlementWay, + a.remark remark + from + shop_saleman_settlement a + left join sys_users b on a.user_id = b.su_id + <where> + a.company_id = #{record.companyId} + <if test="record.userName != null and record.userName != ''"> + and b.su_name like concat('%',#{record.userName},'%') + </if> + <if test="record.startTime != null "> + and a.create_time >= #{record.startTime} + </if> + <if test="record.endTime != null"> + and #{record.endTime} >= a.create_time + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="selectFenxiaoOrderListNoPage" resultType="com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo"> + SELECT + a.id id, + d.order_no, + d.order_money actualBalance, + f.shop_name address, + case when d.order_status = 1 then '待付款' + when d.order_status = 2 then '待配送' + when d.order_status = 3 then '待收货' + when d.order_status = 4 then '待评价' + when d.order_status = 5 then '已评价' + when d.order_status = 6 then '申请退款' + when d.order_status = 7 then '退款成功' + when d.order_status = 8 then '退款拒绝' + when d.order_status = 9 then '已取消' end orderState, + b.nick_name custom, + b.id customUserId, + e.nick_name parentSale, + case when a.revenue_type = 1 then '推广收益' + when a.revenue_type = 2 then '邀请收益' end profitType, + a.amount profitBalance, + case when a.order_status = 1 then '待结算' + when a.order_status = 2 then '已结算' + when a.order_status = 3 then '已退款' end settleType, + c.order_no settleNo, + c.create_time settleTime, + g.su_name settler + FROM + shop_salesman_order a + LEFT JOIN sys_vip_info b on a.user_id = b.id + LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id + LEFT JOIN shop_order d on d.id = a.order_id + LEFT JOIN sys_vip_info e on a.sales_user_id = e.id + LEFT JOIN sys_shop_info f on f.id = d.store_id + LEFT JOIN sys_users g on c.user_id = g.su_id + <where> + a.company_id = #{record.companyId} + <if test="record.userName != null and record.userName != ''"> + and b.nick_name like concat('%',#{record.userName},'%') + </if> + <if test="record.ddType != null and record.ddType != ''"> + and d.order_status = #{record.ddType} + </if> + <if test="record.startTime != null "> + and a.create_time >= #{record.startTime} + </if> + <if test="record.endTime != null"> + and #{record.endTime} >= a.create_time + </if> + <if test="record.tgy != null and record.tgy != ''"> + and e.nick_name like concat('%',#{record.tgy},'%') + </if> + <if test="record.orderType != null and record.orderType != ''"> + and a.order_status = #{record.orderType} + </if> + <if test="record.jsbh != null and record.jsbh != ''"> + and c.order_no = #{record.jsbh} + </if> + <if test="record.ddh != null and record.ddh != ''"> + and d.order_no = #{record.ddh} + </if> + </where> + </select> +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderItemDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderItemDao.xml new file mode 100644 index 0000000..4d73645 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderItemDao.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.fenxiao.dao.ShopSalesmanOrderItemDao"> + <!-- 定义ShopSalesmanOrderItem 的复杂关联map --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanOrderItem" id="ShopSalesmanOrderItemMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="orderId " column="order_id " /> + <result property="salesmanOrderId" column="salesman_order_id" /> + <result property="orderItemId" column="order_item_id" /> + <result property="amount" column="amount" /> + </resultMap> + + + <!-- 定义ShopSalesmanOrderItem 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.fenxiao.entity.ShopSalesmanOrderItem" id="ShopSalesmanOrderItemSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="orderId " column="order_id " /> + <result property="salesmanOrderId" column="salesman_order_id" /> + <result property="orderItemId" column="order_item_id" /> + <result property="amount" column="amount" /> + </resultMap> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml index 361aeb2..0e05a28 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.matrix.system.hive.dao.AchieveNewDao"> <!-- 定义AchieveNew 的复杂关联map --> @@ -17,10 +17,8 @@ <result property="vipId" column="vip_id" /> <result property="freeConsume" column="free_consume" /> <result property="hisConsume" column="his_consume" /> - <result property="consume" column="consume" /> - <result property="cardCash" column="card_cash" /> - <result property="projCash" column="proj_cash" /> <result property="goodsCash" column="goods_cash" /> + <result property="cardCash" column="card_cash" /> <result property="projNum" column="proj_num" /> <result property="numberOfPeople" column="number_of_people" /> <result property="shopName" column="shop_name" /> @@ -30,7 +28,7 @@ <result property="projPercentage" column="proj_percentage" /> <result property="t1" column="t1" /> <result property="t2" column="t2" /> - <result property="t3" column="t3" /> + <result property="achieveType" column="achieveType" /> <result property="t4" column="t4" /> <result property="t5" column="t5" /> <result property="t6" column="t6" /> @@ -47,8 +45,14 @@ <result property="guwen" column="guwen" /> <result property="meiliao" column="meiliao" /> <result property="zkTotal" column="zk_total" /> + <result property="payMethod" column="pay_method" /> + <result property="arriveCnt" column="arrive_cnt" /> + <result property="goodsNo" column="goodsNo" /> + <result property="goodsName" column="goodsName" /> + <result property="cateName" column="cateName" /> + <result property="achieveRuleName" column="achieveRuleName" /> </resultMap> @@ -63,14 +67,9 @@ d.level_name, c.vip_name, e.name as pro_name, - a.card_cash, - (IFNULL(a.card_cash,0) +IFNULL(a.proj_cash,0) + IFNULL(a.goods_cash,0) - ) as zk_total, - a.proj_cash, - a.goods_cash, - a.card_cash, - a.consume, + b.ZK_TOTAL as zk_total, a.his_consume, + er.name as achieveRuleName, a.free_consume, f.su_name meiliao, g.su_name guwen, @@ -78,25 +77,35 @@ a.number_of_people, a.proj_num, a.proj_time, - i.name as module_subName, - h.SHOP_NAME shop_name, - a.order_type + i.name as cateName, + h.shop_short_name shop_name, + a.order_type, + a.achieveType, + case when a.pay_method = '现金' then goods_cash end goods_cash, + case when a.pay_method = '划扣' then goods_cash end card_cash, + j.pay_method from achieve_new a left join sys_order b on a.order_id=b.id left join sys_vip_info c on a.vip_id=c.id left join sys_vip_level d on c.LEVEL_ID=d.id left join shopping_goods e on a.shopping_goods_id=e.id + left join achieve_rule er on e.achieve_rule_id=er.id LEFT JOIN sys_users f on a.beault_id=f.su_id LEFT JOIN sys_users g on a.sale_id = g.su_id LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID LEFT JOIN shopping_goods_category i ON e.cate_id = i.id left join sys_proj_services l on a.service_order_id=l.id + left join sys_order_item j on a.order_item_id=j.ID <where> + and a.company_id = #{record.companyId} <if test="record!=null"> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and a.shop_id = #{record.shopId} + </if> + <if test="record.achieveRuleId != null "> + and e.achieve_rule_id = #{record.achieveRuleId} </if> <if test="record.year != null and record.year !='' "> and YEAR (a.datatime) = #{record.year} @@ -113,8 +122,18 @@ <if test="(record.endTime!=null )"> and a.datatime <![CDATA[ < ]]> #{record.endTime} </if> - <if test="record.companyId != null and record.companyId !='' "> - and a.company_id = #{record.companyId} + <if test="record.beaultId != null and record.beaultId !='' "> + and a.beault_id = #{record.beaultId} + </if> + + <if test="record.beaultId != null and record.beaultId !='' "> + and a.beault_id = #{record.beaultId} + </if> + <if test="record.vipQueryKey != null and record.vipQueryKey != '' "> + and c.VIP_NAME like concat('%',#{record.vipQueryKey},'%') + or (c.VIP_NO like concat('%',#{record.vipQueryKey},'%') + or c.PHONE like concat('%',#{record.vipQueryKey},'%') + ) </if> </if> </where> @@ -132,7 +151,7 @@ </select> <select id="findDayFlowTotal" - resultType="java.lang.Integer"> + resultType="java.lang.Integer"> select count(*) from achieve_new a @@ -148,7 +167,7 @@ <where> <if test="record!=null"> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and a.shop_id = #{record.shopId} </if> <if test="record.year != null and record.year !='' "> @@ -169,11 +188,54 @@ <if test="record.companyId != null and record.companyId !='' "> and a.company_id = #{record.companyId} </if> + <if test="record.beaultId != null and record.beaultId !='' "> + and a.beault_id = #{record.beaultId} + </if> + <if test="record.vipQueryKey != null and record.vipQueryKey != '' "> + and c.VIP_NAME like concat('%',#{record.vipQueryKey},'%') + or (c.VIP_NO like concat('%',#{record.vipQueryKey},'%') + or c.PHONE like concat('%',#{record.vipQueryKey},'%') + ) + </if> </if> </where> </select> + <!-- + 统计员工业绩 + + select + u.name, + g.su_name guwen, + cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total, + cast(SUM(a.his_consume) AS decimal(15,2)), + cast(SUM(a.free_consume) AS decimal(15,2)), + cast(SUM(a.proj_percentage) AS decimal(15,2)), + cast(SUM(a.number_of_people) AS decimal(15,2)), + cast(SUM(a.proj_num) AS decimal(15,2)), + cast(SUM(a.proj_time) AS decimal(15,2)), + h.shop_short_name shop_name, + a.order_type, + a.achieveType + from + achieve_new a + left join sys_order b on a.order_id=b.id + left join sys_vip_info c on a.vip_id=c.id + left join sys_vip_level d on c.LEVEL_ID=d.id + left join shopping_goods e on a.shopping_goods_id=e.id + LEFT JOIN sys_users f on a.beault_id=f.su_id + LEFT JOIN sys_users g on a.sale_id = g.su_id + LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID + LEFT JOIN shopping_goods_category i ON e.cate_id = i.id + left join sys_proj_services l on a.service_order_id=l.id + left join sys_order_item j on a.order_item_id=j.ID + left join achieve_rule u on u.id=e.achieve_rule_id + where h.shop_short_name='龙华店' + GROUP BY g.su_name , a.order_type, h.id,a.achieveType + ORDER BY g.su_name + + --> <select id="findSumDailyInfoNew" resultMap="AchieveNewMap"> @@ -181,12 +243,8 @@ YEAR (a.datatime) year, MONTH (a.datatime) month, DAY(a.datatime) day, - SUM(a.card_cash) as card_cash , - SUM((IFNULL(a.card_cash,0) +IFNULL(a.proj_cash,0) + IFNULL(a.goods_cash,0) ) )as zk_total, - SUM(a.proj_cash) as proj_cash, + SUM( IFNULL(a.goods_cash,0) )as zk_total, SUM(a.goods_cash) as goods_cash, - SUM(a.card_cash) as card_cash, - SUM(a.consume) as consume, SUM(a.his_consume) as his_consume, SUM(a.free_consume) as free_consume, SUM(a.proj_percentage) as proj_percentage, @@ -210,7 +268,7 @@ <where> <if test="record!=null"> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and a.shop_id = #{record.shopId} </if> <if test="record.year != null and record.year !='' "> @@ -262,9 +320,6 @@ <result property="vipId" column="vip_id" /> <result property="freeConsume" column="free_consume" /> <result property="hisConsume" column="his_consume" /> - <result property="consume" column="consume" /> - <result property="cardCash" column="card_cash" /> - <result property="projCash" column="proj_cash" /> <result property="goodsCash" column="goods_cash" /> <result property="projNum" column="proj_num" /> <result property="numberOfPeople" column="number_of_people" /> @@ -273,9 +328,10 @@ <result property="remark" column="remark" /> <result property="orderType" column="order_type" /> <result property="projPercentage" column="proj_percentage" /> + <result property="payMethod" column="pay_method" /> <result property="t1" column="t1" /> <result property="t2" column="t2" /> - <result property="t3" column="t3" /> + <result property="achieveType" column="achieveType" /> <result property="t4" column="t4" /> <result property="t5" column="t5" /> <result property="t6" column="t6" /> @@ -298,9 +354,6 @@ vip_id, free_consume, his_consume, - consume, - card_cash, - proj_cash, goods_cash, proj_num, number_of_people, @@ -309,15 +362,17 @@ remark, order_type, proj_percentage, + t1, t2, - t3, + achieveType, t4, t5, t6, t8, t9, - company_id + company_id, +pay_method </sql> <!-- 属性sql --> @@ -334,9 +389,6 @@ #{item.vipId}, #{item.freeConsume}, #{item.hisConsume}, - #{item.consume}, - #{item.cardCash}, - #{item.projCash}, #{item.goodsCash}, #{item.projNum}, #{item.numberOfPeople}, @@ -345,15 +397,17 @@ #{item.remark}, #{item.orderType}, #{item.projPercentage}, + #{item.t1}, #{item.t2}, - #{item.t3}, + #{item.achieveType}, #{item.t4}, #{item.t5}, #{item.t6}, #{item.t8}, #{item.t9}, - #{item.companyId} + #{item.companyId}, + #{item.payMethod} </sql> <!-- where sql --> @@ -361,130 +415,120 @@ <if test="record!=null"> <if - test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> and id = #{record.id} </if> <if test="record.companyId != null and record.companyId !='' "> and company_id = #{record.companyId} </if> <if - test="(record.saleId!=null and record.saleId!='') or (record.saleId!='' and record.saleId==0) "> + test="(record.saleId!=null and record.saleId!='') or (record.saleId!='' and record.saleId==0) "> and sale_id = #{record.saleId} </if> <if - test="(record.beaultId!=null and record.beaultId!='') or (record.beaultId!='' and record.beaultId==0) "> + test="(record.beaultId!=null and record.beaultId!='') or (record.beaultId!='' and record.beaultId==0) "> and beault_id = #{record.beaultId} </if> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and shop_id = #{record.shopId} </if> <if - test="(record.datatime!=null and record.datatime!='') or (record.datatime!='' and record.datatime==0) "> + test="(record.datatime!=null and record.datatime!='') or (record.datatime!='' and record.datatime==0) "> and datatime = #{record.datatime} </if> <if - test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> + test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> and order_id = #{record.orderId} </if> <if - test="(record.orderItemId!=null and record.orderItemId!='') or (record.orderItemId!='' and record.orderItemId==0) "> + test="(record.orderItemId!=null and record.orderItemId!='') or (record.orderItemId!='' and record.orderItemId==0) "> and order_item_id = #{record.orderItemId} </if> <if - test="(record.shoppingGoodsId!=null and record.shoppingGoodsId!='') or (record.shoppingGoodsId!='' and record.shoppingGoodsId==0) "> + test="(record.shoppingGoodsId!=null and record.shoppingGoodsId!='') or (record.shoppingGoodsId!='' and record.shoppingGoodsId==0) "> and shopping_goods_id = #{record.shoppingGoodsId} </if> <if - test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> + test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> and service_order_id = #{record.serviceOrderId} </if> <if - test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> + test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> and vip_id = #{record.vipId} </if> <if - test="(record.freeConsume!=null and record.freeConsume!='') or (record.freeConsume!='' and record.freeConsume==0) "> + test="(record.freeConsume!=null and record.freeConsume!='') or (record.freeConsume!='' and record.freeConsume==0) "> and free_consume = #{record.freeConsume} </if> <if - test="(record.hisConsume!=null and record.hisConsume!='') or (record.hisConsume!='' and record.hisConsume==0) "> + test="(record.hisConsume!=null and record.hisConsume!='') or (record.hisConsume!='' and record.hisConsume==0) "> and his_consume = #{record.hisConsume} </if> + + <if - test="(record.consume!=null and record.consume!='') or (record.consume!='' and record.consume==0) "> - and consume = #{record.consume} - </if> - <if - test="(record.cardCash!=null and record.cardCash!='') or (record.cardCash!='' and record.cardCash==0) "> - and card_cash = #{record.cardCash} - </if> - <if - test="(record.projCash!=null and record.projCash!='') or (record.projCash!='' and record.projCash==0) "> - and proj_cash = #{record.projCash} - </if> - <if - test="(record.goodsCash!=null and record.goodsCash!='') or (record.goodsCash!='' and record.goodsCash==0) "> + test="(record.goodsCash!=null and record.goodsCash!='') or (record.goodsCash!='' and record.goodsCash==0) "> and goods_cash = #{record.goodsCash} </if> <if - test="(record.projNum!=null and record.projNum!='') or (record.projNum!='' and record.projNum==0) "> + test="(record.projNum!=null and record.projNum!='') or (record.projNum!='' and record.projNum==0) "> and proj_num = #{record.projNum} </if> <if - test="(record.numberOfPeople!=null and record.numberOfPeople!='') or (record.numberOfPeople!='' and record.numberOfPeople==0) "> + test="(record.numberOfPeople!=null and record.numberOfPeople!='') or (record.numberOfPeople!='' and record.numberOfPeople==0) "> and number_of_people = #{record.numberOfPeople} </if> <if - test="(record.shopName!=null and record.shopName!='') or (record.shopName!='' and record.shopName==0) "> + test="(record.shopName!=null and record.shopName!='') or (record.shopName!='' and record.shopName==0) "> and shop_name = #{record.shopName} </if> <if - test="(record.projTime!=null and record.projTime!='') or (record.projTime!='' and record.projTime==0) "> + test="(record.projTime!=null and record.projTime!='') or (record.projTime!='' and record.projTime==0) "> and proj_time = #{record.projTime} </if> <if - test="(record.remark!=null and record.remark!='') or (record.remark!='' and record.remark==0) "> + test="(record.remark!=null and record.remark!='') or (record.remark!='' and record.remark==0) "> and remark = #{record.remark} </if> <if - test="(record.orderType!=null and record.orderType!='') or (record.orderType!='' and record.orderType==0) "> + test="(record.orderType!=null and record.orderType!='') or (record.orderType!='' and record.orderType==0) "> and order_type = #{record.orderType} </if> <if - test="(record.projPercentage!=null and record.projPercentage!='') or (record.projPercentage!='' and record.projPercentage==0) "> + test="(record.projPercentage!=null and record.projPercentage!='') or (record.projPercentage!='' and record.projPercentage==0) "> and proj_percentage = #{record.projPercentage} </if> <if - test="(record.t1!=null and record.t1!='') or (record.t1!='' and record.t1==0) "> + test="(record.t1!=null and record.t1!='') or (record.t1!='' and record.t1==0) "> and t1 = #{record.t1} </if> <if - test="(record.t2!=null and record.t2!='') or (record.t2!='' and record.t2==0) "> + test="(record.t2!=null and record.t2!='') or (record.t2!='' and record.t2==0) "> and t2 = #{record.t2} </if> <if - test="(record.t3!=null and record.t3!='') or (record.t3!='' and record.t3==0) "> - and t3 = #{record.t3} + test="(record.achieveType!=null and record.achieveType!='') or (record.achieveType!='' and record.achieveType==0) "> + and achieveType = #{record.achieveType} </if> <if - test="(record.t4!=null and record.t4!='') or (record.t4!='' and record.t4==0) "> + test="(record.t4!=null and record.t4!='') or (record.t4!='' and record.t4==0) "> and t4 = #{record.t4} </if> <if - test="(record.t5!=null and record.t5!='') or (record.t5!='' and record.t5==0) "> + test="(record.t5!=null and record.t5!='') or (record.t5!='' and record.t5==0) "> and t5 = #{record.t5} </if> <if - test="(record.t6!=null and record.t6!='') or (record.t6!='' and record.t6==0) "> + test="(record.t6!=null and record.t6!='') or (record.t6!='' and record.t6==0) "> and t6 = #{record.t6} </if> <if - test="(record.t8!=null and record.t8!='') or (record.t8!='' and record.t8==0) "> + test="(record.t8!=null and record.t8!='') or (record.t8!='' and record.t8==0) "> and t8 = #{record.t8} </if> <if - test="(record.t9!=null and record.t9!='') or (record.t9!='' and record.t9==0) "> + test="(record.t9!=null and record.t9!='') or (record.t9!='' and record.t9==0) "> and t9 = #{record.t9} </if> </if> @@ -493,7 +537,7 @@ <!-- 插入方法 --> <insert id="insert" parameterType="com.matrix.system.hive.bean.AchieveNew" - useGeneratedKeys="true" keyProperty="item.id"> + useGeneratedKeys="true" keyProperty="item.id"> INSERT INTO achieve_new ( <include refid="columns"></include> ) @@ -511,7 +555,7 @@ ) VALUES <foreach collection="list" item="item" index="index" - separator=","> + separator=","> ( <include refid="propertys"></include> ) @@ -559,15 +603,9 @@ <if test="_parameter.containsKey('hisConsume')"> his_consume = #{hisConsume}, </if> - <if test="_parameter.containsKey('consume')"> - consume = #{consume}, - </if> - <if test="_parameter.containsKey('cardCash')"> - card_cash = #{cardCash}, - </if> - <if test="_parameter.containsKey('projCash')"> - proj_cash = #{projCash}, - </if> + + + <if test="_parameter.containsKey('goodsCash')"> goods_cash = #{goodsCash}, </if> @@ -592,14 +630,15 @@ <if test="_parameter.containsKey('projPercentage')"> proj_percentage = #{projPercentage}, </if> + <if test="_parameter.containsKey('t1')"> t1 = #{t1}, </if> <if test="_parameter.containsKey('t2')"> t2 = #{t2}, </if> - <if test="_parameter.containsKey('t3')"> - t3 = #{t3}, + <if test="_parameter.containsKey('achieveType')"> + achieveType = #{achieveType}, </if> <if test="_parameter.containsKey('t4')"> t4 = #{t4}, @@ -616,6 +655,9 @@ <if test="_parameter.containsKey('t9')"> t9 = #{t9}, </if> + <if test="_parameter.containsKey('payMethod')"> + pay_method = #{payMethod}, + </if> </set> WHERE id=#{id} </update> @@ -626,15 +668,15 @@ UPDATE achieve_new set datatime = #{record.datatime} <where> <if - test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> and id = #{record.id} </if> <if - test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> + test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> and order_id = #{record.orderId} </if> <if - test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> + test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> and service_order_id = #{record.serviceOrderId} </if> </where> @@ -672,21 +714,14 @@ vip_id = #{record.vipId}, </if> <if - test="record.freeConsume != null and record.freeConsume != '' "> + test="record.freeConsume != null and record.freeConsume != '' "> free_consume = #{record.freeConsume}, </if> <if test="record.hisConsume != null "> his_consume = #{record.hisConsume}, </if> - <if test="record.consume != null "> - consume = #{record.consume}, - </if> - <if test="record.cardCash != null "> - card_cash = #{record.cardCash}, - </if> - <if test="record.projCash != null "> - proj_cash = #{record.projCash}, - </if> + + <if test="record.goodsCash != null "> goods_cash = #{record.goodsCash}, </if> @@ -711,14 +746,15 @@ <if test="record.projPercentage != null "> proj_percentage = #{record.projPercentage}, </if> + <if test="record.t1 != null and record.t1 != '' "> t1 = #{record.t1}, </if> <if test="record.t2 != null and record.t2 != '' "> t2 = #{record.t2}, </if> - <if test="record.t3 != null and record.t3 != '' "> - t3 = #{record.t3}, + <if test="record.achieveType != null and record.achieveType != '' "> + achieveType = #{record.achieveType}, </if> <if test="record.t4 != null and record.t4 != '' "> t4 = #{record.t4}, @@ -735,6 +771,9 @@ <if test="record.t9 != null and record.t9 != '' "> t9 = #{record.t9}, </if> + <if test="record.payMethod != null and record.payMethod != '' "> + pay_method = #{record.payMethod}, + </if> </set> WHERE id=#{record.id} </update> @@ -743,7 +782,7 @@ <delete id="deleteByIds" parameterType="java.util.List"> delete from achieve_new where id in <foreach collection="list" index="index" item="item" open="(" - separator="," close=")"> + separator="," close=")"> #{item} </foreach> </delete> @@ -759,6 +798,11 @@ DELETE FROM achieve_new where 1=1 <include refid="where_sql"></include> + </delete> + + + <delete id="deleteByOrderId"> + DELETE FROM achieve_new where order_id=#{orderId} </delete> @@ -784,7 +828,7 @@ <!-- 查询总条数 --> <select id="selectTotalRecord" - resultType="java.lang.Integer"> + resultType="java.lang.Integer"> select count(*) from achieve_new where 1=1 @@ -819,4 +863,513 @@ where 1=1 <include refid="where_sql"></include> </select> + + + <select id="selectVipConsumeStatisticsList" resultType="java.util.HashMap"> + select + a.VIP_NAME vipName, + a.PHONE t9, + b.su_name meiliao, + (SELECT sum(IFNULL(goods_cash,0)) from achieve_new where pay_method='现金' and VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'goodsCash' , + (SELECT sum(IFNULL(goods_cash,0)) from achieve_new where pay_method='划扣' and VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if>) as 'cardCash' , + (SELECT sum(IFNULL(free_consume,0)) from achieve_new where VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'freeConsume' , + (SELECT sum(IFNULL(number_of_people,0)) from achieve_new where VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'arriveCnt' , + (SELECT sum(IFNULL(his_consume,0)) from achieve_new where VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'hisConsume' + from sys_vip_info a + left join sys_users b on a.BEATUY_ID=b.su_id + inner join sys_shop_info c on c.id=a.SHOP_ID + <where> + + <if test="record.vipName != null and record.vipName !=''"> + and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName}) + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.beaultId != null and record.beaultId!=''"> + and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID) + </if> + <if test='record.t1 == "on"'> + and a.BEATUY_ID is not null + </if> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <select id="selectVipConsumeStatisticsTotal" resultType="java.lang.Integer"> + select count(1) + from sys_vip_info a + left join sys_users b on a.BEATUY_ID=b.su_id + inner join sys_shop_info c on c.id=a.SHOP_ID + <where> + + <if test="record.vipName != null and record.vipName !=''"> + and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName}) + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.beaultId != null and record.beaultId!=''"> + and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID) + </if> + <if test='record.t1 == "on"'> + and a.BEATUY_ID is not null + </if> + </where> + </select> + + + <select id="selectUserAchieveByTime" resultType="com.matrix.system.app.vo.UserAchieveVo"> + select + sale_id id, + (select ifnull(sum(case pay_method when '现金' then goods_cash else 0 end),0) + from achieve_new a + where a.beault_id=#{userId} + and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) + ) orderCash, + (select ifnull(sum(case pay_method when '划扣' then goods_cash else 0 end),0) + from achieve_new a + where a.beault_id=#{userId} + and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) + ) cash, + sum(case order_type when '订单' then proj_percentage else 0 end) cardUse, + sum(IFNULL(his_consume, 0)) hisConsume, + sum(IFNULL(free_consume, 0)) freeConsume, + sum(case order_type when '服务单' then proj_percentage else 0 end) projCommission + from achieve_new a + where a.beault_id=#{userId} + and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) + </select> + + <select id="selectApiOrderItemAchieve" resultType="com.matrix.system.app.vo.OrderDetailAchieveItemVo"> + select + b.su_name name, + IFNULL(a.goods_cash, 0) achieve + from achieve_new a + inner join sys_users b on (a.beault_id=b.su_id or a.sale_id = b.su_id) + where a.order_item_id=#{itemId} and order_type = '订单' + </select> + + <select id="selectShopConsumeAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> + select + b.shop_short_name name, + b.SHOP_IMAG photo, + sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume,0)) amount + from achieve_new a + left join sys_shop_info b on a.shop_id=b.ID and b.shop_type!=1 + <where> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test='record.t1 == "1" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d') + </if> + <if test='record.t1 == "2" and record.datatime != null'> + and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m') + </if> + <if test='record.t1 == "3" and record.datatime != null'> + and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') + </if> + <if test='record.t1 == "4" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') + </if> + </where> + group by a.shop_id + order by amount desc, a.shop_id + </select> + + <select id="selectBeauticianConsumeAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> + select + b.su_name name, + b.su_id id, + b.su_photo photo, + sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) ) amount, + c.shop_short_name shopName + from achieve_new a + inner join sys_users b on a.beault_id=b.su_id + left join sys_shop_info c on a.shop_id=c.ID + <where> + a.order_type='服务单' + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test='record.t1 == "1" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d') + </if> + <if test='record.t1 == "2" and record.datatime != null'> + and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m') + </if> + <if test='record.t1 == "3" and record.datatime != null'> + and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') + </if> + <if test='record.t1 == "4" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') + </if> + </where> + group by a.beault_id + order by amount desc + </select> + + <select id="selectOrderItemAchieveByOrderId" resultMap="AchieveNewMap"> + select + a.*, + b.code goodsNo, + b.name goodsName, + c.su_name meiliao, + TRUNCATE(d.count*d.zk_price,2) zk_total + from achieve_new a + left join shopping_goods b on a.shopping_goods_id=b.id + left join sys_users c on a.beault_id=c.su_id + left join sys_order_item d on a.order_item_id=d.id + where a.order_id=#{orderId} + </select> + + <select id="selectStaffSaleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> + select + b.su_name name, + b.su_id id, + b.su_photo photo, + sum(ifnull(goods_cash,0)) amount, + c.shop_short_name shopName + from achieve_new a + inner join sys_users b on a.beault_id=b.su_id + inner join sys_shop_info c on a.SHOP_ID=c.ID + <where> + <if test="record.companyId != null"> + and b.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and b.shop_id=#{record.shopId} + </if> + <if test='record.type == "1" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d') + </if> + <if test='record.type == "2" and record.datatime != null'> + and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m') + </if> + <if test='record.type == "3" and record.datatime != null'> + and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') + </if> + <if test='record.t1 == "4" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') + </if> + </where> + group by b.su_id + order by amount desc, b.su_id + </select> + + <select id="selectShopSaleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> + select + b.shop_short_name name, + b.SHOP_IMAG photo, + sum(IFNULL(a.amount,0)) amount + from sys_order_flow a + inner join sys_order c on a.order_id=c.id and c.STATU != '已取消' + inner join sys_shop_info b on a.shop_id=b.id and shop_type!=1 + <where> + a.pay_method not in ('储值卡', '欠款') + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test='record.t1 == "1" and record.datatime != null'> + and date_format(a.create_time, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d') + </if> + <if test='record.t1 == "2" and record.datatime != null'> + and date_format(a.create_time, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m') + </if> + <if test='record.t1 == "3" and record.datatime != null'> + and date_format(a.create_time, '%Y') = date_format(#{record.datatime}, '%Y') + </if> + <if test='record.t1 == "4" and record.datatime != null'> + and date_format(a.create_time, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') + </if> + </where> + group by a.shop_id + order by amount desc, a.shop_id + </select> + + <!-- 顾问当天下单列表 --> + <select id="selectSaleManAchieveList" resultMap="AchieveNewMap"> + select * from achieve_new + where sale_id=#{saleId} and vip_id=#{vipId} and sale_id=beault_id + and date_format(datatime, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d') + </select> + + <select id="selectBeautyManAchieveList" resultMap="AchieveNewMap"> + select * from achieve_new + where beault_id=#{beautyId} and vip_id=#{vipId} + and date_format(datatime, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d') + </select> + + <select id="achieveNewStatistics" resultType="com.matrix.system.hive.vo.AchieveNewStatisticsVo"> + + select + u.name ruleName, + f.su_name guwen, + f.su_id gwid, + g.su_name createBy, + g.su_id createId, + cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total, + cast(SUM(a.his_consume) AS decimal(15,2)) his_consume, + cast(SUM(a.free_consume) AS decimal(15,2)) free_consume, + cast(SUM(a.proj_percentage) AS decimal(15,2)) proj_percentage, + cast(SUM(a.number_of_people) AS decimal(15,2)) number_of_people, + cast(SUM(a.proj_num) AS decimal(15,2)) proj_num, + cast(SUM(case when a.pay_method = '划扣' then goods_cash end )AS decimal(15,2)) card_cash, + cast(SUM(a.proj_time) AS decimal(15,2)) proj_time, + cast(SUM(case when a.pay_method = '现金' then goods_cash end )AS decimal(15,2)) goods_cash, + h.shop_short_name shop_name, + a.order_type + from + achieve_new a + left join sys_order b on a.order_id=b.id + left join sys_vip_info c on a.vip_id=c.id + left join sys_vip_level d on c.LEVEL_ID=d.id + left join shopping_goods e on a.shopping_goods_id=e.id + LEFT JOIN sys_users f on a.beault_id=f.su_id + LEFT JOIN sys_users g on a.sale_id = g.su_id + LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID + LEFT JOIN shopping_goods_category i ON e.cate_id = i.id + left join sys_proj_services l on a.service_order_id=l.id + left join sys_order_item j on a.order_item_id=j.ID + left join achieve_rule u on u.id=e.achieve_rule_id + <where> + and a.company_id = #{record.companyId} + <if test="record.shopId != null"> + and a.shop_id = #{record.shopId} + </if> + <if test="record.achieveRuleId != null"> + and u.id = #{record.achieveRuleId} + </if> + + <if test="record.staffName != null and record.staffName!=''"> + <!-- 创建人和归属人都有业绩 --> + and (f.su_name like concat('%',#{record.staffName},'%') or g.su_name like concat('%',#{record.staffName},'%') ) + </if> + + <if test="record.orderType != null and record.orderType != '' "> + and a.order_type= #{record.orderType} + </if> + <if test="record.beginTime != null "> + and a.datatime >= #{record.beginTime} + </if> + <if test="record.endTime != null "> + <![CDATA[and a.datatime <= #{record.endTime}]]> + </if> + + </where> + GROUP BY g.su_id , f.su_id, a.order_type, h.id,a.achieveType,u.name + <if test="record.sort !=null and record.sort!=''"> order by ${record.sort} ${record.order}</if> + + </select> + + + <update id="updateAchieveNumOfPeople"> + <foreach collection="list" item="item" index="index" + separator=";"> + update achieve_new set number_of_people=#{num} where id=#{item.id} + </foreach> + </update> + <update id="setPayMethod"> + + + update achieve_new + set pay_method=#{paymethod} + where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + + + </update> + + <select id="selectNumOfPeopleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> + select + b.su_name name, + b.su_id id, + b.su_photo photo, + sum(number_of_people) amount, + c.shop_short_name shopName + from achieve_new a + inner join sys_users b on a.beault_id=b.su_id + left join sys_shop_info c on a.shop_id=c.ID + <where> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test='record.t1 == "1" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d') + </if> + <if test='record.t1 == "2" and record.datatime != null'> + and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m') + </if> + <if test='record.t1 == "3" and record.datatime != null'> + and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') + </if> + <if test='record.t1 == "4" and record.datatime != null'> + and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') + </if> + </where> + group by a.beault_id + order by amount desc + </select> + + <select id="selectDailyBeautyList" resultType="com.matrix.system.hive.vo.DailyBeautyListVo"> + select + date_format(b.datatime, '%Y-%m-%d') datatime, + a.su_id, + a.su_name beautyName, + c.id vipId, + c.VIP_NAME, + c.arrival_way, + case when c.BEATUY_ID=a.su_id then 1 else 0 end isAppoint, + (select count(distinct date_format(n.datatime, '%Y-%m-%d')) from achieve_new n + where date_format(b.datatime, '%Y-%m') = date_format(n.datatime, '%Y-%m') and n.vip_id=c.ID + group by date_format(n.datatime, '%Y-%m'))arriveCnt, + (select count(1) from sys_order o where o.statu in ('欠款', '已付款') and o.VIP_ID=c.id) orderCnt, + (select group_concat(distinct q.pay_method) payMethod from sys_order p + inner join sys_order_flow q on p.ID=q.ORDER_ID + inner join achieve_new o on o.order_id=p.id + where date_format(pay_time, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') and o.beault_id=a.su_id and c.ID=q.vip_id and p.STATU in ('欠款', '已付款') + group by p.VIP_ID) payMethods, + (select sum(amount) from sys_order_flow x + inner join achieve_new y on x.order_id=y.order_id + where x.pay_method='团购' and date_format(x.create_time, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') + and y.beault_id=a.su_id and x.vip_id=c.id ) teamPay, + (select sum(m.ZK_PRICE) from sys_order_item m + inner join achieve_new n on n.ORDER_ID=m.order_id + where date_format(m.create_time, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') + and m.type in ('套餐', '项目') and n.beault_id=a.su_id) tcAndProjCash, + (select sum(m.ZK_PRICE) from sys_order_item m + inner join achieve_new n on n.ORDER_ID=m.order_id + where date_format(m.create_time, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') + and m.type in ('家居产品') and n.beault_id=a.su_id) productCash, + (select sum(m.ZK_PRICE) from sys_order_item m + inner join achieve_new n on n.ORDER_ID=m.order_id + where date_format(m.create_time, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') + and m.type in ('充值卡') and n.beault_id=a.su_id) cardCash, + (select sum(amount) from sys_order_flow x + inner join achieve_new y on x.order_id=y.order_id + where x.pay_method='储值卡' and date_format(x.create_time, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') + and y.beault_id=a.su_id and x.vip_id=c.id) cardPay, + (select sum(amount) from sys_order_flow x + inner join achieve_new y on x.order_id=y.order_id + where x.pay_method not in ('储值卡','欠款') and date_format(x.create_time, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') + and y.beault_id=a.su_id and x.vip_id=c.id) cashPay, + (select sum(e.goods_cash) from achieve_new e + inner join shopping_goods f on e.shopping_goods_id=f.id and f.is_cooperate=1 + where e.order_type='订单' and date_format(e.datatime, '%Y-%m-%d') = date_format(b.datatime, '%Y-%m-%d') + and e.beault_id=a.su_id and e.vip_id=c.id) cooperateProj, + sum(proj_percentage) ticheng, + sum(IFNULL(free_consume,0) + IFNULL(his_consume,0)) consume, + (select count(1) from achieve_new z where z.beault_id=a.su_id and c.id=z.vip_id and z.order_type='服务单' group by z.beault_id,z.vip_id) projCnt + from sys_users a + left join achieve_new b on a.su_id=b.beault_id + left join sys_vip_info c on b.vip_id=c.ID + where 1=1 + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.beginTime != null"> + and date_format(b.datatime, '%Y-%m-%d') > date_format(#{record.beginTime}, '%Y-%m-%d') + </if> + <if test="record.endTime != null"> + and date_format(#{record.endTime}, '%Y-%m-%d') > date_format(b.datatime, '%Y-%m-%d') + </if> + <if test="record.beaultId != null"> + and a.su_id=#{record.beaultId} + </if> + <if test="record.vipQueryKey != null and record.vipQueryKey != ''"> + and c.vip_name like concat('%', #{record.vipQueryKey}, '%') + </if> + <if test="record.beginTime == null and record.endTime == null"> + and date_format(b.datatime, '%Y-%m') = date_format(now(), '%Y-%m') + </if> + group by date_format(b.datatime, '%Y-%m-%d'), a.su_id, c.ID + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + order by date_format(b.datatime, '%Y-%m-%d') desc, a.su_id + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <select id="selectDailyBeautyListTotal" resultType="java.lang.Integer"> + select count(1) from ( + select + date_format(b.datatime, '%Y-%m-%d') datatime, + a.su_id, + a.su_name, + c.id vipId, + c.VIP_NAME, + c.arrival_way, + sum(proj_percentage) ticheng, + sum(IFNULL(free_consume,0) + IFNULL(his_consume,0)) consume + from sys_users a + left join achieve_new b on a.su_id=b.beault_id + left join sys_vip_info c on b.vip_id=c.ID + where 1=1 + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.beginTime != null"> + and date_format(b.datatime, '%Y-%m-%d') > date_format(#{record.beginTime}, '%Y-%m-%d') + </if> + <if test="record.endTime != null"> + and date_format(#{record.endTime}, '%Y-%m-%d') > date_format(b.datatime, '%Y-%m-%d') + </if> + <if test="record.beaultId != null"> + and a.su_id=#{record.beaultId} + </if> + <if test="record.vipQueryKey != null and record.vipQueryKey != ''"> + and c.vip_name like concat('%', #{record.vipQueryKey}, '%') + </if> + <if test="record.beginTime == null and record.endTime == null"> + and date_format(b.datatime, '%Y-%m') = date_format(now(), '%Y-%m') + </if> + group by date_format(b.datatime, '%Y-%m-%d'), a.su_id, c.ID + ) a + </select> + + <select id="selectPlInfoByVipIdAndDate" resultType="java.lang.String"> + select group_concat(concat(name,'*', bb)) + from (select l.name name, 0+CAST(sum(n.amount) as char) bb from sys_out_store m + inner join sys_out_store_item n on m.id=n.OUT_STORE_ID + inner join shopping_goods l on n.SKU_ID=l.id + where m.SERVICE_ID in (select distinct service_order_id from achieve_new where date_format(datatime, '%Y-%m-%d') = date_format(#{datatime}, '%Y-%m-%d') and vip_id=#{vipId}) + group by l.id) a + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveRuleDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveRuleDao.xml new file mode 100644 index 0000000..a6c3707 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveRuleDao.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.AchieveRuleDao"> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml index 40be119..2e0c943 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml @@ -16,7 +16,7 @@ <result property="sort" column="sort" /> <result property="createtiem" column="createtiem" /> <result property="url" column="url" /> - <result property="shopId" column="shop_id"/> + <result property="companyId" column="company_id"/> <result property="articleTypeName" column="article_type_name" /> @@ -43,7 +43,7 @@ url, like_number, classify, - shop_id + company_id ) VALUES ( #{id}, @@ -59,7 +59,7 @@ #{url}, #{likeNumber}, #{classify}, - #{shopId} + #{companyId} ) </insert> @@ -143,7 +143,7 @@ url, classify, like_number, - shop_id, + company_id, (select article_type_name from article_type c where type_id = c.id) articleTypeName, (select type from article_type c where type_id = c.id) type from article @@ -188,8 +188,8 @@ <if test="record.likeNumber != null and record.likeNumber !='' "> and like_number = #{record.likeNumber} </if> - <if test="record.shopId != null and record.shopId !='' "> - and shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} </if> <if test="record.type != null and record.type !='' "> and (select type from article_type c where type_id = c.id) = #{record.type} @@ -228,7 +228,7 @@ url, classify, like_number, - shop_id, + company_id, (select article_type_name from article_type c where type_id = c.id) articleTypeName, (select type from article_type c where type_id = c.id) type from article @@ -279,8 +279,8 @@ <if test="record.articleTypeName != null and record.url !='' "> and (select article_type_name from article_type c where type_id = c.id) = #{record.articleTypeName} </if> - <if test="record.shopId != null and record.shopId !='' "> - and shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} </if> </if> order by type_id,sort,createtiem desc @@ -338,8 +338,8 @@ <if test="record.articleTypeName != null and record.url !='' "> and (select article_type_name from article_type c where type_id = c.id) = #{record.articleTypeName} </if> - <if test="record.shopId != null and record.shopId !='' "> - and shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} </if> </if> </select> @@ -360,12 +360,14 @@ url, like_number, classify, - shop_id, + company_id, (select article_type_name from article_type c where type_id = c.id) articleTypeName<!-- 所属门店名称 --> from article where id=#{id} - </select> - + </select> + + + <!-- 根据对象查询--> <select id="selectByModel" resultMap="ArticleMap"> @@ -383,7 +385,7 @@ a.url, a.classify, a.like_number, - a.shop_id, + a.company_id, (select article_type_name from article_type c where a.type_id = c.id) articleTypeName,<!-- 所属门店名称 --> (select count(*) from article_comment ac where ac.article_id=a.id) commentNum from article a @@ -431,10 +433,25 @@ <if test="record.articleTypeName != null and record.url !='' "> and (select article_type_name from article_type c where a.type_id = c.id) = #{record.articleTypeName} </if> - <if test="record.shopId != null and record.shopId !='' "> - and a.shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and a.company_id = #{record.companyId} </if> </if> order by type_id,sort,createtiem desc </select> + + <select id="selectApiArticleListInPage" resultMap="ArticleMap"> + select * from article a + inner join article_type b on a.type_id=b.id + where a.company_id=#{record.companyId} and (a.type_id=#{record.typeId} or find_in_set(#{record.typeId}, b.parent_ids)) + order by a.createtiem desc + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml index c45c853..bb312b7 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml @@ -12,8 +12,10 @@ <result property="description" column="description" /> <result property="url" column="url" /> <result property="icon" column="icon" /> - <result property="type" column="type" /> + <result property="type" column="type" /> + <result property="parentIds" column="parent_ids" /> <result property="shopId" column="shop_id"/> + <result property="companyId" column="company_id" /> <!--扩展属性 --> <!-- <association property="article" javaType="Article" column="{type_id=id}" select="com.matrix.system.hive.dao.ArticleDao.selectById" /> --> @@ -30,7 +32,9 @@ url, icon, type, - shop_id + shop_id, + company_id, + parent_ids ) VALUES ( #{id}, @@ -41,7 +45,9 @@ #{url}, #{icon}, #{type}, - #{shopId} + #{shopId}, + #{companyId}, + #{parentIds} ) </insert> @@ -70,7 +76,10 @@ </if> <if test="type != null and type !='' "> type = #{type}, - </if> + </if> + <if test="parentIds != null and parentIds !='' "> + parent_ids = #{parentIds}, + </if> </set> WHERE id=#{id} </update> @@ -223,7 +232,7 @@ <if test="record.articleTypeName != null and record.articleTypeName !='' "> and article_type_name = #{record.articleTypeName} </if> - <if test="record.parentId != null and record.parentId !='' "> + <if test="record.parentId != null or record.parentId ==0 "> and parent_id = #{record.parentId} </if> <if test="record.sort != null and record.sort !='' "> @@ -244,6 +253,9 @@ <if test="record.shopId != null and record.shopId !='' "> and shop_id = #{record.shopId} </if> + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} + </if> </if> </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardAssembleDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardAssembleDao.xml index 213bd3a..62d7d53 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardAssembleDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardAssembleDao.xml @@ -224,4 +224,24 @@ card_id from money_card_assemble where card_id=#{cardId} </select> + + <select id="selectCardRelationGoods" resultType="com.matrix.system.app.vo.ShoppingGoodsDetailVo"> + select + b.name goodsName, + b.measure measure, + b.volume volume + from money_card_assemble a + inner join shopping_goods b on a.goods_id=b.id + where a.card_id=#{cardId} + </select> + + <select id="selectCardRelationCategory" resultType="com.matrix.system.hive.bean.ShoppingGoodsCategory"> + select + a.id id, + a.name name, + a.parent_id parentId + from shopping_goods_category a + inner join money_card_assemble b on a.id=b.cate_id + where b.card_id=#{cardId}; + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml index b03d791..e8fc10b 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml @@ -20,6 +20,7 @@ <result property="isVipCar" column="is_vip_car"/> <result property="remark" column="remark"/> <result property="cardName" column="card_name"/> + <result property="orderId" column="orderId"/> <!-- 对应会员信息 --> <association property="vipInfo" javaType="SysVipInfo" @@ -139,6 +140,9 @@ </if> </set> WHERE id=#{id} + </update> + <update id="updateId"> + update money_card_use set id=#{newId} where id=#{id} </update> @@ -366,6 +370,7 @@ select a.id, a.order_item_id, + d.id AS orderId, a.use_total, a.last_count, a.real_money, @@ -380,7 +385,10 @@ a.remark, a.card_name from money_card_use a - where vip_id = #{record.vipId} + left join shopping_goods b on a.goods_id=b.id + left join sys_order_item c on a.ORDER_ITEM_ID=c.id + left join sys_order d on c.ORDER_ID=d.id + where a.vip_id = #{record.vipId} <if test="record!=null"> <if test="record.orderItemId != null and record.orderItemId !='' "> and a.order_item_id = #{record.orderItemId} @@ -420,7 +428,9 @@ select count(*) from money_card_use a left join shopping_goods b on a.goods_id=b.id - where vip_id = #{record.vipId} + left join sys_order_item c on a.ORDER_ITEM_ID=c.id + left join sys_order d on c.ORDER_ID=d.id + where a.vip_id = #{record.vipId} <if test="record!=null"> <if test="record.orderItemId != null and record.orderItemId !='' "> and a.order_item_id = #{record.orderItemId} @@ -517,9 +527,9 @@ and c.shop_id =#{shopId} </if> <if test="vipQueryKey != null and vipQueryKey != '' "> - and e.VIP_NAME like concat('%',#{vipQueryKey},'%') - or (e.VIP_NO like concat('%',#{vipQueryKey},'%') - or e.PHONE like concat('%',#{vipQueryKey},'%') + and c.VIP_NAME like concat('%',#{vipQueryKey},'%') + or (c.VIP_NO like concat('%',#{vipQueryKey},'%') + or c.PHONE like concat('%',#{vipQueryKey},'%') ) </if> <if test="goodsName != null and goodsName != '' "> @@ -611,9 +621,15 @@ group by b.id) t </select> + <!-- 美度不显示赠送金额 IFNULL(sum(IFNULL(gift_money, 0)),0)+--> <select id="selectVipCardTotalMoney" resultType="java.lang.Double"> - SELECT TRUNCATE( SUM(gift_money)+SUM(real_money) ,2 ) from money_card_use where vip_id=#{vipId} and `status` ='有效' + + SELECT IFNULL(sum(IFNULL(real_money, 0)),0) from money_card_use where vip_id=#{vipId} and `status` ='有效' </select> + <update id="updateInvalidMoneyCardUse"> + update money_card_use set STATUS='无效' + where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') and STATUS='有效' + </update> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml index a767566..96da104 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml @@ -7,6 +7,7 @@ <resultMap type="com.matrix.system.hive.bean.MoneyCardUseFlow" id="MoneyCardUseFlowMap"> <id property="id" column="id" /> <result property="orderNo" column="order_no" /> + <result property="payNo" column="pay_no" /> <result property="operationId" column="operation_id" /> <result property="content" column="content" /> <result property="createTime" column="create_time" /> @@ -31,6 +32,7 @@ <resultMap type="com.matrix.system.hive.bean.MoneyCardUseFlow" id="MoneyCardUseFlowSimpleMap"> <id property="id" column="id" /> <result property="orderNo" column="order_no" /> + <result property="payNo" column="pay_no" /> <result property="operationId" column="operation_id" /> <result property="content" column="content" /> <result property="createTime" column="create_time" /> @@ -51,6 +53,7 @@ INSERT INTO money_card_use_flow ( id, order_no, + pay_no, operation_id, content, create_time, @@ -66,6 +69,7 @@ VALUES ( #{id}, #{orderNo}, + #{payNo}, #{operationId}, #{content}, #{createTime}, @@ -94,7 +98,7 @@ <if test="content != null and content !='' "> content = #{content}, </if> - <if test="createTime != null and createTime !='' "> + <if test="createTime != null "> create_time = #{createTime}, </if> <if test="vipId != null and vipId !='' "> @@ -109,8 +113,8 @@ <if test="type != null and type !='' "> type = #{type}, </if> - <if test="taotal != null and taotal !='' "> - taotal = #{taotal}, + <if test="total != null and total !='' "> + total = #{total}, </if> <if test="times != null and times !='' "> times = #{times}, @@ -149,6 +153,7 @@ select id, order_no, + pay_no, operation_id, content, create_time, @@ -160,7 +165,7 @@ times, gift_money, balance, - (SELECT STAFF_NAME from sys_shopstaff_info a WHERE operation_id=a.id) staffName, + (SELECT su_name from sys_users a WHERE operation_id=a.su_id) staffName, (SELECT VIP_NAME FROM sys_vip_info b WHERE vip_id=b.ID) vipName, (SELECT card_NAME FROM money_card_use c WHERE car_use_id=c.ID) cardName from money_card_use_flow @@ -171,6 +176,9 @@ </if> <if test="record.orderNo != null and record.orderNo !='' "> and order_no = #{record.orderNo} + </if> + <if test="record.payNo != null and record.payNo !='' "> + and pay_no = #{record.payNo} </if> <if test="record.operationId != null and record.operationId !='' "> and operation_id = #{record.operationId} @@ -215,6 +223,9 @@ <if test="record.orderNo != null and record.orderNo !='' "> and order_no = #{record.orderNo} </if> + <if test="record.payNo != null and record.payNo !='' "> + and pay_no = #{record.payNo} + </if> <if test="record.operationId != null and record.operationId !='' "> and operation_id = #{record.operationId} </if> @@ -245,6 +256,7 @@ select id, order_no, + pay_no, operation_id, content, create_time, @@ -269,6 +281,7 @@ select id, order_no, + pay_no, operation_id, content, create_time, @@ -291,6 +304,9 @@ </if> <if test="record.orderNo != null and record.orderNo !='' "> and order_no = #{record.orderNo} + </if> + <if test="record.payNo != null and record.payNo !='' "> + and pay_no = #{record.payNo} </if> <if test="record.operationId != null and record.operationId !='' "> and operation_id = #{record.operationId} @@ -315,6 +331,41 @@ </if> </if> </select> + + <select id="selectForWxInPage" resultMap="MoneyCardUseFlowMap"> + select + id, + order_no, + pay_no, + content, + create_time, + type, + total, + times, + gift_money, + balance, + (SELECT su_name from sys_users a WHERE operation_id=a.su_id) staffName + from money_card_use_flow + <where> + and car_use_id=#{record.carUseId} + <if test="record.queryTime!=null and record.queryTime!=''"> + and DATE_FORMAT(create_time,'%Y-%m')=#{record.queryTime} + </if> + <if test="record.revenueType==1"> + and total>0 + </if> + <if test="record.revenueType==2"> + <![CDATA[ and total<0 ]]> + </if> + </where> + order by create_time desc + </select> + + <update id="updateVipCardId"> + update money_card_use_flow + set car_use_id=#{cardId} + where vip_id=#{vipId} and type='会员充值' + </update> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseV2Dao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseV2Dao.xml new file mode 100644 index 0000000..86ef51f --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseV2Dao.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.MoneyCardUseV2Dao"> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/QuestionDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/QuestionDao.xml index 9d9e344..ea70d23 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/QuestionDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/QuestionDao.xml @@ -50,7 +50,10 @@ FROM question a LEFT JOIN vip_answer b ON a.id = b.quesion_id and b.vip_id=#{id} - WHERE category=#{type} + WHERE + a.company_id=#{companyId} + and category=#{type} + ORDER BY order_field DESC </select> diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsAssembleDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsAssembleDao.xml index 9597a28..7a1c514 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsAssembleDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsAssembleDao.xml @@ -432,5 +432,18 @@ WHERE shopping_goods_id = #{shoppingGoodsId} </update> + <select id="selectGoodsRelationGoodsList" resultType="com.matrix.system.app.vo.ShoppingGoodsDetailVo"> + select + b.name goodsName, + b.measure measure, + b.volume volume + from shopping_goods_assemble a + inner join shopping_goods b on a.assembleGoodId=b.id + where a.shopping_goods_id=#{goodsId} + <if test="goodsType!= null and goodsType != ''"> + and b.good_type=#{goodsType} + </if> + </select> + </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsCategoryDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsCategoryDao.xml index 981a76b..1806262 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsCategoryDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsCategoryDao.xml @@ -208,4 +208,20 @@ </if> ORDER BY sequence </select> + + <select id="selectChildNodesByName" resultMap="ShoppingGoodsCategoryMap"> + select * from shopping_goods_category a + inner join shopping_goods_category b on a.parent_id=b.id and b.parent_id=0 + <if test="record.name != null and record.name != ''"> + and b.name=#{record.name} + </if> + <where> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + </where> + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml index 09060f2..42b4adc 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml @@ -85,6 +85,15 @@ <result property="goodsSortName" column="goodsSortName" /> + <result property="achieveRuleName" column="achieveRuleName" /> + + + <result property="payMethods" column="pay_methods" /> + <result property="invalidTime" column="invalid_time" /> + <result property="useValid" column="use_valid" /> + <result property="buyValid" column="buy_valid" /> + <result property="isInfinite" column="is_infinite" /> + <result property="achieveRuleId" column="achieve_rule_id" /> @@ -154,11 +163,14 @@ <!-- 服务项目信息 --> <result property="proReward" column="proReward" /> <result property="timeLength" column="TIME_LENGTH" /> + <result property="achieveRuleId" column="achieve_rule_id" /> <!-- 扩展属性 --> <result property="cateName" column="cate_name" /> <result property="goodsSortName" column="goodsSortName" /> + <result property="achieveRuleName" column="achieveRuleName" /> + </resultMap> @@ -290,7 +302,14 @@ use_shop, headquarters, is_del, - zjm + zjm, + buy_valid, + use_valid, + invalid_time, + pay_methods, + is_infinite, + achieve_rule_id, + is_cooperate ) VALUES ( #{id}, @@ -346,7 +365,14 @@ #{useShop}, #{headquarters}, #{isDel}, - #{zjm} + #{zjm}, + #{buyValid}, + #{useValid}, + #{invalidTime}, + #{payMethods}, + #{isInfinite}, + #{achieveRuleId}, + #{isCooperate} ) </insert> @@ -403,7 +429,7 @@ <if test="isPresent != null and isPresent !='' "> is_present = #{isPresent}, </if> - <if test="isOnce != null and isOnce !='' "> + <if test="isOnce != null "> is_once = #{isOnce}, </if> <if test="salePlatform != null and salePlatform !='' "> @@ -421,13 +447,13 @@ </if> <if - test="(carMaxSaleCount != null and carMaxSaleCount !='') or carMaxSaleCount==0"> + test="carMaxSaleCount != null"> car_max_sale_count = #{carMaxSaleCount}, </if> <if test="carIsAll != null and carIsAll !='' "> car_is_all = #{carIsAll}, </if> - <if test="(carUseCount != null and carUseCount !='') or carUseCount==0 "> + <if test="carUseCount != null "> car_use_count = #{carUseCount}, </if> <if test="isVipCar != null and isVipCar !='' "> @@ -519,8 +545,17 @@ <if test="isDel != null and isDel !='' "> is_del = #{isDel}, </if> + <if test="isInfinite != null and isInfinite !='' "> + is_infinite = #{isInfinite}, + </if> - + <if test="achieveRuleId != null and achieveRuleId !='' "> + achieve_rule_id = #{achieveRuleId}, + </if> + invalid_time = #{invalidTime}, + buy_valid = #{buyValid}, + use_valid = #{useValid}, + pay_methods = #{payMethods}, </set> WHERE id=#{id} </update> @@ -555,8 +590,9 @@ <select id="selectInPage" resultMap="ShoppingGoodsMap"> select a.*, - (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) goodsSortName, - (select NAME from shopping_goods_category t where t.id=a.cate_id) cate_name, + (select name from achieve_rule f where f.id=a.achieve_rule_id) as achieveRuleName, + (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) as goodsSortName, + (select NAME from shopping_goods_category t where t.id=a.cate_id) as cate_name, (select shop_name from sys_shop_info h where a.SHOP_ID=h.ID ) as shop_name from shopping_goods a where 1=1 @@ -631,6 +667,11 @@ </if> + <if test="record.achieveRuleId != null and record.achieveRuleId !='' "> + and achieve_rule_id = #{record.achieveRuleId} + </if> + + <if test="record.headquarters != null and record.headquarters !='' "> and headquarters = #{record.headquarters} @@ -664,28 +705,25 @@ <if test="record.queryNoGoodsype != null and record.queryNoGoodsype !='' "> and good_type !=#{record.queryNoGoodsype} </if> + <if test="record.name != null and record.name !='' "> and (instr(name,#{record.name}) or instr(zjm,#{record.name})) </if> + <if test="record.zjm != null and record.zjm !='' "> + and instr(zjm,#{record.zjm}) + </if> + + <if test="record.staus != null and record.staus !='' "> and staus =#{record.staus} </if> - <if test="record.code != null and record.code !=''"> - and code = #{record.code} - </if> + <if test="record.isAssemble != null and record.isAssemble !='' "> and is_assemble =#{record.isAssemble} </if> <if test="record.deleted != null and record.deleted !='' "> and deleted =#{record.deleted} </if> - <if test="record.isDel != null and record.isDel !='' "> - and is_del = #{record.isDel} - </if> - <if test="record.zjm != null and record.zjm !='' "> - and instr(zjm,#{record.zjm}) - </if> - <if test="record.cateId != null and record.cateId !='' "> and cate_id =#{record.cateId} </if> @@ -700,39 +738,54 @@ <if test="record.isVipCar != null and record.isVipCar !='' "> and is_vip_car = #{record.isVipCar} </if> + <if test="record.achieveRuleId != null and record.achieveRuleId !='' "> + and achieve_rule_id = #{record.achieveRuleId} + </if> <if test="record.isCourse != null and record.isCourse !=''"> and is_course = #{record.isCourse} </if> + + <if test="record.code != null and record.code !=''"> + and code = #{record.code} + </if> + <if test="record.startTime != null "> and create_time <![CDATA[ >= ]]> #{record.startTime} </if> <if test="record.endTime != null "> and create_time <![CDATA[ <= ]]> #{record.endTime} + </if> <if test="record.shopId != null and record.shopId !='' "> - <![CDATA[ and ( shop_id = #{record.shopId} - or ISNULL(use_shop) || LENGTH(trim(use_shop))<1 - or FIND_IN_SET(#{record.shopId},use_shop) ) ]]> + <![CDATA[ and ( shop_id = #{record.shopId} or + ( headquarters=1 and ( ISNULL(use_shop) or LENGTH(trim(use_shop))<1 or FIND_IN_SET(#{record.shopId},use_shop))))]]> </if> <if test="record.companyId != null and record.companyId !='' "> and company_id = #{record.companyId} </if> + + <if test="record.isDel != null and record.isDel !='' "> + and is_del = #{record.isDel} + </if> + <if test="record.headquarters != null and record.headquarters !='' "> and headquarters = #{record.headquarters} </if> - </if> + + </select> <select id="selectAll" resultMap="ShoppingGoodsSimpleMap"> select *, + (select name from achieve_rule f where f.id=a.achieve_rule_id) as achieveRuleName, (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) goodsSortName, (select NAME from shopping_goods_category t where t.id=cate_id) @@ -838,6 +891,7 @@ <select id="findByCode" resultMap="ShoppingGoodsMap"> select *, + (select name from achieve_rule f where f.id=a.achieve_rule_id) as achieveRuleName, (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) goodsSortName, (select NAME from shopping_goods_category t where t.id=cate_id) @@ -850,6 +904,7 @@ <select id="selectSimpleMapById" resultMap="ShoppingGoodsSimpleMap"> select *, + (select name from achieve_rule f where f.id=a.achieve_rule_id) as achieveRuleName, (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) goodsSortName, (select NAME from shopping_goods_category t where t.id=cate_id) @@ -869,6 +924,7 @@ <select id="selectByModel" resultMap="ShoppingGoodsMap"> select *, + (select name from achieve_rule f where f.id=a.achieve_rule_id) as achieveRuleName, (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) goodsSortName, (select NAME from shopping_goods_category t where t.id=cate_id) @@ -948,6 +1004,7 @@ <select id="selectByModel1" resultMap="ShoppingGoodsMap"> select *, + (select name from achieve_rule f where f.id=a.achieve_rule_id) as achieveRuleName, (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) goodsSortName, (select NAME from shopping_goods_category t where t.id=cate_id) @@ -1026,6 +1083,7 @@ <select id="selectInPageNoTaocan" resultMap="ShoppingGoodsMap"> select *, + (select name from achieve_rule f where f.id=a.achieve_rule_id) as achieveRuleName, (select TYPE_NAME from sys_goods_type b where b.id=a.goods_sort_id) goodsSortName, (select NAME from shopping_goods_category t where t.id=cate_id) @@ -1197,6 +1255,10 @@ </foreach> </update> + <update id="updateInvalidProduct"> + update shopping_goods set staus = '下架' + where date_format(now(), '%Y-%m-%d') > date_format(sale_off_time, '%Y-%m-%d') and staus='上架' + </update> <!-- 根据code查询 --> @@ -1207,4 +1269,73 @@ </select> + <select id="selectShoppingGoodsApiInPage" resultType="com.matrix.system.app.vo.ShoppingGoodsListVo"> + select + id id, + code goodsCode, + name name, + seal_pice price, + is_present isPresent, + unit unit, + measure measure, + a.good_type goodsType + from shopping_goods a + where 1=1 and staus = '上架' and a.is_del=1 + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey})) + </if> + <if test="record.cateId!=null"> + and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId})) + </if> + <if test="record.shopId != null and record.shopId !='' "> + <![CDATA[ and ( a.shop_id = #{record.shopId} or + ( a.headquarters=1 and ( ISNULL(a.use_shop) or LENGTH(trim(a.use_shop))<1 or FIND_IN_SET(#{record.shopId},a.use_shop))))]]> + </if> + <if test="record.companyId != null and record.companyId !='' "> + and a.company_id=#{record.companyId} + </if> + <if test="record.goodType!=null"> + and a.good_type=#{record.goodType} + </if> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <select id="selectShopppingGoodsAipTotal" resultType="java.lang.Integer"> + select count(1) + from shopping_goods a + where 1=1 and staus = '上架' + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey})) + </if> + <if test="record.cateId!=null"> + and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId})) + </if> + <if test="record.shopId != null and record.shopId !='' "> + <![CDATA[ and ( a.shop_id = #{record.shopId} or + ( a.headquarters=1 and ( ISNULL(a.use_shop) or LENGTH(trim(a.use_shop))<1 or FIND_IN_SET(#{record.shopId},a.use_shop))))]]> + </if> + <if test="record.companyId != null and record.companyId !='' "> + and a.company_id=#{record.companyId} + </if> + <if test="record.goodType!=null"> + and a.good_type=#{record.goodType} + </if> + </select> + + <select id="selectByIds" resultMap="ShoppingGoodsSimpleMap"> + select + * + from shopping_goods + where id in + <foreach collection="ids" item="item" separator="," open="(" close=")"> + #{item} + </foreach> + </select> </mapper> diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml index 14241e6..709e6c9 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml @@ -131,15 +131,15 @@ a.count, a.proj_id, b.su_name, - c.name as goods_name, - c.seal_pice as goods_seal_pice, + d.proj_name as goods_name, + d.price as goods_seal_pice, c.TIME_LENGTH as goods_time_length, d.id as pu_id, d.SURPLUS_COUNT as pu_SURPLUS_COUNT, d.ASSEMBLE_ID as pu_ASSEMBLE_ID, - d.price as pu_price - - + d.price as pu_price, + d.taocan_id as pu_taocan_id, + d.source as pu_source from sys_beautician_state a left join sys_users b on a.staff_id= b.su_id left join shopping_goods c on a.proj_id=c.id @@ -147,10 +147,14 @@ where a.SERVICES_ID =#{serId} </select> + <!-- EXC_TIME =TIMESTAMPDIFF(MINUTE,BEGIN_TIME,now()) --> <update id="chengItemState"> - update sys_beautician_state set state=#{record.state}, - EXC_TIME =TIMESTAMPDIFF(MINUTE,BEGIN_TIME,now()) - where STAFF_ID=#{record.staffId} and SERVICES_ID =#{record.servicesId} + update sys_beautician_state set state=#{record.state} + where 1=1 + <if test="record.staffId != null"> + and STAFF_ID=#{record.staffId} + </if> + and SERVICES_ID =#{record.servicesId} </update> <!-- 根据id更新 部分更新 --> @@ -172,7 +176,7 @@ <if test="servicesId != null and servicesId !='' "> SERVICES_ID = #{servicesId}, </if> - <if test="servicesId != null and servicesId !='' "> + <if test="excTime != null and excTime !='' "> EXC_TIME = #{excTime}, </if> @@ -327,6 +331,9 @@ <![CDATA[ a.BEGIN_TIME > #{beginTime} and a.END_TIME < #{endTime} and a.STAFF_ID = #{suId} ]]> + and a.STATE !='预约取消' + and a.STATE !='待确认' + and a.STATE !='待预约' order by a.BEGIN_TIME asc </select> @@ -355,9 +362,9 @@ SERVICES_ID, EXC_TIME, extract, - a.puse_id, - a.count, - a.proj_id + puse_id, + count, + proj_id </sql> <sql id="from"> from sys_beautician_state @@ -407,6 +414,7 @@ <select id="selectItemDetail" resultType="java.util.HashMap" parameterType="java.util.HashMap"> select f.SHOP_NAME, + b.yy_time, b.consume_time, b.SERVICE_NO, d.su_name, @@ -417,7 +425,8 @@ a.COUNT, h.PRICE, h.SOURCE, - a.STATE + a.STATE, + a.extract from sys_beautician_state a left join sys_proj_services b on a.SERVICES_ID=b.ID left join shopping_goods c on a.proj_id=c.id @@ -455,7 +464,7 @@ </if> <if test="cateId != null and cateId != '' "> - and c.PROJ_TYPE_ID=#{cateId} + and c.cate_id=#{cateId} </if> @@ -614,4 +623,17 @@ group by c.id,f.id) t </select> + <select id="selectByProjUse" resultMap="SysBeauticianStateMap"> + select * from sys_beautician_state + where state!=#{state} and puse_id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item.id} + </foreach> + </select> + + <select id="selectBeauticianStateByPuseIdAndNoStatus" resultMap="SysBeauticianStateMap"> + select * from sys_beautician_state + where puse_id=#{puseId} and state!=#{state} + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml index d048579..ddb5b13 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml @@ -533,6 +533,444 @@ ) t </select> + <select id="selectApiBusinessDataInPage" resultType="com.matrix.system.app.vo.BusinessesDataShowVo"> + select + date_format(a.time, #{record.t1}) dataTime, + sum(cashPay + cardPay + arrearsPay) totalPay, + sum(cashPay) cashPay, + sum(cardPay) cardPay, + sum(arrearsPay) arrearsPay, + sum(freeConsumePay) freeConsumePay, + sum(consumePay) consumePay, + sum(refundCardPay) refundCardPay, + sum(refundCashPay) refundCashPay + from ( + select + company_id, + shop_id, + a.time, + MAX(CASE code WHEN 'cashPay' THEN value ELSE 0 END) cashPay, + MAX(CASE code WHEN 'cardPay' THEN value ELSE 0 END) cardPay, + MAX(CASE code WHEN 'arrearsPay' THEN value ELSE 0 END) arrearsPay, + MAX(CASE code WHEN 'freeConsumePay' THEN value ELSE 0 END) freeConsumePay, + MAX(CASE code WHEN 'consumePay' THEN value ELSE 0 END) consumePay, + MAX(CASE code WHEN 'refundCashPay' THEN ABS(value) ELSE 0 END) refundCashPay, + MAX(CASE code WHEN 'refundCardPay' THEN ABS(value) ELSE 0 END) refundCardPay + from sys_business_data a + group by a.time, company_id, shop_id + ) a + <where> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + </where> + group by date_format(a.time, #{record.t1}) + order by a.time desc + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + <select id="selectApiBusinessDataTotal" resultType="java.lang.Integer"> + select + count(1) + from ( + select + date_format(a.time, #{record.t1}) dataTime, + sum(cashPay + cardPay + arrearsPay) totalPay, + sum(cashPay) cashPay, + sum(cardPay) cardPay, + sum(arrearsPay) arrearsPay, + sum(freeConsumePay) freeConsumePay, + sum(consumePay) consumePay, + sum(refundCardPay) refundCardPay, + sum(refundCashPay) refundCashPay + from ( + select + company_id, + shop_id, + a.time, + MAX(CASE code WHEN 'cashPay' THEN value ELSE 0 END) cashPay, + MAX(CASE code WHEN 'cardPay' THEN value ELSE 0 END) cardPay, + MAX(CASE code WHEN 'arrearsPay' THEN value ELSE 0 END) arrearsPay, + MAX(CASE code WHEN 'freeConsumePay' THEN value ELSE 0 END) freeConsumePay, + MAX(CASE code WHEN 'consumePay' THEN value ELSE 0 END) consumePay, + MAX(CASE code WHEN 'refundCashPay' THEN ABS(value) ELSE 0 END) refundCashPay, + MAX(CASE code WHEN 'refundCardPay' THEN ABS(value) ELSE 0 END) refundCardPay + from sys_business_data a + group by a.time, company_id, shop_id + ) a + <where> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + </where> + group by date_format(a.time, #{record.t1}) + order by a.time desc + ) a + </select> + <select id="selectApiBusinessData" resultType="com.matrix.system.app.vo.BusinessesDataShowVo"> + <foreach collection="list" index="index" item="item" separator="union all" > + select + #{item.beginTime} dataTime, + (select shop_short_name from sys_shop_info where id=#{shopId}) shopName, + (select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> and a.pay_method!='欠款' + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + )totalPay, + (select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method not in ('储值卡', '欠款') and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) cashPay, + (select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method = '储值卡' and a.flow_type != '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) cardPay, + (select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method = '欠款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) arrearsPay, + (select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method not in ('储值卡', '欠款') and a.flow_type = '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) refundCashPay, + (select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method in ('储值卡') and a.flow_type = '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) refundCardPay, + (select IFNULL(sum(zk_price*count),0) from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + inner join sys_order c on a.ORDER_ID=c.id and c.statu!='已取消' + where b.good_type='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]> + <if test="shopId != null"> + and c.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and c.company_id=#{companyId} + </if> + ) productAchieve, + (select IFNULL(sum(zk_price*count),0) from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + inner join sys_order c on a.ORDER_ID=c.id and c.statu!='已取消' + where b.good_type!='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]> + <if test="shopId != null"> + and c.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and c.company_id=#{companyId} + </if> + ) cardAchieve, + (select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.flow_type = '还款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) refund, + (select sum(IFNULL(amount, 0)) + from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.STATU!='已取消' + where a.pay_method='储值卡' and a.is_gift='N' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) cardAmount, + (select sum(IFNULL(amount, 0)) + from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.STATU!='已取消' + where a.pay_method='储值卡' and a.is_gift='Y' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) cardFreeAmount, + (select IFNULL(count(1),0) from sys_order + where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) perCustomCnt, + (select IFNULL(sum(b.COUNT),0) from sys_order a inner join sys_order_item b on a.ID=b.ORDER_ID + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) totalSaleCnt, + (select IFNULL(sum(e.count * d.GOODS_PRICE),0) from sys_order a + inner join sys_out_store b on a.id=b.ORDER_ID + inner join sys_out_store_item c on b.id=c.OUT_STORE_ID + inner join sys_store_info d on c.store_id = d.ID + inner join sys_order_item e on a.ID=e.ORDER_ID + inner join shopping_goods f on e.goods_id=f.id and f.good_type='家居产品' + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) goodsCost, + (select IFNULL(sum(b.COUNT * IFNULL(c.price, 0)),0) from sys_order a + inner join sys_order_item b on a.ID=b.ORDER_ID + inner join shopping_goods c on c.good_type != '家居产品' and b.goods_id=c.id + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) otherCost, + (select IFNULL(sum(IFNULL(his_consume, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) consumePay, + (select IFNULL(sum(IFNULL(free_consume, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) freeConsumePay, + (select IFNULL(sum(IFNULL(number_of_people, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) peopleCnt, + (select IFNULL(sum(IFNULL(proj_num, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) projConsumeCnt, + (select IFNULL(sum(IFNULL(proj_time, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) timeLength + from dual + </foreach> + </select> + + <select id="selectDailySaleData" resultType="com.matrix.system.hive.statistics.DailySaleVo"> + <foreach collection="list" index="index" item="item" separator="union all" > + select + #{item.beginTime} dataTime, + (select shop_short_name from sys_shop_info where id=#{shopId}) shopName, + (select sum(total) shouldPay from sys_order + where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) shouldPay, + (select IFNULL(sum(amount),0) from sys_order_flow + where <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> and pay_method!='欠款' + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + )totalPay, + (select IFNULL(sum(amount),0) from sys_order_flow + where pay_method not in ('储值卡', '欠款') and flow_type != '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) cashPay, + (select IFNULL(sum(amount),0) from sys_order_flow + where pay_method = '储值卡' and flow_type != '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) cardPay, + (select IFNULL(sum(amount),0) from sys_order_flow + where pay_method = '欠款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) arrearsPay, + (select IFNULL(sum(amount),0) from sys_order_flow + where pay_method not in ('储值卡', '欠款') and flow_type = '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) refundCashPay, + (select IFNULL(sum(amount),0) from sys_order_flow + where pay_method in ('储值卡') and flow_type = '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) refundCardPay, + (select IFNULL(sum(zk_price*count),0) from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + inner join sys_order c on a.ORDER_ID=c.id + where b.good_type='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]> + <if test="shopId != null"> + and c.shop_id=#{shopId} + </if> + ) productAchieve, + (select IFNULL(sum(zk_price*count),0) from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + inner join sys_order c on a.ORDER_ID=c.id + where b.good_type!='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]> + <if test="shopId != null"> + and c.shop_id=#{shopId} + </if> + ) cardAchieve, + (select IFNULL(sum(amount),0) from sys_order_flow where flow_type = '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) refund, + (select IFNULL(count(1),0) from sys_order + where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) perCustomCnt, + (select IFNULL(sum(b.COUNT),0) from sys_order a inner join sys_order_item b on a.ID=b.ORDER_ID + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + ) totalSaleCnt, + (select IFNULL(sum(e.count * d.GOODS_PRICE),0) from sys_order a + inner join sys_out_store b on a.id=b.ORDER_ID + inner join sys_out_store_item c on b.id=c.OUT_STORE_ID + inner join sys_store_info d on c.store_id = d.ID + inner join sys_order_item e on a.ID=e.ORDER_ID + inner join shopping_goods f on e.goods_id=f.id and f.good_type='家居产品' + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + ) goodsCost, + (select IFNULL(sum(b.COUNT * IFNULL(c.price, 0)),0) from sys_order a + inner join sys_order_item b on a.ID=b.ORDER_ID + inner join shopping_goods c on c.good_type != '家居产品' and b.goods_id=c.id + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + ) otherCost, + (select sum(case a.paymethod when '微信' then amount else 0 end) wechat + from (<include refid="dailySaleFlow"></include>) a + ) wechat, + (select + sum(case a.paymethod when '支付宝' then amount else 0 end) alipay + from (<include refid="dailySaleFlow"></include>) a + ) alipay, + (select + sum(case a.paymethod when '现金支付' then amount else 0 end) cash + from (<include refid="dailySaleFlow"></include>) a + ) cash, + (select + sum(case a.paymethod when '银行卡' then amount else 0 end) bankCard + from (<include refid="dailySaleFlow"></include>) a + ) bankCard, + (select + sum(case a.paymethod when '团购' then amount else 0 end) tuan + from (<include refid="dailySaleFlow"></include>) a + ) tuan, + (select + sum(case a.paymethod when '本金收款' then amount else 0 end) cardBj + from (<include refid="dailySaleFlow"></include>) a + ) cardBj, + (select + sum(case a.paymethod when '赠金收款' then amount else 0 end) cardFree + from (<include refid="dailySaleFlow"></include>) a + ) cardFree, + (select + sum(case a.paymethod when '欠款' then amount else 0 end) arrears + from (<include refid="dailySaleFlow"></include>) a + ) arrears + from dual + </foreach> + </select> + + <sql id="dailySaleFlow"> + select sum(amount) amount, case when is_gift = 'Y' then '赠金收款' when is_gift='N' then '本金收款' else pay_method end paymethod + from sys_order_flow + where <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + group by paymethod + </sql> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml new file mode 100644 index 0000000..82af5be --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml @@ -0,0 +1,228 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysFollowupCommentDao"> + <!-- 定义SysFollowupComment 的复杂关联map --> + <resultMap type="com.matrix.system.hive.bean.SysFollowupComment" id="SysFollowupCommentMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="follId" column="foll_id" /> + <result property="staffId" column="staff_id" /> + <result property="content" column="content" /> + </resultMap> + + + <!-- 定义SysFollowupComment 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.hive.bean.SysFollowupComment" id="SysFollowupCommentSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="follId" column="foll_id" /> + <result property="staffId" column="staff_id" /> + <result property="content" column="content" /> + </resultMap> + + <!-- 字段sql --> + <sql id="columns"> + create_by, + create_time, + update_by, + update_time, + id, + foll_id, + staff_id, + content + </sql> + + <!-- 属性sql --> + <sql id="propertys"> + #{item.createBy}, + now(), + #{item.updateBy}, + now(), + #{item.id}, + #{item.follId}, + #{item.staffId}, + #{item.content} + </sql> + + <!-- where sql --> + <sql id="where_sql"> + + <if test="record!=null"> + <if test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + and id = #{record.id} + </if> + <if test="(record.follId!=null and record.follId!='') or (record.follId!='' and record.follId==0) "> + and foll_id = #{record.follId} + </if> + <if test="(record.staffId!=null and record.staffId!='') or (record.staffId!='' and record.staffId==0) "> + and staff_id = #{record.staffId} + </if> + <if test="(record.content!=null and record.content!='') or (record.content!='' and record.content==0) "> + and content = #{record.content} + </if> + </if> + + </sql> + + <!-- 插入方法 --> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysFollowupComment" + useGeneratedKeys="true" keyProperty="item.id"> + INSERT INTO sys_followup_comment ( + <include refid="columns"></include> + ) + VALUES ( + <include refid="propertys"></include> + ) + </insert> + + + + <!-- 批量插入 --> + <insert id="batchInsert" parameterType="java.util.List"> + INSERT INTO sys_followup_comment ( + <include refid="columns"></include> + ) + VALUES + <foreach collection="list" item="item" index="index" separator=",">( + <include refid="propertys"></include> + )</foreach> + </insert> + + + + + + <!-- 根据Map更新 部分更新 --> + <update id="updateByMap" parameterType="java.util.HashMap" > + UPDATE sys_followup_comment + <set> + <if test="_parameter.containsKey('follId')"> + foll_id = #{follId}, + </if> + <if test="_parameter.containsKey('staffId')"> + staff_id = #{staffId}, + </if> + <if test="_parameter.containsKey('content')"> + content = #{content}, + </if> + </set> + WHERE id=#{id} + </update> + + + <!-- 根据对象更新 部分更新 --> + <update id="updateByModel" parameterType="Integer"> + UPDATE sys_followup_comment + <set> + <if test="record.follId != null "> + foll_id = #{record.follId}, + </if> + <if test="record.staffId != null "> + staff_id = #{record.staffId}, + </if> + <if test="record.content != null and record.content != '' "> + content = #{record.content}, + </if> + </set> + WHERE id=#{record.id} + </update> + + <!-- 批量删除 --> + <delete id="deleteByIds" parameterType="java.util.List"> + delete from sys_followup_comment where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 根据id删除--> + <delete id="deleteById" parameterType="Integer"> + DELETE FROM sys_followup_comment + where id=#{id} + </delete> + + <!-- 根据对象删除--> + <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysFollowupComment"> + DELETE FROM sys_followup_comment + <where> + <include refid="where_sql" ></include> + </where> + </delete> + + + + <!-- 分页查询 --> + <select id="selectInPage" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + <where> + <include refid="where_sql"></include> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <!-- 查询总条数 --> + <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> + select count(*) + from sys_followup_comment + <where> + <include refid="where_sql"></include> + </where> + </select> + + <!-- 根据id查询--> + <select id="selectById" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + where id=#{id} + </select> + + + <!-- 根据id 锁表查询--> + <select id="selectForUpdate" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + where id=#{id} + for update + </select> + + + + <!-- 根据对象查询--> + <select id="selectByModel" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + <where> + <include refid="where_sql"></include> + </where> + </select> + + <select id="selectByfollId" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + where foll_id=#{follId} + </select> +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml new file mode 100644 index 0000000..408922a --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml @@ -0,0 +1,405 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysFollowupDao" > + <!-- 定义SysFollowup 的复杂关联map --> + <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="staffId" column="staff_id" /> + <result property="vipId" column="vip_id" /> + <result property="orderId" column="order_id" /> + <result property="serviceId" column="service_id" /> + <result property="shopId" column="shop_id" /> + <result property="companyId" column="company_id" /> + <result property="nextNotifyTime" column="next_notify_time" /> + <result property="content" column="content" /> + <result property="visible" column="visible" /> + <result property="orderAbstract" column="order_abstract" /> + <result property="zans" column="zans" /> + + <result property="staffPhoto" column="staffPhoto" /> + <result property="staffName" column="staffName" /> + <result property="vipName" column="vipName" /> + + <collection property="albums" column="{sourceId=id}" select="com.matrix.system.hive.dao.SysVipAlbumDao.selectBySourceId" /> + + <collection property="followupComments" column="{follId=id}" select="com.matrix.system.hive.dao.SysFollowupCommentDao.selectByfollId" ></collection> + + <collection property="zanUsers" column="{zans=zans}" select="selectUserByZaqns" ></collection> + + + </resultMap> + + <select id="selectUserByZaqns" resultMap="com.matrix.system.common.dao.SysUsersDao.SysUsersMap" > + select su_id,su_name from sys_users where FIND_IN_SET(su_id,#{zans}) + </select> + + <!-- 定义SysFollowup 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="staffId" column="staff_id" /> + <result property="vipId" column="vip_id" /> + <result property="orderId" column="order_id" /> + <result property="serviceId" column="service_id" /> + <result property="shopId" column="shop_id" /> + <result property="companyId" column="company_id" /> + <result property="nextNotifyTime" column="next_notify_time" /> + <result property="content" column="content" /> + <result property="visible" column="visible" /> + <result property="orderAbstract" column="order_abstract" /> + <result property="zans" column="zans" /> + </resultMap> + + <!-- 字段sql --> + <sql id="columns"> + create_by, + create_time, + update_by, + update_time, + id, + staff_id, + vip_id, + order_id, + service_id, + shop_id, + company_id, + next_notify_time, + content, + visible, + order_abstract, + zans + </sql> + + <!-- 属性sql --> + <sql id="propertys"> + #{item.createBy}, + now(), + #{item.updateBy}, + now(), + #{item.id}, + #{item.staffId}, + #{item.vipId}, + #{item.orderId}, + #{item.serviceId}, + #{item.shopId}, + #{item.companyId}, + #{item.nextNotifyTime}, + #{item.content}, + #{item.visible}, + #{item.orderAbstract}, + #{item.zans} + </sql> + + <!-- where sql --> + <sql id="where_sql"> + + <if test="record!=null"> + <if test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + and id = #{record.id} + </if> + <if test="(record.staffId!=null and record.staffId!='') or (record.staffId!='' and record.staffId==0) "> + and staff_id = #{record.staffId} + </if> + <if test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> + and vip_id = #{record.vipId} + </if> + <if test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> + and order_id = #{record.orderId} + </if> + <if test="(record.serviceId!=null and record.serviceId!='') or (record.serviceId!='' and record.serviceId==0) "> + and service_id = #{record.serviceId} + </if> + <if test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + and shop_id = #{record.shopId} + </if> + <if test="(record.companyId!=null and record.companyId!='') or (record.companyId!='' and record.companyId==0) "> + and company_id = #{record.companyId} + </if> + <if test="(record.nextNotifyTime!=null and record.nextNotifyTime!='') or (record.nextNotifyTime!='' and record.nextNotifyTime==0) "> + and next_notify_time = #{record.nextNotifyTime} + </if> + <if test="(record.content!=null and record.content!='') or (record.content!='' and record.content==0) "> + and content = #{record.content} + </if> + <if test="(record.visible!=null and record.visible!='') or (record.visible!='' and record.visible==0) "> + and visible = #{record.visible} + </if> + <if test="(record.orderAbstract!=null and record.orderAbstract!='') or (record.orderAbstract!='' and record.orderAbstract==0) "> + and order_abstract = #{record.orderAbstract} + </if> + <if test="(record.zans!=null and record.zans!='') or (record.zans!='' and record.zans==0) "> + and zans = #{record.zans} + </if> + </if> + + </sql> + + <!-- 插入方法 --> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysFollowup" + useGeneratedKeys="true" keyProperty="item.id"> + INSERT INTO sys_followup ( + <include refid="columns"></include> + ) + VALUES ( + <include refid="propertys"></include> + ) + </insert> + + + + <!-- 批量插入 --> + <insert id="batchInsert" parameterType="java.util.List"> + INSERT INTO sys_followup ( + <include refid="columns"></include> + ) + VALUES + <foreach collection="list" item="item" index="index" separator=",">( + <include refid="propertys"></include> + )</foreach> + </insert> + + + + + + <!-- 根据Map更新 部分更新 --> + <update id="updateByMap" parameterType="java.util.HashMap" > + UPDATE sys_followup + <set> + <if test="_parameter.containsKey('staffId')"> + staff_id = #{staffId}, + </if> + <if test="_parameter.containsKey('vipId')"> + vip_id = #{vipId}, + </if> + <if test="_parameter.containsKey('orderId')"> + order_id = #{orderId}, + </if> + <if test="_parameter.containsKey('serviceId')"> + service_id = #{serviceId}, + </if> + <if test="_parameter.containsKey('shopId')"> + shop_id = #{shopId}, + </if> + <if test="_parameter.containsKey('companyId')"> + company_id = #{companyId}, + </if> + <if test="_parameter.containsKey('nextNotifyTime')"> + next_notify_time = #{nextNotifyTime}, + </if> + <if test="_parameter.containsKey('content')"> + content = #{content}, + </if> + <if test="_parameter.containsKey('visible')"> + visible = #{visible}, + </if> + <if test="_parameter.containsKey('orderAbstract')"> + order_abstract = #{orderAbstract}, + </if> + <if test="_parameter.containsKey('zans')"> + zans = #{zans}, + </if> + </set> + WHERE id=#{id} + </update> + + + <!-- 根据对象更新 部分更新 --> + <update id="updateByModel" parameterType="Integer"> + UPDATE sys_followup + <set> + <if test="record.staffId != null "> + staff_id = #{record.staffId}, + </if> + <if test="record.vipId != null "> + vip_id = #{record.vipId}, + </if> + <if test="record.orderId != null "> + order_id = #{record.orderId}, + </if> + <if test="record.serviceId != null "> + service_id = #{record.serviceId}, + </if> + <if test="record.shopId != null "> + shop_id = #{record.shopId}, + </if> + <if test="record.companyId != null "> + company_id = #{record.companyId}, + </if> + <if test="record.nextNotifyTime != null "> + next_notify_time = #{record.nextNotifyTime}, + </if> + <if test="record.content != null and record.content != '' "> + content = #{record.content}, + </if> + <if test="record.visible != null "> + visible = #{record.visible}, + </if> + <if test="record.orderAbstract != null and record.orderAbstract != '' "> + order_abstract = #{record.orderAbstract}, + </if> + <if test="record.zans != null and record.zans != '' "> + zans = #{record.zans}, + </if> + </set> + WHERE id=#{record.id} + </update> + + <!-- 更新点赞人数 --> + <update id="updateZan"> + update sys_followup set zans=#{zans} where id=#{id} + </update> + + <!-- 批量删除 --> + <delete id="deleteByIds" parameterType="java.util.List"> + delete from sys_followup where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 根据id删除--> + <delete id="deleteById" parameterType="Integer"> + DELETE FROM sys_followup + where id=#{id} + </delete> + + <!-- 根据对象删除--> + <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysFollowup"> + DELETE FROM sys_followup + <where> + <include refid="where_sql" ></include> + </where> + </delete> + + + + <!-- 分页查询 --> + <select id="selectInPage" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + <where> + <include refid="where_sql"></include> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <!-- 查询总条数 --> + <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> + select count(*) + from sys_followup + <where> + <include refid="where_sql"></include> + </where> + </select> + + <!-- 根据id查询--> + <select id="selectById" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + where id=#{id} + </select> + + + <!-- 根据id 锁表查询--> + <select id="selectForUpdate" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + where id=#{id} + for update + </select> + + + + <!-- 根据对象查询--> + <select id="selectByModel" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + <where> + <include refid="where_sql"></include> + </where> + </select> + + + <select id="selectByAppDto" resultMap="SysFollowupMap"> + select a.*, + b.su_photo as staffPhoto, + b.su_name as staffName, + c.vip_name as vipName + from sys_followup a + left join sys_users b on a.staff_id= b.su_id + left join sys_vip_info c on a.vip_id=c.id + <where> + and a.company_id=#{companyId} + + <if test="shopId != null "> + and a.shop_id=#{shopId} + </if> + <if test="queryType == 1 "> + and (visible=1 or ( visible!=1 and a.staff_id=#{selfStaff})) + </if> + <if test="queryType == 2 "> + and a.staff_id=#{selfStaff} + </if> + <if test="queryType == 3 "> + and( visible=1 and a.staff_id!=#{selfStaff}) + </if> + + <if test="startTime != null "> + and a.create_time <![CDATA[ >= ]]> #{startTime} + </if> + <if test="endTime != null "> + and a.create_time <![CDATA[ <= ]]> #{endTime} + </if> + + <if test="vipIds!=null and vipIds.size()!=0"> + and a.vip_id in + <foreach collection="vipIds" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </if> + + <if test="staffIds!=null and staffIds.size()!=0"> + and a.staff_id in + <foreach collection="staffIds" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </if> + + + </where> + + + order by a.create_time desc + + + limit ${offset},${limit} + </select> + + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml index 7569362..955e108 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml @@ -18,10 +18,12 @@ <result property="statu" column="STATU"/> <result property="zkTotal" column="ZK_TOTAL"/> <result property="shopId" column="SHOP_ID"/> + <result property="companyId" column="company_id"/> <result property="vipName" column="VIP_NAME"/> <result property="vipNo" column="VIP_NO"/> <result property="staffName" column="STAFF_NAME"/> <result property="changeId" column="CHANGE_ID"/> + <result property="orderType" column="orderType"/> <result property="cashPay" column="cash_Pay"/> <result property="cardPay" column="card_Pay"/> @@ -30,6 +32,7 @@ <!-- 扩展字段 --> <result property="shopName" column="SHOP_NAME"/> + <result property="shopShortName" column="SHOP_SHORT_NAME"/> <result property="vipPhone" column="PHONE"/> @@ -59,7 +62,9 @@ beatuyId, beatuyName, pay_time, - company_id + company_id, + orderType, + is_has_refund ) VALUES ( #{id}, @@ -81,14 +86,16 @@ #{beatuyId}, #{beatuyName}, #{payTime}, - #{companyId} + #{companyId}, + #{orderType}, + #{isHasRefund} ) </insert> <!-- 更新订单时间 --> <update id="updateOrderTime"> UPDATE sys_order - set ORDER_TIME = #{orderTime} + set pay_time = #{payTime} WHERE id=#{id} </update> @@ -138,9 +145,11 @@ <if test="cashPay != null and cashPay !='' "> cash_Pay = #{cashPay}, </if> - <if test="payTime != null "> pay_time = #{payTime}, + </if> + <if test="isHasRefund != null "> + is_has_refund = #{isHasRefund}, </if> </set> @@ -227,11 +236,14 @@ <if test="(record.companyId!=null and record.companyId!='') "> and a.company_id = #{record.companyId} </if> + <if test="(record.orderType!=null and record.orderType!='') "> + and a.orderType = #{record.orderType} + </if> <if test="record.beginTimeVo != null "> - and a.ORDER_TIME >= #{record.beginTimeVo} + and a.pay_time >= #{record.beginTimeVo} </if> <if test="record.endTimeVo != null "> - <![CDATA[and a.ORDER_TIME <= #{record.endTimeVo}]]> + <![CDATA[and a.pay_time <= #{record.endTimeVo}]]> </if> </if> @@ -281,6 +293,9 @@ <if test="(record.companyId!=null and record.companyId!='') "> and a.company_id = #{record.companyId} </if> + <if test="(record.orderType!=null and record.orderType!='') "> + and a.orderType = #{record.orderType} + </if> <if test="record.isCross != null and record.isCross !='' "> and a.IS_CROSS = #{record.isCross} </if> @@ -306,10 +321,10 @@ and a.SHOP_ID = #{record.shopId} </if> <if test="record.beginTimeVo != null "> - and a.ORDER_TIME >= #{record.beginTimeVo} + and a.pay_time >= #{record.beginTimeVo} </if> <if test="record.endTimeVo != null "> - <![CDATA[and a.ORDER_TIME <= #{record.endTimeVo}]]> + <![CDATA[and a.pay_time <= #{record.endTimeVo}]]> </if> </if> </select> @@ -321,6 +336,7 @@ a.*, c.su_name as STAFF_NAME, d.SHOP_NAME, + d.shop_short_name, b.PHONE, b.VIP_NAME from sys_order a @@ -402,6 +418,9 @@ <if test="(record.companyId!=null and record.companyId!='') "> and a.company_id = #{record.companyId} </if> + <if test="(record.orderType!=null and record.orderType!='') "> + and a.orderType = #{record.orderType} + </if> </if> </sql> @@ -430,6 +449,9 @@ </if> <if test="(record.companyId!=null and record.companyId!='') "> and a.company_id = #{record.companyId} + </if> + <if test="(record.orderType!=null and record.orderType!='') "> + and a.orderType = #{record.orderType} </if> <if test="record.activity != null and record.activity !='' "> and a.ACTIVITY = #{record.activity} @@ -465,4 +487,211 @@ </sql> + <select id="selectVipOrderInfoTotal" resultType="com.matrix.system.hive.bean.SysOrder"> + select + sum(amount) zkTotal, + count(1) times, + MAX(pay_time) payTime, + GROUP_CONCAT(DISTINCT t2.shop_short_name) shopName + from sys_order t1 + left join sys_order_flow b on t1.id=b.ORDER_ID and pay_method!='储值卡' and pay_method!='欠款' + left join sys_shop_info t2 on t1.SHOP_ID=t2.ID + where t1.VIP_ID=#{vipId} and STATU='已付款'; + </select> + + <select id="selectApiOrderListInPage" resultType="com.matrix.system.app.vo.OrderDetailVo"> + select + a.id orderId, + a.VIP_ID vipId, + a.ORDER_NO orderNo, + a.ORDER_TIME orderTime, + a.STATU orderStatus, + a.ZK_TOTAL needPay, + (a.card_Pay + a.cash_Pay) realPay, + a.arrears arrears, + b.su_name staffName, + c.VIP_NAME vipName, + c.PHONE phone + from sys_order a + left join sys_users b on a.STAFF_ID = b.su_id + left join sys_vip_info c on c.id = a.VIP_ID + <where> + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(c.vip_name, #{record.queryKey}) or instr(c.phone, #{record.queryKey}) or instr(a.order_no, #{record.queryKey})) + </if> + <if test="record.status != null and record.status != ''"> + and a.statu = #{record.status} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + order by a.order_time desc + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <select id="selectApiOrderListTotal" resultType="java.lang.Integer"> + select + count(1) + from sys_order a + left join sys_users b on a.STAFF_ID = b.su_id + left join sys_vip_info c on c.id = a.VIP_ID + <where> + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(c.vip_name, #{record.queryKey}) or instr(c.phone, #{record.queryKey}) or instr(a.order_no, #{record.queryKey})) + </if> + <if test="record.status != null and record.status != ''"> + and a.statu = #{record.status} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + </where> + </select> + + <select id="selectApiOrderDetailById" resultType="com.matrix.system.app.vo.OrderDetailVo"> + select + a.id orderId, + b.VIP_NAME vipName, + b.PHONE phone, + a.ORDER_NO orderNo, + c.su_name staffName, + a.cash_Pay cashPay, + a.card_Pay cardPay, + a.ZK_TOTAL needPay, + a.cash_Pay + a.card_Pay realPay, + a.arrears arrears, + a.TOTAL - a.ZK_TOTAL discount, + a.STATU orderStatus, + a.order_time orderTime + from sys_order a + inner join sys_vip_info b on a.VIP_ID=b.ID + left join sys_users c on a.STAFF_ID=c.su_id + where a.id=#{orderId} + </select> + + <select id="selectShopAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> + select + b.shop_short_name name, + b.SHOP_IMAG photo, + sum(IFNULL(a.ZK_TOTAL,0)) amount + from sys_order a + left join sys_shop_info b on a.SHOP_ID=b.ID + <where> + a.statu in ('已付款', '欠款') + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test='record.type == "1" and record.orderTime != null'> + and date_format(order_time, '%Y-%m-%d') = date_format(#{record.orderTime}, '%Y-%m-%d') + </if> + <if test='record.type == "2" and record.orderTime != null'> + and date_format(order_time, '%Y-%m') = date_format(#{record.orderTime}, '%Y-%m') + </if> + <if test='record.type == "3" and record.orderTime != null'> + and date_format(order_time, '%Y') = date_format(#{record.orderTime}, '%Y') + </if> + </where> + group by a.SHOP_ID + order by amount desc, a.shop_id + </select> + + <select id="selectStaffSaleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> + select + b.su_name name, + b.su_id id, + b.su_photo photo, + sum(ZK_TOTAL) amount, + c.shop_short_name shopName + from sys_order a + left join sys_users b on a.STAFF_ID=b.su_id + left join sys_shop_info c on a.SHOP_ID=c.ID + <where> + a.statu in ('已付款', '欠款') and b.su_id is not null + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test='record.type == "1" and record.orderTime != null'> + and date_format(order_time, '%Y-%m-%d') = date_format(#{record.orderTime}, '%Y-%m-%d') + </if> + <if test='record.type == "2" and record.orderTime != null'> + and date_format(order_time, '%Y-%m') = date_format(#{record.orderTime}, '%Y-%m') + </if> + <if test='record.type == "3" and record.orderTime != null'> + and date_format(order_time, '%Y') = date_format(#{record.orderTime}, '%Y') + </if> + </where> + group by b.su_id + order by amount desc, b.su_id + </select> + + + <select id="selectErpOrderList" resultType="com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo"> + select + a.id orderId, + a.ORDER_NO orderNo, + a.ORDER_TIME orderTime, + a.STATU orderStatus, + a.ZK_TOTAL needPay, + a.TOTAL - a.ZK_TOTAL discount, + (a.card_Pay + a.cash_Pay) realPay, + a.arrears arrears, + b.su_name staffName, + d.shop_name as shopName + from sys_order a + left join sys_users b on a.STAFF_ID = b.su_id + left join sys_vip_info c on c.id = a.VIP_ID + left join sys_shop_info d on d.id=a.shop_id + <where> + <if test="queryKey != null and queryKey != ''"> + and instr(a.order_no, #{queryKey}) + </if> + <if test="status != null and status != ''"> + and a.statu = #{status} + </if> + <if test="vipId != null"> + and a.vip_id=#{vipId} + </if> + </where> + order by a.order_time desc + limit #{offset},#{limit} + </select> + <select id="findUserOrderById" resultType="com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo"> + select + a.id orderId, + a.ORDER_NO orderNo, + a.ORDER_TIME orderTime, + a.STATU orderStatus, + a.ZK_TOTAL needPay, + a.TOTAL - a.ZK_TOTAL discount, + (a.card_Pay + a.cash_Pay) realPay, + a.arrears arrears, + b.su_name staffName, + d.shop_name as shopName + from sys_order a + left join sys_users b on a.STAFF_ID = b.su_id + left join sys_vip_info c on c.id = a.VIP_ID + left join sys_shop_info d on d.id=a.shop_id + where a.id=#{orderId} + </select> + + + <select id="selectArrearsByVipId" resultType="java.math.BigDecimal"> + select sum(arrears) from sys_order + where vip_id=#{vipId} and statu='欠款' + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderFlowDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderFlowDao.xml new file mode 100644 index 0000000..55817bf --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderFlowDao.xml @@ -0,0 +1,195 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.matrix.system.hive.dao.SysOrderFlowDao"> + + <resultMap id="SysOrderFlowMap" type="SysOrderFlow"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="flowNo" column="flow_no" /> + <result property="orderId" column="order_id" /> + <result property="flowContent" column="flow_content" /> + <result property="flowType" column="flow_type" /> + <result property="amount" column="amount" /> + <result property="vipId" column="vip_id" /> + <result property="payMethod" column="pay_method" /> + <result property="cardId" column="card_id" /> + <result property="cardName" column="card_name" /> + <result property="isGift" column="is_gift" /> + + <result property="orderNo" column="order_no" /> + </resultMap> + + <insert id="insert" parameterType="SysOrderFlow" useGeneratedKeys="true" + keyProperty="id"> + INSERT INTO sys_order_flow ( + ID, + create_by, + create_time, + update_by, + update_time, + flow_no, + order_id, + flow_content, + flow_type, + amount, + vip_id, + pay_method, + card_id, + is_gift, + shop_id, + company_id + ) + VALUES ( + #{id}, + #{createBy}, + now(), + #{updateBy}, + now(), + #{flowNo}, + #{orderId}, + #{flowContent}, + #{flowType}, + #{amount}, + #{vipId}, + #{payMethod}, + #{cardId}, + #{isGift}, + #{shopId}, + #{companyId} + ) + </insert> + <update id="updateTimeByOrderId"> + UPDATE sys_order_flow set + create_time=#{payTime} + where order_id=#{orderId} + </update> + <delete id="deleteByOrderId"> + delete from sys_order_flow where order_id=#{orderId} + </delete> + + <select id="selectByOrderId" resultMap="SysOrderFlowMap"> + select a.*, b.order_no,c.card_name from sys_order_flow a + left join sys_order b on a.order_id=b.id + left join money_card_use c on a.card_id=c.id + where order_id=#{orderId} + </select> + + <select id="selectPayMethodsAmountByOrderId" resultMap="SysOrderFlowMap"> + select + pay_method, + sum(amount) amount + from sys_order_flow + where order_id=#{orderId} + group by pay_method + </select> + + <select id="selectInPage" resultType="com.matrix.system.hive.vo.OrderFlowVo"> + SELECT + a.id, + b.id as orderId, + a.create_time as createTime, + b.ORDER_NO as orderNo, + a.flow_content as flowContent, + a.flow_type as flowType, + a.amount as amount, + c.VIP_NAME as vipName, + a.pay_method as payMethod, + a.flow_no as flowNo, + d.shop_short_name as shopName, + f.card_name as cardName, + e.su_name as staffName + from sys_order_flow a + LEFT JOIN sys_order b on a.order_id=b.ID + LEFT JOIN sys_vip_info c on a.vip_id=c.ID + LEFT JOIN sys_shop_info d on a.shop_id=d.ID + LEFT JOIN sys_users e on e.su_id=b.STAFF_ID + left join money_card_use f on a.card_id=f.id + + <where> + + and a.company_id=#{record.companyId} + + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(c.vip_name, #{record.queryKey}) or instr(c.phone, #{record.queryKey}) ) + </if> + <if test="record.oprationMan != null and record.oprationMan != ''"> + and instr(e.su_name, #{record.oprationMan}) + </if> + <if test="record.orderNo != null and record.orderNo != ''"> + and instr(b.ORDER_NO, #{record.orderNo}) + </if> + <if test="record.payMethod != null and record.payMethod != ''"> + and a.pay_method=#{record.payMethod} + </if> + + <if test="record.flowType != null and record.flowType != ''"> + and a.flow_type=#{record.flowType} + </if> + + <if test="record.startTime != null "> + and a.create_time >= #{record.startTime} + </if> + <if test="record.endTime != null "> + <![CDATA[and a.create_time <= #{record.endTime}]]> + </if> + <if test="record.shopId != null and record.shopId != ''"> + and a.shop_id=#{record.shopId} + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + <if test="record.offset >=0 and record.limit >0"> + limit + #{record.offset},#{record.limit} + </if> + + + </select> + + <select id="selectTotal" resultType="java.lang.Integer"> + SELECT count(*) + from sys_order_flow a + LEFT JOIN sys_order b on a.order_id=b.ID + LEFT JOIN sys_vip_info c on a.vip_id=c.ID + LEFT JOIN sys_shop_info d on a.shop_id=d.ID + LEFT JOIN sys_users e on e.su_id=b.STAFF_ID + <where> + + and a.company_id=#{record.companyId} + + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(c.vip_name, #{record.queryKey}) or instr(c.phone, #{record.queryKey}) ) + </if> + <if test="record.oprationMan != null and record.oprationMan != ''"> + and instr(e.su_name, #{record.oprationMan}) + </if> + <if test="record.orderNo != null and record.orderNo != ''"> + and instr(b.ORDER_NO, #{record.orderNo}) + </if> + <if test="record.payMethod != null and record.payMethod != ''"> + and a.pay_method=#{record.payMethod} + </if> + + <if test="record.flowType != null and record.flowType != ''"> + and a.flow_type=#{record.flowType} + </if> + + <if test="record.startTime != null "> + and a.create_time >= #{record.startTime} + </if> + <if test="record.endTime != null "> + <![CDATA[and a.create_time <= #{record.endTime}]]> + </if> + <if test="record.shopId != null and record.shopId != ''"> + and a.shop_id=#{record.shopId} + </if> + + </where> + </select> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml index 208e3ec..2e2de04 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml @@ -10,6 +10,7 @@ <!-- <result property="projId" column="PROJ_ID" /> <result property="skuId" column="SKU_ID" /> --> <result property="count" column="COUNT"/> + <result property="refundCount" column="refundCount"/> <!-- <result property="taocanId" column="TAOCAN_ID" /> --> <result property="isFree" column="IS_FREE"/> <result property="type" column="TYPE"/> @@ -33,6 +34,7 @@ resultMap="com.matrix.system.hive.dao.ShoppingGoodsDao.ShoppingGoodsSimpleMap"></association> + </resultMap> <!-- 查询会员待处理的订单商品 --> @@ -48,6 +50,7 @@ a.TOTAL, a.SKU_ID, b.COUNT, + b.refundCount, b.ID, b.IS_FREE, b.ORDER_ID, @@ -88,6 +91,7 @@ ID, ORDER_ID, COUNT, + refundCount, TYPE, IS_FREE, PRICE, @@ -105,6 +109,7 @@ #{id}, #{orderId}, #{count}, + #{refundCount}, #{type}, #{isFree}, #{price}, @@ -128,8 +133,11 @@ <if test="orderId != null and orderId !='' "> ORDER_ID = #{orderId}, </if> - <if test="count != null and count !='' "> + <if test="count != null and count !='' or count == 0 "> COUNT = #{count}, + </if> + <if test="refundCount != null and refundCount !='' or refundCount == 0 "> + refundCount = #{refundCount}, </if> <if test="isFree != null and isFree !='' "> IS_FREE = #{isFree}, @@ -231,6 +239,7 @@ i.ID, i.ORDER_ID, i.COUNT, + i.refundCount, i.TYPE, i.IS_FREE, i.PRICE, @@ -250,11 +259,11 @@ g.is_course, g.car_use_count, g.good_type, - g.code - - + g.code, + g.goods_no, + g.name from sys_order_item i - left join shopping_goods g on i.goods_id=g.id + left join shopping_goods g on i.goods_id=g.id where ORDER_ID =#{orderId} </select> @@ -266,10 +275,13 @@ </select> <!-- 根据商品id查询改商品下单次数总和--> <select id="selectByGoodsId" resultType="java.lang.Integer"> - select sum(COUNT) from sys_order_item a + select IFNULL(sum(COUNT),0) AS total from sys_order_item a left join sys_order b on b.ID=a.ORDER_ID - where a.GOODS_ID = #{goodsId} - and b.STATU !='已取消' + where a.GOODS_ID = #{goodsId} + <if test="vipId != null"> + and b.vip_id=#{vipId} + </if> + and b.STATU ='已付款' </select> @@ -288,6 +300,7 @@ ID, ORDER_ID, COUNT, + refundCount, TYPE, IS_FREE, PRICE, @@ -340,10 +353,12 @@ c.name as goodsName, g.name as cateName, a.COUNT, + a.COUNT * a.ZK_PRICE as total, + a.refundCount, a.ZK_PRICE, a.IS_FREE, a.pay_method, - a.status + b.statu from sys_order_item a left join sys_order b on a.ORDER_ID=b.ID left join shopping_goods c on a.goods_id=c.id @@ -383,8 +398,8 @@ <if test="guwenId != null and guwenId != '' "> and b.STAFF_ID=#{guwenId} </if> - <if test="status != null and status != '' "> - and a.status=#{status} + <if test="statu != null and statu != '' "> + and b.statu=#{statu} </if> </where> @@ -435,8 +450,8 @@ <if test="guwenId != null and guwenId != '' "> and b.STAFF_ID=#{guwenId} </if> - <if test="status != null and status != '' "> - and a.status=#{status} + <if test="statu != null and statu != '' "> + and b.statu=#{statu} </if> </where> </select> @@ -519,5 +534,38 @@ group by c.id ,f.id) t </select> + <select id="selectApiOrderDetailItemsByOrderId" resultType="com.matrix.system.app.vo.OrderDetailItemVo"> + select + a.id id, + b.name goodsName, + a.COUNT count, + a.cash_Pay cashPay, + a.card_Pay cardPay, + a.PRICE price, + a.ZK_PRICE zkPrice, + a.status status + from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + where a.ORDER_ID=#{orderId}; + </select> + + <select id="selectErpOrderItemByOrderId" + resultType="com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo"> + select + b.name goodsName, + a.COUNT count, + a.PRICE price, + a.ZK_PRICE zkPrice + from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + where a.ORDER_ID=#{orderId} + </select> + + <!-- 临时数据处理sql --> + <select id="selectDgd" resultMap="SysOrderItemMap"> + SELECT a.* from sys_order_item a + left join sys_order b on a.ORDER_ID=b.id + where a.type='家居产品' and DATE_FORMAT(a.create_time,'%Y-%m')='2021-04' and b.company_id=17 and b.STATU='已付款'; + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml index e608194..558112d 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml @@ -38,6 +38,10 @@ <result property="oldShopId" column="OLD_SHOP_ID"/> <result property="consumeTime" column="consume_time"/> <result property="companyId" column="company_id"/> + <result property="comment" column="comment"/> + <result property="reply" column="reply"/> + <result property="overtimeNotice" column="overtime_notice"/> + <result property="beautiName" column="beautiName"/> @@ -45,6 +49,7 @@ <result property="shopName" column="shopName"/> <result property="createStaffName" column="createStaffName"/> <result property="bedName" column="bedName"/> + <result property="vipName" column="VIP_Name"/> <association property="vipInfo" resultMap="com.matrix.system.hive.dao.SysVipInfoDao.SysVipInfoMapSimple" ></association> @@ -87,7 +92,10 @@ CHANGE_ID, OLD_SHOP_ID, consume_time, - company_id + company_id, + comment, + reply, + overtime_notice ) VALUES ( #{id}, @@ -122,15 +130,34 @@ #{changeId}, #{oldShopId}, #{consumeTime}, - #{companyId} + #{companyId}, + #{comment}, + #{reply}, + #{overtimeNotice} ) </insert> <!-- 根据id更新 部分更新 --> <update id="updateOrderTime"> - UPDATE sys_proj_services set CREATE_TIME=#{createTime} WHERE id=#{id} + UPDATE sys_proj_services set + consume_time=#{serviceOrderTimeDto.consumeTime}, + yy_time=#{serviceOrderTimeDto.yyTime}, + create_time=#{serviceOrderTimeDto.createTime} + WHERE id=#{serviceOrderTimeDto.id} </update> + + <!-- 设置服务单为已通知 --> + <update id="updateNoticeTimes" > + UPDATE sys_proj_services set overtime_notice=1 + where ID in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </update> + + <update id="update"> UPDATE sys_proj_services @@ -223,14 +250,25 @@ CHANGE_ID = #{changeId}, </if> <if test="oldShopId != null and oldShopId !='' "> - OLD_SHOP_ID = #{oldShopId} + OLD_SHOP_ID = #{oldShopId}, </if> <if test="consumeTime != null "> - consume_time = #{consumeTime} + consume_time = #{consumeTime}, + </if> + + <if test="reply != null "> + reply = #{reply}, + </if> + <if test="comment != null "> + comment = #{comment}, + </if> + <if test="overtimeNotice != null "> + overtime_notice = #{overtimeNotice}, </if> </set> WHERE id=#{id} </update> + <!-- 批量删除 --> <delete id="deleteByIds" parameterType="java.util.List"> @@ -294,9 +332,7 @@ <if test="record.vipId != null and record.vipId !='' "> and a.VIP_ID = #{record.vipId} </if> - <if test="record.isOverTime != null and record.serviceNo !='' "> - and a.IS_OVERTIME > #{record.isOverTime} - </if> + <if test="record.serviceNo != null and record.serviceNo !='' "> and a.SERVICE_NO like CONCAT('%',#{record.serviceNo},'%') </if> @@ -394,7 +430,21 @@ left join sys_beautician_state c on a.id=c.SERVICES_ID where a.ID=#{id} </select> - + + <select id="selectNeedNoticeService" resultMap="SysProjServicesMap"> + select + a.id, + a.company_id, + b.VIP_Name + FROM sys_proj_services a + LEFT JOIN sys_vip_info b on b.ID=a.VIP_ID + where a.YY_TIME > now() + and DATE_ADD(now(),INTERVAL 1 HOUR) > a.YY_TIME + and overtime_notice is null + </select> + + + <!-- 根据对象查询--> <select id="selectByModel" resultMap="SysProjServicesMap"> select distinct @@ -458,4 +508,204 @@ </if> </select> + <resultMap id="ServiceOrderListVoMap" type="com.matrix.system.app.vo.ServiceOrderListVo"> + <id column="id" property="id" /> + <result column="serviceNo" property="serviceNo"/> + <result property="time" column="time"/> + <result property="bed" column="bed" /> + <result property="vipName" column="vipName" /> + <result property="vipId" column="vipId" /> + <result property="timeLength" column="timeLength" /> + <result property="status" column="status" /> + <result property="createStaffId" column="createStaffId" /> + <result property="shopName" column="shop_short_name" /> + <collection property="projs" ofType="com.matrix.system.app.vo.ServiceOrderListProjVo"> + <result property="projName" column="projName" /> + <result property="beautyName" column="beautyName" /> + <result property="id" column="staffId" /> + </collection> + </resultMap> + + + <select id="selectApiServiceOrderListInPage" resultMap="ServiceOrderListVoMap"> + select + a.id id, + a.SERVICE_NO serviceNo, + a.YY_TIME time, + a.TOTAL_TIME timeLength, + a.state status, + a.create_staff_id createStaffId, + d.BED_NAME bed, + e.VIP_NAME vipName, + e.id vipId, + b.staff_id staffId, + f.su_name beautyName, + g.proj_name projName, + h.shop_short_name + from sys_proj_services a + left join sys_beautician_state b on a.ID=b.SERVICES_ID + left join sys_bed_state c on a.ID = c.SERVICE_ID + left join sys_bed_info d on c.BED_ID=d.ID + left join sys_vip_info e on a.VIP_ID=e.ID + left join sys_users f on f.su_id=b.STAFF_ID + left join sys_proj_use g on b.puse_id=g.ID + left join sys_shop_info h on a.SHOP_ID=h.ID + <where> + and a.company_id=#{record.companyId} + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(a.SERVICE_NO, #{record.queryKey}) or instr(e.phone, #{record.queryKey}) or instr(e.vip_name, #{record.queryKey}) ) + </if> + <if test="record.vipId != null and record.vipId != ''"> + and a.vip_id = #{record.vipId} + </if> + <if test="record.status != null and record.status != ''"> + and a.state = #{record.status} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.userId!=null"> + and (a.create_staff_id=#{record.userId} or b.staff_id=#{record.userId}) + </if> + + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + order by a.yy_time desc + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <select id="selectApiServiceOrderListTotal" resultType="java.lang.Integer"> + select count(1) + from sys_proj_services a + left join sys_beautician_state b on a.ID=b.SERVICES_ID + left join sys_bed_state c on a.ID = c.SERVICE_ID + left join sys_bed_info d on c.BED_ID=d.ID + left join sys_vip_info e on a.VIP_ID=e.ID + left join sys_users f on f.su_id=b.STAFF_ID + left join sys_proj_use g on b.puse_id=g.ID + <where> + and a.company_id=#{record.companyId} + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(a.SERVICE_NO, #{record.queryKey}) or instr(e.phone, #{record.queryKey}) or instr(e.vip_name, #{record.queryKey}) ) + </if> + <if test="record.status != null and record.status != ''"> + and a.state = #{record.status} + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.userId!=null"> + and (a.create_staff_id=#{record.userId} or b.staff_id=#{record.userId}) + </if> + </where> + </select> + + + + + <resultMap id="ErpServiceOrderListVoMap" type="com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo"> + <id column="id" property="id" /> + <result column="serviceNo" property="serviceNo"/> + <result property="time" column="time"/> + <result property="bed" column="bed" /> + <result property="timeLength" column="timeLength" /> + <result property="status" column="status" /> + <result property="shopName" column="shopName" /> + <result property="shopAddr" column="shopAddr" /> + <result property="comment" column="comment" /> + <result property="reply" column="reply" /> + <collection property="projs" ofType="com.matrix.system.shopXcx.api.vo.ErpServiceOrderListProjVo"> + <result property="projName" column="projName" /> + <result property="beautyName" column="beautyName" /> + <result property="imgMobile" column="imgMobile" /> + </collection> + </resultMap> + <select id="findWxServiceOrderList" resultMap="ErpServiceOrderListVoMap"> + select + a.id id, + a.SERVICE_NO serviceNo, + a.YY_TIME time, + a.TOTAL_TIME timeLength, + a.state status, + d.BED_NAME bed, + f.su_name beautyName, + g.proj_name projName, + h.shop_short_name as shopName, + h.shop_addr as shopAddr, + m.img as imgMobile + from sys_proj_services a + left join sys_beautician_state b on a.ID=b.SERVICES_ID + left join sys_bed_state c on a.ID = c.SERVICE_ID + left join sys_bed_info d on c.BED_ID=d.ID + left join sys_vip_info e on a.VIP_ID=e.ID + left join sys_users f on f.su_id=b.STAFF_ID + left join sys_proj_use g on b.puse_id=g.ID + left join sys_shop_info h on a.SHOP_ID=h.ID + left join shopping_goods m on g.proj_id=m.id + <where> + <if test="queryKey != null and queryKey != ''"> + and instr(a.SERVICE_NO, #{queryKey}) + </if> + <if test="vipId != null and vipId != ''"> + and a.vip_id = #{vipId} + </if> + <if test="vipStatus != null and vipStatus != '' and vipStatus!=0 "> + <if test="vipStatus == 1"> + and a.state = '待确认' + </if> + <if test="vipStatus == 2"> + and a.state in ( '预约成功待处理' ,'需配料','配料完成','服务中') + </if> + <if test="vipStatus == 3"> + and ( a.state in ( '服务完成' ,'服务单结束') and a.comment is null) + </if> + <if test="vipStatus == 4"> + and a.comment is not null + </if> + <if test="vipStatus == 5"> + and a.state = '预约取消' + </if> + </if> + </where> + order by a.yy_time desc + limit #{offset}, #{limit} + </select> + <select id="findWxServiceOrderById" resultMap="ErpServiceOrderListVoMap"> + select + a.id id, + a.SERVICE_NO serviceNo, + a.YY_TIME time, + a.TOTAL_TIME timeLength, + a.state status, + a.comment, + a.reply, + d.BED_NAME bed, + f.su_name beautyName, + g.proj_name projName, + h.shop_short_name as shopName, + h.shop_addr as shopAddr, + m.img as imgMobile + from sys_proj_services a + left join sys_beautician_state b on a.ID=b.SERVICES_ID + left join sys_bed_state c on a.ID = c.SERVICE_ID + left join sys_bed_info d on c.BED_ID=d.ID + left join sys_vip_info e on a.VIP_ID=e.ID + left join sys_users f on f.su_id=b.STAFF_ID + left join sys_proj_use g on b.puse_id=g.ID + left join sys_shop_info h on a.SHOP_ID=h.ID + left join shopping_goods m on g.proj_id=m.id + where a.id=#{id} + </select> + + + <select id="selectProjServicesByOrderItemId" resultMap="SysProjServicesMap"> + select a.* from sys_proj_services a + inner join sys_beautician_state b on a.id=b.SERVICES_ID + inner join sys_proj_use c on c.id=b.puse_id + where ORDER_ITEM_ID=#{itemId} and a.STATE!='预约取消' + </select> </mapper> diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml index 3914259..335a873 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml @@ -5,7 +5,12 @@ <mapper namespace="com.matrix.system.hive.dao.SysProjUseDao"> <resultMap type="SysProjUse" id="SysProjUseMap"> + <id property="id" column="ID"/> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> <result property="orderItemId" column="ORDER_ITEM_ID"/> <result property="projId" column="PROJ_ID"/> <result property="surplusCount" column="SURPLUS_COUNT"/> @@ -25,17 +30,117 @@ <result property="projName" column="proj_name"/> <result property="deductionNum" column="deductionNum"/> <result property="isCourse" column="is_course"/> - - - - + <result property="timeLength" column="time_length"/> + <result property="orderId" column="orderId"/> <!-- 对应项目信息--> <association property="projInfo" javaType="ShoppingGoods" resultMap="com.matrix.system.hive.dao.ShoppingGoodsDao.ShoppingGoodsMap"/> </resultMap> + <!-- 余次使用记录map --> + <resultMap type="com.matrix.system.hive.bean.SysProjUseFlow" id="SysProjUseFlowMap"> + <id property="id" column="id"/> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="projUseId" column="proj_use_id"/> + <result property="surplusCount" column="surplus_count"/> + <result property="isOver" column="is_over"/> + <result property="failTime" column="fail_time"/> + <result property="price" column="price"/> + <result property="status" column="status"/> + <result property="balance" column="balance"/> + <result property="remark" column="remark"/> + <result property="projName" column="proj_name"/> + <result property="optionType" column="option_type"/> + </resultMap> + <!-- 插入流水 --> + <insert id="insertFlow" parameterType="SysProjUse" useGeneratedKeys="true" + keyProperty="id"> + INSERT INTO sys_proj_use_flow ( + create_by, + create_time, + update_by, + update_time, + id, + proj_use_id, + surplus_count, + is_over, + fail_time, + price, + status, + balance, + remark, + proj_name, + option_type + ) + VALUES ( + #{createBy}, + now(), + #{updateBy}, + now(), + #{id}, + #{projUseId}, + #{surplusCount}, + #{isOver}, + #{failTime}, + #{price}, + #{status}, + #{balance}, + #{remark}, + #{projName}, + #{optionType} + ) + </insert> + + <!-- 查询流水 --> + <select id="selectProjUseFlow" resultMap="SysProjUseFlowMap"> + select * from sys_proj_use_flow + <where> + and proj_use_id=#{record.projUseId} + <if test="record.createBy !=null and record.createBy!='' "> + and instr(createBy,#{record.createBy}) + </if> + <if test="record.beginTime !=null and record.beginTime!=''"> + and create_time >= #{record.beginTime} + </if> + <if test="record.endTime !=null and record.endTime!=''"> + <![CDATA[ and create_time <= #{record.endTime} ]]> + </if> + + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + + </select> + + <select id="selectProjUseFlowTotal" resultType="java.lang.Integer"> + select count(*) from sys_proj_use_flow + <where> + and proj_use_id=#{record.projUseId} + <if test="record.createBy !=null and record.createBy!='' "> + and instr(createBy,#{record.createBy}) + </if> + <if test="record.beginTime !=null and record.beginTime!=''"> + and create_time >= #{record.beginTime} + </if> + <if test="record.endTime !=null and record.endTime!=''"> + <![CDATA[ and create_time <= #{record.endTime} ]]> + </if> + + </where> + </select> <!-- 插入方法 --> <insert id="insert" parameterType="SysProjUse" useGeneratedKeys="true" @@ -179,6 +284,9 @@ <if test="deductionNum != null "> deductionNum = #{deductionNum}, </if> + <if test="failTime != null "> + fail_time = #{failTime}, + </if> </set> WHERE ID = #{id} @@ -224,13 +332,21 @@ <select id="selectInPage" resultMap="SysProjUseMap"> select a.*, - b.TIME_LENGTH + d.id as orderId, + b.TIME_LENGTH, + b.img, + b.code from sys_proj_use a left join shopping_goods b on a.proj_id=b.id + left join sys_order_item c on a.ORDER_ITEM_ID=c.id + left join sys_order d on c.ORDER_ID=d.id where 1=1 <if test="record!=null"> <if test="record.id != null and record.id !='' "> and a.ID = #{record.id} + </if> + <if test="record.queryKey != null and record.queryKey !='' "> + and (instr(b.name, #{record.queryKey}) or instr(b.zjm, #{record.queryKey}) or instr(goods_no, #{record.queryKey})) </if> <if test="record.orderItemId != null and record.orderItemId !='' "> and a.ORDER_ITEM_ID = #{record.orderItemId} @@ -263,7 +379,9 @@ <if test="record.failTime != null "> and a.FAIL_TIME = #{record.failTime} </if> - + <if test="record.targetFailTime != null "> + and date_format(#{record.targetFailTime}, '%Y-%m-%d') > date_format(a.FAIL_TIME, '%Y-%m-%d') + </if> <if test="record.price != null and record.price !='' "> and a.PRICE = #{record.price} </if> @@ -327,80 +445,94 @@ <!-- 查询总条数 --> <select id="selectTotalRecord" resultType="java.lang.Integer"> select count(*) - from sys_proj_use + from sys_proj_use a + left join shopping_goods b on a.proj_id=b.id + left join sys_order_item c on a.ORDER_ITEM_ID=c.id + left join sys_order d on c.ORDER_ID=d.id where 1=1 <if test="record!=null"> <if test="record.id != null and record.id !='' "> - and ID = #{record.id} + and a.ID = #{record.id} + </if> + <if test="record.queryKey != null and record.queryKey !='' "> + and (instr(b.name, #{record.queryKey}) or instr(b.zjm, #{record.queryKey}) or instr(goods_no, #{record.queryKey})) </if> <if test="record.orderItemId != null and record.orderItemId !='' "> - and ORDER_ITEM_ID = #{record.orderItemId} + and a.ORDER_ITEM_ID = #{record.orderItemId} </if> <if test="record.projId != null and record.projId !='' "> - and PROJ_ID = #{record.projId} + and a.PROJ_ID = #{record.projId} </if> <if test="record.surplusCount != null and record.surplusCount !='' "> - and SURPLUS_COUNT = #{record.surplusCount} + and a.SURPLUS_COUNT = #{record.surplusCount} </if> <if test="record.isOver != null and record.isOver !='' "> - and IS_OVER = #{record.isOver} + and a.IS_OVER = #{record.isOver} </if> <!-- 查询具体某一个套餐的使用情况 --> <if test="record.taocanId != null and record.taocanId !=-1 and record.taocanId !=-2"> - and TAOCAN_ID = #{record.taocanId} + and a.TAOCAN_ID = #{record.taocanId} </if> <!-- 查询所有的项目使用情况 --> <if test="record.taocanId != null and record.taocanId ==-1 "> - and TAOCAN_ID IS NULL + and a.TAOCAN_ID IS NULL </if> <!-- 查询所有的套餐使用情况 --> <if test="record.taocanId != null and record.taocanId ==-2 "> - and TAOCAN_ID IS NOT NULL + and a.TAOCAN_ID IS NOT NULL </if> <if test="record.vipId != null and record.vipId !='' "> - and VIP_ID = #{record.vipId} + and a.VIP_ID = #{record.vipId} + </if> + <if test="record.failTime != null "> + and a.FAIL_TIME = #{record.failTime} + </if> + <if test="record.targetFailTime != null "> + and date_format(#{record.targetFailTime}, '%Y-%m-%d') > date_format(a.FAIL_TIME, '%Y-%m-%d') </if> <if test="record.price != null and record.price !='' "> - and PRICE = #{record.price} + and a.PRICE = #{record.price} </if> <if test="record.assembleId != null and record.assembleId !='' "> - and ASSEMBLE_ID = #{record.assembleId} + and a.ASSEMBLE_ID = #{record.assembleId} </if> <if test="record.source != null and record.source !='' "> - and SOURCE like concat('%',#{record.source},'%') + and a.SOURCE like concat('%',#{record.source},'%') </if> <if test="record.status != null and record.status !='' "> - and STATUS = #{record.status} + and a.STATUS = #{record.status} </if> <if test="record.platformFlag != null and record.platformFlag !='' "> - and PLATFORM_FLAG = #{record.platformFlag} - </if> - <if test="record.projName != null and record.projName !='' "> - and PROJ_NAME like concat('%',#{record.projName},'%') + and a.PLATFORM_FLAG = #{record.platformFlag} </if> <if test="record.type != null and record.type !='' "> - and type = #{record.type} + and a.type = #{record.type} + </if> + <if test="record.projName != null and record.projName !='' "> + and a.PROJ_NAME like concat('%',#{record.projName},'%') </if> <if test="record.balance != null and record.balance !='' "> - and balance = #{record.balance} + and a.balance = #{record.balance} </if> <if test="record.remark != null and record.remark !='' "> - and remark = #{record.remark} + and a.remark = #{record.remark} </if> - <if test="record.isCourse != null and record.isCourse !='' "> - and is_course = #{record.isCourse}, + and a.is_course = #{record.isCourse}, </if> </if> </select> <!-- 根据id查询 --> <select id="selectById" resultMap="SysProjUseMap"> - select * - from sys_proj_use + select a.*, + b.TIME_LENGTH, + b.img + from sys_proj_use a + left join shopping_goods b on a.proj_id=b.id where - id=#{id} + a.id=#{id} </select> <!-- 根据id查询 --> @@ -419,8 +551,11 @@ <!-- 根据对象查询 --> <select id="selectByModel" resultMap="SysProjUseMap"> select - a.* + a.*, + b.time_length, + b.img from sys_proj_use a + left join shopping_goods b on a.proj_id=b.id where 1=1 <if test="record!=null"> <if test="record.id != null and record.id !='' "> @@ -593,13 +728,16 @@ a.type, a.SOURCE, e.ORDER_NO, - a.remark + a.remark, + s.SHOP_NAME from sys_proj_use a left join shopping_goods b on a.proj_id = b.id left join sys_vip_info c on c.ID = a.VIP_ID + left join sys_shop_info s on c.SHOP_ID=s.id left join sys_order_item d on d.id = a.ORDER_ITEM_ID left join sys_order e on e.id = d.ORDER_ID left join shopping_goods_category f on f.id = b.cate_id + <where> @@ -623,7 +761,7 @@ and a.proj_name like concat('%',#{projName},'%') </if> <if test="cateId != null and cateId != '' "> - and b.PROJ_TYPE_ID=#{cateId} + and b.cate_id=#{cateId} </if> </where> @@ -719,4 +857,95 @@ group by b.id) t </select> + <update id="updateInvalidProjUse" > + update sys_proj_use set STATUS='无效' + where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') + and STATUS='有效' + </update> + + <resultMap type="SysProjUse" id="TaoCanWithProjMap"> + + <id property="id" column="ID"/> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="orderItemId" column="ORDER_ITEM_ID"/> + <result property="projId" column="PROJ_ID"/> + <result property="surplusCount" column="SURPLUS_COUNT"/> + <result property="isOver" column="IS_OVER"/> + <result property="taocanId" column="TAOCAN_ID"/> + <result property="vipId" column="VIP_ID"/> + <result property="failTime" column="FAIL_TIME"/> + <result property="assembleId" column="ASSEMBLE_ID"/> + <result property="source" column="SOURCE"/> + <result property="status" column="STATUS"/> + <result property="platformFlag" column="PLATFORM_FLAG"/> + <result property="type" column="type"/> + <result property="balance" column="balance"/> + <result property="remark" column="remark"/> + <result property="price" column="price"/> + <result property="tcName" column="tcName"/> + <result property="projName" column="proj_name"/> + <result property="deductionNum" column="deductionNum"/> + <result property="isCourse" column="is_course"/> + <result property="timeLength" column="time_length"/> + <result property="orderId" column="orderId"/> + + <collection property="taocanProjUse" ofType="com.matrix.system.hive.bean.SysProjUse"> + <id property="id" column="proj_info_id" /> + <result property="projName" column="proj_proj_name"/> + <result property="source" column="proj_source"/> + <result property="price" column="proj_price"/> + <result property="failTime" column="proj_FAIL_TIME"/> + <result property="surplusCount" column="proj_SURPLUS_COUNT"/> + <result property="timeLength" column="proj_time_length"/> + <result property="img" column="proj_img"/> + <result property="projId" column="proj_projId"/> + <result property="status" column="proj_status"/> + </collection> + </resultMap> + + <select id="selectTaoCanListWithProj" resultMap="TaoCanWithProjMap"> + select + a.*, + d.id as orderId, + b.TIME_LENGTH, + b.img, + b.code, + e.proj_name proj_proj_name, + e.FAIL_TIME proj_FAIL_TIME, + e.SURPLUS_COUNT proj_SURPLUS_COUNT, + e.id proj_info_id, + e.proj_id proj_projId, + e.source proj_source, + e.price proj_price, + e.status proj_status, + f.time_length proj_time_length, + f.img proj_img + from sys_proj_use a + left join shopping_goods b on a.proj_id=b.id + left join sys_order_item c on a.ORDER_ITEM_ID=c.id + left join sys_order d on c.ORDER_ID=d.id + left join sys_proj_use e on a.id = e.TAOCAN_ID and e.VIP_ID=a.vip_id + left join shopping_goods f on e.proj_id=f.id + where 1=1 and a.type='套餐' and a.TAOCAN_ID IS NULL + <if test="record.queryKey != null and record.queryKey !='' "> + and (instr(b.name, #{record.queryKey}) or instr(b.zjm, #{record.queryKey}) or instr(b.goods_no, #{record.queryKey})) + </if> + <if test="record.isOver != null and record.isOver !='' "> + and a.IS_OVER = #{record.isOver} + </if> + <if test="record.status != null and record.status !='' "> + and a.STATUS = #{record.status} + </if> + <if test="record.vipId != null and record.vipId !='' "> + and a.VIP_ID = #{record.vipId} + </if> + </select> + + <select id="selectTaocanCountForCourseAndInfinite" resultType="java.lang.Integer"> + select count(1) from sys_proj_use + where taocan_id=#{taocanId} and vip_id=#{vipId} + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysSkinCheckRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysSkinCheckRecordDao.xml index 45a2a01..cf75379 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysSkinCheckRecordDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysSkinCheckRecordDao.xml @@ -18,11 +18,13 @@ <result property="shopName" column="shopName" /> <result property="telphone" column="telphone" /> <result property="checkUserName" column="checkUserName" /> + <result property="userName" column="userName" /> <result property="ext1" column="ext1" /> <result property="ext2" column="ext2" /> <result property="ext3" column="ext3" /> <result property="ext4" column="ext4" /> - <result property="ext5" column="ext5" /> + <result property="ext5" column="ext5" /> + <result property="sex" column="sex" /> <collection property="skinDetails" ofType="com.matrix.system.hive.bean.SysSkinDetail" column="id"> <id property="id" column="detailId" /> <result property="checkId" column="check_id" /> @@ -294,6 +296,9 @@ <if test="(record.telphone!=null and record.telphone!='') or (record.telphone!='' and record.telphone==0) "> and telphone = #{record.telphone} </if> + <if test="record.beginTime != null and record.endTime!=null"> + and (date(check_time) between #{record.beginTime} and #{record.endTime}) + </if> </if> </where> <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> @@ -331,6 +336,9 @@ <if test="(record.telphone!=null and record.telphone!='') or (record.telphone!='' and record.telphone==0) "> and telphone = #{record.telphone} </if> + <if test="record.beginTime != null and record.endTime!=null"> + and (date(check_time) between #{record.beginTime} and #{record.endTime}) + </if> </if> </where> </select> @@ -350,10 +358,13 @@ t3.symptom analysisSymptom, t3.percentage analysisPercentage, t3.analysis analysisAnalysis, - t3.img analysisImg + t3.img analysisImg, + t4.vip_name userName, + t4.sex sex from sys_skin_check_record t1 left join sys_skin_detail t2 on t1.id=t2.check_id and t2.t1=1 left join sys_skin_detail t3 on t1.id=t3.check_id and t3.t1=2 + left join sys_vip_info t4 on t1.user_id=t4.id where t1.id=#{id} </select> diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysStoreInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysStoreInfoDao.xml index 1af5845..6bafe6f 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysStoreInfoDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysStoreInfoDao.xml @@ -380,6 +380,7 @@ c.NAME as gs_NAME, c.UNIT as gs_UNIT, c.good_type as gs_good_type, + c.measure as gs_measure, c.GOODS_SORT_ID as gs_GOODS_SORT_ID, c.SUPPLIER_ID as gs_SUPPLIER_ID, (select TYPE_NAME from sys_goods_type t where t.id=c.GOODS_SORT_ID) gs_goodsSortName, @@ -388,6 +389,7 @@ c.volume as gs_volume, c.price as gs_price, c.wholesale as gs_wholesale, + c.img as gs_img, a.shop_id, a.company_id from @@ -404,6 +406,10 @@ </if> <if test="record.batch != null and record.batch !='' "> and batch = #{record.batch} + </if> + + <if test="record.queryKey != null and record.queryKey !='' "> + and (instr(c.name,#{record.queryKey}) or instr(c.goods_no, #{record.queryKey}) or instr(c.zjm, #{record.queryKey})) </if> <if test="record.storeId != null and record.storeId !='' "> and STORE_ID = #{record.storeId} @@ -477,6 +483,9 @@ </if> <if test="record.batch != null and record.batch !='' "> and batch = #{record.batch} + </if> + <if test="record.queryKey != null and record.queryKey !='' "> + and (instr(c.name,#{record.queryKey}) or instr(c.goods_no, #{record.queryKey}) or instr(c.zjm, #{record.queryKey})) </if> <if test="record.storeId != null and record.storeId !='' "> and STORE_ID = #{record.storeId} @@ -657,6 +666,7 @@ FROM ( SELECT + b.id id, b.create_time as createTime, e.CODE, e.NAME, @@ -708,6 +718,7 @@ UNION ALL SELECT + t2_b.id id, t2_b.create_time, t2_e.CODE, t2_e.NAME, @@ -811,6 +822,9 @@ <if test=" record.endTime!=null "> <![CDATA[ and #{record.endTime} >=b.create_time]]> </if> + <if test="record.companyId != null and record.companyId !='' "> + and b.company_id = #{record.companyId} + </if> </where> UNION ALL SELECT @@ -846,6 +860,9 @@ <if test=" record.endTime!=null "> <![CDATA[ and #{record.endTime} >= t2_b.create_time ]]> </if> + <if test="record.companyId != null and record.companyId !='' "> + and t2_b.company_id = #{record.companyId} + </if> </where> ) t diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml new file mode 100644 index 0000000..c82a8c6 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml @@ -0,0 +1,241 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysVipAlbumDao"> + <!-- 定义SysVipAlbum 的复杂关联map --> + <resultMap type="com.matrix.system.hive.bean.SysVipAlbum" id="SysVipAlbumMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="vipId" column="vip_id" /> + <result property="img" column="img" /> + <result property="source" column="source" /> + <result property="sourceId" column="source_id" /> + </resultMap> + + + <!-- 定义SysVipAlbum 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.hive.bean.SysVipAlbum" id="SysVipAlbumSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="vipId" column="vip_id" /> + <result property="img" column="img" /> + <result property="source" column="source" /> + <result property="sourceId" column="source_id" /> + </resultMap> + + <!-- 字段sql --> + <sql id="columns"> + create_by, + create_time, + update_by, + update_time, + id, + vip_id, + img, + source, + source_id + </sql> + + <!-- 属性sql --> + <sql id="propertys"> + #{item.createBy}, + now(), + #{item.updateBy}, + now(), + #{item.id}, + #{item.vipId}, + #{item.img}, + #{item.source}, + #{item.sourceId} + </sql> + + <!-- where sql --> + <sql id="where_sql"> + + <if test="record!=null"> + <if test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + and id = #{record.id} + </if> + <if test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> + and vip_id = #{record.vipId} + </if> + <if test="(record.img!=null and record.img!='') or (record.img!='' and record.img==0) "> + and img = #{record.img} + </if> + <if test="(record.source!=null and record.source!='') or (record.source!='' and record.source==0) "> + and source = #{record.source} + </if> + <if test="(record.sourceId!=null and record.sourceId!='') or (record.sourceId!='' and record.sourceId==0) "> + and source_id = #{record.sourceId} + </if> + </if> + + </sql> + + <!-- 插入方法 --> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysVipAlbum" + useGeneratedKeys="true" keyProperty="item.id"> + INSERT INTO sys_vip_album ( + <include refid="columns"></include> + ) + VALUES ( + <include refid="propertys"></include> + ) + </insert> + + + + <!-- 批量插入 --> + <insert id="batchInsert" parameterType="java.util.List"> + INSERT INTO sys_vip_album ( + <include refid="columns"></include> + ) + VALUES + <foreach collection="list" item="item" index="index" separator=",">( + <include refid="propertys"></include> + )</foreach> + </insert> + + + + + + <!-- 根据Map更新 部分更新 --> + <update id="updateByMap" parameterType="java.util.HashMap" > + UPDATE sys_vip_album + <set> + <if test="_parameter.containsKey('vipId')"> + vip_id = #{vipId}, + </if> + <if test="_parameter.containsKey('img')"> + img = #{img}, + </if> + <if test="_parameter.containsKey('source')"> + source = #{source}, + </if> + <if test="_parameter.containsKey('sourceId')"> + source_id = #{sourceId}, + </if> + </set> + WHERE id=#{id} + </update> + + + <!-- 根据对象更新 部分更新 --> + <update id="updateByModel" parameterType="Integer"> + UPDATE sys_vip_album + <set> + <if test="record.vipId != null "> + vip_id = #{record.vipId}, + </if> + <if test="record.img != null and record.img != '' "> + img = #{record.img}, + </if> + <if test="record.source != null "> + source = #{record.source}, + </if> + <if test="record.sourceId != null "> + source_id = #{record.sourceId}, + </if> + </set> + WHERE id=#{record.id} + </update> + + <!-- 批量删除 --> + <delete id="deleteByIds" parameterType="java.util.List"> + delete from sys_vip_album where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 根据id删除--> + <delete id="deleteById" parameterType="Integer"> + DELETE FROM sys_vip_album + where id=#{id} + </delete> + + <!-- 根据对象删除--> + <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysVipAlbum"> + DELETE FROM sys_vip_album + <where> + <include refid="where_sql" ></include> + </where> + </delete> + + + <select id="selectBySourceId" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + where source_id=#{sourceId} + </select> + + <!-- 分页查询 --> + <select id="selectInPage" resultMap="SysVipAlbumMap"> + + select + <include refid="columns" ></include> + from sys_vip_album + <where> + <include refid="where_sql"></include> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <!-- 查询总条数 --> + <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> + select count(*) + from sys_vip_album + <where> + <include refid="where_sql"></include> + </where> + </select> + + <!-- 根据id查询--> + <select id="selectById" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + where id=#{id} + </select> + + + <!-- 根据id 锁表查询--> + <select id="selectForUpdate" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + where id=#{id} + for update + </select> + + + + <!-- 根据对象查询--> + <select id="selectByModel" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + <where> + <include refid="where_sql"></include> + </where> + </select> +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml index da5030c..ae9ebb7 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml @@ -35,6 +35,10 @@ <result property="disease" column="disease"/> <result property="zjm" column="zjm"/> <result property="companyId" column="company_id"/> + <result property="province" column="province"/> + <result property="city" column="city"/> + <result property="area" column="area"/> + <result property="recommendId" column="recommend_id"/> <result property="statu" column="statu"/> <result property="birthdayType" column="birthdayType"/> @@ -48,6 +52,15 @@ <result property="isDeal" column="is_deal"/> <result property="createDistributionTime" column="create_distribution_time"/> + <result property="isSales" column="is_sales" /> + <result property="withdrawalCash" column="withdrawal_cash" /> + <result property="salesmanGrade" column="salesman_grade" /> + <result property="nickName" column="nick_name" /> + <result property="avatarUrl" column="avatar_url" /> + <result property="gender" column="gender" /> + <result property="country" column="country" /> + <result property="sessionKey" column="session_key" /> + <result property="userIsAuthorize" column="user_is_authorize" /> <!-- 扩展属性 --> <result property="staffName" column="STAFF_NAME"/> @@ -101,9 +114,24 @@ <result property="createDistributionTime" column="create_distribution_time"/> <result property="disease" column="disease"/> <result property="companyId" column="company_id"/> + + <result property="isSales" column="is_sales" /> + <result property="withdrawalCash" column="withdrawal_cash" /> + <result property="salesmanGrade" column="salesman_grade" /> + <result property="nickName" column="nick_name" /> + <result property="avatarUrl" column="avatar_url" /> + <result property="gender" column="gender" /> + <result property="country" column="country" /> + <result property="sessionKey" column="session_key" /> + <result property="userIsAuthorize" column="user_is_authorize" /> + <!-- 扩展属性 --> <result property="staffName" column="STAFF_NAME"/> <result property="shopName" column="SHOP_NAME"/> + <association property="vipLevel" javaType="com.matrix.system.hive.bean.SysVipLevel" > + <result property="levelName" column="levelName"/> + <result property="vipLevel" column="vipLevel"/> + </association> </resultMap> <!-- 查询几天内过生日的会员 --> @@ -274,7 +302,20 @@ disease, is_deal, zjm, - company_id + company_id, + province, + city, + area, + recommend_id, + is_sales, + withdrawal_cash, + salesman_grade, + nick_name, + avatar_url, + gender, + country, + session_key, + user_is_authorize ) @@ -318,7 +359,20 @@ #{disease}, #{isDeal}, #{zjm}, - #{companyId} + #{companyId}, + #{province}, + #{city}, + #{area}, + #{recommendId}, + #{isSales}, + #{withdrawalCash}, + #{salesmanGrade}, + #{nickName}, + #{avatarUrl}, + #{gender}, + #{country}, + #{sessionKey}, + #{userIsAuthorize} ) </insert> @@ -446,6 +500,44 @@ is_deal = #{isDeal}, </if> + <if test="province != null and province !='' "> + province = #{province}, + </if> + <if test="city != null and city !='' "> + city = #{city}, + </if> + <if test="area != null and area !='' "> + area = #{area}, + </if> + <if test="isSales != null "> + is_sales = #{isSales}, + </if> + <if test="withdrawalCash != null "> + withdrawal_cash = #{withdrawalCash}, + </if> + <if test="salesmanGrade != null "> + salesman_grade = #{salesmanGrade}, + </if> + + <if test="gender != null and gender != '' "> + gender = #{gender}, + </if> + <if test="country != null and country != '' "> + country = #{country}, + </if> + <if test="sessionKey != null and sessionKey != '' "> + session_key = #{sessionKey}, + </if> + <if test="userIsAuthorize != null "> + user_is_authorize = #{userIsAuthorize}, + </if> + <if test="nickName != null and nickName != '' "> + nick_name = #{nickName}, + </if> + <if test="avatarUrl != null and avatarUrl != '' "> + avatar_url = #{avatarUrl}, + </if> + </set> WHERE ID=#{id} @@ -454,6 +546,13 @@ <update id="pointClose"> UPDATE sys_vip_info set POINT_ALL = 0 </update> + + <update id="unbundlingSaleMan"> + UPDATE sys_vip_info set recommend_id = NULL where id=#{userId}; + </update> + <update id="bindingRecommend"> + UPDATE sys_vip_info set recommend_id = #{recommendId} where id=#{userId}; + </update> <!-- 批量删除 --> <delete id="deleteByIds" parameterType="java.util.List"> @@ -508,6 +607,11 @@ <include refid="select"></include> <include refid="from"></include> where a.ID=#{id} + </select> + + <select id="findByOpenId" resultMap="SysVipInfoMap"> + select * + from sys_vip_info where openid=#{openId} </select> <!-- 根据手机和密码查询 --> @@ -612,14 +716,11 @@ COMMISSION_ALL,IN_DATE,STAFF_ID,SHOP_ID,IS_DELETE,REMARK,PASSWORD, EMAIL,CREATE_TIME,UUID,BALANCE,blood,sfCard,link,marry,vocation from sys_vip_info - where - SHOP_ID=#{shopId} - and ( - instr(PHONE,#{keyWord}) + where company_id=#{companyId} + and (instr(PHONE,#{keyWord}) or instr(VIP_NAME ,#{keyWord}) or instr(zjm ,#{keyWord}) - or instr(VIP_NO ,#{keyWord}) - ) + or instr(VIP_NO ,#{keyWord})) limit 0,15 </select> @@ -644,7 +745,7 @@ and (a.VIP_NO =#{key} or a.VIP_NAME =#{key} or - a.PHONE =#{key}) and a.shop_id=#{shopId} + a.PHONE =#{key}) </select> <select id="getLevelIdByMoney" resultMap="SysVipInfoMap"> @@ -786,6 +887,28 @@ <if test="(record.companyId!=null and record.companyId!='') "> and a.company_id = #{record.companyId} </if> + + <if test="(record.nickName!=null and record.nickName!='') or (record.nickName!='' and record.nickName==0) "> + and a.nick_name like concat('%',#{record.nickName},'%') + </if> + <if test="(record.avatarUrl!=null and record.avatarUrl!='') or (record.avatarUrl!='' and record.avatarUrl==0) "> + and a.avatar_url = #{record.avatarUrl} + </if> + <if test="record.isSales != null and record.isSales !='' "> + and a.is_sales = #{record.isSales} + </if> + + <if test="record.withdrawalCash != null and record.withdrawalCash !='' "> + and a.withdrawal_cash = #{record.withdrawalCash} + </if> + + <if test="record.salesmanGrade != null and record.salesmanGrade !='' "> + and a.salesman_grade = #{record.salesmanGrade} + </if> + <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or (record.userIsAuthorize!='' and record.userIsAuthorize==0) "> + and a.user_is_authorize = #{record.userIsAuthorize} + </if> + </if> </sql> @@ -891,58 +1014,42 @@ <if test="record.isDeal != null and record.isDeal !='' "> and a.is_deal = #{record.isDeal} </if> + <if test="(record.nickName!=null and record.nickName!='') or (record.nickName!='' and record.nickName==0) "> + and a.nick_name like concat('%',#{record.nickName},'%') + </if> + <if test="(record.avatarUrl!=null and record.avatarUrl!='') or (record.avatarUrl!='' and record.avatarUrl==0) "> + and a.avatar_url = #{record.avatarUrl} + </if> + <if test="record.isSales != null and record.isSales !='' "> + and a.is_sales = #{record.isSales} + </if> + + <if test="record.withdrawalCash != null and record.withdrawalCash !='' "> + and a.withdrawal_cash = #{record.withdrawalCash} + </if> + + <if test="record.salesmanGrade != null and record.salesmanGrade !='' "> + and a.salesman_grade = #{record.salesmanGrade} + </if> + <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or (record.userIsAuthorize!='' and record.userIsAuthorize==0) "> + and a.user_is_authorize = #{record.userIsAuthorize} + </if> </if> </sql> <sql id="select"> select - a.ID, - a.VIP_NO, - a.VIP_NAME, - a.PHONE, - a.SEX, - a.BIRTHDAY1, - a.photo, - a.ADDR, - a.CONSTELL, - a.ANIMAL_SIGN, - a.ARRIVAL_WAY, - a.VIP_TYPE, - a.VIP_STATE, - a.POINT_ALL, - a.COMMISSION_ALL, - a.IN_DATE, - a.REMARK, - a.SHOP_ID, - a.IS_DELETE, - a.EMAIL, - a.STAFF_ID, - a.CREATE_TIME, - a.LEVEL_ID, - a.UUID, - a.BALANCE, - a.BEATUY_ID, - a.PASSWORD, + a.*, c.su_name as STAFF_NAME, d.SHOP_NAME, - a.blood, - a.sfCard, - a.link, - a.marry, - a.vocation, - a.handle_time, - a.statu, - a.openid, - a.parent_id, - a.create_distribution_time, - a.birthdayType, - a.disease, - a.is_deal + e.level_name levelName, + e.vip_level vipLevel </sql> <sql id="from"> from sys_vip_info a left join sys_users c on c.su_id =a.STAFF_ID left join sys_shop_info d ON d.ID=a.SHOP_ID + left join sys_vip_level e on a.level_id=e.id </sql> @@ -1101,7 +1208,7 @@ <select id="selectByPhone" resultMap="SysVipInfoMapSimple"> - select * from sys_vip_info where PHONE = #{phone} + select * from sys_vip_info where PHONE = #{phone} and company_id=#{companyId} </select> @@ -1171,7 +1278,22 @@ create_distribution_time, birthdayType, disease, - is_deal + is_deal, + zjm, + company_id, + province, + city, + area, + recommend_id, + is_sales, + withdrawal_cash, + salesman_grade, + nick_name, + avatar_url, + gender, + country, + session_key, + user_is_authorize ) VALUES <foreach collection="list" item="item" index="index" separator=",">( @@ -1212,12 +1334,207 @@ #{item.createDistributionTime}, #{item.birthdayType}, #{item.disease}, - #{item.isDeal} + #{item.isDeal}, + #{zjm}, + #{companyId}, + #{province}, + #{city}, + #{area}, + #{recommendId}, + #{isSales}, + #{withdrawalCash}, + #{salesmanGrade}, + #{nickName}, + #{avatarUrl}, + #{gender}, + #{country}, + #{sessionKey}, + #{userIsAuthorize} )</foreach> </insert> <select id="selectVipInfoByVipNo" resultMap="SysVipInfoMapSimple"> select * from sys_vip_info where company_id=#{companyId} and vip_no=#{vipNo} </select> + + <select id="selectVipAddressBookByList" resultType="com.matrix.system.app.vo.VipInfoListVo"> + select + a.ID id, + a.VIP_NAME vipName, + a.VIP_NO vipNo, + a.PHONE phone, + a.photo photo, + b.arriveCnt arriveCnt, + g.shop_short_name shopName, + z.level_name vipLevel + from sys_vip_info a + left join ( + select x.vip_id, count(1) arriveCnt from ( + select vip_id, date_format(datatime, '%Y-%m-%d') + from achieve_new + where 1=1 + <!-- 本月到店次数 --> + <if test="record.sort == 'monthArrived'"> + and date_format(curdate(), '%Y-%m') = date_format(datatime, '%Y-%m') + </if> + <!-- 本年到店次数 --> + <if test="record.sort == 'yearArrived'"> + and date_format(curdate(), '%Y') = date_format(datatime, '%Y') + </if> + group by date_format(datatime, '%Y-%m-%d'), vip_id + ) x group by x.vip_id + ) b on a.ID=b.vip_id + left join sys_vip_level z on a.level_id=z.id + <!-- 本月消费 --> + <if test="record.sort == 'used'"> + left join ( + select y.vip_id, sum(IFNULL(card_cash, 0) + IFNULL(proj_cash,0) + IFNULL(goods_cash, 0)) used from achieve_new y where date_format(datatime,'%Y-%m') = date_format(curdate(), '%Y-%m') group by y.vip_id + ) c on a.id=c.vip_id + </if> + <!-- 本月消耗 --> + <if test="record.sort == 'consume'"> + left join ( + select z.vip_id, SUM(IFNULL(free_consume, 0) + IFNULL(his_consume, 0) + IFNULL(consume, 0)) consume from achieve_new z where date_format(datatime,'%Y-%m') = date_format(curdate(), '%Y-%m') group by z.vip_id + ) d on a.ID = d.vip_id + </if> + <!-- 上次到店时间 --> + <if test="record.sort == 'arriveTime'"> + left join ( + select m.vip_id, MAX(datatime) arriveTime from achieve_new m group by m.vip_id + ) e on a.ID=e.vip_id + </if> + <!-- 会员级别排序 --> + <if test="record.sort == 'vipLevel'"> + left join ( + select n.VIP_LEVEL vipLevel, n.ID from sys_vip_level n + ) f on a.LEVEL_ID = f.ID + </if> + left join sys_shop_info g on a.shop_id = g.id + left join sys_vip_level h on a.level_id=h.id + where 1=1 + <if test="record.queryKey != null and record.queryKey != ''"> + and (instr(PHONE,#{record.queryKey}) + or instr(VIP_NAME ,#{record.queryKey}) + or instr(zjm ,#{record.queryKey}) + or instr(VIP_NO ,#{record.queryKey})) + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.companyId != null"> + and a.company_id=#{record.companyId} + </if> + <if test='record.birthType=="1"'> + and a.BIRTHDAY1 between curdate() and DATE_ADD(CURDATE(), INTERVAL 3 DAY) + </if> + <if test='record.birthType=="2"'> + and date_format(a.BIRTHDAY1, '%Y-%m') = date_format(CURDATE(), '%Y-%m') + </if> + <if test='record.birthType=="3"'> + and PERIOD_DIFF(date_format(now() ,'%Y-%m') , date_format(a.BIRTHDAY1, '%Y-%m')) =1 + </if> + <if test="record.vipType != null"> + and a.level_id=#{record.vipType} + </if> + <if test="record.other != null and record.other!=''"> + and a.is_deal=#{record.other} + </if> + + <if test="record.sort == 'monthArrived' or record.sort == 'yearArrived'"> + order by arriveCnt ${record.order} + </if> + <if test="record.sort != 'monthArrived' and record.sort != 'yearArrived'"> + order by ${record.sort} ${record.order} + </if> + <if test="record.offset >=0 and record.limit >0"> + limit #{record.offset},#{record.limit} + </if> + </select> + + <select id="selectVipInfoById" resultType="com.matrix.system.app.vo.VipInfoVo"> + select + a.ID id, + a.photo photo, + a.PHONE phone, + a.VIP_NAME vipName, + a.VIP_NO vipNo, + c.LEVEL_NAME vipLevel, + a.POINT_ALL integral, + e.shop_short_name shopName, + sum(IFNULL(b.real_money, 0)) totalBalance, + sum(IFNULL(b.gift_money, 0)) giftBalance, + (select sum(IFNULL(d.goods_cash, 0) + IFNULL(d.proj_cash, 0) + IFNULL(d.card_cash, 0)) from achieve_new d where d.vip_id=a.id) totalShopping + from sys_vip_info a + left join money_card_use b on a.ID = b.vip_id and b.status='有效' + left join sys_vip_level c on a.LEVEL_ID = c.ID + left join sys_shop_info e on a.SHOP_ID=e.ID + where a.ID=#{id} + </select> + + + + <select id="selectVipArrearsStatistics" resultType="java.util.Map"> + select + a.VIP_NAME vipName, + a.PHONE phone, + c.shop_short_name shopName, + sum(b.arrears) arrears, + count(1) cnt, + d.su_name staffName + from sys_vip_info a + inner join sys_order b on a.ID=b.VIP_ID + inner join sys_shop_info c on a.SHOP_ID=c.ID + left join sys_users d on a.STAFF_ID=d.su_id + where b.STATU='欠款' and b.arrears!=0 + <if test="record.companyId!=null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId!=null"> + and a.shop_id=#{record.shopId} + </if> + <if test='record.vipName!=null and record.vipName!="" '> + and (a.vip_name like concat('%', #{record.vipName}, '%') or a.vip_no like concat('%', #{record.vipName}, '%') or a.phone like concat('%', #{record.vipName}, '%')) + </if> + group by a.id + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + + <select id="selectVipArrearsStatisticsTotal" resultType="java.lang.Integer"> + select count(1) from ( + select + a.VIP_NAME vipName, + a.PHONE phone, + c.shop_short_name shopName, + sum(b.arrears) arrears, + count(1) cnt, + d.su_name staffName + from sys_vip_info a + inner join sys_order b on a.ID=b.VIP_ID + inner join sys_shop_info c on a.SHOP_ID=c.ID + left join sys_users d on a.STAFF_ID=d.su_id + where b.STATU='欠款' and b.arrears!=0 + <if test="record.companyId!=null"> + and a.company_id=#{record.companyId} + </if> + <if test="record.shopId!=null"> + and a.shop_id=#{record.shopId} + </if> + + <if test='record.vipName!=null and record.vipName!="" '> + and (a.vip_name like concat('%', #{record.vipName}, '%') or a.vip_no like concat('%', #{record.vipName}, '%') or a.phone like concat('%', #{record.vipName}, '%')) + </if> + group by a.id + ) a + </select> </mapper> diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml new file mode 100644 index 0000000..cae0a7a --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml @@ -0,0 +1,188 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysVipLabelDao"> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysVipLabel" useGeneratedKeys="true" + keyProperty="id"> + insert sys_vip_label ( + create_time, + create_by, + id, + label, + shop_id, + company_id, + is_all, + user_id, + color + ) values ( + now(), + #{createBy}, + #{id}, + #{label}, + #{shopId}, + #{companyId}, + #{isAll}, + #{userId}, + #{color} + ) + </insert> + + <insert id="insertRelate" parameterType="com.matrix.system.hive.bean.SysVipLabel" useGeneratedKeys="true" + keyProperty="id"> + insert sys_vip_label_relate ( + id, + label_id, + vip_id + ) values ( + #{id}, + #{labelId}, + #{vipId} + ) + </insert> + + <select id="selectInPage" resultType="com.matrix.system.hive.bean.SysVipLabel"> + select + a.create_time createTime, + a.create_by createBy, + a.id, + a.label, + a.shop_id shopId, + a.company_id companyId, + a.is_all isAll, + a.user_id userId, + a.color, + b.shop_short_name shopName + from sys_vip_label a + left join sys_shop_info b on a.shop_id=b.id + where 1=1 + <if test="record!=null"> + <if test="record.label!=null and record.label!=''"> + and a.label like CONCAT('%', CONCAT(#{record.label},'%')) + </if> + <if test="record.isAll!=null and record.isAll!=0"> + and a.is_all=#{record.isAll} + </if> + <if test="record.userId!=null and record.userId!=''"> + and a.user_id=#{record.userId} + </if> + <if test="record.companyId!=null and record.companyId!=''"> + and a.company_id=#{record.companyId} + </if> + </if> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <select id="selectTotal" resultType="java.lang.Integer"> + select + count(1) + from sys_vip_label + where 1=1 + <if test="record!=null"> + <if test="record.label!=null and record.label!=''"> + and label like CONCAT('%', CONCAT(#{record.label},'%')) + </if> + <if test="record.isAll!=null and record.isAll!=0"> + and is_all=#{record.isAll} + </if> + <if test="record.userId!=null and record.userId!=''"> + and user_id=#{record.userId} + </if> + <if test="record.companyId!=null and record.companyId!=''"> + and company_id=#{record.companyId} + </if> + </if> + </select> + + <update id="update"> + update sys_vip_label + <set> + <if test="label != null and label !='' "> + label = #{label}, + </if> + <if test="color != null and color !='' "> + color = #{color}, + </if> + </set> + WHERE ID=#{id} + </update> + + <delete id="deleteById"> + delete from sys_vip_label + where id=#{id} + </delete> + + <delete id="deleteByIds" parameterType="java.util.List"> + delete from sys_vip_label where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + + <select id="selectByVipId" resultType="com.matrix.system.hive.bean.SysVipLabel"> + select b.* + from sys_vip_label_relate a + inner join sys_vip_label b on a.label_id=b.id + where a.vip_id=#{vipId} + </select> + + <select id="selectByModel" resultType="com.matrix.system.hive.bean.SysVipLabel"> + select + create_time createTime, + create_by createBy, + id, + label, + shop_id shopId, + company_id companyId, + is_all isAll, + user_id userId, + color + from sys_vip_label + where 1=1 + <if test="record!=null"> + <if test="record.label!=null and record.label!=''"> + and label like CONCAT('%', CONCAT(#{record.label},'%')) + </if> + <if test="record.isAll!=null and record.isAll!=0"> + and is_all=#{record.isAll} + </if> + <if test="record.userId!=null and record.userId!=''"> + and user_id=#{record.userId} + </if> + <if test="record.companyId!=null and record.companyId!=''"> + and company_id=#{record.companyId} + </if> + </if> + </select> + + <delete id="deleteRelateByVipId"> + delete from sys_vip_label_relate + where vip_id=#{vipId} + </delete> + + <select id="selectById" resultType="com.matrix.system.hive.bean.SysVipLabel"> + select + create_time createTime, + create_by createBy, + id, + label, + shop_id shopId, + company_id companyId, + is_all isAll, + user_id userId, + color + from sys_vip_label + where id=#{id} + </select> +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLevelDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLevelDao.xml index 5adb97d..efcb7f3 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLevelDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLevelDao.xml @@ -13,6 +13,7 @@ <result property="effectDate" column="EFFECT_DATE" /> <result property="bigclass" column="BIGCLASS" /> <result property="shopId" column="shop_id" /> + <result property="companyId" column="company_id" /> </resultMap> <!-- 插入方法 --> <insert id="insert" parameterType="SysVipLevel" @@ -25,7 +26,8 @@ REMARK, EFFECT_DATE, BIGCLASS, - shop_id + shop_id, + company_id ) VALUES ( #{id}, @@ -35,7 +37,8 @@ #{remark}, #{effectDate}, #{bigclass}, - #{shopId} + #{shopId}, + #{companyId} ) </insert> @@ -123,6 +126,9 @@ <if test="record.shopId != null and record.shopId !='' "> and shop_id = #{record.shopId} </if> + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} + </if> </if> <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> <if test="pageVo.sort !=null and pageVo.order !=null"> @@ -165,6 +171,9 @@ </if> <if test="record.shopId != null and record.shopId !='' "> and shop_id = #{record.shopId} + </if> + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} </if> </if> </select> @@ -223,6 +232,9 @@ <if test="record.shopId != null and record.shopId !='' "> and shop_id = #{record.shopId} </if> + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} + </if> </if> </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysWorkBeatuistaffDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysWorkBeatuistaffDao.xml index ea19ca7..2434c5f 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysWorkBeatuistaffDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysWorkBeatuistaffDao.xml @@ -16,6 +16,16 @@ <association property="sysWorktime" column="id=WORK_ID" select="com.matrix.system.hive.dao.SysWorktimeDao.selectById" ></association> </resultMap> + + <resultMap type="SysWorkBeatuistaff" id="SysWorkBeatuistaffSimpleMap"> + <id property="id" column="ID" /> + <result property="staffId" column="STAFF_ID" /> + <result property="paibanCode" column="PAIBAN_CODE" /> + <result property="workId" column="WORK_ID" /> + <result property="signOrder" column="signOrder" /> + <result property="workStaffName" column="WORK_STAFF_NAME" /> + + </resultMap> <!-- 插入方法 --> <insert id="insert" parameterType="SysWorkBeatuistaff" useGeneratedKeys="true" keyProperty="id"> @@ -82,17 +92,13 @@ <!-- 根据时间查询当天上班的人 --> - <select id="selectByDateStr" resultMap="SysWorkBeatuistaffMap"> - select - ID, - STAFF_ID, - PAIBAN_CODE, - SHOP_ID, - WORK_ID, - (select su_name FROM sys_users t where t.su_id=STAFF_ID) AS WORK_STAFF_NAME - from sys_work_beatuistaff - where PAIBAN_CODE = #{timeStr} - and SHOP_ID=#{shopId} + <select id="selectByDateStr" resultMap="SysWorkBeatuistaffSimpleMap"> + select + distinct a.STAFF_ID, PAIBAN_CODE, a.SHOP_ID, b.su_name as WORK_STAFF_NAME + from sys_work_beatuistaff a + left join sys_users b on b.su_id=a.STAFF_ID + where a.PAIBAN_CODE = #{timeStr} + and a.SHOP_ID=#{shopId} </select> <!-- 根据排班编号查询 --> diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml index 55ed022..56a7c07 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml @@ -68,5 +68,702 @@ </select> + <select id="selectBusinessInCome" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(amount),0) from sys_order_flow + where <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> and pay_method!='欠款' + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectCashIncome" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method not in ('储值卡', '欠款') and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectCardUse" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(amount),0) from sys_order_flow + where pay_method = '储值卡' and flow_type != '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectArrears" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method = '欠款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectHisConsume" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(IFNULL(his_consume, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectFreeConsume" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(IFNULL(free_consume, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectPeopleCnt" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(IFNULL(number_of_people, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectProjConsumeCnt" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(IFNULL(proj_num, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectTimeLength" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(IFNULL(proj_time, 0)),0) from achieve_new + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime}]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectProductAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(zk_price*count),0) from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + inner join sys_order c on a.ORDER_ID=c.id and c.statu!='已取消' + where b.good_type='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]> + <if test="shopId != null"> + and c.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and c.company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectCardAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(zk_price*count),0) from sys_order_item a + inner join shopping_goods b on a.goods_id=b.id + inner join sys_order c on a.ORDER_ID=c.id and c.statu!='已取消' + where b.good_type!='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]> + <if test="shopId != null"> + and c.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and c.company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectRepayment" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.flow_type = '还款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectPerCustomCnt" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(count(1),0) from sys_order + where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectCustomGoodsCnt" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select case a.perCustomCnt when 0 then 0 else a.totalSaleCnt/a.perCustomCnt end from ( + select + (select IFNULL(count(1),0) from sys_order + where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) perCustomCnt, + (select IFNULL(sum(b.COUNT),0) from sys_order a inner join sys_order_item b on a.ID=b.ORDER_ID + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) totalSaleCnt from dual + ) a + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectPerCustomPrice" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select case a.perCustomCnt when 0 then 0 else a.totalPay/a.perCustomCnt end from ( + select + (select IFNULL(count(1),0) from sys_order + where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) perCustomCnt, + (select IFNULL(sum(amount),0) from sys_order_flow + where <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> and pay_method!='欠款' + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) totalPay from dual + ) a + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectCost" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select a.goodsCost+a.otherCost end from ( + select + (select IFNULL(sum(e.count * d.GOODS_PRICE),0) from sys_order a + inner join sys_out_store b on a.id=b.ORDER_ID + inner join sys_out_store_item c on b.id=c.OUT_STORE_ID + inner join sys_store_info d on c.store_id = d.ID + inner join sys_order_item e on a.ID=e.ORDER_ID + inner join shopping_goods f on e.goods_id=f.id and f.good_type='家居产品' + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) goodsCost, + (select IFNULL(sum(b.COUNT * IFNULL(c.price, 0)),0) from sys_order a + inner join sys_order_item b on a.ID=b.ORDER_ID + inner join shopping_goods c on c.good_type != '家居产品' and b.goods_id=c.id + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) otherCost from dual + ) a + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectGrossProfit" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select a.totalPay - a.goodsCost - a.otherCost end from ( + select + (select IFNULL(sum(e.count * d.GOODS_PRICE),0) from sys_order a + inner join sys_out_store b on a.id=b.ORDER_ID + inner join sys_out_store_item c on b.id=c.OUT_STORE_ID + inner join sys_store_info d on c.store_id = d.ID + inner join sys_order_item e on a.ID=e.ORDER_ID + inner join shopping_goods f on e.goods_id=f.id and f.good_type='家居产品' + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) goodsCost, + (select IFNULL(sum(b.COUNT * IFNULL(c.price, 0)),0) from sys_order a + inner join sys_order_item b on a.ID=b.ORDER_ID + inner join shopping_goods c on c.good_type != '家居产品' and b.goods_id=c.id + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) otherCost, + (select IFNULL(sum(amount),0) from sys_order_flow + where <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> and pay_method!='欠款' + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) totalPay from dual + ) a + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectGrossProfitRate" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select case a.totalPay when 0 then 0 else (a.totalPay - a.goodsCost - a.otherCost)/a.totalPay end from ( + select + (select IFNULL(sum(e.count * d.GOODS_PRICE),0) from sys_order a + inner join sys_out_store b on a.id=b.ORDER_ID + inner join sys_out_store_item c on b.id=c.OUT_STORE_ID + inner join sys_store_info d on c.store_id = d.ID + inner join sys_order_item e on a.ID=e.ORDER_ID + inner join shopping_goods f on e.goods_id=f.id and f.good_type='家居产品' + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) goodsCost, + (select IFNULL(sum(b.COUNT * IFNULL(c.price, 0)),0) from sys_order a + inner join sys_order_item b on a.ID=b.ORDER_ID + inner join shopping_goods c on c.good_type != '家居产品' and b.goods_id=c.id + where a.STATU in ('已付款', '欠款') and a.orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) otherCost, + (select IFNULL(sum(amount),0) from sys_order_flow + where <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]> and pay_method!='欠款' + <if test="shopId != null"> + and shop_id=#{shopId} + </if> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) totalPay from dual + ) a + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectCashRefund" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method not in ('储值卡', '欠款') and a.flow_type = '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + + <select id="selectCardRefund" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(a.amount),0) from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.statu!='已取消' + where a.pay_method in ('储值卡') and a.flow_type = '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectCardAmount" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(IFNULL(amount, 0)), 0) + from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.STATU!='已取消' + where a.pay_method='储值卡' and a.is_gift='N' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectFreeAmount" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select IFNULL(sum(IFNULL(amount, 0)), 0) + from sys_order_flow a + inner join sys_order b on a.order_id=b.id and b.STATU!='已取消' + where a.pay_method='储值卡' and a.is_gift='Y' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and a.shop_id=#{shopId} + </if> + <if test="companyId != null"> + and a.company_id=#{companyId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectVipAchieveInPage" resultType="com.matrix.system.app.vo.VipAchieveDataShowVo"> + <foreach collection="list" index="index" item="item" separator="union all" > + select + #{item.beginTime} time, + (select ifnull(sum(ifnull(card_cash,0) + ifnull(consume,0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) orderAmount, + (select ifnull(sum(case a.pay_method when '现金' then goods_cash else 0 end),0) + from achieve_new a + inner join sys_order_item b on a.order_item_id=b.ID + where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) cashAmount, + (select ifnull(sum(case a.pay_method when '划扣' then goods_cash else 0 end),0) + from achieve_new a + inner join sys_order_item b on a.order_item_id=b.ID + where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) cardAmount, + (select ifnull(sum(case a.pay_method when '划扣' then goods_cash else 0 end),0) + from achieve_new a + inner join sys_order_item b on a.order_item_id=b.ID + where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) cardUseAmount, + (select ifnull(sum(ifnull(proj_percentage, 0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> and order_type='订单') goodsAmount, + (select ifnull(sum(ifnull(his_consume, 0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) hisConsume, + (select ifnull(sum(ifnull(free_consume, 0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) freeConsume, + (select ifnull(sum(ifnull(proj_percentage, 0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> and order_type='服务单') commission, + (select ifnull(sum(ifnull(number_of_people, 0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) peopleNum, + (select ifnull(sum(ifnull(proj_num, 0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) projNum, + (select ifnull(sum(ifnull(proj_time, 0)),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) serviceTime + from dual + </foreach> + </select> + + <select id="selectStaffOrderAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + (select ifnull(sum(ifnull(card_cash,0) + ifnull(consume,0)),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and a.beault_id=#{staffId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectStaffCashAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + (select ifnull(sum(case a.pay_method when '现金' then goods_cash else 0 end),0) + from achieve_new a + inner join sys_order_item b on a.order_item_id=b.ID + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and a.beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffCardAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + (select ifnull(sum(case a.pay_method when '划扣' then goods_cash else 0 end),0) + from achieve_new a + inner join sys_order_item b on a.order_item_id=b.ID + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and a.beault_id=#{staffId} + </if> + ) as t${index} + + </foreach> + from area where id=1 + </select> + + <select id="selectStaffGoodsAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + (select ifnull(sum(ifnull(proj_percentage, 0)),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> and order_type='订单' + <if test="staffId != null and staffId != 0"> + and a.beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffCardUseAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select + IFNULL(SUM((IFNULL(a.consume,0))),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and sale_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffHisConsumeAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select + IFNULL(SUM((IFNULL(a.his_consume,0))),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffFreeConsumeAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select + IFNULL(SUM((IFNULL(a.free_consume,0))),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffCommissionAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + (select ifnull(sum(ifnull(proj_percentage, 0)),0) from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> and order_type='服务单' + <if test="staffId != null and staffId != 0"> + and a.beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffPeopleNum" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select + IFNULL(SUM((IFNULL(a.number_of_people,0))),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffProjNum" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select + IFNULL(SUM((IFNULL(a.proj_num,0))),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> + + <select id="selectStaffProjTime" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + ( + select + IFNULL(SUM((IFNULL(a.proj_time,0))),0) + from achieve_new a + where <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]> + <if test="staffId != null and staffId != 0"> + and beault_id=#{staffId} + </if> + ) as t${index} + </foreach> + from area where id=1 + </select> </mapper> diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml new file mode 100644 index 0000000..b8a1a41 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.score.dao.ScoreUseRecordDao"> + + + <select id="selectFlowList" resultType="com.matrix.system.shopXcx.api.vo.ScoreUseRecordVo"> + + select a.*, + b.SHOP_NAME, + c.su_name as optionName + from score_use_record a + left join sys_shop_info b on a.shop_id=b.id + left join sys_users c on a.opration_user_id=c.su_id + <where> + + <if test="(record.vipId!=null and record.vipId!='')"> + and a.vip_id=#{record.vipId} + </if> + + <if test="record.remarks!=null and record.remarks!=''"> + and a.remarks like concat('%',#{record.remarks},'%') + </if> + + <if test="record.queryTime!=null and record.queryTime!=''"> + and DATE_FORMAT(a.create_time,'%Y-%m')=#{record.queryTime} + </if> + + <if test="record.beginTime != null and record.endTime!=null"> + and (date(a.create_time) between #{record.beginTime} and #{record.endTime}) + </if> + + <if test="record.revenueType==1"> + and a.rec_num>0 + </if> + <if test="record.revenueType==2"> + <![CDATA[ and a.rec_num<0 ]]> + </if> + </where> + order by a.create_time desc + + </select> + + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml new file mode 100644 index 0000000..bc19396 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.score.dao.ScoreVipDetailDao"> + + <select id="selectUserTotalScore" resultType="java.lang.Integer"> + select IFNULL(sum(IFNULL(remain_score, 0 )),0) from score_vip_detail + where state=1 and vip_id=#{vipId} + + + </select> + + <select id="selectEffectiveScore" resultType="com.matrix.system.score.entity.ScoreVipDetail"> + select * + from score_vip_detail + where state = 1 and vip_id = #{vipId} + order by create_time + + </select> + + + <select id="selectInvalidaVipScore" resultType="com.matrix.system.score.entity.ScoreVipDetail"> + select * from score_vip_detail where state=1 and remain_score>0 and validite_time <![CDATA[ < now()]]> + </select> + + <update id="invalidVipScore"> + update score_vip_detail set state = 2 , remain_score=0 where state=1 and validite_time <![CDATA[ < now()]]> + </update> + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml deleted file mode 100644 index dc38d94..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml +++ /dev/null @@ -1,492 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.biz.dao.BizUserDao"> - <!-- 定义BizUser 的复杂关联map --> - <resultMap type="com.matrix.biz.bean.BizUser" id="BizUserMap"> - <id property="userId" column="user_id" /> - <result property="createBy" column="create_by" /> - <result property="createTime" column="create_time" /> - <result property="updateBy" column="update_by" /> - <result property="updateTime" column="update_time" /> - <result property="userName" column="user_name" /> - <result property="userPassword" column="user_password" /> - <result property="nickName" column="nick_name" /> - <result property="avatarUrl" column="avatar_url" /> - <result property="openId" column="open_id" /> - <result property="unionId" column="union_id" /> - <result property="gender" column="gender" /> - <result property="phoneNumber" column="phone_number" /> - <result property="area" column="area" /> - <result property="city" column="city" /> - <result property="province" column="province" /> - <result property="country" column="country" /> - <result property="sessionKey" column="session_key" /> - <result property="lastLoginTime" column="last_login_time" /> - <result property="userStatus" column="user_status" /> - <result property="userVip" column="user_vip" /> - <result property="userExpiryTime" column="user_expiry_time" /> - <result property="userAuthentication" column="user_authentication" /> - <result property="userIsAuthorize" column="user_is_authorize" /> - <result property="userTempName" column="user_temp_name" /> - <result property="userTempAvatarUrl" column="user_temp_avatar_url" /> - <result property="userType" column="user_type" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义BizUser 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.biz.bean.BizUser" id="BizUserSimpleMap"> - <id property="userId" column="user_id" /> - <result property="createBy" column="create_by" /> - <result property="createTime" column="create_time" /> - <result property="updateBy" column="update_by" /> - <result property="updateTime" column="update_time" /> - <result property="userName" column="user_name" /> - <result property="userPassword" column="user_password" /> - <result property="nickName" column="nick_name" /> - <result property="avatarUrl" column="avatar_url" /> - <result property="openId" column="open_id" /> - <result property="unionId" column="union_id" /> - <result property="gender" column="gender" /> - <result property="phoneNumber" column="phone_number" /> - <result property="area" column="area" /> - <result property="city" column="city" /> - <result property="province" column="province" /> - <result property="country" column="country" /> - <result property="sessionKey" column="session_key" /> - <result property="lastLoginTime" column="last_login_time" /> - <result property="userStatus" column="user_status" /> - <result property="userVip" column="user_vip" /> - <result property="userExpiryTime" column="user_expiry_time" /> - <result property="userAuthentication" column="user_authentication" /> - <result property="userIsAuthorize" column="user_is_authorize" /> - <result property="userTempName" column="user_temp_name" /> - <result property="userTempAvatarUrl" column="user_temp_avatar_url" /> - <result property="userType" column="user_type" /> - <result property="companyId" column="company_id" /> - </resultMap> - - <!-- 字段sql --> - <sql id="columns"> - create_by, - create_time, - update_by, - update_time, - user_id, - user_name, - user_password, - nick_name, - avatar_url, - open_id, - union_id, - gender, - phone_number, - area, - city, - province, - country, - session_key, - last_login_time, - user_status, - user_vip, - user_expiry_time, - user_authentication, - user_is_authorize, - user_temp_name, - user_temp_avatar_url, - user_type, - company_id - </sql> - - <!-- 属性sql --> - <sql id="propertys"> - #{item.createBy}, - now(), - #{item.updateBy}, - now(), - #{item.userId}, - #{item.userName}, - #{item.userPassword}, - #{item.nickName}, - #{item.avatarUrl}, - #{item.openId}, - #{item.unionId}, - #{item.gender}, - #{item.phoneNumber}, - #{item.area}, - #{item.city}, - #{item.province}, - #{item.country}, - #{item.sessionKey}, - #{item.lastLoginTime}, - #{item.userStatus}, - #{item.userVip}, - #{item.userExpiryTime}, - #{item.userAuthentication}, - #{item.userIsAuthorize}, - #{item.userTempName}, - #{item.userTempAvatarUrl}, - #{item.userType}, - #{item.companyId} - </sql> - - <!-- where sql --> - <sql id="where_sql"> - - <if test="record!=null"> - <if test="(record.userId!=null and record.userId!='') or (record.userId!='' and record.userId==0) "> - and user_id = #{record.userId} - </if> - <if test="(record.userName!=null and record.userName!='') or (record.userName!='' and record.userName==0) "> - and user_name = #{record.userName} - </if> - <if test="(record.userPassword!=null and record.userPassword!='') or (record.userPassword!='' and record.userPassword==0) "> - and user_password = #{record.userPassword} - </if> - <if test="(record.nickName!=null and record.nickName!='') or (record.nickName!='' and record.nickName==0) "> - and nick_name like concat('%',#{record.nickName},'%') - </if> - <if test="(record.avatarUrl!=null and record.avatarUrl!='') or (record.avatarUrl!='' and record.avatarUrl==0) "> - and avatar_url = #{record.avatarUrl} - </if> - <if test="(record.openId!=null and record.openId!='') or (record.openId!='' and record.openId==0) "> - and open_id = #{record.openId} - </if> - <if test="(record.unionId!=null and record.unionId!='') or (record.unionId!='' and record.unionId==0) "> - and union_id = #{record.unionId} - </if> - <if test="(record.gender!=null and record.gender!='') or (record.gender!='' and record.gender==0) "> - and gender = #{record.gender} - <if test="record.gender==0"> - or gender is null - </if> - </if> - <if test="(record.phoneNumber!=null and record.phoneNumber!='') or (record.phoneNumber!='' and record.phoneNumber==0) "> - and phone_number = #{record.phoneNumber} - </if> - <if test="(record.area!=null and record.area!='') or (record.area!='' and record.area==0) "> - and area = #{record.area} - </if> - <if test="(record.city!=null and record.city!='') or (record.city!='' and record.city==0) "> - and city = #{record.city} - </if> - <if test="(record.province!=null and record.province!='') or (record.province!='' and record.province==0) "> - and province = #{record.province} - </if> - <if test="(record.country!=null and record.country!='') or (record.country!='' and record.country==0) "> - and country = #{record.country} - </if> - <if test="(record.sessionKey!=null and record.sessionKey!='') or (record.sessionKey!='' and record.sessionKey==0) "> - and session_key = #{record.sessionKey} - </if> - <if test="(record.lastLoginTime!=null and record.lastLoginTime!='') or (record.lastLoginTime!='' and record.lastLoginTime==0) "> - and last_login_time = #{record.lastLoginTime} - </if> - <if test="(record.userStatus!=null and record.userStatus!='') or (record.userStatus!='' and record.userStatus==0) "> - and user_status = #{record.userStatus} - </if> - <if test="(record.userVip!=null and record.userVip!='') or (record.userVip!='' and record.userVip==0) "> - and user_vip = #{record.userVip} - </if> - <if test="(record.userExpiryTime!=null and record.userExpiryTime!='') or (record.userExpiryTime!='' and record.userExpiryTime==0) "> - and user_expiry_time = #{record.userExpiryTime} - </if> - <if test="(record.userAuthentication!=null and record.userAuthentication!='') or (record.userAuthentication!='' and record.userAuthentication==0) "> - and user_authentication = #{record.userAuthentication} - </if> - <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or (record.userIsAuthorize!='' and record.userIsAuthorize==0) "> - and user_is_authorize = #{record.userIsAuthorize} - </if> - <if test="(record.userTempName!=null and record.userTempName!='') or (record.userTempName!='' and record.userTempName==0) "> - and user_temp_name = #{record.userTempName} - </if> - <if test="(record.userTempAvatarUrl!=null and record.userTempAvatarUrl!='') or (record.userTempAvatarUrl!='' and record.userTempAvatarUrl==0) "> - and user_temp_avatar_url = #{record.userTempAvatarUrl} - </if> - <if test="(record.userType!=null and record.userType!='') or (record.userType!='' and record.userType==0) "> - and user_type = #{record.userType} - </if> - - <if test="record.companyId != null and record.companyId !='' "> - and company_id = #{record.companyId} - </if> - <if test="(record.startTime!=null and record.startTime!='') or (record.startTime!='' and record.startTime==0) "> - and date_format(create_time,'%Y-%m-%d') >= #{record.startTime} - </if> - <if test="(record.endTime!=null and record.endTime!='') or (record.endTime!='' and record.endTime==0) "> - and date_format(create_time,'%Y-%m-%d') <= #{record.endTime} - </if> - </if> - - </sql> - - <!-- 插入方法 --> - <insert id="insert" parameterType="com.matrix.biz.bean.BizUser" - useGeneratedKeys="true" keyProperty="item.userId"> - INSERT INTO biz_user ( - <include refid="columns"></include> - ) - VALUES ( - <include refid="propertys"></include> - ) - </insert> - - - - <!-- 批量插入 --> - <insert id="batchInsert" parameterType="java.util.List"> - INSERT INTO biz_user ( - <include refid="columns"></include> - ) - VALUES - <foreach collection="list" item="item" index="index" separator=",">( - <include refid="propertys"></include> - )</foreach> - </insert> - - - - - - <!-- 根据Map更新 部分更新 --> - <update id="updateByMap" parameterType="java.util.HashMap" > - UPDATE biz_user - <set> - <if test="_parameter.containsKey('userName')"> - user_name = #{userName}, - </if> - <if test="_parameter.containsKey('userPassword')"> - user_password = #{userPassword}, - </if> - <if test="_parameter.containsKey('nickName')"> - nick_name = #{nickName}, - </if> - <if test="_parameter.containsKey('avatarUrl')"> - avatar_url = #{avatarUrl}, - </if> - <if test="_parameter.containsKey('openId')"> - open_id = #{openId}, - </if> - <if test="_parameter.containsKey('unionId')"> - union_id = #{unionId}, - </if> - <if test="_parameter.containsKey('gender')"> - gender = #{gender}, - </if> - <if test="_parameter.containsKey('phoneNumber')"> - phone_number = #{phoneNumber}, - </if> - <if test="_parameter.containsKey('area')"> - area = #{area}, - </if> - <if test="_parameter.containsKey('city')"> - city = #{city}, - </if> - <if test="_parameter.containsKey('province')"> - province = #{province}, - </if> - <if test="_parameter.containsKey('country')"> - country = #{country}, - </if> - <if test="_parameter.containsKey('sessionKey')"> - session_key = #{sessionKey}, - </if> - <if test="_parameter.containsKey('lastLoginTime')"> - last_login_time = #{lastLoginTime}, - </if> - <if test="_parameter.containsKey('userStatus')"> - user_status = #{userStatus}, - </if> - <if test="_parameter.containsKey('userVip')"> - user_vip = #{userVip}, - </if> - <if test="_parameter.containsKey('userExpiryTime')"> - user_expiry_time = #{userExpiryTime}, - </if> - <if test="_parameter.containsKey('userAuthentication')"> - user_authentication = #{userAuthentication}, - </if> - <if test="_parameter.containsKey('userIsAuthorize')"> - user_is_authorize = #{userIsAuthorize}, - </if> - <if test="_parameter.containsKey('userTempName')"> - user_temp_name = #{userTempName}, - </if> - <if test="_parameter.containsKey('userTempAvatarUrl')"> - user_temp_avatar_url = #{userTempAvatarUrl}, - </if> - <if test="_parameter.containsKey('userType')"> - user_type = #{userType}, - </if> - </set> - WHERE user_id=#{userId} - </update> - - - <!-- 根据对象更新 部分更新 --> - <update id="updateByModel" parameterType="String"> - UPDATE biz_user - <set> - <if test="record.userName != null and record.userName != '' "> - user_name = #{record.userName}, - </if> - <if test="record.userPassword != null and record.userPassword != '' "> - user_password = #{record.userPassword}, - </if> - <if test="record.nickName != null and record.nickName != '' "> - nick_name = #{record.nickName}, - </if> - <if test="record.avatarUrl != null and record.avatarUrl != '' "> - avatar_url = #{record.avatarUrl}, - </if> - <if test="record.openId != null and record.openId != '' "> - open_id = #{record.openId}, - </if> - <if test="record.unionId != null and record.unionId != '' "> - union_id = #{record.unionId}, - </if> - <if test="record.gender != null and record.gender != '' "> - gender = #{record.gender}, - </if> - <if test="record.phoneNumber != null and record.phoneNumber != '' "> - phone_number = #{record.phoneNumber}, - </if> - <if test="record.area != null and record.area != '' "> - area = #{record.area}, - </if> - <if test="record.city != null and record.city != '' "> - city = #{record.city}, - </if> - <if test="record.province != null and record.province != '' "> - province = #{record.province}, - </if> - <if test="record.country != null and record.country != '' "> - country = #{record.country}, - </if> - <if test="record.sessionKey != null and record.sessionKey != '' "> - session_key = #{record.sessionKey}, - </if> - <if test="record.lastLoginTime != null "> - last_login_time = #{record.lastLoginTime}, - </if> - <if test="record.userStatus != null "> - user_status = #{record.userStatus}, - </if> - <if test="record.userVip != null "> - user_vip = #{record.userVip}, - </if> - <if test="record.userExpiryTime != null "> - user_expiry_time = #{record.userExpiryTime}, - </if> - <if test="record.userAuthentication != null and record.userAuthentication != '' "> - user_authentication = #{record.userAuthentication}, - </if> - <if test="record.userIsAuthorize != null "> - user_is_authorize = #{record.userIsAuthorize}, - </if> - <if test="record.userTempName != null and record.userTempName != '' "> - user_temp_name = #{record.userTempName}, - </if> - <if test="record.userTempAvatarUrl != null and record.userTempAvatarUrl != '' "> - user_temp_avatar_url = #{record.userTempAvatarUrl}, - </if> - <if test="record.userType != null "> - user_type = #{record.userType}, - </if> - </set> - WHERE user_id=#{record.userId} - </update> - - <!-- 批量删除 --> - <delete id="deleteByIds" parameterType="java.util.List"> - delete from biz_user where user_id in - <foreach collection="list" index="index" item="item" open="(" - separator="," close=")"> - #{item} - </foreach> - </delete> - - <!-- 根据id删除--> - <delete id="deleteById" parameterType="String"> - DELETE FROM biz_user - where user_id=#{userId} - </delete> - - <!-- 根据对象删除--> - <delete id="deleteByModel" parameterType="com.matrix.biz.bean.BizUser"> - DELETE FROM biz_user - <where> - <include refid="where_sql" ></include> - </where> - </delete> - - - - <!-- 分页查询 --> - <select id="selectInPage" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - <where> - <include refid="where_sql"></include> - </where> - <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> - <if test="pageVo.sort !=null and pageVo.order !=null"> - order by - ${pageVo.sort} ${pageVo.order} - </if> - <if test="pageVo.offset >=0 and pageVo.limit >0"> - limit - #{pageVo.offset},#{pageVo.limit} - </if> - </if> - </select> - - <!-- 查询总条数 --> - <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> - select count(*) - from biz_user - <where> - <include refid="where_sql"></include> - </where> - </select> - - <!-- 根据id查询--> - <select id="selectById" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - where user_id=#{userId} - </select> - - - <!-- 根据id 锁表查询--> - <select id="selectForUpdate" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - where user_id=#{user_id} - for update - </select> - - - - <!-- 根据对象查询--> - <select id="selectByModel" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - <where> - <include refid="where_sql"></include> - </where> - </select> - - - <select id="findByOpenId" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user where open_id=#{openId} - </select> -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml index 78a0c37..4ad1d1f 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml @@ -7,6 +7,7 @@ <resultMap type="com.matrix.system.shopXcx.bean.ShopActivities" id="ShopActivitiesMap"> <id property="id" column="id" /> <result property="actName" column="act_name" /> + <result property="actCode" column="act_code" /> <result property="actType" column="act_type" /> <result property="actBeginTime" column="act_begin_time" /> <result property="actEndTime" column="act_end_time" /> @@ -47,6 +48,7 @@ <resultMap type="com.matrix.system.shopXcx.bean.ShopActivities" id="ShopActivitiesSimpleMap"> <id property="id" column="id" /> <result property="actName" column="act_name" /> + <result property="actCode" column="act_code" /> <result property="actType" column="act_type" /> <result property="actBeginTime" column="act_begin_time" /> <result property="actEndTime" column="act_end_time" /> @@ -65,6 +67,7 @@ update_time, id, act_name, + act_code, act_type, act_begin_time, act_end_time, @@ -85,6 +88,7 @@ now(), #{item.id}, #{item.actName}, + #{item.actCode}, #{item.actType}, #{item.actBeginTime}, #{item.actEndTime}, @@ -208,6 +212,13 @@ <set> <if test="record.actName != null and record.actName != '' "> act_name = #{record.actName}, + </if> + <if test="record.actCode != null "> + act_code = #{record.actCode}, + </if> + + <if test="record.actContent != null "> + act_content = #{record.actContent}, </if> <if test="record.actType != null "> act_type = #{record.actType}, @@ -386,4 +397,46 @@ </if> </if> </select> + + <select id="findActivitiesList" resultType="com.matrix.system.activity.vo.ActivitiesListVo"> + SELECT + * + FROM + shop_activities a + <where> + a.company_id=#{record.companyId} + <if test="record.hdzt != null and record.hdzt != ''"> + and a.act_status=#{record.hdzt} + </if> + <if test="record.hdmc != null and record.hdmc != ''"> + and a.act_name like concat('%',#{record.hdmc},'%') + </if> + </where> + <if test="record.sort !=null"> + order by + a.${record.sort} ${record.order} + </if> + </select> + + <select id="selectOneByCompanyIdAndActTypeAndActStatus" resultType="com.matrix.system.shopXcx.bean.ShopActivities"> + SELECT + * + FROM + shop_activities a + where + a.company_id=#{companyId} + and a.act_type=#{activitiesTypeSign} + and a.act_status=#{actstatusStatusIng} + </select> + + <select id="selectOneByCompanyIdAndActType" resultType="com.matrix.system.shopXcx.bean.ShopActivities"> + SELECT + * + FROM + shop_activities a + where + a.company_id=#{companyId} + and a.act_type=#{activitiesTypeSign} + and a.act_status != 5 + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml index f429e8c..2e74316 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml @@ -247,7 +247,7 @@ t3.nick_name headName from shop_activities_group_join t1 inner join shop_activities_group_price t2 on t1.gp_id=t2.id - inner join biz_user t3 on t1.gj_head_id=t3.open_id + inner join sys_vip_info t3 on t1.gj_head_id=t3.id where t1.act_id = #{record.actId} <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> <if test="pageVo.sort !=null and pageVo.order !=null"> @@ -310,7 +310,7 @@ t3.avatar_url avatarUrl from shop_activities_group_join t1 inner join shop_activities_group_join_user t2 on t1.id=t2.gj_id and t2.is_has_cancel=2 and t2.is_has_pay=1 - left join biz_user t3 on t2.user_id=t3.open_id + left join sys_vip_info t3 on t2.user_id=t3.id where t1.id=#{gjId} </select> @@ -327,7 +327,7 @@ t3.avatar_url avatarUrl from shop_activities_group_join t1 inner join shop_activities_group_join_user t2 on t1.id=t2.gj_id and t2.is_has_cancel=2 - left join biz_user t3 on t2.user_id=t3.open_id + left join sys_vip_info t3 on t2.user_id=t3.id where t1.id=#{gjId} </select> @@ -350,7 +350,7 @@ t3.avatar_url from shop_activities_group_join t1 inner join shop_activities_group_price t2 on t1.gp_id=t2.id - left join biz_user t3 on t1.gj_head_id=t3.open_id + left join sys_vip_info t3 on t1.gj_head_id=t3.id where t1.act_id=#{actId} and t1.gj_status=3 </select> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml index c98ffff..0ed3811 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml @@ -317,7 +317,7 @@ t3.nick_name from shop_activities_group_join_user t1 inner join shop_order t2 on t1.order_id=t2.id - inner join biz_user t3 on t1.user_id=t3.open_id + inner join sys_vip_info t3 on t1.user_id=t3.id where t1.gj_id=#{gjId} </select> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml index da0bb54..a759d6f 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml @@ -16,7 +16,7 @@ <result property="status" column="status" /> <result property="nickName" column="nick_name" /> <result property="shopName" column="shop_short_name" /> - <result property="phone" column="phone_number" /> + <result property="phone" column="phone" /> <collection property="salonAttr" ofType="com.matrix.system.shopXcx.bean.ShopActivitiesSalonAttrRecord"> <id property="id" column="asd_id" /> <result property="attrName" column="attr_name" /> @@ -184,10 +184,10 @@ <!-- 分页查询 --> <select id="selectInPage" resultMap="ShopActivitiesSalonRecordMap"> - select t1.*, t3.nick_name, t3.phone_number, t4.shop_short_name, t2.id asd_id, t2.attr_name, t2.attr_value, t2.asr_id + select t1.*, t3.nick_name, t3.phone, t4.shop_short_name, t2.id asd_id, t2.attr_name, t2.attr_value, t2.asr_id from shop_activities_salon_record t1 inner join shop_activities_salon_attr_record t2 on t1.id=t2.asr_id - left join biz_user t3 on t1.user_id=open_id + left join sys_vip_info t3 on t1.user_id=id left join sys_shop_info t4 on t1.shop_id=t4.id <where> <include refid="where_sql"></include> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml index b577b01..0a420e7 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml @@ -181,12 +181,12 @@ t3.purchase_quantity, t4.shop_short_name, t5.nick_name userName, - t5.phone_number phone + t5.phone from shop_activities_seckill_record t1 inner join shop_activities_seckill_info t2 on t1.si_id=t2.id inner join shop_order t3 on t1.order_id=t3.id left join sys_shop_info t4 on t3.store_id=t4.id - left join biz_user t5 on t1.user_id=t5.open_id + left join sys_vip_info t5 on t1.user_id=t5.id left join shop_product t6 on t2.goods_id=t6.id where t2.act_id=#{record.actId} <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> @@ -208,7 +208,7 @@ inner join shop_activities_seckill_info t2 on t1.si_id=t2.id inner join shop_order t3 on t1.order_id=t3.id left join sys_shop_info t4 on t3.store_id=t4.id - left join biz_user t5 on t1.user_id=t5.open_id + left join sys_vip_info t5 on t1.user_id=t5.id left join shop_product t6 on t2.goods_id=t6.id where t2.act_id=#{record.actId} </select> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopAdvertisDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopAdvertisDao.xml index e8b87b0..b0a7931 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopAdvertisDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopAdvertisDao.xml @@ -20,6 +20,7 @@ <result property="linkType" column="link_type"/> <result property="linkUrl" column="link_url"/> <result property="companyId" column="company_id" /> + <result property="pageId" column="page_id" /> </resultMap> @@ -38,6 +39,7 @@ <result property="remarks" column="remarks" /> <result property="linkType" column="link_type"/> <result property="linkUrl" column="link_url"/> + <result property="pageId" column="page_id" /> <result property="companyId" column="company_id" /> </resultMap> @@ -56,6 +58,7 @@ remarks, link_type, link_url, +page_id, company_id </sql> @@ -74,6 +77,7 @@ #{item.remarks}, #{item.linkType}, #{item.linkUrl}, + #{item.pageId}, #{item.companyId} </sql> @@ -101,6 +105,9 @@ </if> <if test="(record.remarks!=null and record.remarks!='') or (record.remarks!='' and record.remarks==0) "> and remarks = #{record.remarks} + </if> + <if test="(record.pageId!=null and record.pageId!='') or (record.pageId!='' and record.pageId==0) "> + and page_id = #{record.pageId} </if> <if test="record.companyId != null and record.companyId !='' "> and company_id = #{record.companyId} @@ -167,6 +174,10 @@ link_type = #{linkType}, </if> + <if test="_parameter.containsKey('pageId')"> + page_id = #{pageId}, + </if> + </set> WHERE id=#{id} @@ -206,6 +217,10 @@ company_id = #{record.companyId} </if> + <if test="record.pageId != null and record.pageId !='' "> + page_id = #{record.pageId} + </if> + </set> WHERE id=#{record.id} </update> @@ -232,8 +247,8 @@ <include refid="where_sql" ></include> </where> </delete> - - + + <!-- 分页查询 --> <select id="selectInPage" resultType="com.matrix.system.shopXcx.bean.ShopAdvertis"> @@ -249,6 +264,7 @@ ad.type_id typeId, ad.sort, ad.remarks, + ad.page_id, IFNULL(adType.adt_name ,'无分类') adtName from shop_advertis ad left join shop_advertis_type adType diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml index 1ed2da7..e55332e 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml @@ -32,7 +32,7 @@ <result property="delFlag" column="del_flag" /> <result property="userName" column="user_name" /> <result property="nickName" column="nick_name" /> - <result property="phoneNumber" column="phone_number" /> + <result property="phoneNumber" column="phone" /> <result property="companyId" column="company_id" /> </resultMap> @@ -215,10 +215,10 @@ c.coll_productid, u.user_name, u.nick_name, - u.phone_number, + u.phone, p.title from shop_collection c - LEFT JOIN biz_user u ON c.coll_userid = u.open_id + LEFT JOIN sys_vip_info u ON c.coll_userid = u.id LEFT JOIN shop_product p ON c.coll_productid = p.id <where> <include refid="where_sql"></include> @@ -236,7 +236,7 @@ <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> select count(*) from shop_collection c - LEFT JOIN biz_user u ON c.coll_userid = u.open_id + LEFT JOIN sys_vip_info u ON c.coll_userid = u.id LEFT JOIN shop_product p ON c.coll_productid = p.id <where> <include refid="where_sql"></include> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponDao.xml index 62b8923..4e833dc 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponDao.xml @@ -526,6 +526,7 @@ <result property="tag" column="tag"/> <result property="isUsing" column="is_using"/> <result property="kind" column="kind"/> + <result property="companyId" column="company_id"/> </resultMap> <select id="selectUsableCouponByProductInfo" resultMap="WxShopCouponMap"> @@ -561,7 +562,8 @@ select * from shop_coupon where - kind=2 and now() >= begin_time and end_time >= now() + company_id=#{companyId} + and kind=2 and now() >= begin_time and end_time >= now() and is_open = 1 and (is_all = 1 or ( @@ -584,7 +586,7 @@ ifnull(scr.is_using, 0) is_using from shop_coupon sc left join shop_coupon_record scr on sc.id = scr.c_id and user_id = #{userId} - where sc.shop_id=#{shopId} and sc.kind=1 and now() >= begin_time and end_time >= now() and is_open = 1 + where sc.company_id=#{companyId} and sc.kind=1 and now() >= begin_time and end_time >= now() and is_open = 1 <!--<if test="!isNewPeople">--> <!--and get_limit = 1--> <!--</if>--> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml index 808f1a7..4a915c2 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml @@ -270,7 +270,7 @@ sc.min_amount minAmount, sc.offset_amount offsetAmount, sc.is_all isAll, sc.product_ids productIds, sc.attr_ids attrIds, scr.is_using isUsing from shop_coupon sc, shop_coupon_record scr - where sc.shop_id=#{shopId} and sc.id = scr.c_id and scr.user_id = #{userId} and is_using = #{status} + where sc.company_id=#{companyId} and sc.id = scr.c_id and scr.user_id = #{userId} and is_using = #{status} and is_open = 1 <if test="status == 2"> and now() >= begin_time and end_time >= now() @@ -296,7 +296,7 @@ sc.min_amount minAmount, sc.offset_amount offsetAmount, sc.is_all isAll, sc.product_ids productIds, sc.attr_ids attrIds, scr.is_using isUsing from shop_coupon sc, shop_coupon_record scr - where sc.shop_id=#{shopId} and sc.id = scr.c_id and scr.user_id = #{userId} + where sc.company_id=#{companyId} and sc.id = scr.c_id and scr.user_id = #{userId} and (isnull(order_id) or order_id = 0) and now() > end_time and is_open = 1 <if test="pageVo != null"><!-- 判断pageVo对象是否为空 --> @@ -311,4 +311,8 @@ </if> </select> + <select id="countUnuseCouponRecord" resultType="java.lang.Integer"> + select count(*) from shop_coupon_record where user_id = #{userId} and is_using = 2 + </select> + </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml index fecc71b..d88c52d 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml @@ -65,6 +65,7 @@ logistics_status, delivery_time, pick_up_status, + receive_id, shop_id </sql> @@ -87,6 +88,7 @@ #{item.logisticsStatus}, #{item.deliveryTime}, #{item.pickUpStatus}, + #{item.receiveId}, #{item.shopId} </sql> @@ -142,6 +144,9 @@ </if> <if test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and shop_id = #{record.shopId} + </if> + <if test="(record.companyId!=null and record.companyId!='') or (record.companyId!='' and record.companyId==0) "> + and company_id = #{record.companyId} </if> </if> @@ -239,6 +244,9 @@ <if test="record.orderId != null "> order_id = #{record.orderId}, </if> + <if test="record.receiveId != null "> + receive_id = #{record.receiveId}, + </if> <if test="record.userId != null and record.userId != '' "> user_id = #{record.userId}, </if> @@ -263,6 +271,9 @@ <if test="record.shopId != null "> shop_id = #{record.shopId}, </if> + <if test="record.companyId != null "> + company_id = #{record.companyId}, + </if> </set> WHERE id=#{record.id} </update> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml index 15b7e08..fadeb51 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml @@ -366,7 +366,7 @@ FROM shop_invoice i LEFT JOIN shop_order o ON i.order_id = o.id - LEFT JOIN biz_user b on i.user_id = b.open_id + LEFT JOIN sys_vip_info b on i.user_id = b.id <where> <include refid="where_sql"></include> </where> @@ -385,7 +385,7 @@ FROM shop_invoice i LEFT JOIN shop_order o ON i.order_id = o.id - LEFT JOIN biz_user b on i.user_id = b.open_id + LEFT JOIN sys_vip_info b on i.user_id = b.id <where> <include refid="where_sql"></include> </where> @@ -419,7 +419,7 @@ FROM shop_invoice i LEFT JOIN shop_order o ON i.order_id = o.id - LEFT JOIN biz_user b on i.user_id = b.open_id + LEFT JOIN sys_vip_info b on i.user_id = b.id where invo_id=#{invoId} </select> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml index 8ec31fb..ba616cb 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml @@ -33,7 +33,12 @@ <result property="storeName" column="shop_name" /> <result property="orderType" column="order_type" /> <result property="applyStatus" column="apply_status" /> + <result property="scorePay" column="score_pay" /> + <result property="payMethod" column="pay_method" /> <result property="companyId" column="company_id" /> + <!--返回详情列表--> + <collection property="details" column="{orderId=id}" + select="com.matrix.system.shopXcx.dao.ShopOrderDetailsDao.selectByOrderId"/> </resultMap> @@ -44,6 +49,7 @@ <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> + <result property="payMethod" column="pay_method" /> <result property="orderNo" column="order_no" /> <result property="orderMoney" column="order_money" /> <result property="commodityPrice" column="commodity_price" /> @@ -66,6 +72,7 @@ <result property="postage" column="postage" /> <result property="orderType" column="order_type" /> <result property="storeName" column="shop_name" /> + <result property="scorePay" column="score_pay" /> <result property="companyId" column="company_id" /> <result property="activityType" column="activity_type" /> <!--支付时间--> @@ -127,6 +134,9 @@ postage, order_type, activity_type, +score_pay, + + pay_method, company_id </sql> @@ -159,6 +169,8 @@ #{item.postage}, #{item.orderType}, #{item.activityType}, + #{item.scorePay}, + #{item.payMethod}, #{item.companyId} </sql> @@ -235,6 +247,7 @@ <if test="(record.companyId!=null and record.companyId!='') or (record.companyId!='' and record.companyId==0) "> and company_id = #{record.companyId} </if> + </if> </sql> @@ -337,6 +350,9 @@ <if test="_parameter.containsKey('orderType')"> order_type = #{orderType}, </if> + <if test="_parameter.containsKey('scorePay')"> + score_pay = #{scorePay}, + </if> </set> WHERE id=#{id} </update> @@ -405,6 +421,9 @@ </if> <if test="record.postage != null and record.postage != '' "> postage = #{record.postage}, + </if> + <if test="record.scorePay != null and record.scorePay != '' "> + score_pay = #{record.scorePay}, </if> <if test="true"> update_time = now(), @@ -529,36 +548,10 @@ </select> <!-- 分页查询 --> - <select id="selectInPageByQuery" resultMap="ShopOrderMap"> + <select id="selectInPageByQuery" resultMap="ShopOrderComplexMap"> select - o.create_by, - o.create_time, - o.update_by, - o.update_time, - o.id, - o.order_no, - o.order_money, - o.commodity_price, - o.user_id, - o.order_time, - o.pay_status, - o.discount_explain, - o.discount_amount, - o.order_status, - o.refund_charge, - o.user_name, - o.user_tel, - o.remarks, - o.shipping_method, - o.store_id, - o.purchase_quantity, - o.del_flag, - o.wx_order_no, - o.pay_result, - o.postage, - s.shop_name, - o.order_type, - o.apply_status + o.*, + s.shop_name from shop_order o INNER JOIN sys_shop_info s on o.store_id = s.ID where del_flag = 2 and o.company_id = #{record.companyId} @@ -587,6 +580,8 @@ <if test="(record.shopId!=null and record.shopId!='')"> and o.store_id=#{record.shopId} </if> + + </if> <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> <if test="pageVo.sort !=null and pageVo.order !=null"> @@ -628,10 +623,11 @@ o.wx_order_no, o.pay_result, o.postage, - s.store_name, + o.pay_method, + s.shop_name, o.order_type from shop_order o - LEFT JOIN shop_store s on o.store_id = s.store_id + LEFT JOIN sys_shop_info s on o.store_id = s.ID where del_flag = 2 and o.company_id = #{record.companyId} <if test="record != null"> @@ -654,7 +650,7 @@ and o.order_status = #{record.orderStatus} </if> <if test="(record.storeName!=null and record.storeName!='')"> - and s.store_name like concat('%', #{record.storeName}, '%') + and s.shop_name like concat('%', #{record.storeName}, '%') </if> </if> <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> @@ -756,10 +752,17 @@ <select id="selectOrderStatusCount" resultType="java.util.HashMap" > select count(order_status) as count , order_status as orderStatus from shop_order - where user_id=#{openId} + where user_id=#{userId} group by order_status </select> + <select id="selectShopOrderByOrderNo" resultType="com.matrix.system.shopXcx.bean.ShopOrder" > + select + a.* + from shop_order a + where a.order_no=#{orderNo} + </select> + <update id="batchUpdateOrderStatus"> <foreach collection="list" index="index" item="item" separator=";"> update shop_order set order_status=#{item.orderStatus} diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml index c1263ab..46254ee 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml @@ -19,6 +19,9 @@ <result property="sTitle" column="s_title" /> <result property="discountExplain" column="discount_explain" /> <result property="discountAmount" column="discount_amount" /> + <result property="payType" column="pay_type" /> + <result property="scoreCount" column="score_count" /> + <result property="totalScoreCount" column="total_score_count" /> </resultMap> <!-- 定义ShopOrderDetails 的复杂map --> @@ -37,22 +40,19 @@ <result property="sTitle" column="s_title" /> <result property="discountExplain" column="discount_explain" /> <result property="discountAmount" column="discount_amount" /> + <result property="payType" column="pay_type" /> + <result property="scoreCount" column="score_count" /> + <result property="totalScoreCount" column="total_score_count" /> + <!--产品信息--> <association property="shopProduct" column="p_id" select="com.matrix.system.shopXcx.dao.ShopProductDao.selectById"/> <!--规格信息--> <association property="shopSku" column="s_id" select="com.matrix.system.shopXcx.dao.ShopSkuDao.selectById"/> - <!--查询生产企业--> - <association property="productionEnterprise" column="{pId=p_id}" - select="selectProductionEnterpriseByPid"/> + </resultMap> - <!--查询产品生产企业--> - <select id="selectProductionEnterpriseByPid" resultType="java.lang.String"> - select ifnull(param_value, '') from shop_product_param_ref - where p_id = ${pId} and param_name = '生产企业' - </select> <!-- 字段sql --> <sql id="columns"> @@ -69,7 +69,10 @@ total_price, s_title, discount_explain, - discount_amount + discount_amount, + pay_type, + score_count, + total_score_count </sql> <!-- 属性sql --> @@ -87,7 +90,10 @@ #{item.totalPrice}, #{item.sTitle}, #{item.discountExplain}, - #{item.discountAmount} + #{item.discountAmount}, + #{item.payType}, + #{item.scoreCount}, + #{item.totalScoreCount} </sql> <!-- where sql --> @@ -123,6 +129,17 @@ </if> <if test="(record.discountAmount!=null and record.discountAmount!='') or (record.discountAmount!='' and record.discountAmount==0) "> and discount_amount = #{record.discountAmount} + </if> + <if test="(record.payType!=null and record.payType!='') or (record.payType!='' and record.payType==0) "> + and pay_type = #{record.payType} + </if> + + <if test="(record.scoreCount!=null and record.scoreCount!='') or (record.scoreCount!='' and record.scoreCount==0) "> + and score_count = #{record.scoreCount} + </if> + + <if test="(record.totalScoreCount!=null and record.totalScoreCount!='') or (record.totalScoreCount!='' and record.totalScoreCount==0) "> + and total_score_count = #{record.totalScoreCount} </if> </if> @@ -186,7 +203,20 @@ </if> <if test="_parameter.containsKey('discountAmount')"> discount_amount = #{discountAmount}, - </if> + </if> + + <if test="_parameter.containsKey('payType')"> + pay_type = #{payType}, + </if> + + <if test="_parameter.containsKey('scoreCount')"> + score_count = #{scoreCount}, + </if> + + <if test="_parameter.containsKey('totalScoreCount')"> + total_score_count = #{totalScoreCount}, + </if> + </set> WHERE id=#{id} </update> @@ -223,10 +253,18 @@ <if test="record.discountAmount != null "> discount_amount = #{record.discountAmount}, </if> + <if test="record.payType != null "> + pay_type = #{record.payType}, + </if> + <if test="record.scoreCount != null "> + score_count = #{record.scoreCount}, + </if> + <if test="record.totalScoreCount != null "> + total_score_count = #{record.totalScoreCount}, + </if> </set> WHERE id=#{record.id} </update> - <!-- 批量删除 --> <delete id="deleteByIds" parameterType="java.util.List"> delete from shop_order_details where id in diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml index 6404029..9c86499 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml @@ -95,13 +95,13 @@ select so.order_no,so.order_status,sp.title pro_name,spa.attr_name pro_type,sp.attrs_values pro_attrs,sku.`NAME` pro_specification,sod.count 'count',sod.price*sod.count order_money,bu.nick_name nick_name,so.order_time from - shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku + shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku where so.del_flag = 2 and sod.p_id = sp.id and sp.category_id = spa.attr_id and sod.order_id = so.id - and bu.open_id = so.user_id + and bu.id = so.user_id and sku.p_id = sod.p_id and so.company_id=#{record.companyId} <if test="record != null"> @@ -152,13 +152,13 @@ <select id="selectTotalRecordByQuery" resultType="java.lang.Integer"> select count(*) from - shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku + shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku where so.del_flag = 2 and sod.p_id = sp.id and sp.category_id = spa.attr_id and sod.order_id = so.id - and bu.open_id = so.user_id + and bu.id = so.user_id and sku.p_id = sod.p_id and so.company_id=#{record.companyId} <if test="record != null"> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml new file mode 100644 index 0000000..a282ab6 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.shopXcx.dao.ShopOrderV2Dao"> + + <select id="selectReceivedOrderCount" resultType="java.lang.Integer"> + select count(*) from shop_order where user_id = #{userId} and order_status in (4,5) + </select> + + <select id="countOrderAmount" resultType="java.lang.Double"> + select IFNULL(sum(IFNULL( order_money, 0 )),0) from shop_order where user_id = #{userId} and order_status in (4,5) + </select> + + <select id="countBuyZdcp" resultType="java.lang.Integer"> + select count(*) from shop_order a + left join shop_order_details b on a.id=b.order_id + where a.user_id=#{userId} + and order_status in (4,5) + and find_in_set(b.p_id,#{productIds}) + </select> + + + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductAttributeDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductAttributeDao.xml index 1efb9b7..f025c09 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductAttributeDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductAttributeDao.xml @@ -39,7 +39,7 @@ <result property="attrMark" column="attr_mark" /> <result property="sort" column="sort"/> <result property="companyId" column="company_id" /> - <collection property="child" column="{attrId=attr_id, shopId=shop_id}" select="selectByParentIds"/> + <collection property="child" column="{attrId=attr_id, companyId=company_id}" select="selectByParentIds"/> </resultMap> <!-- 根据id查询--> @@ -47,7 +47,7 @@ select <include refid="columns" ></include> from shop_product_attribute - where parent_id=#{attrId} and shop_id=#{shopId} + where parent_id=#{attrId} and company_id=#{companyId} </select> <!-- 根据编码查询--> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml index c32a212..3c85b34 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml @@ -104,7 +104,7 @@ </if> <if test="record.companyId != null and record.companyId !='' "> - and company_id = #{record.companyId} + and c.company_id = #{record.companyId} </if> <if test="(record.comContent!=null and record.comContent!='') or (record.comContent!='' and record.comContent==0) "> @@ -318,7 +318,7 @@ shop_product_comment c LEFT JOIN shop_product p ON c.product_id = p.id LEFT JOIN shop_order o ON c.order_id = o.id - LEFT JOIN biz_user b ON c.user_id = b.open_id + LEFT JOIN sys_vip_info b ON c.user_id = b.openid <where> <include refid="where_sql"></include> </where> @@ -338,7 +338,7 @@ shop_product_comment c LEFT JOIN shop_product p ON c.product_id = p.id LEFT JOIN shop_order o ON c.order_id = o.id - LEFT JOIN biz_user b ON c.user_id = b.open_id + LEFT JOIN sys_vip_info b ON c.user_id = b.id <where> <include refid="where_sql"></include> </where> @@ -379,7 +379,7 @@ shop_product_comment c LEFT JOIN shop_product p ON c.product_id = p.id LEFT JOIN shop_order o ON c.order_id = o.id - LEFT JOIN biz_user b ON c.user_id = b.open_id + LEFT JOIN sys_vip_info b ON c.user_id = b.id <where> <if test="record!=null"> <if test="(record.userId!=null and record.userId!='') or (record.userId!='' and record.userId==0) "> @@ -425,7 +425,7 @@ shop_product_comment c LEFT JOIN shop_product p ON c.product_id = p.id LEFT JOIN shop_order o ON c.order_id = o.id - LEFT JOIN biz_user b ON c.user_id = b.open_id + LEFT JOIN sys_vip_info b ON c.user_id = b.openid <where> and c.product_id = #{record.productId} AND p.del_flag = 2 @@ -448,13 +448,14 @@ shop_product_comment c LEFT JOIN shop_product p ON c.product_id = p.id LEFT JOIN shop_order o ON c.order_id = o.id - LEFT JOIN biz_user b ON c.user_id = b.open_id + LEFT JOIN sys_vip_info b ON c.user_id = b.openid <where> <if test="record!=null"> <if test="(record.productId!=null and record.productId!='') or (record.productId!='' and record.productId==0) "> and c.product_id = #{record.productId} </if> </if> + and c.com_audit_status=1 AND p.del_flag = 2 AND o.del_flag = 2 AND c.del_flag = 2 diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml index f12db2c..b0061e1 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml @@ -42,6 +42,11 @@ <result property="couponId" column="couponId"></result> <result property="serviceTime" column="service_time"></result> <result property="companyId" column="company_id"/> + <result property="ableScorePay" column="able_score_pay"/> + <result property="ableSales" column="able_sales"/> + <result property="scoreCategoryId" column="score_category_id"/> + <result property="isUnrealProduct" column="is_unreal_product"/> + <association property="shopCoupon" select="com.matrix.system.shopXcx.dao.ShopCouponDao.selectById" column="{id=couponId}"></association> </resultMap> @@ -80,6 +85,9 @@ <result property="couponId" column="couponId"></result> <result property="serviceTime" column="service_time"></result> <result property="companyId" column="company_id"/> + <result property="ableScorePay" column="able_score_pay"/> + <result property="ableSales" column="able_sales"/> + <result property="scoreCategoryId" column="score_category_id"/> </resultMap> <sql id="columns"> @@ -113,7 +121,12 @@ is_service, service_time, shop_ids, - company_id + company_id, + able_score_pay, + able_sales, + is_unreal_product, + score_category_id + </sql> <!-- 属性sql --> @@ -148,7 +161,12 @@ #{item.isService}, #{item.serviceTime}, #{item.shopIds}, - #{item.companyId} + #{item.companyId}, + #{item.ableScorePay}, + #{item.ableSales}, + #{item.isUnrealProduct}, + #{item.scoreCategoryId} + </sql> <!-- where sql --> <sql id="where_sql"> @@ -237,6 +255,15 @@ and a.company_id = #{record.companyId} </if> + <if test="record.ableScorePay != null and record.ableScorePay !='' "> + and a.able_score_pay = #{record.ableScorePay} + </if> + <if test="record.ableSales != null and record.ableSales !='' "> + and a.able_sales = #{record.ableSales} + </if> + <if test="record.scoreCategoryId != null and record.scoreCategoryId "> + and a.score_category_id = #{record.scoreCategoryId} + </if> </if> @@ -311,6 +338,17 @@ and b.attr_full_path like concat('%/',#{record.attrs},'/%') </if> + + <if test="record.ableScorePay != null and record.ableScorePay !='' "> + and a.able_score_pay = #{record.ableScorePay} + </if> + <if test="record.ableSales != null and record.ableSales !='' "> + and a.able_sales = #{record.ableSales} + </if> + <if test="record.scoreCategoryId != null and record.scoreCategoryId "> + and a.score_category_id = #{record.scoreCategoryId} + </if> + </if> @@ -418,6 +456,16 @@ <if test="_parameter.containsKey('companyId')"> company_id = #{companyId}, </if> + <if test="_parameter.containsKey('scoreCategoryId')"> + score_category_id = #{scoreCategoryId}, + </if> + <if test="_parameter.containsKey('ableSales')"> + able_sales = #{ableSales}, + </if> + <if test="_parameter.containsKey('ableScorePay')"> + able_score_pay = #{ableScorePay}, + </if> + </set> WHERE id=#{id} @@ -500,6 +548,18 @@ shop_ids = #{record.shopIds}, </if> + <if test="record.ableScorePay != null and record.ableScorePay !='' "> + able_score_pay = #{record.ableScorePay}, + </if> + <if test="record.ableSales != null and record.ableSales !='' "> + able_sales = #{record.ableSales}, + </if> + <if test="record.scoreCategoryId != null and record.scoreCategoryId "> + score_category_id = #{record.scoreCategoryId}, + </if> + <if test="record.isUnrealProduct != null and record.isUnrealProduct"> + is_unreal_product = #{record.isUnrealProduct}, + </if> </set> WHERE id=#{record.id} @@ -588,6 +648,9 @@ a.marked_price, b.attr_full_path, a.couponId, + a.able_score_pay, + a.able_sales, + a.score_category_id, (SELECT ROUND(SUM(ss.stock),2) from shop_sku ss where ss.p_id = a.id) as stockNum, GROUP_CONCAT(DISTINCT(s.atrid) order by a.id SEPARATOR ',') atrid from shop_product a left join shop_product_attr_ref b on a.id = b.p_id @@ -628,6 +691,9 @@ a.marked_price, a.service_time, a.couponId, + a.able_score_pay, + a.able_sales, + a.score_category_id, (SELECT ROUND(SUM(ss.stock),2) from shop_sku ss where ss.p_id = a.id) as stockNum from shop_product a where a.id in (${productIds}) and shop_ids=#{shopId} @@ -665,6 +731,9 @@ a.marked_price, b.attr_full_path, a.couponId, + a.able_score_pay, + a.able_sales, + a.score_category_id, a.service_time, (SELECT ROUND(SUM(ss.stock),2) from shop_sku ss where ss.p_id = a.id) as stockNum, GROUP_CONCAT(DISTINCT(s.atrid) order by a.id SEPARATOR ',') atrid @@ -730,6 +799,9 @@ b.attr_full_path, a.service_time, a.couponId, + a.able_score_pay, + a.able_sales, + a.score_category_id, (SELECT ROUND(SUM(s.stock),2) from shop_sku s where s.p_id = a.id) as stockNum, (SELECT COUNT(p.com_id) from shop_product_comment p where p.product_id=a.id and p.del_flag=2 and p.com_audit_status=1 and p.com_score=5) as comment from shop_product a @@ -771,6 +843,18 @@ <if test="(record.shopIds!=null and record.shopIds!='') or (record.shopIds!='' and record.shopIds==0) "> and find_in_set(#{record.shopIds}, a.shop_ids) </if> + + <if test="record.ableScorePay != null and record.ableScorePay !='' "> + and a.able_score_pay = #{record.ableScorePay} + </if> + <if test="record.ableSales != null and record.ableSales !='' "> + and a.able_sales = #{record.ableSales} + </if> + <if test="record.scoreCategoryId != null and record.scoreCategoryId "> + and a.score_category_id = #{record.scoreCategoryId} + </if> + + </where> GROUP BY a.id <if test="record.queryType != null and record.queryType == 1"> @@ -828,6 +912,10 @@ is_special_price, marked_price, couponId, + a.able_score_pay, + a.able_sales, + a.score_category_id, + a.is_unreal_product, (SELECT SUM(s.stock) from shop_sku s where s.p_id = a.id) as stockNum, (SELECT ROUND(SUM(s.stock),2) from shop_sku s where s.p_id = a.id) as stockNum, shop_ids @@ -846,6 +934,16 @@ </foreach> </select> + <select id="selectProductNameByIds" resultType="java.lang.String"> + select + title + from shop_product + where id in + <foreach collection="ids" item="item" separator="," open="(" close=")"> + #{item} + </foreach> + </select> + <!-- 根据id 锁表查询--> <select id="selectForUpdate" resultMap="ShopProductMap"> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml index 374a982..75e8591 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml @@ -465,7 +465,7 @@ u.nick_name from shop_refund_record r left join shop_order o on r.order_id = o.id - LEFT JOIN biz_user u ON r.user_id = u.open_id + LEFT JOIN sys_vip_info u ON r.user_id = u.id <where> <include refid="where_sql"></include> </where> @@ -483,7 +483,7 @@ select count(*) from shop_refund_record r left join shop_order o on r.order_id = o.id - LEFT JOIN biz_user u ON r.user_id = u.open_id + LEFT JOIN sys_vip_info u ON r.user_id = u.id <where> <include refid="where_sql"></include> </where> @@ -520,7 +520,7 @@ u.nick_name from shop_refund_record r left join shop_order o on r.order_id = o.id - LEFT JOIN biz_user u ON r.user_id = u.open_id + LEFT JOIN sys_vip_info u ON r.user_id = u.id where r.id=#{id} </select> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml index 8e59026..5f88fc6 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml @@ -27,6 +27,7 @@ <result property="isSelected" column="isSelected" /> <result property="shopId" column="shop_id" /> <result property="companyId" column="company_id" /> + <result property="cartType" column="cart_type" /> </resultMap> @@ -44,6 +45,8 @@ <result property="isSelected" column="isSelected" /> <result property="shopId" column="shop_id" /> <result property="companyId" column="company_id" /> + <result property="cartType" column="cart_type" /> + </resultMap> <!-- 字段sql --> @@ -59,7 +62,9 @@ cart_number, isSelected, shop_id, - company_id + company_id, + cart_type + </sql> <!-- 属性sql --> @@ -75,7 +80,9 @@ #{item.cartNumber}, #{item.isSelected}, #{item.shopId}, - #{item.companyId} + #{item.companyId}, + #{item.cartType} + </sql> <!-- where sql --> @@ -122,6 +129,7 @@ <if test="record.companyId != null and record.companyId !='' "> and c.company_id = #{record.companyId} </if> + </if> @@ -268,11 +276,12 @@ p.img_mobile, p.img_pc, u.nick_name, - s.NAME + s.NAME, + c.cart_type, from shop_shopping_cart c LEFT JOIN shop_product p ON c.cart_product_id = p.id LEFT JOIN shop_sku s ON c.cart_sku_id = s.id - LEFT JOIN biz_user u ON c.cart_user_id = u.open_id + LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id <where> <include refid="where_sql"></include> </where> @@ -291,7 +300,7 @@ from shop_shopping_cart c LEFT JOIN shop_product p ON c.cart_product_id = p.id LEFT JOIN shop_sku s ON c.cart_sku_id = s.id - LEFT JOIN biz_user u ON c.cart_user_id = u.open_id + LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id <where> <include refid="where_sql"></include> </where> @@ -325,7 +334,10 @@ p.img_pc, p.buy_limit, s.NAME, - s.stock + s.stock, + s.score_count, + s.score_price, + c.cart_type from shop_shopping_cart c LEFT JOIN shop_product p ON c.cart_product_id = p.id LEFT JOIN shop_sku s ON c.cart_sku_id = s.id @@ -349,9 +361,9 @@ <!-- 统计用户购物车数量 --> <select id="selectUserCartCount" resultType="java.lang.Integer" > - select sum(cart_number) from shop_shopping_cart c + select ifnull(sum(cart_number),0) from shop_shopping_cart c LEFT JOIN shop_product p on p.id = c.cart_product_id -where c.shop_Id=#{shopId} and p.del_flag = 2 and cart_user_id=#{openId}; +where c.shop_Id=#{shopId} and p.del_flag = 2 and cart_user_id=#{userId} </select> <!-- 根据id 锁表查询--> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml index 0e5d2a5..13a8e2e 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml @@ -22,6 +22,11 @@ <result property="sealCount" column="seal_count"/> <result property="stockCode" column="stock_code"/> <result property="shopId" column="shop_id"/> + <result property="selfPrice" column="self_price"/> + <result property="sealesPrice" column="seales_price"/> + <result property="invitationPrice" column="invitation_price"/> + <result property="scorePrice" column="score_price"/> + <result property="scoreCount" column="score_count"/> @@ -46,6 +51,11 @@ <result property="sealCount" column="seal_count"/> <result property="stockCode" column="stock_code"/> <result property="shopId" column="shop_id"/> + <result property="selfPrice" column="self_price"/> + <result property="sealesPrice" column="seales_price"/> + <result property="invitationPrice" column="invitation_price"/> + <result property="scorePrice" column="score_price"/> + <result property="scoreCount" column="score_count"/> </resultMap> <!-- 字段sql --> @@ -66,7 +76,14 @@ purchase_price, seal_count, stock_code, - shop_id + shop_id, +self_price, +seales_price, +invitation_price, + score_price, +score_count + + </sql> <!-- 属性sql --> @@ -87,7 +104,13 @@ #{item.purchasePrice}, #{item.sealCount}, #{item.stockCode}, - #{item.shopId} + #{item.shopId}, + #{item.selfPrice}, + #{item.sealesPrice}, + #{item.invitationPrice}, + #{item.scorePrice}, + #{item.scoreCount} + </sql> @@ -128,6 +151,18 @@ <if test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and shop_id = #{record.shopId} </if> + + <if test="(record.scorePrice!=null and record.scorePrice!='') or (record.scorePrice!='' and record.scorePrice==0) "> + and score_price = #{record.scorePrice} + </if> + + + <if test="(record.scoreCount!=null and record.scoreCount!='') or (record.scoreCount!='' and record.scoreCount==0) "> + and score_count = #{record.scoreCount} + </if> + + + </if> </sql> @@ -188,6 +223,26 @@ <if test="_parameter.containsKey('stockCode')"> stock_code = #{stockCode}, </if> + <if test="_parameter.containsKey('invitationPrice')"> + invitation_price = #{invitationPrice}, + </if> + <if test="_parameter.containsKey('sealesPrice')"> + seales_price = #{sealesPrice}, + </if> + + <if test="_parameter.containsKey('scorePrice')"> + score_price = #{scorePrice}, + </if> + + <if test="_parameter.containsKey('scoreCount')"> + score_count = #{scoreCount}, + </if> + + <if test="_parameter.containsKey('selfPrice')"> + self_price = #{selfPrice}, + </if> + + </set> WHERE id=#{id} </update> @@ -231,6 +286,24 @@ <if test="record.stockCode != null "> stock_code = #{record.stockCode}, </if> + <if test="record.sealesPrice != null "> + seales_price = #{record.sealesPrice}, + </if> + <if test="record.invitationPrice != null "> + invitation_price = #{record.invitationPrice}, + </if> + + <if test="record.scorePrice != null "> + score_price = #{record.scorePrice}, + </if> + + <if test="record.scoreCount != null "> + score_count = #{record.scoreCount}, + </if> + + <if test="record.selfPrice != null "> + self_price = #{record.selfPrice}, + </if> </set> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopWxtemplateMsgDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopWxtemplateMsgDao.xml index cb13505..d426cec 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopWxtemplateMsgDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopWxtemplateMsgDao.xml @@ -16,6 +16,8 @@ <result property="remark" column="remark" /> <result property="companyId" column="company_id" /> <result property="code" column="code" /> + <result property="tempType" column="temp_type" /> + <result property="templateClass" column="template_class" /> </resultMap> @@ -32,6 +34,8 @@ <result property="remark" column="remark" /> <result property="companyId" column="company_id" /> <result property="code" column="code" /> + <result property="tempType" column="temp_type" /> + <result property="templateClass" column="template_class" /> </resultMap> <!-- 字段sql --> @@ -46,7 +50,9 @@ status, remark, company_id, - code + code, + temp_type, + template_class </sql> <!-- 属性sql --> @@ -61,9 +67,10 @@ #{item.status}, #{item.remark}, #{item.companyId}, - #{item.code} + #{item.code}, + #{item.tempType}, + #{item.templateClass} </sql> - <!-- where sql --> <sql id="where_sql"> @@ -86,6 +93,12 @@ <if test="(record.companyId!=null and record.companyId!='') or (record.companyId!='' and record.companyId==0) "> and company_id = #{record.companyId} </if> + + <if test="(record.tempType!=null and record.tempType!='') or (record.tempType!='' and record.tempType==0) "> + and tempType = #{record.tempType} + </if> + + </if> </sql> @@ -140,6 +153,10 @@ <if test="_parameter.containsKey('code')"> code = #{code}, </if> + <if test="_parameter.containsKey('temp_type')"> + temp_type = #{tempType}, + </if> + </set> WHERE id=#{id} </update> @@ -167,6 +184,11 @@ <if test="record.code != null and record.code != '' "> code = #{record.code}, </if> + + <if test="record.tempType != null and record.tempType != '' "> + temp_type = #{record.tempType}, + </if> + </set> WHERE id=#{record.id} </update> @@ -198,8 +220,19 @@ <!-- 分页查询 --> <select id="selectInPage" resultMap="ShopWxtemplateMsgMap"> - select - <include refid="columns" ></include> + select + create_by, + create_time, + update_by, + update_time, + id, + name, + uuid, + status, + remark, + company_id, + code, + temp_type from shop_wxtemplate_msg <where> <include refid="where_sql"></include> @@ -248,7 +281,7 @@ select <include refid="columns" ></include> from shop_wxtemplate_msg - where code=#{code} + where code=#{code} and company_id=#{companyId} </select> diff --git a/zq-erp/src/main/resources/mybatis/mybatis-config.xml b/zq-erp/src/main/resources/mybatis/mybatis-config.xml index ac77a00..66fe1b7 100644 --- a/zq-erp/src/main/resources/mybatis/mybatis-config.xml +++ b/zq-erp/src/main/resources/mybatis/mybatis-config.xml @@ -63,5 +63,6 @@ <typeAlias alias="ServicesFlow" type="com.matrix.system.hive.bean.ServicesFlow" /> <typeAlias alias="VipAnswer" type="com.matrix.system.hive.bean.VipAnswer" /> <typeAlias alias="SysWorktime" type="com.matrix.system.hive.bean.SysWorktime" /> + <typeAlias alias="SysOrderFlow" type="com.matrix.system.hive.bean.SysOrderFlow" /> </typeAliases> </configuration> diff --git a/zq-erp/src/main/resources/readme-jyy b/zq-erp/src/main/resources/readme-jyy new file mode 100644 index 0000000..a6787a0 --- /dev/null +++ b/zq-erp/src/main/resources/readme-jyy @@ -0,0 +1,11 @@ +删除 +cardCash +projCash +只留下 +goodsCash +产品现金业绩和划扣业绩consume + +重构订单,收款,退款等方法不要共用逻辑 + +把所有历史订单的订单类型区分销售订单和退款订单 + diff --git a/zq-erp/src/main/resources/static/css/styleOne/style.min.css b/zq-erp/src/main/resources/static/css/styleOne/style.min.css index 5e1b542..31088b3 100644 --- a/zq-erp/src/main/resources/static/css/styleOne/style.min.css +++ b/zq-erp/src/main/resources/static/css/styleOne/style.min.css @@ -9157,4 +9157,10 @@ line-height: 50px; } -/*===========鑷畾涔夋牱寮廵nd==============================*/ \ No newline at end of file +/*===========鑷畾涔夋牱寮廵nd==============================*/ +/** +* 覆盖elementui一些无用样式 +*/ +.el-form-item{ + margin-bottom:10px !important; +} \ No newline at end of file diff --git a/zq-erp/src/main/resources/static/demoPage/soketLoginTest.html b/zq-erp/src/main/resources/static/demoPage/soketLoginTest.html new file mode 100644 index 0000000..0598c8d --- /dev/null +++ b/zq-erp/src/main/resources/static/demoPage/soketLoginTest.html @@ -0,0 +1,138 @@ +<!DOCTYPE html> +<html xmlns:th="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <!-- 启用360浏览器的极速模式(webkit) --> + <meta name="renderer" content="webkit"> + <meta name="viewport" + content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> + <title>soketTest</title> + <link th:href="@{/images/}" + rel="SHORTCUT ICON"> + <meta name="keywords" + content=""/> + <meta name="description" + content=""/> + <style type="text/css"> + .row > div:nth-child(1) { + background: url(../../images/login-title.jpg) no-repeat; + background-size: 100% 100%; + height: 380px; + } + + .row > div:nth-child(2) { + background: #fff; + height: 380px; + } + .download-bar { + margin-top: 15px; + color: #fff; + } + + .download-bar a { + color: #fff; + margin: 0 5px; + } + + .download-bar a:hover { + text-decoration: underline; + color: #fff; + } + </style> + <script> + var isoldIE = false; + if (navigator.userAgent.indexOf("MSIE") > 0) { + if (navigator.userAgent.indexOf("MSIE 6.0") > 0 + || navigator.userAgent.indexOf("MSIE 7.0") > 0 + || avigator.userAgent.indexOf("MSIE 8.0") > 0) { + isoldIE = true; + } + } + if (window.top !== window.self) { + window.top.location = window.location + } + ; + </script> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <link th:href="@{/css/styleOne/login.min.css}" rel="stylesheet"> + +</head> + +<body > +<h3>hello socket</h3> +<p>【sendMsg】:<div><input style="width: 700px;" id="sendMsg" name="sendMsg" type="text" value='{ "webClientId":"123", "loginQrCodeKey":"1231" "appUserId":"1010","msgType":"1","loginOperation":"1"}';></div> +<p> +</p> + + +<p>操作:<div><button onclick="openSocket()">开启socket</button></div> +<p>【操作】:<div><button onclick="sendMessage()">发送消息</button></div> +<p>【操作】:<div><button onclick="colseSocket()">关闭连接</button></div> +</body> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <script> + + var socket; + function openSocket() { + if(typeof(WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + }else{ + console.log("您的浏览器支持WebSocket"); + //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接 + + //var socketUrl="ws://test.hive.jyymatrix.cc/webSocketServer?userId=123"; + var socketUrl="ws://192.168.0.6:8080/webSocketServer?userId=123"; + console.log(socketUrl); + if(socket!=null){ + socket.close(); + socket=null; + } + socket = new WebSocket(socketUrl); + //打开事件 + socket.onopen = function() { + console.log("websocket已打开"); + //socket.send("这是来自客户端的消息" + location.href + new Date()); + }; + //获得消息事件 + socket.onmessage = function(msg) { + console.log("获得消息:"+msg); + var serverMsg = msg.data; + console.log(serverMsg); + + }; + //关闭事件 + socket.onclose = function() { + console.log("websocket已关闭"); + }; + //发生了错误事件 + socket.onerror = function() { + console.log("websocket发生了错误"); + } + } + } + + function sendMessage() { + if(typeof(WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + }else { + // console.log("您的浏览器支持WebSocket"); + var sendMsg = document.getElementById('sendMsg').value; + //var msg = '{ "webClientId":"'+webClientId+'","appUserId":"'+appUserId+'"}'; + console.log("发送消息"+sendMsg); + socket.send(sendMsg); + + } + } + function colseSocket() { + if(typeof(WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + }else { + socket.close(); + } + } + </script> + + +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/static/demoPage/soketTest.html b/zq-erp/src/main/resources/static/demoPage/soketTest.html index 4e4b932..d2f6b24 100644 --- a/zq-erp/src/main/resources/static/demoPage/soketTest.html +++ b/zq-erp/src/main/resources/static/demoPage/soketTest.html @@ -87,7 +87,7 @@ console.log("您的浏览器支持WebSocket"); //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接 var userId = document.getElementById('userId').value; - var socketUrl="ws://192.168.111.175:8091/webSocketServer?userId="+userId; + var socketUrl="ws://localhost:8080/webSocketServer?userId="+userId; console.log(socketUrl); if(socket!=null){ socket.close(); diff --git a/zq-erp/src/main/resources/static/images/dui.png b/zq-erp/src/main/resources/static/images/dui.png new file mode 100644 index 0000000..fa086b7 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/dui.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/line.png b/zq-erp/src/main/resources/static/images/luckyDraw/line.png new file mode 100644 index 0000000..7df2255 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/line.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/oAward.png b/zq-erp/src/main/resources/static/images/luckyDraw/oAward.png new file mode 100644 index 0000000..4e78626 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/oAward.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/sAward.png b/zq-erp/src/main/resources/static/images/luckyDraw/sAward.png new file mode 100644 index 0000000..97f5ab7 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/sAward.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/start.png b/zq-erp/src/main/resources/static/images/luckyDraw/start.png new file mode 100644 index 0000000..2dc6ec6 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/start.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/tAward.png b/zq-erp/src/main/resources/static/images/luckyDraw/tAward.png new file mode 100644 index 0000000..2752767 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/tAward.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/xiexiecanyu.png b/zq-erp/src/main/resources/static/images/luckyDraw/xiexiecanyu.png new file mode 100644 index 0000000..7df35a1 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/xiexiecanyu.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/zhuanpan.png b/zq-erp/src/main/resources/static/images/luckyDraw/zhuanpan.png new file mode 100644 index 0000000..1cbf542 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/zhuanpan.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/luckyDraw/zhuanpanchoujian.png b/zq-erp/src/main/resources/static/images/luckyDraw/zhuanpanchoujian.png new file mode 100644 index 0000000..65b216b --- /dev/null +++ b/zq-erp/src/main/resources/static/images/luckyDraw/zhuanpanchoujian.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pay/card.png b/zq-erp/src/main/resources/static/images/pay/card.png new file mode 100644 index 0000000..5265578 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pay/card.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pay/cash.png b/zq-erp/src/main/resources/static/images/pay/cash.png new file mode 100644 index 0000000..26b92e5 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pay/cash.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pay/qian.png b/zq-erp/src/main/resources/static/images/pay/qian.png new file mode 100644 index 0000000..ab49f33 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pay/qian.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pay/tuan.png b/zq-erp/src/main/resources/static/images/pay/tuan.png new file mode 100644 index 0000000..d4eb1c5 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pay/tuan.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pay/wechat.png b/zq-erp/src/main/resources/static/images/pay/wechat.png new file mode 100644 index 0000000..e7930a7 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pay/wechat.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pay/yinlian.png b/zq-erp/src/main/resources/static/images/pay/yinlian.png new file mode 100644 index 0000000..9a16785 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pay/yinlian.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pay/zhifubao.png b/zq-erp/src/main/resources/static/images/pay/zhifubao.png new file mode 100644 index 0000000..02ce6dd --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pay/zhifubao.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/pc.png b/zq-erp/src/main/resources/static/images/pc.png new file mode 100644 index 0000000..7787899 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/pc.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/qrcode.png b/zq-erp/src/main/resources/static/images/qrcode.png new file mode 100644 index 0000000..1d5d2fc --- /dev/null +++ b/zq-erp/src/main/resources/static/images/qrcode.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/qrcodeBack.png b/zq-erp/src/main/resources/static/images/qrcodeBack.png new file mode 100644 index 0000000..2dd3faf --- /dev/null +++ b/zq-erp/src/main/resources/static/images/qrcodeBack.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/sign/jisumiaosha.png b/zq-erp/src/main/resources/static/images/sign/jisumiaosha.png new file mode 100644 index 0000000..f690d6f --- /dev/null +++ b/zq-erp/src/main/resources/static/images/sign/jisumiaosha.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/sign/meiriqiandao.png b/zq-erp/src/main/resources/static/images/sign/meiriqiandao.png new file mode 100644 index 0000000..b338432 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/sign/meiriqiandao.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/sign/shalonghuodong.png b/zq-erp/src/main/resources/static/images/sign/shalonghuodong.png new file mode 100644 index 0000000..19e4579 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/sign/shalonghuodong.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/sign/signButton.png b/zq-erp/src/main/resources/static/images/sign/signButton.png new file mode 100644 index 0000000..3021259 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/sign/signButton.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/sign/signHead.png b/zq-erp/src/main/resources/static/images/sign/signHead.png new file mode 100644 index 0000000..9e31b32 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/sign/signHead.png Binary files differ diff --git a/zq-erp/src/main/resources/static/images/sign/tiantianpingtuan.png b/zq-erp/src/main/resources/static/images/sign/tiantianpingtuan.png new file mode 100644 index 0000000..83dfcd5 --- /dev/null +++ b/zq-erp/src/main/resources/static/images/sign/tiantianpingtuan.png Binary files differ diff --git a/zq-erp/src/main/resources/static/js/function/vip.js b/zq-erp/src/main/resources/static/js/function/vip.js index 06e6fd5..c0fa8b9 100644 --- a/zq-erp/src/main/resources/static/js/function/vip.js +++ b/zq-erp/src/main/resources/static/js/function/vip.js @@ -73,7 +73,6 @@ $("#levelName").html(loj.getString(0, "vipLevel.levelName")); vipId = loj.getString(0, "id"); - updateHistory(); if (isActive) { $(".isActive").removeAttr("disabled"); isActive = false; @@ -83,25 +82,7 @@ } } -/** - * 更新最近查询客户 - */ -function updateHistory() { - $ - .AjaxProxy() - .invoke( - basePath + "/admin/showHistoryUser", - function (loj) { - var html = ""; - for (var i = 0; i < loj.getRowCount(); i++) { - html += "<li class='list-group-item'onclick='selectHistory(\"" - + loj.getString(i, "phone") - + "\")' >" - + loj.getString(i, "vipName") + "</li>"; - } - $("#historyList").html(html); - }); -} + /* * 点击切换最近查询用户 @@ -125,7 +106,7 @@ title: "修改预约排班", maxmin: true, area: [MUI.SIZE_L, '500px'], - content: [basePath + '/admin/projService/yypb?pageFlae=1&id=' + id] + content: [basePath + '/admin/projService/yypb?pageFlae=2&id=' + id] })); } @@ -222,13 +203,13 @@ } -function openAddService() { +function openAddService(id) { layer.full(layer.open({ type: 2, title: "添加服务单", maxmin: true, area: [MUI.SIZE_L, '500px'], - content: [basePath + '/admin/redirect/hive/beautySalon/servicceAddForm'] + content: [basePath + '/admin/redirect/hive/beautySalon/servicceAddForm?id='+id] })); } diff --git a/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/index.html b/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/index.html index e106d1a..76758d7 100644 --- a/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/index.html +++ b/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/index.html @@ -11,7 +11,7 @@ .iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:nowrap} .iw_poi_content {font:12px arial,sans-serif;overflow:visible;padding-top:4px;white-space:-moz-pre-wrap;word-wrap:break-word} </style> -<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script> +<script type="text/javascript" src="https://api.map.baidu.com/api?key=&v=1.1&services=true"></script> </head> <body onload="initMap();"> diff --git a/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/map.html b/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/map.html index b65ea1d..7029c94 100644 --- a/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/map.html +++ b/zq-erp/src/main/resources/static/js/plugin/kindeditor/plugins/baidumap/map.html @@ -7,7 +7,7 @@ html { height: 100% } body { height: 100%; margin: 0; padding: 0; background-color: #FFF } </style> - <script charset="utf-8" src="http://api.map.baidu.com/api?v=1.3"></script> + <script charset="utf-8" src="https://api.map.baidu.com/api?v=1.3"></script> <script> var map, geocoder; function initialize() { diff --git a/zq-erp/src/main/resources/static/js/plugin/moment.mini.js b/zq-erp/src/main/resources/static/js/plugin/moment.mini.js new file mode 100644 index 0000000..57cd2d4 --- /dev/null +++ b/zq-erp/src/main/resources/static/js/plugin/moment.mini.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function f(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(m(e,t))return;return 1}function r(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){for(var n=[],s=0;s<e.length;++s)n.push(t(e[s],s));return n}function c(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function _(e,t,n,s){return xt(e,t,n,s,!0).utc()}function y(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function g(e){if(null==e._isValid){var t=y(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function w(e){var t=_(NaN);return null!=e?c(y(t),e):y(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var p=f.momentProperties=[],t=!1;function v(e,t){var n,s,i;if(r(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),r(t._i)||(e._i=t._i),r(t._f)||(e._f=t._f),r(t._l)||(e._l=t._l),r(t._strict)||(e._strict=t._strict),r(t._tzm)||(e._tzm=t._tzm),r(t._isUTC)||(e._isUTC=t._isUTC),r(t._offset)||(e._offset=t._offset),r(t._pf)||(e._pf=y(t)),r(t._locale)||(e._locale=t._locale),0<p.length)for(n=0;n<p.length;n++)r(i=t[s=p[n]])||(e[s]=i);return e}function k(e){v(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,f.updateOffset(this),t=!1)}function M(e){return e instanceof k||null!=e&&null!=e._isAMomentObject}function D(e){!1===f.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return c(function(){if(null!=f.deprecationHandler&&f.deprecationHandler(null,i),a){for(var e,t,n=[],s=0;s<arguments.length;s++){if(e="","object"==typeof arguments[s]){for(t in e+="\n["+s+"] ",arguments[0])m(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[s];n.push(e)}D(i+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,S={};function Y(e,t){null!=f.deprecationHandler&&f.deprecationHandler(e,t),S[e]||(D(t),S[e]=!0)}function O(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=c({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},c(s[n],e[n]),c(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=c({},s[n]));return s}function x(e){null!=e&&this.set(e)}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};function T(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,P=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},W={};function C(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(W[e]=i),t&&(W[t[0]]=function(){return T(i.apply(this,arguments),t[1],t[2])}),n&&(W[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function U(e,t){return e.isValid()?(t=H(t,e.localeData()),R[t]=R[t]||function(s){for(var e,i=s.match(N),t=0,r=i.length;t<r;t++)W[i[t]]?i[t]=W[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=O(i[n])?i[n].call(e,s):i[n];return t}}(t),R[t](e)):e.localeData().invalidDate()}function H(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(P.lastIndex=0;0<=n&&P.test(e);)e=e.replace(P,s),P.lastIndex=0,--n;return e}var F={};function L(e,t){var n=e.toLowerCase();F[n]=F[n+"s"]=F[t]=e}function V(e){return"string"==typeof e?F[e]||F[e.toLowerCase()]:void 0}function G(e){var t,n,s={};for(n in e)m(e,n)&&(t=V(n))&&(s[t]=e[n]);return s}var E={};function A(e,t){E[e]=t}function j(e){return e%4==0&&e%100!=0||e%400==0}function I(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Z(e){var t=+e,n=0;return 0!=t&&isFinite(t)&&(n=I(t)),n}function z(t,n){return function(e){return null!=e?(q(this,t,e),f.updateOffset(this,n),this):$(this,t)}}function $(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function q(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&j(e.year())&&1===e.month()&&29===e.date()?(n=Z(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),xe(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var B,J=/\d/,Q=/\d\d/,X=/\d{3}/,K=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,ne=/\d\d\d\d?/,se=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,re=/\d{1,4}/,ae=/[+-]?\d{1,6}/,oe=/\d+/,ue=/[+-]?\d+/,le=/Z|[+-]\d\d:?\d\d/gi,he=/Z|[+-]\d\d(?::?\d\d)?/gi,de=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function ce(e,n,s){B[e]=O(n)?n:function(e,t){return e&&s?s:n}}function fe(e,t){return m(B,e)?B[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}B={};var _e={};function ye(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),h(n)&&(s=function(e,t){t[n]=Z(e)}),t=0;t<e.length;t++)_e[e[t]]=s}function ge(e,i){ye(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var we,pe=0,ve=1,ke=2,Me=3,De=4,Se=5,Ye=6,Oe=7,be=8;function xe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1==s?j(e)?29:28:31-s%7%2}we=Array.prototype.indexOf?Array.prototype.indexOf:function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},C("M",["MM",2],"Mo",function(){return this.month()+1}),C("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),C("MMMM",0,0,function(e){return this.localeData().months(this,e)}),L("month","M"),A("month",8),ce("M",te),ce("MM",te,Q),ce("MMM",function(e,t){return t.monthsShortRegex(e)}),ce("MMMM",function(e,t){return t.monthsRegex(e)}),ye(["M","MM"],function(e,t){t[ve]=Z(e)-1}),ye(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[ve]=i:y(n).invalidMonth=e});var Te="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ne="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Re=de,We=de;function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Z(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),xe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ue(e){return null!=e?(Ce(this,e),f.updateOffset(this,!0),this):$(this,"Month")}function He(){function e(e,t){return t.length-e.length}for(var t,n=[],s=[],i=[],r=0;r<12;r++)t=_([2e3,r]),n.push(this.monthsShort(t,"")),s.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(n.sort(e),s.sort(e),i.sort(e),r=0;r<12;r++)n[r]=me(n[r]),s[r]=me(s[r]);for(r=0;r<24;r++)i[r]=me(i[r]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Fe(e){return j(e)?366:365}C("Y",0,0,function(){var e=this.year();return e<=9999?T(e,4):"+"+e}),C(0,["YY",2],0,function(){return this.year()%100}),C(0,["YYYY",4],0,"year"),C(0,["YYYYY",5],0,"year"),C(0,["YYYYYY",6,!0],0,"year"),L("year","y"),A("year",1),ce("Y",ue),ce("YY",te,Q),ce("YYYY",re,K),ce("YYYYY",ae,ee),ce("YYYYYY",ae,ee),ye(["YYYYY","YYYYYY"],pe),ye("YYYY",function(e,t){t[pe]=2===e.length?f.parseTwoDigitYear(e):Z(e)}),ye("YY",function(e,t){t[pe]=f.parseTwoDigitYear(e)}),ye("Y",function(e,t){t[pe]=parseInt(e,10)}),f.parseTwoDigitYear=function(e){return Z(e)+(68<Z(e)?1900:2e3)};var Le=z("FullYear",!0);function Ve(e){var t,n;return e<100&&0<=e?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ge(e,t,n){var s=7+t-n;return s-(7+Ve(e,0,s).getUTCDay()-t)%7-1}function Ee(e,t,n,s,i){var r,a=1+7*(t-1)+(7+n-s)%7+Ge(e,s,i),o=a<=0?Fe(r=e-1)+a:a>Fe(e)?(r=e+1,a-Fe(e)):(r=e,a);return{year:r,dayOfYear:o}}function Ae(e,t,n){var s,i,r=Ge(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+je(i=e.year()-1,t,n):a>je(e.year(),t,n)?(s=a-je(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function je(e,t,n){var s=Ge(e,t,n),i=Ge(e+1,t,n);return(Fe(e)-s+i)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),A("week",5),A("isoWeek",5),ce("w",te),ce("ww",te,Q),ce("W",te),ce("WW",te,Q),ge(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=Z(e)});function Ie(e,t){return e.slice(t,7).concat(e.slice(0,t))}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),ce("d",te),ce("e",te),ce("E",te),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:y(n).invalidWeekday=e}),ge(["d","e","E"],function(e,t,n,s){t[s]=Z(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$e="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qe=de,Be=de,Je=de;function Qe(){function e(e,t){return t.length-e.length}for(var t,n,s,i,r=[],a=[],o=[],u=[],l=0;l<7;l++)t=_([2e3,1]).day(l),n=me(this.weekdaysMin(t,"")),s=me(this.weekdaysShort(t,"")),i=me(this.weekdays(t,"")),r.push(n),a.push(s),o.push(i),u.push(n),u.push(s),u.push(i);r.sort(e),a.sort(e),o.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,Xe),C("k",["kk",2],0,function(){return this.hours()||24}),C("hmm",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)}),C("hmmss",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),L("hour","h"),A("hour",13),ce("a",et),ce("A",et),ce("H",te),ce("h",te),ce("k",te),ce("HH",te,Q),ce("hh",te,Q),ce("kk",te,Q),ce("hmm",ne),ce("hmmss",se),ce("Hmm",ne),ce("Hmmss",se),ye(["H","HH"],Me),ye(["k","kk"],function(e,t,n){var s=Z(e);t[Me]=24===s?0:s}),ye(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ye(["h","hh"],function(e,t,n){t[Me]=Z(e),y(n).bigHour=!0}),ye("hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s)),y(n).bigHour=!0}),ye("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i)),y(n).bigHour=!0}),ye("Hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s))}),ye("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i))});var tt=z("Hours",!0);var nt,st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:Ne,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=at(e[r]).split("-")).length,n=(n=at(e[r+1]))?n.split("-"):null;0<t;){if(s=ut(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return nt}function ut(t){var e;if(void 0===it[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=nt._abbr,require("./locale/"+t),lt(e)}catch(e){it[t]=null}return it[t]}function lt(e,t){var n;return e&&((n=r(t)?dt(e):ht(e,t))?nt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nt._abbr}function ht(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ut(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new x(b(s,t)),rt[e]&&rt[e].forEach(function(e){ht(e.name,e.config)}),lt(e),it[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nt;if(!o(e)){if(t=ut(e))return t;e=[e]}return ot(e)}function ct(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[ve]<0||11<n[ve]?ve:n[ke]<1||n[ke]>xe(n[pe],n[ve])?ke:n[Me]<0||24<n[Me]||24===n[Me]&&(0!==n[De]||0!==n[Se]||0!==n[Ye])?Me:n[De]<0||59<n[De]?De:n[Se]<0||59<n[Se]?Se:n[Ye]<0||999<n[Ye]?Ye:-1,y(e)._overflowDayOfYear&&(t<pe||ke<t)&&(t=ke),y(e)._overflowWeeks&&-1===t&&(t=Oe),y(e)._overflowWeekday&&-1===t&&(t=be),y(e).overflow=t),e}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wt=/^\/?Date\((-?\d+)/i,pt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function kt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(y(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||" ")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Ot(e)}else e._isValid=!1}function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Ne.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}function Dt(e){var t,n,s,i,r=pt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(r){if(t=Mt(r[4],r[3],r[2],r[5],r[6],r[7]),n=r[1],s=t,i=e,n&&ze.indexOf(n)!==new Date(s[0],s[1],s[2]).getDay()&&(y(i).weekdayMismatch=!0,!void(i._isValid=!1)))return;e._a=t,e._tzm=function(e,t,n){if(e)return vt[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return 60*((s-i)/100)+i}(r[8],r[9],r[10]),e._d=Ve.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),y(e).rfc2822=!0}else e._isValid=!1}function St(e,t,n){return null!=e?e:null!=t?t:n}function Yt(e){var t,n,s,i,r,a,o,u=[];if(!e._d){for(a=e,o=new Date(f.now()),s=a._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()],e._w&&null==e._a[ke]&&null==e._a[ve]&&function(e){var t,n,s,i,r,a,o,u,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,n=St(t.GG,e._a[pe],Ae(Tt(),1,4).year),s=St(t.W,1),((i=St(t.E,1))<1||7<i)&&(u=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,l=Ae(Tt(),r,a),n=St(t.gg,e._a[pe],l.year),s=St(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r);s<1||s>je(n,r,a)?y(e)._overflowWeeks=!0:null!=u?y(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[pe]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=St(e._a[pe],s[pe]),(e._dayOfYear>Fe(r)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=Ve(r,0,e._dayOfYear),e._a[ve]=n.getUTCMonth(),e._a[ke]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=u[t]=s[t];for(;t<7;t++)e._a[t]=u[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Me]&&0===e._a[De]&&0===e._a[Se]&&0===e._a[Ye]&&(e._nextDay=!0,e._a[Me]=0),e._d=(e._useUTC?Ve:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,u),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Me]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function Ot(e){if(e._f!==f.ISO_8601)if(e._f!==f.RFC_2822){e._a=[],y(e).empty=!0;for(var t,n,s,i,r,a,o,u=""+e._i,l=u.length,h=0,d=H(e._f,e._locale).match(N)||[],c=0;c<d.length;c++)n=d[c],(t=(u.match(fe(n,e))||[])[0])&&(0<(s=u.substr(0,u.indexOf(t))).length&&y(e).unusedInput.push(s),u=u.slice(u.indexOf(t)+t.length),h+=t.length),W[n]?(t?y(e).empty=!1:y(e).unusedTokens.push(n),r=n,o=e,null!=(a=t)&&m(_e,r)&&_e[r](a,o._a,o,r)):e._strict&&!t&&y(e).unusedTokens.push(n);y(e).charsLeftOver=l-h,0<u.length&&y(e).unusedInput.push(u),e._a[Me]<=12&&!0===y(e).bigHour&&0<e._a[Me]&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[Me]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[Me],e._meridiem),null!==(i=y(e).era)&&(e._a[pe]=e._locale.erasConvertYear(i,e._a[pe])),Yt(e),ct(e)}else Dt(e);else kt(e)}function bt(e){var t,n,s=e._i,i=e._f;return e._locale=e._locale||dt(e._l),null===s||void 0===i&&""===s?w({nullInput:!0}):("string"==typeof s&&(e._i=s=e._locale.preparse(s)),M(s)?new k(ct(s)):(a(s)?e._d=s:o(i)?function(e){var t,n,s,i,r,a,o=!1;if(0===e._f.length)return y(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,a=!1,t=v({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Ot(t),g(t)&&(a=!0),r+=y(t).charsLeftOver,r+=10*y(t).unusedTokens.length,y(t).score=r,o?r<s&&(s=r,n=t):(null==s||r<s||a)&&(s=r,n=t,a&&(o=!0));c(e,n||t)}(e):i?Ot(e):r(n=(t=e)._i)?t._d=new Date(f.now()):a(n)?t._d=new Date(n.valueOf()):"string"==typeof n?function(e){var t=wt.exec(e._i);null===t?(kt(e),!1===e._isValid&&(delete e._isValid,Dt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:f.createFromInputFallback(e)))):e._d=new Date(+t[1])}(t):o(n)?(t._a=d(n.slice(0),function(e){return parseInt(e,10)}),Yt(t)):u(n)?function(e){var t,n;e._d||(n=void 0===(t=G(e._i)).day?t.date:t.day,e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Yt(e))}(t):h(n)?t._d=new Date(n):f.createFromInputFallback(t),g(e)||(e._d=null),e))}function xt(e,t,n,s,i){var r,a={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&l(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new k(ct(bt(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Tt(e,t,n,s){return xt(e,t,n,s,!1)}f.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),f.ISO_8601=function(){},f.RFC_2822=function(){};var Nt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:w()}),Pt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:w()});function Rt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var t=G(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,h=t.millisecond||0;this._isValid=function(e){var t,n,s=!1;for(t in e)if(m(e,t)&&(-1===we.call(Wt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<Wt.length;++n)if(e[Wt[n]]){if(s)return!1;parseFloat(e[Wt[n]])!==Z(e[Wt[n]])&&(s=!0)}return!0}(t),this._milliseconds=+h+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=dt(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){C(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+T(~~(e/60),2)+n+T(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ce("Z",he),ce("ZZ",he),ye(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vt(he,e)});var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var n,s,i=(t||"").match(e);return null===i?null:0===(s=60*(n=((i[i.length-1]||[])+"").match(Lt)||["-",0,0])[1]+Z(n[2]))?0:"+"===n[0]?s:-s}function Gt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(M(e)||a(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),f.updateOffset(n,!1),n):Tt(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}f.updateOffset=function(){};var jt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,It=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Zt(e,t){var n,s,i,r=e,a=null;return Ut(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:h(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(a=jt.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:Z(a[ke])*n,h:Z(a[Me])*n,m:Z(a[De])*n,s:Z(a[Se])*n,ms:Z(Ht(1e3*a[Ye]))*n}):(a=It.exec(e))?(n="-"===a[1]?-1:1,r={y:zt(a[2],n),M:zt(a[3],n),w:zt(a[4],n),d:zt(a[5],n),h:zt(a[6],n),m:zt(a[7],n),s:zt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=$t(e,t):((n=$t(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ct(r),Ut(e)&&m(e,"_locale")&&(s._locale=e._locale),Ut(e)&&m(e,"_isValid")&&(s._isValid=e._isValid),s}function zt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function $t(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=t-e.clone().add(n.months,"M"),n}function qt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Y(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),Bt(this,Zt(e,t),s),this}}function Bt(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),a=Ht(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,$(e,"Month")+a*n),r&&q(e,"Date",$(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&f.updateOffset(e,r||a))}Zt.fn=Ct.prototype,Zt.invalid=function(){return Zt(NaN)};var Jt=qt(1,"add"),Qt=qt(-1,"subtract");function Xt(e){return"string"==typeof e||e instanceof String}function Kt(e){return M(e)||a(e)||Xt(e)||h(e)||function(t){var e=o(t),n=!1;e&&(n=0===t.filter(function(e){return!h(e)&&Xt(t)}).length);return e&&n}(e)||function(e){var t,n,s=u(e)&&!l(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<r.length;t+=1)n=r[t],i=i||m(e,n);return s&&i}(e)||null==e}function en(e,t){if(e.date()<t.date())return-en(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months"),i=t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s);return-(n+i)||0}function tn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=dt(e))&&(this._locale=t),this)}f.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",f.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var nn=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function sn(){return this._locale}var rn=126227808e5;function an(e,t){return(e%t+t)%t}function on(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-rn:new Date(e,t,n).valueOf()}function un(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-rn:Date.UTC(e,t,n)}function ln(e,t){return t.erasAbbrRegex(e)}function hn(){for(var e=[],t=[],n=[],s=[],i=this.eras(),r=0,a=i.length;r<a;++r)t.push(me(i[r].name)),e.push(me(i[r].abbr)),n.push(me(i[r].narrow)),s.push(me(i[r].name)),s.push(me(i[r].abbr)),s.push(me(i[r].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}function dn(e,t){C(0,[e,e.length],0,t)}function cn(e,t,n,s,i){var r;return null==e?Ae(this,s,i).year:((r=je(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ve(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),ce("N",ln),ce("NN",ln),ce("NNN",ln),ce("NNNN",function(e,t){return t.erasNameRegex(e)}),ce("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),ye(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var i=n._locale.erasParse(e,s,n._strict);i?y(n).era=i:y(n).invalidEra=e}),ce("y",oe),ce("yy",oe),ce("yyy",oe),ce("yyyy",oe),ce("yo",function(e,t){return t._eraYearOrdinalRegex||oe}),ye(["y","yy","yyy","yyyy"],pe),ye(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[pe]=n._locale.eraYearOrdinalParse(e,i):t[pe]=parseInt(e,10)}),C(0,["gg",2],0,function(){return this.weekYear()%100}),C(0,["GG",2],0,function(){return this.isoWeekYear()%100}),dn("gggg","weekYear"),dn("ggggg","weekYear"),dn("GGGG","isoWeekYear"),dn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),A("weekYear",1),A("isoWeekYear",1),ce("G",ue),ce("g",ue),ce("GG",te,Q),ce("gg",te,Q),ce("GGGG",re,K),ce("gggg",re,K),ce("GGGGG",ae,ee),ce("ggggg",ae,ee),ge(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=Z(e)}),ge(["gg","GG"],function(e,t,n,s){t[s]=f.parseTwoDigitYear(e)}),C("Q",0,"Qo","quarter"),L("quarter","Q"),A("quarter",7),ce("Q",J),ye("Q",function(e,t){t[ve]=3*(Z(e)-1)}),C("D",["DD",2],"Do","date"),L("date","D"),A("date",9),ce("D",te),ce("DD",te,Q),ce("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],ke),ye("Do",function(e,t){t[ke]=Z(e.match(te)[0])});var fn=z("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),A("dayOfYear",4),ce("DDD",ie),ce("DDDD",X),ye(["DDD","DDDD"],function(e,t,n){n._dayOfYear=Z(e)}),C("m",["mm",2],0,"minute"),L("minute","m"),A("minute",14),ce("m",te),ce("mm",te,Q),ye(["m","mm"],De);var mn=z("Minutes",!1);C("s",["ss",2],0,"second"),L("second","s"),A("second",15),ce("s",te),ce("ss",te,Q),ye(["s","ss"],Se);var _n,yn,gn=z("Seconds",!1);for(C("S",0,0,function(){return~~(this.millisecond()/100)}),C(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,function(){return 10*this.millisecond()}),C(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),C(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),C(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),C(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),C(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),A("millisecond",16),ce("S",ie,J),ce("SS",ie,Q),ce("SSS",ie,X),_n="SSSS";_n.length<=9;_n+="S")ce(_n,oe);function wn(e,t){t[Ye]=Z(1e3*("0."+e))}for(_n="S";_n.length<=9;_n+="S")ye(_n,wn);yn=z("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");var pn=k.prototype;function vn(e){return e}pn.add=Jt,pn.calendar=function(e,t){1===arguments.length&&(arguments[0]?Kt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=u(e)&&!l(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||m(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var n=e||Tt(),s=Gt(n,this).startOf("day"),i=f.calendarFormat(this,s)||"sameElse",r=t&&(O(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},pn.clone=function(){return new k(this)},pn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=V(t)){case"year":r=en(this,s)/12;break;case"month":r=en(this,s);break;case"quarter":r=en(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:I(r)},pn.endOf=function(e){var t,n;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?un:on,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-an(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-an(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-an(t,1e3)-1;break}return this._d.setTime(t),f.updateOffset(this,!0),this},pn.format=function(e){e=e||(this.isUtc()?f.defaultFormatUtc:f.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},pn.from=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Tt(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.fromNow=function(e){return this.from(Tt(),e)},pn.to=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Tt(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.toNow=function(e){return this.to(Tt(),e)},pn.get=function(e){return O(this[e=V(e)])?this[e]():this},pn.invalidAt=function(){return y(this).overflow},pn.isAfter=function(e,t){var n=M(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},pn.isBefore=function(e,t){var n=M(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},pn.isBetween=function(e,t,n,s){var i=M(e)?e:Tt(e),r=M(t)?t:Tt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&(("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n)))},pn.isSame=function(e,t){var n,s=M(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},pn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},pn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},pn.isValid=function(){return g(this)},pn.lang=nn,pn.locale=tn,pn.localeData=sn,pn.max=Pt,pn.min=Nt,pn.parsingFlags=function(){return c({},y(this))},pn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)m(e,t)&&n.push({unit:t,priority:E[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=G(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(O(this[e=V(e)]))return this[e](t);return this},pn.startOf=function(e){var t,n;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?un:on,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=an(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=an(t,6e4);break;case"second":t=this._d.valueOf(),t-=an(t,1e3);break}return this._d.setTime(t),f.updateOffset(this,!0),this},pn.subtract=Qt,pn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},pn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},pn.toDate=function(){return new Date(this.valueOf())},pn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?U(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(n,"Z")):U(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},pn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,s="moment",i="";return this.isLocal()||(s=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+s+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(pn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),pn.toJSON=function(){return this.isValid()?this.toISOString():null},pn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pn.unix=function(){return Math.floor(this.valueOf()/1e3)},pn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pn.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},pn.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},pn.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},pn.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.clone().startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-f(n[s].since).year())*e+n[s].offset;return this.year()},pn.year=Le,pn.isLeapYear=function(){return j(this.year())},pn.weekYear=function(e){return cn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},pn.isoWeekYear=function(e){return cn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},pn.quarter=pn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},pn.month=Ue,pn.daysInMonth=function(){return xe(this.year(),this.month())},pn.week=pn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},pn.isoWeek=pn.isoWeeks=function(e){var t=Ae(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},pn.weeksInYear=function(){var e=this.localeData()._week;return je(this.year(),e.dow,e.doy)},pn.weeksInWeekYear=function(){var e=this.localeData()._week;return je(this.weekYear(),e.dow,e.doy)},pn.isoWeeksInYear=function(){return je(this.year(),1,4)},pn.isoWeeksInISOWeekYear=function(){return je(this.isoWeekYear(),1,4)},pn.date=fn,pn.day=pn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},pn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},pn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,s=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?s:s-7)},pn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},pn.hour=pn.hours=tt,pn.minute=pn.minutes=mn,pn.second=pn.seconds=gn,pn.millisecond=pn.milliseconds=yn,pn.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(he,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?Bt(this,Zt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,f.updateOffset(this,!0),this._changeInProgress=null)),this},pn.utc=function(e){return this.utcOffset(0,e)},pn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Et(this),"m")),this},pn.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(le,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},pn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},pn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pn.isLocal=function(){return!!this.isValid()&&!this._isUTC},pn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pn.isUtc=At,pn.isUTC=At,pn.zoneAbbr=function(){return this._isUTC?"UTC":""},pn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pn.dates=n("dates accessor is deprecated. Use date instead.",fn),pn.months=n("months accessor is deprecated. Use month instead",Ue),pn.years=n("years accessor is deprecated. Use year instead",Le),pn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),pn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=bt(t))._a?(e=(t._isUTC?_:Tt)(t._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&Z(e[a])!==Z(t[a]))&&r++;return r+i}(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted});var kn=x.prototype;function Mn(e,t,n,s){var i=dt(),r=_().set(s,t);return i[n](r,e)}function Dn(e,t,n){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return Mn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=Mn(e,i,n,"month");return s}function Sn(e,t,n,s){t=("boolean"==typeof e?h(t)&&(n=t,t=void 0):(t=e,e=!1,h(n=t)&&(n=t,t=void 0)),t||"");var i,r=dt(),a=e?r._week.dow:0,o=[];if(null!=n)return Mn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=Mn(t,(i+a)%7,s,"day");return o}kn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return O(s)?s.call(t,n):s},kn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(N).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},kn.invalidDate=function(){return this._invalidDate},kn.ordinal=function(e){return this._ordinal.replace("%d",e)},kn.preparse=vn,kn.postformat=vn,kn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return O(i)?i(e,t,n,s):i.replace(/%d/i,e)},kn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return O(n)?n(t):n.replace(/%s/i,t)},kn.set=function(e){var t,n;for(n in e)m(e,n)&&(O(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},kn.eras=function(e,t){for(var n,s=this._eras||dt("en")._eras,i=0,r=s.length;i<r;++i){switch(typeof s[i].since){case"string":n=f(s[i].since).startOf("day"),s[i].since=n.valueOf();break}switch(typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=f(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf();break}}return s},kn.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s];break}else if(0<=[r,a,o].indexOf(e))return u[s]},kn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?f(e.since).year():f(e.since).year()+(t-e.offset)*n},kn.erasAbbrRegex=function(e){return m(this,"_erasAbbrRegex")||hn.call(this),e?this._erasAbbrRegex:this._erasRegex},kn.erasNameRegex=function(e){return m(this,"_erasNameRegex")||hn.call(this),e?this._erasNameRegex:this._erasRegex},kn.erasNarrowRegex=function(e){return m(this,"_erasNarrowRegex")||hn.call(this),e?this._erasNarrowRegex:this._erasRegex},kn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},kn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},kn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=_([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=we.call(this._shortMonthsParse,a))?i:null:-1!==(i=we.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=we.call(this._shortMonthsParse,a))||-1!==(i=we.call(this._longMonthsParse,a))?i:null:-1!==(i=we.call(this._longMonthsParse,a))||-1!==(i=we.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=_([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},kn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||He.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=We),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},kn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||He.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},kn.week=function(e){return Ae(e,this._week.dow,this._week.doy).week},kn.firstDayOfYear=function(){return this._week.doy},kn.firstDayOfWeek=function(){return this._week.dow},kn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ie(n,this._week.dow):e?n[e.day()]:n},kn.weekdaysMin=function(e){return!0===e?Ie(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},kn.weekdaysShort=function(e){return!0===e?Ie(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},kn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=_([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=we.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=we.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=we.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=we.call(this._weekdaysParse,a))||-1!==(i=we.call(this._shortWeekdaysParse,a))||-1!==(i=we.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=we.call(this._shortWeekdaysParse,a))||-1!==(i=we.call(this._weekdaysParse,a))||-1!==(i=we.call(this._minWeekdaysParse,a))?i:null:-1!==(i=we.call(this._minWeekdaysParse,a))||-1!==(i=we.call(this._weekdaysParse,a))||-1!==(i=we.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=_([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},kn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},kn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Be),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},kn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},kn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},kn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},lt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Z(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),f.lang=n("moment.lang is deprecated. Use moment.locale instead.",lt),f.langData=n("moment.langData is deprecated. Use moment.localeData instead.",dt);var Yn=Math.abs;function On(e,t,n,s){var i=Zt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function bn(e){return e<0?Math.floor(e):Math.ceil(e)}function xn(e){return 4800*e/146097}function Tn(e){return 146097*e/4800}function Nn(e){return function(){return this.as(e)}}var Pn=Nn("ms"),Rn=Nn("s"),Wn=Nn("m"),Cn=Nn("h"),Un=Nn("d"),Hn=Nn("w"),Fn=Nn("M"),Ln=Nn("Q"),Vn=Nn("y");function Gn(e){return function(){return this.isValid()?this._data[e]:NaN}}var En=Gn("milliseconds"),An=Gn("seconds"),jn=Gn("minutes"),In=Gn("hours"),Zn=Gn("days"),zn=Gn("months"),$n=Gn("years");var qn=Math.round,Bn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jn(e,t,n,s){var i=Zt(e).abs(),r=qn(i.as("s")),a=qn(i.as("m")),o=qn(i.as("h")),u=qn(i.as("d")),l=qn(i.as("M")),h=qn(i.as("w")),d=qn(i.as("y")),c=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||a<=1&&["m"]||a<n.m&&["mm",a]||o<=1&&["h"]||o<n.h&&["hh",o]||u<=1&&["d"]||u<n.d&&["dd",u];return null!=n.w&&(c=c||h<=1&&["w"]||h<n.w&&["ww",h]),(c=c||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,c[3]=0<+e,c[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,c)}var Qn=Math.abs;function Xn(e){return(0<e)-(e<0)||+e}function Kn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,s,i,r,a,o,u=Qn(this._milliseconds)/1e3,l=Qn(this._days),h=Qn(this._months),d=this.asSeconds();return d?(e=I(u/60),t=I(e/60),u%=60,e%=60,n=I(h/12),h%=12,s=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",r=Xn(this._months)!==Xn(d)?"-":"",a=Xn(this._days)!==Xn(d)?"-":"",o=Xn(this._milliseconds)!==Xn(d)?"-":"",i+"P"+(n?r+n+"Y":"")+(h?r+h+"M":"")+(l?a+l+"D":"")+(t||e||u?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(u?o+s+"S":"")):"P0D"}var es=Ct.prototype;return es.isValid=function(){return this._isValid},es.abs=function(){var e=this._data;return this._milliseconds=Yn(this._milliseconds),this._days=Yn(this._days),this._months=Yn(this._months),e.milliseconds=Yn(e.milliseconds),e.seconds=Yn(e.seconds),e.minutes=Yn(e.minutes),e.hours=Yn(e.hours),e.months=Yn(e.months),e.years=Yn(e.years),this},es.add=function(e,t){return On(this,e,t,1)},es.subtract=function(e,t){return On(this,e,t,-1)},es.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=V(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+xn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},es.asMilliseconds=Pn,es.asSeconds=Rn,es.asMinutes=Wn,es.asHours=Cn,es.asDays=Un,es.asWeeks=Hn,es.asMonths=Fn,es.asQuarters=Ln,es.asYears=Vn,es.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Z(this._months/12):NaN},es._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*bn(Tn(o)+a),o=a=0),u.milliseconds=r%1e3,e=I(r/1e3),u.seconds=e%60,t=I(e/60),u.minutes=t%60,n=I(t/60),u.hours=n%24,a+=I(n/24),o+=i=I(xn(a)),a-=bn(Tn(i)),s=I(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},es.clone=function(){return Zt(this)},es.get=function(e){return e=V(e),this.isValid()?this[e+"s"]():NaN},es.milliseconds=En,es.seconds=An,es.minutes=jn,es.hours=In,es.days=Zn,es.weeks=function(){return I(this.days()/7)},es.months=zn,es.years=$n,es.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,s,i=!1,r=Bn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(r=Object.assign({},Bn,t),null!=t.s&&null==t.ss&&(r.ss=t.s-1)),n=this.localeData(),s=Jn(this,!i,r,n),i&&(s=n.pastFuture(+this,s)),n.postformat(s)},es.toISOString=Kn,es.toString=Kn,es.toJSON=Kn,es.locale=tn,es.localeData=sn,es.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Kn),es.lang=nn,C("X",0,0,"unix"),C("x",0,0,"valueOf"),ce("x",ue),ce("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),ye("x",function(e,t,n){n._d=new Date(Z(e))}),f.version="2.29.1",e=Tt,f.fn=pn,f.min=function(){return Rt("isBefore",[].slice.call(arguments,0))},f.max=function(){return Rt("isAfter",[].slice.call(arguments,0))},f.now=function(){return Date.now?Date.now():+new Date},f.utc=_,f.unix=function(e){return Tt(1e3*e)},f.months=function(e,t){return Dn(e,t,"months")},f.isDate=a,f.locale=lt,f.invalid=w,f.duration=Zt,f.isMoment=M,f.weekdays=function(e,t,n){return Sn(e,t,n,"weekdays")},f.parseZone=function(){return Tt.apply(null,arguments).parseZone()},f.localeData=dt,f.isDuration=Ut,f.monthsShort=function(e,t){return Dn(e,t,"monthsShort")},f.weekdaysMin=function(e,t,n){return Sn(e,t,n,"weekdaysMin")},f.defineLocale=ht,f.updateLocale=function(e,t){var n,s,i;return null!=t?(i=st,null!=it[e]&&null!=it[e].parentLocale?it[e].set(b(it[e]._config,t)):(null!=(s=ut(e))&&(i=s._config),t=b(i,t),null==s&&(t.abbr=e),(n=new x(t)).parentLocale=it[e],it[e]=n),lt(e)):null!=it[e]&&(null!=it[e].parentLocale?(it[e]=it[e].parentLocale,e===lt()&<(e)):null!=it[e]&&delete it[e]),it[e]},f.locales=function(){return s(it)},f.weekdaysShort=function(e,t,n){return Sn(e,t,n,"weekdaysShort")},f.normalizeUnits=V,f.relativeTimeRounding=function(e){return void 0===e?qn:"function"==typeof e&&(qn=e,!0)},f.relativeTimeThreshold=function(e,t){return void 0!==Bn[e]&&(void 0===t?Bn[e]:(Bn[e]=t,"s"===e&&(Bn.ss=t-1),!0))},f.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},f.prototype=pn,f.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},f}); +//# sourceMappingURL=moment.min.js.map \ No newline at end of file diff --git a/zq-erp/src/main/resources/static/js/plugin/qrcode.js b/zq-erp/src/main/resources/static/js/plugin/qrcode.js new file mode 100644 index 0000000..1b31fb1 --- /dev/null +++ b/zq-erp/src/main/resources/static/js/plugin/qrcode.js @@ -0,0 +1,614 @@ +/** + * @fileoverview + * - Using the 'QRCode for Javascript library' + * - Fixed dataset of 'QRCode for Javascript library' for support full-spec. + * - this library has no dependencies. + * + * @author davidshimjs + * @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> + * @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> + */ +var QRCode; + +(function () { + //--------------------------------------------------------------------- + // QRCode for JavaScript + // + // Copyright (c) 2009 Kazuhiko Arase + // + // URL: http://www.d-project.com/ + // + // Licensed under the MIT license: + // http://www.opensource.org/licenses/mit-license.php + // + // The word "QR Code" is registered trademark of + // DENSO WAVE INCORPORATED + // http://www.denso-wave.com/qrcode/faqpatent-e.html + // + //--------------------------------------------------------------------- + function QR8bitByte(data) { + this.mode = QRMode.MODE_8BIT_BYTE; + this.data = data; + this.parsedData = []; + + // Added to support UTF-8 Characters + for (var i = 0, l = this.data.length; i < l; i++) { + var byteArray = []; + var code = this.data.charCodeAt(i); + + if (code > 0x10000) { + byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18); + byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12); + byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6); + byteArray[3] = 0x80 | (code & 0x3F); + } else if (code > 0x800) { + byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12); + byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6); + byteArray[2] = 0x80 | (code & 0x3F); + } else if (code > 0x80) { + byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6); + byteArray[1] = 0x80 | (code & 0x3F); + } else { + byteArray[0] = code; + } + + this.parsedData.push(byteArray); + } + + this.parsedData = Array.prototype.concat.apply([], this.parsedData); + + if (this.parsedData.length != this.data.length) { + this.parsedData.unshift(191); + this.parsedData.unshift(187); + this.parsedData.unshift(239); + } + } + + QR8bitByte.prototype = { + getLength: function (buffer) { + return this.parsedData.length; + }, + write: function (buffer) { + for (var i = 0, l = this.parsedData.length; i < l; i++) { + buffer.put(this.parsedData[i], 8); + } + } + }; + + function QRCodeModel(typeNumber, errorCorrectLevel) { + this.typeNumber = typeNumber; + this.errorCorrectLevel = errorCorrectLevel; + this.modules = null; + this.moduleCount = 0; + this.dataCache = null; + this.dataList = []; + } + + QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);} + return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=new Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++){this.modules[row][col]=null;}} + this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(test,maskPattern);if(this.typeNumber>=7){this.setupTypeNumber(test);} + if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);} + this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}} + return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs;var dark=this.modules[row][col];if(dark){qr_mc.beginFill(0,100);qr_mc.moveTo(x,y);qr_mc.lineTo(x+cs,y);qr_mc.lineTo(x+cs,y+cs);qr_mc.lineTo(x,y+cs);qr_mc.endFill();}}} + return qr_mc;},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!=null){continue;} + this.modules[r][6]=(r%2==0);} + for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!=null){continue;} + this.modules[6][c]=(c%2==0);}},setupPositionAdjustPattern:function(){var pos=QRUtil.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++){for(var j=0;j<pos.length;j++){var row=pos[i];var col=pos[j];if(this.modules[row][col]!=null){continue;} + for(var r=-2;r<=2;r++){for(var c=-2;c<=2;c++){if(r==-2||r==2||c==-2||c==2||(r==0&&c==0)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}}}},setupTypeNumber:function(test){var bits=QRUtil.getBCHTypeNumber(this.typeNumber);for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;} + for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}} + for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}} + this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex<data.length){dark=(((data[byteIndex]>>>bitIndex)&1)==1);} + var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;} + this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}} + row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4);buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber));data.write(buffer);} + var totalDataCount=0;for(var i=0;i<rsBlocks.length;i++){totalDataCount+=rsBlocks[i].dataCount;} + if(buffer.getLengthInBits()>totalDataCount*8){throw new Error("code length overflow. (" + +buffer.getLengthInBits() + +">" + +totalDataCount*8 + +")");} + if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);} + while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);} + while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;} + buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;} + buffer.put(QRCodeModel.PAD1,8);} + return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount;var ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount);maxEcCount=Math.max(maxEcCount,ecCount);dcdata[r]=new Array(dcCount);for(var i=0;i<dcdata[r].length;i++){dcdata[r][i]=0xff&buffer.buffer[i+offset];} + offset+=dcCount;var rsPoly=QRUtil.getErrorCorrectPolynomial(ecCount);var rawPoly=new QRPolynomial(dcdata[r],rsPoly.getLength()-1);var modPoly=rawPoly.mod(rsPoly);ecdata[r]=new Array(rsPoly.getLength()-1);for(var i=0;i<ecdata[r].length;i++){var modIndex=i+modPoly.getLength()-ecdata[r].length;ecdata[r][i]=(modIndex>=0)?modPoly.get(modIndex):0;}} + var totalCodeCount=0;for(var i=0;i<rsBlocks.length;i++){totalCodeCount+=rsBlocks[i].totalCount;} + var data=new Array(totalCodeCount);var index=0;for(var i=0;i<maxDcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<dcdata[r].length){data[index++]=dcdata[r][i];}}} + for(var i=0;i<maxEcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<ecdata[r].length){data[index++]=ecdata[r][i];}}} + return data;};var QRMode={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3};var QRErrorCorrectLevel={L:1,M:0,Q:3,H:2};var QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:(1<<10)|(1<<8)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0),G18:(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<5)|(1<<2)|(1<<0),G15_MASK:(1<<14)|(1<<12)|(1<<10)|(1<<4)|(1<<1),getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));} + return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));} + return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;} + return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i<errorCorrectLength;i++){a=a.multiply(new QRPolynomial([1,QRMath.gexp(i)],0));} + return a;},getLengthInBits:function(mode,type){if(1<=type&&type<10){switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw new Error("mode:"+mode);}}else if(type<27){switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw new Error("mode:"+mode);}}else if(type<41){switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw new Error("mode:"+mode);}}else{throw new Error("type:"+type);}},getLostPoint:function(qrCode){var moduleCount=qrCode.getModuleCount();var lostPoint=0;for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount;col++){var sameCount=0;var dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r){continue;} + for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c){continue;} + if(r==0&&c==0){continue;} + if(dark==qrCode.isDark(row+r,col+c)){sameCount++;}}} + if(sameCount>5){lostPoint+=(3+sameCount-5);}}} + for(var row=0;row<moduleCount-1;row++){for(var col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count==0||count==4){lostPoint+=3;}}} + for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount-6;col++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6)){lostPoint+=40;}}} + for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount-6;row++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col)){lostPoint+=40;}}} + var darkCount=0;for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount;row++){if(qrCode.isDark(row,col)){darkCount++;}}} + var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;lostPoint+=ratio*10;return lostPoint;}};var QRMath={glog:function(n){if(n<1){throw new Error("glog("+n+")");} + return QRMath.LOG_TABLE[n];},gexp:function(n){while(n<0){n+=255;} + while(n>=256){n-=255;} + return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<<i;} + for(var i=8;i<256;i++){QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];} + for(var i=0;i<255;i++){QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;} + function QRPolynomial(num,shift){if(num.length==undefined){throw new Error(num.length+"/"+shift);} + var offset=0;while(offset<num.length&&num[offset]==0){offset++;} + this.num=new Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++){this.num[i]=num[i+offset];}} + QRPolynomial.prototype={get:function(index){return this.num[index];},getLength:function(){return this.num.length;},multiply:function(e){var num=new Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++){for(var j=0;j<e.getLength();j++){num[i+j]^=QRMath.gexp(QRMath.glog(this.get(i))+QRMath.glog(e.get(j)));}} + return new QRPolynomial(num,0);},mod:function(e){if(this.getLength()-e.getLength()<0){return this;} + var ratio=QRMath.glog(this.get(0))-QRMath.glog(e.get(0));var num=new Array(this.getLength());for(var i=0;i<this.getLength();i++){num[i]=this.get(i);} + for(var i=0;i<e.getLength();i++){num[i]^=QRMath.gexp(QRMath.glog(e.get(i))+ratio);} + return new QRPolynomial(num,0).mod(e);}};function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this.dataCount=dataCount;} + QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock==undefined){throw new Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);} + var length=rsBlock.length/3;var list=[];for(var i=0;i<length;i++){var count=rsBlock[i*3+0];var totalCount=rsBlock[i*3+1];var dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++){list.push(new QRRSBlock(totalCount,dataCount));}} + return list;};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return undefined;}};function QRBitBuffer(){this.buffer=[];this.length=0;} + QRBitBuffer.prototype={get:function(index){var bufIndex=Math.floor(index/8);return((this.buffer[bufIndex]>>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i<length;i++){this.putBit(((num>>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);} + if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));} + this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]; + + function _isSupportCanvas() { + return typeof CanvasRenderingContext2D != "undefined"; + } + + // android 2.x doesn't support Data-URI spec + function _getAndroid() { + var android = false; + var sAgent = navigator.userAgent; + + if (/android/i.test(sAgent)) { // android + android = true; + var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i); + + if (aMat && aMat[1]) { + android = parseFloat(aMat[1]); + } + } + + return android; + } + + var svgDrawer = (function() { + + var Drawing = function (el, htOption) { + this._el = el; + this._htOption = htOption; + }; + + Drawing.prototype.draw = function (oQRCode) { + var _htOption = this._htOption; + var _el = this._el; + var nCount = oQRCode.getModuleCount(); + var nWidth = Math.floor(_htOption.width / nCount); + var nHeight = Math.floor(_htOption.height / nCount); + + this.clear(); + + function makeSVG(tag, attrs) { + var el = document.createElementNS('http://www.w3.org/2000/svg', tag); + for (var k in attrs) + if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]); + return el; + } + + var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight}); + svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); + _el.appendChild(svg); + + svg.appendChild(makeSVG("rect", {"fill": _htOption.colorLight, "width": "100%", "height": "100%"})); + svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"})); + + for (var row = 0; row < nCount; row++) { + for (var col = 0; col < nCount; col++) { + if (oQRCode.isDark(row, col)) { + var child = makeSVG("use", {"x": String(col), "y": String(row)}); + child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template") + svg.appendChild(child); + } + } + } + }; + Drawing.prototype.clear = function () { + while (this._el.hasChildNodes()) + this._el.removeChild(this._el.lastChild); + }; + return Drawing; + })(); + + var useSVG = document.documentElement.tagName.toLowerCase() === "svg"; + + // Drawing in DOM by using Table tag + var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () { + var Drawing = function (el, htOption) { + this._el = el; + this._htOption = htOption; + }; + + /** + * Draw the QRCode + * + * @param {QRCode} oQRCode + */ + Drawing.prototype.draw = function (oQRCode) { + var _htOption = this._htOption; + var _el = this._el; + var nCount = oQRCode.getModuleCount(); + var nWidth = Math.floor(_htOption.width / nCount); + var nHeight = Math.floor(_htOption.height / nCount); + var aHTML = ['<table style="border:0;border-collapse:collapse;">']; + + for (var row = 0; row < nCount; row++) { + aHTML.push('<tr>'); + + for (var col = 0; col < nCount; col++) { + aHTML.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (oQRCode.isDark(row, col) ? _htOption.colorDark : _htOption.colorLight) + ';"></td>'); + } + + aHTML.push('</tr>'); + } + + aHTML.push('</table>'); + _el.innerHTML = aHTML.join(''); + + // Fix the margin values as real size. + var elTable = _el.childNodes[0]; + var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2; + var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2; + + if (nLeftMarginTable > 0 && nTopMarginTable > 0) { + elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px"; + } + }; + + /** + * Clear the QRCode + */ + Drawing.prototype.clear = function () { + this._el.innerHTML = ''; + }; + + return Drawing; + })() : (function () { // Drawing in Canvas + function _onMakeImage() { + this._elImage.src = this._elCanvas.toDataURL("image/png"); + this._elImage.style.display = "block"; + this._elCanvas.style.display = "none"; + } + + // Android 2.1 bug workaround + // http://code.google.com/p/android/issues/detail?id=5141 + if (this._android && this._android <= 2.1) { + var factor = 1 / window.devicePixelRatio; + var drawImage = CanvasRenderingContext2D.prototype.drawImage; + CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) { + if (("nodeName" in image) && /img/i.test(image.nodeName)) { + for (var i = arguments.length - 1; i >= 1; i--) { + arguments[i] = arguments[i] * factor; + } + } else if (typeof dw == "undefined") { + arguments[1] *= factor; + arguments[2] *= factor; + arguments[3] *= factor; + arguments[4] *= factor; + } + + drawImage.apply(this, arguments); + }; + } + + /** + * Check whether the user's browser supports Data URI or not + * + * @private + * @param {Function} fSuccess Occurs if it supports Data URI + * @param {Function} fFail Occurs if it doesn't support Data URI + */ + function _safeSetDataURI(fSuccess, fFail) { + var self = this; + self._fFail = fFail; + self._fSuccess = fSuccess; + + // Check it just once + if (self._bSupportDataURI === null) { + var el = document.createElement("img"); + var fOnError = function() { + self._bSupportDataURI = false; + + if (self._fFail) { + self._fFail.call(self); + } + }; + var fOnSuccess = function() { + self._bSupportDataURI = true; + + if (self._fSuccess) { + self._fSuccess.call(self); + } + }; + + el.onabort = fOnError; + el.onerror = fOnError; + el.onload = fOnSuccess; + el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data. + return; + } else if (self._bSupportDataURI === true && self._fSuccess) { + self._fSuccess.call(self); + } else if (self._bSupportDataURI === false && self._fFail) { + self._fFail.call(self); + } + }; + + /** + * Drawing QRCode by using canvas + * + * @constructor + * @param {HTMLElement} el + * @param {Object} htOption QRCode Options + */ + var Drawing = function (el, htOption) { + this._bIsPainted = false; + this._android = _getAndroid(); + + this._htOption = htOption; + this._elCanvas = document.createElement("canvas"); + this._elCanvas.width = htOption.width; + this._elCanvas.height = htOption.height; + el.appendChild(this._elCanvas); + this._el = el; + this._oContext = this._elCanvas.getContext("2d"); + this._bIsPainted = false; + this._elImage = document.createElement("img"); + this._elImage.alt = "Scan me!"; + this._elImage.style.display = "none"; + this._el.appendChild(this._elImage); + this._bSupportDataURI = null; + }; + + /** + * Draw the QRCode + * + * @param {QRCode} oQRCode + */ + Drawing.prototype.draw = function (oQRCode) { + var _elImage = this._elImage; + var _oContext = this._oContext; + var _htOption = this._htOption; + + var nCount = oQRCode.getModuleCount(); + var nWidth = _htOption.width / nCount; + var nHeight = _htOption.height / nCount; + var nRoundedWidth = Math.round(nWidth); + var nRoundedHeight = Math.round(nHeight); + + _elImage.style.display = "none"; + this.clear(); + + for (var row = 0; row < nCount; row++) { + for (var col = 0; col < nCount; col++) { + var bIsDark = oQRCode.isDark(row, col); + var nLeft = col * nWidth; + var nTop = row * nHeight; + _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; + _oContext.lineWidth = 1; + _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; + _oContext.fillRect(nLeft, nTop, nWidth, nHeight); + + // 안티 앨리어싱 방지 처리 + _oContext.strokeRect( + Math.floor(nLeft) + 0.5, + Math.floor(nTop) + 0.5, + nRoundedWidth, + nRoundedHeight + ); + + _oContext.strokeRect( + Math.ceil(nLeft) - 0.5, + Math.ceil(nTop) - 0.5, + nRoundedWidth, + nRoundedHeight + ); + } + } + + this._bIsPainted = true; + }; + + /** + * Make the image from Canvas if the browser supports Data URI. + */ + Drawing.prototype.makeImage = function () { + if (this._bIsPainted) { + _safeSetDataURI.call(this, _onMakeImage); + } + }; + + /** + * Return whether the QRCode is painted or not + * + * @return {Boolean} + */ + Drawing.prototype.isPainted = function () { + return this._bIsPainted; + }; + + /** + * Clear the QRCode + */ + Drawing.prototype.clear = function () { + this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height); + this._bIsPainted = false; + }; + + /** + * @private + * @param {Number} nNumber + */ + Drawing.prototype.round = function (nNumber) { + if (!nNumber) { + return nNumber; + } + + return Math.floor(nNumber * 1000) / 1000; + }; + + return Drawing; + })(); + + /** + * Get the type by string length + * + * @private + * @param {String} sText + * @param {Number} nCorrectLevel + * @return {Number} type + */ + function _getTypeNumber(sText, nCorrectLevel) { + var nType = 1; + var length = _getUTF8Length(sText); + + for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) { + var nLimit = 0; + + switch (nCorrectLevel) { + case QRErrorCorrectLevel.L : + nLimit = QRCodeLimitLength[i][0]; + break; + case QRErrorCorrectLevel.M : + nLimit = QRCodeLimitLength[i][1]; + break; + case QRErrorCorrectLevel.Q : + nLimit = QRCodeLimitLength[i][2]; + break; + case QRErrorCorrectLevel.H : + nLimit = QRCodeLimitLength[i][3]; + break; + } + + if (length <= nLimit) { + break; + } else { + nType++; + } + } + + if (nType > QRCodeLimitLength.length) { + throw new Error("Too long data"); + } + + return nType; + } + + function _getUTF8Length(sText) { + var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a'); + return replacedText.length + (replacedText.length != sText ? 3 : 0); + } + + /** + * @class QRCode + * @constructor + * @example + * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie"); + * + * @example + * var oQRCode = new QRCode("test", { + * text : "http://naver.com", + * width : 128, + * height : 128 + * }); + * + * oQRCode.clear(); // Clear the QRCode. + * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode. + * + * @param {HTMLElement|String} el target element or 'id' attribute of element. + * @param {Object|String} vOption + * @param {String} vOption.text QRCode link data + * @param {Number} [vOption.width=256] + * @param {Number} [vOption.height=256] + * @param {String} [vOption.colorDark="#000000"] + * @param {String} [vOption.colorLight="#ffffff"] + * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] + */ + QRCode = function (el, vOption) { + this._htOption = { + width : 256, + height : 256, + typeNumber : 4, + colorDark : "#000000", + colorLight : "#ffffff", + correctLevel : QRErrorCorrectLevel.H + }; + + if (typeof vOption === 'string') { + vOption = { + text : vOption + }; + } + + // Overwrites options + if (vOption) { + for (var i in vOption) { + this._htOption[i] = vOption[i]; + } + } + + if (typeof el == "string") { + el = document.getElementById(el); + } + + if (this._htOption.useSVG) { + Drawing = svgDrawer; + } + + this._android = _getAndroid(); + this._el = el; + this._oQRCode = null; + this._oDrawing = new Drawing(this._el, this._htOption); + + if (this._htOption.text) { + this.makeCode(this._htOption.text); + } + }; + + /** + * Make the QRCode + * + * @param {String} sText link data + */ + QRCode.prototype.makeCode = function (sText) { + this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel); + this._oQRCode.addData(sText); + this._oQRCode.make(); + this._el.title = sText; + this._oDrawing.draw(this._oQRCode); + this.makeImage(); + }; + + /** + * Make the Image from Canvas element + * - It occurs automatically + * - Android below 3 doesn't support Data-URI spec. + * + * @private + */ + QRCode.prototype.makeImage = function () { + if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { + this._oDrawing.makeImage(); + } + }; + + /** + * Clear the QRCode + */ + QRCode.prototype.clear = function () { + this._oDrawing.clear(); + }; + + /** + * @name QRCode.CorrectLevel + */ + QRCode.CorrectLevel = QRErrorCorrectLevel; +})(); diff --git a/zq-erp/src/main/resources/static/js/systools/AjaxProxyVue.js b/zq-erp/src/main/resources/static/js/systools/AjaxProxyVue.js index b11d542..878dd39 100644 --- a/zq-erp/src/main/resources/static/js/systools/AjaxProxyVue.js +++ b/zq-erp/src/main/resources/static/js/systools/AjaxProxyVue.js @@ -121,6 +121,10 @@ var MTools = { + closeIframe: function () { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + /** 返回一个随机字符串 */ uuid : function() { @@ -240,7 +244,16 @@ return root.children; }, - + /** json对象转Url参数**/ + jsonToUrlParam:function(obj){ + let str=""; + for(item in obj){ + if(obj[item]){ + str+=item+"="+obj[item]+"&" + } + } + return str; + } diff --git a/zq-erp/src/main/resources/static/js/systools/MBase.js b/zq-erp/src/main/resources/static/js/systools/MBase.js index d754c18..648d3ef 100644 --- a/zq-erp/src/main/resources/static/js/systools/MBase.js +++ b/zq-erp/src/main/resources/static/js/systools/MBase.js @@ -5,9 +5,16 @@ */ function getRootPath() { var curWwwPath = window.document.location.href; - console.log(curWwwPath); + let url=""; var pathName = window.document.location.pathname; - var url=curWwwPath.substring(0, curWwwPath.indexOf(pathName)); + if(pathName&&pathName!="/"){ + url= curWwwPath.substring(0, curWwwPath.indexOf(pathName)); + }else{ + url= curWwwPath; + } + console.log(url); + return url; + // if(url.indexOf('localhost')>0){ // return url++- pathName.substring(0, pathName.substr(1).indexOf('/') + 1); // console.log("1"+url); @@ -16,7 +23,7 @@ // return url+ pathName.substring(0, pathName.substr(1).indexOf('/') + 1); // console.log("2"+url); // } - return url; + } /** 全局路径,代表当前网站的根URL */ var basePath = getRootPath(); diff --git a/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/map.html b/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/map.html index 8bf8afe..f457982 100644 --- a/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/map.html +++ b/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/map.html @@ -4,7 +4,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script type="text/javascript" src="../internal.js"></script> - <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.1&services=true"></script> + <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.1&services=true"></script> <style type="text/css"> .content{width:530px; height: 350px;margin: 10px auto;} .content table{width: 100%} diff --git a/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/show.html b/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/show.html index 329cfeb..929fdd8 100644 --- a/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/show.html +++ b/zq-erp/src/main/resources/static/plugin/beditor/dialogs/map/show.html @@ -14,7 +14,7 @@ overflow: hidden; } </style> - <script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script> + <script type="text/javascript" src="https://api.map.baidu.com/api?key=&v=1.1&services=true"></script> </head> <body onload="initMap();"> diff --git a/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/index.html b/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/index.html index 313bc61..664bc4b 100644 --- a/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/index.html +++ b/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/index.html @@ -12,7 +12,7 @@ .iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:nowrap} .iw_poi_content {font:12px arial,sans-serif;overflow:visible;padding-top:4px;white-space:-moz-pre-wrap;word-wrap:break-word} </style> -<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script> +<script type="text/javascript" src="https://api.map.baidu.com/api?key=&v=1.1&services=true"></script> </head> <body onload="initMap();"> diff --git a/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/map.html b/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/map.html index b65ea1d..7029c94 100644 --- a/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/map.html +++ b/zq-erp/src/main/resources/static/plugin/kindeditor/plugins/baidumap/map.html @@ -7,7 +7,7 @@ html { height: 100% } body { height: 100%; margin: 0; padding: 0; background-color: #FFF } </style> - <script charset="utf-8" src="http://api.map.baidu.com/api?v=1.3"></script> + <script charset="utf-8" src="https://api.map.baidu.com/api?v=1.3"></script> <script> var map, geocoder; function initialize() { diff --git a/zq-erp/src/main/resources/static/templates/logisticsImport.xls b/zq-erp/src/main/resources/static/templates/logisticsImport.xls new file mode 100644 index 0000000..4e7e566 --- /dev/null +++ b/zq-erp/src/main/resources/static/templates/logisticsImport.xls Binary files differ diff --git a/zq-erp/src/main/resources/static/templates/vipInfoImport.xls b/zq-erp/src/main/resources/static/templates/vipInfoImport.xls index 1f0f4c4..78f4a0b 100644 --- a/zq-erp/src/main/resources/static/templates/vipInfoImport.xls +++ b/zq-erp/src/main/resources/static/templates/vipInfoImport.xls Binary files differ diff --git a/zq-erp/src/main/resources/static/templates/vipProjUse.xls b/zq-erp/src/main/resources/static/templates/vipProjUse.xls index 46f3c7d..5f99c4d 100644 --- a/zq-erp/src/main/resources/static/templates/vipProjUse.xls +++ b/zq-erp/src/main/resources/static/templates/vipProjUse.xls Binary files differ diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html new file mode 100644 index 0000000..1054379 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html @@ -0,0 +1,560 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + .panel-body{ + overflow: hidden; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-row> + <el-row justify="space-between" type="flex"> + <el-col> + <el-form ref="form" :model="form" inline > + <el-form-item prop="hdmc" > + <el-input v-model="form.hdmc" placeholder="活动名称"></el-input> + </el-form-item> + <el-form-item label="活动状态" prop="hdzt"> + <el-select v-model="form.hdzt" placeholder="活动状态"> + <el-option + v-for="item in hdztList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + <el-button type="primary" @click="searchFormActivitys" >搜索</el-button> + <el-button @click="resetFormActivitys('form')">重置</el-button> + </el-form> + </el-col> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="activitysList.rows" + :height="height" + stripe:true + @sort-change="sortChange" + @selection-change="handleSelectionChange"> + <el-table-column + type="selection"> + </el-table-column> + <el-table-column + prop="actName" + label="活动名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="actCode" + label="活动编号" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="活动类型"> + <template slot-scope="scope"> + <span v-if="scope.row.actType == 1">团购</span> + <span v-if="scope.row.actType == 2">秒杀</span> + <span v-if="scope.row.actType == 3">沙龙</span> + <span v-if="scope.row.actType == 4">每日签到</span> + <span v-if="scope.row.actType == 5">转盘抽奖</span> + </template> + </el-table-column> + <el-table-column + label="状态"> + <template slot-scope="scope"> + + <div v-if="scope.row.actType == 4 || scope.row.actType == 5"> + <span v-if="scope.row.actStatus == 1">未发布</span> + </div> + <div v-if="scope.row.actType != 4 && scope.row.actType != 5"> + <span v-if="scope.row.actStatus == 1">开启</span> + </div> + <div v-if="scope.row.actType == 4 || scope.row.actType == 5"> + <span v-if="scope.row.actStatus == 2">未开始</span> + </div> + <div v-if="scope.row.actType != 4 && scope.row.actType != 5"> + <span v-if="scope.row.actStatus == 2">关闭</span> + </div> + <span v-if="scope.row.actStatus == 3">进行中</span> + <span v-if="scope.row.actStatus == 4">已结束</span> + <span v-if="scope.row.actStatus == 5">已删除</span> + </template> + </el-table-column> + <el-table-column + prop="actBeginTime" + label="开始时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="actEndTime" + label="结束时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="createBy" + label="创建人" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="actRemark" + label="备注" + show-overflow-tooltip> + </el-table-column> + <el-table-column label="操作" width="400"> + <template slot-scope="scope"> + <el-row style="display:flex;" v-if="[4].includes(scope.row.actType)"> + <el-button type="primary" v-if="scope.row.actStatus == 1" size="mini" @click="beReady(scope.row)">发布</el-button> + <el-button type="primary" v-if="[1,2,3].includes(scope.row.actStatus)" @click="beUpdate(scope.row)" size="mini">修改</el-button> + <el-button type="primary" v-if="scope.row.actStatus == 3" size="mini">推广</el-button> + <el-button type="primary" v-if="[3,4,5].includes(scope.row.actStatus)" @click="openSignReceive(scope.row)" size="mini">活动统计</el-button> + <el-button type="primary" v-if="scope.row.actStatus == 3" @click="beClose(scope.row)" size="mini">关闭</el-button> + <el-button type="danger" v-if="scope.row.actStatus != 5" size="mini" @click="delRow(scope.row)">删除</el-button> + </el-row> + <el-row style="display:flex;" v-if="[5].includes(scope.row.actType)"> + <el-button type="primary" v-if="scope.row.actStatus == 1" size="mini" @click="beReady(scope.row)">发布</el-button> + <el-button type="primary" v-if="[1,2,3].includes(scope.row.actStatus)" @click="beUpdateLuckdraw(scope.row)" size="mini">修改</el-button> + <el-button type="primary" v-if="scope.row.actStatus == 3" size="mini">推广</el-button> + <el-button type="primary" v-if="[3,4,5].includes(scope.row.actStatus)" @click="openLuckdrawReceive(scope.row)" size="mini">活动统计</el-button> + <el-button type="primary" v-if="scope.row.actStatus == 3" @click="beClose(scope.row)" size="mini">关闭</el-button> + <el-button type="danger" v-if="scope.row.actStatus != 5" size="mini" @click="delRow(scope.row)">删除</el-button> + </el-row> + <el-row style="display:flex;" v-if="[1,2,3].includes(scope.row.actType)"> + <el-button type="primary" @click="openEdit(scope.row)" size="mini">编辑</el-button> + <el-button type="primary" @click="activityStatistics(scope.row)" size="mini">活动统计</el-button> + <el-button type="primary" @click="closeAct(scope.row)" size="mini">关闭</el-button> + <el-button type="danger" @click="delAct(scope.row)" size="mini">删除</el-button> + </el-row> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeActivitys" + @current-change="changeCurrentPageActivitys" + :current-page="activitysList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="activitysList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="activitysList.total"> + </el-pagination> + </el-row> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + var app = new Vue({ + el: '#app', + data: { + height:'calc(100vh - 200px)', + // 条件查询 + hdztList:[ + {value:'',label:'全部'}, + {value:1,label:'未发布'}, + {value:2,label:'未开始'}, + {value:3,label:'进行中'}, + {value:4,label:'已结束'}, + {value:5,label:'已删除'}, + ], + form:{ + hdmc:'', + hdzt:'', + order:'', + sort:'' + }, + //活动列表 + activitysList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadActivitysList(); + }, + //删除 + delAct(row){ + let _this = this; + _this.$confirm('确认删除活动吗?', '删除', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'info' + }).then(() => { + //通过 + let id = row.id; + $.AjaxProxy().invoke(basePath + "/admin/shopActivities/del?keys="+id, function(loj) { + if (loj[0].result.status == '200') { + _this.loadActivitysList(); + } + }); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + } + }); + }, + //关闭 + closeAct(row){ + let _this = this; + _this.$confirm('确认关闭活动吗?', '关闭', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'info' + }).then(() => { + //通过 + let id = row.id; + $.AjaxProxy().invoke(basePath + "/admin/shopActivities/closeAct?id="+id, function(loj) { + if (loj[0].result.status == '200') { + layer.msg(loj[0].result.info, { + icon: 1 + }); + } + }); + _this.loadActivitysList(); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + } + }); + }, + // 活动统计 + activityStatistics(row) { + let type = row.actType; + let id = row.id; + let name = row.actName; + console.log("-------"); + if (type == 2) { + layer.full(layer.open({ + type : 2, + title : name + "-活动统计", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSecKill-list?id=' + id] + })); + } + + if (type == 1) { + layer.full(layer.open({ + type : 2, + title : name + "-活动统计", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesGroupBuy-list?id=' + id] + })); + } + + if (type == 3) { + layer.full(layer.open({ + type : 2, + title : name + "-活动统计", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSalon-list?id=' + id] + })); + } + }, + //打开编辑界面 + openEdit(row) { + let type = row.actType; + let id = row.id; + if (type == 1) { + layer.full(layer.open({ + type : 2, + title : "编辑拼团", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/activitiesGroupBuy-form?id=' + id] + })); + } else if (type == 2) { + layer.full(layer.open({ + type : 2, + title : "编辑秒杀", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/activitiesSecKill-form?id=' + id] + })); + } else if (type == 3) { + layer.full(layer.open({ + type : 2, + title : "编辑沙龙", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/activitiesSalon-form?id=' + id] + })); + } + }, + //修改 + beUpdate(row){ + layer.full(layer.open({ + type: 2, + title: "修改", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-sign-update?actId=' + row.id] + })); + }, + //修改 + beUpdateLuckdraw(row){ + layer.full(layer.open({ + type: 2, + title: "修改", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-luckyDraw-update?actId=' + row.id] + })); + }, + + //活动统计 + openSignReceive(row){ + layer.full(layer.open({ + type: 2, + title: "活动统计", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-sign-receive?actId=' + row.id] + })); + }, + //活动统计 + openLuckdrawReceive(row){ + layer.full(layer.open({ + type: 2, + title: "活动统计", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-luckdraw-receive?actId=' + row.id] + })); + }, + //发布 + beReady(row){ + let _this = this; + let actState = row.actStatus; + if(actState !== 1){ + this.$notify({ + title: '提示', + message: '状态为【未发布】才能发布', + type: 'warning' + }); + } + _this.$confirm('确认发布活动吗?', '发布', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'info' + }).then(() => { + //通过 + let id = row.id; + let obj = { + actId: id, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/admin/activitySignAwardSet/beReady', + callback: function (data) { + _this.$message.success(data.info); + _this.loadActivitysList(); + } + }); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + } + }); + }, + //关闭 + beClose(row){ + let _this = this; + _this.$confirm('确认关闭活动吗?', '关闭', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'info' + }).then(() => { + //通过 + let id = row.id; + let obj = { + actId: id, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/admin/activitySignAwardSet/beClose', + callback: function (data) { + _this.$message.success(data.info); + _this.loadActivitysList(); + } + }); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + } + }); + }, + //删除 + delRow(row){ + let _this = this; + _this.$confirm('确认删除活动吗?', '删除', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + //通过 + let id = row.id; + let obj = { + actId: id, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/admin/activitySignAwardSet/delRow', + callback: function (data) { + _this.$message.success(data.info); + _this.loadActivitysList(); + } + }); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + } + }); + }, + + //--活动列表 + loadActivitysList() { + let _this = this; + let data=_this.getRequestParamActivitys(); + data.pageSize=_this.activitysList.pageSize; + data.pageNum=_this.activitysList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/findActivitiesList', + callback: function (data) { + _this.activitysList.rows = data.rows; + _this.activitysList.total = data.total; + } + }); + },//查询参数 + getRequestParamActivitys(){ + let _this = this; + return { + hdmc:_this.form.hdmc, + hdzt:_this.form.hdzt, + order:_this.form.order, + sort:_this.form.sort, + } + }, + //查询 + searchFormActivitys:function(){ + this.activitysList.currentPage=1; + this.loadActivitysList(); + }, + //重置 + resetFormActivitys(formName) { + this.$refs[formName].resetFields(); + }, + changePageSizeActivitys(val) { + this.activitysList.pageSize = val; + this.loadActivitysList(); + }, + changeCurrentPageActivitys(val) { + this.activitysList.currentPage = val; + this.loadActivitysList(); + }, + //排序 + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadInfo(); + } + }, + //选择 + handleSelectionChange(val) { + let _this = this; + _this.multipleSelection = val; + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckdraw-receive.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckdraw-receive.html new file mode 100644 index 0000000..17d0308 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckdraw-receive.html @@ -0,0 +1,279 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + .panel-body{ + overflow: hidden; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-row> + <el-row justify="space-between" type="flex"> + <el-col> + <el-form ref="form" :model="form" inline > + <el-form-item label="用户名称" prop="yhmc" > + <el-input v-model="form.yhmc" placeholder="用户名称"></el-input> + </el-form-item> + <el-form-item prop="qdsj" label="签到时间"> + <el-date-picker + v-model="form.qdsj" + type="datetimerange" + :picker-options="pickerOptions" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期" + align="right"> + </el-date-picker> + </el-form-item> + <el-button type="primary" @click="searchFormSignReceive" >搜索</el-button> + <el-button @click="resetFormSignReceive('form')">重置</el-button> + </el-form> + </el-col> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="signReceiveList.rows" + :height="height" + stripe:true + @sort-change="sortChange" + @selection-change="handleSelectionChange"> + <el-table-column + type="selection"> + </el-table-column> + <el-table-column + prop="nickName" + label="用户" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="reciveTime" + label="抽奖时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="状态" + show-overflow-tooltip> + <template slot-scope="scope"> + <span v-if="scope.row.state == 1">待领取</span> + <span v-if="scope.row.state == 2">已领取</span> + <span v-if="scope.row.state == 3">待配送</span> + <span v-if="scope.row.state == 4">待收货</span> + <span v-if="scope.row.state == 5">已失效</span> + </template> + </el-table-column> + <el-table-column + label="奖品类型"> + <template slot-scope="scope"> + <span v-if="scope.row.awardType == 1">自定义礼品</span> + <span v-if="scope.row.awardType == 2">积分</span> + <span v-if="scope.row.awardType == 3">优惠券</span> + <span v-if="scope.row.awardType == 4">店铺商品</span> + </template> + </el-table-column> + <el-table-column + prop="awardName" + label="获得奖励" + show-overflow-tooltip> + </el-table-column> + + <el-table-column + label="奖励名称" + show-overflow-tooltip> + <template slot-scope="scope"> + {{scope.row.awardName}} + <span v-if="scope.row.awardType == 3">({{scope.row.couponName}})</span> + <span v-if="scope.row.awardType == 2">(*{{scope.row.scoreCnt}})</span> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSignReceive" + @current-change="changeCurrentPageSignReceive" + :current-page="signReceiveList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="signReceiveList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="signReceiveList.total"> + </el-pagination> + </el-row> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的活动对象 + var actId = $.query.get("actId"); + + var app = new Vue({ + el: '#app', + data: { + height:'calc(100vh - 200px)', + //--时间选择 + pickerOptions: { + shortcuts: [{ + text: '最近一周', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近三个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + } + }] + }, + // 条件查询 + form:{ + yhmc:'', + qdsj:'', + order:'', + sort:'' + }, + //活动列表 + signReceiveList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadSignReceiveList(); + }, + //--列表 + loadSignReceiveList() { + let _this = this; + let data=_this.getRequestParamSignReceive(); + data.pageSize=_this.signReceiveList.pageSize; + data.pageNum=_this.signReceiveList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/findSignReceiveList', + callback: function (data) { + _this.signReceiveList.rows = data.rows; + _this.signReceiveList.total = data.total; + } + }); + },//查询参数 + getRequestParamSignReceive(){ + let _this = this; + let startTime = ''; + let endTime = ''; + if(_this.form.qdsj.length > 0){ + startTime = _this.form.qdsj[0]; + endTime = _this.form.qdsj[1]; + } + return { + yhmc:_this.form.yhmc, + startTime:startTime, + endTime:endTime, + actId:actId, + order:_this.form.order, + sort:_this.form.sort, + } + }, + //查询 + searchFormSignReceive:function(){ + this.signReceiveList.currentPage=1; + this.loadSignReceiveList(); + }, + //重置 + resetFormSignReceive(formName) { + this.$refs[formName].resetFields(); + }, + changePageSignReceive(val) { + this.signReceiveList.pageSize = val; + this.loadSignReceiveList(); + }, + changeCurrentPageSignReceive(val) { + this.signReceiveList.currentPage = val; + this.loadSignReceiveList(); + }, + //排序 + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadInfo(); + } + }, + //选择 + handleSelectionChange(val) { + let _this = this; + _this.multipleSelection = val; + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw-update.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw-update.html new file mode 100644 index 0000000..4c3ec30 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw-update.html @@ -0,0 +1,1116 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + + .el-aside { + background-color: #D3DCE6; + color: #333; + text-align: center; + } + .el-main { + background-color: #E9EEF3; + color: #333; + } + body > .el-container { + margin-bottom: 1000px; + } + .button { + padding: 5px; + text-align: center; + } + + .imageOne { + display: block; + height: 50px; + padding: 5px 5px; + text-align: center; + } + .imageTwo { + display: block; + height: 280px; + padding: 5px 5px; + text-align: center; + } + .imageThree { + display: block; + padding: 5px 5px; + text-align: center; + } + + .box-card { + padding: 5px 5px; + } + + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-form :model="ruleForm" :rules="rules" class="form-horizontal" id="dataform" ref="ruleForm" label-width="120px"> + + <el-container> + <el-aside width="30%"> + <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> + <el-row> + <div @click="uploadImg()" class="imageTwo" > + <img v-if="imageUrlHead" :src="imageUrlHead" style="width: 100%;height: 100%"> + <el-button type="primary" v-show="imageUrlHead == ''" round><span style="font-size: 20px;">头部</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + </div> + </el-row> + <el-row style="display:flex;"> + <el-col> + <div style="padding:5px;font-size: 15px;text-align: left;"> + <el-button type="primary" size="mini" round> + <span>拥有积分:</span> + </el-button> + </div> + </el-col> + </el-row> + + <el-row> + <div @click="uploadImg()" class="imageThree" > + <el-button type="primary" v-show="imageUrlButton == ''" round><span style="font-size: 20px;">签到按钮</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + <img v-if="imageUrlButton" :src="imageUrlButton" style="width: 100%;"> + </div> + </el-row> + + + <el-row> + <div style="text-align: center;padding: 5px;" @click="gzsmSet()"> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 30px;">-- 规则说明--</span> + </div> + <div class="el-col-sm-24" style="text-align: center;"> + <span style="padding:5px;font-size: 15px;color: red;">(点击,编辑规则内容,背景颜色,字体颜色、大小、透明度)</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">1、每天参与签到可获得积分换取抽奖机会</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">2、每天参与签到可获得积分换取抽奖机会</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">3、每天参与签到可获得积分换取抽奖机会</span> + </div> + </div> + </el-row> + </el-card> + </el-aside> + + <el-main width="70%"> + <div> + <el-tabs v-model="activeName" @tab-click="clickSecondTab"> + <el-tab-pane label="活动设置" name="first"> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动名称" prop="actName"> + <el-input v-model="ruleForm.actName" placeholder="请输入活动名称"></el-input> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动编码" prop="actCode"> + <el-input v-model.number="ruleForm.actCode" placeholder="请输入最大开团数量"></el-input> + </el-form-item> + </div> + <div class="col-sm-4 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动时间" prop="actTime"> + <div class="block"> + <el-date-picker + v-model="ruleForm.actTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <p class="el-big-title" style="text-align: left;">抽奖规则</p> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="每日抽奖机会"> + <el-form-item label="每人每日有" prop="wmkcjjh"> + <el-input-number v-model="ruleForm.wmkcjjh" :min="1" :max="10" label="描述文字"></el-input-number> 次无门槛抽奖机会 + </el-form-item> + </el-form-item> + <el-form-item> + <el-form-item label="可用" prop="dhycjfs"> + <el-input-number v-model="ruleForm.dhycjfs" :min="1" :max="200" label="描述文字"></el-input-number> 积分兑换1次抽奖机会,每日最多兑换 + </el-form-item> + </el-form-item> + <el-form-item> + <el-form-item label="每日最多兑换" prop="jfdhcs"> + <el-input-number v-model="ruleForm.jfdhcs" :min="1" :max="10" label="描述文字"></el-input-number> 次抽奖机会 + </el-form-item> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="中奖概率"> + <el-form-item label="每人最多中奖" prop="zzjcs"> + <el-input-number v-model="ruleForm.zzjcs" :min="1" :max="100" label="描述文字"></el-input-number> 次 + </el-form-item> + </el-form-item> + <el-form-item> + <el-form-item label="总中奖率" prop="zzjl"> + <el-input-number v-model="ruleForm.zzjl" :min="1" :max="100" label="描述文字"></el-input-number> % + </el-form-item> + </el-form-item> + </div> + </el-tab-pane> + + <el-tab-pane label="奖品设置" name="second"> + <el-row style="display:flex;"> + <el-col :span="20"> + <el-tabs v-model="editableTabsValue" type="card" closable @tab-click="clickTab" @tab-remove="removeTab"> + <el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title" :name="item.name"> + <el-row v-show="editableTabsValue !== '1'"> + </el-row> + <el-row > + <el-col> + <el-form-item label="奖项名称"> + <el-input v-model="item.content.awardName" placeholder="奖项名称"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="图片介绍"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="introduceImgSuccess"> + <img v-if="item.content.introduceImg" :src="item.content.introduceImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + <div v-show="item.name !== '1'"> + <el-row> + <el-form-item label="奖项类型"> + <el-col> + <el-radio-group v-model="item.content.awardType" @change="jxlxChange"> + <el-radio :label="1">自定义奖品</el-radio> + <el-radio :label="2">积分</el-radio> + <el-radio :label="3">优惠券</el-radio> + <el-radio :label="4">商品</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-row> + + <div> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="奖项库存"> + <el-input v-model="item.content.awardInventoryCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="已派发"> + <el-input v-model="item.content.awardDistributeCnt"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === 1"> + <el-row > + <el-col> + <el-form-item label="文字介绍"> + <el-input type="textarea" v-model="item.content.introduceTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="兑奖方式"> + <el-col> + <el-radio-group v-model="item.content.awardWay" @change="awardWayChange"> + <el-radio :label="'1'">线下兑换</el-radio> + <el-radio :label="'2'">物流配送</el-radio> + <el-radio :label="'3'">客服兑换</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="操作提示"> + <el-input v-model="item.content.operationTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <div v-show="item.content.awardWay === '1'"> + <el-row > + <el-col> + <el-form-item label="兑奖地址"> + <el-input v-model="item.content.prizeAddress"></el-input> + </el-form-item> + </el-col> + </el-row> + + </div> + <div v-show="item.content.awardWay === '3'"> + <el-row > + <el-col> + <el-form-item label="客服微信"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="wechatImgSuccess"> + <img v-if="item.content.wechatImg" :src="item.content.wechatImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="[1,3].includes(item.content.awardWay)"> + <el-row > + <el-col> + <el-form-item label="客服电话"> + <el-input v-model="item.content.customerPhone"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardWay !== '2'"> + <el-row > + <el-col> + <el-form-item label="兑奖期限"> + <div class="block"> + <el-date-picker + v-model="item.content.prizeTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </el-col> + </el-row> + </div> + </div> + <div v-show="item.content.awardType === 2"> + <el-row > + <el-col> + <el-form-item label="积分数量"> + <el-input v-model="item.content.scoreCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === 3"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="优惠券名称"> + <el-input v-model="item.content.couponName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="优惠券"> + <el-input v-model="item.content.couponId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseCoupon(item.content.couponName,item.name)"> + 选择优惠券 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择商城优惠券" + :visible.sync="drawerCoupon" + :direction="directionCoupon" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formCoupon" :model="formCoupon" inline > + <el-form-item prop="yhjmc"> + <el-input v-model="formCoupon.yhjmc" placeholder="请输入优惠券名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormCoupon" >搜索</el-button> + <el-button @click="resetFormCoupon('formCoupon')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="couponList.rows" + :height="tableHeightCoupon" + stripe:true + style="width: 100%"> + <el-table-column + prop="cname" + label="优惠券名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="endTime" + label="截止日期" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneCoupon(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeCoupon" + @current-change="changeCurrentPageCoupon" + :current-page="couponList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="couponList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="couponList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + </div> + <div v-show="item.content.awardType === 4"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="品项名称"> + <el-input v-model="item.content.goodsName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="品项"> + <el-input v-model="item.content.goodsId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseGoods(item.content.goodsName,item.name)"> + 选择品项 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择ERP产品" + :visible.sync="drawerGoods" + :direction="directionGoods" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formGoods" :model="formGoods" inline > + <el-form-item prop="cpmc"> + <el-input v-model="formGoods.cpmc" placeholder="请输入产品名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormGoods" >搜索</el-button> + <el-button @click="resetFormGoods('formGoods')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="goodsList.rows" + :height="tableHeightGoods" + stripe:true + style="width: 100%"> + <el-table-column + prop="name" + label="名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneGoods(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeGoods" + @current-change="changeCurrentPageGoods" + :current-page="goodsList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="goodsList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="goodsList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + </div> + </div> + </el-tab-pane> + </el-tabs> + </el-col> + <el-col :span="4"> + <el-button type="primary" @click="addTab(editableTabsValue)"> + 新增奖品 + </el-button> + </el-col> + </el-row> + </el-tab-pane> + + <el-tab-pane label="背景图片上传" name="third"> + <!--<div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="标题"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlTitleSuccess"> + <img v-if="imageUrlTitle" :src="imageUrlTitle" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div>--> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="头部"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlHeadSuccess"> + <img v-if="imageUrlHead" :src="imageUrlHead" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="开始按钮"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlTitleSuccess"> + <img v-if="imageUrlTitle" :src="imageUrlTitle" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="奖品划分线"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageLineSuccess"> + <img v-if="imageLine" :src="imageLine" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + + <!--<div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="转盘背景"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlButtonSuccess"> + <img v-if="imageUrlButton" :src="imageUrlButton" style="max-width: 300px;"> + <i v-else></i> + </el-upload> + </el-form-item> + </div>--> + </el-tab-pane> + + <el-tab-pane label="规则说明" name="fourth"> + <div class="col-sm-8 col-sm-offset-1"> + <el-form-item label="规则内容" prop="ruleExplain" style="padding: 10px"> + <el-input type="textarea" v-model="ruleForm.ruleExplain"></el-input> + </el-form-item> + <el-form-item label="背景颜色" style="padding: 10px"> + <el-color-picker v-model="backgroundColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体颜色" style="padding: 10px"> + <el-color-picker v-model="typographyColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体大小" style="padding: 10px"> + <el-input-number v-model="typographyNum" :min="10" :max="50" label="描述文字"></el-input-number> + </el-form-item> + <!--<el-form-item label="字体透明度" style="padding: 10px"> + <el-input-number v-model="typographyLight" :min="1" :max="100" label="描述文字">%</el-input-number> + </el-form-item>--> + </div> + </el-tab-pane> + </el-tabs> + </div> + + <div class="form-group "> + <div class="col-sm-12 text-center"> + <el-button type="primary" @click="updateSignAwardSet('ruleForm')">保存</el-button> + <el-button type="danger" @click="cancelSubmit">关闭</el-button> + </div> + </div> + </el-main> + + </el-container> + + </el-form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的活动对象 + var actId = $.query.get("actId"); + const prize = { + //奖品基本信息 + id:'', + cumulativeDay:'', + awardType:1, + awardName:'', + introduceImg:'', + introduceTip:'', + awardInventoryCnt:'', + awardDistributeCnt:'', + awardWay:1, + operationTip:'', + prizeAddress:'', + prizeTime: '', + wechatImg:'', + scoreCnt:'', + couponId:'', + customerPhone:'', + goodsId:'', + couponName:'', + goodsName:'', + } + var app = new Vue({ + el: '#app', + data: { + activeName: 'first', + formLabelWidth: '120px', + //标题图片 + imageLine: "../../../images/luckyDraw/line.png", + imageUrlTitle: "../../../images/luckyDraw/start.png", + imageUrlButton: "", + imageUrlHead: "../../../images/luckyDraw/zhuanpan.png", + + activeClickTab:0, + + //优惠券搜索弹出 + drawerCoupon: false, + directionCoupon: 'rtl', + tableHeightCoupon: 500, + //--优惠券 + formCoupon:{ + yhjmc:'', + order:'', + sort:'' + }, + couponList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //品项搜索弹出 + drawerGoods: false, + directionGoods: 'rtl', + tableHeightGoods: 500, + //--品项 + formGoods:{ + cpmc:'', + order:'', + sort:'' + }, + goodsList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //字体颜色 + typographyColor: '#409EFF', + //背景颜色 + backgroundColor: '#409EFF', + //字体大小 + typographyNum: '5', + //字体透明度 + typographyLight: '50', + //奖品设置 + prize:JSON.parse(JSON.stringify(prize)), + editableTabsValue: '1', + editableTabs: [{ + title: '谢谢参与', + name: '1', + content: JSON.parse(JSON.stringify(prize)) + }], + tabIndex: 1, + + ruleForm : { + //商品基本信息 + actName : '', + actCode : '', + actTime : '', + //抽奖规则 + wmkcjjh : '5', + dhycjfs : '20', + jfdhcs : '10', + zzjcs : '5', + zzjl : '10', + //规则说明 + ruleExplain : '', + }, + rules : { + //商品基本信息 + actName : [ + { required: true, message: '请输入活动名称', trigger: 'blur' } + ], + actCode : [ + { required: true, message: '请输入活动编码', trigger: 'blur' } + ], + actTime : [ + { required: true, message: '请选择日期', trigger: 'change' } + ], + wmkcjjh : [ + { required: true, message: '请输入1到10的数字', trigger: 'blur' } + ], + dhycjfs : [ + { required: true, message: '请输入1到200的数字', trigger: 'blur' } + ], + jfdhcs : [ + { required: true, message: '请输入1到10的数字', trigger: 'blur' } + ], + zzjcs : [ + { required: true, message: '请输入1到100的数字', trigger: 'blur' } + ], + zzjl : [ + { required: true, message: '请输入1到100的数字', trigger: 'blur' } + ], + ruleExplain : [ + { required: true, message: '请输入规则内容', trigger: 'blur' } + ] + }, + }, + created: function () { + this.loadInfo(); + }, + methods: { + //选择优惠券 + chooseCoupon(val,name){ + let _this = this; + _this.drawerCoupon = true; + _this.activeClickTab = parseInt(name); + + console.log(_this.activeClickTab); + _this.formCoupon.yhjmc = val; + _this.loadCouponList(); + }, + //--优惠券 + loadCouponList() { + let _this = this; + let data=_this.getRequestParamCoupon(); + data.pageSize=_this.couponList.pageSize; + data.pageNum=_this.couponList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectCouponList', + callback: function (data) { + _this.couponList.rows = data.rows; + _this.couponList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamCoupon(){ + let _this = this; + return { + yhjmc:_this.formCoupon.yhjmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormCoupon:function(){ + this.couponList.currentPage=1; + this.loadCouponList(); + }, + //重置 + resetFormCoupon(formName) { + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeCoupon(val) { + this.couponList.pageSize = val; + this.loadCouponList(); + }, + changeCurrentPageCoupon(val) { + this.couponList.currentPage = val; + this.loadCouponList(); + }, + //选择 + chooseOneCoupon(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.couponId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.couponName = row.cname; + _this.drawerCoupon = false; + }, + + //选择品项 + chooseGoods(val,name){ + let _this = this; + _this.drawerGoods = true; + _this.activeClickTab = parseInt(name); + _this.formGoods.cpmc = val; + _this.loadGoodsList(); + }, + //--品项 + loadGoodsList() { + let _this = this; + let data=_this.getRequestParamGoods(); + data.pageSize=_this.goodsList.pageSize; + data.pageNum=_this.goodsList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectGoodsList', + callback: function (data) { + _this.goodsList.rows = data.rows; + _this.goodsList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamGoods(){ + let _this = this; + return { + cpmc:_this.formCoupon.cpmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormGoods:function(){ + this.goodsList.currentPage=1; + this.loadGoodsList(); + }, + //重置 + resetFormGoods(formName) { + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeGoods(val) { + this.goodsList.pageSize = val; + this.loadGoodsList(); + }, + changeCurrentPageGoods(val) { + this.goodsList.currentPage = val; + this.loadGoodsList(); + }, + //选择 + chooseOneGoods(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.goodsId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.goodsName = row.name; + _this.drawerGoods = false; + }, + + //加载活动详情 + loadInfo() { + let _this = this; + _this.loadSign(); + }, + loadSign() { + let _this = this; + let data={ + actId:actId, + }; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/findLuckyDrawForUpdate', + callback: function (data) { + _this.ruleForm.actName = data.mapInfo.addLuckyDrawSetVo.actName; + _this.ruleForm.actCode = data.mapInfo.addLuckyDrawSetVo.actCode; + let arrayObj = new Array(); + arrayObj.push(new Date(data.mapInfo.addLuckyDrawSetVo.beginTime)); + arrayObj.push(new Date(data.mapInfo.addLuckyDrawSetVo.endTime)); + _this.ruleForm.actTime = arrayObj; + //抽奖规则 + _this.ruleForm.wmkcjjh = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.wmkcjjh; + _this.ruleForm.dhycjfs = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.dhycjfs; + _this.ruleForm.jfdhcs = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.jfdhcs; + _this.ruleForm.zzjcs = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.zzjcs; + _this.ruleForm.zzjl = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.zzjl; + //字体颜色 + _this.ruleForm.ruleExplain = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.ruleExplain; + _this.typographyColor = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.typographyColor; + _this.backgroundColor = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.backgroundColor; + _this.typographyNum = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.typographyNum; + _this.typographyLight = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.typographyLight; + _this.imageUrlTitle = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.imageUrlTitle; + _this.imageUrlHead = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.imageUrlHead; + _this.imageUrlButton = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.imageUrlButton; + _this.imageUrlState = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.imageUrlState; + _this.imageLine = data.mapInfo.addLuckyDrawSetVo.luckyDrawBasicJsonVo.imageLine; + + for (let i = 0; i < data.mapInfo.addLuckyDrawSetVo.activityluckyDrawSets.length; i++) { + _this.tabIndex = data.mapInfo.addLuckyDrawSetVo.activityluckyDrawSets.length; + let prizeVo = data.mapInfo.addLuckyDrawSetVo.activityluckyDrawSets[i]; + let arrayObjs = new Array(); + arrayObjs.push(new Date(prizeVo.prizeStartTime)); + arrayObjs.push(new Date(prizeVo.prizeEndTime)); + let content = JSON.parse(JSON.stringify(prize)); + content = { + id: prizeVo.id, + cumulativeDay: prizeVo.cumulativeDay, + awardType: parseInt(prizeVo.awardType), + awardName: prizeVo.awardName, + introduceImg: prizeVo.introduceImg, + customerPhone: prizeVo.customerPhone, + introduceTip: prizeVo.introduceTip, + awardInventoryCnt: prizeVo.awardInventoryCnt, + awardDistributeCnt: prizeVo.awardDistributeCnt, + awardWay: parseInt(prizeVo.awardWay), + operationTip: prizeVo.operationTip, + prizeAddress: prizeVo.prizeAddress, + wechatImg: prizeVo.wechatImg, + scoreCnt: prizeVo.scoreCnt, + couponId: prizeVo.couponId, + goodsId: prizeVo.goodsId, + couponName: prizeVo.couponName, + goodsName: prizeVo.goodsName, + prizeTime: arrayObjs, + } + if(i === 0){ + _this.editableTabs[0].content = content; + }else{ + let newTabName = i+1 +''; + _this.editableTabs.push({ + title: "商品奖励"+"("+newTabName+")", + name: newTabName, + content: content, + }); + this.editableTabsValue = newTabName; + } + } + } + }); + }, + //保存 + updateSignAwardSet : function(formName) { + const _this = this; + let flag = false; + _this.$refs[formName].validate((valid) => { + if (!valid) { + _this.$notify({ + title: '提示', + message: '请完善转盘抽奖活动信息', + type: 'warning' + }); + flag = true; + return; + } + }); + if (flag) { + return; + } + //活动基本信息 + let luckyDrawBasicJsonDto = { + ruleExplain: _this.ruleForm.ruleExplain, + //字体颜色 + typographyColor: _this.typographyColor, + //背景颜色 + backgroundColor: _this.backgroundColor, + //字体大小 + typographyNum: _this.typographyNum, + //标题图片 + imageUrlTitle: _this.imageUrlTitle, + imageLine: _this.imageLine, + imageUrlHead: _this.imageUrlHead, + imageUrlButton: _this.imageUrlButton, + //抽奖规则 + wmkcjjh: _this.ruleForm.wmkcjjh, + dhycjfs: _this.ruleForm.dhycjfs, + jfdhcs: _this.ruleForm.jfdhcs, + zzjcs: _this.ruleForm.zzjcs, + zzjl: _this.ruleForm.zzjl, + } + //奖品信息 + let activityAwardSets = []; + for (let i = 0; i < _this.editableTabs.length; i++) { + let prize = _this.editableTabs[i].content; + let name = _this.editableTabs[i].title; + let awardRule = 2; + if(name == "谢谢参与"){ + awardRule = 1; + } + let activitySignAwardSet = { + id: prize.id, + cumulativeDay: prize.cumulativeDay, + awardRule: awardRule, + awardType: prize.awardType, + awardName: prize.awardName, + introduceImg: prize.introduceImg, + introduceTip: prize.introduceTip, + awardInventoryCnt: prize.awardInventoryCnt, + awardDistributeCnt: prize.awardDistributeCnt, + awardWay: prize.awardWay, + operationTip: prize.operationTip, + customerPhone: prize.customerPhone, + prizeAddress: prize.prizeAddress, + wechatImg: prize.wechatImg, + scoreCnt: prize.scoreCnt, + couponId: prize.couponId, + goodsId: prize.goodsId, + couponName: prize.couponName, + goodsName: prize.goodsName, + prizeStartTime: prize.prizeTime[0], + prizeEndTime: prize.prizeTime[1], + } + activityAwardSets.push(activitySignAwardSet); + } + let resultData = { + actMainId: actId, + actName: _this.ruleForm.actName, + actCode: _this.ruleForm.actCode, + beginTime : _this.ruleForm.actTime[0], + endTime : _this.ruleForm.actTime[1], + luckyDrawBasicJsonDto, + activityAwardSets, + } + AjaxProxy.requst({ + app: _this, + data: resultData, + url: basePath + '/admin/activitySignAwardSet/updateLuckyDrawSet', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + }); + } + }); + }, + //奖品设置 + addTab(targetName) { + let newTabName = ++this.tabIndex + ''; + this.editableTabs.push({ + title: "转盘奖品"+"("+newTabName+")", + name: newTabName, + content: JSON.parse(JSON.stringify(prize)), + }); + this.editableTabsValue = newTabName; + this.activeClickTab = parseInt(newTabName); + }, + clickSecondTab(targetName) { + this.activeClickTab = 1; + }, + clickTab(targetName) { + console.log(targetName.name); + this.activeClickTab = parseInt(targetName.name); + }, + removeTab(targetName) { + let tabs = this.editableTabs; + let activeName = this.editableTabsValue; + if(activeName === '1' || targetName === '1'){ + this.$notify({ + title: '提示', + message: '【谢谢参与】不能删除', + type: 'warning' + }); + }else{ + if (activeName === targetName) { + tabs.forEach((tab, index) => { + if (tab.name === targetName && tab.title !== "谢谢参与") { + let nextTab = tabs[index + 1] || tabs[index - 1]; + if (nextTab) { + activeName = nextTab.name; + } + } + }); + } + this.editableTabsValue = activeName; + this.editableTabs = tabs.filter(tab => tab.name !== targetName); + this.tabIndex = this.editableTabs.length; + } + }, + //切换奖项类型,显示不同内容 + jxlxChange(val){ + let _this = this; + _this.isShow=val; + }, + //切换兑奖方式,显示不同内容 + awardWayChange(val){ + let _this = this; + _this.isShow=val; + }, + //跳转到图片上传 + uploadImg(){ + this.activeName = 'third'; + }, + //跳转到规则说明 + gzsmSet(){ + this.activeName = 'fourth'; + }, + //标题图片 + imageUrlTitleSuccess(res, file) { + this.imageUrlTitle = res.path; + }, + imageLineSuccess(res, file) { + this.imageLine = res.path; + }, + imageUrlHeadSuccess(res, file) { + this.imageUrlHead = res.path; + }, + imageUrlButtonSuccess(res, file) { + this.imageUrlButton = res.path; + }, + //奖品设置的图片介绍 + introduceImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.introduceImg = res.path; + }, + //奖品设置的客服微信 + wechatImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.wechatImg = res.path; + }, + cancelSubmit() { + this.closeFrame(); + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw.html new file mode 100644 index 0000000..b8c948a --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-luckyDraw.html @@ -0,0 +1,1027 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + + .el-aside { + background-color: #D3DCE6; + color: #333; + text-align: center; + } + .el-main { + background-color: #E9EEF3; + color: #333; + } + body > .el-container { + margin-bottom: 1000px; + } + .button { + padding: 5px; + text-align: center; + } + + .imageOne { + display: block; + height: 50px; + padding: 5px 5px; + text-align: center; + } + .imageTwo { + display: block; + height: 280px; + padding: 5px 5px; + text-align: center; + } + .imageThree { + display: block; + padding: 5px 5px; + text-align: center; + } + + .box-card { + padding: 5px 5px; + } + + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-form :model="ruleForm" :rules="rules" class="form-horizontal" id="dataform" ref="ruleForm" label-width="120px"> + + <el-container> + <el-aside width="30%"> + <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> + <el-row> + <div @click="uploadImg()" class="imageTwo" > + <img v-if="imageUrlHead" :src="imageUrlHead" style="width: 100%;height: 100%"> + <el-button type="primary" v-show="imageUrlHead == ''" round><span style="font-size: 20px;">头部</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + </div> + </el-row> + <el-row style="display:flex;"> + <el-col> + <div style="padding:5px;font-size: 15px;text-align: left;"> + <el-button type="primary" size="mini" round> + <span>拥有积分:</span> + </el-button> + </div> + </el-col> + </el-row> + + <el-row> + <div @click="uploadImg()" class="imageThree" > + <el-button type="primary" v-show="imageUrlButton == ''" round><span style="font-size: 20px;">签到按钮</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + <img v-if="imageUrlButton" :src="imageUrlButton" style="width: 100%;"> + </div> + </el-row> + + + <el-row> + <div style="text-align: center;padding: 5px;" @click="gzsmSet()"> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 30px;">-- 规则说明--</span> + </div> + <div class="el-col-sm-24" style="text-align: center;"> + <span style="padding:5px;font-size: 15px;color: red;">(点击,编辑规则内容,背景颜色,字体颜色、大小、透明度)</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">1、每天参与签到可获得积分换取抽奖机会</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">2、每天参与签到可获得积分换取抽奖机会</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">3、每天参与签到可获得积分换取抽奖机会</span> + </div> + </div> + </el-row> + </el-card> + </el-aside> + + <el-main width="70%"> + <div> + <el-tabs v-model="activeName" @tab-click="clickSecondTab"> + <el-tab-pane label="活动设置" name="first"> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动名称" prop="actName"> + <el-input v-model="ruleForm.actName" placeholder="请输入活动名称"></el-input> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动编码" prop="actCode"> + <el-input v-model.number="ruleForm.actCode" placeholder="请输入最大开团数量"></el-input> + </el-form-item> + </div> + <div class="col-sm-4 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动时间" prop="actTime"> + <div class="block"> + <el-date-picker + v-model="ruleForm.actTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <p class="el-big-title" style="text-align: left;">抽奖规则</p> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="每日抽奖机会"> + <el-form-item label="每人每日有" prop="wmkcjjh"> + <el-input-number v-model="ruleForm.wmkcjjh" :min="1" :max="10" label="描述文字"></el-input-number> 次无门槛抽奖机会 + </el-form-item> + </el-form-item> + <el-form-item> + <el-form-item label="可用" prop="dhycjfs"> + <el-input-number v-model="ruleForm.dhycjfs" :min="1" :max="200" label="描述文字"></el-input-number> 积分兑换1次抽奖机会,每日最多兑换 + </el-form-item> + </el-form-item> + <el-form-item> + <el-form-item label="每日最多兑换" prop="jfdhcs"> + <el-input-number v-model="ruleForm.jfdhcs" :min="1" :max="10" label="描述文字"></el-input-number> 次抽奖机会 + </el-form-item> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="中奖概率"> + <el-form-item label="每人最多中奖" prop="zzjcs"> + <el-input-number v-model="ruleForm.zzjcs" :min="1" :max="100" label="描述文字"></el-input-number> 次 + </el-form-item> + </el-form-item> + <el-form-item> + <el-form-item label="总中奖率" prop="zzjl"> + <el-input-number v-model="ruleForm.zzjl" :min="1" :max="100" label="描述文字"></el-input-number> % + </el-form-item> + </el-form-item> + </div> + </el-tab-pane> + + <el-tab-pane label="奖品设置" name="second"> + <el-row style="display:flex;"> + <el-col :span="20"> + <el-tabs v-model="editableTabsValue" type="card" closable @tab-click="clickTab" @tab-remove="removeTab"> + <el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title" :name="item.name"> + <el-row v-show="editableTabsValue !== '1'"> + </el-row> + <el-row > + <el-col> + <el-form-item label="奖项名称"> + <el-input v-model="item.content.awardName" placeholder="奖项名称"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="图片介绍"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="introduceImgSuccess"> + <img v-if="item.content.introduceImg" :src="item.content.introduceImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + <div v-show="item.name !== '1'"> + <el-row> + <el-form-item label="奖项类型"> + <el-col> + <el-radio-group v-model="item.content.awardType" @change="jxlxChange"> + <el-radio :label="'1'">自定义奖品</el-radio> + <el-radio :label="'2'">积分</el-radio> + <el-radio :label="'3'">优惠券</el-radio> + <el-radio :label="'4'">商品</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-row> + + <div> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="奖项库存"> + <el-input v-model="item.content.awardInventoryCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="已派发"> + <el-input v-model="item.content.awardDistributeCnt"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === '1'"> + <el-row > + <el-col> + <el-form-item label="文字介绍"> + <el-input type="textarea" v-model="item.content.introduceTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="兑奖方式"> + <el-col> + <el-radio-group v-model="item.content.awardWay" @change="awardWayChange"> + <el-radio :label="'1'">线下兑换</el-radio> + <el-radio :label="'2'">物流配送</el-radio> + <el-radio :label="'3'">客服兑换</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="操作提示"> + <el-input v-model="item.content.operationTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <div v-show="item.content.awardWay === '1'"> + <el-row > + <el-col> + <el-form-item label="兑奖地址"> + <el-input v-model="item.content.prizeAddress"></el-input> + </el-form-item> + </el-col> + </el-row> + + </div> + <div v-show="item.content.awardWay === '3'"> + <el-row > + <el-col> + <el-form-item label="客服微信"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="wechatImgSuccess"> + <img v-if="item.content.wechatImg" :src="item.content.wechatImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="[1,3].includes(item.content.awardWay)"> + <el-row > + <el-col> + <el-form-item label="客服电话"> + <el-input v-model="item.content.customerPhone"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardWay !== '2'"> + <el-row > + <el-col> + <el-form-item label="兑奖期限"> + <div class="block"> + <el-date-picker + v-model="item.content.prizeTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </el-col> + </el-row> + </div> + </div> + <div v-show="item.content.awardType === '2'"> + <el-row > + <el-col> + <el-form-item label="积分数量"> + <el-input v-model="item.content.scoreCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === '3'"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="优惠券名称"> + <el-input v-model="item.content.couponName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="优惠券"> + <el-input v-model="item.content.couponId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseCoupon(item.content.couponName,item.name)"> + 选择优惠券 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择商城优惠券" + :visible.sync="drawerCoupon" + :direction="directionCoupon" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formCoupon" :model="formCoupon" inline > + <el-form-item prop="yhjmc"> + <el-input v-model="formCoupon.yhjmc" placeholder="请输入优惠券名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormCoupon" >搜索</el-button> + <el-button @click="resetFormCoupon('formCoupon')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="couponList.rows" + :height="tableHeightCoupon" + stripe:true + style="width: 100%"> + <el-table-column + prop="cname" + label="优惠券名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="endTime" + label="截止日期" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneCoupon(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeCoupon" + @current-change="changeCurrentPageCoupon" + :current-page="couponList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="couponList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="couponList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + </div> + <div v-show="item.content.awardType === '4'"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="品项名称"> + <el-input v-model="item.content.goodsName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="品项"> + <el-input v-model="item.content.goodsId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseGoods(item.content.goodsName,item.name)"> + 选择品项 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择ERP产品" + :visible.sync="drawerGoods" + :direction="directionGoods" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formGoods" :model="formGoods" inline > + <el-form-item prop="cpmc"> + <el-input v-model="formGoods.cpmc" placeholder="请输入产品名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormGoods" >搜索</el-button> + <el-button @click="resetFormGoods('formGoods')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="goodsList.rows" + :height="tableHeightGoods" + stripe:true + style="width: 100%"> + <el-table-column + prop="name" + label="名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneGoods(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeGoods" + @current-change="changeCurrentPageGoods" + :current-page="goodsList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="goodsList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="goodsList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + </div> + </div> + </el-tab-pane> + </el-tabs> + </el-col> + <el-col :span="4"> + <el-button type="primary" @click="addTab(editableTabsValue)"> + 新增奖品 + </el-button> + </el-col> + </el-row> + </el-tab-pane> + + <el-tab-pane label="背景图片上传" name="third"> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="头部"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlHeadSuccess"> + <img v-if="imageUrlHead" :src="imageUrlHead" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="开始按钮"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlTitleSuccess"> + <img v-if="imageUrlTitle" :src="imageUrlTitle" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="奖品划分线"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageLineSuccess"> + <img v-if="imageLine" :src="imageLine" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + + <!--<div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="转盘背景"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlButtonSuccess"> + <img v-if="imageUrlButton" :src="imageUrlButton" style="max-width: 300px;"> + <i v-else></i> + </el-upload> + </el-form-item> + </div>--> + </el-tab-pane> + + <el-tab-pane label="规则说明" name="fourth"> + <div class="col-sm-8 col-sm-offset-1"> + <el-form-item label="规则内容" prop="ruleExplain" style="padding: 10px"> + <el-input type="textarea" v-model="ruleForm.ruleExplain"></el-input> + </el-form-item> + <el-form-item label="背景颜色" style="padding: 10px"> + <el-color-picker v-model="backgroundColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体颜色" style="padding: 10px"> + <el-color-picker v-model="typographyColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体大小" style="padding: 10px"> + <el-input-number v-model="typographyNum" :min="10" :max="50" label="描述文字"></el-input-number> + </el-form-item> + <!--<el-form-item label="字体透明度" style="padding: 10px"> + <el-input-number v-model="typographyLight" :min="1" :max="100" label="描述文字">%</el-input-number> + </el-form-item>--> + </div> + </el-tab-pane> + </el-tabs> + </div> + + <div class="form-group "> + <div class="col-sm-12 text-center"> + <el-button type="primary" @click="dataSubmit('ruleForm')">保存</el-button> + <el-button type="danger" @click="cancelSubmit">关闭</el-button> + </div> + </div> + </el-main> + + </el-container> + + </el-form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的活动对象 + var actId = $.query.get("actId"); + const prize = { + //奖品基本信息 + awardType:'1', + awardName:'', + introduceImg:'', + introduceTip:'', + awardInventoryCnt:'', + awardDistributeCnt:'', + awardWay:'1', + operationTip:'', + prizeAddress:'', + prizeTime: '', + wechatImg:'', + scoreCnt:'', + couponId:'', + goodsId:'', + couponName:'', + customerPhone:'', + goodsName:'', + } + var app = new Vue({ + el: '#app', + data: { + activeName: 'first', + formLabelWidth: '120px', + + activeClickTab:0, + //优惠券搜索弹出 + drawerCoupon: false, + directionCoupon: 'rtl', + tableHeightCoupon: 500, + //--优惠券 + formCoupon:{ + yhjmc:'', + order:'', + sort:'' + }, + couponList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //品项搜索弹出 + drawerGoods: false, + directionGoods: 'rtl', + tableHeightGoods: 500, + //--品项 + formGoods:{ + cpmc:'', + order:'', + sort:'' + }, + goodsList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //标题图片 + imageLine: "../../../images/luckyDraw/line.png", + imageUrlTitle: "../../../images/luckyDraw/start.png", + imageUrlButton: "", + imageUrlHead: "../../../images/luckyDraw/zhuanpan.png", + + //字体颜色 + typographyColor: '#409EFF', + //背景颜色 + backgroundColor: '#409EFF', + //字体大小 + typographyNum: '5', + //字体透明度 + typographyLight: '50', + //奖品设置 + prize:JSON.parse(JSON.stringify(prize)), + editableTabsValue: '1', + editableTabs: [{ + title: '谢谢参与', + name: '1', + content: JSON.parse(JSON.stringify(prize)) + }], + tabIndex: 1, + + ruleForm : { + //商品基本信息 + actName : '', + actCode : '', + actTime : '', + //抽奖规则 + wmkcjjh : '5', + dhycjfs : '20', + jfdhcs : '10', + zzjcs : '5', + zzjl : '10', + + //规则说明 + ruleExplain : '', + }, + rules : { + //商品基本信息 + actName : [ + { required: true, message: '请输入活动名称', trigger: 'blur' } + ], + actCode : [ + { required: true, message: '请输入活动编码', trigger: 'blur' } + ], + actTime : [ + { required: true, message: '请选择日期', trigger: 'change' } + ], + wmkcjjh : [ + { required: true, message: '请输入1到10的数字', trigger: 'blur' } + ], + dhycjfs : [ + { required: true, message: '请输入1到200的数字', trigger: 'blur' } + ], + jfdhcs : [ + { required: true, message: '请输入1到10的数字', trigger: 'blur' } + ], + zzjcs : [ + { required: true, message: '请输入1到100的数字', trigger: 'blur' } + ], + zzjl : [ + { required: true, message: '请输入1到100的数字', trigger: 'blur' } + ], + ruleExplain : [ + { required: true, message: '请输入规则内容', trigger: 'blur' } + ] + }, + }, + created: function () { + }, + methods: { + //选择优惠券 + chooseCoupon(val,name){ + let _this = this; + _this.drawerCoupon = true; + _this.activeClickTab = parseInt(name); + _this.formCoupon.yhjmc = val; + _this.loadCouponList(); + }, + //--优惠券 + loadCouponList() { + let _this = this; + let data=_this.getRequestParamCoupon(); + data.pageSize=_this.couponList.pageSize; + data.pageNum=_this.couponList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectCouponList', + callback: function (data) { + _this.couponList.rows = data.rows; + _this.couponList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamCoupon(){ + let _this = this; + return { + yhjmc:_this.formCoupon.yhjmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormCoupon:function(){ + this.couponList.currentPage=1; + this.loadCouponList(); + }, + //重置 + resetFormCoupon(formName) { + // this.formCoupon.yhjmc = '' + // console.log(this.$refs[formName].resetFields) + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeCoupon(val) { + this.couponList.pageSize = val; + this.loadCouponList(); + }, + changeCurrentPageCoupon(val) { + this.couponList.currentPage = val; + this.loadCouponList(); + }, + //选择 + chooseOneCoupon(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.couponId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.couponName = row.cname; + _this.drawerCoupon = false; + }, + + //选择品项 + chooseGoods(val,name){ + let _this = this; + _this.drawerGoods = true; + _this.activeClickTab = parseInt(name); + _this.formGoods.cpmc = val; + _this.loadGoodsList(); + }, + //--品项 + loadGoodsList() { + let _this = this; + let data=_this.getRequestParamGoods(); + data.pageSize=_this.goodsList.pageSize; + data.pageNum=_this.goodsList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectGoodsList', + callback: function (data) { + _this.goodsList.rows = data.rows; + _this.goodsList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamGoods(){ + let _this = this; + return { + cpmc:_this.formCoupon.cpmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormGoods:function(){ + this.goodsList.currentPage=1; + this.loadGoodsList(); + }, + //重置 + resetFormGoods(formName) { + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeGoods(val) { + this.goodsList.pageSize = val; + this.loadGoodsList(); + }, + changeCurrentPageGoods(val) { + this.goodsList.currentPage = val; + this.loadGoodsList(); + }, + //选择 + chooseOneGoods(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.goodsId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.goodsName = row.name; + _this.drawerGoods = false; + }, + + //保存 + dataSubmit : function(formName) { + const _this = this; + let flag = false; + _this.$refs[formName].validate((valid) => { + if (!valid) { + _this.$notify({ + title: '提示', + message: '请完善转盘抽奖活动信息', + type: 'warning' + }); + flag = true; + return; + } + }); + if (flag) { + return; + } + //活动基本信息 + let luckyDrawBasicJsonDto = { + ruleExplain: _this.ruleForm.ruleExplain, + //字体颜色 + typographyColor: _this.typographyColor, + //背景颜色 + backgroundColor: _this.backgroundColor, + //字体大小 + typographyNum: _this.typographyNum, + //标题图片 + imageUrlTitle: _this.imageUrlTitle, + imageLine: _this.imageLine, + imageUrlHead: _this.imageUrlHead, + imageUrlButton: _this.imageUrlButton, + //抽奖规则 + wmkcjjh: _this.ruleForm.wmkcjjh, + dhycjfs: _this.ruleForm.dhycjfs, + jfdhcs: _this.ruleForm.jfdhcs, + zzjcs: _this.ruleForm.zzjcs, + zzjl: _this.ruleForm.zzjl, + } + //奖品信息 + let luckyDrawAwardSets = []; + for (let i = 0; i < _this.editableTabs.length; i++) { + let prize = _this.editableTabs[i].content; + let name = _this.editableTabs[i].title; + let awardRule = 2; + if(name == "谢谢参与"){ + awardRule = 1; + } + let activitySignAwardSet = { + awardRule: awardRule, + awardType: prize.awardType, + awardName: prize.awardName, + introduceImg: prize.introduceImg, + introduceTip: prize.introduceTip, + awardInventoryCnt: prize.awardInventoryCnt, + awardDistributeCnt: prize.awardDistributeCnt, + awardWay: prize.awardWay, + operationTip: prize.operationTip, + prizeAddress: prize.prizeAddress, + wechatImg: prize.wechatImg, + customerPhone: prize.customerPhone, + scoreCnt: prize.scoreCnt, + couponId: prize.couponId, + goodsId: prize.goodsId, + couponName: prize.couponName, + goodsName: prize.goodsName, + prizeStartTime: prize.prizeTime[0], + prizeEndTime: prize.prizeTime[1], + } + luckyDrawAwardSets.push(activitySignAwardSet); + } + let resultData = { + actName: _this.ruleForm.actName, + actCode: _this.ruleForm.actCode, + beginTime : _this.ruleForm.actTime[0], + endTime : _this.ruleForm.actTime[1], + luckyDrawBasicJsonDto, + luckyDrawAwardSets, + } + AjaxProxy.requst({ + app: _this, + data: resultData, + url: basePath + '/admin/activitySignAwardSet/addLuckyDrawSet', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + }); + parent.layer.close(parent.layer.getFrameIndex(window.name)); + } + }); + }, + //奖品设置 + addTab(targetName) { + let newTabName = ++this.tabIndex + ''; + this.editableTabs.push({ + title: "转盘奖品"+"("+newTabName+")", + name: newTabName, + content: JSON.parse(JSON.stringify(prize)), + }); + this.editableTabsValue = newTabName; + this.activeClickTab = parseInt(newTabName); + }, + clickSecondTab(targetName) { + this.activeClickTab = 1; + }, + clickTab(targetName) { + console.log(targetName.name); + this.activeClickTab = parseInt(targetName.name); + }, + removeTab(targetName) { + let tabs = this.editableTabs; + let activeName = this.editableTabsValue; + if(activeName === '1' || targetName === '1'){ + this.$notify({ + title: '提示', + message: '【谢谢参与】不能删除', + type: 'warning' + }); + }else{ + if (activeName === targetName) { + tabs.forEach((tab, index) => { + if (tab.name === targetName && tab.title !== "谢谢参与") { + let nextTab = tabs[index + 1] || tabs[index - 1]; + if (nextTab) { + activeName = nextTab.name; + } + } + }); + } + this.editableTabsValue = activeName; + this.editableTabs = tabs.filter(tab => tab.name !== targetName); + this.tabIndex = this.editableTabs.length; + } + }, + //切换奖项类型,显示不同内容 + jxlxChange(val){ + let _this = this; + _this.isShow=val; + }, + //切换兑奖方式,显示不同内容 + awardWayChange(val){ + let _this = this; + _this.isShow=val; + }, + //跳转到图片上传 + uploadImg(){ + this.activeName = 'third'; + }, + //跳转到规则说明 + gzsmSet(){ + this.activeName = 'fourth'; + }, + //标题图片 + imageUrlTitleSuccess(res, file) { + this.imageUrlTitle = res.path; + }, + imageLineSuccess(res, file) { + this.imageLine = res.path; + }, + imageUrlHeadSuccess(res, file) { + this.imageUrlHead = res.path; + }, + imageUrlButtonSuccess(res, file) { + this.imageUrlButton = res.path; + }, + //奖品设置的图片介绍 + introduceImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.introduceImg = res.path; + }, + //奖品设置的客服微信 + wechatImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.wechatImg = res.path; + }, + cancelSubmit() { + this.closeFrame(); + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-market.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-market.html new file mode 100644 index 0000000..db5f1e4 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-market.html @@ -0,0 +1,216 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + + .button { + padding: 0; + float: right; + } + + .image { + width: 100%; + height: 100%; + display: block; + } + + .clearfix:before, + .clearfix:after { + display: table; + content: ""; + } + + .clearfix:after { + clear: both + } + + .box-card { + padding: 5px 5px; + margin-right: 40px; + } + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-row style="padding:20px;"> +<!-- <el-col :span="4">--> +<!-- <el-card class="box-card" :body-style="{ padding: '10px 10px'}">--> +<!-- <img src="../../../images/sign/meiriqiandao.png" class="image">--> +<!-- <div style="padding: 5px;">--> +<!-- <span style="padding:5px;font-size: 18px;">每日签到</span>--> +<!-- <div class="bottom clearfix">--> +<!-- <el-button type="primary" size="mini" class="button" @click="createSign()" round>马上创建</el-button>--> +<!-- </div>--> +<!-- </div>--> +<!-- </el-card>--> +<!-- </el-col>--> + <el-col :span="4"> + <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> + <img src="../../../images/sign/tiantianpingtuan.png" class="image"> + <div style="padding: 5px;"> + <span style="padding:5px;font-size: 18px;">拼团</span> + <div class="bottom clearfix"> + <el-button type="primary" size="mini" class="button" @click="openAdd(1)" round>马上创建</el-button> + </div> + </div> + </el-card> + </el-col> + <el-col :span="4"> + <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> + <img src="../../../images/sign/jisumiaosha.png" class="image"> + <div style="padding: 5px;"> + <span style="padding:5px;font-size: 18px;">秒杀</span> + <div class="bottom clearfix"> + <el-button type="primary" size="mini" class="button" @click="openSecKill()" round>马上创建</el-button> + </div> + </div> + </el-card> + </el-col> + <el-col :span="4"> + <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> + <img src="../../../images/sign/shalonghuodong.png" class="image"> + <div style="padding: 5px;"> + <span style="padding:5px;font-size: 18px;">沙龙</span> + <div class="bottom clearfix"> + <el-button type="primary" size="mini" class="button" @click="openSalon()" round>马上创建</el-button> + </div> + </div> + </el-card> + </el-col> + </el-row> +<!-- <el-row style="padding:20px;">--> +<!-- <el-col :span="4">--> +<!-- <el-card class="box-card" :body-style="{ padding: '10px 10px'}">--> +<!-- <img src="../../../images/luckyDraw/zhuanpanchoujian.png" class="image">--> +<!-- <div style="padding: 5px;">--> +<!-- <span style="padding:5px;font-size: 18px;">转盘抽奖</span>--> +<!-- <div class="bottom clearfix">--> +<!-- <el-button type="primary" size="mini" class="button" @click="createLuckyDraw()" round>马上创建</el-button>--> +<!-- </div>--> +<!-- </div>--> +<!-- </el-card>--> +<!-- </el-col>--> +<!-- </el-row>--> + +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + var app = new Vue({ + el: '#app', + data: { + imageUrlqd: "../../images/sign/meiriqiandao.png", + imageUrlms: "../../images/sign/jisumiaosha.png", + imageUrlpt: "../../images/sign/tiantianpingtuan.png", + imageUrlsl: "../../images/sign/shalonghuodong.png", + }, + created: function () { + }, + methods: { + //跳转到设置转盘抽奖 + createLuckyDraw(){ + $.AjaxProxy().invoke(basePath + "/admin/activitySignAwardSet/createLuckyDrawSet", function(loj) { + if (loj[0].result.status == '200') { + layer.full(layer.open({ + type: 2, + title: "转盘抽奖管理", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-luckyDraw'] + })); + }else{ + _this.$message({ + message: data.info, + type: 'success', + }); + } + }); + }, + //跳转到设置签到活动 + createSign(){ + $.AjaxProxy().invoke(basePath + "/admin/activitySignAwardSet/createSignAwardSet", function(loj) { + if (loj[0].result.status == '200') { + layer.full(layer.open({ + type: 2, + title: "签到管理", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-sign'] + })); + }else{ + _this.$message({ + message: data.info, + type: 'success', + }); + } + }); + }, + // 打新增拼团界面 + openAdd(value) { + layer.full(layer.open({ + type : 2, + title : "新建拼团", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/activitiesGroupBuy-form'] + })); + }, + + // 打开新增秒杀界面 + openSecKill() { + layer.full(layer.open({ + type : 2, + title : "新建秒杀", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/activitiesSecKill-form'] + })); + }, + + // 打开新增沙龙界面 + openSalon() { + layer.full(layer.open({ + type : 2, + title : "新建沙龙", + area : [ MUI.SIZE_L, MUI.SIZE_L ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/activities/activitiesSalon-form'] + })); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-logistics-info.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-logistics-info.html new file mode 100644 index 0000000..46fa5e1 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-logistics-info.html @@ -0,0 +1,340 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <style> + + .el-aside { + background-color: #fff; + color: #333; + } + .el-main { + background-color: #fff; + color: #333; + } + body > .el-container { + margin-bottom: 1000px; + } + + </style> +</head> + +<body> +<div class="ibox-content" id="app" v-cloak> + <el-container> + <el-aside width="50%"> + <el-row style="padding: 20px"> + <p class="el-big-title">中奖信息</p> + </el-row> + <el-row style="margin-top: 10px;"> + <el-col> + <el-form :model="formSelect"> + <el-row> + <el-form-item label="奖品名称:" :label-width="formLabelWidth"> + {{formSelect.jpmc}} + </el-form-item> + </el-row> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="奖品图片:" :label-width="formLabelWidth"> + <img :src="formSelect.jptp" style="max-width: 200px;"> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="数量:" :label-width="formLabelWidth"> + {{formSelect.sl}} + </el-form-item> + </el-col> + </el-row> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="中奖人:" :label-width="formLabelWidth"> + {{formSelect.zjr}} + </el-form-item> + </el-col> + <el-col> + <el-form-item label="中奖时间:" :label-width="formLabelWidth"> + {{formSelect.zjsj}} + </el-form-item> + </el-col> + </el-row> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="活动名称:" :label-width="formLabelWidth"> + {{formSelect.hdmc}} + </el-form-item> + </el-col> + <el-col> + <el-form-item label="活动编号:" :label-width="formLabelWidth"> + {{formSelect.hdbh}} + </el-form-item> + </el-col> + </el-row> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="兑奖方式:" :label-width="formLabelWidth"> + <span v-if="formSelect.djfs == 1">线下兑换</span> + <span v-if="formSelect.djfs == 2">物流配送</span> + <span v-if="formSelect.djfs == 3">客服兑换</span> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="兑奖时间:" :label-width="formLabelWidth"> + {{formSelect.djsj}} + </el-form-item> + </el-col> + </el-row> + </el-form> + </el-col> + </el-row> + <el-row style="padding: 20px"> + <p class="el-big-title">收货地址</p> + </el-row> + <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px"> + <el-row style="padding: 10px"> + <el-col class="col-sm-10" > + <el-form-item label="收货人:" prop="consignee"> + <el-input v-model="ruleForm.consignee" :disabled="(formSelect.state == 3 ? true:false)"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row style="padding: 10px"> + <el-col class="col-sm-10" > + <el-form-item label="联系电话:" prop="consigneePhone"> + <el-input v-model="ruleForm.consigneePhone" :disabled="(formSelect.state == 3 ? true:false)"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row style="padding: 10px"> + <el-col class="col-sm-10" > + <el-form-item label="收货地址:" prop="consigneeAddress"> + <el-input v-model="ruleForm.consigneeAddress" :disabled="(formSelect.state == 3 ? true:false)"></el-input> + </el-form-item> + </el-col> + </el-row> + + <el-row style="padding: 20px"> + <p class="el-big-title">发货信息</p> + </el-row> + <el-row style="padding: 10px"> + <el-col class="col-sm-10" > + <el-form-item label="配送方式:" > + <span>物流配送</span> + </el-form-item> + </el-col> + </el-row> + <el-row style="padding: 10px"> + <el-col class="col-sm-10" v-show='false'> + <el-form-item label="快递公司编码:"> + <el-input v-model="ruleForm.kdgs" :disabled="(formSelect.state == 3 ? true:false)"></el-input> + </el-form-item> + </el-col> + <el-col class="col-sm-10" > + <el-form-item label="快递公司" prop="kdgs"> + <el-select v-model="ruleForm.kdgs" :disabled="(formSelect.state == 3 ? true:false)" placeholder="请选择" filterable> + <el-option v-for="item in logisticsList " :key="item.code" :label="item.name" :value="item.code"> + </el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row style="padding: 10px"> + <el-col class="col-sm-10" > + <el-form-item label="快递单号:" prop="kddh"> + <el-input :disabled="(formSelect.state == 3 ? true:false)" v-model="ruleForm.kddh"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row style="padding: 10px"> + <el-col class="col-sm-12 text-center"> + <el-button type="primary" v-if="formSelect.djfs == 2 && formSelect.state != 3" @click="dataSubmit('ruleForm')">发货</el-button> + <el-button type="danger" @click="cancelSubmit">关闭</el-button> + </el-col> + </el-row> + </el-form> + </el-aside> + + <el-main width="50%"> + <el-row> + <p class="el-big-title">物流跟踪</p> + </el-row> + + <el-row style="padding: 10px"> + <div class="block"> + <el-timeline :reverse="reverse"> + <el-timeline-item + v-for="(activity, index) in activities" + :key="index" + :timestamp="activity.timestamp" placement="top"> + <el-card> + <p>{{activity.content}}</p> + </el-card> + </el-timeline-item> + </el-timeline> + </div> + </el-row> + + </el-main> + + </el-container> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + +<script> + var writeoffId = $.query.get("writeoffId"); + var app = new Vue({ + el: '#app', + data: { + formLabelWidth: '120px', + //基本信息 + formSelect: { + jpmc: '', + jptp: '', + sl: '', + zjr: '', + zjsj: '', + hdmc: '', + hdbh: '', + djfs: '', + state: '', + djsj: '', + }, + //物流信息 + logisticsList:[], + ruleForm : { + consignee:'', + consigneePhone:'', + consigneeAddress:'', + kdgs:'', + kddh:'', + }, + //物流跟踪 + reverse: true, + activities: [], + + rules : { + consignee : [ + { required: true, message: '请输入收货人', trigger: 'blur' } + ], + consigneePhone : [ + { required: true, message: '请输入联系电话', trigger: 'blur' } + ], + consigneeAddress : [ + { required: true, message: '请输入收货地址', trigger: 'blur' } + ], + kdgs : [ + { required: true, message: '请选择快递公司', trigger: 'change' } + ], + kddh : [ + { required: true, message: '请输入快递单号', trigger: 'blur' } + ], + }, + }, + created: function () { + this.loadInfo(); + this.getlogisticsList(); + }, + mounted: function () { + }, + methods: { + //加载 + loadInfo() { + let _this = this; + //加载配置 + AjaxProxy.requst({ + app: _this, + data: {writeoffId}, + url: basePath + '/admin/activitySignWriteoff/findSignWriteoff', + callback: function (data) { + _this.formSelect = data.mapInfo.signWriteoffVo; + _this.ruleForm.consignee = data.mapInfo.signWriteoffVo.consignee; + _this.ruleForm.consigneePhone = data.mapInfo.signWriteoffVo.consigneePhone; + _this.ruleForm.consigneeAddress = data.mapInfo.signWriteoffVo.consigneeAddress; + _this.ruleForm.kdgs = data.mapInfo.signWriteoffVo.logisticsCompany; + _this.ruleForm.kddh = data.mapInfo.signWriteoffVo.logisticsNum; + _this.activities = data.mapInfo.signWriteoffVo.activities; + } + }); + }, + // 下拉框数据源---快递公司 + getlogisticsList() { + let _this = this; + AjaxProxy.requst({ + app: _this, + contentType: 'application/x-www-form-urlencoded', + data:{ + type: '快递公司' + }, + url: basePath + '/admin/dataDictionary/showDataDictionary', + callback: function (data) { + _this.logisticsList = data.rows; + } + }); + }, + //发货 + dataSubmit : function(formName) { + const _this = this; + let flag = false; + _this.$refs[formName].validate((valid) => { + if (!valid) { + flag = true; + return; + } + }); + if (flag) { + return; + } + let resultData = { + writeoffId : writeoffId, + shr : _this.ruleForm.consignee, + lxdh : _this.ruleForm.consigneePhone, + shdz : _this.ruleForm.consigneeAddress, + kdgs : _this.ruleForm.kdgs, + kddh : _this.ruleForm.kddh, + } + AjaxProxy.requst({ + app: _this, + data: resultData, + url: basePath + '/admin/activitySignWriteoff/logisticsSubmit', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + }); + _this.loadInfo(); + } + }); + }, + //关闭 + cancelSubmit() { + this.closeFrame(); + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + parent.location.reload(); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-receive.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-receive.html new file mode 100644 index 0000000..8f1da03 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-receive.html @@ -0,0 +1,294 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + .panel-body{ + overflow: hidden; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-row> + <el-row justify="space-between" type="flex"> + <el-col> + <el-form ref="form" :model="form" inline > + <el-form-item label="用户名称" prop="yhmc" > + <el-input v-model="form.yhmc" placeholder="用户名称"></el-input> + </el-form-item> + <el-form-item prop="qdsj" label="签到时间"> + <el-date-picker + v-model="form.qdsj" + type="datetimerange" + :picker-options="pickerOptions" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期" + align="right"> + </el-date-picker> + </el-form-item> + <el-button type="primary" @click="searchFormSignReceive" >搜索</el-button> + <el-button @click="resetFormSignReceive('form')">重置</el-button> + </el-form> + </el-col> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="signReceiveList.rows" + :height="height" + stripe:true + @sort-change="sortChange" + @selection-change="handleSelectionChange"> + <el-table-column + type="selection"> + </el-table-column> + <el-table-column + prop="nickName" + label="用户" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="reciveTime" + label="签到时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="状态" + show-overflow-tooltip> + <template slot-scope="scope"> + <span v-if="scope.row.state == 1">待领取</span> + <span v-if="scope.row.state == 2">已领取</span> + <span v-if="scope.row.state == 3">待配送</span> + <span v-if="scope.row.state == 4">待收货</span> + <span v-if="scope.row.state == 5">已失效</span> + </template> + </el-table-column> + <el-table-column + label="签到类型" + show-overflow-tooltip> + <template slot-scope="scope"> + <span v-if="scope.row.awardRule == 1">日常奖励</span> + <span v-if="scope.row.awardRule == 2">累计签到奖励</span> + </template> + </el-table-column> + <el-table-column + label="连续签到天数" + show-overflow-tooltip> + <template slot-scope="scope"> + <span v-if="scope.row.awardRule == 2">{{scope.row.cumulativeDay}}</span> + </template> + </el-table-column> + <el-table-column + label="奖品类型"> + <template slot-scope="scope"> + <span v-if="scope.row.awardType == 1">自定义礼品</span> + <span v-if="scope.row.awardType == 2">积分</span> + <span v-if="scope.row.awardType == 3">优惠券</span> + <span v-if="scope.row.awardType == 4">店铺商品</span> + </template> + </el-table-column> + <el-table-column + prop="awardName" + label="获得奖励" + show-overflow-tooltip> + </el-table-column> + + <el-table-column + label="奖励名称" + show-overflow-tooltip> + <template slot-scope="scope"> + {{scope.row.awardName}} + <span v-if="scope.row.awardType == 3">({{scope.row.couponName}})</span> + <span v-if="scope.row.awardType == 2">(*{{scope.row.scoreCnt}})</span> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSignReceive" + @current-change="changeCurrentPageSignReceive" + :current-page="signReceiveList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="signReceiveList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="signReceiveList.total"> + </el-pagination> + </el-row> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的活动对象 + var actId = $.query.get("actId"); + + var app = new Vue({ + el: '#app', + data: { + height:'calc(100vh - 200px)', + //--时间选择 + pickerOptions: { + shortcuts: [{ + text: '最近一周', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近三个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + } + }] + }, + // 条件查询 + form:{ + yhmc:'', + qdsj:'', + order:'', + sort:'' + }, + //活动列表 + signReceiveList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadSignReceiveList(); + }, + //--列表 + loadSignReceiveList() { + let _this = this; + let data=_this.getRequestParamSignReceive(); + data.pageSize=_this.signReceiveList.pageSize; + data.pageNum=_this.signReceiveList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/findSignReceiveList', + callback: function (data) { + _this.signReceiveList.rows = data.rows; + _this.signReceiveList.total = data.total; + } + }); + },//查询参数 + getRequestParamSignReceive(){ + let _this = this; + let startTime = ''; + let endTime = ''; + if(_this.form.qdsj.length > 0){ + startTime = _this.form.qdsj[0]; + endTime = _this.form.qdsj[1]; + } + return { + yhmc:_this.form.yhmc, + startTime:startTime, + endTime:endTime, + actId:actId, + order:_this.form.order, + sort:_this.form.sort, + } + }, + //查询 + searchFormSignReceive:function(){ + this.signReceiveList.currentPage=1; + this.loadSignReceiveList(); + }, + //重置 + resetFormSignReceive(formName) { + this.$refs[formName].resetFields(); + }, + changePageSignReceive(val) { + this.signReceiveList.pageSize = val; + this.loadSignReceiveList(); + }, + changeCurrentPageSignReceive(val) { + this.signReceiveList.currentPage = val; + this.loadSignReceiveList(); + }, + //排序 + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadInfo(); + } + }, + //选择 + handleSelectionChange(val) { + let _this = this; + _this.multipleSelection = val; + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-update.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-update.html new file mode 100644 index 0000000..896b822 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-update.html @@ -0,0 +1,1055 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + + .el-aside { + background-color: #D3DCE6; + color: #333; + text-align: center; + } + .el-main { + background-color: #E9EEF3; + color: #333; + } + body > .el-container { + margin-bottom: 1000px; + } + .button { + padding: 5px; + text-align: center; + } + + .imageOne { + display: block; + height: 50px; + padding: 5px 5px; + text-align: center; + } + .imageTwo { + display: block; + height: 280px; + padding: 5px 5px; + text-align: center; + } + .imageThree { + display: block; + padding: 5px 5px; + text-align: center; + } + + .box-card { + padding: 5px 5px; + } + + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-form :model="ruleForm" :rules="rules" class="form-horizontal" id="dataform" ref="ruleForm" label-width="120px"> + + <el-container> + <el-aside width="30%"> + <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> + <!--<div @click="uploadImg()" class="imageOne"> + <img v-if="imageUrlTitle" :src="imageUrlTitle" style="width: 100%;"> + <el-button type="primary" v-show="imageUrlTitle == ''" round><span style="font-size: 20px;">标题</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + </div>--> + <el-row> + <div @click="uploadImg()" class="imageTwo" > + <img v-if="imageUrlHead" :src="imageUrlHead" style="width: 100%;height: 100%"> + <el-button type="primary" v-show="imageUrlHead == ''" round><span style="font-size: 20px;">头部</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + </div> + </el-row> + <el-row style="display:flex;"> + <el-col> + <div style="padding:5px;font-size: 15px;text-align: left;"><span>您已累计签到<span style="color: red;">3</span>天</span></div> + </el-col> + <el-col> + <div style="padding:5px;font-size: 15px;text-align: right;"><span>签到提醒</span></div> + </el-col> + </el-row> + + <el-row> + <div @click="uploadImg()"> + <el-calendar :range="['2019-03-04', '2019-03-24']"></el-calendar> + <img v-if="imageUrlState" :src="imageUrlState" style="width: 100%;"> + <!--<el-button type="primary" v-show="imageUrlState == ''" round><span style="font-size: 20px;">日历签到背景</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button>--> + </div> + </el-row> + + <el-row> + <div @click="uploadImg()" class="imageThree" > + <el-button type="primary" v-show="imageUrlButton == ''" round><span style="font-size: 20px;">签到按钮</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + <img v-if="imageUrlButton" :src="imageUrlButton" style="width: 100%;"> + </div> + </el-row> + + + <el-row> + <div style="text-align: center;padding: 5px;" @click="gzsmSet()"> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 30px;">-- 规则说明--</span> + </div> + <div class="el-col-sm-24" style="text-align: center;"> + <span style="padding:5px;font-size: 15px;color: red;">(点击,编辑规则内容,背景颜色,字体颜色、大小、透明度)</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">1、每天参与签到可获得积分</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">2、连续签到7天将获得赠送大礼包</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">3、每7天重新开始计算</span> + </div> + </div> + </el-row> + </el-card> + </el-aside> + + <el-main width="70%"> + <div> + <el-tabs v-model="activeName" @tab-click="clickSecondTab"> + <el-tab-pane label="活动设置" name="first"> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动名称" prop="actName"> + <el-input v-model="ruleForm.actName" placeholder="请输入活动名称"></el-input> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动编码" prop="actCode"> + <el-input v-model.number="ruleForm.actCode" placeholder="请输入最大开团数量"></el-input> + </el-form-item> + </div> + <div class="col-sm-4 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动时间" prop="actTime"> + <div class="block"> + <el-date-picker + v-model="ruleForm.actTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </div> + </el-tab-pane> + + <el-tab-pane label="奖品设置" name="second"> + <el-row style="display:flex;"> + <el-col :span="20"> + <el-tabs v-model="editableTabsValue" type="card" closable @tab-click="clickTab" @tab-remove="removeTab"> + <el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title" :name="item.name"> + <el-row v-show="editableTabsValue !== '1'"> + <el-form-item label="签到累计天数"> + <el-input v-model.number="item.content.cumulativeDay" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-row> + <el-row> + <el-form-item label="奖项类型"> + <el-col> + <el-radio-group v-model="item.content.awardType" @change="jxlxChange"> + <el-radio :label="1">自定义奖品</el-radio> + <el-radio :label="2">积分</el-radio> + <el-radio :label="3">优惠券</el-radio> + <el-radio :label="4">商品</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-row> + <el-row > + <el-col> + <el-form-item label="奖项名称"> + <el-input v-model="item.content.awardName" placeholder="奖项名称"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="图片介绍"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="introduceImgSuccess"> + <img v-if="item.content.introduceImg" :src="item.content.introduceImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + + <div v-show="item.content.awardType !== 2"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="奖项库存"> + <el-input v-model="item.content.awardInventoryCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="已派发"> + <el-input v-model="item.content.awardDistributeCnt"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === 1"> + <el-row > + <el-col> + <el-form-item label="文字介绍"> + <el-input type="textarea" v-model="item.content.introduceTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="兑奖方式"> + <el-col> + <el-radio-group v-model="item.content.awardWay" @change="awardWayChange"> + <el-radio :label="1">线下兑换</el-radio> + <el-radio :label="2">物流配送</el-radio> + <el-radio :label="3">客服兑换</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="操作提示"> + <el-input v-model="item.content.operationTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <div v-show="item.content.awardWay === 1"> + <el-row > + <el-col> + <el-form-item label="兑奖地址"> + <el-input v-model="item.content.prizeAddress"></el-input> + </el-form-item> + </el-col> + </el-row> + + </div> + <div v-show="item.content.awardWay === 3"> + <el-row > + <el-col> + <el-form-item label="客服微信"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="wechatImgSuccess"> + <img v-if="item.content.wechatImg" :src="item.content.wechatImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="[1,3].includes(item.content.awardWay)"> + <el-row > + <el-col> + <el-form-item label="客服电话"> + <el-input v-model="item.content.customerPhone"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardWay !== 2"> + <el-row > + <el-col> + <el-form-item label="兑奖期限"> + <div class="block"> + <el-date-picker + v-model="item.content.prizeTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </el-col> + </el-row> + </div> + </div> + <div v-show="item.content.awardType === 2"> + <el-row > + <el-col> + <el-form-item label="积分数量"> + <el-input v-model="item.content.scoreCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === 3"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="优惠券名称"> + <el-input v-model="item.content.couponName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="优惠券"> + <el-input v-model="item.content.couponId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseCoupon(item.content.couponName,item.name)"> + 选择优惠券 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择商城优惠券" + :visible.sync="drawerCoupon" + :direction="directionCoupon" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formCoupon" :model="formCoupon" inline > + <el-form-item prop="yhjmc"> + <el-input v-model="formCoupon.yhjmc" placeholder="请输入优惠券名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormCoupon" >搜索</el-button> + <el-button @click="resetFormCoupon('formCoupon')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="couponList.rows" + :height="tableHeightCoupon" + stripe:true + style="width: 100%"> + <el-table-column + prop="cname" + label="优惠券名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="endTime" + label="截止日期" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneCoupon(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeCoupon" + @current-change="changeCurrentPageCoupon" + :current-page="couponList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="couponList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="couponList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + + </div> + <div v-show="item.content.awardType === 4"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="品项名称"> + <el-input v-model="item.content.goodsName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="品项"> + <el-input v-model="item.content.goodsId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseGoods(item.content.goodsName,item.name)"> + 选择品项 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择ERP产品" + :visible.sync="drawerGoods" + :direction="directionGoods" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formGoods" :model="formGoods" inline > + <el-form-item prop="cpmc"> + <el-input v-model="formGoods.cpmc" placeholder="请输入产品名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormGoods" >搜索</el-button> + <el-button @click="resetFormGoods('formGoods')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="goodsList.rows" + :height="tableHeightGoods" + stripe:true + style="width: 100%"> + <el-table-column + prop="name" + label="名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneGoods(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeGoods" + @current-change="changeCurrentPageGoods" + :current-page="goodsList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="goodsList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="goodsList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + + </div> + </el-tab-pane> + </el-tabs> + </el-col> + <el-col :span="4"> + <el-button type="primary" @click="addTab(editableTabsValue)"> + 新增奖品 + </el-button> + </el-col> + </el-row> + </el-tab-pane> + + <el-tab-pane label="背景图片上传" name="third"> + <!--<div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="标题"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlTitleSuccess"> + <img v-if="imageUrlTitle" :src="imageUrlTitle" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div>--> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="头部"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlHeadSuccess"> + <img v-if="imageUrlHead" :src="imageUrlHead" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + <!--<div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="日历签到背景"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlStateSuccess"> + <img v-if="imageUrlState" :src="imageUrlState" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div>--> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="签到按钮"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlButtonSuccess"> + <img v-if="imageUrlButton" :src="imageUrlButton" style="max-width: 300px;"> + <i v-else></i> + </el-upload> + </el-form-item> + </div> + </el-tab-pane> + + <el-tab-pane label="规则说明" name="fourth"> + <div class="col-sm-8 col-sm-offset-1"> + <el-form-item label="规则内容" prop="ruleExplain" style="padding: 10px"> + <el-input type="textarea" v-model="ruleForm.ruleExplain"></el-input> + </el-form-item> + <el-form-item label="背景颜色" style="padding: 10px"> + <el-color-picker v-model="backgroundColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体颜色" style="padding: 10px"> + <el-color-picker v-model="typographyColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体大小" style="padding: 10px"> + <el-input-number v-model="typographyNum" :min="10" :max="50" label="描述文字"></el-input-number> + </el-form-item> + <!--<el-form-item label="字体透明度" style="padding: 10px"> + <el-input-number v-model="typographyLight" :min="1" :max="100" label="描述文字">%</el-input-number> + </el-form-item>--> + </div> + </el-tab-pane> + </el-tabs> + </div> + + <div class="form-group "> + <div class="col-sm-12 text-center"> + <el-button type="primary" @click="updateSignAwardSet('ruleForm')">保存</el-button> + <el-button type="danger" @click="cancelSubmit">关闭</el-button> + </div> + </div> + </el-main> + + </el-container> + + </el-form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的活动对象 + var actId = $.query.get("actId"); + const prize = { + //奖品基本信息 + id:'', + cumulativeDay:'', + awardType:1, + awardName:'', + introduceImg:'', + introduceTip:'', + awardInventoryCnt:'', + awardDistributeCnt:'', + awardWay:1, + operationTip:'', + prizeAddress:'', + prizeTime: '', + wechatImg:'', + scoreCnt:'', + couponId:'', + customerPhone:'', + goodsId:'', + couponName:'', + goodsName:'', + } + var app = new Vue({ + el: '#app', + data: { + activeName: 'first', + formLabelWidth: '120px', + //标题图片 + imageUrlTitle: '', + imageUrlHead: "../../../images/sign/signHead.png", + imageUrlButton: "../../../images/sign/signButton.png", + imageUrlState: '', + + activeClickTab:0, + + //优惠券搜索弹出 + drawerCoupon: false, + directionCoupon: 'rtl', + tableHeightCoupon: 500, + //--优惠券 + formCoupon:{ + yhjmc:'', + order:'', + sort:'' + }, + couponList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //品项搜索弹出 + drawerGoods: false, + directionGoods: 'rtl', + tableHeightGoods: 500, + //--品项 + formGoods:{ + cpmc:'', + order:'', + sort:'' + }, + goodsList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //字体颜色 + typographyColor: '#409EFF', + //背景颜色 + backgroundColor: '#409EFF', + //字体大小 + typographyNum: '5', + //字体透明度 + typographyLight: '50', + //奖品设置 + prize:JSON.parse(JSON.stringify(prize)), + editableTabsValue: '1', + editableTabs: [{ + title: '签到日常奖励', + name: '1', + content: JSON.parse(JSON.stringify(prize)) + }], + tabIndex: 1, + + ruleForm : { + //商品基本信息 + actName : '', + actCode : '', + actTime : '', + //规则说明 + ruleExplain : '', + }, + rules : { + //商品基本信息 + actName : [ + { required: true, message: '请输入活动名称', trigger: 'blur' } + ], + actCode : [ + { required: true, message: '请输入活动编码', trigger: 'blur' } + ], + actTime : [ + { required: true, message: '请选择日期', trigger: 'change' } + ], + ruleExplain : [ + { required: true, message: '请输入规则内容', trigger: 'blur' } + ] + }, + }, + created: function () { + this.loadInfo(); + }, + methods: { + //选择优惠券 + chooseCoupon(val,name){ + let _this = this; + _this.drawerCoupon = true; + _this.activeClickTab = parseInt(name); + + console.log(_this.activeClickTab); + _this.formCoupon.yhjmc = val; + _this.loadCouponList(); + }, + //--优惠券 + loadCouponList() { + let _this = this; + let data=_this.getRequestParamCoupon(); + data.pageSize=_this.couponList.pageSize; + data.pageNum=_this.couponList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectCouponList', + callback: function (data) { + _this.couponList.rows = data.rows; + _this.couponList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamCoupon(){ + let _this = this; + return { + yhjmc:_this.formCoupon.yhjmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormCoupon:function(){ + this.couponList.currentPage=1; + this.loadCouponList(); + }, + //重置 + resetFormCoupon(formName) { + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeCoupon(val) { + this.couponList.pageSize = val; + this.loadCouponList(); + }, + changeCurrentPageCoupon(val) { + this.couponList.currentPage = val; + this.loadCouponList(); + }, + //选择 + chooseOneCoupon(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.couponId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.couponName = row.cname; + _this.drawerCoupon = false; + }, + + //选择品项 + chooseGoods(val,name){ + let _this = this; + _this.drawerGoods = true; + _this.activeClickTab = parseInt(name); + _this.formGoods.cpmc = val; + _this.loadGoodsList(); + }, + //--品项 + loadGoodsList() { + let _this = this; + let data=_this.getRequestParamGoods(); + data.pageSize=_this.goodsList.pageSize; + data.pageNum=_this.goodsList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectGoodsList', + callback: function (data) { + _this.goodsList.rows = data.rows; + _this.goodsList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamGoods(){ + let _this = this; + return { + cpmc:_this.formCoupon.cpmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormGoods:function(){ + this.goodsList.currentPage=1; + this.loadGoodsList(); + }, + //重置 + resetFormGoods(formName) { + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeGoods(val) { + this.goodsList.pageSize = val; + this.loadGoodsList(); + }, + changeCurrentPageGoods(val) { + this.goodsList.currentPage = val; + this.loadGoodsList(); + }, + //选择 + chooseOneGoods(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.goodsId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.goodsName = row.name; + _this.drawerGoods = false; + }, + + //加载活动详情 + loadInfo() { + let _this = this; + _this.loadSign(); + }, + loadSign() { + let _this = this; + let data={ + actId:actId, + }; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/findSignForUpdate', + callback: function (data) { + _this.ruleForm.actName = data.mapInfo.addSignAwardSetVo.actName; + _this.ruleForm.actCode = data.mapInfo.addSignAwardSetVo.actCode; + let arrayObj = new Array(); + arrayObj.push(new Date(data.mapInfo.addSignAwardSetVo.beginTime)); + arrayObj.push(new Date(data.mapInfo.addSignAwardSetVo.endTime)); + _this.ruleForm.actTime = arrayObj; + //字体颜色 + _this.ruleForm.ruleExplain = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.ruleExplain; + _this.typographyColor = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.typographyColor; + _this.backgroundColor = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.backgroundColor; + _this.typographyNum = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.typographyNum; + _this.typographyLight = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.typographyLight; + _this.imageUrlTitle = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlTitle; + _this.imageUrlHead = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlHead; + _this.imageUrlButton = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlButton; + _this.imageUrlState = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlState; + + for (let i = 0; i < data.mapInfo.addSignAwardSetVo.activitySignAwardSets.length; i++) { + _this.tabIndex = data.mapInfo.addSignAwardSetVo.activitySignAwardSets.length; + let prizeVo = data.mapInfo.addSignAwardSetVo.activitySignAwardSets[i]; + let arrayObjs = new Array(); + arrayObjs.push(new Date(prizeVo.prizeStartTime)); + arrayObjs.push(new Date(prizeVo.prizeEndTime)); + let content = JSON.parse(JSON.stringify(prize)); + content = { + id: prizeVo.id, + cumulativeDay: prizeVo.cumulativeDay, + awardType: parseInt(prizeVo.awardType), + awardName: prizeVo.awardName, + introduceImg: prizeVo.introduceImg, + customerPhone: prizeVo.customerPhone, + introduceTip: prizeVo.introduceTip, + awardInventoryCnt: prizeVo.awardInventoryCnt, + awardDistributeCnt: prizeVo.awardDistributeCnt, + awardWay: parseInt(prizeVo.awardWay), + operationTip: prizeVo.operationTip, + prizeAddress: prizeVo.prizeAddress, + wechatImg: prizeVo.wechatImg, + scoreCnt: prizeVo.scoreCnt, + couponId: prizeVo.couponId, + goodsId: prizeVo.goodsId, + couponName: prizeVo.couponName, + goodsName: prizeVo.goodsName, + prizeTime: arrayObjs, + } + if(i === 0){ + _this.editableTabs[0].content = content; + }else{ + let newTabName = i+1 +''; + _this.editableTabs.push({ + title: "商品奖励"+"("+newTabName+")", + name: newTabName, + content: content, + }); + this.editableTabsValue = newTabName; + } + } + } + }); + }, + //保存 + updateSignAwardSet : function(formName) { + const _this = this; + let flag = false; + _this.$refs[formName].validate((valid) => { + if (!valid) { + _this.$notify({ + title: '提示', + message: '请完善签到活动信息', + type: 'warning' + }); + flag = true; + return; + } + }); + if (flag) { + return; + } + //活动基本信息 + let signSetBasicJsonDto = { + ruleExplain: _this.ruleForm.ruleExplain, + //字体颜色 + typographyColor: _this.typographyColor, + //背景颜色 + backgroundColor: _this.backgroundColor, + //字体大小 + typographyNum: _this.typographyNum, + //字体透明度 + typographyLight: _this.typographyNum, + //标题图片 + imageUrlTitle: _this.imageUrlTitle, + imageUrlHead: _this.imageUrlHead, + imageUrlButton: _this.imageUrlButton, + imageUrlState: _this.imageUrlState, + } + //奖品信息 + let activitySignAwardSets = []; + for (let i = 0; i < _this.editableTabs.length; i++) { + let prize = _this.editableTabs[i].content; + let name = _this.editableTabs[i].title; + let awardRule = 2; + if(name == "签到日常奖励"){ + awardRule = 1; + } + let activitySignAwardSet = { + id: prize.id, + cumulativeDay: prize.cumulativeDay, + awardRule: awardRule, + awardType: prize.awardType, + awardName: prize.awardName, + introduceImg: prize.introduceImg, + introduceTip: prize.introduceTip, + awardInventoryCnt: prize.awardInventoryCnt, + awardDistributeCnt: prize.awardDistributeCnt, + awardWay: prize.awardWay, + operationTip: prize.operationTip, + customerPhone: prize.customerPhone, + prizeAddress: prize.prizeAddress, + wechatImg: prize.wechatImg, + scoreCnt: prize.scoreCnt, + couponId: prize.couponId, + goodsId: prize.goodsId, + couponName: prize.couponName, + goodsName: prize.goodsName, + prizeStartTime: prize.prizeTime[0], + prizeEndTime: prize.prizeTime[1], + } + activitySignAwardSets.push(activitySignAwardSet); + } + let resultData = { + actMainId: actId, + actName: _this.ruleForm.actName, + actCode: _this.ruleForm.actCode, + beginTime : _this.ruleForm.actTime[0], + endTime : _this.ruleForm.actTime[1], + signSetBasicJsonDto, + activitySignAwardSets, + } + AjaxProxy.requst({ + app: _this, + data: resultData, + url: basePath + '/admin/activitySignAwardSet/updateSignAwardSet', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + }); + } + }); + }, + //奖品设置 + addTab(targetName) { + let newTabName = ++this.tabIndex + ''; + this.editableTabs.push({ + title: "商品奖励"+"("+newTabName+")", + name: newTabName, + content: JSON.parse(JSON.stringify(prize)), + }); + this.editableTabsValue = newTabName; + this.activeClickTab = parseInt(newTabName); + }, + clickSecondTab(targetName) { + this.activeClickTab = 1; + }, + clickTab(targetName) { + console.log(targetName.name); + this.activeClickTab = parseInt(targetName.name); + }, + removeTab(targetName) { + let tabs = this.editableTabs; + let activeName = this.editableTabsValue; + if(activeName === '1' || targetName === '1'){ + this.$notify({ + title: '提示', + message: '【签到日常奖励】不能删除', + type: 'warning' + }); + }else{ + if (activeName === targetName) { + tabs.forEach((tab, index) => { + if (tab.name === targetName && tab.title !== "签到日常奖励") { + let nextTab = tabs[index + 1] || tabs[index - 1]; + if (nextTab) { + activeName = nextTab.name; + } + } + }); + } + this.editableTabsValue = activeName; + this.editableTabs = tabs.filter(tab => tab.name !== targetName); + this.tabIndex = this.editableTabs.length; + } + }, + //切换奖项类型,显示不同内容 + jxlxChange(val){ + let _this = this; + _this.isShow=val; + }, + //切换兑奖方式,显示不同内容 + awardWayChange(val){ + let _this = this; + _this.isShow=val; + }, + //跳转到图片上传 + uploadImg(){ + this.activeName = 'third'; + }, + //跳转到规则说明 + gzsmSet(){ + this.activeName = 'fourth'; + }, + //标题图片 + imageUrlTitleSuccess(res, file) { + this.imageUrlTitle = res.path; + }, + imageUrlHeadSuccess(res, file) { + this.imageUrlHead = res.path; + }, + imageUrlButtonSuccess(res, file) { + this.imageUrlButton = res.path; + }, + imageUrlStateSuccess(res, file) { + this.imageUrlState = res.path; + }, + //奖品设置的图片介绍 + introduceImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.introduceImg = res.path; + }, + //奖品设置的客服微信 + wechatImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.wechatImg = res.path; + }, + cancelSubmit() { + this.closeFrame(); + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff-info.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff-info.html new file mode 100644 index 0000000..07d826c --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff-info.html @@ -0,0 +1,197 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> +</head> + +<body> +<div class="ibox-content" id="app" v-cloak> + <el-row> + <p class="el-big-title">中奖信息</p> + </el-row> + <el-row style="margin-top: 20px;"> + <el-col> + <el-form :model="formSelect"> + <el-row> + <el-form-item label="奖品名称:" :label-width="formLabelWidth"> + {{formSelect.jpmc}} + </el-form-item> + </el-row> + <el-row style="display:flex;"> + <el-col :span="6"> + <el-form-item label="奖品图片:" :label-width="formLabelWidth"> + <img :src="formSelect.jptp" style="max-width: 200px;"> + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="数量:" :label-width="formLabelWidth"> + {{formSelect.sl}} + </el-form-item> + </el-col> + </el-row> + <el-row style="display:flex;"> + <el-col :span="6"> + <el-form-item label="中奖人:" :label-width="formLabelWidth"> + {{formSelect.zjr}} + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="中奖时间:" :label-width="formLabelWidth"> + {{formSelect.zjsj}} + </el-form-item> + </el-col> + </el-row> + <el-row style="display:flex;"> + <el-col :span="6"> + <el-form-item label="活动名称:" :label-width="formLabelWidth"> + {{formSelect.hdmc}} + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="活动编号:" :label-width="formLabelWidth"> + {{formSelect.hdbh}} + </el-form-item> + </el-col> + </el-row> + <el-row style="display:flex;"> + <el-col :span="6"> + <el-form-item label="兑奖方式:" :label-width="formLabelWidth"> + <span v-if="formSelect.djfs == 1">线下兑换</span> + <span v-if="formSelect.djfs == 2">物流配送</span> + <span v-if="formSelect.djfs == 3">客服兑换</span> + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="兑奖时间:" :label-width="formLabelWidth"> + {{formSelect.djsj}} + </el-form-item> + </el-col> + </el-row> + </el-form> + </el-col> + </el-row> + + <el-row style="margin-top: 20px;"> + <el-col class="col-sm-2" > + <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" v-if="formSelect.state == 1"> + <el-form-item label="兑奖码" prop="writeOffCode"> + <el-input v-model="ruleForm.writeOffCode" placeholder="请输入兑奖码"></el-input> + </el-form-item> + </el-form> + </el-col> + <el-col class="col-sm-2 text-center"> + <el-button type="primary" v-if="formSelect.state == 1" @click="dataSubmit('ruleForm')">核销</el-button> + <el-button type="danger" @click="cancelSubmit">关闭</el-button> + </el-col> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + +<script> + var writeoffId = $.query.get("writeoffId"); + var app = new Vue({ + el: '#app', + data: { + formLabelWidth: '120px', + formSelect: { + jpmc: '', + jptp: '', + sl: '', + zjr: '', + zjsj: '', + hdmc: '', + hdbh: '', + djfs: '', + state: '', + djsj: '' + }, + ruleForm : { + writeOffCode:'', + }, + rules : { + writeOffCode : [ + { required: true, message: '请输入兑奖码', trigger: 'blur' } + ], + }, + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + //加载配置 + AjaxProxy.requst({ + app: _this, + data: {writeoffId}, + url: basePath + '/admin/activitySignWriteoff/findSignWriteoff', + callback: function (data) { + _this.formSelect = data.mapInfo.signWriteoffVo; + } + }); + }, + //核销 + dataSubmit : function(formName) { + const _this = this; + let flag = false; + _this.$refs[formName].validate((valid) => { + if (!valid) { + flag = true; + return; + } + }); + if (flag) { + return; + } + let resultData = { + writeoffId : writeoffId, + writeOffCode : _this.ruleForm.writeOffCode, + } + AjaxProxy.requst({ + app: _this, + data: resultData, + url: basePath + '/admin/activitySignWriteoff/writeoffCodeSubmit', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + }); + _this.loadInfo(); + } + }); + }, + + cancelSubmit() { + this.closeFrame(); + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + parent.location.reload(); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff.html new file mode 100644 index 0000000..6b8aec3 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff.html @@ -0,0 +1,299 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + .panel-body{ + overflow: hidden; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-row> + <el-row style="display:flex;"> + <el-col> + <el-form ref="form" :model="form" inline > + <el-form-item label="中奖人名称" prop="yhmc" > + <el-input v-model="form.yhmc" placeholder="中奖人名称"></el-input> + </el-form-item> + <el-form-item label="输入活动名称/编码" prop="hdmcbm" > + <el-input v-model="form.hdmcbm" placeholder="输入活动名称/编码"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormSignReceive" >搜索</el-button> + <el-button @click="resetFormSignReceive('form')">重置</el-button> + </el-form> + </el-col> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="signWriteoffList.rows" + :height="height" + stripe:true + @sort-change="sortChange"> + <el-table-column + prop="receiveName" + label="中奖者" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="actName" + label="活动名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="awardName" + label="奖品名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="winTime" + label="中奖时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="状态"> + <template slot-scope="scope"> + <span v-if="scope.row.state == 1">待兑换</span> + <span v-if="scope.row.state == 2">待发货</span> + <span v-if="scope.row.state == 3">已兑换</span> + <span v-if="scope.row.state == 4">已失效</span> + </template> + </el-table-column> + <el-table-column + label="兑奖方式"> + <template slot-scope="scope"> + <span v-if="scope.row.awardWay == 1">线下兑换</span> + <span v-if="scope.row.awardWay == 2">物流配送</span> + <span v-if="scope.row.awardWay == 3">客服兑换</span> + </template> + </el-table-column> + <el-table-column + prop="writeoffTime" + label="核销时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="writeoffUser" + label="核销员" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="兑奖码" + show-overflow-tooltip> + <template slot-scope="scope"> + <span v-if="scope.row.state == 3">{{scope.row.writeoffCode}}</span> + </template> + </el-table-column> + <el-table-column + prop="receiveAddress" + label="收货地址" + show-overflow-tooltip> + </el-table-column> + <el-table-column label="操作" width="200"> + <template slot-scope="scope"> + <el-button type="primary" v-if="scope.row.awardWay == 2 && scope.row.state == 2" @click="jumpTologistics(scope.row)" size="mini">发货</el-button> + <el-button type="primary" v-if="scope.row.awardWay != 2 && scope.row.state == 1" @click="jumpToWriteOff(scope.row)" size="mini">核销</el-button> + + <el-button type="primary" v-if="scope.row.awardWay == 2" @click="jumpTologistics(scope.row)" size="mini">查看</el-button> + <el-button type="primary" v-if="scope.row.awardWay != 2" @click="jumpToWriteOff(scope.row)" size="mini">查看</el-button> + </template> + </el-table-column> + + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSignReceive" + @current-change="changeCurrentPageSignReceive" + :current-page="signWriteoffList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="signWriteoffList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="signWriteoffList.total"> + </el-pagination> + </el-row> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的活动对象 + var actId = $.query.get("actId"); + + var app = new Vue({ + el: '#app', + data: { + height:'calc(100vh - 200px)', + //--时间选择 + pickerOptions: { + shortcuts: [{ + text: '最近一周', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近三个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + } + }] + }, + // 条件查询 + form:{ + yhmc:'', + hdmcbm:'', + order:'', + sort:'' + }, + //核销列表 + signWriteoffList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadSignWriteoffList(); + }, + //跳转到核销 + jumpToWriteOff(row){ + layer.full(layer.open({ + type: 2, + title: "核销", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-sign-writeoff-info?writeoffId=' + row.id] + })); + }, + //跳转到发货 + jumpTologistics(row){ + layer.full(layer.open({ + type: 2, + title: "发货", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/activity/activity-sign-logistics-info?writeoffId=' + row.id] + })); + }, + //--列表 + loadSignWriteoffList() { + let _this = this; + let data=_this.getRequestParamSignWriteoff(); + data.pageSize=_this.signWriteoffList.pageSize; + data.pageNum=_this.signWriteoffList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignWriteoff/findSignWriteoffList', + callback: function (data) { + _this.signWriteoffList.rows = data.rows; + _this.signWriteoffList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamSignWriteoff(){ + let _this = this; + return { + zjzxm:_this.form.yhmc, + hdmcbm:_this.form.hdmcbm, + order:_this.form.order, + sort:_this.form.sort, + } + }, + //查询 + searchFormSignReceive:function(){ + this.signWriteoffList.currentPage=1; + this.loadSignWriteoffList(); + }, + //重置 + resetFormSignReceive(formName) { + this.$refs[formName].resetFields(); + }, + changePageSignReceive(val) { + this.signWriteoffList.pageSize = val; + this.loadSignWriteoffList(); + }, + changeCurrentPageSignReceive(val) { + this.signWriteoffList.currentPage = val; + this.loadSignWriteoffList(); + }, + //排序 + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadInfo(); + } + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign.html b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign.html new file mode 100644 index 0000000..733e4da --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/activity/activity-sign.html @@ -0,0 +1,983 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + + .el-aside { + background-color: #D3DCE6; + color: #333; + text-align: center; + } + .el-main { + background-color: #E9EEF3; + color: #333; + } + body > .el-container { + margin-bottom: 1000px; + } + .button { + padding: 5px; + text-align: center; + } + + .imageOne { + display: block; + height: 50px; + padding: 5px 5px; + text-align: center; + } + .imageTwo { + display: block; + height: 280px; + padding: 5px 5px; + text-align: center; + } + .imageThree { + display: block; + padding: 5px 5px; + text-align: center; + } + + .box-card { + padding: 5px 5px; + } + + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-form :model="ruleForm" :rules="rules" class="form-horizontal" id="dataform" ref="ruleForm" label-width="120px"> + + <el-container> + <el-aside width="30%"> + <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> + <!--<div @click="uploadImg()" class="imageOne"> + <img v-if="imageUrlTitle" :src="imageUrlTitle" style="width: 100%;"> + <el-button type="primary" v-show="imageUrlTitle == ''" round><span style="font-size: 20px;">标题</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + </div>--> + <el-row> + <div @click="uploadImg()" class="imageTwo" > + <img v-if="imageUrlHead" :src="imageUrlHead" style="width: 100%;height: 100%"> + <el-button type="primary" v-show="imageUrlHead == ''" round><span style="font-size: 20px;">头部</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + </div> + </el-row> + <el-row style="display:flex;"> + <el-col> + <div style="padding:5px;font-size: 15px;text-align: left;"><span>您已累计签到<span style="color: red;">3</span>天</span></div> + </el-col> + <el-col> + <div style="padding:5px;font-size: 15px;text-align: right;"><span>签到提醒</span></div> + </el-col> + </el-row> + + <el-row> + <div @click="uploadImg()"> + <el-calendar :range="['2019-03-04', '2019-03-24']"></el-calendar> + <img v-if="imageUrlState" :src="imageUrlState" style="width: 100%;"> + <!--<el-button type="primary" v-show="imageUrlState == ''" round><span style="font-size: 20px;">日历签到背景</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button>--> + </div> + </el-row> + + <el-row> + <div @click="uploadImg()" class="imageThree" > + <el-button type="primary" v-show="imageUrlButton == ''" round><span style="font-size: 20px;">签到按钮</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> + <img v-if="imageUrlButton" :src="imageUrlButton" style="width: 100%;"> + </div> + </el-row> + + + <el-row> + <div style="text-align: center;padding: 5px;" @click="gzsmSet()"> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 30px;">-- 规则说明--</span> + </div> + <div class="el-col-sm-24" style="text-align: center;"> + <span style="padding:5px;font-size: 15px;color: red;">(点击,编辑规则内容,背景颜色,字体颜色、大小、透明度)</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">1、每天参与签到可获得积分</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">2、连续签到7天将获得赠送大礼包</span> + </div> + <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> + <span style="padding:5px;font-size: 15px;">3、每7天重新开始计算</span> + </div> + </div> + </el-row> + </el-card> + </el-aside> + + <el-main width="70%"> + <div> + <el-tabs v-model="activeName" @tab-click="clickSecondTab"> + <el-tab-pane label="活动设置" name="first"> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动名称" prop="actName"> + <el-input v-model="ruleForm.actName" placeholder="请输入活动名称"></el-input> + </el-form-item> + </div> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动编码" prop="actCode"> + <el-input v-model.number="ruleForm.actCode" placeholder="请输入活动编码"></el-input> + </el-form-item> + </div> + <div class="col-sm-4 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="活动时间" prop="actTime"> + <div class="block"> + <el-date-picker + v-model="ruleForm.actTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </div> + </el-tab-pane> + + <el-tab-pane label="奖品设置" name="second"> + <el-row style="display:flex;"> + <el-col :span="20"> + <el-tabs v-model="editableTabsValue" type="card" closable @tab-click="clickTab" @tab-remove="removeTab"> + <el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title" :name="item.name"> + <el-row v-show="editableTabsValue !== '1'"> + <el-form-item label="签到累计天数"> + <el-input v-model.number="item.content.cumulativeDay" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-row> + <el-row> + <el-form-item label="奖项类型"> + <el-col> + <el-radio-group v-model="item.content.awardType" @change="jxlxChange"> + <el-radio :label="'1'">自定义奖品</el-radio> + <el-radio :label="'2'">积分</el-radio> + <el-radio :label="'3'">优惠券</el-radio> + <el-radio :label="'4'">商品</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-row> + <el-row > + <el-col> + <el-form-item label="奖项名称"> + <el-input v-model="item.content.awardName" placeholder="奖项名称"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="图片介绍"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="introduceImgSuccess"> + <img v-if="item.content.introduceImg" :src="item.content.introduceImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + + <div v-show="item.content.awardType !== '2'"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="奖项库存"> + <el-input v-model="item.content.awardInventoryCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="已派发"> + <el-input v-model="item.content.awardDistributeCnt"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === '1'"> + <el-row > + <el-col> + <el-form-item label="文字介绍"> + <el-input type="textarea" v-model="item.content.introduceTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="兑奖方式"> + <el-col> + <el-radio-group v-model="item.content.awardWay" @change="awardWayChange"> + <el-radio :label="'1'">线下兑换</el-radio> + <el-radio :label="'2'">物流配送</el-radio> + <el-radio :label="'3'">客服兑换</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </el-col> + </el-row> + <el-row > + <el-col> + <el-form-item label="操作提示"> + <el-input v-model="item.content.operationTip"></el-input> + </el-form-item> + </el-col> + </el-row> + <div v-show="item.content.awardWay === '1'"> + <el-row > + <el-col> + <el-form-item label="兑奖地址"> + <el-input v-model="item.content.prizeAddress"></el-input> + </el-form-item> + </el-col> + </el-row> + + </div> + <div v-show="item.content.awardWay === '3'"> + <el-row > + <el-col> + <el-form-item label="客服微信"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="wechatImgSuccess"> + <img v-if="item.content.wechatImg" :src="item.content.wechatImg" style="max-width: 200px;"> + </el-upload> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="[1,3].includes(item.content.awardWay)"> + <el-row > + <el-col> + <el-form-item label="客服电话"> + <el-input v-model="item.content.customerPhone"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardWay !== '2'"> + <el-row > + <el-col> + <el-form-item label="兑奖期限"> + <div class="block"> + <el-date-picker + v-model="item.content.prizeTime" + type="daterange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </div> + </el-form-item> + </el-col> + </el-row> + </div> + </div> + <div v-show="item.content.awardType === '2'"> + <el-row > + <el-col> + <el-form-item label="积分数量"> + <el-input v-model="item.content.scoreCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-form-item> + </el-col> + </el-row> + </div> + <div v-show="item.content.awardType === '3'"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="优惠券名称"> + <el-input v-model="item.content.couponName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="优惠券"> + <el-input v-model="item.content.couponId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseCoupon(item.content.couponName,item.name)"> + 选择优惠券 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择商城优惠券" + :visible.sync="drawerCoupon" + :direction="directionCoupon" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formCoupon" :model="formCoupon" inline > + <el-form-item prop="yhjmc"> + <el-input v-model="formCoupon.yhjmc" placeholder="请输入优惠券名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormCoupon" >搜索</el-button> + <el-button @click="resetFormCoupon('formCoupon')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="couponList.rows" + :height="tableHeightCoupon" + stripe:true + style="width: 100%"> + <el-table-column + prop="cname" + label="优惠券名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="endTime" + label="截止日期" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneCoupon(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeCoupon" + @current-change="changeCurrentPageCoupon" + :current-page="couponList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="couponList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="couponList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + </div> + <div v-show="item.content.awardType === '4'"> + <el-row style="display:flex;"> + <el-col> + <el-form-item label="品项名称"> + <el-input v-model="item.content.goodsName"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-form-item label="品项"> + <el-input v-model="item.content.goodsId"></el-input> + </el-form-item> + </el-col> + <el-col> + <el-button type="primary" @click="chooseGoods(item.content.goodsName,item.name)"> + 选择品项 + </el-button> + </el-col> + </el-row> + + <el-drawer + title="选择ERP产品" + :visible.sync="drawerGoods" + :direction="directionGoods" + size="90%"> + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row> + <el-form ref="formGoods" :model="formGoods" inline > + <el-form-item prop="cpmc"> + <el-input v-model="formGoods.cpmc" placeholder="请输入产品名称"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormGoods" >搜索</el-button> + <el-button @click="resetFormGoods('formGoods')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="goodsList.rows" + :height="tableHeightGoods" + stripe:true + style="width: 100%"> + <el-table-column + prop="name" + label="名称" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="chooseOneGoods(scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeGoods" + @current-change="changeCurrentPageGoods" + :current-page="goodsList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="goodsList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="goodsList.total"> + </el-pagination> + </el-row> + </el-col> + </el-row> + </el-drawer> + + </div> + </el-tab-pane> + </el-tabs> + </el-col> + <el-col :span="4"> + <el-button type="primary" @click="addTab(editableTabsValue)"> + 新增奖品 + </el-button> + </el-col> + </el-row> + </el-tab-pane> + + <el-tab-pane label="背景图片上传" name="third"> + <!--<div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="标题"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlTitleSuccess"> + <img v-if="imageUrlTitle" :src="imageUrlTitle" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div>--> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="头部"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlHeadSuccess"> + <img v-if="imageUrlHead" :src="imageUrlHead" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div> + <!--<div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="日历签到背景"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlStateSuccess"> + <img v-if="imageUrlState" :src="imageUrlState" style="max-width: 300px;"> + </el-upload> + </el-form-item> + </div>--> + <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> + <el-form-item label="签到按钮"> + <el-upload + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="imageUrlButtonSuccess"> + <img v-if="imageUrlButton" :src="imageUrlButton" style="max-width: 300px;"> + <i v-else></i> + </el-upload> + </el-form-item> + </div> + </el-tab-pane> + + <el-tab-pane label="规则说明" name="fourth"> + <div class="col-sm-8 col-sm-offset-1"> + <el-form-item label="规则内容" prop="ruleExplain" style="padding: 10px"> + <el-input type="textarea" v-model="ruleForm.ruleExplain"></el-input> + </el-form-item> + <el-form-item label="背景颜色" style="padding: 10px"> + <el-color-picker v-model="backgroundColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体颜色" style="padding: 10px"> + <el-color-picker v-model="typographyColor"></el-color-picker> + </el-form-item> + <el-form-item label="字体大小" style="padding: 10px"> + <el-input-number v-model="typographyNum" :min="10" :max="50" label="描述文字"></el-input-number> + </el-form-item> + <!--<el-form-item label="字体透明度" style="padding: 10px"> + <el-input-number v-model="typographyLight" :min="1" :max="100" label="描述文字">%</el-input-number> + </el-form-item>--> + </div> + </el-tab-pane> + </el-tabs> + </div> + + <div class="form-group "> + <div class="col-sm-12 text-center"> + <el-button type="primary" @click="dataSubmit('ruleForm')">保存</el-button> + <el-button type="danger" @click="cancelSubmit">关闭</el-button> + </div> + </div> + </el-main> + + </el-container> + + </el-form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的活动对象 + var actId = $.query.get("actId"); + const prize = { + //奖品基本信息 + cumulativeDay:'', + awardType:'1', + awardName:'', + introduceImg:'', + introduceTip:'', + awardInventoryCnt:'', + awardDistributeCnt:'', + awardWay:'1', + operationTip:'', + prizeAddress:'', + prizeTime: '', + wechatImg:'', + scoreCnt:'', + couponId:'', + goodsId:'', + couponName:'', + customerPhone:'', + goodsName:'', + } + var app = new Vue({ + el: '#app', + data: { + activeName: 'first', + formLabelWidth: '120px', + + activeClickTab:0, + //优惠券搜索弹出 + drawerCoupon: false, + directionCoupon: 'rtl', + tableHeightCoupon: 500, + //--优惠券 + formCoupon:{ + yhjmc:'', + order:'', + sort:'' + }, + couponList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //品项搜索弹出 + drawerGoods: false, + directionGoods: 'rtl', + tableHeightGoods: 500, + //--品项 + formGoods:{ + cpmc:'', + order:'', + sort:'' + }, + goodsList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + + //标题图片 + imageUrlTitle: '', + imageUrlHead: "../../../images/sign/signHead.png", + imageUrlButton: "../../../images/sign/signButton.png", + imageUrlState: '', + + //字体颜色 + typographyColor: '#409EFF', + //背景颜色 + backgroundColor: '#409EFF', + //字体大小 + typographyNum: '5', + //字体透明度 + typographyLight: '50', + //奖品设置 + prize:JSON.parse(JSON.stringify(prize)), + editableTabsValue: '1', + editableTabs: [{ + title: '签到日常奖励', + name: '1', + content: JSON.parse(JSON.stringify(prize)) + }], + tabIndex: 1, + + ruleForm : { + //商品基本信息 + actName : '', + actCode : '', + actTime : '', + //规则说明 + ruleExplain : '', + }, + rules : { + //商品基本信息 + actName : [ + { required: true, message: '请输入活动名称', trigger: 'blur' } + ], + actCode : [ + { required: true, message: '请输入活动编码', trigger: 'blur' } + ], + actTime : [ + { required: true, message: '请选择日期', trigger: 'change' } + ], + ruleExplain : [ + { required: true, message: '请输入规则内容', trigger: 'blur' } + ] + }, + }, + created: function () { + }, + methods: { + //选择优惠券 + chooseCoupon(val,name){ + let _this = this; + _this.drawerCoupon = true; + _this.activeClickTab = parseInt(name); + _this.formCoupon.yhjmc = val; + _this.loadCouponList(); + }, + //--优惠券 + loadCouponList() { + let _this = this; + let data=_this.getRequestParamCoupon(); + data.pageSize=_this.couponList.pageSize; + data.pageNum=_this.couponList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectCouponList', + callback: function (data) { + _this.couponList.rows = data.rows; + _this.couponList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamCoupon(){ + let _this = this; + return { + yhjmc:_this.formCoupon.yhjmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormCoupon:function(){ + this.couponList.currentPage=1; + this.loadCouponList(); + }, + //重置 + resetFormCoupon(formName) { + // this.formCoupon.yhjmc = '' + // console.log(this.$refs[formName].resetFields) + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeCoupon(val) { + this.couponList.pageSize = val; + this.loadCouponList(); + }, + changeCurrentPageCoupon(val) { + this.couponList.currentPage = val; + this.loadCouponList(); + }, + //选择 + chooseOneCoupon(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.couponId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.couponName = row.cname; + _this.drawerCoupon = false; + }, + + //选择品项 + chooseGoods(val,name){ + let _this = this; + _this.drawerGoods = true; + _this.activeClickTab = parseInt(name); + _this.formGoods.cpmc = val; + _this.loadGoodsList(); + }, + //--品项 + loadGoodsList() { + let _this = this; + let data=_this.getRequestParamGoods(); + data.pageSize=_this.goodsList.pageSize; + data.pageNum=_this.goodsList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/activitySignAwardSet/selectGoodsList', + callback: function (data) { + _this.goodsList.rows = data.rows; + _this.goodsList.total = data.total; + } + }); + }, + //查询参数 + getRequestParamGoods(){ + let _this = this; + return { + cpmc:_this.formCoupon.cpmc, + order:_this.formCoupon.order, + sort:_this.formCoupon.sort, + } + }, + //查询 + searchFormGoods:function(){ + this.goodsList.currentPage=1; + this.loadGoodsList(); + }, + //重置 + resetFormGoods(formName) { + (this.$refs[formName])[0].resetFields(); + }, + changePageSizeGoods(val) { + this.goodsList.pageSize = val; + this.loadGoodsList(); + }, + changeCurrentPageGoods(val) { + this.goodsList.currentPage = val; + this.loadGoodsList(); + }, + //选择 + chooseOneGoods(row) { + let _this = this; + _this.editableTabs[_this.activeClickTab-1].content.goodsId = row.id; + _this.editableTabs[_this.activeClickTab-1].content.goodsName = row.name; + _this.drawerGoods = false; + }, + + //保存 + dataSubmit : function(formName) { + const _this = this; + let flag = false; + _this.$refs[formName].validate((valid) => { + if (!valid) { + _this.$notify({ + title: '提示', + message: '请完善签到活动信息', + type: 'warning' + }); + flag = true; + return; + } + }); + if (flag) { + return; + } + //活动基本信息 + let signSetBasicJsonDto = { + ruleExplain: _this.ruleForm.ruleExplain, + //字体颜色 + typographyColor: _this.typographyColor, + //背景颜色 + backgroundColor: _this.backgroundColor, + //字体大小 + typographyNum: _this.typographyNum, + //字体透明度 + typographyLight: _this.typographyNum, + //标题图片 + imageUrlTitle: _this.imageUrlTitle, + imageUrlHead: _this.imageUrlHead, + imageUrlButton: _this.imageUrlButton, + imageUrlState: _this.imageUrlState, + } + //奖品信息 + let activitySignAwardSets = []; + for (let i = 0; i < _this.editableTabs.length; i++) { + let prize = _this.editableTabs[i].content; + let name = _this.editableTabs[i].title; + let awardRule = 2; + if(name == "签到日常奖励"){ + awardRule = 1; + } + let activitySignAwardSet = { + cumulativeDay: prize.cumulativeDay, + awardRule: awardRule, + awardType: prize.awardType, + awardName: prize.awardName, + introduceImg: prize.introduceImg, + introduceTip: prize.introduceTip, + awardInventoryCnt: prize.awardInventoryCnt, + awardDistributeCnt: prize.awardDistributeCnt, + awardWay: prize.awardWay, + operationTip: prize.operationTip, + prizeAddress: prize.prizeAddress, + wechatImg: prize.wechatImg, + customerPhone: prize.customerPhone, + scoreCnt: prize.scoreCnt, + couponId: prize.couponId, + goodsId: prize.goodsId, + couponName: prize.couponName, + goodsName: prize.goodsName, + prizeStartTime: prize.prizeTime[0], + prizeEndTime: prize.prizeTime[1], + } + activitySignAwardSets.push(activitySignAwardSet); + } + let resultData = { + actName: _this.ruleForm.actName, + actCode: _this.ruleForm.actCode, + beginTime : _this.ruleForm.actTime[0], + endTime : _this.ruleForm.actTime[1], + signSetBasicJsonDto, + activitySignAwardSets, + } + AjaxProxy.requst({ + app: _this, + data: resultData, + url: basePath + '/admin/activitySignAwardSet/addSignAwardSet', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + }); + parent.layer.close(parent.layer.getFrameIndex(window.name)); + } + }); + }, + //奖品设置 + addTab(targetName) { + let newTabName = ++this.tabIndex + ''; + this.editableTabs.push({ + title: "商品奖励"+"("+newTabName+")", + name: newTabName, + content: JSON.parse(JSON.stringify(prize)), + }); + this.editableTabsValue = newTabName; + this.activeClickTab = parseInt(newTabName); + }, + clickSecondTab(targetName) { + this.activeClickTab = 1; + }, + clickTab(targetName) { + console.log(targetName.name); + this.activeClickTab = parseInt(targetName.name); + }, + removeTab(targetName) { + let tabs = this.editableTabs; + let activeName = this.editableTabsValue; + if(activeName === '1' || targetName === '1'){ + this.$notify({ + title: '提示', + message: '【签到日常奖励】不能删除', + type: 'warning' + }); + }else{ + if (activeName === targetName) { + tabs.forEach((tab, index) => { + if (tab.name === targetName && tab.title !== "签到日常奖励") { + let nextTab = tabs[index + 1] || tabs[index - 1]; + if (nextTab) { + activeName = nextTab.name; + } + } + }); + } + this.editableTabsValue = activeName; + this.editableTabs = tabs.filter(tab => tab.name !== targetName); + this.tabIndex = this.editableTabs.length; + } + }, + //切换奖项类型,显示不同内容 + jxlxChange(val){ + let _this = this; + _this.isShow=val; + }, + //切换兑奖方式,显示不同内容 + awardWayChange(val){ + let _this = this; + _this.isShow=val; + }, + //跳转到图片上传 + uploadImg(){ + this.activeName = 'third'; + }, + //跳转到规则说明 + gzsmSet(){ + this.activeName = 'fourth'; + }, + //标题图片 + imageUrlTitleSuccess(res, file) { + this.imageUrlTitle = res.path; + }, + imageUrlHeadSuccess(res, file) { + this.imageUrlHead = res.path; + }, + imageUrlButtonSuccess(res, file) { + this.imageUrlButton = res.path; + }, + imageUrlStateSuccess(res, file) { + this.imageUrlState = res.path; + }, + //奖品设置的图片介绍 + introduceImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.introduceImg = res.path; + }, + //奖品设置的客服微信 + wechatImgSuccess(res, file) { + this.editableTabs[this.activeClickTab-1].content.wechatImg = res.path; + }, + cancelSubmit() { + this.closeFrame(); + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html new file mode 100644 index 0000000..71bded8 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html @@ -0,0 +1,219 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + <title></title> + <style> + .panel-body{ + overflow: hidden; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> +<body> +<div class="panel-body" id="app"> + <el-row style="display:flex;align-items: center;text-align: right;"> + <el-col> + <el-form ref="form" :model="form" inline > + <el-form-item prop="nickName"> + <el-input v-model="form.nickName" placeholder="请输入会员姓名"></el-input> + </el-form-item> + + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + </el-form> + </el-col> + </el-row> + + <el-row class="table-style" style="margin-left: 50px;"> + <el-table id="proj" :data="table.rows" :height="height" stripe @sort-change="sortChange"> + <el-table-column + label="会员"> + <template slot-scope="scope"> + <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/> + {{scope.row.nickname}} + </template> + </el-table-column> + <el-table-column + prop="phone" + label="手机号码"> + </el-table-column> + <el-table-column + prop="createTime" + label="注册时间"> + </el-table-column> + <el-table-column + prop="salesGrade" + label="分销等级" + width="180"> + <template slot-scope="scope"> + <el-select v-model="scope.row.proJbruserValue" @focus="getDatalist(scope.row)" placeholder="请选择" filterable allow-create> + <el-option v-for="item in salesGradeList " :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="text" size="small" @click="addSaleManApply(scope.row)">设置为分销员</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="table.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="table.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="table.total"> + </el-pagination> + </el-row> + +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript" th:inline="javascript"> + + var vue = new Vue({ + el: '#app', + data: { + table:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + form:{ + nickName:'', + order:'', + sort:'' + }, + proJbruserValue : "", + salesGradeList: [], + height:'calc(100vh - 240px)', + }, + created: function () { + this.loadData(); + window.addEventListener("keydown", this.keydown); + }, + methods: { + //设置为分销员 + addSaleManApply(row){ + let _this = this; + let userId = row.userId; + let openId = row.openId; + let gradeId = row.proJbruserValue; + let obj = { + userId: userId, + openId: openId, + gradeId: gradeId, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoUser/addSaleManApply', + callback: function (data) { + _this.$message.success(data.info); + this.loadData(); + } + }); + }, + // select下拉框获取焦点的时候查询对应的下拉框数据源 + getDatalist(row) { + let _this = this; + AjaxProxy.requst({ + app: _this, + data:[], + url: basePath + '/fenXiao/fenXiaoUser/getShopSalesmanGrade', + callback: function (data) { + _this.salesGradeList = data.mapInfo.salesGrade; + } + }); + }, + changePageSize(val) { + this.table.pageSize = val; + this.loadData(); + }, + changeCurrentPage(val) { + this.table.currentPage = val; + this.loadData(); + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + }, + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadData(); + } + }, + loadData:function(){ + let _this = this; + let data=_this.getRequestParam(); + data.pageSize=_this.table.pageSize; + data.pageNum=_this.table.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanAppliingList', + callback: function (data) { + _this.table.rows = data.rows; + _this.table.total=data.total; + } + }); + }, + getRequestParam(){ + let _this = this; + return { + nickName:_this.form.nickName, + order:_this.form.order, + sort:_this.form.sort, + } + }, + search:function(){ + this.table.currentPage=1; + this.loadData(); + }, + keydown(evt){ + if(evt.keyCode==13) { + this.search(); + } + } + + } + }); + + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html new file mode 100644 index 0000000..a3e3dce --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html @@ -0,0 +1,704 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + .panel-body{ + overflow: hidden; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + + .box-card { + width: 240px; + border-radius: 5px; + color: #ffffff; + padding: 2px 0px; + margin-right: 20px; + cursor: pointer; + float: left; + text-align: center; + } + .el-card__body { + padding: 0px; + } + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-row> + <el-card class="box-card" style="background-color: #0a628f;"> + <div style="padding:10px;font-size: 20px;">¥{{basicdetail.orderBalance}}</div> + <div>订单总金额</div> + </el-card > + <el-card class="box-card" style="background-color: #0f9aef;"> + <div style="padding:10px;font-size: 20px;">¥{{basicdetail.balance}}</div> + <div>待结算金额</div> + </el-card > + <el-card class="box-card" style="background: #67C23A;"> + <div style="padding:10px;font-size: 20px;">{{basicdetail.waitNum}}人</div> + <div>待结算人数</div> + </el-card > + <el-card class="box-card" style="background: rgb(121, 187, 255);"> + <div style="padding:10px;font-size: 20px;">{{basicdetail.waitOrderNum}}笔</div> + <div>待结算订单</div> + </el-card > + </el-row> + <el-row> + <el-tabs v-model="activeName" > + <el-tab-pane label="分销订单" name="first"> + <el-row justify="space-between" type="flex"> + <el-col :span="6"> + <el-button type="primary" @click="setOrderDone()">批量结算</el-button> + </el-col> + <el-dialog title="本次结算分销订单" :visible.sync="dialogFormVisible"> + <el-form :model="formSelect"> + <el-form-item label="结算金额:" :label-width="formLabelWidth"> + <div style="font-size: 30px;color: #ff0000">¥{{formSelect.jsje}}</div> + </el-form-item> + <el-form-item label="结算订单:" :label-width="formLabelWidth"> + <div style="font-size: 20px;">{{formSelect.jsdds}}单</div> + </el-form-item> + <el-form-item label="结算人数:" :label-width="formLabelWidth"> + <div style="font-size: 20px;">{{formSelect.jsrs}}人</div> + </el-form-item> + <el-form-item label="结算方式:" :label-width="formLabelWidth"> + <el-radio-group v-model="formSelect.jsfs"> + <el-radio-button label="1">线下结算</el-radio-button> + <el-radio-button label="2">微信余额支付</el-radio-button> + </el-radio-group> + </el-form-item> + <el-form-item label="备注:" :label-width="formLabelWidth"> + <el-input type="textarea" :rows="3" v-model="formSelect.bz" autocomplete="off"></el-input> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button @click="dialogFormVisible = false">取 消</el-button> + <el-button type="primary" @click="updateSetOrderDone()">确 定</el-button> + </div> + </el-dialog> + + <el-col> + <el-form ref="form" :model="form" inline > + <el-form-item label="订单状态" prop="ddType"> + <el-select v-model="form.ddType" placeholder="订单状态"> + <el-option + v-for="item in ddTypeList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="结算状态" prop="orderType"> + <el-select v-model="form.orderType" placeholder="结算状态"> + <el-option + v-for="item in orderTypeList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item prop="userName" > + <el-input v-model="form.userName" placeholder="请输入客户名称"></el-input> + </el-form-item> + <el-form-item prop="tgy" > + <el-input v-model="form.tgy" placeholder="请输入推广员名称"></el-input> + </el-form-item> + <el-form-item prop="ddsj" > + <el-date-picker + v-model="form.ddsj" + type="datetimerange" + :picker-options="pickerOptions" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期" + align="right"> + </el-date-picker> + </el-form-item> + <el-form-item prop="jsbh" > + <el-input v-model="form.jsbh" placeholder="请输入结算编号"></el-input> + </el-form-item> + <el-form-item prop="ddh" > + <el-input v-model="form.ddh" placeholder="请输入订单号"></el-input> + </el-form-item> + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + <el-button @click="excelExport">导出</el-button> + </el-form> + </el-col> + </el-row> + + <el-row class="table-style" > + <el-table ref="multipleTable" + :data="fxyList.rows" + :height="height" + stripe:true + @sort-change="sortChange" + @selection-change="handleSelectionChange"> + <el-table-column + type="selection"> + </el-table-column> + <el-table-column + prop="orderNo" + label="订单编号" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="actualBalance" + label="实付金额(元)"> + </el-table-column> + <el-table-column + label="订单状态"> + <template slot-scope="scope"> + <span v-if="scope.row.orderState == 1">待付款</span> + <span v-if="scope.row.orderState == 2">待配送</span> + <span v-if="scope.row.orderState == 3">待收货</span> + <span v-if="scope.row.orderState == 4">待评价</span> + <span v-if="scope.row.orderState == 5">已评价</span> + <span v-if="scope.row.orderState == 6">申请退款</span> + <span v-if="scope.row.orderState == 7">退款成功</span> + <span v-if="scope.row.orderState == 8">退款拒绝</span> + <span v-if="scope.row.orderState == 9">已取消</span> + </template> + </el-table-column> + <el-table-column + prop="address" + label="下单门店" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="custom" + label="客户" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="parentSale" + label="推广员" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="收益类型"> + <template slot-scope="scope"> + <span v-if="scope.row.profitType == 1">推广收益</span> + <span v-if="scope.row.profitType == 2">邀请收益</span> + </template> + </el-table-column> + <el-table-column + prop="profitBalance" + label="收益金额"> + </el-table-column> + <el-table-column + label="结算状态"> + <template slot-scope="scope"> + <span v-if="scope.row.settleType == 1">待结算</span> + <span v-if="scope.row.settleType == 2">已结算</span> + <span v-if="scope.row.settleType == 3">已退款</span> + </template> + </el-table-column> + <el-table-column + prop="settleNo" + label="结算编号" + show-overflow-tooltip + width="150"> + </el-table-column> + <el-table-column + prop="settleTime" + label="结算时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="settler" + label="结算人" + show-overflow-tooltip> + </el-table-column> + <el-table-column label="操作"> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="fxyList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="fxyList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="fxyList.total"> + </el-pagination> + </el-row> + </el-tab-pane> + + <el-tab-pane label="结算记录" name="second"> + <el-row style="display:flex;align-items: center;text-align: right;"> + <el-col> + <el-form ref="formOrder" :model="formOrder" inline > + <el-form-item prop="jssj" > + <el-date-picker + v-model="formOrder.jssj" + type="datetimerange" + :picker-options="pickerOptions" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期" + align="right"> + </el-date-picker> + </el-form-item> + <el-form-item prop="userName"> + <el-input v-model="formOrder.userName" placeholder="请输入结算人姓名"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormOrder" >搜索</el-button> + <el-button @click="resetFormOrder('formOrder')">重置</el-button> + </el-form> + </el-col> + </el-row> + <el-row class="table-style" > + <el-table :data="orderLevelList.rows" :height="height" stripe:true @sort-change="sortChange"> + <el-table-column + prop="orderNo" + label="结算编号" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="actualBalance" + label="结算金额"> + </el-table-column> + <el-table-column + prop="setNum" + label="结算订单数"> + </el-table-column> + <el-table-column + prop="setManNum" + label="结算人数"> + </el-table-column> + <el-table-column + prop="setTime" + label="结算时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="setMan" + label="结算人" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="结算方式"> + <template slot-scope="scope"> + <span v-if="scope.row.settlementWay == 1">线下结算</span> + <span v-if="scope.row.settlementWay == 2">微信余额结算</span> + </template> + </el-table-column> + <el-table-column + prop="remark" + label="备注" + show-overflow-tooltip> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeOrder" + @current-change="changeCurrentPageOrder" + :current-page="orderLevelList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="orderLevelList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="orderLevelList.total"> + </el-pagination> + </el-row> + </el-tab-pane> + </el-tabs> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的USERID对象 + var userId = $.query.get("userId"); + var applyId = $.query.get("applyId"); + + var app = new Vue({ + el: '#app', + data: { + activeName: 'first', + height:'calc(100vh - 340px)', + //--基本数据 + basicdetail:{}, + //--时间选择 + pickerOptions: { + shortcuts: [{ + text: '最近一周', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近三个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + } + }] + }, + + //--批量审核选中操作 + multipleSelection: [], + orderIds:"", + orderNums:0, + orderNumsDones:0, + dialogFormVisible: false, + formSelect: { + jsje: '', + jsdds: '', + jsrs: '', + jsfs: 2, + bz: '' + }, + formLabelWidth: '120px', + //--分销订单 + // 条件查询结算状态 + orderTypeList:[ + {value:'',label:'全部'}, + {value:1,label:'待结算'}, + {value:2,label:'已结算'}, + {value:3,label:'已退款'} + ], + ddTypeList:[ + {value:'',label:'全部'}, + {value:1,label:'待付款'}, + {value:2,label:'待配送'}, + {value:3,label:'待收货'}, + {value:4,label:'待评价'}, + {value:5,label:'已评价'}, + {value:6,label:'申请退款'}, + {value:7,label:'退款成功'}, + {value:8,label:'退款拒绝'}, + {value:9,label:'已取消'} + ], + form:{ + userName:'', + orderType:'', + ddType:'', + ddsj: '', + tgy:'', + jsbh:'', + ddh:'', + order:'', + sort:'' + }, + fxyList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + //--结算记录 + formOrder:{ + userName:'', + jssj:'', + order:'', + sort:'' + }, + orderLevelList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadFenxiaoOrderBasic(); + _this.loadFenxiaoOrderList(); + _this.loadSetOrderList(); + }, + //--基础数据 + loadFenxiaoOrderBasic() { + let _this = this; + let obj = {}; + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoOrder/loadFenxiaoOrderBasic', + callback: function (data) { + _this.basicdetail = data.mapInfo.basicdetail; + } + }); + }, + //--结算记录 + loadSetOrderList() { + let _this = this; + let data=_this.getRequestParamOrder(); + data.pageSize=_this.orderLevelList.pageSize; + data.pageNum=_this.orderLevelList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoOrder/loadSetOrderList', + callback: function (data) { + _this.orderLevelList.rows = data.rows; + _this.orderLevelList.total = data.total; + _this.loadFenxiaoOrderBasic(); + } + }); + }, + //查询参数 + getRequestParamOrder(){ + let _this = this; + let startTime = ''; + let endTime = ''; + if(_this.formOrder.jssj.length > 0){ + startTime = _this.formOrder.jssj[0]; + endTime = _this.formOrder.jssj[1]; + } + return { + userName:_this.formOrder.userName, + startTime:startTime, + endTime:endTime, + order:_this.formOrder.order, + sort:_this.formOrder.sort, + } + }, + //查询 + searchFormOrder:function(){ + this.orderLevelList.currentPage=1; + this.loadSetOrderList(); + }, + //重置 + resetFormOrder(formName) { + this.$refs[formName].resetFields(); + }, + changePageSizeOrder(val) { + this.orderLevelList.pageSize = val; + this.loadSetOrderList(); + }, + changeCurrentPageOrder(val) { + this.orderLevelList.currentPage = val; + this.loadSetOrderList(); + }, + //--分销订单 + loadFenxiaoOrderList() { + let _this = this; + let data=_this.getRequestParam(); + data.pageSize=_this.fxyList.pageSize; + data.pageNum=_this.fxyList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoOrder/loadFenxiaoOrderList', + callback: function (data) { + _this.fxyList.rows = data.rows; + _this.fxyList.total = data.total; + _this.loadFenxiaoOrderBasic(); + } + }); + }, + //查询参数 + getRequestParam(){ + let _this = this; + let startTime = ''; + let endTime = ''; + if(_this.form.ddsj.length > 0){ + startTime = _this.form.ddsj[0]; + endTime = _this.form.ddsj[1]; + } + return { + orderType:_this.form.orderType, + ddType:_this.form.ddType, + tgy:_this.form.tgy, + userName:_this.form.userName, + jsbh:_this.form.jsbh, + startTime:startTime, + endTime:endTime, + ddh:_this.form.ddh, + order:_this.form.order, + sort:_this.form.sort, + } + }, + //查询 + search:function(){ + this.fxyList.currentPage=1; + this.loadFenxiaoOrderList(); + }, + //重置 + resetForm(formName) { + this.$refs[formName].resetFields(); + }, + changePageSize(val) { + this.fxyList.pageSize = val; + this.loadFenxiaoOrderList(); + }, + changeCurrentPage(val) { + this.fxyList.currentPage = val; + this.loadFenxiaoOrderList(); + }, + //排序 + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadInfo(); + } + }, + //选择 + handleSelectionChange(val) { + let _this = this; + _this.multipleSelection = val; + //拼接出一个逗号隔开的字符串 + let submitDate = ""; + let orderNum = 0; + let orderBalance = 0; + let orderNumsDone = 0; + let name = []; + for (let i = 0; i < _this.multipleSelection.length; i++) { + let order = _this.multipleSelection[i]; + //待审核的计算到弹出框 + let orderState = order.orderState; + let settleType = order.settleType; + if((orderState == 4 || orderState == 5) && settleType == 1){ + let orderId = order.id; + name.push(order.customUserId); + orderNum = orderNum + 1; + orderBalance = orderBalance + order.profitBalance; + submitDate = submitDate +orderId+","; + }else{ + orderNumsDone = orderNumsDone + 1; + } + } + _this.orderNumsDones = orderNumsDone; + _this.orderIds = submitDate; + _this.orderNums = orderNum; + _this.formSelect.jsdds = orderNum; + _this.formSelect.jsje = orderBalance; + _this.formSelect.jsrs = _this.distinctFunction(name).length; + }, + //去重 + distinctFunction(name){ + var arr = name, + result = [], + i, + j, + len = arr.length; + for(i = 0; i < len; i++){ + for(j = i + 1; j < len; j++){ + if(arr[i] === arr[j]){ + j = ++i; + } + } + result.push(arr[i]); + } + return result; + }, + //批量结算 + setOrderDone() { + if(this.orderNumsDones > 0){ + this.$message({ + message: '【待评价】和【已评价】状态下的【待结算】订单,才允许结算', + type: 'warning' + }); + }else if(this.orderNums > 0){ + this.dialogFormVisible = true; + }else{ + this.$message({ + message: '至少需要选中一条数据', + type: 'warning' + }); + } + }, + updateSetOrderDone(){ + let _this = this; + let obj = { + orderIds: _this.orderIds, + setType: _this.formSelect.jsfs, + manCount: _this.formSelect.jsrs, + orderCount: _this.formSelect.jsdds, + amount: _this.formSelect.jsje, + remark: _this.formSelect.bz, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoOrder/updateSetOrderDone', + callback: function (data) { + _this.$message.success(data.info); + _this.loadFenxiaoOrderList(); + _this.dialogFormVisible = false; + } + }); + }, + excelExport() { + var jsonParam = this.getRequestParam(); + var param = ""; + Object.keys(jsonParam).forEach(function(key){ + if (jsonParam[key]) { + param += key + "=" + jsonParam[key] + "&"; + } + }); + window.location.href=basePath+"/fenXiao/fenXiaoOrder/exportExcel?"+param; + } + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-setting.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-setting.html new file mode 100644 index 0000000..48bbaef --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-setting.html @@ -0,0 +1,567 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> +</head> + +<body> +<div class="ibox-content" id="app" v-cloak> + <el-form label-width="120px" > + <el-row> + <p class="el-big-title">分销设置</p> + </el-row> + <el-row style="margin-top: 20px;"> + <el-col> + <template v-for="paramSettingOne in fxkg"> + <el-form-item> + <span slot="label">{{paramSettingOne.paramName}}</span> + <el-col > + <el-radio-group v-model="paramSettingOne.paramValue"> + <el-radio v-model="paramSettingOne.paramValue" :label="'1'">开启分销</el-radio> + <el-radio v-model="paramSettingOne.paramValue" :label="'2'">关闭分销</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </template> + </el-col> + </el-row> + + <el-row style="margin-top: 20px;"> + <el-col> + <template v-for="paramSettingzgfy in zgfy"> + <el-form-item> + <span slot="label">{{paramSettingzgfy.paramName}}</span> + <el-col> + <el-radio-group v-model="paramSettingzgfy.paramValue"> + <el-radio :label="'1'">是</el-radio> + <el-radio :label="'2'">否</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </template> + </el-col> + </el-row> + + <el-row style="margin-top: 20px;"> + <el-col> + <template v-for="paramSettingTwo in fxms"> + <el-form-item> + <span slot="label">{{paramSettingTwo.paramName}}</span> + <el-col> + <el-radio-group v-model="paramSettingTwo.paramValue"> + <el-radio :label="'1'">一级分销</el-radio> + <el-radio :label="'2'">二级分销</el-radio> + </el-radio-group> + </el-col> + </el-form-item > + </template> + </el-col> + </el-row> + + <el-row style="margin-top: 20px;"> + <el-col> + <template v-for="paramSettingThree in sqfs"> + <el-form-item> + <span slot="label">{{paramSettingThree.paramName}}</span> + <el-col> + <el-radio-group v-model="paramSettingThree.paramValue" @change="sqfsChange"> + <div style="margin-top: 12px;"><el-radio :label="'1'">无需申请满足条件自动成为分销员</el-radio></div> + <div style="margin-top: 20px;"><el-radio :label="'2'">需要客户主动申请</el-radio></div> + </el-radio-group> + </el-col> + </el-form-item > + </template> + </el-col> + </el-row> + + <el-row v-show="isShow" style="margin-top: 20px;"> + <el-col> + <template v-for="paramSettingFive in sqtj"> + <el-form-item> + <span slot="label">{{paramSettingFive.paramName}}</span> + <el-col> + <el-radio-group v-model="paramSettingFive.paramValue"> + <div style="margin-top: 12px;"><el-radio :label="'1'">无条件注册即可成为分销员</el-radio></div> + <div style="margin-top: 25px;"><el-radio :label="'2'">消费任意产品可成为分销员</el-radio></div> + <div style="margin-top: 25px;display:flex;align-items: center;"> + <el-radio :label="'3'">消费指定产品可成为分销员</el-radio> + <div style="display:flex;align-items: center;"> + <el-button type="primary" @click="drawer = true">设置产品</el-button> + <el-input style="width:100px;display: none;" v-model="paramSettingFive.paramValue1"></el-input> + <el-input style="width:100px;display: none;" v-model="cpid"></el-input> + </div> + </div> + <div style="margin-top: 25px;display:flex;align-items: center;"> + <el-radio :label="'4'">消费指定金额可成为分销员</el-radio> + <div style="display:flex;align-items: center;"> + <el-input style="width:100px;" v-model="paramSettingFive.paramValue2" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + <div style="font-size: 14px;align-items: center;">元</div> + </div> + </div> + </el-radio-group> + </el-col> + </el-form-item > + </template> + </el-col> + </el-row> + + <el-row style="margin-top: 20px;"> + <el-col> + <template v-for="paramSettingFour in shfs"> + <el-form-item> + <span slot="label">{{paramSettingFour.paramName}}</span> + <el-col> + <el-radio-group v-model="paramSettingFour.paramValue"> + <div style="margin-top: 12px;"><el-radio :label="'1'">系统自动审核</el-radio></div> + <div style="margin-top: 20px;"><el-radio :label="'2'">人工审核</el-radio></div> + </el-radio-group> + </el-col> + </el-form-item > + </template> + </el-col> + </el-row> + + + <el-drawer + title="分销产品" + :visible.sync="drawer" + :direction="direction" + size="90%" + > + <el-row style="margin-left: 50px;"> + <el-col :span="24"> + <el-row class="vertical "> + <el-input class="searchInput" @input="searchGoods()" v-model="queryKey" + placeholder="搜索添加产品"></el-input> + <el-button @click="searchGoods()" type="primary">搜索</el-button> + </el-row> + + <div class="searchResultTable" style="width: 50%" v-show="showSearchTable"> + <!-- 搜索加载数据表格 --> + <el-table + ref="dataTable" + v-loading="loading" + element-loading-text="拼命加载中" + element-loading-spinner="el-icon-loading" + element-loading-background="rgba(0, 0, 0, 0.8)" + @selection-change="handleSelectionChange" + @row-click="handleClickTableRow" + :max-height="400" + :data="searchTableData" + style="width: 100%"> + <el-table-column + type="selection" + width="50"> + </el-table-column> + <el-table-column + prop="id" + label="ID"> + </el-table-column> + + <el-table-column + prop="title" + label="产品名称"> + </el-table-column> + <el-table-column + prop="price" + label="价格"> + </el-table-column> + <el-table-column + prop="score" + label="积分"> + </el-table-column> + <el-table-column + prop="attrValues" + label="产品属性"> + </el-table-column> + <el-table-column + label="是否上架"> + <template slot-scope="scope"> + <span v-if="scope.row.status == 1">是</span> + <span v-if="scope.row.status == 2">否</span> + </template> + </el-table-column> + <el-table-column + width="150" + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="handleEdit(scope.$index, scope.row)">选择 + </el-button> + </template> + </el-table-column> + </el-table> + <el-row class="btn-box"> + <el-button size="mini" type="danger" @click="closeXm()">关闭</el-button> + <el-button size="mini" type="primary" @click="chouseGoods()">确认</el-button> + </el-row> + </div> + + <el-row class="mt-10"> + <el-table + :stripe="true" + :border="true" + :height="tableHeight" + :data="order" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="id" + width="280" + label="产品ID"> + </el-table-column> + <el-table-column + prop="title" + width="280" + label="产品名称"> + </el-table-column> + <el-table-column + prop="attrValues" + width="80" + label="产品属性"> + </el-table-column> + <el-table-column + prop="price" + label="单价"> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" + size="mini" + @click="removeItem(scope.$index, scope.row)">删除 + </el-button> + </template> + </el-table-column> + </el-table> + + </el-row> + <el-row class="mt-20 vertical"> + <el-col :span="14" class="btn-box"> + <el-button type="primary" @click="submitOrder()">保存</el-button> + <el-button type="danger" @click="drawer = false">取消</el-button> + </el-col> + </el-row> + </el-col> + </el-row> + </el-drawer> + <el-row justify="center" type="flex"> + <el-button type="primary" @click="submit()">保存</el-button> + </el-row> + </el-form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + +<script> + var app = new Vue({ + el: '#app', + data: { + cpid:"", + //业绩设置框 + drawer: false, + direction: 'rtl', + order: [], + tableHeight: 500, + /*****搜索表格数据*********/ + //搜索关键词 + queryKey: '', + //是否展示搜索表格 + showSearchTable: false, + //搜索表格数据 + searchTableData: [], + //表格加载效果 + loading: false, + /******搜索表格数据END********/ + val:'', + isShow:true, + fxkg:[], + fxms:[], + sqfs:[], + shfs:[], + sqtj:[], + zgfy:[], + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadParamSetting(); + }, + sqfsChange(val){ + let _this = this; + _this.isShow=(val==2)?true:false; + }, + loadParamSetting() { + let _this = this; + //加载配置 + AjaxProxy.requst({ + app: _this, + data: {}, + url: basePath + '/fenXiao/ruleSetting/selectFenXiaoSetting', + callback: function (data) { + _this.fxkg = data.mapInfo.fxkg; + _this.fxms = data.mapInfo.fxms; + _this.sqfs = data.mapInfo.sqfs; + _this.zgfy = data.mapInfo.zgfy; + if(_this.sqfs.length > 0){ + let paramssqfs = _this.sqfs[0].paramValue; + if(paramssqfs == 2){ + _this.isShow = true; + }else{ + _this.isShow = false; + } + } + _this.shfs = data.mapInfo.shfs; + _this.sqtj = data.mapInfo.sqtj; + if (!data.mapInfo.order && data.mapInfo.order != null) { + _this.order = data.mapInfo.order; + } + } + }); + }, + setSelectGoods(data){ + console.log(data); + }, + + //选择产品 + handleEdit(index, row) { + this.pushToSelectGoods(row); + }, + pushToSelectGoods(goods) { + console.log(this.order) + //判断是否被选中 + let selected = false; + for(let i = 0; i < this.order.length; i++){ + if (this.order[i].id === goods.id) { + selected = true; + return; + } + } + if (!selected) { + //未选中产品加入列表 + let item = {}; + item.ShopProduct = goods; + item.goodsId = goods.id; + item.count = 1; + this.order.push(item.ShopProduct); + } + + }, + + /** + * 点击多选 + */ + handleSelectionChange(val) { + this.multipleSelection = val; + }, + /** + * 提交表单订单 + * submitType 1 提交,2保存 + */ + submitOrder(submitType) { + let _this = this; + let submitDate =""; + for (let i = 0; i < _this.order.length; i++) { + let ShopProduct = _this.order[i]; + let goodsId = ShopProduct.id; + submitDate = submitDate +goodsId+","; + } + _this.cpid = submitDate; + _this.drawer = false; + }, + /** + * 批量选择产品 + */ + chouseGoods() { + let _this = this; + this.closeXm(); + }, + /** + * 行点击事件 + */ + handleClickTableRow(row, event, column) { + this.pushToSelectGoods(row); + }, + /** + * 删除组合产品 + */ + removeItem(index, row) { + this.order.splice(index, 1); + }, + /** + * 搜索项目绑定的产品信息 + */ + searchGoods() { + let _this = this; + if (this.queryKey && this.queryKey.trim().length > 0) { + this.showSearchTable = true; + this.loading = true; + AjaxProxy.requst({ + app: _this, + contentType: 'application/x-www-form-urlencoded', + //TODO 优化下拉加载 + data: {name: _this.queryKey, limit: 10000}, + url: basePath + "/fenXiao/ruleSetting/selectProduct", + callback: function (data) { + _this.searchTableData = data.rows; + _this.loading = false; + } + }); + } else { + this.showSearchTable = false; + } + }, + closeXm() { + this.showSearchTable = false; + }, + + submit() { + console.log("提交"); + let _this = this; + let submitDate = []; + for (let i = 0; i < _this.fxkg.length; i++) { + let paramSetting = _this.fxkg[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.zgfy.length; i++) { + let paramSetting = _this.zgfy[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.fxms.length; i++) { + let paramSetting = _this.fxms[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.sqfs.length; i++) { + let paramSetting = _this.sqfs[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.shfs.length; i++) { + let paramSetting = _this.shfs[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.sqtj.length; i++) { + let paramSetting = _this.sqtj[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1; + let paramValue2; + if(paramValue === '3'){ + paramValue1 = _this.cpid; + }else if(paramValue === '4'){ + paramValue2 = paramSetting.paramValue2; + } + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + + AjaxProxy.requst({ + app: _this, + data: submitDate, + url: basePath + '/fenXiao/ruleSetting/updateFenXiaoSetting', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + onClose: function () { + _this.loadParamSetting(); + } + }); + } + }); + } + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html new file mode 100644 index 0000000..7611622 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html @@ -0,0 +1,672 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + .el-aside { + color: #333; + line-height: 15px; + } + .el-main { + color: #333; + line-height: 15px; + } + .box-card { + width: 160px; + border-radius: 5px; + color: #ffffff; + padding: 5px 5px; + margin-right: 20px; + cursor: pointer; + float: right; + } + .el-card__body { + padding: 0px; + } + </style> +</head> + +<body> +<div class="ibox-content" id="app" v-cloak> + <el-container> + <el-aside width="60px" style="display:flex;align-items: center;"> + <el-avatar :size="50" :src="basicdetail.avatarUrl" style="display:flex;align-items: center;margin-left: 10px"></el-avatar> + </el-aside> + <el-main> + <el-row style="display:flex;align-items: center;padding: 10px;"> + <el-col :span="8" style="display:flex;align-items: center;"> + <span style="font-size: 20px;">{{basicdetail.nickname}} </span> + </el-col> + <el-col :span="6"> + <el-select v-model="basicdetail.grade" @focus="getDatalist()" @change="changeSaleManGrade(basicdetail.grade)" placeholder="请选择" filterable allow-create> + <el-option v-for="item in salemanGradeList " :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-col> + <el-col :span="10"> + </el-col> + </el-row> + <el-row style="display:flex;padding: 5px;"> + <el-col> + <span> + 手机号码:{{basicdetail.phone}} | + 加入时间:{{basicdetail.createTime}} + </span> + </el-col> + </el-row> + <el-row style="display:flex;padding: 5px;"> + <el-col> + <span> + 邀请人:{{basicdetail.parentUser}} | + 来源: + <span v-if="basicdetail.applyWay == 1">自主申请</span> + <span v-if="basicdetail.applyWay == 2">自动添加</span> + <span v-if="basicdetail.applyWay == 3">上级邀请</span> + <span v-if="basicdetail.applyWay == 4">手动添加</span> | + 状态: + <span v-if="basicdetail.applyStatus == 1">待审核</span> + <span v-if="basicdetail.applyStatus == 2">通过</span> + <span v-if="basicdetail.applyStatus == 3">未通过</span> + </span> + </el-col> + </el-row> + </el-main> + <el-main> + <el-row> + <el-row style="display:flex;align-items: center;text-align: center;"> + <el-card class="box-card" style="background-color: #0f9aef;"> + <div style="padding:10px;font-size: 20px;">{{basicdetail.lowerLevelNum}}人</div> + <div>绑定客户</div> + </el-card > + <el-card class="box-card" style="background: #67C23A;"> + <div style="padding:10px;font-size: 20px;">{{basicdetail.invitedNum}}人</div> + <div>邀请下级</div> + </el-card > + <el-card class="box-card" style="background: rgb(121, 187, 255);"> + <div style="padding:10px;font-size: 20px;">{{basicdetail.totalRevenue}}元</div> + <div>累计收益</div> + </el-card > + <el-card class="box-card" style="background: rgb(93 191 45);"> + <div style="padding:10px;font-size: 20px;">{{basicdetail.balance}}元</div> + <div>待结算</div> + </el-card > + </el-row> + </el-row> + </el-main> + </el-container> + + <el-row> + <el-tabs v-model="activeName" > + <el-tab-pane label="绑定客户" name="first"> + <el-row style="display:flex;align-items: center;text-align: right;"> + <el-col> + <el-form ref="form" :model="form" inline > + <el-form-item prop="userName" > + <el-input v-model="form.userName" placeholder="请输入会员姓名"></el-input> + </el-form-item> + + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + </el-form> + </el-col> + </el-row> + <el-row class="table-style" > + <el-table id="proj" :data="fxyList.rows" :height="height" stripe:true @sort-change="sortChange"> + <el-table-column + type="selection"> + </el-table-column> + <el-table-column + label="客户" + show-overflow-tooltip> + <template slot-scope="scope"> + <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/> + {{scope.row.nickname}} + </template> + </el-table-column> + <el-table-column + prop="createTime" + label="绑定时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="客户状态"> + <template slot-scope="scope"> + <span v-if="scope.row.doneNum == 0">已成交</span> + <span v-if="scope.row.doneNum > 0">未成交</span> + </template> + </el-table-column> + <el-table-column label="操作" width="240"> + <template slot-scope="scope"> + <el-row style="display:flex;"> + <el-button type="primary" size="mini" @click="openExamineSaleMan(scope.row)">解绑</el-button> + </el-row> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="fxyList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="fxyList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="fxyList.total"> + </el-pagination> + </el-row> + </el-tab-pane> + + <el-tab-pane label="邀请下级" name="second"> + <el-row style="display:flex;align-items: center;text-align: right;"> + <el-col> + <el-form ref="formlow" :model="formlow" inline > + <el-form-item prop="userName"> + <el-input v-model="formlow.userName" placeholder="请输入会员姓名"></el-input> + </el-form-item> + + <el-button type="primary" @click="searchlow" >搜索</el-button> + <el-button @click="resetFormlow('formlow')">重置</el-button> + </el-form> + </el-col> + </el-row> + <el-row class="table-style" > + <el-table id="proj" :data="lowLevelList.rows" :height="height" stripe:true @sort-change="sortChange"> + <el-table-column + type="selection"> + </el-table-column> + <el-table-column + label="客户"> + <template slot-scope="scope"> + <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/> + {{scope.row.nickname}} + </template> + </el-table-column> + <el-table-column + prop="createTime" + label="绑定时间"> + </el-table-column> + <el-table-column + label="绑定方式"> + <template slot-scope="scope"> + <span v-if="scope.row.applyWay == 1">自主申请</span> + <span v-if="scope.row.applyWay == 2">自动添加</span> + <span v-if="scope.row.applyWay == 3">上级邀请</span> + <span v-if="scope.row.applyWay == 4">手动添加</span> + </template> + </el-table-column> + <el-table-column label="操作" width="240"> + <template slot-scope="scope"> + <el-row style="display:flex;"> + <el-button type="primary" size="mini" @click="openExamineSaleMan(scope.row)">解绑</el-button> + </el-row> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizelow" + @current-change="changeCurrentPagelow" + :current-page="lowLevelList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="lowLevelList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="lowLevelList.total"> + </el-pagination> + </el-row> + </el-tab-pane> + + <el-tab-pane label="收益订单" name="third"> + <el-row style="display:flex;align-items: center;text-align: right;"> + <el-col> + <el-form ref="formOrder" :model="formOrder" inline > + <el-form-item label="结算状态" prop="orderType"> + <el-select v-model="formOrder.orderType" placeholder="请选择"> + <el-option + v-for="item in orderTypeList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item prop="userName"> + <el-input v-model="formOrder.userName" placeholder="请输入会员姓名"></el-input> + </el-form-item> + <el-button type="primary" @click="searchFormOrder" >搜索</el-button> + <el-button @click="resetFormOrder('formOrder')">重置</el-button> + </el-form> + </el-col> + </el-row> + <el-row class="table-style" > + <el-table id="proj" :data="orderLevelList.rows" :height="height" stripe:true @sort-change="sortChange"> + <el-table-column + prop="orderNo" + label="订单编号" + show-overflow-tooltip> + </el-table-column> + <el-table-column + prop="orderMoney" + label="实付金额"> + </el-table-column> + <el-table-column + label="订单状态"> + <template slot-scope="scope"> + <span v-if="scope.row.orderState == 1">待付款</span> + <span v-if="scope.row.orderState == 2">待配送</span> + <span v-if="scope.row.orderState == 3">待收货</span> + <span v-if="scope.row.orderState == 4">待评价</span> + <span v-if="scope.row.orderState == 5">已评价</span> + <span v-if="scope.row.orderState == 6">申请退款</span> + <span v-if="scope.row.orderState == 7">退款成功</span> + <span v-if="scope.row.orderState == 8">退款拒绝</span> + <span v-if="scope.row.orderState == 9">已取消</span> + </template> + </el-table-column> + <el-table-column + prop="storeName" + label="下单门店" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="客户" + show-overflow-tooltip> + <template slot-scope="scope"> + <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/> + {{scope.row.nickName}} + </template> + </el-table-column> + <el-table-column + prop="createTime" + label="时间" + show-overflow-tooltip> + </el-table-column> + <el-table-column + label="收益类型"> + <template slot-scope="scope"> + <span v-if="scope.row.revenueType == 1">推广收益</span> + <span v-if="scope.row.revenueType == 2">邀请收益</span> + </template> + </el-table-column> + <el-table-column + prop="amount" + label="收益金额"> + </el-table-column> + <el-table-column + label="结算状态"> + <template slot-scope="scope"> + <span v-if="scope.row.orderStatus == 1">待结算</span> + <span v-if="scope.row.orderStatus == 2">已结算</span> + <span v-if="scope.row.orderStatus == 3">已退款</span> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizeOrder" + @current-change="changeCurrentPageOrder" + :current-page="orderLevelList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="orderLevelList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="orderLevelList.total"> + </el-pagination> + </el-row> + </el-tab-pane> + </el-tabs> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //获取传输的USERID对象 + var userId = $.query.get("userId"); + var applyId = $.query.get("applyId"); + + var app = new Vue({ + el: '#app', + data: { + activeName: 'first', + basicdetail:{}, + //绑定客户 + form:{ + userName:'', + order:'', + sort:'' + }, + salemanGradeList:[], + fxyList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + //邀请下级 + formlow:{ + userName:'', + order:'', + sort:'' + }, + lowLevelList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + //收益订单 + formOrder:{ + userName:'', + orderType:'', + order:'', + sort:'' + }, + //条件查询结算状态 + orderTypeList:[ + {value:'',label:'全部'}, + {value:1,label:'待结算'}, + {value:2,label:'已结算'}, + {value:3,label:'已退款'} + ], + orderLevelList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + height:'calc(100vh - 400px)', + }, + + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadParamSettingBasic(); + _this.loadParamSetting(); + _this.loadParamSettinglow(); + _this.loadParamSettingOrder(); + _this.getDatalist(); + }, + //修改等级 + changeSaleManGrade(id){ + let _this = this; + let obj = { + userId: userId, + gradeId: id, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoUser/changeSaleManGrade', + callback: function (data) { + _this.$message.success(data.info); + this.loadInfo(); + } + }); + }, + //加载基本数据信息 + loadParamSettingBasic() { + let _this = this; + let data={ + userId:userId, + applyId:applyId, + }; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/loadParamSettingBasic', + callback: function (data) { + _this.basicdetail = data.mapInfo.basicdetail; + } + }); + }, + //绑定客户 + loadParamSetting() { + let _this = this; + let data=_this.getRequestParam(); + data.pageSize=_this.fxyList.pageSize; + data.pageNum=_this.fxyList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/loadParamSetting', + callback: function (data) { + _this.fxyList.rows = data.mapInfo.customDetailRecords; + _this.fxyList.total = data.mapInfo.customDetailTotal; + _this.loadParamSettingBasic(); + } + }); + }, + //查询参数 + getRequestParam(){ + let _this = this; + return { + userName:_this.form.userName, + order:_this.form.order, + sort:_this.form.sort, + userId:userId, + applyId:applyId, + } + }, + //查询 + search:function(){ + this.fxyList.currentPage=1; + this.loadParamSetting(); + }, + //重置 + resetForm(formName) { + this.$refs[formName].resetFields(); + }, + changePageSize(val) { + this.fxyList.pageSize = val; + this.loadParamSetting(); + }, + changeCurrentPage(val) { + this.fxyList.currentPage = val; + this.loadParamSetting(); + }, + //邀请下级 + loadParamSettinglow() { + let _this = this; + let data=_this.getRequestParamlow(); + data.pageSize=_this.lowLevelList.pageSize; + data.pageNum=_this.lowLevelList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/loadParamSettinglow', + callback: function (data) { + _this.lowLevelList.rows = data.mapInfo.customLowRecords; + _this.lowLevelList.total = data.mapInfo.customLowTotal; + _this.loadParamSettingBasic(); + } + }); + }, + //查询参数 + getRequestParamlow(){ + let _this = this; + return { + userName:_this.formlow.userName, + order:_this.formlow.order, + sort:_this.formlow.sort, + userId:userId, + applyId:applyId, + } + }, + //查询 + searchlow:function(){ + this.lowLevelList.currentPage=1; + this.loadParamSettinglow(); + }, + //重置 + resetFormlow(formName) { + this.$refs[formName].resetFields(); + }, + changePageSizelow(val) { + this.lowLevelList.pageSize = val; + this.loadParamSettinglow(); + }, + changeCurrentPagelow(val) { + this.lowLevelList.currentPage = val; + this.loadParamSettinglow(); + }, + + //收益订单 + loadParamSettingOrder() { + let _this = this; + let data=_this.getRequestParamOrder(); + data.pageSize=_this.orderLevelList.pageSize; + data.pageNum=_this.orderLevelList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/loadParamSettingOrder', + callback: function (data) { + _this.orderLevelList.rows = data.mapInfo.orderRecords; + _this.orderLevelList.total = data.mapInfo.orderTotal; + _this.loadParamSettingBasic(); + } + }); + }, + //查询参数 + getRequestParamOrder(){ + let _this = this; + return { + userName:_this.formOrder.userName, + orderType:_this.formOrder.orderType, + order:_this.formOrder.order, + sort:_this.formOrder.sort, + userId:userId, + applyId:applyId, + } + }, + //查询 + searchFormOrder:function(){ + this.orderLevelList.currentPage=1; + this.loadParamSettingOrder(); + }, + //重置 + resetFormOrder(formName) { + this.$refs[formName].resetFields(); + }, + changePageSizeOrder(val) { + this.orderLevelList.pageSize = val; + this.loadParamSettingOrder(); + }, + changeCurrentPageOrder(val) { + this.orderLevelList.currentPage = val; + this.loadParamSettingOrder(); + }, + + // select下拉框获取焦点的时候下拉框数据源---分销员等级 + getDatalist() { + let _this = this; + AjaxProxy.requst({ + app: _this, + data:[], + url: basePath + '/fenXiao/fenXiaoUser/getShopSalesmanGrade', + callback: function (data) { + _this.salemanGradeList = data.mapInfo.salesGrade; + } + }); + }, + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadInfo(); + } + }, + //解绑 + openExamineSaleMan(row) { + this.$confirm('是否解绑?', '解绑', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '同意', + cancelButtonText: '取消', + type: 'info' + }).then(() => { + //通过 + console.log("conform"); + this.unbundlingSaleMan(row); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + } + }); + }, + unbundlingSaleMan(row){ + let _this = this; + let userId = row.userId; + let obj = { + userId: userId, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoUser/unbundlingSaleMan', + callback: function (data) { + _this.$message.success(data.info); + if(_this.activeName == "first"){ + _this.loadParamSetting(); + } + if(_this.activeName == "second"){ + _this.loadParamSettinglow(); + } + } + }); + }, + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html new file mode 100644 index 0000000..2e975b3 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html @@ -0,0 +1,770 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style> + .panel-body{ + overflow: hidden; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + .avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + overflow: hidden; + } + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 178px; + height: 178px; + line-height: 178px; + text-align: center; + } + .avatar { + width: 178px; + height: 178px; + display: block; + } + </style> +</head> + +<body> +<div class="panel-body" id="app" v-cloak> + <el-row> + <el-tabs v-model="activeName" > + <el-tab-pane label="分销员管理" name="first"> + <el-row > + <el-col :span="6" style="display:flex;align-items: center;"> + <el-button type="primary" @click="addSaleMan()">新增分销员</el-button> + </el-col> + <el-col :span="12" style="display: flex;align-items: center;"> + <el-form ref="form" :model="form" inline > + <el-form-item label="审核状态" prop="shenheState"> + <el-select v-model="form.shenheState" placeholder="请选择"> + <el-option + v-for="item in shenheStateList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="分销员等级" prop="salemanGrade"> + <el-select v-model="form.salemanGrade" placeholder="请选择" filterable allow-create> + <el-option v-for="item in salemanGradeList " :key="item.id" :label="item.name" :value="item.id"> + </el-option> + </el-select> + </el-form-item> + <el-form-item prop="userName"> + <el-input v-model="form.userName" placeholder="请输入会员姓名"></el-input> + </el-form-item> + </el-form> + </el-col> + <el-col :span="6" style="display:flex;align-items: center;"> + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + </el-col> + </el-row> + <el-row class="table-style" > + <el-table id="proj" :data="fxyList.rows" :height="height" stripe:true @sort-change="sortChange"> + <el-table-column + type="selection"> + </el-table-column> + <el-table-column + label="分销员" + show-overflow-tooltip + width="150"> + <template slot-scope="scope"> + <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/> + {{scope.row.nickname}} + </template> + </el-table-column> + <el-table-column + prop="parentUserNow" + label="当前上级"> + </el-table-column> + <el-table-column + prop="lowerLevelNum" + label="推广客户"> + </el-table-column> + <el-table-column + prop="invitedNum" + label="邀请下级"> + </el-table-column> + <el-table-column + prop="totalRevenue" + label="累计收益"> + </el-table-column> + <el-table-column + prop="balance" + label="待结算"> + </el-table-column> + <el-table-column + prop="grade" + label="等级"> + </el-table-column> + <el-table-column + prop="createTime" + label="加入时间" + show-overflow-tooltip + :formatter="formatDate"> + </el-table-column> + <el-table-column + label="状态"> + <template slot-scope="scope"> + <span v-if="scope.row.applyStatus == 1">待审核</span> + <span v-if="scope.row.applyStatus == 2">通过</span> + <span v-if="scope.row.applyStatus == 3">未通过</span> + <span v-if="scope.row.applyStatus == 4">系统删除</span> + </template> + </el-table-column> + <el-table-column + prop="parentUser" + label="注册邀请人"> + </el-table-column> + <el-table-column + label="来源"> + <template slot-scope="scope"> + <span v-if="scope.row.applyWay == 1">自主申请</span> + <span v-if="scope.row.applyWay == 2">自动添加</span> + <span v-if="scope.row.applyWay == 3">上级邀请</span> + <span v-if="scope.row.applyWay == 4">手动添加</span> + </template> + </el-table-column> + <el-table-column label="操作" width="240"> + <template slot-scope="scope"> + <el-row style="display:flex;"> + <el-button type="primary" v-if="scope.row.applyStatus == 1" size="mini" @click="openExamineSaleManApply(scope.row)">审核</el-button> + <el-button type="primary" v-if="scope.row.applyStatus == 2" size="mini" @click="openUpdateSaleManGrade(scope.row)">修改等级</el-button> + <el-button type="primary" size="mini" @click="openUpdateSaleManGrade(scope.row)">详情</el-button> + <el-button type="danger" v-if="scope.row.applyStatus == 2" size="mini" @click="delSaleManGradeApply(scope.row)">删除</el-button> + </el-row> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="fxyList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="fxyList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="fxyList.total"> + </el-pagination> + </el-row> + </el-tab-pane> + + <el-tab-pane label="分佣方案" name="second"> + <el-row class="table-style" > + <el-table id="proj" :data="fyfaList.rows" :height="height"> + <el-table-column + prop="name" + label="方案名称"> + <template slot-scope="scope"> + <el-input class="edit-input" v-model="scope.row.name" placeholder="方案名称"></el-input> + </template> + </el-table-column> + <el-table-column + prop="sealesCommission" + label="自购返佣 %"> + <template slot-scope="scope"> + <el-input class="edit-input" v-model="scope.row.selfCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="自购返佣"></el-input> + </template> + </el-table-column> + <el-table-column + prop="sealesCommission" + label="推广提成 %"> + <template slot-scope="scope"> + <el-input class="edit-input" v-model="scope.row.sealesCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="推广提成"></el-input> + </template> + </el-table-column> + <el-table-column + prop="invitationCommission" + label="邀请提成 %"> + <template slot-scope="scope"> + <el-input class="edit-input" v-model="scope.row.invitationCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="邀请提成"></el-input> + </template> + </el-table-column> + <el-table-column + prop="gradeCondition" + label="等级条件(推广金额)"> + <template slot-scope="scope"> + <el-input class="edit-input" v-model="scope.row.gradeCondition" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="等级条件(推广金额)"></el-input> + </template> + </el-table-column> + <el-table-column label="操作" width="240"> + <template slot-scope="scope"> + <el-row style="display:flex;"> + <el-button type="primary" v-if="scope.row.isDefault == 1" size="mini" @click="addFyfaReady()">新增</el-button> + <el-button type="primary" size="mini" @click="updateFyfa(scope.row)">保存</el-button> + <el-button type="danger" v-if="scope.row.isDefault == 2" size="mini" @click="delFyfa(scope.row)">删除</el-button> + </el-row> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSizelow" + @current-change="changeCurrentPagelow" + :current-page="fyfaList.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="fyfaList.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="fyfaList.total"> + </el-pagination> + </el-row> + </el-tab-pane> + + <el-tab-pane label="推广文案" name="third"> + <p class="el-big-title">文案描述</p> + <el-row justify="center" type="flex"> + <script style="height: 400px;width: 375px;" id="description" name="description" + type="text/plain"> + </script> + </el-row> + <el-row justify="center" type="flex"> + <el-button type="primary" size="mini" @click="wamsSubmit()">保存</el-button> + </el-row> + </el-tab-pane> + + <el-tab-pane label="推广图片" name="fourth"> + <p class="el-big-title">上传图片</p> + <el-row justify="center" type="flex"> + <el-upload + class="avatar-uploader" + action="/admin/multipleUploadFile/doUpload" + :show-file-list="false" + :on-success="handleAvatarSuccess" + :before-upload="beforeAvatarUpload"> + <img v-if="imageUrl" :src="imageUrl" class="avatar"> + <i v-else class="el-icon-plus avatar-uploader-icon"></i> + </el-upload> + </el-row> + <el-row justify="center" type="flex"> + <el-button type="primary" size="mini" @click="tgtpSubmit()">保存</el-button> + </el-row> + </el-tab-pane> + + </el-tabs> + </el-row> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + +<script> + //百度编辑器 + var ue = { + initialFrameWidth :750 + }; + var app = new Vue({ + el: '#app', + data: { + height:'calc(100vh - 240px)', + activeName: 'first', + fenxiaoGrade: "", + //推广文案 + tgwa: {}, + //图片上传 + imageUrl: '', + //分佣方案 + fyfaList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + //分销员管理 + shenheAgreeType : 2, + shenheDisagreeType : 3, + form:{ + shenheState:'', + salemanGrade:'', + userName:'', + order:'', + sort:'' + }, + //条件查询审核状态 + shenheStateList:[ + {value:'',label:'全部'}, + {value:1,label:'未审核'}, + {value:2,label:'通过'}, + {value:3,label:'未通过'} + ], + //条件查询分销员等级 + salemanGradeList:[], + fxyList:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + }, + created: function () { + this.loadInfo(); + window.addEventListener("keydown", this.keydown); + //初始化编辑器 + ue = UE.getEditor('description', { + toolbars: [ + [ + 'anchor', + 'bold', //加粗 + 'indent', //首行缩进 + 'italic', //斜体 + 'underline', //下划线 + 'strikethrough', //删除线 + 'subscript', //下标 + 'fontborder', //字符边框 + 'superscript', //上标 + 'formatmatch', //格式刷 + 'pasteplain', //纯文本粘贴模式 + 'selectall', //全选 + 'horizontal', //分隔线 + 'removeformat', //清除格式 + 'unlink', //取消链接 + 'inserttitle', //插入标题 + 'cleardoc', //清空文档 + 'fontfamily', //字体 + 'fontsize', //字号 + 'paragraph', //段落格式 + 'simpleupload', //单图上传 + 'insertimage', //多图上传 + 'link', //超链接 + 'emotion', //表情 + 'justifyleft', //居左对齐 + 'justifyright', //居右对齐 + 'justifycenter', //居中对齐 + 'justifyjustify', //两端对齐 + 'forecolor', //字体颜色 + 'backcolor', //背景色 + 'insertorderedlist', //有序列表 + 'insertunorderedlist', //无序列表 + 'fullscreen', //全屏 + 'rowspacingtop', //段前距 + 'rowspacingbottom', //段后距 + 'imagecenter', //居中 + 'lineheight', //行间距 + 'customstyle', //自定义标题 + 'autotypeset', //自动排版 + 'background', //背景 + ] + ]}); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadParamSetting(); + _this.loadFyfaSetting(); + _this.loadTgwaSetting(); + _this.loadTgtpSetting(); + _this.getSalemanGradeList(); + }, + //推广文案 + loadTgwaSetting() { + let _this = this; + AjaxProxy.requst({ + app: _this, + data:[], + url: basePath + '/fenXiao/fenXiaoUser/loadTgwaSetting', + callback: function (data) { + _this.tgwa = data.mapInfo.tgwa; + var ue = UE.getEditor('description'); + ue.ready(function() {//编辑器初始化完成再赋值 + ue.setContent(_this.tgwa.paramValue3); //赋值给UEditor + }); + } + }); + }, + wamsSubmit(){ + let _this = this; + let tgfa = ue.getContent(); + let data= { + tgfa:tgfa, + }; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/updateTgjh', + callback: function (data) { + _this.$message.success(data.info); + _this.loadTgwaSetting(); + } + }); + }, + //图片上传 + loadTgtpSetting() { + let _this = this; + AjaxProxy.requst({ + app: _this, + data:[], + url: basePath + '/fenXiao/fenXiaoUser/loadTgtpSetting', + callback: function (data) { + _this.imageUrl = data.mapInfo.tgtp.paramValue; + } + }); + }, + tgtpSubmit(){ + let _this = this; + let imageUrl = _this.imageUrl; + let data= { + imageUrl:imageUrl, + }; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/updateTgtp', + callback: function (data) { + _this.$message.success(data.info); + _this.loadTgtpSetting(); + } + }); + }, + handleAvatarSuccess(res, file) { + this.imageUrl = res.path; + }, + beforeAvatarUpload(file) { + const isJPG = file.type === 'image/jpeg'; + const isLt2M = file.size / 1024 / 1024 < 2; + + if (!isJPG) { + this.$message.error('上传头像图片只能是 JPG 格式!'); + } + if (!isLt2M) { + this.$message.error('上传头像图片大小不能超过 2MB!'); + } + return isJPG && isLt2M; + }, + //分佣方案 + loadFyfaSetting() { + let _this = this; + let data=_this.getRequestParam(); + data.pageSize=_this.fyfaList.pageSize; + data.pageNum=_this.fyfaList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/findFyfaManageList', + callback: function (data) { + _this.fyfaList.rows = data.rows; + _this.fyfaList.total = data.total; + } + }); + }, + changePageSizelow(val) { + this.fyfaList.pageSize = val; + this.loadFyfaSetting(); + }, + changeCurrentPagelow(val) { + this.fyfaList.currentPage = val; + this.loadFyfaSetting(); + }, + //新增 + addFyfaReady(){ + let _this = this; + let fyfaReady = {}; + _this.fyfaList.rows.push(fyfaReady); + }, + // addFyfa(){ + // let _this = this; + // AjaxProxy.requst({ + // app: _this, + // data:[], + // url: basePath + '/fenXiao/fenXiaoUser/addFyfa', + // callback: function (data) { + // _this.$message.success(data.info); + // _this.loadFyfaSetting(); + // } + // }); + // }, + updateFyfa(row){ + let _this = this; + let id = row.id; + let name = row.name; + let sealesCommission = row.sealesCommission; + let selfCommission = row.selfCommission; + let invitationCommission = row.invitationCommission; + let gradeCondition = row.gradeCondition; + let obj = { + id: id, + name: name, + sealesCommission: sealesCommission, + selfCommission: selfCommission, + invitationCommission: invitationCommission, + gradeCondition: gradeCondition, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoUser/updateFyfa', + callback: function (data) { + _this.$message.success(data.info); + _this.loadFyfaSetting(); + } + }); + }, + //删除 + delFyfa(row){ + let _this = this; + _this.$confirm('是否删除?', '删除', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'info' + }).then(() => { + //通过 + _this.delFyfaApply(row); + + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + //this.$message({type: 'info',message: ''}) + } + }); + }, + delFyfaApply(row){ + let _this = this; + let id = row.id; + let obj = { + gradeId: id, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoUser/delFyfaApply', + callback: function (data) { + _this.$message.success(data.info); + _this.loadFyfaSetting(); + } + }); + }, + //分销员管理 + loadParamSetting() { + let _this = this; + let data=_this.getRequestParam(); + data.pageSize=_this.fxyList.pageSize; + data.pageNum=_this.fxyList.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanApplyList', + callback: function (data) { + _this.fxyList.rows = data.rows; + _this.fxyList.total=data.total; + } + }); + }, + // 下拉框数据源---分销员等级 + getSalemanGradeList() { + let _this = this; + AjaxProxy.requst({ + app: _this, + data:[], + url: basePath + '/fenXiao/fenXiaoUser/getShopSalesmanGrade', + callback: function (data) { + _this.salemanGradeList = data.mapInfo.salesGrade; + } + }); + }, + getRequestParam(){ + let _this = this; + return { + shenheState:_this.form.shenheState, + salemanGrade:_this.form.salemanGrade, + userName:_this.form.userName, + order:_this.form.order, + sort:_this.form.sort, + } + }, + search:function(){ + this.fxyList.currentPage=1; + this.loadParamSetting(); + }, + keydown(evt){ + if(evt.keyCode==13) { + this.search(); + } + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + }, + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadParamSetting(); + } + }, + changePageSize(val) { + this.fxyList.pageSize = val; + this.loadParamSetting(); + }, + changeCurrentPage(val) { + this.fxyList.currentPage = val; + this.loadParamSetting(); + }, + //时间格式化 + formatDate(row,column){ + let data = row[column.property] + if (data ===null) { + return '' + } + let dt = new Date(data) + return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' ' + dt.getHours() + ':' + dt.getMinutes() + }, + //新增分销员页面 + addSaleMan(){ + layer.full(layer.open({ + type: 2, + title: "选择会员", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/fenxiao/fenxiao-apply'] + })); + }, + //删除 + delSaleManGradeApply(row){ + this.$confirm('是否删除?', '删除', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'info' + }).then(() => { + //通过 + this.examineDelSaleManGradeApply(row); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + console.log("cancel"); + }else{ + //关闭按钮 + console.log("close"); + //this.$message({type: 'info',message: ''}) + } + }); + }, + examineDelSaleManGradeApply(row){ + let _this = this; + let userId = row.userId; + let id = row.id; + let obj = { + userId: userId, + applyId: id, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoUser/delSaleManGradeApply', + callback: function (data) { + _this.$message.success(data.info); + _this.loadParamSetting(); + } + }); + }, + //修改等级跳转 + openUpdateSaleManGrade(row){ + layer.full(layer.open({ + type: 2, + title: "查看", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content : [ basePath + '/admin/redirect/fenxiao/fenxiao-update?userId=' + row.userId+'&applyId='+row.id ] + })); + }, + //审核 + openExamineSaleManApply(row) { + this.$confirm('是否通过?', '审核', { + distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别 + confirmButtonText: '通过', + cancelButtonText: '不通过', + type: 'info' + }).then(() => { + //通过 + this.examineSaleManApply(row,this.shenheAgreeType); + }).catch(action => { + //不通过 + if(action === 'cancel'){ + this.examineSaleManApply(row,this.shenheDisagreeType); + }else{ + //关闭按钮 + console.log("close"); + //this.$message({type: 'info',message: ''}) + } + }); + }, + examineSaleManApply(row,type){ + let _this = this; + let userId = row.userId; + let applyId = row.id; + let obj = { + userId: userId, + applyId: applyId, + applyState: type, + } + AjaxProxy.requst({ + app: _this, + data:obj, + url: basePath + '/fenXiao/fenXiaoUser/examineSaleManApply', + callback: function (data) { + _this.$message.success(data.info); + _this.loadParamSetting(); + } + }); + } + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html index badcee5..70680aa 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html @@ -10,253 +10,987 @@ <meta http-equiv="Cache-Control" content="no-siteapp"/> <LINK rel="Bookmark" href="../images/favicon.ico"> <!-- 本框架基本脚本和样式 --> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + + <script type="text/javascript" th:src="@{/js/function/meiduCommon.js}"></script> <title></title> -</head> - -<div class="panel-body"> - <div class="form-group"> - <label class="col-sm-2 control-label">订单号</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.orderNo}"></span> - </div> - - <label class="col-sm-2 control-label">订单总价</label> - <div class="col-sm-4"> - <span class="form-control-static" id="total" th:text="${order.total}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">客户编号</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.vipNo}"></span> - </div> - <label class="col-sm-2 control-label">客户姓名</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.vipName}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">现金支付金额</label> - <div class="col-sm-4"> - <span class="form-control-static">[[${order.cashPay}]]</span> - </div> - <label class="col-sm-2 control-label">卡支付金额</label> - <div class="col-sm-4"> - <span class="form-control-static" id="total">[[${order.cardPay}]]</span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">欠款</label> - <div class="col-sm-4"> - <span class="form-control-static">[[${order.arrears}]]</span> - </div> - <label class="col-sm-2 control-label">折后价</label> - <div class="col-sm-4"> - <span class="form-control-static" id="zkTotal" th:text="${order.zkTotal}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">顾问姓名</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.staffName}"></span> - </div> - <label class="col-sm-2 control-label">备注</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.remark}"></span> - </div> - </div> - -</div> - - -<div class="col-sm-12 form-group"> - <div class="panel-body"> - <table class="table table-striped table-condensed table-hover"> - <thead> - <tr> - <th>序号</th> - <th>商品名称</th> - <th>单价</th> - <th>购买数量</th> - <th>折扣单价</th> - <th>卡付款</th> - <th>现金付款</th> - <th>欠款</th> - </tr> - </thead> - <tbody id="tbody"> - <tr th:each="item,count:${order.items }"> - <td th:text="${count.index}+1"></td> - <td><span th:text=" ${item.shoppingGoods.name }"></span> - - <span th:if="${item.isFree eq '是' }" th:text="赠"></span> - </td> - <td th:text="${item.price }"></td> - <td th:text="${item.count}"></td> - <td th:text="${item.zkPrice}"></td> - <td>[[${item.cardPay}]]</td> - <td>[[${item.cashPay}]]</td> - <td>[[${item.arrears}]]</td> - </tr> - </tbody> - </table> - </div> - <div class="form-group "> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> - <button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">取消</button> - </div> - </div> -</div> - -</body> - -<form id="print" style="display: none;"> - <!-- <form id="print"> --> - <style midia="print"> - .table1 { - width: 500px; - font-size: 10px; - border-top: 1px solid #333; - margin-top: 40px; + <style> + .ibox-content { + background-color: rgba(240, 242, 245, 1); + } + .aside label { + width: 100%; + margin: 5px 0 !important; + } + .arrears { + color: #E6A23C; } - .table2 { - margin-bottom: 100px; + .paymethod ul { + padding: 0; + margin: 0; + height: 50px; } - - .table1 td { - height: 20px; + .paymethod ul li { + padding: 10px; + margin: 5px; + list-style:none; + float: left; + display: block; + cursor: pointer; + position: relative; + border: white 1px solid; } - - .table2 td { - height: 20px; + .paymethod ul li:hover { + border: #409EFF 1px solid; } - - .table1 tr { - height: 30px; + .paymethod .active { + border: #409EFF 1px solid; } - - .table3 { + .paymethod .active::after { + content: ''; + display: block; + height: 0px; + width: 0px; position: absolute; - bottom: 20px; + bottom: 0; + right: 0; + color:#fff; + /**对号大小*/ + font-size: 10px; + line-height: 8px; + border: 3px solid; + border-color: transparent #4884ff #4884ff transparent; } - .tittl { - text-align: center; - font-size: 20px; + .el-dialog__body { + padding-top: 10px !important; } </style> +</head> +<div class="ibox-content" id="app"> + <el-container> + <el-aside class="aside" style="width: 300px; background-color: white; padding: 10px;"> + <el-row style="border-bottom: #E4E7ED 1px solid;"> + <el-col :span="20" style="padding: 10px;"> + <el-row type="flex" align="middle"> + <el-col :span="7"> + <el-avatar :size="60" :src="circleUrl"></el-avatar> + </el-col> + <el-col :span="15" style="margin-left: 10px;"> + <label>{{vipInfo.vipName}}({{vipInfo.vipLevel == null ? '' : vipInfo.vipLevel.levelName}})</label> + <label>{{vipInfo.vipNo}}</label> + </el-col> + </el-row> + <el-row style="line-height: 20px;"> + <label>订单号: <span>{{order.orderNo}}</span></label> + <label>下单顾问: <span>{{order.staffName}}</span></label> + <label>消费门店: <span>{{order.shopShortName}}</span></label> + <label>订单时间: <span>{{order.orderTime}}</span></label> + <label>备 注: <span>{{order.remark}}</span></label> + </el-row> + </el-col> + </el-row> + <el-row style="padding: 10px; border-bottom: #E4E7ED 1px solid;"> + <el-col :span="24"> + <el-row> + <el-col :span="6" style="text-align: right;"> + <label>总金额</label> + <label>整单折扣</label> + <label style="font-size: 14px;">应收金额</label> + <label>欠款</label> + <label>已还</label> + <label v-if="order.refund != 0">退款</label> + </el-col> + <el-col :span="14" style="text-align: right;"> + <label>¥ {{order.total}}</label> + <!-- 退款订单不能显示为负数 --> + <label>¥ {{(order.zkTotal - order.total>0?order.zkTotal - order.total:0).toFixed(2)}}</label> + <label>¥ {{order.zkTotal}}</label> + <label>¥ {{order.arrears}}</label> + <label>¥ {{order.repay}}</label> + <label v-if="order.refund != 0">¥ {{order.refund}}</label> + </el-col> + </el-row> + </el-col> + </el-row> + <el-row style="padding: 10px; border-bottom: #E4E7ED 1px solid;"> + <el-col :span="24"> + <el-row> + <h3>收款明细</h3> + </el-row> + <el-row> + <el-col :span="6" style="text-align: right;"> + <label v-for="(item, index) in payMethodItems">{{item.payMethod}}</label> + </el-col> + <el-col :span="14" style="text-align: right;"> + <label v-for="(item, index) in payMethodItems">¥ {{item.amount}}</label> + </el-col> + </el-row> + </el-col> + </el-row> + <el-row type="flex" justify="center" style="margin: 20px;"> + <el-button size="medium" type="primary" @click="printf">打印</el-button> + </el-row> + </el-aside> + <el-main style="background-color: white; margin-right: 15px; margin-left: 15px; padding: 20px 30px;"> + <el-tabs v-model="activeName" @tab-click="handleClick"> + <el-tab-pane label="订单明细" name="first"> + <el-row> + <el-button size="mini" type="primary" @click="openPayMoneyDialog" v-if="isRefund">提交退款<span v-if="totalRefund"> ¥ {{totalRefund}}</span></el-button> + <el-button size="mini" type="danger" @click="isRefund = false" v-if="isRefund">取消</el-button> + <el-button size="mini" type="primary" @click="isRefund = true" v-if="order.statu == '已付款' && !isRefund">退款</el-button> + </el-row> + <el-row v-show="!isRefund"> + <el-table + :data="orderItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="shoppingGoods.code" + label="产品编号" + width="100"> + </el-table-column> + <el-table-column + prop="shoppingGoods.name" + label="产品名称" + width="280"> + </el-table-column> + <el-table-column + prop="shoppingGoods.goodType" + label="产品类型"> + </el-table-column> + <el-table-column + prop="price" + label="单价"> + </el-table-column> + <el-table-column + prop="count" + label="数量"> + </el-table-column> + <el-table-column + prop="zkPrice" + label="折扣单价"> + </el-table-column> + <el-table-column label="小计" :formatter="calOrderTotalFormatter"> + </el-table-column> + <el-table-column label="支付方式" prop="payMethod"> + </el-table-column> + </el-table> + </el-row> + <el-row v-show="isRefund"> + <el-table + :data="orderItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="shoppingGoods.code" + label="产品编号" + width="100"> + </el-table-column> + <el-table-column + prop="shoppingGoods.name" + label="产品名称" + width="280"> + </el-table-column> + <el-table-column + prop="shoppingGoods.goodType" + label="产品类型"> + </el-table-column> + <el-table-column + prop="zkPrice" + label="单价"> + </el-table-column> + <el-table-column + prop="count" + label="可退数量"> + </el-table-column> + <el-table-column label="退款单价"> + <template slot-scope="scope"> + <el-input @change="calRefund" v-model="scope.row.refundPrice" v-if="scope.row.count > 0"></el-input> + </template> + </el-table-column> + <el-table-column label="退款数量"> + <template slot-scope="scope"> + <el-input @change="calRefund" v-model.number="scope.row.refundCount" v-if="scope.row.count > 0"></el-input> + </template> + </el-table-column> + <el-table-column label="是否退库存" align="center"> + <template slot-scope="scope"> + <el-checkbox v-model="scope.row.returnStore" v-if="scope.row.type == '家居产品' && scope.row.count > 0"></el-checkbox> + </template> + </el-table-column> + </el-table> - <h1 class="tittl">HIVE收银单</h1> - <table class="table1"> + <el-checkbox v-model="isReturnAchieve">退业绩</el-checkbox> + <el-row v-if="isReturnAchieve"> + <el-table + :data="achieveItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="goodsNo" + label="产品编号" + width="100"> + </el-table-column> + <el-table-column + prop="goodsName" + label="产品名称" + width="200"> + </el-table-column> + <el-table-column + prop="zkTotal" + label="收款"> + </el-table-column> + <el-table-column + prop="payMethod" + label="支付方式"> + </el-table-column> + <el-table-column + prop="achieveType" + label="业绩类型"> + </el-table-column> + <el-table-column + prop="goodsCash" + label="原业绩"> + </el-table-column> + <el-table-column + prop="projPercentage" + label="原提成"> + </el-table-column> + <el-table-column label="业绩"> + <template slot-scope="scope"> + <el-input v-model="scope.row.returnAchieve" v-if="scope.row.zkTotal != 0"></el-input> + </template> + </el-table-column> + <el-table-column label="提成"> + <template slot-scope="scope"> + <el-input v-model="scope.row.returnCommission" v-if="scope.row.zkTotal != 0"></el-input> + </template> + </el-table-column> + <el-table-column + label="员工" prop="meiliao"> + </el-table-column> + </el-table> + </el-row> + </el-row> + </el-tab-pane> + <el-tab-pane label="业绩设置" name="second"> + <el-row> + <el-button size="mini" type="primary" @click="saveAchieve" v-if="order.statu == '已付款'">保存</el-button> + </el-row> + <el-table + :data="achieveItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="goodsNo" + label="产品编号" + width="180"> + </el-table-column> + <el-table-column + prop="goodsName" + label="产品名称" + width="180"> + </el-table-column> + <el-table-column + prop="zkTotal" + label="收款"> + </el-table-column> + <el-table-column + prop="payMethod" + label="支付方式"> + </el-table-column> + <el-table-column + prop="t3" + label="业绩类型"> + <template slot-scope="scope"> + <el-select v-model="scope.row.achieveType" placeholder="请选择业绩类型"> + <el-option + v-for="item in achieveTypeList" + :key="item.value" + :label="item.value" + :value="item.value"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + prop="achieve" + label="业绩"> + <template slot-scope="scope"> + <el-input @input="checkAchieveMoney" v-model="scope.row.goodsCash"></el-input> + </template> + </el-table-column> + <el-table-column + prop="projPercentage" + label="提成"> + <template slot-scope="scope"> + <el-input v-model="scope.row.projPercentage"></el-input> + </template> + </el-table-column> + <el-table-column + label="员工"> + <template slot-scope="scope"> + <el-select v-model="scope.row.beaultId" placeholder="请选择员工"> + <el-option + v-for="item in userList" + :key="item.suId" + :label="item.suName" + :value="item.suId"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="primary" v-if="scope.row.isShare" + size="mini" + @click="delAchieve(scope.$index, scope.row)">删除 + </el-button> + <el-tooltip content="分享业绩" placement="top" v-if="!scope.row.isShare"> + <el-button @click="shareAchieve(scope.$index, scope.row)" icon="el-icon-share" + size="mini" type="primary"></el-button> + </el-tooltip> + </template> + </el-table-column> + </el-table> + </el-tab-pane> + <el-tab-pane label="交易流水" name="third"> + <el-table + :data="flowItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="orderNo" + label="订单号" + width="180"> + </el-table-column> + <el-table-column + prop="flowContent" + label="交易内容" + width="300"> + </el-table-column> + <el-table-column + prop="createTime" + label="交易时间"> + </el-table-column> + <el-table-column + prop="flowType" + label="交易类型"> + </el-table-column> + <el-table-column + prop="amount" + label="交易金额"> + </el-table-column> + <el-table-column + prop="payMethod" + label="支付方式"> + </el-table-column> + <el-table-column + prop="cardName" + label="储值卡名称"> + </el-table-column> + <el-table-column + prop="flowNo" + label="流水号"> + </el-table-column> + </el-table> + </el-tab-pane> + </el-tabs> + </el-main> + </el-container> - <tr> - <td>会员姓名:[[${order.vipName }]]</td> - <td>联系电话:[[${order.vipPhone }]]</td> - <td>打印日期:[[<span id="date">]]</span></td> - </tr> - <tr> - <td>会员编号:[[${order.vipNo}]]</td> - <td>健康顾问:[[${order.staffName}]]</td> - </tr> - <tr> - <td>订单编号:[[${order.orderNo}]]</td> - <td>收银人:[[${session.userInfo.suName}]]</td> - </tr> - </table> - <table class="table2 table1"> - <tr> - <td>套餐/项目/家居/充值卡</td> - <td>数量</td> - <td>单价</td> - <td>折后价</td> - <td>赠送</td> - </tr> + <el-dialog title="退款" :visible.sync="dialogSettleVisible"> + <el-row type="flex" align="middle" style="padding: 0 0 10px 0;"> + <el-col :span="5" style="text-align: center;">退款金额</el-col> + <el-col :span="10" style="text-align: center; line-height: 50px;"><span style="color: red; font-size: 20px;">¥ {{refundMoney}}</span></el-col> + </el-row> - <tr th:each="item,count:${orderItems }"> - <td> <span th:text=" ${item.shoppingGoods.name }"></span> + <el-row type="flex" align="middle" style="padding: 10px 0;"> + <el-col :span="5" style="text-align: center;">退款方式</el-col> + <el-col class="paymethod" :span="18"> + <el-row> + <ul> + <span v-for="(item, index) in payMethods"> + <el-popover + :disabled="item.type != '储值卡'" + placement="bottom" + trigger="hover" + @hide="popoverHide(item)"> + <el-row style="text-align: center;"><span style="padding: 0 0 10px 0; display: block; font-size: 12px;">选择储值卡支付方式</span></el-row> + <el-tree :data="moneyCards" + show-checkbox + default-expand-all + node-key="id" + ref="tree" + check-strictly + highlight-current + @check="(click, checked,$item)=>{handleCheckChange(click, checked,$item)}" + :props="defaultProps"> + </el-tree> + <li :class="{active : item.isActive}" slot="reference" @click="payMethodSelect(item, index)"><div style=" height:30px; line-height: 30px; display: flex; align-items: center"><img style="width: 25px; height: 25px; align-items: center;" :src="item.img"><span style="margin-left: 5px;">{{item.value}}</span></div></li> + </el-popover> + </span> + </ul> + </el-row> + </el-col> + </el-row> - <span th:if="${item.isFree eq '是' }" th:text="赠"></span> - </td> - <td th:text="${item.count}"></td> - <td th:text="${item.price }"></td> - <td th:text="${item.zkPrice}"></td> + <el-row type="flex" align="middle" style="padding: 10px 0 50px 0;"> + <el-col :span="5" style="text-align: center;">退款方式</el-col> + <el-col :span="15"> + <el-row style="line-height: 50px;" v-for="(item, index) in payMoneys"> + <el-col :span="6" style="text-align: right; padding-right: 10px; font-size: 12px;">{{item.value}}</el-col> + <el-col :span="8"><el-input v-model="item.money"></el-input></el-col> + <el-col :span="6" style="margin-left: 10px;" v-if="item.type == '储值卡'">{{item.isGift == 1 ? '赠送余额' : '余额' }}:<span class="arrears">¥ {{item.balance}}</span></el-col> + </el-row> + </el-col> + </el-row> - <td> - <span th:if="${item.shoppingGoods.goodType eq '充值卡' }"> - [[${item.shoppingGoods.referencePice }]] - </span> - </td> - </tr> - </table> + <!-- <el-row style="text-align: center; margin: 20px 0 10px 0">--> + <!-- <el-checkbox v-model="printPaper">打印小票</el-checkbox>--> + <!-- </el-row>--> - <table class="table1 table3"> - <tr> - <td colspan="4">备注:</td> - </tr> - <tr> - <td>缴纳金额:[[${order.cashPay+order.cardPay}]]</td> - <td>现金:[[${order.cashPay}]]</td> - <td>划扣:[[${order.cardPay }]]</td> - <td>本次欠款:[[${order.arrears }]]</td> - </tr> + <el-row style="text-align: center; margin: 10px 0 0 0"> + <el-button type="primary" @click="confirmSubmit">确认收款</el-button> + </el-row> + </el-dialog> +</div> +</body> - </table> -</form> -<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> -<script type="text/javascript"> +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:inline="javascript"> + //<![CDATA[ + var app = new Vue({ + el : "#app", + data : { + orderParam : "", + vipInfo : "", + order : "", + activeName : "first", + circleUrl : "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png", + userList : [], + achieveTypeList : [], + orderItems : [], + achieveItems : [], + flowItems : [], + payMethodItems : [], + isRefund : false, + isReturnAchieve : false, + totalRefund : "", + payMethods: [{ + value: '现金支付', + img: '/images/pay/cash.png', + isActive: false, + type: '现金支付' + }, { + value: '微信', + img: '/images/pay/wechat.png', + isActive: false, + type: '微信' + }, { + value: '支付宝', + img: '/images/pay/zhifubao.png', + isActive: false, + type: '支付宝' + }, { + value: '银行卡', + img: '/images/pay/yinlian.png', + isActive: false, + type: '银行卡' + }, { + value: '团购', + img: '/images/pay/tuan.png', + isActive: false, + type: '团购' + }, { + value: '储值卡', + img: '/images/pay/card.png', + isActive: false, + type: '储值卡' + }, ], - var LODOP; + dialogSettleVisible : false, + moneyCards: [], + defaultProps: { + children: 'children', + label: 'showLable' + }, + treeSelect : [], + payMoneys : [], + printPaper : true, + refundMoney : 0, + data : {}, - function print() { - CreateOneFormPage(); - LODOP.PRINTA(); - } + }, + created : function() { + let _this = this; + this.orderParam = /*[[${orderParam}]]*/ + var orderId = /*[[${orderId}]]*/ + var orderNo = /*[[${orderNo}]]*/ - function CreateOneFormPage() { - $("#date").text(getNowFormatDate()); + var param = {}; + if(orderId) { + param.id = orderId; + } else { + param.orderNo = orderNo; + } + this.queryOrderDetailData(param); + // 业绩类型 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX', + callback: function (data) { + _this.achieveTypeList = data.rows; + } + }); + }, + methods : { + calRefund() { + let _this = this; + var total = 0; + _this.orderItems.forEach(item => { + if (item.refundPrice && item.refundCount) { + total += parseFloat(item.refundPrice * item.refundCount); + } + }) - LODOP = getLodop(); + _this.totalRefund = total; + }, + queryOrderDetailData(param) { + let _this = this; + AjaxProxy.requst({ + app: _this, + data: param, + contentType: 'application/x-www-form-urlencoded', + url: basePath + '/admin/order/findOrderDetailByIdOrNo', + callback: function (data) { + console.log(data); + var mapInfo = data.mapInfo; + _this.vipInfo = mapInfo.vipInfo; + _this.order = mapInfo.order; + _this.orderItems = mapInfo.orderItems; + _this.payMethodItems = mapInfo.payMethods; + _this.achieveItems = mapInfo.achieveList; - LODOP.PRINT_INIT(""); - LODOP.SET_PRINT_STYLE("FontSize", 18); - LODOP.SET_PRINT_PAGESIZE(0, 1300, 1945, ""); - strCenterStyle = "<style/>table {width:100%}</style>"; - LODOP.ADD_PRINT_HTM(5, "9%", "82%", 600, strCenterStyle - + document.getElementById("print").innerHTML); - LODOP.SET_PRINT_STYLE("Bold", 1); - /* LODOP.ADD_PRINT_HTM(30,30,650,600,document.getElementById("print").innerHTML); */ + _this.flowItems = _this.order.flows; - }; + _this.checkAchieveIsDel(_this.achieveItems); + _this.order.orderTime = moment(_this.order.orderTime).format("YYYY-MM-DD HH:mm"); - //获取当前时间 - function getNowFormatDate() { - var date = new Date(); - var seperator1 = "-"; - var seperator2 = ":"; - var month = date.getMonth() + 1; - var strDate = date.getDate(); - if (month >= 1 && month <= 9) { - month = "0" + month; + var arrears = 0; + var refund = 0; + var repay = 0; + for(var i = 0; i < _this.flowItems.length; i++) { + var item = _this.flowItems[i]; + if (item.payMethod === '欠款') { + arrears += item.amount; + } + + if (item.flowType === '还款') { + repay += item.amount; + } + + if (item.flowType === '退款') { + refund += item.amount; + } + } + _this.order.arrears = arrears; + _this.order.refund = refund; + _this.order.repay = repay; + + //获取用户列表 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/all', + callback: function (data) { + _this.userList = data.rows; + } + }); + _this.getVipMoneyCards(); + } + }); + }, + confirmSubmit() { + let _this = this; + _this.data.oldOrderId = _this.order.id; + _this.data.vipId = _this.vipInfo.id; + + if(!_this.payMethodFlow()) { + return; + } + + let orderItems = _this.orderItems; + let dataItems = []; + for(var i = 0; i < orderItems.length; i++) { + let item = orderItems[i]; + if (item.refundPrice && item.refundCount) { + let achieveList = [] + if (_this.isReturnAchieve) { + for(var j = 0; j < _this.achieveItems.length; j++) { + let achieveItem = _this.achieveItems[j]; + if (achieveItem.returnAchieve || achieveItem.returnCommission) { + achieveItem.t1 = achieveItem.returnAchieve ? achieveItem.returnAchieve : 0; + achieveItem.projPercentage = achieveItem.returnCommission ? achieveItem.returnCommission : 0; + achieveList.push(achieveItem); + } + } + + item.achaeveList = achieveList; + } + if (item.returnStore) { + item.isReturnStore = 'Y'; + } else { + item.isReturnStore = 'N'; + } + + item.preCount = item.count; + item.count = item.refundCount; + item.zkPrice = item.refundPrice; + item.cashPay = 0; + item.cardPay = 0; + item.oldItemId = item.id; + dataItems.push(item); + } + } + + _this.data.items = dataItems; + _this.data.zkTotal = _this.refundMoney; + _this.data.total = _this.total; + + + AjaxProxy.requst({ + app: _this, + data: _this.data, + contentType: 'application/json', + url: basePath + '/admin/order/refundOrder', + callback: function (data) { + _this.isRefund = false; + _this.dialogSettleVisible = false; + var param = {}; + param.id = _this.data.oldOrderId; + _this.queryOrderDetailData(param); + } + }); + + }, + payMethodFlow() { + let _this = this; + if (_this.payMoneys.length > 0) { + let flows = [] + var total = 0; + _this.payMoneys.forEach(item => { + let flow = {}; + flow.payMethod = item.type; + if (!item.money) { + this.$message.warning("请输入" + item.type + "的付款金额"); + return false; + } + flow.amount = parseFloat(item.money); + if (item.type == '储值卡'){ + flow.isGift = item.isGift; + flow.cardId = item.id; + } + total += parseFloat(item.money); + flows.push(flow) + }) + if (total != _this.refundMoney) { + this.$message.warning("输入付款总金额与应付金额不符"); + return false; + } + + if(_this.order.zkTotal - _this.order.refund - _this.order.arrears < total) { + this.$message.warning("退款金额不能超过收款金额"); + return false; + } + _this.data.flows = flows; + return true; + } else { + this.$message.warning("请选择支付方式"); + return false; + } + }, + openPayMoneyDialog() { + let _this = this; + let items = this.orderItems; + _this.refundMoney = 0; + _this.total = 0; + + for(var i = 0; i < items.length; i++) { + let item = items[i] + if (item.refundPrice && item.refundCount) { + if (!item.refundPrice > 0 && !item.refundCount > 0) { + _this.$message.error("退款金额或退款数量须大于0"); + return; + } + + if (item.refundCount > item.count) { + _this.$message.error("输入正确的退款数量"); + return; + } + + _this.refundMoney += parseFloat(item.refundPrice * item.refundCount); + //记录一下未优惠之前的价格 + _this.total += parseFloat(item.price * item.refundCount); + } + } + + if (_this.refundMoney == 0) { + _this.$message.error("请输入退款金额或退款数量"); + return; + } + _this.dialogSettleVisible = true; + }, + calOrderTotalFormatter(row, column) { + return (row.count * row.zkPrice).toFixed(2); + }, + getVipMoneyCards() { + let _this = this; + if (_this.order.vipId) { + AjaxProxy.requst({ + app: _this, + data: {vipId: _this.order.vipId}, + contentType: 'application/x-www-form-urlencoded', + url: basePath + '/admin/moneyCardUse/getUseMoneyCard', + callback: function (data) { + if (data.rows.length > 0) { + data.rows.forEach(function (item, index, input) { + item.showLable = item.cardName + "-余额:" + (item.realMoney) + item.uuid = MTools.uuid(); + if (item.giftMoney != 0) { + var children = []; + var gift = {}; + gift.id = item.id; + gift.giftMoney = item.giftMoney; + gift.showLable = item.cardName + '-赠送金额' + item.giftMoney; + gift.cardName = item.cardName; + gift.isGift = 1; + gift.uuid = MTools.uuid(); + children.push(gift); + item.children = children; + } + }); + _this.moneyCards = data.rows; + } + } + }); + } + }, + payMethodSelect(item, index) { + let _this = this; + let payMoneys = _this.payMoneys; + if (item.type != '储值卡') { + this.$nextTick(function () { + if (item.isActive) { + Vue.set(item,'isActive',false); + var index = -1; + for (var i = 0; i < payMoneys.length; i++) { + let payMoney = payMoneys[i]; + if (payMoney.value == item.value) { + index = i; + break; + } + } + + if (index > -1) { + _this.payMoneys.splice(index, 1) + } + } else { + Vue.set(item,'isActive',true); + var hasAmount = 0; + for(var i = 0; i < payMoneys.length; i++) { + hasAmount += parseFloat(payMoneys[i].money); + } + if (_this.refundMoney - hasAmount > 0) { + Vue.set(item, 'money', _this.refundMoney - hasAmount); + } + _this.payMoneys.push(item); + } + }); + } + }, + popoverHide(item) { + if(this.treeSelect.length <= 0) { + Vue.set(item, 'isActive', false) + } else { + Vue.set(item, 'isActive', true) + } + }, + handleCheckChange(clickNode, checked) { + let _this = this; + + let nodes = checked.checkedNodes; + _this.treeSelect = nodes; + var index = -1; + // 判断点击节点是否在已展示支付方式中 + for(var i = 0; i < _this.payMoneys.length; i++) { + let node = _this.payMoneys[i]; + if (node.uuid === clickNode.uuid) { + index = i; + break; + } + } + + // 若点击节点在选中节点中,且已展示支付方式不存在,则添加 + if (nodes.indexOf(clickNode) > -1 && index === -1) { + var node = clickNode; + var item = {}; + if (node.isGift) { + item.value = node.cardName; + item.balance = node.giftMoney; + item.isGift = 'Y'; + } else { + item.value = node.cardName; + item.balance = node.realMoney; + item.isGift = 'N'; + } + item.type = '储值卡'; + item.id = node.id; + item.uuid = clickNode.uuid; + _this.payMoneys.push(item); + } + + // 若点击节点不存在选中节点中,且已展示支付方式中存在,则移除 + if (nodes.indexOf(clickNode) === -1 && index > -1) { + _this.payMoneys.splice(index, 1); + } + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + saveAchieve() { + let _this = this; + if(_this.checkAchieveMoney()){ + AjaxProxy.requst({ + app: _this, + data: _this.achieveItems, + contentType: 'application/json', + url: basePath + '/admin/achieve/add', + callback: function (data) { + _this.$message.success(data.info); + } + }); + } + + }, + + shareAchieve(index, row) { + var row2 = JSON.parse(JSON.stringify(row)); + row2.id = null; + row2.isShare = true; + this.achieveItems.splice(index+1,0,row2); + this.calculationAchieve(); + }, + //业绩均分订单金额 + calculationAchieve(){ + console.log("计算业绩"); + let jsqMap={}; + this.achieveItems.forEach(achieve=>{ + key=achieve.achieveType+achieve.orderItemId; + if(!jsqMap[key]){ + jsqMap[key]=1; + }else{ + jsqMap[key]++; + } + }); + this.achieveItems.forEach(achieve=>{ + key=achieve.achieveType+achieve.orderItemId; + achieve.goodsCash=(achieve.zkTotal/jsqMap[key]).toFixed(2); + }); + }, + //校验业绩是否大于订单收款金额 + checkAchieveMoney(){ + console.log("校验业绩是否大于订单收款金额"); + let jsqMap={}; + let isOk=true; + for(let i=0 ; i< this.achieveItems.length; i++){ + let achieve=this.achieveItems[i]; + if(!isNaN(achieve.goodsCash) ){ + key=achieve.achieveType+achieve.orderItemId; + if(!jsqMap[key]){ + jsqMap[key]=parseFloat(achieve.goodsCash); + }else{ + jsqMap[key]=jsqMap[key]+parseFloat(achieve.goodsCash); + } + if(jsqMap[key]>achieve.zkTotal) { + this.$message.error("【"+achieve.goodsName + "】业绩分配金额大于支付金额"); + isOk = false; + break; + } + }else{ + this.$message.error("【"+achieve.goodsName + "】业绩分配金额请填写数字"); + isOk=false; + break; + } + } + console.log("isOk",isOk); + return isOk; + }, + //删除业绩 + delAchieve(index, row) { + let _this = this; + _this.achieveItems.splice(index, 1); + this.calculationAchieve(); + }, + checkAchieveIsDel(items) { + var achieveIds = []; + for(var i = 0; i < items.length; i++) { + var item = items[i]; + if(achieveIds.indexOf(item.orderItemId) === -1) { + achieveIds.push(item.orderItemId); + item.isShare = false; + } else { + item.isShare = true; + } + + item.t1 = item.consume + item.cardCash; + } + }, + printf() { + var id = this.order.id; + layer.open({ + type: 2, + title: "打印订单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/order/printOrder?id=' + id] + }); + }, + handleClick() { + + }, + toBack() { + MTools.closeForm(); + }, } - if (strDate >= 0 && strDate <= 9) { - strDate = "0" + strDate; - } - var currentdate = date.getFullYear() + seperator1 + month + seperator1 - + strDate + " " + date.getHours() + seperator2 - + date.getMinutes() + seperator2 + date.getSeconds(); - return currentdate; - } + }); + //]]> </script> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html index 72e8f44..c1f81ad 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html @@ -38,10 +38,7 @@ <input autocomplete="off" name="closureTime" type="text" class="form-control datetimepicker" id="endTime"> </div> - <div class="form-group mr-20"> - <label >超时时长 > </label> - <input autocomplete="off" name="isOverTime" type="text" class="form-control" placeholder="单位分钟" id="isOverTime"> - </div> + <div class="form-group mr-20"> <label >所属门店</label> <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" @@ -54,7 +51,7 @@ <select class="form-control" name="state" id="state"> <option value="">-- 请选择服务状态 --</option> <option value="待预约">待预约</option> - <option value="预约成功待处理">预约成功待处理</option> +<!-- <option value="预约成功待处理">预约成功待处理</option>--> <option value="预约失败">预约失败</option> <option value="预约取消">预约取消</option> <option value="需配料">需配料</option> @@ -79,6 +76,7 @@ <div id="option-bar"> <button matrix:btn="mdfwd-exportExcel" onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> <button class="btn btn-info btn-sm" onClick="openEdit2()" title=""><i class="fa fa-lg fa-eye"></i> 查看详情</button> + <button matrix:btn="mdfwd-del" onClick="removeOrder()" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash" ></i> 删除</button> </div> <!-- 数据表格部分 --> <table id="mgrid"> @@ -135,6 +133,24 @@ }); }); + function removeOrder(id) { + var id=myGrid.getSelectItemId(); + layer.confirm('确定取消此订单?', { + btn: ['确认', '取消'] //可以无限个按钮 + }, function(index, layero){ + $.post(basePath+'/admin/projService/erpCancelOrder?id='+id, {}, function(data){ + parent.layer.msg(data.info,{icon: 1}); + layer.closeAll(); + myGrid.serchData(); + }); + //按钮【按钮一】的回调 + }, function(index){ + // alert("2 = "+index); + //按钮【按钮二】的回调 + }); + + } + /** 超时 **/ diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/serviceOrderDetail.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/serviceOrderDetail.html index 3114f12..82b63d7 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/serviceOrderDetail.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/serviceOrderDetail.html @@ -10,318 +10,203 @@ <meta http-equiv="Cache-Control" content="no-siteapp"/> <LINK rel="Bookmark" href="../images/favicon.ico"> <!-- 本框架基本脚本和样式 --> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <script type="text/javascript" th:src="@{/js/function/meiduCommon.js}"></script> </head> +<style> + .ibox-content { + background-color: rgba(240, 242, 245, 1); + } + + .order-info p { + line-height: 30px; + } +</style> <body> -<div class="ibox-content"> - - <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="panel panel-default"> - <div class="panel-heading"><strong th:text="'服务单金额:'+${obj.money}"></strong></div> - <table class="table table-bordered table-striped " - style="width: 100%;" id="mgrid"> - <thead> - <tr> - <th>项目名称</th> - <th width="50px">服务时长</th> - <th>服务时间</th> - <th width="300px">美疗师</th> - <th width="100px">提成</th> - </tr> - </thead> - <tbody> - <tr th:each="item,st:${obj.serviceItems}"> - <th th:text="${item.projInfo?.name}"></th> - <th th:text="${item.projInfo?.timeLength+'分钟'}"></th> - <th> - <span th:text="${#dates.format(item.beginTime, 'yyyy-MM-dd HH:mm')}"></span> - —— - <span th:text="${#dates.format(item.endTime, 'yyyy-MM-dd HH:mm')}"></span> - </th> - <th th:text="${item.beautiStaffInfo?.suName}"></th> - <th th:text="${item.extract}"></th> - </tr> - </tbody> - </table> - </div> - <div style="border-radius:5px; background:#F5F5F5;padding:10px 0;"> - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">会员姓名</label> - <div class="col-sm-2 "> - <p class="form-control-static" th:text="${obj?.vipInfo.vipName }"></p> - </div> - <div class="col-sm-5 "> - <label class="col-sm-3 control-label">会员编号</label> - <div class="col-sm-9"> - <p class="form-control-static" th:text="${obj?.vipInfo.vipNo }"></p> - </div> - </div> - <div class="col-sm-4 "> - <label class="col-sm-5 control-label">会员手机 </label> - <div class="col-sm-7"> - <p class="form-control-static" th:text="${obj?.vipInfo.phone }"></p> - </div> - </div> - </div> - </div> - </div> - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">床位安排</label> - <div class="col-sm-2 "> - <p th:each="item:${cw}" th:if="${obj.bedId eq item.id }" class="form-control-static" - th:text="${item.bedName }"></p> - </div> - <div class="col-sm-5 "> - <label class="col-sm-3 control-label">服务时间</label> - <div class="col-sm-9"> - <p class="form-control-static"> - <span th:text="${#dates.format(obj.bedState?.startTime, 'yyyy-MM-dd HH:mm')}"></span> - —— - <span th:text="${#dates.format(obj.bedState?.endTime, 'yyyy-MM-dd HH:mm')}"></span> - </p> - </div> - </div> - </div> - </div> - </div> - - - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">预约时间 </label> - <div class="col-sm-2"> - <p class="form-control-static"> - <span th:text="${#dates.format(obj.yyTime, 'yyyy-MM-dd HH:mm')}"></span> - </p> - </div> - <div class="col-sm-5 "> - <label class="col-sm-3 control-label">配料师</label> - <div class="col-sm-10" th:each="item:${yls}" th:if="${obj.doctorId eq item.id }"> - <p class="form-control-static" th:text="${item.staffName }"></p> - </div> - </div> - <div class="col-sm-4 "> - <label class="col-sm-5 control-label">备注 </label> - <div class="col-sm-7"> - <p class="form-control-static" th:text="${obj?.remark }"></p> - </div> - </div> - </div> - </div> - </div> - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">备注 </label> - <div class="col-sm-10"> - <p class="form-control-static" th:text="${obj?.remark }"></p> - </div> - - </div> - </div> - </div> - </div> - - <div class="form-group "> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="myPreview2()" class="btn btn-success radius">预览</a> - <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> - <button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">关闭</button> - </div> - </div> +<div class="ibox-content" id="app"> + <el-container> + <el-header style="height: 210px; background-color: white; margin: 15px;"> + <el-row style="line-height: 60px; padding-top: 20px;"> + <el-col :span="1" style="font-size: 40px; color:#409EFF;"> + <i class="el-icon-s-order" type="primary"></i> + </el-col> + <el-col :span="10"> + <h1 style="line-height: 60px; margin: 0 0;">服务单号:{{serviceOrderInfo.serviceNo}}</h1> + </el-col> + <el-col :span="5" style="float: right; margin-right: 10px;"> + <el-button type="info" @click="printf">打印</el-button> + <!-- <el-button type="primary">划扣</el-button>--> + <el-button type="danger" @click="toBack">返回</el-button> + </el-col> + </el-row> + <el-row class="order-info" type="flex" justify="space-around" style="height: 150px; padding: 30px 30px;"> + <el-col :span="5"> + <p>会员姓名:{{serviceOrderInfo.vipInfo.vipName}}</p> + <p>会员电话:{{serviceOrderInfo.vipInfo.phone}}</p> + </el-col> + <el-col :span="5"> + <p>会员编号:{{serviceOrderInfo.vipInfo.vipNo}}</p> + <p>床位安排:{{bedFormat()}}</p> + </el-col> + <el-col :span="6"> + <p>服务时间:<span v-if="serviceOrderInfo.bedState != null">{{dateFormat(serviceOrderInfo.bedState.startTime)}} - {{dateFormat(serviceOrderInfo.bedState.endTime)}}</span></p> + <p>预约时间:{{dateFormat(serviceOrderInfo.yyTime)}}</p> + </el-col> + <el-col :span="3"> + <p>配料师:{{pylFormat()}}</p> + <p>备注:{{serviceOrderInfo.remark}}</p> + </el-col> + </el-row> + </el-header> + <el-main style="background-color: white; margin: 15px; padding: 20px 30px;"> + <el-tabs v-model="tabName" @tab-click="handleClick"> + <el-tab-pane label="服务单" name="serviceOrder"> + <el-table :data="tableData" + style="width: 100%"> + <el-table-column + prop="projInfo.name" + label="商品名称" + width="400"> + </el-table-column> + <el-table-column + prop="projUse.source" + label="来源" + width="400"> + </el-table-column> + <el-table-column + :formatter="hkPrice" + label="划扣金额" + width="100"> + </el-table-column> + <el-table-column + prop="count" + label="次数" + width="100"> + </el-table-column> + <el-table-column + prop="projInfo.timeLength" + label="服务时长" + width="200"> + </el-table-column> + <el-table-column + label="服务时间" :formatter="serviceTime"> + </el-table-column> + <el-table-column + prop="beautiStaffInfo.suName" + label="美疗师" + width="200"> + </el-table-column> + <el-table-column + prop="extract" + label="提成" + width="200"> + </el-table-column> + </el-table> + </el-tab-pane> + </el-tabs> + </el-main> + </el-container> </div> -</form> -</div> -<form id="print" style="display: none;"> - <!-- <form id="print"> --> - <style midia="print"> - - .table1 { - width: 440px; - font-size: 12px; - border-top: 1px solid #333; - margin-top: 20px; - } - - .table4 { - width: 440px; - font-size: 12px; - border-top: 1px solid #333; - margin-top: 20px; - } - - .table2 { - font-size: 12px; - border-top: 1px solid #333; - } - - .table1 td { - height: 20px; - } - - .table2 td { - height: 20px; - } - - .table1 tr { - height: 30px; - } - - .table3 { - position: absolute; - font-size: 12px; - border-top: 1px solid #333; - bottom: 30px; - } - - .tittl { - text-align: center; - font-size: 20px; - } - - .line { - border-bottom: 1px solid #333; - } - - </style> - - <h1 class="tittl">HIVE消耗单</h1> - <table class="table1"> - - <tr> - <td>会员姓名:[[${obj.vipInfo.vipName }]]</td> - <td>联系电话:[[${obj.vipInfo.phone }]]</td> - <td>打印日期:<span id="date"></span></td> - </tr> - <tr> - <td>会员编号:[[${obj.vipInfo.vipNo}]]</td> - <td>健康顾问:[[${obj.vipInfo.staffName}]]</td> - <td>流水号:[[${obj.serviceNo}]]</td> - </tr> - <tr> - </tr> - </table> - <table class="table2 table4 "> - <tr class="line"> - <td>消费项目</td> - <td>数量</td> - <td>金额</td> - <td>余次</td> - <td>技师</td> - </tr> - - <th:block th:each="item:${obj.serviceItems }"> - - <tr> - <td th:text="${item.projInfo?.name }"></td> - <td th:text="${item.count}"></td> - <td th:text="${item.projUse.price }"></td> - <td th:if="${item.projUse.taocanId eq null }">0</td> - <td th:if="${item.projUse.taocanId ne null }" th:text="${item.projUse.surplusCount }"></td> - <td th:text="${item.beautiStaffInfo?.suName }"></td> - </tr> - - </th:block> - - - </table> - <table class="table1 table3"> - <tr> - <td>累计积分: - <th:block th:text="${obj?.vipInfo.pointAll }"></th:block> - </td> - <td>本次划扣: - <th:block th:text="${obj?.money }"></th:block> - </td> - <td>收银人: - <th:block th:text="${user?.name }"></th:block> - </td> - </tr> - <tr> - <td>客户签名:</td> - <td></td> - <td></td> - </tr> - </table> -</form> <script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> -<script type="text/javascript"> +<script type="text/javascript" th:inline="javascript"> + //<![CDATA[ + var app = new Vue({ + el : "#app", + data : { + serviceOrderInfo : "", + tabName : "serviceOrder", + tableData : [], + bedList : [], + plsList : [] + }, + created :function () { + this.bedList = /*[[${cw}]]*/ + this.serviceOrderInfo = /*[[${obj}]]*/ + this.tableData = this.serviceOrderInfo.serviceItems; + this.plsList = /*[[${yls}]]*/ + console.log(this.plsList); + }, + methods : { + handleClick() {}, + dateFormat(time) { + return moment(time).format("YYYY-MM-DD HH:mm"); + }, + bedFormat() { + if (this.bedList.length < 0) { + return "-"; + } - var LODOP; + var beds = this.bedList; + var bedId = this.serviceOrderInfo.bedId; + if (!bedId) { + return "-"; + } + + for(var i = 0; i < beds.length; i++) { + if (beds[i].id == bedId) { + return beds[i].bedName; + } + } + }, + pylFormat() { + if (!this.plsList) { + return; + } + + var plsList = this.plsList; + var doctorId = this.serviceOrderInfo.doctorId; + + for(var i = 0; i < plsList.length; i++) { + if (plsList[i].id = doctorId) { + return plsList[i].staffName; + } + } + }, + printf() { + var id = this.serviceOrderInfo.id; + layer.open({ + type: 2, + title: "打印服务单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/projService/printOrder?id=' + id] + }); + }, + toBack() { + MTools.closeForm(); + }, + serviceTime(row, column) { + if (!column.bedState) { + return "-"; + } + var startTime = moment(column.bedState.startTime).format("YYYY-MM-DD HH:mm"); + var endTime = moment(column.bedState.endTime).format("YYYY-MM-DD HH:mm"); + return startTime + "-" + endTime; + } + }, + }); + //]]> function print() { - CreateOneFormPage(); - LODOP.PRINTA(); - } - - function myPreview2() { - CreateOneFormPage(); - LODOP.SET_PREVIEW_WINDOW(0, 0, 0, 760, 540, ""); - LODOP.PREVIEW(); - } - - function CreateOneFormPage() { - $("#date").text(getNowFormatDate()); - - LODOP = getLodop(); - - LODOP.PRINT_INIT(""); - LODOP.SET_PRINT_STYLE("FontSize", 18); - LODOP.SET_PRINT_PAGESIZE(0, 2300, 945, ""); - strCenterStyle = "<style/>table {width:100%}</style>"; - LODOP.ADD_PRINT_HTM(5, 5, "RightMargin:0.9cm", "BottomMargin:9mm", strCenterStyle - + document.getElementById("print").innerHTML); - /* LODOP.ADD_PRINT_HTM(5, "6%", "88%", 600, strCenterStyle - + document.getElementById("print").innerHTML); */ - LODOP.SET_PRINT_STYLE("Bold", 1); - /* LODOP.ADD_PRINT_HTM(30,30,650,600,document.getElementById("print").innerHTML); */ - - }; - - function CreateOneFormPage1() { - $("#date").text(getNowFormatDate()); - - LODOP = getLodop(); - LODOP.SET_LICENSES("湖南卓景京信息技术有限公司", "4DCD4C2508498B1DDD6CD498AC0B04F2", - "", ""); - LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_表单一"); - LODOP.SET_PRINT_STYLE("FontSize", 18); - LODOP.SET_PRINT_PAGESIZE(0, 2300, 1945, ""); - strCenterStyle = "<style/>table {width:100%}</style>"; - LODOP.ADD_PRINT_HTM(5, "9%", "82%", 600, strCenterStyle - + document.getElementById("print").innerHTML); - LODOP.SET_PRINT_STYLE("Bold", 1); - /* LODOP.ADD_PRINT_HTM(30,30,650,600,document.getElementById("print").innerHTML); */ - - }; - - //获取当前时间 - function getNowFormatDate() { - var date = new Date(); - var seperator1 = "-"; - var seperator2 = ":"; - var month = date.getMonth() + 1; - var strDate = date.getDate(); - if (month >= 1 && month <= 9) { - month = "0" + month; - } - if (strDate >= 0 && strDate <= 9) { - strDate = "0" + strDate; - } - var currentdate = date.getFullYear() + seperator1 + month + seperator1 - + strDate + " " + date.getHours() + seperator2 - + date.getMinutes() + seperator2 + date.getSeconds(); - return currentdate; + var id = $("#serviceId").val(); + layer.open({ + type: 2, + title: "打印服务单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/projService/printOrder?id=' + id] + }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/sysOrder-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/sysOrder-list.html index 2af8d9b..eb8abf4 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/sysOrder-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/sysOrder-list.html @@ -52,7 +52,7 @@ </select> </div> <div class="form-group mr-20"> - <label>订单日期</label> + <label>付款日期</label> <input autocomplete="off" name="beginTimeVo" type="text" class="form-control datetimepicker" id="beginTime">- <input autocomplete="off" name="endTimeVo" type="text" class="form-control datetimepicker" id="endTime"> </div> @@ -84,6 +84,7 @@ <div id="option-bar"> <button class="btn btn-info btn-sm mr-5" onClick="openLook()" ><i class="fa fa-eye fa-trash-o"></i> 查看详情</button> <button matrix:btn="mddd-exportExcel" onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> + <button matrix:btn="mddd-del" class="btn btn-danger btn-sm mr-5" onClick="cancelOrder()" ><i class="fa fa-trash-o fa-fw"></i> 取消</button> </div> <!-- 数据表格部分 --> @@ -99,6 +100,8 @@ <th data-field="vipPhone">客户手机号</th> <th data-field="orderTime" data-formatter="MGrid.getTime" data-sortable="true">下单时间</th> + <th data-field="payTime" data-formatter="MGrid.getTime" + data-sortable="true">支付时间</th> <th data-field="statu">订单状态</th> <th data-field="total">订单总价</th> <th data-field="zkTotal">折后价</th> @@ -142,7 +145,25 @@ }); }); - + function cancelOrder() { + var id=myGrid.getSelectItemId(); + layer.confirm('确定取消此订单?', { + btn: ['确认', '取消'] //可以无限个按钮 + }, function(index, layero){ + $.post(basePath+'/admin/order/erpCancelOrder?id='+id+'&del=0', {}, function(data){ + if (data.status == '200') { + parent.layer.msg(data.info,{icon: 1}); + } else { + parent.layer.msg(data.info,{icon: 2}); + } + layer.closeAll(); + myGrid.serchData(); + }); + }, + function(index){ + //按钮【按钮二】的回调 + }); + } /** * 跳转消费流水详情页面 diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/achieverule-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/achieverule-list.html new file mode 100644 index 0000000..c82e927 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/achieverule-list.html @@ -0,0 +1,402 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + <title></title> + <style> + .panel-body { + overflow: hidden; + } + + .buttonPanel { + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + } + + .rowPanel { + background: #ffffff; + padding: 0px 10px; + padding-top: 10px; + margin: 0px 0px 10px 0px; + } + + .paginationStyle { + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> +<body> +<div class="panel-body" id="app"> + + <el-row class="buttonPanel"> + <el-button @click="openForm('add')" type="primary">新增</el-button> + </el-row> + + <el-row class="rowPanel"> + <el-form ref="form" :model="form" inline> + <el-form-item label="规则名称" prop="queryKey"> + <el-input v-model="form.keyword" placeholder="请输入规则名称"></el-input> + </el-form-item> + <el-button type="primary" @click="search">搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style"> + + <el-table id="proj" :data="table.rows" :height="height" stripe @sort-change="sortChange"> + <el-table-column + prop="name" + label="规则名称"> + </el-table-column> + <el-table-column + prop="updateTime" + sortable="custom" + label="修改时间" + show-overflow-tooltip + width="180"> + </el-table-column> + <el-table-column + prop="updateBy" + label="修改人"> + </el-table-column> + + <el-table-column + prop="createTime" + sortable="custom" + label="创建时间" + show-overflow-tooltip + width="180"> + </el-table-column> + <el-table-column + prop="createBy" + label="创建人" + width="180"> + </el-table-column> + + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="text" @click="openForm('modify', scope.row)" size="small">修改</el-button> + <el-button type="text" @click="remove(scope.$index, scope.row)" size="small">删除</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle"> + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="table.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="table.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="table.total"> + </el-pagination> + </el-row> + + <el-dialog + :title="title" + :visible.sync="dialogVisible" + width="60%" + :before-close="handleClose"> + + <el-form :model="formData" ref="ruleForm" label-width="100px" class="demo-ruleForm"> + + <el-form-item label="规则名称" > + <el-input style="width: 200px" v-model="formData.name"></el-input> + <el-button type="primary" @click="addRuleItem()" size="small">添加规则</el-button> + </el-form-item> + + <el-form-item label="绩效方案" > + <el-table + :data="formData.ruleItemList" + style="width: 100%"> + <el-table-column + label="业绩类型" + > + <template slot-scope="scope"> + <el-select v-model="scope.row.achieveType" placeholder="请选择业绩类型"> + <el-option label="本金消耗" :value="1"></el-option> + <el-option label="赠送消耗" :value="2"></el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + label="计算方式" + > + <template slot-scope="scope"> + <el-select v-model="scope.row.calculationType" placeholder="请选择计算方式"> + <el-option label="固定金额" :value="1"></el-option> + <el-option label="百分比(%)" :value="2"></el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + label="区间" + width="240"> + <template slot-scope="scope"> + <el-input style="width: 100px" v-model="scope.row.lower"></el-input> + - + <el-input style="width: 100px" v-model="scope.row.upper"></el-input> + </template> + </el-table-column> + <el-table-column + label="业绩"> + <template slot-scope="scope"> + <el-input v-model="scope.row.achieve"></el-input> + </template> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="text" @click="removeRuleItem(scope.$index, scope.row)" size="small">删除</el-button> + </template> + </el-table-column> + </el-table> + </el-form-item> + + + + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="dialogVisible = false">取 消</el-button> + <el-button type="primary" @click="submitForm">确 定</el-button> + </span> +</el-dialog> + + +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript" th:inline="javascript"> + + var vue = new Vue({ + el: '#app', + data: { + table: { + rows: [], + total: 0, + pageSize: 10, + currentPage: 1, + }, + form: { + queryKey: null, + }, + + height: 'calc(100vh - 240px)', + dialogVisible: false, + title: '', + formData: { + name: '', + ruleItemList: [ + { + achieveType: 1, + calculationType: 1, + lower: '', + upper: '', + achieve: '', + } + ] + }, + + type: '', + + }, + created: function () { + this.loadData(); + window.addEventListener("keydown", this.keydown); + }, + methods: { + changePageSize(val) { + this.table.pageSize = val; + this.loadData(); + }, + changeCurrentPage(val) { + this.table.currentPage = val; + this.loadData(); + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + }, + sortChange: function (column) { + if (column.order) { + if (column.order.indexOf("desc")) { + this.form.order = "desc"; + } else { + this.form.order = "asc"; + } + this.form.sort = column.prop; + this.loadData(); + } + }, + loadData: function () { + let _this = this; + let data = _this.getRequestParam(); + data.pageSize = _this.table.pageSize; + data.pageNum = _this.table.currentPage; + AjaxProxy.requst({ + app: _this, + data: data, + url: basePath + '/admin/achieveRule/selectList', + callback: function (data) { + _this.table.rows = data.rows; + _this.table.total = data.total; + } + }); + }, + getRequestParam() { + let _this = this; + return { + queryKey: _this.form.queryKey, + } + }, + search: function () { + this.table.currentPage = 1; + this.loadData(); + }, + keydown(evt) { + if (evt.keyCode == 13) { + this.search(); + } + }, + + remove(index, row) { + let _this = this; + this.$confirm('确认删除该规则吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + AjaxProxy.requst({ + app: _this, + type: 'GET', + url: basePath + "/admin/achieveRule/removeById/" + row.id, + callback: function (data) { + _this.loadData(); + _this.$message({ + type: 'success', + message: data.info, + }); + } + }); + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); + }, + //开启表单弹窗 + openForm(type, data) { + + if (type == 'add') { + this.title = '新增规则'; + //this.$refs['formName'].resetFields(); + + } else { + this.title = '修改规则'; + this.formData = data; + } + this.type = type; + this.dialogVisible = true; + }, + //提交表单 + submitForm() { + let url = basePath + "/admin/achieveRule/add"; + if (this.type == 'modify') { + url = basePath + "/admin/achieveRule/update"; + } + let data=this.formData; + + if(MTools.isBlank(data.name)){this.$message.error("请输入规则名称");return;} + + if(data.ruleItemList.length<1){ + this.$message.error("最少需要一个计算规则");;return;} + let flag=true; + data.ruleItemList.forEach(item=>{ + if(MTools.isBlank(item.lower)){ + this.$message.error("请输入业绩下限");flag=false;} + else if(MTools.isBlank(item.upper)){ + this.$message.error("请输入业绩上限");flag=false;} + else if(MTools.isBlank(item.achieve)){ + this.$message.error("请输入业绩金额或者比例");flag=false;} + }) + if(flag){ + var _this=this; + AjaxProxy.requst({ + app: _this, + data:data, + url:url, + callback: function (data) { + _this.$message.success(data.info); + _this.loadData(); + _this.dialogVisible = false; + _this.formData={ + name: '', + ruleItemList: [ + { + achieveType: 1, + calculationType: 1, + lower: '', + upper: '', + achieve: '', + } + ] + }; + } + }); + + } + }, + handleClose(done) { + this.$confirm('确认关闭?') + .then(_ => { + done(); + }) + .catch(_ => { + }); + }, + addRuleItem(){ + this.formData.ruleItemList.push( + { + achieveType: 1, + calculationType: 1, + lower: '', + upper: '', + achieve: '', + } + ); + }, + removeRuleItem(index,row){ + this.formData.ruleItemList.splice(index, 1); + }, + + + } + + }); + + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html index d5ee48e..15facb0 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html @@ -107,18 +107,18 @@ <tr> <th data-checkbox="true"></th> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> - <th data-field="code">商品编号</th> - <th data-field="name">商品名称</th> - <th data-field="sealPice">售价/(本金)</th> + <th data-field="code" data-sortable="true">商品编号</th> + <th data-field="name" data-sortable="true">商品名称</th> + <th data-field="sealPice" data-sortable="true">售价/(本金)</th> <th data-field="referencePice">参考价/(赠送金额)</th> - <th data-field="realSealCount">真实销量</th> - <th data-field="staus">状态</th> - <th data-field="isPresent">是否赠送</th> - <th data-field="goodType">类型</th> + <th data-field="realSealCount" data-sortable="true">真实销量</th> + <th data-field="staus" data-sortable="true">状态</th> + <th data-field="isPresent" data-sortable="true">是否赠送</th> + <th data-field="goodType" data-sortable="true" >类型</th> <th data-field="cateName">分类</th> <th data-field="isCourse" data-formatter="getCourse">套餐卡</th> - <th data-field="shopName">所属门店</th> - <th data-field="createTime" data-formatter="MGrid.getTime">创建时间</th> + <th data-field="shopName" >所属门店</th> + <th data-field="createTime" data-sortable="true" data-formatter="MGrid.getTime">创建时间</th> </tr> </thead> </table> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/score/score-setting.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/score/score-setting.html new file mode 100644 index 0000000..da44764 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/score/score-setting.html @@ -0,0 +1,339 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> +</head> + +<body> +<div class="ibox-content" id="app" v-cloak> + <el-form label-width="120px" > + <el-row> + <p class="el-big-title">积分统计</p> + </el-row> + <el-row> + <el-row> + <el-col :span="18"> + <el-form-item> + <el-col class="line" :span="6" style="text-align: center">积分总额</el-col> + <el-col class="line" :span="6" style="text-align: center">可使用积分</el-col> + <el-col class="line" :span="6" style="text-align: center">已消耗积分</el-col> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="18"> + <el-form-item> + <el-col class="line" :span="6" style="text-align: center">0</el-col> + <el-col class="line" :span="6" style="text-align: center">0</el-col> + <el-col class="line" :span="6" style="text-align: center">0</el-col> + </el-form-item> + </el-col> + </el-row> + </el-row> + <el-row> + <p class="el-big-title">积分规则</p> + </el-row> + <el-row> + <el-col :span="10"> + <template v-for="paramSettingOnes in jfyxq"> + <el-form-item label-width="200px;"> + <span slot="label">{{paramSettingOnes.paramName}}</span> + <el-col :span="8"> + <el-select v-model="paramSettingOnes.paramValue" placeholder="请选择"> + <el-option label="本年后" value="1"></el-option> + <el-option label="1年后" value="2"></el-option> + <el-option label="2年后" value="3"></el-option> + <el-option label="3年后" value="4"></el-option> + <el-option label="4年后" value="5"></el-option> + <el-option label="5年后" value="6"></el-option> + </el-select> + </el-col> + <el-col :span="2" style="margin-left: 10px;display: flex;align-items: center;height: 40px"> + <el-tooltip class="item" effect="dark" content="设置为“1年后”,表示在今年获得的用户积分将在明年的12月31号23:59:59失效,以此类推" placement="top"> + <i class="el-icon-question" style="font-size: 18px;color:#999999" ></i> + </el-tooltip> + </el-col> + </el-form-item > + </template> + </el-col> + <el-col :span="14"> + <template v-for="paramSettingTwos in jfdxj"> + <el-form-item> + <span slot="label">{{paramSettingTwos.paramName}}</span> + <el-col :span="1"> + <el-switch v-model="paramSettingTwos.paramSwitch" active-color="#13ce66" inactive-color="#ccc" @change="change"> + </el-switch> + </el-col> + <el-col :span="2" style="margin-left: 10px;display: flex;align-items: center;height: 40px"> + <el-tooltip class="item" effect="dark" content="客户付款时,可以选择积分抵现付款" placement="top"> + <i class="el-icon-question" style="font-size: 18px;color:#999999" ></i> + </el-tooltip> + </el-col> + <el-col :span="11"> + <transition> + <div v-show="paramSettingTwos.paramSwitch"> + <el-col :span="6"> + <el-input v-model="paramSettingTwos.paramValue" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-col> + <el-col class="line" :span="5" style="margin-left: 10px">积分=1元</el-col> + </div> + </transition> + </el-col> + </el-form-item> + </template> + </el-col> + </el-row> + <el-row> + <el-tabs v-model="activeName" > + <el-tab-pane label="门店积分规则" name="first"> + <el-row> + <el-col :span="21"> + <el-form-item> + <el-col class="line" :span="7" style="margin-left: 10px">本人积分</el-col> + <el-col class="line" :span="7" style="margin-left: 10px">老带新积分</el-col> + <el-col class="line" :span="7" style="margin-left: 10px">二级老带新积分</el-col> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="21"> + <template v-for="paramSetting in mdjf"> + <el-form-item> + <span slot="label">{{paramSetting.paramName}}</span> + <el-col :span="3"> + <el-input v-model="paramSetting.paramValue" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-col> + <div v-show="paramSetting.paramName === '转介客户'"> + <el-col class="line" :span="4" style="margin-left: 10px">积分/位</el-col> + </div> + <div v-show="paramSetting.paramName !== '转介客户'"> + <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> + </div> + <el-col :span="3"> + <el-input v-model="paramSetting.paramValue1" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-col> + <div v-show="paramSetting.paramName === '转介客户'"> + <el-col class="line" :span="4" style="margin-left: 10px">积分/位</el-col> + </div> + <div v-show="paramSetting.paramName !== '转介客户'"> + <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> + </div> + <div v-show="paramSetting.paramName !== '转介客户'"> + <el-col :span="3"> + <el-input v-model="paramSetting.paramValue2" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-col> + <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> + </div> + </el-form-item> + </template> + </el-col> + </el-row> + </el-tab-pane> + <el-tab-pane label="商城积分规则" name="second"> + <el-row> + <el-col :span="21"> + <el-form-item> + <el-col class="line" :span="7" style="margin-left: 10px">本人积分</el-col> + <el-col class="line" :span="7" style="margin-left: 10px">老带新积分</el-col> + <el-col class="line" :span="7" style="margin-left: 10px">二级老带新积分</el-col> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="21"> + <template v-for="paramSettingShop in scjf"> + <el-form-item> + <span slot="label">{{paramSettingShop.paramName}}</span> + <el-col :span="3"> + <el-input v-model="paramSettingShop.paramValue" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-col> + <div v-show="paramSettingShop.paramName !== '现金消费'"> + <el-col class="line" :span="4" style="margin-left: 10px">积分/次</el-col> + </div> + <div v-show="paramSettingShop.paramName === '现金消费'"> + <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> + </div> + <el-col :span="3"> + <el-input v-model="paramSettingShop.paramValue1" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-col> + <div v-show="paramSettingShop.paramName !== '现金消费'"> + <el-col class="line" :span="4" style="margin-left: 10px">积分/次</el-col> + </div> + <div v-show="paramSettingShop.paramName === '现金消费'"> + <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> + </div> + <el-col :span="3"> + <el-input v-model="paramSettingShop.paramValue2" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> + </el-col> + <div v-show="paramSettingShop.paramName !== '现金消费'"> + <el-col class="line" :span="4" style="margin-left: 10px">积分/次</el-col> + </div> + <div v-show="paramSettingShop.paramName === '现金消费'"> + <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> + </div> + </el-form-item> + </template> + </el-col> + </el-row> + </el-tab-pane> + </el-tabs> + </el-row> + <el-row justify="center" type="flex"> + <el-button matrix:btn="scoreSetting-save" type="primary" @click="submit()">保存</el-button> + </el-row> + </el-form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> + +<script> + var app = new Vue({ + el: '#app', + data: { + activeName: 'first', + jfyxq:[], + jfdxj:[], + mdjf:[], + scjf:[], + }, + created: function () { + this.loadInfo(); + }, + mounted: function () { + }, + methods: { + //加载分类 + loadInfo() { + let _this = this; + _this.loadParamSetting(); + }, + loadParamSetting() { + let _this = this; + //加载配置 + AjaxProxy.requst({ + app: _this, + data: {}, + url: basePath + '/score/ruleSetting/selectScoreRule', + callback: function (data) { + _this.jfyxq = data.mapInfo.jfyxq; + _this.jfdxj = data.mapInfo.jfdxj; + _this.mdjf = data.mapInfo.mdjf; + _this.scjf = data.mapInfo.scjf; + console.log("over"); + } + }); + }, + change(data){ + if(data){ + this.paramSwitch = true; + }else{ + this.paramSwitch = false; + } + }, + + submit() { + console.log("提交"); + let _this = this; + let submitDate = []; + for (let i = 0; i < _this.jfyxq.length; i++) { + let paramSetting = _this.jfyxq[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.scjf.length; i++) { + let paramSetting = _this.scjf[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.mdjf.length; i++) { + let paramSetting = _this.mdjf[i]; + let paramCode = paramSetting.paramCode; + let paramValue = paramSetting.paramValue; + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + for (let i = 0; i < _this.jfdxj.length; i++) { + let paramSetting = _this.jfdxj[i]; + let paramCode = paramSetting.paramCode; + let paramSwitch = paramSetting.paramSwitch; + let paramValue; + if(paramSwitch){ + paramValue = paramSetting.paramValue; + } + let paramValue1 = paramSetting.paramValue1; + let paramValue2 = paramSetting.paramValue2; + + let obj = { + paramCode: paramCode, + paramValue: paramValue, + paramValue1: paramValue1, + paramValue2: paramValue2, + } + submitDate.push(obj); + } + + AjaxProxy.requst({ + app: _this, + data: submitDate, + url: basePath + '/score/ruleSetting/updateScoreRule', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + onClose: function () { + _this.loadParamSetting(); + } + }); + } + }); + } + } + }) +</script> + +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/shop/shopInfo-form.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/shop/shopInfo-form.html index 6f50cb3..8eeeea3 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/shop/shopInfo-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/shop/shopInfo-form.html @@ -13,7 +13,7 @@ th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> - <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=Oego4OzlvPRPNyjCPTctXtuVNsSissOX"></script> + <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=Oego4OzlvPRPNyjCPTctXtuVNsSissOX"></script> </head> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/achieveNewStatiostics.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/achieveNewStatiostics.html new file mode 100644 index 0000000..34ecd48 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/achieveNewStatiostics.html @@ -0,0 +1,366 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + <title></title> + <style> + .panel-body{ + overflow: hidden; + } + .buttonPanel{ + background: #ffffff; + padding: 10px 10px ; + margin: 0px 0px 10px 0px; + } + .rowPanel{ + background: #ffffff; + padding: 0px 10px ; + padding-top: 10px; + margin: 0px 0px 10px 0px; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> +<body> +<div class="panel-body" id="app"> + + <el-row class="buttonPanel"> + <el-button @click="exportExcel" type="primary" >导出</el-button> + </el-row> + + <el-row class="rowPanel" > + <el-form ref="form" :model="form" inline > + + <el-form-item label="业绩规则" > + <el-select v-model="form.achieveRuleId" filterable placeholder="请选择业绩规则"> + <el-option + v-for="item in achieveRulsList" + :key="item.id" + :label="item.name" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + + <el-form-item label="员工姓名" > + <el-input v-model="form.staffName"></el-input> + </el-form-item> + + + <el-form-item label="统计门店" > + <el-select v-model="form.shopId" placeholder="请选择"> + <el-option + v-for="item in shopList" + :key="item.shopShortName" + :label="item.shopShortName" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + + + <el-form-item label="订单类型" > + <el-select v-model="form.orderType" placeholder="请选择"> + <el-option + v-for="item in orderTypeList" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + + <el-form-item label="统计时间" prop="datetimeArr"> + <el-date-picker + v-model="form.datetimeArr" + type="daterange" + range-separator="至" format="yyyy-MM-dd HH:mm" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-form-item> + + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + + <el-table id="proj" :data="table.rows" :height="height" stripe @sort-change="sortChange"> + <el-table-column + sortable="custom" + prop="ruleName" + label="规则名称" + width="180"> + </el-table-column> + <el-table-column + prop="shopName" + label="门店名称" + show-overflow-tooltip + width="240"> + </el-table-column> + <el-table-column + prop="guwen" + label="业绩归属人" + show-overflow-tooltip + width="180"> + </el-table-column> + <el-table-column + prop="createBy" + label="业绩创建人" + show-overflow-tooltip + width="180"> + </el-table-column> + <el-table-column + sortable="custom" + prop="zkTotal" + label="订单金额"> + </el-table-column> + <el-table-column + sortable="custom" + prop="goodsCash" + label="现金"> + </el-table-column> + <el-table-column + sortable="custom" + prop="cardCash" + label="划扣"> + </el-table-column> + <el-table-column + sortable="custom" + prop="hisConsume" + label="本金消耗"> + </el-table-column> + <el-table-column + sortable="custom" + prop="freeConsume" + label="赠送消耗"> + </el-table-column> + <el-table-column + sortable="custom" + prop="projPercentage" + label="服务提成"> + </el-table-column> + <el-table-column + sortable="custom" + prop="numberOfPeople" + label="人头"> + </el-table-column> + + <el-table-column + sortable="custom" + prop="projNum" + label="项目个数"> + </el-table-column> + + <el-table-column + sortable="custom" + prop="projTime" + label="服务时间"> + </el-table-column> + + <el-table-column + sortable="custom" + prop="orderType" + label="订单类型"> + </el-table-column> + + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="table.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="table.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="table.total"> + </el-pagination> + </el-row> + +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript" th:inline="javascript"> + + var vue = new Vue({ + el: '#app', + data: { + table:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + form:{ + achieveRuleId:null, + staffName:null, + shopId:null, + orderType:'', + order:'', + sort:'', + beginTime:'', + endTime:'', + }, + height:'calc(100vh - 240px)', + + //提成规则 + achieveRulsList:[], + //业绩用户列表 + userList: [], + shopList:[{id:0,shopShortName:'全部'}], + + orderTypeList:[ + {value:'',label:'全部'}, + {value:'订单',label:'订单'}, + {value:'服务单',label:'服务单'}, + + ], + }, + created: function () { + let _this=this; + //获取业绩用户列表 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopAll', + callback: function (data) { + _this.userList = data.rows; + } + }); + AjaxProxy.requst({ + app:_this, + url:basePath+"/admin/shopInfo/findAll", + callback:function (data) { + data.rows.forEach(shop=>{ + _this.shopList.push(shop); + }); + } + + }) + this.getAchieveRule(); + this.loadData(); + window.addEventListener("keydown", this.keydown); + }, + methods: { + changePageSize(val) { + this.table.pageSize = val; + this.loadData(); + }, + changeCurrentPage(val) { + this.table.currentPage = val; + this.loadData(); + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + this.form={ + achieveRuleId:null, + staffName:null, + shopId:null, + orderType:'', + order:'', + sort:'', + beginTime:'', + endTime:'', + }; + }, + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadData(); + } + }, + loadData:function(){ + let _this = this; + let data=_this.getRequestParam(); + data.pageSize=_this.table.pageSize; + data.pageNum=_this.table.currentPage; + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/achieve/achieveNewStatistics', + callback: function (data) { + _this.table.rows = data.rows; + _this.table.total=data.total; + } + }); + }, + + /** + * 获取规则 + */ + getAchieveRule(){ + let _this = this; + AjaxProxy.requst({ + app: _this, + data: {pageNum:1,pageSize:1000}, + url: basePath + "/admin/achieveRule/selectList", + callback: function (data) { + _this.achieveRulsList=data.rows; + } + }); + }, + + getRequestParam(){ + let _this = this; + return { + achieveRuleId:_this.form.achieveRuleId, + staffName:_this.form.staffName, + shopId:_this.form.shopId, + orderType:_this.form.orderType, + beginTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'', + endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'', + order:_this.form.order, + sort:_this.form.sort, + } + }, + search:function(){ + this.table.currentPage=1; + this.loadData(); + }, + keydown(evt){ + if(evt.keyCode==13) { + this.search(); + } + }, + + //导出 + exportExcel(){ + window.location.href=basePath+"/admin/achieve/exportAchieveNewStatisticsExcel?"+MTools.jsonToUrlParam(this.getRequestParam()); + } + + } + }); + + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/custom-consume-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/custom-consume-list.html new file mode 100644 index 0000000..bef3210 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/custom-consume-list.html @@ -0,0 +1,155 @@ + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + +</head> +<body class="gray-bg"> + + + <div class="ibox-content"> + <!-- 搜索框部分start --> + <form class="form-inline" id="serchform"> + <div class="form-group mr-20"> + <label>日期范围</label> + <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- + <input name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + </div> + + <div class="form-group mr-20"> + <label>会员</label> + <input autocomplete="off" placeholder="姓名/编号/电话" name="vipName" type="text" class="form-control" > + </div> + + <div class="form-group mr-20"> + <label>美疗师</label> + <select class="form-control autoFull select2" + th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" + data-value="suId" + data-filed="suName" + name="beaultId" + id="beaultId"> + <option value="">--请选择美容师--</option> + </select> + </div> + + <div class="form-group mr-20"> + <label>门店</label> + <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" + th:data-url="@{/admin/shopInfo/findAllWithPermi}"> + <option value=''>--请选择部所属门店--</option> + </select> + </div> + + <div class="row mb-10"> + <div class="col-sm-8"> + <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> + <button type="reset" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> +<!-- <button matrix:btn="ygyjbb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>--> + </div> + </div> + </form> + + + <table id="mgrid"> + <thead> + <tr> + <th data-formatter="MGrid.indexfn" data-align="center" + data-width="30px">序号</th> + <th data-field="vipName" data-formatter="buildVipNameJump">姓名</th> + <th data-field="meiliao">美疗师</th> + <th data-field="arriveCnt">到店次数</th> + <th data-field="goodsCash" data-formatter="countColumn">消费金额</th> + <th data-field="hisConsume" data-formatter="countColumn">消耗本金</th> + <th data-field="freeConsume" data-formatter="countColumn">消耗赠送</th> + + </tr> + </thead> + </table> + </div> + + <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/public.js}"></script> + <script type="text/javascript"> + var myGrid; + var initParam = { + format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss" + minView: "hour", //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour" + } + MTools.ininDatetimepicker(initParam); + //限制结束时间不小于开始时间 + MTools.limitStartEndTime({}); + + $(function() { + MTools.autoFullSelect(); + $(".select2").select2(); + myGrid = MGrid.initGrid({ + url : basePath+"/admin/vipStatistics/vipConsumeStatistics", + showExport : true, + showFooter : false, + height:'auto', + width:'auto', + exportDataType : "basic", //basic', 'all', 'selected'. + exportTypes : [ 'excel', 'xlsx' ], //导出类型 + exportOptions : { + ignoreColumn : [ 0 ], + fileName : "客户消费统计" + MTools.getTime(), //文件名称设置 + worksheetName : 'Sheet1', //表格工作区名称 + tableName : '客户消费统计', + excelstyles : [ 'background-color', 'color', 'font-size', + 'font-weight' ], + } + }); + + $('[data-toggle="tooltip"]').tooltip() + + }); + + function footCountTitle(data) { + return "<b>合计</b>"; + }; + function countColumn(data) { + if (data) { + var resultsumQuantity = parseFloat(data).toFixed(2);//保留有效数字 + return resultsumQuantity; + } else { + return "-"; + } + }; + + function buildVipNameJump(value, row, index) { + return '<a onClick="vipDetail(\'' + row.t9 +'\')" class="text-primary " >'+value+'</a>'; + } + + function vipDetail(value) { + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + area : MUI.SIZE_M, + content : [basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ] + })); + } + + function exportExcel(){ + + var param=MForm.toUrlParam("#serchform"); + + window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param; + } + + </script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html index 43018b0..f7fe57f 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html @@ -2,227 +2,323 @@ <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> <head> -<meta charset="utf-8"> -<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> -<meta name="renderer" content="webkit|ie-comp|ie-stand"> -<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -<meta name="viewport" - content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> -<LINK rel="Bookmark" href="../images/favicon.ico"> -<!-- 本框架基本脚本和样式 --> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> - -</head> -<body class="gray-bg"> - - - <div class="ibox-content"> - <!-- 搜索框部分start --> - <form class="form-inline" id="serchform"> - <div class="row mb-10"> - <div class="col-sm-8"> - <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> - <button onclick="myGrid.resetForm()" type="button" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> - <button matrix:btn="ygyjbbZb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> - </div> - </div> - <div class="form-group mr-20"> - <label >选择年月</label> <select - class="form-control" name="year" id="select_year"> - <option value="">年份</option> - <option value="2010">2010</option> - <option value="2011">2011</option> - <option value="2012">2012</option> - <option value="2013">2013</option> - <option value="2014">2014</option> - <option value="2015">2015</option> - <option value="2016">2016</option> - <option value="2017">2017</option> - <option value="2018">2018</option> - <option value="2019">2019</option> - <option value="2020">2020</option> - <option value="2021">2021</option> - </select> <select class="form-control" name="month" id="select_month"> - <option value="01">1</option> - <option value="02">2</option> - <option value="03">3</option> - <option value="04">4</option> - <option value="05">5</option> - <option value="06">6</option> - <option value="07">7</option> - <option value="08">8</option> - <option value="09">9</option> - <option value="10">10</option> - <option value="11">11</option> - <option value="12">12</option> - </select> - <select class="form-control" name="day" id="select_day"> - <option value="">日</option> - <th:block th:each="i:${#numbers.sequence(1, 31)}" > - <option th:value="${i }" th:text="${i }"></option> - </th:block> - </select> - </div> - <div class="form-group mr-20"> - <label>日期范围</label> - <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- - <input name="endTime" type="text" class="form-control datetimepicker" id="endTime"> - </div> - <div class="form-group mr-20"> - <label >所属门店</label> <select id="select_id" - class="form-control autoFull" - th:data-url="@{/admin/shopInfo/findShops}" data-value="id" - data-filed="shopName" data-def="${obj.shopId}" name="shopId"> - <option value="">--请选择所属门店--</option> - </select> - </div> - </form> - - - <table id="mgrid"> - <thead> - <tr> - <th data-formatter="MGrid.indexfn" data-align="center" - data-width="30px" data-footer-formatter="footCountTitle">序号</th> - <th data-field="datatime" >时间</th> - <th data-field="orderType">订单类型</th> - <th data-field="orderNo" data-formatter="buildOpenDetail" >订单编号</th> - <th data-field="levelName">会员级别</th> - <th data-field="vipName">姓名</th> - <th data-field="proName">项目名称</th> - <th data-field="zkTotal" data-footer-formatter="countColumn">总现金业绩 - <i data-toggle="tooltip" data-placement="top" title="总现金业绩=售卡+项目+产品" class="fa fa-question-circle"></i> - </th> - - <th data-field="cardCash" data-footer-formatter="countColumn" >售卡业绩 - <i data-toggle="tooltip" data-placement="top" title="售卡业绩:现金购买充值卡,套餐,充值的收款金额" class="fa fa-question-circle"></i> - </th> - - <th data-field="projCash" data-footer-formatter="countColumn">项目业绩 - <i data-toggle="tooltip" data-placement="top" title="项目业绩:现金购买单个项目的业绩" class="fa fa-question-circle"></i> - </th> - - <th data-field="goodsCash" data-footer-formatter="countColumn">产品业绩 - <i data-toggle="tooltip" data-placement="top" title="产品业绩:现金购买产品的业绩" class="fa fa-question-circle"></i> - </th> - - <th data-field="consume" data-footer-formatter="countColumn">余额划扣业绩 - <i data-toggle="tooltip" data-placement="top" title="余额划扣业绩:从客户的充值卡余额中划扣消费的金额" class="fa fa-question-circle"></i> - </th> - - <th data-field="hisConsume" data-footer-formatter="countColumn">本金消耗 - <i data-toggle="tooltip" data-placement="top" title="消耗金额:客户做服务时划扣的本金" class="fa fa-question-circle"></i> - </th> - <th data-field="freeConsume" data-footer-formatter="countColumn">赠送消耗 - <i data-toggle="tooltip" data-placement="top" title="赠送消耗:客户做服务时划扣的赠送金额" class="fa fa-question-circle"></i> - </th> - <th data-field="projPercentage" data-footer-formatter="countColumn">服务提成 - <i data-toggle="tooltip" data-placement="top" title="服务提成:为美疗师手动设置的项目服务提成" class="fa fa-question-circle"></i> - </th> - <th data-field="guwen">顾问</th> - <th data-field="meiliao">美疗师</th> - <th data-field="numberOfPeople" data-footer-formatter="countColumn">人头</th> - <th data-field="projNum" data-footer-formatter="countColumn">项目个数</th> - <th data-field="projTime" data-footer-formatter="countColumn">项目时间</th> - <th data-field="shopName">门店</th> - - </tr> - </thead> - </table> - </div> - - <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> <script type="text/javascript" th:src="@{/js/function/public.js}"></script> - <script type="text/javascript"> - var myGrid; - var initParam = { - format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss" - minView: "hour", //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour" - } - MTools.ininDatetimepicker(initParam); - //限制结束时间不小于开始时间 - MTools.limitStartEndTime({}); - - var date = new Date(); - var year = date.getFullYear(); - var month = date.getMonth() + 1; - var year_options = ""; - for (var i = 9; i > 0; i--) { - year_options += "<option value='" + (year - i) + "'>" + (year - i) - + "</option>"; - } - year_options += "<option value='"+year+"' selected='selected'>" + year - + "</option>"; - $("#select_year").html(year_options); - $("#select_month").find("option").each(function(row) { - var option_month = $(this).val(); - if (month == option_month) { - $(this).attr("selected", true); - } - }); +</head> +<style> + .table-style { + margin: 20px 0; + padding: 20px 10px; + border: 1px solid #DCDFE6; + background-color: white; + } + .search-form { + background-color: white; + padding-top: 10px; + padding-left: 20px; + padding-bottom: 10px; + } +</style> +<body> +<div id="app" style=""> + <el-row class="search-form"> + <el-form ref="form" :model="form" inline> + <el-form-item label="选择年月"> + <el-select v-model="form.year" style="width:120px;" placeholder="请选择年份"> + <el-option v-for="item in years" + :key="item" + :label="item" + :value="item"></el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-select v-model="form.month" style="width:120px;" placeholder="请选择月份"> + <el-option v-for="item in months" + :key="item" + :label="item" + :value="item"></el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-select v-model="form.day" style="width:120px;" placeholder="请选择日"> + <el-option v-for="item in days" + :key="item" + :label="item" + :value="item"></el-option> + </el-select> + </el-form-item> + <el-form-item label="日期范围"> + <el-date-picker v-model="form.timeRange" + type="datetimerange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-form-item> + <el-form-item label="业绩规则" prop="achieveRuleId"> + <el-select v-model="form.achieveRuleId" filterable placeholder="请选择业绩规则"> + <el-option + v-for="item in achieveRulsList" + :key="item.id" + :label="item.name" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="会员"> + <el-input v-model="form.vipQueryKey"></el-input> + </el-form-item> - $(function() { - MTools.autoFullSelect(); - myGrid = MGrid.initGrid({ - url : basePath+"/admin/achieve/findDailyInfoNew", - showExport : true, - showFooter : true, - height:'auto', - width:'auto', - exportDataType : "basic", //basic', 'all', 'selected'. - exportTypes : [ 'excel', 'xlsx' ], //导出类型 - exportOptions : { - ignoreColumn : [ 0 ], - fileName : "每日单据统计" + MTools.getTime(), //文件名称设置 - worksheetName : 'Sheet1', //表格工作区名称 - tableName : '每日单据统计', - excelstyles : [ 'background-color', 'color', 'font-size', - 'font-weight' ], + <el-form-item label="业绩归属人"> + <el-select v-model="form.beaultId" placeholder="请选择"> + <el-option v-for="item in achieveUsers" + :key="item.suId" + :label="item.suName" + :value="item.suId"></el-option> + </el-select> + </el-form-item> + + <el-form-item label="门店"> + <el-select v-model="form.shopId" placeholder="请选择所属门店"> + <el-option v-for="item in shopList" + :key="item.id" + :label="item.shopName" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + <el-button type="warning" @click="exportExcel">导出</el-button> + </el-form> + + </el-row> + <el-row class="table-style"> + <el-table :data="tableData" style="width: 100%"> + <el-table-column type="index" width="30"></el-table-column> + <el-table-column prop="datatime" width="150" label="时间"></el-table-column> + <el-table-column prop="orderNo" width="180" label="订单编号"> + <template slot-scope="scope"> + <el-link @click="jumpOrder(scope.row.orderType, scope.row.orderNo)" type="primary">{{scope.row.orderNo}}</el-link> + </template> + </el-table-column> + <el-table-column prop="orderType" label="订单类型"></el-table-column> + <el-table-column prop="vipName" label="会员姓名"></el-table-column> + <el-table-column prop="proName" label="产品" width="200"></el-table-column> + <el-table-column prop="achieveRuleName" label="业绩规则" width="200"></el-table-column> + <el-table-column prop="cateName" label="产品分类"></el-table-column> + <el-table-column prop="zkTotal" label="订单金额"></el-table-column> + <el-table-column prop="goodsCash" label="现金"></el-table-column> + <el-table-column prop="cardCash" label="划扣"></el-table-column> + <!-- <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>--> + <el-table-column prop="meiliao" label="员工"></el-table-column> + <el-table-column v-for="(item, index) in customColumns" width="120" :key="index" :label="item.value"> + <template slot-scope="scope"> + <span v-if="item.value == scope.row.achieveType">{{scope.row.goodsCash}}</span> + </template> + </el-table-column> + <el-table-column prop="hisConsume" label="本金消耗"></el-table-column> + <el-table-column prop="freeConsume" label="赠送消耗"></el-table-column> + <el-table-column prop="projPercentage" label="服务提成"></el-table-column> + <el-table-column prop="numberOfPeople" label="人头"></el-table-column> + <el-table-column prop="projNum" label="项目个数"></el-table-column> + <el-table-column prop="projTime" label="服务时间"></el-table-column> + <el-table-column prop="guwen" label="操作人"></el-table-column> + <el-table-column prop="shopName" label="门店"></el-table-column> + </el-table> + <el-row style="margin-top: 10px;"> + <el-pagination + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="page.size" + layout="total, sizes, prev, pager, next, jumper" + :total="page.total"> + </el-pagination> + </el-row> + </el-row> +</div> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript" th:inline="javascript"> + var vue = new Vue({ + el : "#app", + data : { + tableData : [], + customColumns : [], + achieveRulsList : [], + shopList : [], + achieveUsers : [], + years : [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021,2022], + months : ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"], + days : [], + form : { + year : '', + month : '', + day : '', + timeRange : '', + vipQueryKey : '', + beaultId : '', + achieveRuleId : '', + shopId : '' + }, + page : { + currentPage : 1, + size : 10, + total : 0 + } + }, + created : function() { + this.initDays(); + this.queryCustomColumns(); + this.queryShops(); + this.queryAchieveUsers(); + this.getAchieveRule(); + }, + methods : { + queryTableData () { + + let _this = this; + let form = _this.form; + let page = _this.page; + let params = {}; + params.year=form.year; + params.achieveRuleId=form.achieveRuleId; + params.month=form.month; + params.year=form.year; + params.day=form.day; + params.vipQueryKey=form.vipQueryKey; + params.beaultId=form.beaultId; + params.shopId=form.shopId; + params.limit = page.size; + params.offset = (page.currentPage - 1) * page.size; + + if (form.timeRange) { + params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):''; + params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):''; } - }); - $('[data-toggle="tooltip"]').tooltip() - - }); - - - function footCountTitle(data) { - return "<b>合计</b>"; - }; - function countColumn(data) { - console.log(data) - field = this.field; - var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { - console.log(sum,row[field]); - return sum + (+row[field]); - }, 0)).toFixed(2));//保留有效数字 - return "<b>"+resultsumQuantity+"</b>"; - }; - - - function exportExcel(){ - var param=MForm.toUrlParam("#serchform"); - - window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param; - } - - function buildOpenDetail(value, row, index){ - var html = []; - if(row.orderType=='服务单'){ - html[0] = '<a onClick="fnPublci.showServiceOrder(1 , \'' + value +'\')" class="text-primary " >'+value+'</a>' - }else{ - html[0] = '<a onClick="fnPublci.showOrder(1 , \'' + value +'\')" class="text-primary " >'+value+'</a>' + AjaxProxy.requst({ + app: _this, + data: params, + url: basePath + "/admin/achieve/findDailyInfoNew", + callback: function (loj) { + _this.tableData = loj.rows; + _this.page.total = loj.total; + } + }); + }, + queryCustomColumns() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX', + callback: function (data) { + _this.customColumns = data.rows; + _this.queryTableData(); + } + }); + }, + /** + * 获取规则 + */ + getAchieveRule(){ + let _this = this; + AjaxProxy.requst({ + app: _this, + data: {pageNum:1,pageSize:1000}, + url: basePath + "/admin/achieveRule/selectList", + callback: function (data) { + _this.achieveRulsList=data.rows; + } + }); + }, + queryShops() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopInfo/findAllWithPermi', + callback: function (data) { + _this.shopList = data.rows; + } + }); + }, + queryAchieveUsers() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/getShopStaffByRoleName?roleName=美疗师', + callback: function (data) { + _this.achieveUsers = data.rows; + } + }); + }, + resetForm(formName) { + // this.$refs[formName].resetFields(); + this.form = { + timeRange : '', + vipQueryKey : '', + beaultId : '', + shopId : '' + } + }, + search() { + this.queryTableData(); + }, + handleSizeChange(val) { + this.page.size = val; + this.queryTableData(); + }, + handleCurrentChange(val) { + this.page.currentPage = val; + this.queryTableData(); + }, + initDays() { + let _this = this; + for (var i = 1; i <= 31 ; i++) { + _this.days.push(i); + } + }, + getRequestParam() { + var form = this.form; + var params = form; + if (form.timeRange) { + params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):''; + params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):''; + } + return params; + }, + exportExcel() { + window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+MTools.jsonToUrlParam(this.getRequestParam()); + }, + jumpOrder(type, value) { + if(type=='服务单') { + fnPublci.showServiceOrder(1, value); + } else { + fnPublci.showOrder(1, value); + } } - - return html.join(""); } - - - - - </script> + }); +</script> </body> </html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html new file mode 100644 index 0000000..010a1a8 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html @@ -0,0 +1,156 @@ + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + +</head> +<body class="gray-bg"> + + + <div class="ibox-content"> + <!-- 搜索框部分start --> + <form class="form-inline" id="serchform"> + <div class="form-group mr-20"> + <label>日期范围</label> + <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- + <input name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + </div> + + <div class="form-group mr-20"> + <label>门店</label> + <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" + th:data-url="@{/admin/shopInfo/findShops}"> + <option value=''>--请选择部所属门店--</option> + </select> + </div> + + <div class="row mb-10"> + <div class="col-sm-8"> + <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> + <button type="reset" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> +<!-- <button matrix:btn="ygyjbb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>--> + </div> + </div> + </form> + + + <table id="mgrid"> + <thead> + <tr> + <th data-formatter="MGrid.indexfn" data-align="center" + data-width="30px">序号</th> + <th data-field="dataTime">日期</th> + <th data-field="shopName">门店名称</th> + <th data-field="shouldPay" data-formatter="shouldPayFormat">应收金额</th> + <th data-field="totalPay">实收金额</th> + <th data-field="shouldPay" data-formatter="zkAmountFormat">折扣金额</th> + <th data-field="perCustomCnt">客单数</th> + <th data-field="customGoodsCnt">客品数</th> + <th data-field="cost">成本</th> + <th data-field="grossProfit">毛利</th> + <th data-field="grossProfitRate">毛利率</th> + <th data-field="wechat">微信</th> + <th data-field="alipay">支付宝</th> + <th data-field="cash">现金</th> + <th data-field="bankCard">银行卡</th> + <th data-field="tuan">团购</th> + <th data-field="cardBj">本金收款</th> + <th data-field="cardFree">赠金收款</th> + <th data-field="arrears">欠款</th> + </tr> + </thead> + </table> + </div> + + <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/public.js}"></script> + <script type="text/javascript"> + var myGrid; + var initParam = { + format : "yyyy-mm-dd", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss" + minView: "month", //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour" + } + MTools.ininDatetimepicker(initParam); + //限制结束时间不小于开始时间 + MTools.limitStartEndTime({}); + + $(function() { + MTools.autoFullSelect(); + $(".select2").select2(); + myGrid = MGrid.initGrid({ + url : basePath+"/admin/sysBusinessData/findDailySaleData", + showExport : true, + showFooter : false, + exportDataType : "basic", //basic', 'all', 'selected'. + exportTypes : [ 'excel', 'xlsx' ], //导出类型 + exportOptions : { + ignoreColumn : [ 0 ], + fileName : "客户消费统计" + MTools.getTime(), //文件名称设置 + worksheetName : 'Sheet1', //表格工作区名称 + tableName : '客户消费统计', + excelstyles : [ 'background-color', 'color', 'font-size', + 'font-weight' ], + } + }); + + $('[data-toggle="tooltip"]').tooltip() + + }); + + function shouldPayFormat(value, row, index) { + return row.shouldPay + row.refund; + } + + function zkAmountFormat(value, row, index) { + var result = row.shouldPay + row.refund - row.arrears - row.totalPay; + return result.toFixed(2); + } + + function footCountTitle(data) { + return "<b>合计</b>"; + }; + function countColumn(data) { + if (data) { + var resultsumQuantity = parseFloat(data).toFixed(2);//保留有效数字 + return resultsumQuantity; + } else { + return "-"; + } + }; + + function buildVipNameJump(value, row, index) { + return '<a onClick="vipDetail(\'' + row.t9 +'\')" class="text-primary " >'+value+'</a>'; + } + + function vipDetail(value) { + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + area : MUI.SIZE_M, + content : [basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ] + })); + } + + function exportExcel(){ + + var param=MForm.toUrlParam("#serchform"); + + window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param; + } + + </script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html index 3ab0f06..e84629b 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html @@ -28,9 +28,9 @@ </div> <div class="form-group mr-20"> - <label>日期范围</label> - <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- - <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + <label>日期</label> + <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime"> +<!-- <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime">--> </div> <div class="form-group mr-20"> <label >所属门店</label> <select id="select_id" @@ -49,15 +49,27 @@ <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" data-footer-formatter="footCountTitle">序号</th> - <th data-field="time">日期</th> - <th data-field="shopName" >门店</th> - <th data-field="cashPay" data-footer-formatter="countColumn">收现金额</th> - <th data-field="cardPay" data-footer-formatter="countColumn">实收余额支付</th> - <th data-field="consumePay" data-footer-formatter="countColumn">消耗金额</th> - <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="dataTime">日期</th> + <th data-field="cashPay" data-footer-formatter="countColumn">现金收款</th> + <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="" data-footer-formatter="countColumn">还款</th> + <th data-field="productAchieve" data-footer-formatter="countColumn">产品业绩</th> + <th data-field="cardAchieve" data-footer-formatter="countColumn">卡项业绩</th> <th data-field="refundCashPay" data-footer-formatter="countColumn">现金退款</th> <th data-field="refundCardPay" data-footer-formatter="countColumn">卡项退款</th> - <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="cardAmount" data-footer-formatter="countColumn">储值卡本金扣款</th> + <th data-field="cardFreeAmount" data-footer-formatter="countColumn">储值卡赠送扣款</th> + <th data-field="consumePay" data-footer-formatter="countColumn">本金消耗</th> + <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="peopleCnt" data-footer-formatter="countColumn">人头数</th> + <th data-field="projConsumeCnt" data-footer-formatter="countColumn">项目消耗数</th> + <th data-field="timeLength" data-footer-formatter="countColumn">服务时长</th> + <th data-field="perCustomCnt" data-footer-formatter="countColumn">客单数</th> + <th data-field="customGoodsCnt" data-footer-formatter="countColumn">客品数</th> + <th data-field="perCustomPrice" data-footer-formatter="countColumn">客单价</th> + <th data-field="cost" data-footer-formatter="countColumn">成本</th> + <th data-field="grossProfit" data-footer-formatter="countColumn">毛利</th> + <th data-field="grossProfitRate" data-footer-formatter="countColumn">毛利率</th> </tr> </thead> </table> @@ -78,7 +90,7 @@ $(function() { MTools.autoFullSelect(); myGrid = MGrid.initGrid({ - url : basePath+"/admin/sysBusinessData/showList", + url : basePath+"/admin/sysBusinessData/findShopBusinessesData", showExport : true, showFooter : true, height:'', @@ -100,10 +112,8 @@ return "<b>合计</b>"; }; function countColumn(data) { - console.log(data) field = this.field; var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { - console.log(sum,row[field]); return sum + (+row[field]); }, 0)).toFixed(2));//保留有效数字 return "<b>"+resultsumQuantity+"</b>"; diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html new file mode 100644 index 0000000..5ca688e --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html @@ -0,0 +1,337 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + <title></title> + <style> + .panel-body{ + overflow: hidden; + } + .buttonPanel{ + background: #ffffff; + padding: 10px 10px ; + margin: 0px 0px 10px 0px; + } + .rowPanel{ + background: #ffffff; + padding: 0px 10px ; + padding-top: 10px; + margin: 0px 0px 10px 0px; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> +<body> +<div class="panel-body" id="app"> + + <el-row class="buttonPanel"> + <el-button @click="exportExcel" type="primary" >导出</el-button> + </el-row> + + <el-row class="rowPanel" > + <el-form ref="form" :model="form" inline > + <el-form-item label="会员" prop="queryKey"> + <el-input v-model="form.queryKey" placeholder="请输入会员姓名/手机"></el-input> + </el-form-item> + + <el-form-item label="操作人" prop="oprationMan" > + <el-input v-model="form.oprationMan"></el-input> + </el-form-item> + + <el-form-item label="订单号" prop="orderNo"> + <el-input v-model="form.orderNo"></el-input> + </el-form-item> + + <el-form-item label="交易类型" prop="flowType"> + <el-select v-model="form.flowType" placeholder="请选择"> + <el-option + v-for="item in flowTypeList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + + <el-form-item label="支付方式" prop="payMethod"> + <el-select v-model="form.payMethod" placeholder="请选择"> + <el-option + v-for="item in payMethodList" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + + <el-form-item label="时间" prop="datetimeArr"> + <el-date-picker + v-model="form.datetimeArr" + type="daterange" + range-separator="至" format="yyyy-MM-dd HH:mm" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-form-item> + + <el-form-item label="交易门店" prop="shopId"> + <el-select v-model="form.shopId" placeholder="请选择"> + <el-option + v-for="item in shopList" + :key="item.shopShortName" + :label="item.shopShortName" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + + + + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + + <el-table id="proj" :data="table.rows" :height="height" stripe @sort-change="sortChange"> + <el-table-column + prop="orderNo" + label="订单号" + width="180"> + </el-table-column> + <el-table-column + prop="flowContent" + label="交易内容" + show-overflow-tooltip + width="240"> + </el-table-column> + <el-table-column + prop="createTime" + sortable="custom" + label="交易时间" + show-overflow-tooltip + width="180"> + </el-table-column> + <el-table-column + prop="flowType" + sortable="custom" + label="交易类型"> + </el-table-column> + <el-table-column + prop="amount" + sortable="custom" + label="交易金额"> + </el-table-column> + <el-table-column + prop="vipName" + label="会员姓名"> + </el-table-column> + <el-table-column + prop="payMethod" + sortable="custom" + label="支付方式"> + </el-table-column> + <el-table-column + prop="cardName" + sortable="custom" + label="储值卡名称"> + </el-table-column> + <el-table-column + prop="flowNo" + label="支付流水号"> + </el-table-column> + <el-table-column + prop="staffName" + label="操作人"> + </el-table-column> + <el-table-column + prop="shopName" + label="门店名称"> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="text" @click="openOrder(scope.$index, scope.row)" size="small">订单详情</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="table.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="table.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="table.total"> + </el-pagination> + </el-row> + +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript" th:inline="javascript"> + + var vue = new Vue({ + el: '#app', + data: { + table:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + form:{ + name:null, + datetimeArr:'', + payMethod:'', + flowType:'', + orderNo:'', + oprationMan:'', + queryKey:'', + shopId:'', + }, + height:'calc(100vh - 240px)', + shopList:[{id:0,shopShortName:'全部'}], + flowTypeList:[ + {value:'',label:'全部'}, + {value:'购买',label:'购买'}, + {value:'退款',label:'退款'}, + {value:'还款',label:'还款'} + ], + payMethodList:[ + {value:'',label:'全部'}, + {value:'现金',label:'现金'}, + {value:'微信',label:'微信'}, + {value:'支付宝',label:'支付宝'}, + {value:'银行卡',label:'银行卡'}, + {value:'团购',label:'团购'}, + {value:'储值卡',label:'储值卡'}, + {value:'欠款',label:'欠款'} + ], + }, + created: function () { + let _this=this; + this.loadData(); + window.addEventListener("keydown", this.keydown); + AjaxProxy.requst({ + app:_this, + url:basePath+"/admin/shopInfo/findAll", + callback:function (data) { + data.rows.forEach(shop=>{ + _this.shopList.push(shop); + }); + } + + }) + + }, + methods: { + changePageSize(val) { + this.table.pageSize = val; + this.loadData(); + }, + changeCurrentPage(val) { + this.table.currentPage = val; + this.loadData(); + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + }, + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadData(); + } + }, + loadData:function(){ + let _this = this; + let data=_this.getRequestParam(); + data.limit=_this.table.pageSize; + data.offset=_this.table.pageSize*(_this.table.currentPage-1); + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/orderFlow/findOrderFlow', + callback: function (data) { + _this.table.rows = data.rows; + _this.table.total=data.total; + } + }); + }, + getRequestParam(){ + let _this = this; + return { + name:_this.form.name, + payMethod:_this.form.payMethod, + flowType:_this.form.flowType, + orderNo:_this.form.orderNo, + oprationMan:_this.form.oprationMan, + queryKey:_this.form.queryKey, + startTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'', + endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'', + shopId:_this.form.shopId, + order:_this.form.order, + sort:_this.form.sort, + + } + }, + search:function(){ + this.table.currentPage=1; + this.loadData(); + }, + keydown(evt){ + if(evt.keyCode==13) { + this.search(); + } + }, + + openOrder(index,row){ + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + content : [ basePath + '/admin/order/orderItem?id=' + row.orderId ] + })); + }, + //导出 + exportExcel(){ + window.location.href=basePath+"/admin/orderFlow/exportOrderFlowExcel?"+MTools.jsonToUrlParam(this.getRequestParam()); + } + + } + }); + + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-item.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-item.html index 00ee7bc..81a5c7c 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-item.html @@ -27,7 +27,7 @@ </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label>储值卡名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> @@ -103,14 +103,10 @@ url:basePath+"/admin/moneyCardUseStatistics/showList" }); }); - + function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/moneyCardUseStatistics/exportShowList?"+param; } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-summary.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-summary.html index 56073ea..554ddec 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-summary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-summary.html @@ -25,30 +25,27 @@ <button onclick="myGrid.resetForm()" type="button" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> </div> </div> - <div class="form-group mr-20"> - <label >产品名称</label> + <label>储值卡名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> +<!-- <div class="form-group mr-20">--> +<!-- <label for="parentId">商品分类</label>--> +<!-- <select class="form-control select2" size="1" name="cateId" id="parentId">--> +<!-- <option value="" selected="selected">--选择分类--</option>--> +<!-- </select>--> +<!-- </div>--> - <div class="form-group mr-20"> - <label for="parentId">商品分类</label> - <select class="form-control select2" size="1" name="cateId" id="parentId"> - <option value="" selected="selected">--选择分类--</option> - </select> - </div> +<!-- <div class="form-group mr-20">--> +<!-- <label>会员</label>--> +<!-- <input autocomplete="off" placeholder="姓名/编号/电话" name="vipQueryKey" type="text" class="form-control" >--> +<!-- </div>--> - <div class="form-group mr-20"> - <label>会员</label> - <input autocomplete="off" placeholder="姓名/编号/电话" name="vipQueryKey" type="text" class="form-control" > - </div> - - - <div class="form-group mr-20"> - <label>到期时间</label><!-- 入库时间的查询增加一个查询的其实时间两个字段 --> - <input autocomplete="off" id="select_begin" name="beginTime" type="text" class="form-control datetimepicker">- - <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="select_end"> - </div> +<!-- <div class="form-group mr-20">--> +<!-- <label>到期时间</label><!– 入库时间的查询增加一个查询的其实时间两个字段 –>--> +<!-- <input autocomplete="off" id="select_begin" name="beginTime" type="text" class="form-control datetimepicker">- --> +<!-- <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="select_end">--> +<!-- </div>--> </form> <div id="option-bar" > <button matrix:btn="bedListZb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> @@ -87,15 +84,11 @@ url:basePath+"/admin/moneyCardUseStatistics/summaryItemDetail" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/moneyCardUseStatistics/exportSummaryItemDetail?"+param; + } function initFunctionList() { diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html index f6459f4..62a5048 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html @@ -27,7 +27,7 @@ </div> <div class="form-group mr-20"> <label >订单状态</label> - <select class="form-control " name="status" > + <select class="form-control " name="statu" > <option value=''>--请选择订单状态--</option> <option value='欠款'>欠款</option> <option value='待付款'>待付款</option> @@ -92,9 +92,10 @@ <th data-field="VIP_NAME" >客户名</th> <th data-field="COUNT" data-sortable="true" >购买数量</th> <th data-field="ZK_PRICE" data-sortable="true" >单价</th> + <th data-field="total" >小计</th> <th data-field="su_name" >健康顾问</th> <th data-field="pay_method" >支付方式</th> - <th data-field="status" >状态</th> + <th data-field="statu" >状态</th> </tr> </thead> </table> @@ -121,12 +122,8 @@ }); function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/orderStatistics/exportShowList?"+param; } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-summary.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-summary.html index 10f50c0..f3030f0 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-summary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-summary.html @@ -102,7 +102,7 @@ function exportExcel(){ var param=MForm.toUrlParam("#serchform"); - window.location.href=basePath+"/form/furnsale/exportFurn? "+param; + window.location.href=basePath+"/admin/orderStatistics/exportSummaryItemDetail?"+param; } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-item.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-item.html index e34d45c..042aee0 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-item.html @@ -36,14 +36,14 @@ </select> </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label>服务名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> @@ -85,13 +85,15 @@ <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" >序号</th> <th data-field="SHOP_NAME" >门店</th> - <th data-field="consume_time" data-formatter="MGrid.getTime" data-sortable="true" >服务日期</th> + <th data-field="yy_time" data-formatter="MGrid.getTime" data-sortable="true" >预约时间</th> + <th data-field="consume_time" data-formatter="MGrid.getTime" data-sortable="true" >划扣时间</th> <th data-field="SERVICE_NO" >服务单号</th> <th data-field="PROJ_NAME" >服务名称</th> <th data-field="TYPE_NAME" >分类</th> <th data-field="VIP_NAME" >客户名</th> - <th data-field="COUNT" data-sortable="true" >次数</th> - <th data-field="PRICE" data-sortable="true" >单价</th> + <th data-field="COUNT" data-sortable="true">次数</th> + <th data-field="PRICE" data-sortable="true">划扣单价</th> + <th data-field="extract" data-sortable="true" >提成</th> <th data-field="su_name" >美疗师</th> <th data-field="SOURCE" >来源</th> </tr> @@ -115,28 +117,28 @@ //有删除权限 var delUrl=""; myGrid=MGrid.initGrid({ - url:basePath+"/admin/serviceStatistics/showList" + url:basePath+"/admin/serviceStatistics/showList", + sortName:"yy_time", + sortOrder:"desc" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/serviceStatistics/exportShowList?"+param; + } + function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-sumary.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-sumary.html index 3262674..8b2b1d3 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-sumary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-sumary.html @@ -26,7 +26,7 @@ </div> </div> <div class="form-group mr-20"> - <label >订单状态</label> + <label>订单状态</label> <select class="form-control " name="state" > <option value=''>--请选择订单状态--</option> <option value='待预约'>待预约</option> @@ -36,14 +36,14 @@ </select> </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label>商品名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> @@ -99,25 +99,22 @@ url:basePath+"/admin/serviceStatistics/summaryItemDetail" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/serviceStatistics/exportSummaryItemDetail?"+param; + } function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-item.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-item.html index e54f7ea..46bd288 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-item.html @@ -27,14 +27,14 @@ </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label>服务名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> @@ -43,6 +43,14 @@ <input autocomplete="off" placeholder="姓名/编号/电话" name="vipQueryKey" type="text" class="form-control" > </div> + <div class="form-group mr-20"> + <label >所属门店</label> <select + class="form-control autoFull" + data-url="/admin/shopInfo/findShops" data-value="id" + data-filed="shopName" name="shopId"> + <option value="">--请选择所属门店--</option> + </select> + </div> <div class="form-group mr-20"> <label>到期时间</label><!-- 入库时间的查询增加一个查询的其实时间两个字段 --> @@ -58,6 +66,7 @@ <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" >序号</th> <th data-field="VIP_NAME" >客户名</th> + <th data-field="SHOP_NAME" >客户门店</th> <th data-field="PROJ_NAME" >服务名称</th> <th data-field="FAIL_TIME" data-formatter="MGrid.getTime" data-sortable="true" >到期日期</th> <th data-field="SURPLUS_COUNT" data-sortable="true" >剩余次数</th> @@ -104,25 +113,22 @@ url:basePath+"/admin/projUseStatistics/showList" }); }); - + function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/projUseStatistics/exportShowList?"+param; } - function initFunctionList() { + function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-sumary.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-sumary.html index afd83fd..636a0f6 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-sumary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-sumary.html @@ -25,13 +25,13 @@ </div> </div> <div class="form-group mr-20"> - <label>产品名称</label> + <label>服务名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> </form> @@ -73,25 +73,23 @@ url:basePath+"/admin/projUseStatistics/summaryItemDetail" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/projUseStatistics/exportSummaryItemDetail?"+param; + } function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/store/store-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/store/store-list.html index b906aa3..4b0e032 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/store/store-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/store/store-list.html @@ -186,7 +186,7 @@ alarmNum = row.alarmNum; } var storeNum = parseInt(value); - if (alarmNum >= storeNum) { + if (alarmNum > storeNum) { html = '<span class="label-danger" > ' + value + ' </span>'; } else { diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html index 0354078..c26f320 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html @@ -96,7 +96,7 @@ </select> </div> <div class="form-group"> - <button matrix:btn="mdhyzl-add" onclick="myGrid.serchData(1)" type="button" + <button onclick="myGrid.serchData(1)" type="button" class="btn btn-sm btn-info"> <i class="fa fa-search "></i> 搜索 </button> @@ -110,17 +110,12 @@ <!-- 功能按钮部分 --> <div id="option-bar" > - <button matrix:fn="mdhyzl-edit" onclick="openEdit()" type="button" class="btn btn-success btn-sm "><i + <button matrix:btn="mdhyzl-edit" onclick="openEdit()" type="button" class="btn btn-success btn-sm "><i class="fa fa-edit"></i>编辑 </button> - <button matrix:fn="mdhyzl-gjjl" onclick="openFollow()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 跟进记录</button> - <button matrix:fn="mdhyzl-khda" onclick="openArchieves()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 客户档案</button> - <button matrix:btn="mdhyzl-projTaocan" onclick="openProj()" type="button" class="btn btn-info btn-sm"><i class="fa fa-cube"></i> 项目管理</button> - <button matrix:btn="mdhyzl-projTaocan" onclick="openTc()" type="button" class="btn btn-info btn-sm"><i class="fa fa-cubes"></i> 套餐管理</button> - <button matrix:btn="mdhyzl-projTaocan" onclick="openMoneyCard()" type="button" class="btn btn-info btn-sm"><i class="fa fa-credit-card"></i> 充值卡管理</button> - <button matrix:fn="mdhyzl-xfdd" onclick="openOrder()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 消费订单</button> - <button matrix:fn="mdhyzl-fwd" onclick="openServiceOrder()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 服务单</button> - <button matrix:btn="mdhyzl-excelOut" onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> + <button matrix:btn="mdhyzl-gjjl" onclick="openFollow()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 跟进记录</button> + <button matrix:btn="mdhyzl-khda" onclick="openArchieves()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 客户档案</button> + <button matrix:btn="mdhyzl-exportExcel" onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> </div> <!-- 数据表格部分 --> @@ -138,6 +133,7 @@ <th data-field="arrivalWay">到店途径</th> <th data-field="staffName">健康顾问</th> <th data-field="shopName">所属门店</th> + <th data-field="phone" data-formatter="buildOperation">操作</th> </tr> </thead> </table> @@ -156,7 +152,6 @@ var delUrl=""; delUrl=basePath+"/hiveErp/vipInfo/del"; - myGrid= MGrid.initGrid({ url : basePath+"/hiveErp/vipInfo/showVipInfoList", @@ -165,16 +160,7 @@ }); }); - function openOrder(){ - var vipName=myGrid.getSelectItemId("vipName"); - layer.full(layer.open({ - type : 2, - title : "消费记录", - area : [ MUI.SIZE_L, '450px' ], - maxmin : true, - content : [ basePath+'/admin/redirect/hive/operate/sysOrder-list?vipName=' + vipName ] - })); - } + /** * 构建会员名称 */ @@ -185,16 +171,7 @@ return value; } } - function openServiceOrder(){ - var vipName=myGrid.getSelectItemId("vipName"); - layer.full(layer.open({ - type : 2, - title : "服务单", - area : [ MUI.SIZE_L, '450px' ], - maxmin : true, - content : [ basePath+'/admin/redirect/hive/store/projService-list?vipName=' + vipName ] - })); - } + function openArchieves(){ var id=myGrid.getSelectItemId(); @@ -219,84 +196,15 @@ content : [ basePath+'/admin/serviceRecord/toServicefollowListForZd?id=' + id ] }); } - function createDateDictionary() { - $(".dds").each( - function() { - var type = $(this).attr("cc"); - var _this = $(this); - //取服务器请求数据 - $.AjaxProxy({ - p : { - type : type - } - }) - .invoke( - basePath+"/admin/dds/showDataDictionary", - function(loj) { - var html = ''; - console.log(loj.getRowCount()); - for (var i = 0; i < loj - .getRowCount(); i++) { - html += '<option value="' - + loj - .getString(i, - "id") - + '">' - + loj.getString(i, - "name") - + "</option>"; - } - _this.html(html); - }); - }); - } - function openTc() { - var id=myGrid.getSelectItemId(); - layer.open({ - type: 2, - title: "会员套餐管理", - area: MUI.SIZE_M, - content : [ basePath+'/admin/redirect/hive-erp/vip/viptc-list?vipId=' + id] - }); - } - function openProj() { - var id=myGrid.getSelectItemId(); - layer.open({ - type: 2, - title: "会员项目管理", - area: MUI.SIZE_M, - content : [ basePath+'/admin/redirect/hive-erp/vip/projUse-list?vipId=' + id] - }); - } - function openMoneyCard() { - var id=myGrid.getSelectItemId(); - layer.open({ - type: 2, - title: "会员充值卡管理", - area: MUI.SIZE_M, - content : [ basePath+'/admin/redirect/hive-erp/vip/moneyCardUse-list?vipId=' + id] - }); - } //导出 function exportExcel() { - var name = $("#search-text").attr("name"); - var value = $("#search-text").val(); - var vipType = $("#vipType").val(); - var arrivalWay = $("#arrivalWay").val(); - var vipState = $("#vipState").val(); - var staffId = $("#staffId").val(); - var shopId = $("#shopId").val(); - window.location.href = basePath+"/admin/vipInfo/exportExcel?vipType=" - + encodeURI(encodeURI(vipType)) + "&arrivalWay=" - + encodeURI(encodeURI(arrivalWay)) + "&"+name+"=" - + encodeURI(encodeURI(value)) + "&vipState=" - + encodeURI(encodeURI(vipState)) + "&shopId=" + shopId - + "&staffId=" + staffId; + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/hiveErp/vipInfo/exportExcel?"+param; } //打开编辑界面 @@ -310,6 +218,21 @@ }); } + function buildOperation(value, row, index) { + var html = ""; + html += '<a class="text-info" href="javascript:void(0)" onClick="openVipDetail(\''+row.phone+'\')">查看详情</a> ' + return html; + } + function openVipDetail(value) { + debugger + layer.full(layer.open({ + type : 2, + title : "会员详情", + area : [ MUI.SIZE_L, '450px' ], + maxmin : true, + content : [ basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ] + })); + } </script> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form-bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form-bak.html new file mode 100644 index 0000000..8e4fb55 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form-bak.html @@ -0,0 +1,348 @@ + + + + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + +<title></title> + + +</head> + +<div class="panel-body"> + <div class="form-group"> + <label class="col-sm-2 control-label">订单号</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.orderNo}"></span> + </div> + <label class="col-sm-2 control-label">订单总价</label> + <div class="col-sm-4"> + <span class="form-control-static" id="total" th:text="${order.total}"></span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">客户编号</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.vipNo}"></span> + </div> + <label class="col-sm-2 control-label">客户姓名</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.vipName}"></span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">折后价</label> + <div class="col-sm-4"> + <span class="form-control-static" id="zkTotal" th:text="${order.zkTotal}"></span> + </div> + <label class="col-sm-2 control-label">欠款</label> + <div class="col-sm-4"> + <span class="form-control-static" id="zkTotal" th:text="${order.arrears}"></span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">卡付金额</label> + <div class="col-sm-4"> + <span class="form-control-static" id="zkTotal" th:text="${order.cardPay}"></span> + </div> + <label class="col-sm-2 control-label">现金付款</label> + <div class="col-sm-4"> + <span class="form-control-static" id="zkTotal" th:text="${order.cashPay}"></span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">顾问姓名</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.staffName}"></span> + </div> + </div> +</div> + + + + +<div class="row "> + <div class="col-sm-10 pd-20 col-sm-offset-1"> + <form class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> + <div class="tabs-container "> + <ul class="nav nav-tabs"> + <li class="active"><a data-toggle="tab" href="#tab-1" + aria-expanded="true">收款</a></li> + <li class=""><a data-toggle="tab" href="#tab-2" + aria-expanded="false">业绩</a></li> + </ul> + <div class="tab-content"> + <div id="tab-1" class="tab-pane active"> + <div class="panel-body"> + <div class="col-sm-12 form-group"> + <!-- 改变折扣后的总价 --> + <input autocomplete="off" type="hidden" name="zkTotal" th:value="${order.zkTotal}" + id="zkTotalInput"> + <div class="panel-body"> + <table class="table table-striped table-condensed table-hover"> + <thead> + <tr> + <th>序号</th> + <th>商品名称</th> + <th>单价</th> + <th>购买数量</th> + <th>折扣单价</th> + <th>支付方式</th> + <th>支付金额</th> + </tr> + </thead> + <tbody id="tbody"> + <tr th:each="item,count:${order.items }"> + <td th:text="${count.index}+1"></td> + <td> + <span th:text=" ${item.shoppingGoods.name }"></span> + + <span th:if="${item.isFree eq '是' }" th:text="赠"></span> + </td> + <td th:text="${item.price }"></td> + <td th:text="${item.count}"></td> + <td th:text="${item.zkPrice}"></td> + + <td><input autocomplete="off" type="hidden" + th:name="'items['+${count.index}+'].id'" + th:value="${item.id }"> + + + <input autocomplete="off" type="hidden" th:name="'items['+${count.index}+'].goodsId'" + th:value="${item.goodsId }"> + <input autocomplete="off" type="hidden" th:name="'items['+${count.index}+'].count'" th:value="${item.count}"> + + <select class="form-control" + th:name="'items['+${count.index}+'].payMethod'"> + <option th:if="${item.type eq '充值卡'}" value="现金">现金</option> + <option value="现金">现金</option> + <th:block th:if="${item.type ne '充值卡'}"> + <th:block th:each="cardItem:${cards }" > + <option th:value="${cardItem.id }" th:text="${cardItem.cardName }+'-余:'+${cardItem.realMoney+cardItem.giftMoney}"></option> + </th:block> + </th:block> + + </select></td> + <td><input autocomplete="off" type="text" class="form-control" + th:onchange="'changePayMoney(\'p'+${item.id}+'\',this)'" + + onchange="reckonTotal()" dataType="price" nullmsg="请填写金额" + errormsg="金额可为两位小数的正数" th:value="${item.arrears}" + th:name="'items['+${count.index}+'].payMoney'" > + <div class="Validform_checktip"></div></td> + </tr> + </th> + </tbody> + </table> + </div> + </div> + + + + <div class="col-sm-12 form-group"> + <div class="form-group"> + <div class="form-group"> + <label class="col-sm-2 control-label">实收金额</label> + <div class="col-sm-4"> + <input autocomplete="off" type="text" class="form-control" name="actualPay" + id="money" readonly="readonly" th:value="${order.arrears}" + datatype="/^(([0-9]\d{0,9})|0)(\.\d{1,2})?$/" + ignore="ignore"> + <div class="Validform_checktip"></div> + </div> + + <label class="col-sm-2 control-label">备注</label> + <div class="col-sm-4"> + <input autocomplete="off" type="text" class="form-control" name="remark" + th:value="${order.remark}" datatype="*0-200" ignore="ignore"> + <div class="Validform_checktip"></div> + </div> + </div> + </div> + <input autocomplete="off" type="hidden" id="id" name="id" th:value="${order.id}" /> + </div> + </div> + </div> + <div id="tab-2" class="tab-pane"> + <div class="panel-body"> + <table class="table table-condensed "> + <thead> + <tr> + <th>序号</th> + <th>商品名称</th> + <th>分配金额</th> + <th>美疗师业绩</th> + <th>操作</th> + </tr> + </thead> + <tbody id="tbody2"> + <th:block th:each="item,count:${order.items }" > + <tr th:id="'p'+${item.id}"> + <td th:text="${count.index}+1"></td> + <td th:text="${item.shoppingGoods.name }"> + <span th:if="${item.isFree eq '是' }" th:text="赠"></span> + </td> + <td th:text="${item.arrears }"></td> + <td> + <table class="table table-condensed "> + <tr th:each="achaeve,count2:${item.achaeveList }"> + <td><select class="autoFull select2 input-sm" + + data-value="suId" + data-filed="suName" + th:data-def="${achaeve.staffId }" + th:name="'items['+${count.index}+'].achaeveList['+${count2.index}'].beaultId'" + th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" + > + </select></td> + <td><input autocomplete="off" type="text" + class="form-control input-sm" style="width: 80px" + th:name="'items['+${count.index}+'].achaeveList['+${count2.index}'].t1"></td> + <td><button class="btn btn-danger btn-sm" + onclick="deleteBeaute(this)">删除</button></td> + </tr> + </table> + </td> + <td><a class="btn btn-default btn-sm" + th:onclick="'addBeaute(\'p'+${item.id}+'\','+${count.index}+')'">添加</a></td> + </tr> + + </tbody> + </table> + </div> + </div> + </div> + <div class="form-group mt-20 "> + <div class="col-sm-12 text-center"> + <a href="javascript:;" + onclick="myForm.submit()" class="btn btn-success radius">确认</a> + + <button onclick="MTools.closeForm()" + class="btn btn-danger radius" type="button">取消</button> + </div> + </div> + </div> + </form> + </div> +</div> + + +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> + var myForm = MForm.initForm({ + invokeUrl : basePath+"/admin/moneyCardUse/bj", + beforeSubmit : function() { + + //校验业绩 + var ifAchieveOk=true; + $("#tbody2").children("tr").each(function(){ + var tr=$(this); + var pay=parseFloat(tr.find("td").eq(2).html()); + var achieveSum=0; + tr.find("td").eq(3).find("table").find("tr").each(function(){ + var achieve= parseFloat($(this).find("td").eq(1).find("input").val()); + achieveSum+=achieve; + }); + if(achieveSum>pay){ + ifAchieveOk=false; + } + }); + if(!ifAchieveOk){ + layer.msg("业绩金额不能大于支付金额",{icon:2}) + return false; + } + + + var money = parseFloat($("#money").val()); + var total = parseFloat($("#zkTotal").html()); + }, + afterSubmit : function() { + if(parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.orderQuery(); + } + }, + }); + + //添加一个美疗师 + function addBeaute(trId,itemIndex){ + if(!itemIndex){ + itemIndex=0; + } + var id=MTools.randomStr(); + + var table=$("#"+trId).find("td").eq(3).find("table") + + var achieveIndex=$("#"+trId).find("td").eq(3).find("table").find("tr").length; + var html= '<tr> <td><select class="autoFull select2 input-sm" id="'+id+'" name="items['+itemIndex+'].achaeveList['+achieveIndex+'].beaultId" ' + +'data-url="'+basePath+'/admin/getShopStaffByRoleName?roleName=美疗师" data-value="suId" data-filed="suName" data-def=""' + +'name="beatuyId"> </select></td> <td><input autocomplete="off" type="text" class="form-control input-sm" style="width: 80px" name="items['+itemIndex+'].achaeveList['+achieveIndex+'].t1" ' + +'name="items['+itemIndex+'].zkPrice" ></td> <td><button class="btn btn-danger btn-sm" onclick="deleteBeaute(this)" >删除</button></td> </tr>'; + $("#"+trId).find("td").eq(3).find("table").append(html); + $('#'+id).select2({'width':'80px'}); + MTools.autoFullSelect({selecteder:'#'+id}); + }; + //删除一个美疗师 + function deleteBeaute(node){ + $(node).closest("tr").remove(); + } + + //修改收款金额 + function changePayMoney(trId,node){ + console.log(trId,node); + $("#"+trId).find("td").eq(2).html($(node).val()); + }; + + + //改变折扣单价 + function changeZkprice() { + var sum = 0; + $("#tbody").find("tr").each(function() { + var $tds = $(this).find("td"); + var count = $tds.eq(3).html(); + var zkprice = $tds.eq(4).find("input").eq(0).val(); + totalMoney = parseFloat(count) * parseFloat(zkprice); + $tds.eq(6).find("input").eq(0).val(totalMoney); + sum += totalMoney; + }); + $("#money").val(sum); + $("#zkTotal").html(sum); + $("#zkTotalInput").val(sum); + } + + //计算实收 + function reckonTotal() { + var sum = 0; + $("#tbody").find("tr").each(function() { + var $tds = $(this).find("td"); + var count = $tds.eq(6).find("input").eq(0).val(); + sum += parseFloat(count) + }); + $("#money").val(sum); + + } +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form.html index 169bc31..8265278 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/bj-form.html @@ -1,8 +1,4 @@ - - - - -<!DOCTYPE HTML> +<!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> @@ -13,330 +9,364 @@ content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <LINK rel="Bookmark" href="../images/favicon.ico"> -<!-- 本框架基本脚本和样式 --> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> - + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> <title></title> - - -</head> - -<div class="panel-body"> - <div class="form-group"> - <label class="col-sm-2 control-label">订单号</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.orderNo}"></span> - </div> - <label class="col-sm-2 control-label">订单总价</label> - <div class="col-sm-4"> - <span class="form-control-static" id="total" th:text="${order.total}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">客户编号</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.vipNo}"></span> - </div> - <label class="col-sm-2 control-label">客户姓名</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.vipName}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">折后价</label> - <div class="col-sm-4"> - <span class="form-control-static" id="zkTotal" th:text="${order.zkTotal}"></span> - </div> - <label class="col-sm-2 control-label">欠款</label> - <div class="col-sm-4"> - <span class="form-control-static" id="zkTotal" th:text="${order.arrears}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">卡付金额</label> - <div class="col-sm-4"> - <span class="form-control-static" id="zkTotal" th:text="${order.cardPay}"></span> - </div> - <label class="col-sm-2 control-label">现金付款</label> - <div class="col-sm-4"> - <span class="form-control-static" id="zkTotal" th:text="${order.cashPay}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">顾问姓名</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.staffName}"></span> - </div> - </div> -</div> - - - - -<div class="row "> - <div class="col-sm-10 pd-20 col-sm-offset-1"> - <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="tabs-container "> - <ul class="nav nav-tabs"> - <li class="active"><a data-toggle="tab" href="#tab-1" - aria-expanded="true">收款</a></li> - <li class=""><a data-toggle="tab" href="#tab-2" - aria-expanded="false">业绩</a></li> - </ul> - <div class="tab-content"> - <div id="tab-1" class="tab-pane active"> - <div class="panel-body"> - <div class="col-sm-12 form-group"> - <!-- 改变折扣后的总价 --> - <input autocomplete="off" type="hidden" name="zkTotal" th:value="${order.zkTotal}" - id="zkTotalInput"> - <div class="panel-body"> - <table class="table table-striped table-condensed table-hover"> - <thead> - <tr> - <th>序号</th> - <th>商品名称</th> - <th>单价</th> - <th>购买数量</th> - <th>折扣单价</th> - <th>支付方式</th> - <th>支付金额</th> - </tr> - </thead> - <tbody id="tbody"> - <tr th:each="item,count:${order.items }"> - <td th:text="${count.index}+1"></td> - <td> - <span th:text=" ${item.shoppingGoods.name }"></span> - - <span th:if="${item.isFree eq '是' }" th:text="赠"></span> - </td> - <td th:text="${item.price }"></td> - <td th:text="${item.count}"></td> - <td th:text="${item.zkPrice}"></td> - - <td><input autocomplete="off" type="hidden" - th:name="'items['+${count.index}+'].id'" - th:value="${item.id }"> - - - <input autocomplete="off" type="hidden" th:name="'items['+${count.index}+'].goodsId'" - th:value="${item.goodsId }"> - <input autocomplete="off" type="hidden" th:name="'items['+${count.index}+'].count'" th:value="${item.count}"> - - <select class="form-control" - th:name="'items['+${count.index}+'].payMethod'"> - <option th:if="${item.type eq '充值卡'}" value="现金">现金</option> - <option value="现金">现金</option> - <th:block th:if="${item.type ne '充值卡'}"> - <th:block th:each="cardItem:${cards }" > - <option th:value="${cardItem.id }" th:text="${cardItem.cardName }+'-余:'+${cardItem.realMoney+cardItem.giftMoney}"></option> - </th:block> - </th:block> - - </select></td> - <td><input autocomplete="off" type="text" class="form-control" - th:onchange="'changePayMoney(\'p'+${item.id}+'\',this)'" - - onchange="reckonTotal()" dataType="price" nullmsg="请填写金额" - errormsg="金额可为两位小数的正数" th:value="${item.arrears}" - th:name="'items['+${count.index}+'].payMoney'" > - <div class="Validform_checktip"></div></td> - </tr> - </th> - </tbody> - </table> - </div> - </div> - - - - <div class="col-sm-12 form-group"> - <div class="form-group"> - <div class="form-group"> - <label class="col-sm-2 control-label">实收金额</label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" name="actualPay" - id="money" readonly="readonly" th:value="${order.arrears}" - datatype="/^(([0-9]\d{0,9})|0)(\.\d{1,2})?$/" - ignore="ignore"> - <div class="Validform_checktip"></div> - </div> - - <label class="col-sm-2 control-label">备注</label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" name="remark" - th:value="${order.remark}" datatype="*0-200" ignore="ignore"> - <div class="Validform_checktip"></div> - </div> - </div> - </div> - <input autocomplete="off" type="hidden" id="id" name="id" th:value="${order.id}" /> - </div> - </div> - </div> - <div id="tab-2" class="tab-pane"> - <div class="panel-body"> - <table class="table table-condensed "> - <thead> - <tr> - <th>序号</th> - <th>商品名称</th> - <th>分配金额</th> - <th>美疗师业绩</th> - <th>操作</th> - </tr> - </thead> - <tbody id="tbody2"> - <th:block th:each="item,count:${order.items }" > - <tr th:id="'p'+${item.id}"> - <td th:text="${count.index}+1"></td> - <td th:text="${item.shoppingGoods.name }"> - <span th:if="${item.isFree eq '是' }" th:text="赠"></span> - </td> - <td th:text="${item.arrears }"></td> - <td> - <table class="table table-condensed "> - <tr th:each="achaeve,count2:${item.achaeveList }"> - <td><select class="autoFull select2 input-sm" - - data-value="suId" - data-filed="suName" - th:data-def="${achaeve.staffId }" - th:name="'items['+${count.index}+'].achaeveList['+${count2.index}'].beaultId'" - th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" - > - </select></td> - <td><input autocomplete="off" type="text" - class="form-control input-sm" style="width: 80px" - th:name="'items['+${count.index}+'].achaeveList['+${count2.index}'].t1"></td> - <td><button class="btn btn-danger btn-sm" - onclick="deleteBeaute(this)">删除</button></td> - </tr> - </table> - </td> - <td><a class="btn btn-default btn-sm" - th:onclick="'addBeaute(\'p'+${item.id}+'\','+${count.index}+')'">添加</a></td> - </tr> - - </tbody> - </table> - </div> - </div> - </div> - <div class="form-group mt-20 "> - <div class="col-sm-12 text-center"> - <a href="javascript:;" - onclick="myForm.submit()" class="btn btn-success radius">确认</a> - - <button onclick="MTools.closeForm()" - class="btn btn-danger radius" type="button">取消</button> - </div> - </div> - </div> - </form> - </div> -</div> - - -<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> - var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/moneyCardUse/bj", - beforeSubmit : function() { - - //校验业绩 - var ifAchieveOk=true; - $("#tbody2").children("tr").each(function(){ - var tr=$(this); - var pay=parseFloat(tr.find("td").eq(2).html()); - var achieveSum=0; - tr.find("td").eq(3).find("table").find("tr").each(function(){ - var achieve= parseFloat($(this).find("td").eq(1).find("input").val()); - achieveSum+=achieve; - }); - if(achieveSum>pay){ - ifAchieveOk=false; - } - }); - if(!ifAchieveOk){ - layer.msg("业绩金额不能大于支付金额",{icon:2}) - return false; - } - - - var money = parseFloat($("#money").val()); - var total = parseFloat($("#zkTotal").html()); - }, - afterSubmit : function() { - parent.myGrid.serchData(); - }, - }); - - //添加一个美疗师 - function addBeaute(trId,itemIndex){ - if(!itemIndex){ - itemIndex=0; + <style> + .paymethod ul { + padding: 0; + margin: 0; + height: 50px; } - var id=MTools.randomStr(); - - var table=$("#"+trId).find("td").eq(3).find("table") - - var achieveIndex=$("#"+trId).find("td").eq(3).find("table").find("tr").length; - var html= '<tr> <td><select class="autoFull select2 input-sm" id="'+id+'" name="items['+itemIndex+'].achaeveList['+achieveIndex+'].beaultId" ' - +'data-url="'+basePath+'/admin/getShopStaffByRoleName?roleName=美疗师" data-value="suId" data-filed="suName" data-def=""' - +'name="beatuyId"> </select></td> <td><input autocomplete="off" type="text" class="form-control input-sm" style="width: 80px" name="items['+itemIndex+'].achaeveList['+achieveIndex+'].t1" ' - +'name="items['+itemIndex+'].zkPrice" ></td> <td><button class="btn btn-danger btn-sm" onclick="deleteBeaute(this)" >删除</button></td> </tr>'; - $("#"+trId).find("td").eq(3).find("table").append(html); - $('#'+id).select2({'width':'80px'}); - MTools.autoFullSelect({selecteder:'#'+id}); - }; - //删除一个美疗师 - function deleteBeaute(node){ - $(node).closest("tr").remove(); - } - - //修改收款金额 - function changePayMoney(trId,node){ - console.log(trId,node); - $("#"+trId).find("td").eq(2).html($(node).val()); - }; + .paymethod ul li { + padding: 10px; + margin: 5px; + list-style:none; + float: left; + display: block; + cursor: pointer; + position: relative; + border: white 1px solid; + } + .paymethod ul li:hover { + border: #409EFF 1px solid; + } + .paymethod .active { + border: #409EFF 1px solid; + } + .paymethod .active::after { + content: ''; + display: block; + height: 0px; + width: 0px; + position: absolute; + bottom: 0; + right: 0; + color:#fff; + /**对号大小*/ + font-size: 10px; + line-height: 8px; + border: 3px solid; + border-color: transparent #4884ff #4884ff transparent; + } - - //改变折扣单价 - function changeZkprice() { - var sum = 0; - $("#tbody").find("tr").each(function() { - var $tds = $(this).find("td"); - var count = $tds.eq(3).html(); - var zkprice = $tds.eq(4).find("input").eq(0).val(); - totalMoney = parseFloat(count) * parseFloat(zkprice); - $tds.eq(6).find("input").eq(0).val(totalMoney); - sum += totalMoney; - }); - $("#money").val(sum); - $("#zkTotal").html(sum); - $("#zkTotalInput").val(sum); - } + .el-dialog__body { + padding-top: 10px !important; + } + </style> +</head> +<div class="panel-body" id="app"> + <el-dialog title="还款" :visible.sync="dialogSettleVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false"> + <el-row type="flex" align="middle" style="padding: 0 0 10px 0;"> + <el-col :span="5" style="text-align: center;">还款金额</el-col> + <el-col :span="10" style="text-align: center; line-height: 50px;"><span style="color: red; font-size: 20px;">¥ {{order.arrears}}</span></el-col> + </el-row> - //计算实收 - function reckonTotal() { - var sum = 0; - $("#tbody").find("tr").each(function() { - var $tds = $(this).find("td"); - var count = $tds.eq(6).find("input").eq(0).val(); - sum += parseFloat(count) - }); - $("#money").val(sum); + <el-row type="flex" align="middle" style="padding: 10px 0;"> + <el-col :span="5" style="text-align: center;">收款方式</el-col> + <el-col class="paymethod" :span="15"> + <el-row> + <ul> + <span v-for="(item, index) in payMethods"> + <el-popover + :disabled="item.type != '储值卡'" + placement="bottom" + trigger="hover" + @hide="popoverHide(item)"> + <el-row style="text-align: center;"><span style="padding: 0 0 10px 0; display: block; font-size: 12px;">选择储值卡支付方式</span></el-row> + <el-tree :data="moneyCards" + show-checkbox + default-expand-all + node-key="id" + ref="tree" + check-strictly + highlight-current + @check="(click, checked,$item)=>{handleCheckChange(click, checked,$item)}" + :props="defaultProps"> + </el-tree> + <li :class="{active : item.isActive}" slot="reference" @click="payMethodSelect(item, index)"><div style=" height:30px; line-height: 30px; display: flex; align-items: center"><img style="width: 25px; height: 25px; align-items: center;" :src="item.img"><span style="margin-left: 5px;">{{item.value}}</span></div></li> + </el-popover> + </span> + </ul> + </el-row> + </el-col> + </el-row> - } + <el-row type="flex" align="middle" style="padding: 10px 0 50px 0;"> + <el-col :span="5" style="text-align: center;">支付金额</el-col> + <el-col :span="15"> + <el-row style="line-height: 50px;" v-for="(item, index) in payMoneys"> + <el-col :span="6" style="text-align: right; padding-right: 10px; font-size: 12px;">{{item.value}}</el-col> + <el-col :span="8"><el-input v-model="item.money"></el-input></el-col> + <el-col :span="6" style="margin-left: 10px;" v-if="item.type == '储值卡'">{{item.isGift == 1 ? '赠送余额' : '余额' }}:<span class="arrears">¥ {{item.balance}}</span></el-col> + </el-row> + </el-col> + </el-row> + + <el-row style="text-align: center; margin: 20px 0 10px 0"> + <el-checkbox v-model="printPaper">打印小票</el-checkbox> + </el-row> + + <el-row style="text-align: center; margin: 10px 0 0 0"> + <el-button type="primary" @click="submitBj">确认收款</el-button> + <el-button type="danger" @click="cancelSubmit">取消</el-button> + </el-row> + </el-dialog> +</div> + +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:inline="javascript"> + //<![CDATA[ + var vue = new Vue({ + el: '#app', + data : { + order : "", + payMethods: [{ + value: '现金支付', + img: '/images/pay/cash.png', + isActive: false, + type: '现金支付' + }, { + value: '微信', + img: '/images/pay/wechat.png', + isActive: false, + type: '微信' + }, { + value: '支付宝', + img: '/images/pay/zhifubao.png', + isActive: false, + type: '支付宝' + }, { + value: '银行卡', + img: '/images/pay/yinlian.png', + isActive: false, + type: '银行卡' + }, { + value: '团购', + img: '/images/pay/tuan.png', + isActive: false, + type: '团购' + }, { + value: '储值卡', + img: '/images/pay/card.png', + isActive: false, + type: '储值卡' + },], + moneyCards : [], + dialogSettleVisible : true, + defaultProps: { + children: 'children', + label: 'showLable' + }, + treeSelect : [], + payMoneys : [], + printPaper : false, + }, + created : function() { + this.order = /*[[${order}]]*/ + this.getVipMoneyCards(); + }, + methods : { + submitBj() { + let _this = this; + if (_this.payMoneys.length > 0) { + let flows = [] + var total = 0; + _this.payMoneys.forEach(item => { + let flow = {}; + flow.payMethod = item.type; + if (!item.money) { + this.$message.warning("请输入" + item.type + "的付款金额"); + return false; + } + flow.amount = item.money; + if (item.type == '储值卡'){ + flow.isGift = item.isGift; + flow.cardId = item.id; + } + total += item.money; + flows.push(flow) + }) + if (total > _this.order.arrears) { + this.$message.warning("输入付款总金额大于应还金额"); + return false; + } + _this.order.flows = flows; + } else { + this.$message.warning("请选择支付方式"); + return false; + } + + let url = basePath + "/admin/moneyCardUse/bj"; + + AjaxProxy.requst({ + app: _this, + data: _this.order, + url: url, + callback: function (data) { + if (_this.printPaper) { + _this.print(); + } + + if(parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.orderQuery(); + } + + _this.closeFrame(); + } + }); + }, + cancelSubmit() { + this.closeFrame(); + }, + print() { + let _this = this; + if (_this.order.id) { + layer.open({ + type: 2, + title: "打印订单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/order/printOrder?id=' + this.order.id], + cancel: function (index, layero) { + _this.closeFram(); + } + }); + } else { + this.$message.warning("请先挂单在打印"); + } + + + }, + getVipMoneyCards() { + let _this = this; + if (_this.order.vipId) { + AjaxProxy.requst({ + app: _this, + data: {vipId: _this.order.vipId}, + contentType: 'application/x-www-form-urlencoded', + url: basePath + '/admin/moneyCardUse/getUseMoneyCard', + callback: function (data) { + if (data.rows.length > 0) { + data.rows.forEach(function (item, index, input) { + item.showLable = item.cardName + "-余额:" + (item.realMoney) + item.uuid = MTools.uuid(); + if (item.giftMoney != 0) { + var children = []; + var gift = {}; + gift.id = item.id; + gift.giftMoney = item.giftMoney; + gift.showLable = item.cardName + '-赠送金额' + item.giftMoney; + gift.cardName = item.cardName; + gift.isGift = 1; + gift.uuid = MTools.uuid(); + children.push(gift); + item.children = children; + } + }); + _this.moneyCards = data.rows; + } + + } + }); + } + }, + payMethodSelect(item, index) { + let _this = this; + let payMoneys = _this.payMoneys; + if (item.type != '储值卡') { + this.$nextTick(function () { + if (item.isActive) { + Vue.set(item,'isActive',false); + var index = -1; + for (var i = 0; i < payMoneys.length; i++) { + let payMoney = payMoneys[i]; + if (payMoney.value == item.value) { + index = i; + break; + } + } + + if (index > -1) { + _this.payMoneys.splice(index, 1) + } + } else { + Vue.set(item,'isActive',true); + var hasAmount = 0; + for(var i = 0; i < payMoneys.length; i++) { + hasAmount += parseFloat(payMoneys[i].money); + } + if (_this.order.arrears - hasAmount > 0) { + Vue.set(item, 'money', _this.order.arrears - hasAmount); + } + _this.payMoneys.push(item); + } + }); + } + }, + popoverHide(item) { + if(this.treeSelect.length <= 0) { + Vue.set(item, 'isActive', false) + } else { + Vue.set(item, 'isActive', true) + } + }, + handleCheckChange(clickNode, checked) { + let _this = this; + + let nodes = checked.checkedNodes; + _this.treeSelect = nodes; + var index = -1; + // 判断点击节点是否在已展示支付方式中 + for(var i = 0; i < _this.payMoneys.length; i++) { + let node = _this.payMoneys[i]; + if (node.uuid === clickNode.uuid) { + index = i; + break; + } + } + + // 若点击节点在选中节点中,且已展示支付方式不存在,则添加 + if (nodes.indexOf(clickNode) > -1 && index === -1) { + var node = clickNode; + var item = {}; + if (node.isGift) { + item.value = node.cardName; + item.balance = node.giftMoney; + item.isGift = 'Y'; + } else { + item.value = node.cardName; + item.balance = node.realMoney; + item.isGift = 'N'; + } + item.type = '储值卡'; + item.id = node.id; + item.uuid = clickNode.uuid; + _this.payMoneys.push(item); + } + + // 若点击节点不存在选中节点中,且已展示支付方式中存在,则移除 + if (nodes.indexOf(clickNode) === -1 && index > -1) { + _this.payMoneys.splice(index, 1); + } + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + } + }); + //]]> </script> </body> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form-bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form-bak.html new file mode 100644 index 0000000..8f3bf53 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form-bak.html @@ -0,0 +1,239 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + + +<title></title> +</head> +<div class="ibox-content"> + + <form th:if="${obj ne null }" class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> + <input autocomplete="off" type="hidden" name="cardId" th:value="${obj.id }"> + <div class="form-group"> + <label class="col-sm-2 control-label">余额</label> + <div class="col-sm-4"> + <input autocomplete="off" type="text" class="form-control" th:value="${obj.realMoney}" + readonly="readonly"> + <div class="Validform_checktip"></div> + </div> + <label class="col-sm-2 control-label">充值时间</label> + <div class="col-sm-4"> + + <input autocomplete="off" name="dateTime" type="text" datatype="*" + class="form-control datetimepicker" nullmsg="充值时间不能为空" + style="display: inline;" + th:value="${#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd')}"> + <div class="Validform_checktip"></div> + </div> + + + </div> + <div class="form-group"> + + <label class="col-sm-2 control-label">充值金额</label> + <div class="col-sm-4"> + <input autocomplete="off" type="text" class="form-control" name="bjmoney" value="0" + onchange="changePayMoney('p0',this)" + datatype="*" nullmsg="充值金额不能为空"> + <div class="Validform_checktip"></div> + </div> + + <label class="col-sm-2 control-label">赠送金额</label> + <div class="col-sm-4"> + <input autocomplete="off" type="text" class="form-control" value="0" dataType="n1-8" + name="giftMoney" /> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group"> + + <label class="col-sm-2 control-label">赠送积分</label> + <div class="col-sm-4"> + <input autocomplete="off" type="text" class="form-control" value="0" dataType="n1-8" + name="jf" /> + <div class="Validform_checktip"></div> + </div> + + <label class="col-sm-2 control-label">下单顾问</label> + <div class="col-sm-4"> + <select class="autoFull select2 " style="width: 100%" + th:data-url="@{/admin/getShopStaffByRoleName?roleName=健康顾问}" + data-value="suId" data-filed="suName" + th:data-def="${session.userInfo.suId }" name="staffId"> + </select> + </div> + + </div> + <div class="row "> + <div class="col-sm-10 pd-20 col-sm-offset-1"> + <div class="panel-body"> + <table class="table table-condensed "> + <thead> + <tr> + <th>序号</th> + <th>商品名称</th> + <th>分配金额</th> + <th>美疗师业绩</th> + <th>操作</th> + </tr> + </thead> + <tbody id="tbody2"> + <tr id="p0"> + <td>1</td> + <td>会籍卡充值</td> + <td>0</td> + <td> + <table class="table table-condensed "> + <tr> + <td><select class="autoFull select2 input-sm" style="width: 80px;" + th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" + data-value="suId" data-filed="suName" + th:data-def="${session.userInfo.suId }" + name="achaeveList[0].beaultId"> + </select></td> + <td><input autocomplete="off" type="text" class="form-control input-sm" value="0" + style="width: 80px" name="achaeveList[0].t1"></td> + <td><button class="btn btn-danger btn-sm" + onclick="deleteBeaute(this)">删除</button></td> + </tr> + </table> + </td> + <td><a class="btn btn-default btn-sm" + onclick="addBeaute('p0','0')">添加</a></td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + + + <div class="form-group "> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="myForm.submit()" + class="btn btn-success radius">保存</a> + <button onclick="MTools.closeForm()" class="btn btn-danger radius" + type="button">取消</button> + </div> + </div> + </form> + </c:if> + <div th:if="${obj eq null }" class="text-center text-info"> + <h2>该会员没有可用的会员卡!</h2> + </div> + +</div> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> + $('.select2 ').select2(); + MTools.autoFullSelect(); + MTools.ininDatetimepicker({}); + var myForm = MForm.initForm({ + invokeUrl : basePath+"/admin/moneyCardUse/cz", + isAutoClose : false, + beforeSubmit : function() { + + //校验业绩 + var ifAchieveOk = true; + var achieveSum = 0; + $("#tbody2").children("tr").each( + function() { + var tr = $(this); + var pay = parseFloat(tr.find("td").eq(2).html()); + + tr.find("td").eq(3).find("table").find("tr").each( + function() { + var achieve = parseFloat($(this).find("td") + .eq(1).find("input").val()); + achieveSum += achieve; + }); + if (achieveSum > pay) { + ifAchieveOk = false; + } + }); + if(isNaN(achieveSum)){ + layer.msg("业绩金额格式错误", { + icon : 2 + }) + return false; + } + if (!ifAchieveOk) { + layer.msg("业绩金额不能大于支付金额", { + icon : 2 + }) + return false; + } + + }, + afterSubmit : function(loj) { + + layer.open({ + type: 2, + title: "打印订单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/order/printOrder?id=' + loj.getResult().mapInfo.orderId], + cancel: function (index, layer) { + if (parent.app) { + parent.app.vipInfoFn(); + } else { + parent.selectByKey(); + } + MTools.closeForm(); + } + }); + + }, + }); + + + + //添加一个美疗师 + function addBeaute(trId, itemIndex) { + if (!itemIndex) { + itemIndex = 0; + } + var id = MTools.randomStr(); + console.log(1); + var table = $("#" + trId).find("td").eq(3).find("table") + + var achieveIndex = $("#" + trId).find("td").eq(3).find("table").find( + "tr").length; + var html = '<tr> <td><select class="autoFull select2 input-sm" id="'+id+'" name="achaeveList['+achieveIndex+'].beaultId" ' + +'data-url="'+basePath+'/admin/getShopStaffByRoleName?roleName=美疗师" data-value="suId" data-filed="suName" data-def=""' + +'name="beatuyId"> </select></td> <td><input autocomplete="off" type="text" class="form-control input-sm" value="0" style="width: 80px" name="achaeveList['+achieveIndex+'].t1" ' + +'name="items['+achieveIndex+'].zkPrice" ></td> <td><button class="btn btn-danger btn-sm" onclick="deleteBeaute(this)" >删除</button></td> </tr>'; + $("#" + trId).find("td").eq(3).find("table").append(html); + $('#' + id).select2({ + 'width' : '80px' + }); + MTools.autoFullSelect({ + selecteder : '#' + id + }); + }; + //删除一个美疗师 + function deleteBeaute(node) { + $(node).closest("tr").remove(); + } + + //修改收款金额 + function changePayMoney(trId, node) { + console.log(trId, node); + $("#" + trId).find("td").eq(2).html($(node).val()); + }; +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html index 8ea22c7..174a386 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html @@ -10,226 +10,477 @@ <meta http-equiv="Cache-Control" content="no-siteapp" /> <LINK rel="Bookmark" href="../images/favicon.ico"> <!-- 本框架基本脚本和样式 --> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> - - +<script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> +<link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> +<link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> <title></title> + <style> + .paymethod ul { + padding: 0; + margin: 0; + height: 50px; + } + .paymethod ul li { + padding: 10px; + margin: 5px; + list-style:none; + float: left; + display: block; + cursor: pointer; + position: relative; + border: white 1px solid; + } + .paymethod ul li:hover { + border: #409EFF 1px solid; + } + .paymethod .active { + border: #409EFF 1px solid; + } + .paymethod .active::after { + content: ''; + display: block; + height: 0px; + width: 0px; + position: absolute; + bottom: 0; + right: 0; + color:#fff; + /**对号大小*/ + font-size: 10px; + line-height: 8px; + border: 3px solid; + border-color: transparent #4884ff #4884ff transparent; + } + + .el-dialog__body { + padding-top: 10px !important; + } + </style> </head> -<div class="ibox-content"> +<div class="panel-body" id="app"> + <el-dialog title="充值" :visible.sync="dialogSettleVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false"> + <el-row type="flex" align="middle" style="padding: 0 0 10px 0;"> + <el-col :span="5" style="text-align: center;">充值金额</el-col> + <el-col :span="10" style="text-align: center; line-height: 50px;"> + <el-input type="number" v-model="rechargeMoney" @change="changeRechargeMoney" placeholder="可充负数退款"></el-input> + </el-col> + </el-row> - <form th:if="${obj ne null }" class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <input autocomplete="off" type="hidden" name="cardId" th:value="${obj.id }"> - <div class="form-group"> - <label class="col-sm-2 control-label">余额</label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" th:value="${obj.realMoney}" - readonly="readonly"> - <div class="Validform_checktip"></div> - </div> - <label class="col-sm-2 control-label">充值时间</label> - <div class="col-sm-4"> + <el-row type="flex" align="middle" style="padding: 10px 0;"> + <el-col :span="5" style="text-align: center;">收款方式</el-col> + <el-col class="paymethod" :span="15"> + <el-row> + <ul> + <span v-for="(item, index) in payMethods"> + <li :class="{active : item.isActive}" @click="payMethodSelect(item, index)"><div style=" height:30px; line-height: 30px; display: flex; align-items: center"><img style="width: 25px; height: 25px; align-items: center;" :src="item.img"><span style="margin-left: 5px;">{{item.value}}</span></div></li> + </span> + </ul> + </el-row> + </el-col> + </el-row> - <input autocomplete="off" name="dateTime" type="text" datatype="*" - class="form-control datetimepicker" nullmsg="充值时间不能为空" - style="display: inline;" - th:value="${#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd')}"> - <div class="Validform_checktip"></div> - </div> + <el-row type="flex" align="middle" style="padding: 10px 0 50px 0;"> + <el-col :span="5" style="text-align: center;">支付金额</el-col> + <el-col :span="15"> + <el-row style="line-height: 50px;" v-for="(item, index) in payMoneys"> + <el-col :span="6" style="text-align: right; padding-right: 10px; font-size: 12px;">{{item.value}}</el-col> + <el-col :span="8"><el-input v-model="item.money"></el-input></el-col> + </el-row> + </el-col> + </el-row> + <el-row type="flex" align="middle" style="padding: 10px 0 50px 0;"> + <el-col :span="5" style="text-align: center;">业绩</el-col> + <el-col :span="16"> + <el-table class="mt-20" + :border="true" + :data="achieveList" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + label="业绩类型" width="150"> + <template slot-scope="scope"> + <el-select v-model="scope.row.achieveType" @change="calculationAchieve" placeholder="请选择业绩类型"> + <el-option + v-for="item in achieveTypeList" + :key="item.value" + :label="item.value" + :value="item.value"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + label="业绩" width="100"> + <template slot-scope="scope"> + <el-input @input="checkAchieveMoney" v-model="scope.row.goodsCash"></el-input> + </template> + </el-table-column> + <el-table-column + label="提成"> + <template slot-scope="scope"> + <el-input v-model="scope.row.commission"></el-input> + </template> + </el-table-column> + <el-table-column + label="员工" width="130"> + <template slot-scope="scope"> + <el-select v-model="scope.row.saleId" placeholder="请选择员工"> + <el-option + v-for="item in userList" + :key="item.suId" + :label="item.suName" + :value="item.suId"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + width="150" + label="操作"> + <template slot-scope="scope"> + <el-button type="primary" v-if="scope.row.isShare" + size="mini" + @click="delAchieve(scope.$index, scope.row)">删除 + </el-button> + <el-tooltip content="分享业绩" placement="top"> + <el-button @click="shareAchieve(scope.$index, scope.row)" icon="el-icon-share" + size="mini" type="primary"></el-button> + </el-tooltip> + </template> + </el-table-column> + </el-table> + </el-col> + </el-row> - </div> - <div class="form-group"> + <el-row style="text-align: center; margin: 20px 0 10px 0"> + <el-checkbox v-model="printPaper">打印小票</el-checkbox> + </el-row> - <label class="col-sm-2 control-label">充值金额</label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" name="bjmoney" value="0" - onchange="changePayMoney('p0',this)" - datatype="*" nullmsg="充值金额不能为空"> - <div class="Validform_checktip"></div> - </div> - - <label class="col-sm-2 control-label">赠送金额</label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" value="0" dataType="n1-8" - name="giftMoney" /> - <div class="Validform_checktip"></div> - </div> - </div> - <div class="form-group"> - - <label class="col-sm-2 control-label">赠送积分</label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" value="0" dataType="n1-8" - name="jf" /> - <div class="Validform_checktip"></div> - </div> - - <label class="col-sm-2 control-label">下单顾问</label> - <div class="col-sm-4"> - <select class="autoFull select2 " style="width: 100%" - th:data-url="@{/admin/getShopStaffByRoleName?roleName=健康顾问}" - data-value="suId" data-filed="suName" - th:data-def="${session.userInfo.suId }" name="staffId"> - </select> - </div> - - </div> - <div class="row "> - <div class="col-sm-10 pd-20 col-sm-offset-1"> - <div class="panel-body"> - <table class="table table-condensed "> - <thead> - <tr> - <th>序号</th> - <th>商品名称</th> - <th>分配金额</th> - <th>美疗师业绩</th> - <th>操作</th> - </tr> - </thead> - <tbody id="tbody2"> - <tr id="p0"> - <td>1</td> - <td>会籍卡充值</td> - <td>0</td> - <td> - <table class="table table-condensed "> - <tr> - <td><select class="autoFull select2 input-sm" style="width: 80px;" - th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" - data-value="suId" data-filed="suName" - th:data-def="${session.userInfo.suId }" - name="achaeveList[0].beaultId"> - </select></td> - <td><input autocomplete="off" type="text" class="form-control input-sm" value="0" - style="width: 80px" name="achaeveList[0].t1"></td> - <td><button class="btn btn-danger btn-sm" - onclick="deleteBeaute(this)">删除</button></td> - </tr> - </table> - </td> - <td><a class="btn btn-default btn-sm" - onclick="addBeaute('p0','0')">添加</a></td> - </tr> - </tbody> - </table> - </div> - </div> - </div> - - - <div class="form-group "> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="myForm.submit()" - class="btn btn-success radius">保存</a> - <button onclick="MTools.closeForm()" class="btn btn-danger radius" - type="button">取消</button> - </div> - </div> - </form> - </c:if> - <div th:if="${obj eq null }" class="text-center text-info"> - <h2>该会员没有可用的会员卡!</h2> - </div> - + <el-row style="text-align: center; margin: 10px 0 0 0"> + <el-button type="primary" @click="submitRecharge">确认收款</el-button> + <el-button type="danger" @click="cancelSubmit">取消</el-button> + </el-row> + </el-dialog> </div> -<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> - $('.select2 ').select2(); - MTools.autoFullSelect(); - MTools.ininDatetimepicker({}); - var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/moneyCardUse/cz", - isAutoClose : false, - beforeSubmit : function() { +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:inline="javascript"> + var vipId = $.query.get("vipId"); - //校验业绩 - var ifAchieveOk = true; - var achieveSum = 0; - $("#tbody2").children("tr").each( - function() { - var tr = $(this); - var pay = parseFloat(tr.find("td").eq(2).html()); + //<![CDATA[ + var vue = new Vue({ + el: '#app', + data : { + cardInfo : "", + loginUser : "", + rechargeMoney : 0, + achieveTypeList : [], + payMethods: [{ + value: '现金支付', + img: '/images/pay/cash.png', + isActive: false, + type: '现金支付' + }, { + value: '微信', + img: '/images/pay/wechat.png', + isActive: false, + type: '微信' + }, { + value: '支付宝', + img: '/images/pay/zhifubao.png', + isActive: false, + type: '支付宝' + }, { + value: '银行卡', + img: '/images/pay/yinlian.png', + isActive: false, + type: '银行卡' + }, { + value: '团购', + img: '/images/pay/tuan.png', + isActive: false, + type: '团购' + }, ], + dialogSettleVisible : true, + defaultProps: { + children: 'children', + label: 'showLable' + }, + achieveList : [], + userList: [], + treeSelect : [], + payMoneys : [], + order:{}, + printPaper : false, + }, + created : function() { + let _this = this; + this.cardInfo = /*[[${obj}]]*/ - tr.find("td").eq(3).find("table").find("tr").each( - function() { - var achieve = parseFloat($(this).find("td") - .eq(1).find("input").val()); - achieveSum += achieve; - }); - if (achieveSum > pay) { - ifAchieveOk = false; + //获取用户列表 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopAll', + callback: function (data) { + _this.userList = data.rows; + } + }); + + + // 业绩类型 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX', + callback: function (data) { + _this.achieveTypeList = data.rows; + + //获取登录用户信息 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/getLoginUser', + callback: function (data) { + _this.loginUser = data.mapInfo.user; + + _this.achieveList.push({ + saleId: _this.loginUser.suId, + goodsCash: 0, + achieveType : _this.achieveTypeList[0].value, + commission : 0, + isShare: false + }); } }); - if(isNaN(achieveSum)){ - layer.msg("业绩金额格式错误", { - icon : 2 - }) - return false; - } - if (!ifAchieveOk) { - layer.msg("业绩金额不能大于支付金额", { - icon : 2 - }) - return false; - } - - }, - afterSubmit : function(loj) { - - layer.open({ - type: 2, - title: "打印订单", - area: ['250px', '550px'], - maxmin: true, - content: [basePath + '/admin/redirect/hive/beautySalon/print-order?id=' + loj.getResult().mapInfo.orderId], - cancel: function (index, layer) { - parent.selectByKey(); - MTools.closeForm(); } }); }, - }); + methods : { + //修改充值金额同步修改业绩 + changeRechargeMoney(){ + let aMoeny=(this.rechargeMoney/this.achieveList.length).toFixed(2); + this.achieveList.forEach(item=>{ + item.goodsCash=aMoeny; + }); + }, + submitRecharge() { + let _this = this; + + if (!_this.rechargeMoney) { + this.$message.warning("请输入充值金额"); + return; + } + + if (_this.payMoneys.length > 0) { + let flows = [] + var total = 0; + _this.payMoneys.forEach(item => { + let flow = {}; + flow.payMethod = item.type; + if (!item.money) { + this.$message.warning("请输入" + item.type + "的付款金额"); + return false; + } + flow.amount = parseFloat(item.money); + total += parseFloat(item.money); + flows.push(flow); + }) + debugger + if (total != _this.rechargeMoney) { + this.$message.warning("付款金额应等于充值金额"); + return false; + } + _this.cardInfo.flows = flows; + } else { + this.$message.warning("请选择支付方式"); + return false; + } + + let achaeveList = []; + _this.achieveList.forEach(achieve => { + let achieveNew = { + beaultId: achieve.saleId, + goodsCash: achieve.goodsCash, + achieveType: achieve.achieveType, + projPercentage: achieve.commission, + payMethod:"现金", + }; + achaeveList.push(achieveNew); + }) + _this.cardInfo.bjmoney = _this.rechargeMoney; + _this.cardInfo.achaeveList = achaeveList; + if (_this.checkAchieveMoney()) { + let url = basePath + "/admin/moneyCardUse/cz"; + + console.log(_this.cardInfo); + AjaxProxy.requst({ + app: _this, + data: _this.cardInfo, + url: url, + callback: function (data) { + _this.order.id = data.mapInfo.orderId; + + if (_this.printPaper) { + _this.$message.success(data.info); + _this.print(); + } else { + _this.$message.success({ + message : data.info, + duration : 1000, + onClose() { + _this.closeFrame(); + } + }); + } + + if(parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.vipInfoFn(); + } + + // _this.closeFrame(); + } + }); + } + }, + cancelSubmit() { + this.closeFrame(); + }, + print() { + let _this = this; + if (_this.order.id) { + layer.open({ + type: 2, + title: "打印订单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/order/printOrder?id=' + this.order.id], + cancel: function (index, layero) { + _this.closeFrame(); + } + }); + } else { + this.$message.warning("请先挂单在打印"); + } + }, + payMethodSelect(item, index) { + let _this = this; + let payMoneys = _this.payMoneys; + let rechargeMoney = _this.rechargeMoney; + if (!rechargeMoney) { + this.$message.warning("请输入充值金额"); + return; + } - //添加一个美疗师 - function addBeaute(trId, itemIndex) { - if (!itemIndex) { - itemIndex = 0; + + if (item.type != '储值卡') { + this.$nextTick(function () { + if (item.isActive) { + Vue.set(item,'isActive',false); + var index = -1; + for (var i = 0; i < payMoneys.length; i++) { + let payMoney = payMoneys[i]; + if (payMoney.value == item.value) { + index = i; + break; + } + } + + if (index > -1) { + _this.payMoneys.splice(index, 1) + } + } else { + Vue.set(item,'isActive',true); + var hasAmount = 0; + for(var i = 0; i < payMoneys.length; i++) { + hasAmount += parseFloat(payMoneys[i].money); + } + Vue.set(item, 'money', _this.rechargeMoney - hasAmount); + _this.payMoneys.push(item); + } + }); + } + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + shareAchieve(index, row) { + row2 = JSON.parse(JSON.stringify(row)); + row2.isShare = true; + this.achieveList.push(row2); + this.calculationAchieve(); + }, + calculationAchieve() { + let _this = this; + let jsqMap = {}; + this.achieveList.forEach(achieve=>{ + key=achieve.achieveType; + if(!jsqMap[key]) { + jsqMap[key]=1; + } else { + jsqMap[key]++; + } + }); + this.achieveList.forEach(achieve=>{ + key = achieve.achieveType; + achieve.goodsCash=(_this.rechargeMoney/jsqMap[key]).toFixed(2); + }); + }, + //删除业绩 + delAchieve(index, row) { + this.achieveList.splice(index, 1); + this.calculationAchieve(); + }, + checkAchieveMoney(){ + console.log("校验业绩是否大于订单收款金额"); + let _this = this; + let jsqMap={}; + let isOk=true; + console.log(this.achieveList); + let rechargeMoney=parseFloat(_this.rechargeMoney); + for(let i=0 ; i< this.achieveList.length; i++){ + let achieve=this.achieveList[i]; + + if(!isNaN(achieve.goodsCash) ){ + key=achieve.achieveType; + if(!jsqMap[key]){ + jsqMap[key]=parseFloat(achieve.goodsCash); + }else{ + jsqMap[key]=jsqMap[key]+parseFloat(achieve.goodsCash); + } + }else{ + this.$message.error("业绩分配金额请填写数字"); + isOk=false; + return; + } + }; + for(money in jsqMap ){ + if(money > rechargeMoney) { + this.$message.error("业绩分配金额大于支付金额"); + isOk = false; + return; + } + } + + + console.log("isOk",isOk); + return isOk; + }, } - var id = MTools.randomStr(); - console.log(1); - var table = $("#" + trId).find("td").eq(3).find("table") - - var achieveIndex = $("#" + trId).find("td").eq(3).find("table").find( - "tr").length; - var html = '<tr> <td><select class="autoFull select2 input-sm" id="'+id+'" name="achaeveList['+achieveIndex+'].beaultId" ' - +'data-url="'+basePath+'/admin/getShopStaffByRoleName?roleName=美疗师" data-value="suId" data-filed="suName" data-def=""' - +'name="beatuyId"> </select></td> <td><input autocomplete="off" type="text" class="form-control input-sm" value="0" style="width: 80px" name="achaeveList['+achieveIndex+'].t1" ' - +'name="items['+achieveIndex+'].zkPrice" ></td> <td><button class="btn btn-danger btn-sm" onclick="deleteBeaute(this)" >删除</button></td> </tr>'; - $("#" + trId).find("td").eq(3).find("table").append(html); - $('#' + id).select2({ - 'width' : '80px' - }); - MTools.autoFullSelect({ - selecteder : '#' + id - }); - }; - //删除一个美疗师 - function deleteBeaute(node) { - $(node).closest("tr").remove(); - } - - //修改收款金额 - function changePayMoney(trId, node) { - console.log(trId, node); - $("#" + trId).find("td").eq(2).html($(node).val()); - }; + }); + //]]> </script> </body> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/index.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/index.html index a33c214..05ace41 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/index.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/index.html @@ -10,7 +10,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="renderer" content="webkit"> <meta http-equiv="Cache-Control" content="no-siteapp" /> -<title>HIVE蜜米管理系统</title> +<title>讯聪管理系统</title> <link rel="shortcut icon" href="${path }/resource/images/mm.ico"> <!--[if lt IE 8]> <meta http-equiv="refresh" content="0;ie.html" /> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html index b1890a5..fb3829a 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html @@ -75,10 +75,51 @@ .arrears { color: #E6A23C; } + + .paymethod ul { + padding: 0; + margin: 0; + height: 50px; + } + .paymethod ul li { + padding: 10px; + margin: 5px; + list-style:none; + float: left; + display: block; + cursor: pointer; + position: relative; + border: white 1px solid; + } + .paymethod ul li:hover { + border: #409EFF 1px solid; + } + .paymethod .active { + border: #409EFF 1px solid; + } + .paymethod .active::after { + content: ''; + display: block; + height: 0px; + width: 0px; + position: absolute; + bottom: 0; + right: 0; + color:#fff; + /**对号大小*/ + font-size: 10px; + line-height: 8px; + border: 3px solid; + border-color: transparent #4884ff #4884ff transparent; + } + + .el-dialog__body { + padding-top: 10px !important; + } </style> </head> -<body> -<div class="ibox-content" id="app" v-cloak> +<body > +<div id="app" v-cloak> <el-row> @@ -134,6 +175,15 @@ </el-col> </el-row> <el-row class="vertical "> + <el-select v-model="goodsType" placeholder="商品类型" style="width: 120px" > + <el-option + v-for="item in goodsTypeList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> <el-input class="searchInput" @input="searchGoods()" v-model="queryKey" placeholder="搜索添加产品"></el-input> <el-button @click="searchGoods()" type="primary">搜索</el-button> @@ -196,6 +246,18 @@ </template> </el-table-column> </el-table> + + <el-row style="text-align: center; margin-top: 10px;"> + <el-pagination + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="page.pageSize" + layout="total, prev, pager, next, jumper" + :total="page.total"> + </el-pagination> + </el-row> <el-row class="btn-box"> <el-button size="mini" type="danger" @click="closeXm()">关闭</el-button> <el-button size="mini" type="primary" @click="chouseGoods()">确认</el-button> @@ -246,52 +308,53 @@ <el-input @change="calculationTotal" v-model="scope.row.zkPrice"></el-input> </template> </el-table-column> + <el-table-column - label="应付"> + label="小计"> <template slot-scope="scope"> - {{scope.row.zkPrice * scope.row.count }} + {{(scope.row.zkPrice * scope.row.count).toFixed(2) }} </template> </el-table-column> - <el-table-column - label="实付"> - <template slot-scope="scope"> - <el-input @change="calculationTotal(1)" v-model="scope.row.payMoney"></el-input> - </template> - </el-table-column> +<!-- <el-table-column--> +<!-- label="实付">--> +<!-- <template slot-scope="scope">--> +<!-- <el-input @change="calculationTotal(1)" v-model="scope.row.payMoney"></el-input>--> +<!-- </template>--> +<!-- </el-table-column>--> - <el-table-column - label="支付方式" - width="130"> - <template slot-scope="scope"> - <el-select @change="changePayMethod(scope.row)" v-model="scope.row.payMethod" - placeholder="请选择支付方式"> - <el-option - v-for="item in payMethods" - :key="item.value" - :label="item.label" - :value="item.value" - :disabled="item.disabled"> - </el-option> - </el-select> - </template> - </el-table-column> +<!-- <el-table-column--> +<!-- label="支付方式"--> +<!-- width="130">--> +<!-- <template slot-scope="scope">--> +<!-- <el-select @change="changePayMethod(scope.row)" v-model="scope.row.payMethod"--> +<!-- placeholder="请选择支付方式">--> +<!-- <el-option--> +<!-- v-for="item in payMethods"--> +<!-- :key="item.value"--> +<!-- :label="item.label"--> +<!-- :value="item.value"--> +<!-- :disabled="item.disabled">--> +<!-- </el-option>--> +<!-- </el-select>--> +<!-- </template>--> +<!-- </el-table-column>--> - <el-table-column - label="会员卡"> - <template slot-scope="scope"> - <el-select :disabled="scope.row.payMethod!='会员卡'" v-model="scope.row.payMethodDetail" - placeholder="请选择支付卡"> - <el-option - v-for="item in moneyCards" - :key="item.id" - :label="item.showLable" - :value="item.id"> - </el-option> - </el-select> - </template> - </el-table-column> +<!-- <el-table-column--> +<!-- label="储值卡">--> +<!-- <template slot-scope="scope">--> +<!-- <el-select :disabled="scope.row.payMethod!='储值卡'" v-model="scope.row.payMethodDetail"--> +<!-- placeholder="请选择支付卡">--> +<!-- <el-option--> +<!-- v-for="item in moneyCards"--> +<!-- :key="item.id"--> +<!-- :label="item.showLable"--> +<!-- :value="item.id">--> +<!-- </el-option>--> +<!-- </el-select>--> +<!-- </template>--> +<!-- </el-table-column>--> <el-table-column prop="address" label="操作"> @@ -305,7 +368,7 @@ </el-table> </el-row> - <el-row class="mt-20 vertical"> + <el-row class=" vertical"> <el-col :span="10" class="money-box"> <div> <ul> @@ -313,8 +376,9 @@ <li>订单总金额:{{order.total}}</li> - <li v-if="order.arrears>0">订单欠款:<span class="arrears">{{order.arrears}}</span></li> - <li v-if="order.arrears<0">找零:<span class="arrears">{{order.arrears}}</span></li> + <li>整单折扣:<span class="arrears" v-if="order.zkTotal != null">{{(order.total - order.zkTotal).toFixed(2)}}</span></li> +<!-- <li v-if="order.arrears>0">订单欠款:<span class="arrears">{{order.arrears}}</span></li>--> +<!-- <li v-if="order.arrears<0">找零:<span class="arrears">{{order.arrears}}</span></li>--> </ul> </div> <div class="money"> @@ -327,19 +391,20 @@ <el-button type="primary" @click="submitOrder(2)">挂单</el-button> <el-button type="primary" @click="print()">打印</el-button> <el-button type="primary" @click="drawer = true">业绩设置</el-button> - <el-button type="success" @click="confirmSubmit()" class="bigbtn"> 结算</el-button> + <!-- <el-button type="success" @click="confirmSubmit()" class="bigbtn"> 结算</el-button>--> + <el-button type="success" @click="openPayMoney" class="bigbtn">收款 ¥{{order.payMoney}}</el-button> </el-col> </el-row> </el-col> </el-row> - + <!-- 业绩设置 --> <el-drawer title="业绩设置" :visible.sync="drawer" :direction="direction" - size="50%" + size="90%" > <el-row> <el-col :span="24"> @@ -372,13 +437,49 @@ label="收款"> </el-table-column> <el-table-column - label="业绩"> + label="支付方式" + width="130"> <template slot-scope="scope"> - <el-input v-model="scope.row.achieveMoney"></el-input> + <el-select v-model="scope.row.payMethod" + placeholder="请选择支付方式"> + <el-option + v-for="item in itemSimplePayMethods" + :key="item.value" + :label="item.label" + :value="item.value" + :disabled="item.disabled"> + </el-option> + </el-select> </template> </el-table-column> <el-table-column - label="员工"> + label="业绩类型" width="150"> + <template slot-scope="scope"> + <el-select v-model="scope.row.achieveType" @change="calculationAchieve" placeholder="请选择业绩类型"> + <el-option + v-for="item in achieveTypeList" + :key="item.value" + :label="item.value" + :value="item.value"> + </el-option> + </el-select> + </template> + </el-table-column> + + <el-table-column + label="业绩" > + <template slot-scope="scope"> + <el-input @input="checkAchieveMoney" v-model="scope.row.goodsCash"></el-input> + </template> + </el-table-column> + <el-table-column width="100" + label="提成"> + <template slot-scope="scope"> + <el-input v-model="scope.row.commission"></el-input> + </template> + </el-table-column> + <el-table-column + label="员工" width="130"> <template slot-scope="scope"> <el-select v-model="scope.row.saleId" placeholder="请选择员工"> <el-option @@ -391,14 +492,14 @@ </template> </el-table-column> <el-table-column - width="200" + width="150" label="操作"> <template slot-scope="scope"> <el-button type="primary" v-if="scope.row.isShare" size="mini" @click="delAchieve(scope.$index, scope.row)">删除 </el-button> - <el-tooltip content="分享业绩" placement="top"> + <el-tooltip content="分享业绩" placement="top" v-if="!scope.row.isShare"> <el-button @click="shareAchieve(scope.$index, scope.row)" icon="el-icon-share" size="mini" type="primary"></el-button> </el-tooltip> @@ -411,6 +512,62 @@ </el-row> </el-drawer> + <!-- 收款 --> + <el-dialog title="收款" :visible.sync="dialogSettleVisible"> + <el-row type="flex" align="middle" style="padding: 0 0 10px 0;"> + <el-col :span="5" style="text-align: center;">应收</el-col> + <el-col :span="10" style="text-align: center; line-height: 50px;"><span style="color: red; font-size: 20px;">¥ {{order.payMoney}}</span></el-col> + </el-row> + + <el-row type="flex" align="middle" style="padding: 10px 0;"> + <el-col :span="5" style="text-align: center;">收款方式</el-col> + <el-col class="paymethod" :span="18"> + <el-row> + <ul> + <span v-for="(item, index) in payMethods"> + <el-popover + :disabled="item.type != '储值卡'" + placement="bottom" + trigger="hover" + @hide="popoverHide(item)"> + <el-row style="text-align: center;"><span style="padding: 0 0 10px 0; display: block; font-size: 12px;">选择储值卡支付方式</span></el-row> + <el-tree :data="moneyCards" + show-checkbox + default-expand-all + node-key="id" + ref="tree" + check-strictly + highlight-current + @check="(click, checked,$item)=>{handleCheckChange(click, checked,$item)}" + :props="defaultProps"> + </el-tree> + <li :class="{active : item.isActive}" slot="reference" @click="payMethodSelect(item, index)"><div style=" height:30px; line-height: 30px; display: flex; align-items: center"><img style="width: 25px; height: 25px; align-items: center;" :src="item.img"><span style="margin-left: 5px;">{{item.value}}</span></div></li> + </el-popover> + </span> + </ul> + </el-row> + </el-col> + </el-row> + + <el-row type="flex" align="middle" style="padding: 10px 0 50px 0;"> + <el-col :span="5" style="text-align: center;">支付金额</el-col> + <el-col :span="15"> + <el-row style="line-height: 50px;" v-for="(item, index) in payMoneys"> + <el-col :span="6" style="text-align: right; padding-right: 10px; font-size: 12px;">{{item.value}}</el-col> + <el-col :span="8"><el-input v-model="item.money"></el-input></el-col> + <el-col :span="8" style="margin-left: 10px;" v-if="item.type == '储值卡'">{{item.isGift == 1 ? '赠送余额' : '余额' }}:<span class="arrears">¥ {{item.balance}}</span></el-col> + </el-row> + </el-col> + </el-row> + + <el-row style="text-align: center; margin: 20px 0 10px 0"> + <el-checkbox v-model="printPaper">打印小票</el-checkbox> + </el-row> + + <el-row style="text-align: center; margin: 10px 0 0 0"> + <el-button type="primary" @click="confirmSubmit">确认收款</el-button> + </el-row> + </el-dialog> </div> </body> @@ -434,12 +591,14 @@ var app = new Vue({ el: '#app', data: { - + goodsType:"", + goodsTypeList:[{value:"",label:"全部"},{value:"套餐",label:"套餐"},{value:"项目",label:"项目"},{value:"充值卡",label:"充值卡"}], //业绩设置框 drawer: false, direction: 'rtl', //当前登录用户 loginUser: {}, + staffUser:{}, //业绩用户列表 userList: [], order: { @@ -455,34 +614,63 @@ vipList: [], currentVipInfo: {}, vipLoading: false, - payMethods: [{ + itemSimplePayMethods:[{ value: '现金', - label: '现金' + label:'现金', + },{ + value: '划扣', + label:'划扣', + }], + payMethods: [{ + value: '现金支付', + img: '/images/pay/cash.png', + isActive: false, + type: '现金支付' }, { value: '微信', - label: '微信' + img: '/images/pay/wechat.png', + isActive: false, + type: '微信' }, { value: '支付宝', - label: '支付宝' + img: '/images/pay/zhifubao.png', + isActive: false, + type: '支付宝' }, { value: '银行卡', - label: '银行卡' + img: '/images/pay/yinlian.png', + isActive: false, + type: '银行卡' }, { - value: '美团', - label: '美团' + value: '团购', + img: '/images/pay/tuan.png', + isActive: false, + type: '团购' }, { - value: '会员卡', - label: '会员卡', - disabled: true, + value: '储值卡', + img: '/images/pay/card.png', + isActive: false, + type: '储值卡' + },{ + value: '欠款', + img: '/images/pay/qian.png', + isActive: false, + type: '欠款' },], achieveList: [], + //业绩岗位 + achievePostList : [ + ], + //业绩类型 + achieveTypeList : [ + ], //会员可用的充值卡 moneyCards: [], //门店信息 shopInfo: {}, - tableHeight: 500, + tableHeight: 'calc(100vh - 300px)', /*****搜索表格数据*********/ //搜索关键词 @@ -493,8 +681,21 @@ searchTableData: [], //表格加载效果 loading: false, + page : { + currentPage : 1, + pageSize : 10, + total : 0 + }, /******搜索表格数据END********/ + dialogSettleVisible : false, + defaultProps: { + children: 'children', + label: 'showLable' + }, + treeSelect : [], + payMoneys : [], + printPaper : true, }, @@ -504,78 +705,103 @@ created: function () { let _this = this; - //获取登录用户信息 - AjaxProxy.requst({ - app: _this, - url: basePath + '/admin/getLoginUser', - callback: function (data) { - _this.loginUser = data.mapInfo.user; - - if (id) { - //加载订单信息 - AjaxProxy.requst({ - app: _this, - url: basePath + '/admin/order/findOrderById/' + id, - callback: function (data) { - _this.order = data.rows[0]; - //修改支付金额 - _this.changeVip(_this.order.vipId); - let items = _this.order.items; - let orderPayMoney = 0; - //设置欠款订单设置欠款金额等于支付金额,非欠款订单设置折扣金额等于支付金额 - items.forEach(item => { - if (item.arrears > 0) { - item.payMoney = item.arrears; - } else { - item.payMoney = item.zkPrice; - } - orderPayMoney += item.payMoney; - - //业绩设置 - _this.achieveList.push({ - orderItem: item, - staff: _this.loginUser, - saleId: _this.loginUser.suId, - achieveMoney: item.payMoney, - isShare: false, - }); - }); - _this.order.payMoney = orderPayMoney; - } - }); - - } else { - //获取门店信息 - AjaxProxy.requst({ - app: _this, - url: basePath + '/admin/shopInfo/findUserShop', - callback: function (data) { - _this.order.shopName = data.rows[0].shopName; - - } - }); - } - - - } - }); - + _this.initMethod() if (vipId) { _this.changeVip(vipId); } - //获取用户列表 + //获取业绩用户列表 AjaxProxy.requst({ app: _this, - url: basePath + '/admin/getShopStaffByRoleName?roleName=美疗师', + url: basePath + '/admin/shopAll', callback: function (data) { _this.userList = data.rows; } }); + // 业绩类型 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX', + callback: function (data) { + _this.achieveTypeList = data.rows; + } + }); + }, methods: { + initMethod() { + let _this = this; + + //获取登录用户信息 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/getLoginUser', + callback: function (data) { + _this.loginUser = data.mapInfo.user; + + if (id) { + //加载订单信息 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/order/findOrderById/' + id, + callback: function (data) { + _this.order = data.rows[0]; + //修改支付金额 + _this.changeVip(_this.order.vipId); + + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/getUserById?id='+_this.order.staffId, + callback: function (data) { + _this.staffUser = data.mapInfo.user; + + let items = _this.order.items; + let orderPayMoney = 0; + //设置欠款订单设置欠款金额等于支付金额,非欠款订单设置折扣金额等于支付金额 + items.forEach(item => { + if (item.arrears > 0) { + item.payMoney = item.arrears; + } else { + item.payMoney = item.zkPrice; + } + orderPayMoney += item.payMoney; + item.uuid = MTools.uuid(); + //业绩设置 + _this.achieveList.push({ + orderItem: item, + staff: _this.staffUser, + saleId: _this.staffUser.suId, + goodsCash: item.payMoney, + commission : 0, + achieveType : _this.achieveTypeList[0].value, + isShare: false, + payMethod:"现金", + }); + }); + _this.order.payMoney = orderPayMoney; + } + }); + } + }); + + } else { + //获取门店信息 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopInfo/findUserShop', + callback: function (data) { + _this.order.shopName = data.rows[0].shopName; + + } + }); + } + + + } + }); + }, //取消订单 closeFram() { @@ -584,7 +810,7 @@ changePayMethod(item) { console.log("changePayMethod", item); - if (item.payMethod != '会员卡') { + if (item.payMethod != '储值卡') { item.payMethodDetail = ''; } }, @@ -598,17 +824,25 @@ contentType: 'application/x-www-form-urlencoded', url: basePath + '/admin/moneyCardUse/getUseMoneyCard', callback: function (data) { - console.log(_this.moneyCards) if (data.rows.length > 0) { data.rows.forEach(function (item, index, input) { - item.showLable = item.cardName + "-余额:" + (item.realMoney + item.giftMoney) + item.showLable = item.cardName + "-余额:" + (item.realMoney) + item.uuid = MTools.uuid(); + if (item.giftMoney != 0) { + var children = []; + var gift = {}; + gift.id = item.id; + gift.giftMoney = item.giftMoney; + gift.showLable = item.cardName + '-赠送金额' + item.giftMoney; + gift.cardName = item.cardName; + gift.isGift = 1; + gift.uuid = MTools.uuid(); + children.push(gift); + item.children = children; + } }); + console.log(data.rows) _this.moneyCards = data.rows; - //启用会员卡支付方式 - _this.payMethods[5].disabled = false; - } else { - //禁用会员卡支付方式 - _this.payMethods[5].disabled = true; } } @@ -627,7 +861,7 @@ * @param{type} 1 = 购买 2=赠送 * */ pushToSelectGoods(goods, type) { - + let _this=this; //判断是否被选中 let selected = false; this.order.items.forEach(item => { @@ -648,7 +882,6 @@ item.price = goods.sealPice; item.goodsId = goods.id; item.isFree = '否'; - item.payMethod = '现金'; if (type == BUY_TYPE_NOT_FREE) { //购买 item.zkPrice = goods.sealPice; @@ -661,15 +894,31 @@ } item.count = 1; - - //加入业绩 - this.achieveList.push({ - orderItem: item, - staff: this.loginUser, - saleId: this.loginUser.suId, - achieveMoney: item.payMoney, - isShare: false, - }); + if (this.staffUser.suId) { + //加入业绩 + this.achieveList.push({ + orderItem: item, + staff: this.staffUser, + saleId: this.staffUser.suId, + goodsCash: item.payMoney, + achieveType : _this.achieveTypeList[0].value, + commission: 0, + isShare: false, + payMethod:'现金', + }); + } else { + //加入业绩 + this.achieveList.push({ + orderItem: item, + staff: this.loginUser, + saleId: _this.loginUser.suUserType === 'admin' ? '' : this.loginUser.suId, + goodsCash: item.payMoney, + achieveType : _this.achieveTypeList[0].value, + commission: 0, + isShare: false, + payMethod:'现金', + }); + } this.order.items.push(item); } @@ -698,25 +947,36 @@ callback: function (data) { let order = data.rows[0]; console.log("order", order); - _this.order.zkTotal = order.zkTotal; - _this.order.total = order.total; + _this.order.zkTotal = order.zkTotal.toFixed(2); + _this.order.total = order.total.toFixed(2); //支付金额计算 _this.order.items.forEach(item => { let count = parseFloat(item.count); let zkPrice = parseFloat(item.zkPrice); - if (optionType != 1) { + // if (optionType != 1) { //直接修改支付金额不重置支付金额 - item.payMoney = zkPrice * count; - } + item.payMoney = (zkPrice * count).toFixed(2); + // } _this.order.payMoney += parseFloat(item.payMoney); + + //重新计算业绩金额 + _this.achieveList.forEach(achieve=>{ + if(achieve.orderItem.uuid==item.uuid){ + achieve.orderItem.payMoney=item.payMoney; + } + }) + _this.calculationAchieve(); + + }); + _this.order.payMoney = _this.order.payMoney.toFixed(2); //计算欠款 - _this.order.arrears = _this.order.zkTotal - _this.order.payMoney; - if (_this.order.arrears < 0) { - _this.$message.error("支付金额不能大于应收金额"); - } + // _this.order.arrears = _this.order.zkTotal - _this.order.payMoney; + // if (_this.order.arrears < 0) { + // _this.$message.error("支付金额不能大于应收金额"); + // } } }) } @@ -747,49 +1007,86 @@ */ submitOrder(submitType) { - - - if (this.checkSubmitOrder()) { let _this = this; + //是否全部为储值卡支付 + let isCardPay=true; + + if(submitType == 1) { + //校验支付方式 - //检查支付方式 - let hasPayMethod=true; - _this.order.items.forEach(item=>{ - if(!item.payMethod){ - hasPayMethod=false; - return; + + if (_this.payMoneys.length > 0) { + let flows = [] + var total = 0; + let isPayMethodOk=true; + for(let i=0; i<_this.payMoneys.length;i++){ + let item = _this.payMoneys[i]; + let flow = {}; + flow.payMethod = item.type; + if (!item.money) { + _this.$message.warning("请输入" + item.type + "的付款金额"); + isPayMethodOk=false; + return false; + } + flow.amount = parseFloat(item.money); + if (item.type == '储值卡'){ + flow.isGift = item.isGift; + flow.cardId = item.id; + }else{ + isCardPay=false; + } + total += parseFloat(item.money); + flows.push(flow) + } + if (total != _this.order.payMoney) { + this.$message.warning("输入付款总金额与应付金额不符"); + return false; + } + _this.order.flows = flows; + + + + + } else { + this.$message.warning("请选择支付方式"); + return false; } - }); - if(!hasPayMethod){ - this.$message.warning("请选择支付方式"); - return false; } - - - - - + console.log("isCardPay",isCardPay); //匹配业绩 + _this.order.items.forEach(item=>{ + item.achieveList = []; + }) _this.achieveList.forEach(achieve => { for (let i = 0; i < _this.order.items.length; i++) { let item = _this.order.items[i]; - item.achieveList = []; if (item.uuid == achieve.orderItem.uuid) { + + let payMethod=achieve.payMethod; + if(isCardPay){ + //如果是储值卡支付,则业绩自动切换到划扣金额 + payMethod="划扣"; + } let achieveNew = { + uuid:item.uuid, beaultId: achieve.saleId, - t1: achieve.achieveMoney + projPercentage: achieve.commission, + achieveType: achieve.achieveType, + goodsCash: achieve.goodsCash, + payMethod: payMethod, }; - item.achieveList.push(achieveNew); + item.achieveList.push(achieveNew); break; } } }) + console.log(_this.order); //校验业绩金额 - if (_this.checkAchieve()) { + if (_this.checkAchieveMoney()) { let url = basePath + "/admin/order/payOrder"; if (submitType == 2) { url = basePath + "/admin/order/saveOrder"; @@ -805,20 +1102,40 @@ _this.order.orderNo = order.orderNo; //结算打印提示 if (submitType == 1) { - _this.$confirm('结算成功,是否立刻打印小票?', '提示', { - confirmButtonText: '打印', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + if (_this.printPaper) { + _this.$message.success(data.info); _this.print(); + } else { + _this.$message.success({ + message : data.info, + duration : 1000, + onClose() { + _this.closeFram(); + } + }); + } - }).catch(() => { - _this.closeFram(); - }); + // _this.$confirm('结算成功,是否立刻打印小票?', '提示', { + // confirmButtonText: '打印', + // cancelButtonText: '取消', + // type: 'warning' + // }).then(() => { + // _this.print(); + // + // }).catch(() => { + // _this.closeFram(); + // }); } else { _this.$message.success(data.info); } - parent.myGrid.serchData(); + + if(parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.orderQuery(); + } } }); } @@ -826,29 +1143,7 @@ } }, - /** - * 校验订单业绩设置是否合理 - */ - checkAchieve() { - /* - //TODO 前端展示不检测,因为考虑到会员卡支付问题 - let _this = this; - for (let i = 0; i < _this.order.items.length; i++) { - if (_this.achieveList.length > 0) { - let item = _this.order.items[i]; - let sum = 0; - item.achieveList.forEach(achieve => { - console.log(sum, achieve); - sum += parseFloat(achieve.t1); - }); - if (sum > item.payMoney) { - this.$message.warning("业绩金额不能大于支付金额【" + item.shoppingGoods.name + "】"); - return false; - } - } - }*/ - return true; - }, + /** * 检查订单是否能够提交 @@ -870,10 +1165,10 @@ this.$message.warning("折扣单价填写不正确"); return false; } - if (!(MTools.isRealNum(item.payMoney) && item.payMoney >= 0)) { - this.$message.warning("实付金额填写不正确"); - return false; - } + // if (!(MTools.isRealNum(item.payMoney) && item.payMoney >= 0)) { + // this.$message.warning("实付金额填写不正确"); + // return false; + // } }) } else { this.$message.warning("请选择要购买的产品"); @@ -888,7 +1183,7 @@ */ chouseGoods() { let _this = this; - this.multipleSelection.forEach(item => { + _this.multipleSelection.forEach(item => { _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE); }); this.closeXm(); @@ -913,6 +1208,9 @@ } }); this.achieveList = achieveListNew; + this.order.zkTotal = 0; + this.order.total = 0; + this.order.payMoney = 0; this.calculationTotal(); }, @@ -922,6 +1220,9 @@ */ searchGoods() { let _this = this; + var currentPage = this.page.currentPage; + var pageSize = this.page.pageSize; + var offset = (currentPage - 1) * pageSize; if (this.queryKey && this.queryKey.trim().length > 0) { this.showSearchTable = true; this.loading = true; @@ -929,10 +1230,11 @@ app: _this, contentType: 'application/x-www-form-urlencoded', //TODO 优化下拉加载 - data: {name: _this.queryKey, limit: 10000}, + data: {name: _this.queryKey,goodType:_this.goodsType , limit: pageSize, offset : offset}, url: basePath + "/admin/shoppinggoods/showList", callback: function (data) { _this.searchTableData = data.rows; + _this.page.total = data.total; _this.loading = false; } }); @@ -940,8 +1242,14 @@ this.showSearchTable = false; } }, - - + handleSizeChange(val) { + this.page.pageSize = val; + this.searchGoods(); + }, + handleCurrentChange(val) { + this.page.currentPage = val; + this.searchGoods(); + }, remoteMethod(query) { if (query !== '') { this.vipLoading = true; @@ -989,11 +1297,61 @@ shareAchieve(index, row) { row2 = JSON.parse(JSON.stringify(row)); row2.isShare = true; - this.achieveList.push(row2); + this.achieveList.splice(index+1,0,row2); + //this.achieveList=; + this.calculationAchieve(); }, + + //业绩均分订单金额 + calculationAchieve(){ + console.log("计算业绩"); + let jsqMap={}; + this.achieveList.forEach(achieve=>{ + key=achieve.achieveType+achieve.orderItem.uuid; + if(!jsqMap[key]){ + jsqMap[key]=1; + }else{ + jsqMap[key]++; + } + }); + this.achieveList.forEach(achieve=>{ + key=achieve.achieveType+achieve.orderItem.uuid; + achieve.goodsCash=(achieve.orderItem.payMoney/jsqMap[key]).toFixed(2); + }); + }, + //校验业绩是否大于订单收款金额 + checkAchieveMoney(){ + console.log("校验业绩是否大于订单收款金额"); + let jsqMap={}; + let isOk=true; + for(let i=0 ; i< this.achieveList.length; i++){ + let achieve=this.achieveList[i]; + if(!isNaN(achieve.goodsCash) ){ + key=achieve.achieveType+achieve.orderItem.uuid; + if(!jsqMap[key]){ + jsqMap[key]=parseFloat(achieve.goodsCash); + }else{ + jsqMap[key]=jsqMap[key]+parseFloat(achieve.goodsCash); + } + if(jsqMap[key]>achieve.orderItem.payMoney) { + this.$message.error("【"+achieve.orderItem.shoppingGoods.name + "】业绩分配金额大于支付金额"); + isOk = false; + return; + } + }else{ + this.$message.error("【"+achieve.orderItem.shoppingGoods.name + "】业绩分配金额请填写数字"); + isOk=false; + return; + } + }; + console.log("isOk",isOk); + return isOk; + }, + //删除业绩 delAchieve(index, row) { this.achieveList.splice(index, 1); + this.calculationAchieve(); }, print() { let _this = this; @@ -1003,7 +1361,7 @@ title: "打印订单", area: ['250px', '550px'], maxmin: true, - content: [basePath + '/admin/redirect/hive/beautySalon/print-order?id=' + this.order.id], + content: [basePath + '/admin/order/printOrder?id=' + this.order.id], cancel: function (index, layero) { _this.closeFram(); } @@ -1014,6 +1372,98 @@ }, + payMethodSelect(item, index) { + let _this = this; + let payMoneys = _this.payMoneys; + if (item.type != '储值卡') { + this.$nextTick(function () { + if (item.isActive) { + Vue.set(item,'isActive',false); + var index = -1; + for (var i = 0; i < payMoneys.length; i++) { + let payMoney = payMoneys[i]; + if (payMoney.value == item.value) { + index = i; + break; + } + } + + if (index > -1) { + _this.payMoneys.splice(index, 1) + } + } else { + Vue.set(item,'isActive',true); + var hasAmount = 0; + for(var i = 0; i < payMoneys.length; i++) { + hasAmount += parseFloat(payMoneys[i].money); + } + if (_this.order.payMoney - hasAmount > 0) { + Vue.set(item, 'money', _this.order.payMoney - hasAmount); + } + _this.payMoneys.push(item); + } + }); + } + }, + popoverHide(item) { + if(this.treeSelect.length <= 0) { + Vue.set(item, 'isActive', false) + } else { + Vue.set(item, 'isActive', true) + } + }, + handleCheckChange(clickNode, checked) { + let _this = this; + + let nodes = checked.checkedNodes; + _this.treeSelect = nodes; + var index = -1; + // 判断点击节点是否在已展示支付方式中 + for(var i = 0; i < _this.payMoneys.length; i++) { + let node = _this.payMoneys[i]; + if (node.uuid === clickNode.uuid) { + index = i; + break; + } + } + + // 若点击节点在选中节点中,且已展示支付方式不存在,则添加 + if (nodes.indexOf(clickNode) > -1 && index === -1) { + var node = clickNode; + var item = {}; + if (node.isGift) { + item.value = node.cardName; + item.balance = node.giftMoney; + item.isGift = 'Y'; + } else { + item.value = node.cardName; + item.balance = node.realMoney; + item.isGift = 'N'; + } + item.type = '储值卡'; + item.id = node.id; + item.uuid = clickNode.uuid; + _this.payMoneys.push(item); + } + + // 若点击节点不存在选中节点中,且已展示支付方式中存在,则移除 + if (nodes.indexOf(clickNode) === -1 && index > -1) { + _this.payMoneys.splice(index, 1); + } + }, + openPayMoney() { + let _this = this; + if (!_this.order.items.length > 0) { + this.$message.warning("请选择要购买的产品"); + return false; + } + + if(!this.checkAchieveMoney()){ + return ; + } + + _this.dialogSettleVisible = true; + } } }) diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak.html new file mode 100644 index 0000000..17a9a67 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak.html @@ -0,0 +1,140 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + <title></title> +</head> + +<div class="panel-body"> + <div class="form-group"> + <label class="col-sm-2 control-label">订单号</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.orderNo}"></span> + </div> + + <label class="col-sm-2 control-label">订单总价</label> + <div class="col-sm-4"> + <span class="form-control-static" id="total" th:text="${order.total}"></span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">客户编号</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.vipNo}"></span> + </div> + <label class="col-sm-2 control-label">客户姓名</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.vipName}"></span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">现金支付金额</label> + <div class="col-sm-4"> + <span class="form-control-static">[[${order.cashPay}]]</span> + </div> + <label class="col-sm-2 control-label">卡支付金额</label> + <div class="col-sm-4"> + <span class="form-control-static" id="total">[[${order.cardPay}]]</span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">欠款</label> + <div class="col-sm-4"> + <span class="form-control-static">[[${order.arrears}]]</span> + </div> + <label class="col-sm-2 control-label">折后价</label> + <div class="col-sm-4"> + <span class="form-control-static" id="zkTotal" th:text="${order.zkTotal}"></span> + </div> + </div> + <br> + <div class="form-group"> + <label class="col-sm-2 control-label">顾问姓名</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.staffName}"></span> + </div> + <label class="col-sm-2 control-label">备注</label> + <div class="col-sm-4"> + <span class="form-control-static" th:text="${order.remark}"></span> + </div> + </div> + +</div> + + +<div class="col-sm-12 form-group"> + <div class="panel-body"> + <table class="table table-striped table-condensed table-hover"> + <thead> + <tr> + <th>序号</th> + <th>商品名称</th> + <th>单价</th> + <th>购买数量</th> + <th>折扣单价</th> + <th>卡付款</th> + <th>现金付款</th> + <th>欠款</th> + </tr> + </thead> + <tbody id="tbody"> + <tr th:each="item,count:${order.items }"> + <td th:text="${count.index}+1"></td> + <td><span th:text=" ${item.shoppingGoods.name }"></span> + + <span th:if="${item.isFree eq '是' }" th:text="赠"></span> + </td> + <td th:text="${item.price }"></td> + <td th:text="${item.count}"></td> + <td th:text="${item.zkPrice}"></td> + <td>[[${item.cardPay}]]</td> + <td>[[${item.cashPay}]]</td> + <td>[[${item.arrears}]]</td> + </tr> + </tbody> + </table> + </div> + <div class="form-group "> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> + <button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">取消</button> + </div> + </div> + </div> +</div> +<input autocomplete="off" type="hidden" id="orderId" th:value="${order.id}"> +</body> + + +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript"> + + function print() { + var id=$("#orderId").val(); + layer.open({ + type: 2, + title: "打印订单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/order/printOrder?id=' + id] + }); + }; + + +</script> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak2.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak2.html new file mode 100644 index 0000000..51becc3 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak2.html @@ -0,0 +1,170 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <script type="text/javascript" th:src="@{/js/function/meiduCommon.js}"></script> + <title></title> + <style> + .ibox-content { + background-color: rgba(240, 242, 245, 1); + } + </style> +</head> +<div class="ibox-content" id="app"> + <el-container> + <el-header style="height: 210px; background-color: white; margin: 15px;"> + <el-row style="line-height: 60px; padding-top: 20px;"> + <el-col :span="1" style="font-size: 40px; color:#409EFF;"> + <i class="el-icon-s-order" type="primary"></i> + </el-col> + <el-col :span="10"> + <h1 style="line-height: 60px; margin: 0 0;">订单号:{{order.orderNo}}</h1> + </el-col> + <el-col :span="5" style="float: right; margin-right: 10px;"> + <el-button type="info" @click="printf">打印</el-button> + <el-button type="danger" @click="toBack">返回</el-button> + </el-col> + </el-row> + <el-row class="order-info" type="flex" justify="space-around" style="height: 150px; padding: 30px 30px;"> + <el-col :span="5"> + <p>顾问姓名:{{order.staffName}}</p> + <p>会员姓名:{{order.vipName}}</p> + <p>会员编号:{{order.vipNo}}</p> + </el-col> + <el-col :span="5"> + <p>卡支付:{{order.cardPay}}</p> + <p>现金支付:{{order.cashPay}}</p> + <p>备注:{{order.remark}}</p> + </el-col> + <el-col :span="10"> + <el-col :span="6"> + <p>欠款总额</p> + <h2>¥ {{order.arrears}}</h2> + </el-col> + <el-col :span="6"> + <p>折后总额</p> + <h2>¥ {{order.zkTotal}}</h2> + </el-col> + <el-col :span="6"> + <p>订单总额</p> + <h2>¥ {{order.total}}</h2> + </el-col> + </el-col> + </el-row> + </el-header> + <el-main style="background-color: white; margin: 15px; padding: 20px 30px;"> + <el-tabs v-model="activeName" @tab-click="handleClick"> + <el-tab-pane label="商品" name="goods"> + <el-table :data="orderData" + style="width: 100%"> + <el-table-column + prop="shoppingGoods.name" + label="商品名称" + width="300"> + </el-table-column> + <el-table-column + prop="price" + label="单价" + width="80"> + </el-table-column> + <el-table-column + prop="count" + label="购买数量"> + </el-table-column> + <el-table-column + prop="zkPrice" + label="折后金额"> + </el-table-column> + <el-table-column + prop="cardPay" + label="卡付款"> + </el-table-column> + <el-table-column + prop="cashPay" + label="现金付款"> + </el-table-column> + <el-table-column + prop="arrears" + label="欠款"> + </el-table-column> + </el-table> + </el-tab-pane> + <el-tab-pane label="业绩" name="yj">业绩</el-tab-pane> + </el-tabs> + </el-main> + </el-container> +</div> +</body> + +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:inline="javascript"> + //<![CDATA[ + var app = new Vue({ + el : "#app", + data : { + activeName : "goods", + order : "", + orderItems : "", + cards : "", + orderData : [] + }, + created : function() { + this.order = /*[[${order}]]*/ + this.orderItems = /*[[${orderItems}]]*/ + this.cards = /*[[${cards}]]*/ + + this.orderData = this.order.items; + }, + methods : { + handleClick(tab, event) { + }, + printf() { + var id = 1; + layer.open({ + type: 2, + title: "打印服务单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/projService/printOrder?id=' + id] + }); + }, + toBack() { + MTools.closeForm(); + }, + } + }); + //]]> + function print() { + var id=$("#orderId").val(); + layer.open({ + type: 2, + title: "打印订单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/order/printOrder?id=' + id] + }); + }; + + +</script> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html index 69a0a76..2e3cc8b 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html @@ -10,131 +10,1007 @@ <meta http-equiv="Cache-Control" content="no-siteapp"/> <LINK rel="Bookmark" href="../images/favicon.ico"> <!-- 本框架基本脚本和样式 --> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + + <script type="text/javascript" th:src="@{/js/function/meiduCommon.js}"></script> <title></title> + <style> + .ibox-content { + background-color: rgba(240, 242, 245, 1); + } + .aside label { + width: 100%; + margin: 5px 0 !important; + } + .arrears { + color: #E6A23C; + } + + .paymethod ul { + padding: 0; + margin: 0; + height: 50px; + } + .paymethod ul li { + padding: 10px; + margin: 5px; + list-style:none; + float: left; + display: block; + cursor: pointer; + position: relative; + border: white 1px solid; + } + .paymethod ul li:hover { + border: #409EFF 1px solid; + } + .paymethod .active { + border: #409EFF 1px solid; + } + .paymethod .active::after { + content: ''; + display: block; + height: 0px; + width: 0px; + position: absolute; + bottom: 0; + right: 0; + color:#fff; + /**对号大小*/ + font-size: 10px; + line-height: 8px; + border: 3px solid; + border-color: transparent #4884ff #4884ff transparent; + } + + .el-dialog__body { + padding-top: 10px !important; + } + </style> </head> +<div class="ibox-content" id="app"> + <el-container> + <el-aside class="aside" style="width: 300px; background-color: white; padding: 10px;"> + <el-row style="border-bottom: #E4E7ED 1px solid;"> + <el-col :span="20" style="padding: 10px;"> + <el-row type="flex" align="middle"> + <el-col :span="7"> + <el-avatar :size="60" :src="circleUrl"></el-avatar> + </el-col> + <el-col :span="15" style="margin-left: 10px;"> + <label>{{vipInfo.vipName}}({{vipInfo.vipLevel == null ? '' : vipInfo.vipLevel.levelName}})</label> + <label>{{vipInfo.vipNo}}</label> + </el-col> + </el-row> + <el-row style="line-height: 20px;"> + <label>订单号: <span>{{order.orderNo}}</span></label> + <label>下单顾问: <span>{{order.staffName}}</span></label> + <label>消费门店: <span>{{order.shopShortName}}</span></label> + <label>订单时间: <span>{{order.orderTime}}</span></label> + <label>备 注: <span>{{order.remark}}</span></label> + </el-row> + </el-col> + </el-row> + <el-row style="padding: 10px; border-bottom: #E4E7ED 1px solid;"> + <el-col :span="24"> + <el-row> + <el-col :span="6" style="text-align: right;"> + <label>总金额</label> + <label>整单折扣</label> + <label style="font-size: 14px;">应收金额</label> + <label>欠款</label> + <label>已还</label> + <label v-if="order.refund != 0">退款</label> + </el-col> + <el-col :span="14" style="text-align: right;"> + <label>¥ {{order.total}}</label> + <!-- 退款订单不能显示为负数 --> + <label>¥ {{(order.zkTotal - order.total>0?order.zkTotal - order.total:0).toFixed(2)}}</label> + <label>¥ {{order.zkTotal}}</label> + <label>¥ {{order.arrears}}</label> + <label>¥ {{order.repay}}</label> + <label v-if="order.refund != 0">¥ {{order.refund}}</label> + </el-col> + </el-row> + </el-col> + </el-row> + <el-row style="padding: 10px; border-bottom: #E4E7ED 1px solid;"> + <el-col :span="24"> + <el-row> + <h3>收款明细</h3> + </el-row> + <el-row> + <el-col :span="6" style="text-align: right;"> + <label v-for="(item, index) in payMethodItems">{{item.payMethod}}</label> + </el-col> + <el-col :span="14" style="text-align: right;"> + <label v-for="(item, index) in payMethodItems">¥ {{item.amount}}</label> + </el-col> + </el-row> + </el-col> + </el-row> + <el-row type="flex" justify="center" style="margin: 20px;"> + <el-button size="medium" type="primary" @click="printf">打印</el-button> + </el-row> + </el-aside> + <el-main style="background-color: white; margin-right: 15px; margin-left: 15px; padding: 20px 30px;"> + <el-tabs v-model="activeName" @tab-click="handleClick"> + <el-tab-pane label="订单明细" name="first"> + <el-row> + <el-button size="mini" type="primary" @click="openPayMoneyDialog" v-if="isRefund">提交退款<span v-if="totalRefund"> ¥ {{totalRefund}}</span></el-button> + <el-button size="mini" type="danger" @click="isRefund = false" v-if="isRefund">取消</el-button> + <el-button size="mini" type="primary" @click="isRefund = true" v-if="order.statu == '已付款' && !isRefund">退款</el-button> + </el-row> + <el-row v-show="!isRefund"> + <el-table + :data="orderItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="shoppingGoods.code" + label="产品编号" + width="100"> + </el-table-column> + <el-table-column + prop="shoppingGoods.name" + label="产品名称" + width="280"> + </el-table-column> + <el-table-column + prop="shoppingGoods.goodType" + label="产品类型"> + </el-table-column> + <el-table-column + prop="price" + label="单价"> + </el-table-column> + <el-table-column + prop="count" + label="数量"> + </el-table-column> + <el-table-column + prop="zkPrice" + label="折扣单价"> + </el-table-column> + <el-table-column label="小计" :formatter="calOrderTotalFormatter"> + </el-table-column> + <el-table-column label="支付方式" prop="payMethod"> + </el-table-column> + </el-table> + </el-row> + <el-row v-show="isRefund"> + <el-table + :data="orderItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="shoppingGoods.code" + label="产品编号" + width="100"> + </el-table-column> + <el-table-column + prop="shoppingGoods.name" + label="产品名称" + width="280"> + </el-table-column> + <el-table-column + prop="shoppingGoods.goodType" + label="产品类型"> + </el-table-column> + <el-table-column + prop="zkPrice" + label="单价"> + </el-table-column> + <el-table-column + prop="count" + label="可退数量"> + </el-table-column> + <el-table-column label="退款单价"> + <template slot-scope="scope"> + <el-input @change="calRefund" v-model="scope.row.refundPrice" v-if="scope.row.count > 0"></el-input> + </template> + </el-table-column> + <el-table-column label="退款数量"> + <template slot-scope="scope"> + <el-input @change="calRefund" v-model.number="scope.row.refundCount" v-if="scope.row.count > 0"></el-input> + </template> + </el-table-column> + <el-table-column label="是否退库存" align="center"> + <template slot-scope="scope"> + <el-checkbox v-model="scope.row.returnStore" v-if="scope.row.type == '家居产品' && scope.row.count > 0"></el-checkbox> + </template> + </el-table-column> + </el-table> -<div class="panel-body"> - <div class="form-group"> - <label class="col-sm-2 control-label">订单号</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.orderNo}"></span> - </div> + <el-checkbox v-model="isReturnAchieve">退业绩</el-checkbox> - <label class="col-sm-2 control-label">订单总价</label> - <div class="col-sm-4"> - <span class="form-control-static" id="total" th:text="${order.total}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">客户编号</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.vipNo}"></span> - </div> - <label class="col-sm-2 control-label">客户姓名</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.vipName}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">现金支付金额</label> - <div class="col-sm-4"> - <span class="form-control-static">[[${order.cashPay}]]</span> - </div> - <label class="col-sm-2 control-label">卡支付金额</label> - <div class="col-sm-4"> - <span class="form-control-static" id="total">[[${order.cardPay}]]</span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">欠款</label> - <div class="col-sm-4"> - <span class="form-control-static">[[${order.arrears}]]</span> - </div> - <label class="col-sm-2 control-label">折后价</label> - <div class="col-sm-4"> - <span class="form-control-static" id="zkTotal" th:text="${order.zkTotal}"></span> - </div> - </div> - <br> - <div class="form-group"> - <label class="col-sm-2 control-label">顾问姓名</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.staffName}"></span> - </div> - <label class="col-sm-2 control-label">备注</label> - <div class="col-sm-4"> - <span class="form-control-static" th:text="${order.remark}"></span> - </div> - </div> + <el-row v-if="isReturnAchieve"> + <el-table + :data="achieveItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="goodsNo" + label="产品编号" + width="100"> + </el-table-column> + <el-table-column + prop="goodsName" + label="产品名称" + width="200"> + </el-table-column> + <el-table-column + prop="zkTotal" + label="收款"> + </el-table-column> + <el-table-column + prop="payMethod" + label="支付方式"> + </el-table-column> + <el-table-column + prop="achieveType" + label="业绩类型"> + </el-table-column> + <el-table-column + prop="goodsCash" + label="原业绩"> + </el-table-column> + <el-table-column + prop="projPercentage" + label="原提成"> + </el-table-column> + <el-table-column label="业绩"> + <template slot-scope="scope"> + <el-input v-model="scope.row.returnAchieve" v-if="scope.row.zkTotal != 0"></el-input> + </template> + </el-table-column> + <el-table-column label="提成"> + <template slot-scope="scope"> + <el-input v-model="scope.row.returnCommission" v-if="scope.row.zkTotal != 0"></el-input> + </template> + </el-table-column> + <el-table-column + label="员工" prop="meiliao"> + </el-table-column> + </el-table> + </el-row> + </el-row> + </el-tab-pane> + <el-tab-pane label="业绩设置" name="second"> + <el-row> + <el-button size="mini" type="primary" @click="saveAchieve" v-if="order.statu == '已付款'">保存</el-button> + </el-row> + <el-table + :data="achieveItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="goodsNo" + label="产品编号" + width="180"> + </el-table-column> + <el-table-column + prop="goodsName" + label="产品名称" + width="180"> + </el-table-column> + <el-table-column + prop="zkTotal" + label="收款"> + </el-table-column> + <el-table-column + label="支付方式" + width="130"> + <template slot-scope="scope"> + <el-select v-model="scope.row.payMethod" + placeholder="请选择支付方式"> + <el-option + v-for="item in itemSimplePayMethods" + :key="item.value" + :label="item.label" + :value="item.value" + :disabled="item.disabled"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + prop="t3" + label="业绩类型"> + <template slot-scope="scope"> + <el-select v-model="scope.row.achieveType" placeholder="请选择业绩类型"> + <el-option + v-for="item in achieveTypeList" + :key="item.value" + :label="item.value" + :value="item.value"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + prop="achieve" + label="业绩"> + <template slot-scope="scope"> + <el-input @input="checkAchieveMoney" v-model="scope.row.goodsCash"></el-input> + </template> + </el-table-column> + <el-table-column + prop="projPercentage" + label="提成"> + <template slot-scope="scope"> + <el-input v-model="scope.row.projPercentage"></el-input> + </template> + </el-table-column> + <el-table-column + label="员工"> + <template slot-scope="scope"> + <el-select v-model="scope.row.beaultId" placeholder="请选择员工"> + <el-option + v-for="item in userList" + :key="item.suId" + :label="item.suName" + :value="item.suId"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="primary" v-if="scope.row.isShare" + size="mini" + @click="delAchieve(scope.$index, scope.row)">删除 + </el-button> + <el-tooltip content="分享业绩" placement="top" v-if="!scope.row.isShare"> + <el-button @click="shareAchieve(scope.$index, scope.row)" icon="el-icon-share" + size="mini" type="primary"></el-button> + </el-tooltip> + </template> + </el-table-column> + </el-table> + </el-tab-pane> + <el-tab-pane label="交易流水" name="third"> + <el-table + :data="flowItems" + style="width: 100%"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="orderNo" + label="订单号" + width="180"> + </el-table-column> + <el-table-column + prop="flowContent" + label="交易内容" + width="300"> + </el-table-column> + <el-table-column + prop="createTime" + label="交易时间"> + </el-table-column> + <el-table-column + prop="flowType" + label="交易类型"> + </el-table-column> + <el-table-column + prop="amount" + label="交易金额"> + </el-table-column> + <el-table-column + prop="payMethod" + label="支付方式"> + </el-table-column> + <el-table-column + prop="cardName" + label="储值卡名称"> + </el-table-column> + <el-table-column + prop="flowNo" + label="流水号"> + </el-table-column> + </el-table> + </el-tab-pane> + </el-tabs> + </el-main> + </el-container> + + <el-dialog title="退款" :visible.sync="dialogSettleVisible"> + <el-row type="flex" align="middle" style="padding: 0 0 10px 0;"> + <el-col :span="5" style="text-align: center;">退款金额</el-col> + <el-col :span="10" style="text-align: center; line-height: 50px;"><span style="color: red; font-size: 20px;">¥ {{refundMoney}}</span></el-col> + </el-row> + + <el-row type="flex" align="middle" style="padding: 10px 0;"> + <el-col :span="5" style="text-align: center;">退款方式</el-col> + <el-col class="paymethod" :span="18"> + <el-row> + <ul> + <span v-for="(item, index) in payMethods"> + <el-popover + :disabled="item.type != '储值卡'" + placement="bottom" + trigger="hover" + @hide="popoverHide(item)"> + <el-row style="text-align: center;"><span style="padding: 0 0 10px 0; display: block; font-size: 12px;">选择储值卡支付方式</span></el-row> + <el-tree :data="moneyCards" + show-checkbox + default-expand-all + node-key="id" + ref="tree" + check-strictly + highlight-current + @check="(click, checked,$item)=>{handleCheckChange(click, checked,$item)}" + :props="defaultProps"> + </el-tree> + <li :class="{active : item.isActive}" slot="reference" @click="payMethodSelect(item, index)"><div style=" height:30px; line-height: 30px; display: flex; align-items: center"><img style="width: 25px; height: 25px; align-items: center;" :src="item.img"><span style="margin-left: 5px;">{{item.value}}</span></div></li> + </el-popover> + </span> + </ul> + </el-row> + </el-col> + </el-row> + + <el-row type="flex" align="middle" style="padding: 10px 0 50px 0;"> + <el-col :span="5" style="text-align: center;">退款方式</el-col> + <el-col :span="15"> + <el-row style="line-height: 50px;" v-for="(item, index) in payMoneys"> + <el-col :span="6" style="text-align: right; padding-right: 10px; font-size: 12px;">{{item.value}}</el-col> + <el-col :span="8"><el-input v-model="item.money"></el-input></el-col> + <el-col :span="6" style="margin-left: 10px;" v-if="item.type == '储值卡'">{{item.isGift == 1 ? '赠送余额' : '余额' }}:<span class="arrears">¥ {{item.balance}}</span></el-col> + </el-row> + </el-col> + </el-row> + + <!-- <el-row style="text-align: center; margin: 20px 0 10px 0">--> + <!-- <el-checkbox v-model="printPaper">打印小票</el-checkbox>--> + <!-- </el-row>--> + + <el-row style="text-align: center; margin: 10px 0 0 0"> + <el-button type="primary" @click="confirmSubmit">确认收款</el-button> + </el-row> + </el-dialog> </div> - - -<div class="col-sm-12 form-group"> - <div class="panel-body"> - <table class="table table-striped table-condensed table-hover"> - <thead> - <tr> - <th>序号</th> - <th>商品名称</th> - <th>单价</th> - <th>购买数量</th> - <th>折扣单价</th> - <th>卡付款</th> - <th>现金付款</th> - <th>欠款</th> - </tr> - </thead> - <tbody id="tbody"> - <tr th:each="item,count:${order.items }"> - <td th:text="${count.index}+1"></td> - <td><span th:text=" ${item.shoppingGoods.name }"></span> - - <span th:if="${item.isFree eq '是' }" th:text="赠"></span> - </td> - <td th:text="${item.price }"></td> - <td th:text="${item.count}"></td> - <td th:text="${item.zkPrice}"></td> - <td>[[${item.cardPay}]]</td> - <td>[[${item.cashPay}]]</td> - <td>[[${item.arrears}]]</td> - </tr> - </tbody> - </table> - </div> - <div class="form-group "> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> - <button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">取消</button> - </div> - </div> - </div> -</div> -<input autocomplete="off" type="hidden" id="orderId" th:value="${order.id}"> </body> - +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> -<script type="text/javascript"> +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:inline="javascript"> + //<![CDATA[ + var app = new Vue({ + el : "#app", + data : { + orderParam : "", + vipInfo : "", + order : "", + activeName : "first", + circleUrl : "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png", + userList : [], + achieveTypeList : [], + orderItems : [], + achieveItems : [], + flowItems : [], + payMethodItems : [], + isRefund : false, + isReturnAchieve : false, + totalRefund : "", + itemSimplePayMethods:[{ + value: '现金', + label:'现金', + },{ + value: '划扣', + label:'划扣', + }], + payMethods: [{ + value: '现金支付', + img: '/images/pay/cash.png', + isActive: false, + type: '现金支付' + }, { + value: '微信', + img: '/images/pay/wechat.png', + isActive: false, + type: '微信' + }, { + value: '支付宝', + img: '/images/pay/zhifubao.png', + isActive: false, + type: '支付宝' + }, { + value: '银行卡', + img: '/images/pay/yinlian.png', + isActive: false, + type: '银行卡' + }, { + value: '团购', + img: '/images/pay/tuan.png', + isActive: false, + type: '团购' + }, { + value: '储值卡', + img: '/images/pay/card.png', + isActive: false, + type: '储值卡' + }, ], - function print() { - var id=$("#orderId").val(); - layer.open({ - type: 2, - title: "打印订单", - area: ['250px', '550px'], - maxmin: true, - content: [basePath + '/admin/redirect/hive/beautySalon/print-order?id=' + id] - }); - }; + dialogSettleVisible : false, + moneyCards: [], + defaultProps: { + children: 'children', + label: 'showLable' + }, + treeSelect : [], + payMoneys : [], + printPaper : true, + refundMoney : 0, + data : {}, + + }, + created : function() { + let _this = this; + this.orderParam = /*[[${orderParam}]]*/ + var orderId = /*[[${orderId}]]*/ + var orderNo = /*[[${orderNo}]]*/ + + var param = {}; + if(orderId) { + param.id = orderId; + } else { + param.orderNo = orderNo; + } + this.queryOrderDetailData(param); + // 业绩类型 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX', + callback: function (data) { + _this.achieveTypeList = data.rows; + } + }); + }, + methods : { + calRefund() { + let _this = this; + var total = 0; + _this.orderItems.forEach(item => { + if (item.refundPrice && item.refundCount) { + total += parseFloat(item.refundPrice * item.refundCount); + } + }) + + _this.totalRefund = total; + }, + queryOrderDetailData(param) { + let _this = this; + AjaxProxy.requst({ + app: _this, + data: param, + contentType: 'application/x-www-form-urlencoded', + url: basePath + '/admin/order/findOrderDetailByIdOrNo', + callback: function (data) { + console.log(data); + var mapInfo = data.mapInfo; + _this.vipInfo = mapInfo.vipInfo; + _this.order = mapInfo.order; + _this.orderItems = mapInfo.orderItems; + _this.payMethodItems = mapInfo.payMethods; + _this.achieveItems = mapInfo.achieveList; + + _this.flowItems = _this.order.flows; + + _this.checkAchieveIsDel(_this.achieveItems); + _this.order.orderTime = moment(_this.order.orderTime).format("YYYY-MM-DD HH:mm"); + + var arrears = 0; + var refund = 0; + var repay = 0; + for(var i = 0; i < _this.flowItems.length; i++) { + var item = _this.flowItems[i]; + if (item.payMethod === '欠款') { + arrears += item.amount; + } + + if (item.flowType === '还款') { + repay += item.amount; + } + + if (item.flowType === '退款') { + refund += item.amount; + } + } + _this.order.arrears = arrears; + _this.order.refund = refund; + _this.order.repay = repay; + + //获取用户列表 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopAll', + callback: function (data) { + _this.userList = data.rows; + } + }); + _this.getVipMoneyCards(); + } + }); + }, + confirmSubmit() { + let _this = this; + _this.data.oldOrderId = _this.order.id; + _this.data.vipId = _this.vipInfo.id; + + if(!_this.payMethodFlow()) { + return; + } + + let orderItems = _this.orderItems; + let dataItems = []; + for(var i = 0; i < orderItems.length; i++) { + let item = orderItems[i]; + if (item.refundPrice && item.refundCount) { + let achieveList = [] + if (_this.isReturnAchieve) { + for(var j = 0; j < _this.achieveItems.length; j++) { + let achieveItem = _this.achieveItems[j]; + if (achieveItem.returnAchieve || achieveItem.returnCommission) { + achieveItem.t1 = achieveItem.returnAchieve ? achieveItem.returnAchieve : 0; + achieveItem.projPercentage = achieveItem.returnCommission ? achieveItem.returnCommission : 0; + achieveList.push(achieveItem); + } + } + + item.achaeveList = achieveList; + } + if (item.returnStore) { + item.isReturnStore = 'Y'; + } else { + item.isReturnStore = 'N'; + } + + item.preCount = item.count; + item.count = item.refundCount; + item.zkPrice = item.refundPrice; + item.cashPay = 0; + item.cardPay = 0; + item.oldItemId = item.id; + dataItems.push(item); + } + } + + _this.data.items = dataItems; + _this.data.zkTotal = _this.refundMoney; + _this.data.total = _this.total; + AjaxProxy.requst({ + app: _this, + data: _this.data, + contentType: 'application/json', + url: basePath + '/admin/order/refundOrder', + callback: function (data) { + _this.isRefund = false; + _this.dialogSettleVisible = false; + var param = {}; + param.id = _this.data.oldOrderId; + _this.queryOrderDetailData(param); + } + }); + + }, + payMethodFlow() { + let _this = this; + if (_this.payMoneys.length > 0) { + let flows = [] + var total = 0; + _this.payMoneys.forEach(item => { + let flow = {}; + flow.payMethod = item.type; + if (!item.money) { + this.$message.warning("请输入" + item.type + "的付款金额"); + return false; + } + flow.amount = parseFloat(item.money); + if (item.type == '储值卡'){ + flow.isGift = item.isGift; + flow.cardId = item.id; + } + total += parseFloat(item.money); + flows.push(flow) + }) + if (total != _this.refundMoney) { + this.$message.warning("输入付款总金额与应付金额不符"); + return false; + } + + if(_this.order.zkTotal - _this.order.refund - _this.order.arrears < total) { + this.$message.warning("退款金额不能超过收款金额"); + return false; + } + _this.data.flows = flows; + return true; + } else { + this.$message.warning("请选择支付方式"); + return false; + } + }, + openPayMoneyDialog() { + let _this = this; + let items = this.orderItems; + _this.refundMoney = 0; + _this.total = 0; + + for(var i = 0; i < items.length; i++) { + let item = items[i] + if (item.refundPrice && item.refundCount) { + if (!item.refundPrice > 0 && !item.refundCount > 0) { + _this.$message.error("退款金额或退款数量须大于0"); + return; + } + + if (item.refundCount > item.count) { + _this.$message.error("输入正确的退款数量"); + return; + } + + _this.refundMoney += parseFloat(item.refundPrice * item.refundCount); + //记录一下未优惠之前的价格 + _this.total += parseFloat(item.price * item.refundCount); + } + } + + if (_this.refundMoney == 0) { + _this.$message.error("请输入退款金额或退款数量"); + return; + } + _this.dialogSettleVisible = true; + }, + calOrderTotalFormatter(row, column) { + return (row.count * row.zkPrice).toFixed(2); + }, + getVipMoneyCards() { + let _this = this; + if (_this.order.vipId) { + AjaxProxy.requst({ + app: _this, + data: {vipId: _this.order.vipId}, + contentType: 'application/x-www-form-urlencoded', + url: basePath + '/admin/moneyCardUse/getUseMoneyCard', + callback: function (data) { + if (data.rows.length > 0) { + data.rows.forEach(function (item, index, input) { + item.showLable = item.cardName + "-余额:" + (item.realMoney) + item.uuid = MTools.uuid(); + if (item.giftMoney != 0) { + var children = []; + var gift = {}; + gift.id = item.id; + gift.giftMoney = item.giftMoney; + gift.showLable = item.cardName + '-赠送金额' + item.giftMoney; + gift.cardName = item.cardName; + gift.isGift = 1; + gift.uuid = MTools.uuid(); + children.push(gift); + item.children = children; + } + }); + _this.moneyCards = data.rows; + } + } + }); + } + }, + payMethodSelect(item, index) { + let _this = this; + let payMoneys = _this.payMoneys; + if (item.type != '储值卡') { + this.$nextTick(function () { + if (item.isActive) { + Vue.set(item,'isActive',false); + var index = -1; + for (var i = 0; i < payMoneys.length; i++) { + let payMoney = payMoneys[i]; + if (payMoney.value == item.value) { + index = i; + break; + } + } + + if (index > -1) { + _this.payMoneys.splice(index, 1) + } + } else { + Vue.set(item,'isActive',true); + var hasAmount = 0; + for(var i = 0; i < payMoneys.length; i++) { + hasAmount += parseFloat(payMoneys[i].money); + } + if (_this.refundMoney - hasAmount > 0) { + Vue.set(item, 'money', _this.refundMoney - hasAmount); + } + _this.payMoneys.push(item); + } + }); + } + }, + popoverHide(item) { + if(this.treeSelect.length <= 0) { + Vue.set(item, 'isActive', false) + } else { + Vue.set(item, 'isActive', true) + } + }, + handleCheckChange(clickNode, checked) { + let _this = this; + + let nodes = checked.checkedNodes; + _this.treeSelect = nodes; + var index = -1; + // 判断点击节点是否在已展示支付方式中 + for(var i = 0; i < _this.payMoneys.length; i++) { + let node = _this.payMoneys[i]; + if (node.uuid === clickNode.uuid) { + index = i; + break; + } + } + + // 若点击节点在选中节点中,且已展示支付方式不存在,则添加 + if (nodes.indexOf(clickNode) > -1 && index === -1) { + var node = clickNode; + var item = {}; + if (node.isGift) { + item.value = node.cardName; + item.balance = node.giftMoney; + item.isGift = 'Y'; + } else { + item.value = node.cardName; + item.balance = node.realMoney; + item.isGift = 'N'; + } + item.type = '储值卡'; + item.id = node.id; + item.uuid = clickNode.uuid; + _this.payMoneys.push(item); + } + + // 若点击节点不存在选中节点中,且已展示支付方式中存在,则移除 + if (nodes.indexOf(clickNode) === -1 && index > -1) { + _this.payMoneys.splice(index, 1); + } + }, + closeFrame() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + saveAchieve() { + let _this = this; + if(_this.checkAchieveMoney()){ + AjaxProxy.requst({ + app: _this, + data: _this.achieveItems, + contentType: 'application/json', + url: basePath + '/admin/achieve/add', + callback: function (data) { + _this.$message.success(data.info); + } + }); + } + + }, + + shareAchieve(index, row) { + var row2 = JSON.parse(JSON.stringify(row)); + row2.id = null; + row2.isShare = true; + this.achieveItems.splice(index+1,0,row2); + this.calculationAchieve(); + }, + //业绩均分订单金额 + calculationAchieve(){ + console.log("计算业绩"); + let jsqMap={}; + this.achieveItems.forEach(achieve=>{ + key=achieve.achieveType+achieve.orderItemId; + if(!jsqMap[key]){ + jsqMap[key]=1; + }else{ + jsqMap[key]++; + } + }); + this.achieveItems.forEach(achieve=>{ + key=achieve.achieveType+achieve.orderItemId; + achieve.goodsCash=(achieve.zkTotal/jsqMap[key]).toFixed(2); + }); + }, + //校验业绩是否大于订单收款金额 + checkAchieveMoney(){ + console.log("校验业绩是否大于订单收款金额"); + let jsqMap={}; + let isOk=true; + for(let i=0 ; i< this.achieveItems.length; i++){ + let achieve=this.achieveItems[i]; + if(!isNaN(achieve.goodsCash) ){ + key=achieve.achieveType+achieve.orderItemId; + if(!jsqMap[key]){ + jsqMap[key]=parseFloat(achieve.goodsCash); + }else{ + jsqMap[key]=jsqMap[key]+parseFloat(achieve.goodsCash); + } + if(jsqMap[key]>achieve.zkTotal) { + this.$message.error("【"+achieve.goodsName + "】业绩分配金额大于支付金额"); + isOk = false; + break; + } + }else{ + this.$message.error("【"+achieve.goodsName + "】业绩分配金额请填写数字"); + isOk=false; + break; + } + } + console.log("isOk",isOk); + return isOk; + }, + //删除业绩 + delAchieve(index, row) { + let _this = this; + _this.achieveItems.splice(index, 1); + this.calculationAchieve(); + }, + checkAchieveIsDel(items) { + var achieveIds = []; + for(var i = 0; i < items.length; i++) { + var item = items[i]; + if(achieveIds.indexOf(item.orderItemId) === -1) { + achieveIds.push(item.orderItemId); + item.isShare = false; + } else { + item.isShare = true; + } + + item.t1 = item.consume + item.cardCash; + } + }, + printf() { + var id = this.order.id; + layer.open({ + type: 2, + title: "打印订单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/order/printOrder?id=' + id] + }); + }, + handleClick() { + + }, + toBack() { + MTools.closeForm(); + }, + } + }); + //]]> </script> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form-bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form-bak.html new file mode 100644 index 0000000..6083dca --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form-bak.html @@ -0,0 +1,159 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> +</head> +<body> +<div class="ibox-content"> + + <form class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> + <div class="panel panel-default"> + <div class="panel-heading"><strong th:text="'服务单金额:'+${obj.money}"></strong></div> + <table class="table table-bordered table-striped " + style="width: 100%;" id="mgrid"> + <thead> + <tr> + <th>项目名称</th> + <th width="50px">服务时长</th> + <th>服务时间</th> + <th width="300px">美疗师</th> + <th width="100px">提成</th> + </tr> + </thead> + <tbody> + <tr th:each="item,st:${obj.serviceItems}"> + <th th:text="${item.projInfo?.name}"></th> + <th th:text="${item.projInfo?.timeLength+'分钟'}"></th> + <th> + <span th:text="${#dates.format(item.beginTime, 'yyyy-MM-dd HH:mm')}"></span> + —— + <span th:text="${#dates.format(item.endTime, 'yyyy-MM-dd HH:mm')}"></span> + </th> + <th th:text="${item.beautiStaffInfo?.suName}"></th> + <th th:text="${item.extract}"></th> + </tr> + </tbody> + </table> + </div> + <div style="border-radius:5px; background:#F5F5F5;padding:10px 0;"> + <div class="form-group"> + <div class="col-sm-11 "> + <div class="row"> + <label class="col-sm-1 control-label">会员姓名</label> + <div class="col-sm-2 "> + <p class="form-control-static" th:text="${obj?.vipInfo.vipName }"></p> + </div> + <div class="col-sm-5 "> + <label class="col-sm-3 control-label">会员编号</label> + <div class="col-sm-9"> + <p class="form-control-static" th:text="${obj?.vipInfo.vipNo }"></p> + </div> + </div> + <div class="col-sm-4 "> + <label class="col-sm-5 control-label">会员手机 </label> + <div class="col-sm-7"> + <p class="form-control-static" th:text="${obj?.vipInfo.phone }"></p> + </div> + </div> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-11 "> + <div class="row"> + <label class="col-sm-1 control-label">床位安排</label> + <div class="col-sm-2 "> + <p th:each="item:${cw}" th:if="${obj.bedId eq item.id }" class="form-control-static" + th:text="${item.bedName }"></p> + </div> + <div class="col-sm-5 "> + <label class="col-sm-3 control-label">服务时间</label> + <div class="col-sm-9"> + <p class="form-control-static"> + <span th:text="${#dates.format(obj.bedState?.startTime, 'yyyy-MM-dd HH:mm')}"></span> + —— + <span th:text="${#dates.format(obj.bedState?.endTime, 'yyyy-MM-dd HH:mm')}"></span> + </p> + </div> + </div> + </div> + </div> + </div> + + + <div class="form-group"> + <div class="col-sm-11 "> + <div class="row"> + <label class="col-sm-1 control-label">预约时间 </label> + <div class="col-sm-2"> + <p class="form-control-static"> + <span th:text="${#dates.format(obj.yyTime, 'yyyy-MM-dd HH:mm')}"></span> + </p> + </div> + <div class="col-sm-5 "> + <label class="col-sm-3 control-label">配料师</label> + <div class="col-sm-10" th:each="item:${yls}" th:if="${obj.doctorId eq item.id }"> + <p class="form-control-static" th:text="${item.staffName }"></p> + </div> + </div> + <div class="col-sm-4 "> + <label class="col-sm-5 control-label">备注 </label> + <div class="col-sm-7"> + <p class="form-control-static" th:text="${obj?.remark }"></p> + </div> + </div> + </div> + </div> + </div> + <div class="form-group"> + <div class="col-sm-11 "> + <div class="row"> + <label class="col-sm-1 control-label">备注 </label> + <div class="col-sm-10"> + <p class="form-control-static" th:text="${obj?.remark }"></p> + </div> + + </div> + </div> + </div> + </div> + <input autocomplete="off" type="hidden" id="serviceId" th:value="${obj.id}"> + <div class="form-group "> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> + <button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">关闭</button> + </div> + </div> + </form> +</div> +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript"> + function print() { + var id = $("#serviceId").val(); + layer.open({ + type: 2, + title: "打印服务单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/projService/printOrder?id=' + id] + }); + } + + +</script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html index b80d7fa..90f4acc 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html @@ -10,138 +10,188 @@ <meta http-equiv="Cache-Control" content="no-siteapp"/> <LINK rel="Bookmark" href="../images/favicon.ico"> <!-- 本框架基本脚本和样式 --> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <script type="text/javascript" th:src="@{/js/function/meiduCommon.js}"></script> </head> +<style> + .ibox-content { + background-color: rgba(240, 242, 245, 1); + } + + .order-info p { + line-height: 30px; + } +</style> <body> -<div class="ibox-content"> - - <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="panel panel-default"> - <div class="panel-heading"><strong th:text="'服务单金额:'+${obj.money}"></strong></div> - <table class="table table-bordered table-striped " - style="width: 100%;" id="mgrid"> - <thead> - <tr> - <th>项目名称</th> - <th width="50px">服务时长</th> - <th>服务时间</th> - <th width="300px">美疗师</th> - <th width="100px">提成</th> - </tr> - </thead> - <tbody> - <tr th:each="item,st:${obj.serviceItems}"> - <th th:text="${item.projInfo?.name}"></th> - <th th:text="${item.projInfo?.timeLength+'分钟'}"></th> - <th> - <span th:text="${#dates.format(item.beginTime, 'yyyy-MM-dd HH:mm')}"></span> - —— - <span th:text="${#dates.format(item.endTime, 'yyyy-MM-dd HH:mm')}"></span> - </th> - <th th:text="${item.beautiStaffInfo?.suName}"></th> - <th th:text="${item.extract}"></th> - </tr> - </tbody> - </table> - </div> - <div style="border-radius:5px; background:#F5F5F5;padding:10px 0;"> - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">会员姓名</label> - <div class="col-sm-2 "> - <p class="form-control-static" th:text="${obj?.vipInfo.vipName }"></p> - </div> - <div class="col-sm-5 "> - <label class="col-sm-3 control-label">会员编号</label> - <div class="col-sm-9"> - <p class="form-control-static" th:text="${obj?.vipInfo.vipNo }"></p> - </div> - </div> - <div class="col-sm-4 "> - <label class="col-sm-5 control-label">会员手机 </label> - <div class="col-sm-7"> - <p class="form-control-static" th:text="${obj?.vipInfo.phone }"></p> - </div> - </div> - </div> - </div> - </div> - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">床位安排</label> - <div class="col-sm-2 "> - <p th:each="item:${cw}" th:if="${obj.bedId eq item.id }" class="form-control-static" - th:text="${item.bedName }"></p> - </div> - <div class="col-sm-5 "> - <label class="col-sm-3 control-label">服务时间</label> - <div class="col-sm-9"> - <p class="form-control-static"> - <span th:text="${#dates.format(obj.bedState?.startTime, 'yyyy-MM-dd HH:mm')}"></span> - —— - <span th:text="${#dates.format(obj.bedState?.endTime, 'yyyy-MM-dd HH:mm')}"></span> - </p> - </div> - </div> - </div> - </div> - </div> - - - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">预约时间 </label> - <div class="col-sm-2"> - <p class="form-control-static"> - <span th:text="${#dates.format(obj.yyTime, 'yyyy-MM-dd HH:mm')}"></span> - </p> - </div> - <div class="col-sm-5 "> - <label class="col-sm-3 control-label">配料师</label> - <div class="col-sm-10" th:each="item:${yls}" th:if="${obj.doctorId eq item.id }"> - <p class="form-control-static" th:text="${item.staffName }"></p> - </div> - </div> - <div class="col-sm-4 "> - <label class="col-sm-5 control-label">备注 </label> - <div class="col-sm-7"> - <p class="form-control-static" th:text="${obj?.remark }"></p> - </div> - </div> - </div> - </div> - </div> - <div class="form-group"> - <div class="col-sm-11 "> - <div class="row"> - <label class="col-sm-1 control-label">备注 </label> - <div class="col-sm-10"> - <p class="form-control-static" th:text="${obj?.remark }"></p> - </div> - - </div> - </div> - </div> - </div> - <input autocomplete="off" type="hidden" id="serviceId" th:value="${obj.id}"> - <div class="form-group "> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> - <button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">关闭</button> - </div> - </div> - </form> +<div class="ibox-content" id="app"> + <el-container> + <el-header style="height: 210px; background-color: white; margin: 15px;"> + <el-row style="line-height: 60px; padding-top: 20px;"> + <el-col :span="1" style="font-size: 40px; color:#409EFF;"> + <i class="el-icon-s-order" type="primary"></i> + </el-col> + <el-col :span="10"> + <h1 style="line-height: 60px; margin: 0 0;display: inline-block">服务单号:{{serviceOrderInfo.serviceNo}}</h1> + </el-col> + <el-col :span="5"> + <h1 style="line-height: 60px; margin: 0 0;display: inline-block"><span style="color: #cf2d27;float: right ">¥{{serviceOrderInfo.money}}</span></h1> + </el-col> + <el-col :span="5" style="float: right; margin-right: 10px;"> + <el-button type="info" @click="printf">打印</el-button> +<!-- <el-button type="primary">划扣</el-button>--> + <el-button type="danger" @click="toBack">返回</el-button> + </el-col> + </el-row> + <el-row class="order-info" type="flex" justify="space-around" style="height: 150px; padding: 30px 30px;"> + <el-col :span="5"> + <p>会员姓名:{{serviceOrderInfo.vipInfo.vipName}}</p> + <p>会员电话:{{serviceOrderInfo.vipInfo.phone}}</p> + </el-col> + <el-col :span="5"> + <p>会员编号:{{serviceOrderInfo.vipInfo.vipNo}}</p> + <p>床位安排:{{bedFormat()}}</p> + </el-col> + <el-col :span="6"> + <p>服务时间:<span v-if="serviceOrderInfo.bedState != null">{{dateFormat(serviceOrderInfo.bedState.startTime)}} - {{dateFormat(serviceOrderInfo.bedState.endTime)}}</span></p> + <p>预约时间:{{dateFormat(serviceOrderInfo.yyTime)}}</p> + </el-col> + <el-col :span="3"> + <p>配料师:{{serviceOrderInfo.plsName}}</p> + <p>备注:{{serviceOrderInfo.remark}}</p> + </el-col> + </el-row> + </el-header> + <el-main style="background-color: white; margin: 15px; padding: 20px 30px;"> + <el-tabs v-model="tabName" @tab-click="handleClick"> + <el-tab-pane label="服务单" name="serviceOrder"> + <el-table :data="tableData" + style="width: 100%"> + <el-table-column + prop="projInfo.name" + label="商品名称" + width="400"> + </el-table-column> + <el-table-column + prop="projUse.source" + label="来源" + width="400"> + </el-table-column> + <el-table-column + :formatter="hkPrice" + label="划扣金额" + width="100"> + </el-table-column> + <el-table-column + prop="count" + label="次数" + width="100"> + </el-table-column> + <el-table-column + prop="projInfo.timeLength" + label="服务时长" + width="200"> + </el-table-column> + <el-table-column + label="服务时间" :formatter="serviceTime"> + </el-table-column> + <el-table-column + prop="beautiStaffInfo.suName" + label="美疗师" + width="200"> + </el-table-column> + <el-table-column + prop="extract" + label="提成" + width="200"> + </el-table-column> + </el-table> + </el-tab-pane> + </el-tabs> + </el-main> + </el-container> </div> <script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> -<script type="text/javascript"> +<script type="text/javascript" th:inline="javascript"> + //<![CDATA[ + var app = new Vue({ + el : "#app", + data : { + serviceOrderInfo : "", + tabName : "serviceOrder", + tableData : [], + bedList : [], + plsList : [] + }, + created :function () { + this.bedList = /*[[${cw}]]*/ + this.serviceOrderInfo = /*[[${obj}]]*/ + this.tableData = this.serviceOrderInfo.serviceItems; + this.plsList = /*[[${yls}]]*/ + console.log(this.plsList); + }, + methods : { + handleClick() {}, + dateFormat(time) { + return moment(time).format("YYYY-MM-DD HH:mm"); + }, + bedFormat() { + if (this.bedList.length < 0) { + return "-"; + } + + var beds = this.bedList; + var bedId = this.serviceOrderInfo.bedId; + if (!bedId) { + return "-"; + } + + for(var i = 0; i < beds.length; i++) { + if (beds[i].id == bedId) { + return beds[i].bedName; + } + } + }, + + printf() { + var id = this.serviceOrderInfo.id; + layer.open({ + type: 2, + title: "打印服务单", + area: ['250px', '550px'], + maxmin: true, + content: [basePath + '/admin/projService/printOrder?id=' + id] + }); + }, + toBack() { + MTools.closeForm(); + }, + serviceTime(row, column) { + if (!row.beginTime) { + return "-"; + } + var startTime = this.dateFormat(row.beginTime); + var endTime = this.dateFormat(row.endTime); + return startTime + " - " + endTime; + }, + hkPrice(row, column) { + console.log(row); + return row.projUse.price * row.count ; + } + }, + }); + //]]> + function print() { var id = $("#serviceId").val(); layer.open({ @@ -149,7 +199,7 @@ title: "打印服务单", area: ['250px', '550px'], maxmin: true, - content: [basePath + '/admin/redirect/hive/beautySalon/print-service?id=' + id] + content: [basePath + '/admin/projService/printOrder?id=' + id] }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-order.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-order.html index c902c92..82fd01c 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-order.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-order.html @@ -1,219 +1,6 @@ <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> - <meta name="renderer" content="webkit|ie-comp|ie-stand"> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" - content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> - <meta http-equiv="Cache-Control" content="no-siteapp" /> - <LINK rel="Bookmark" href="../images/favicon.ico"> - <!-- 本框架基本脚本和样式 --> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> - <style> - .btn{ - position: fixed; - bottom: 10px; - left: 45%; - } + <div th:include="'admin/hive/printTemplates/'+${page}::html" ></div> - </style> -</head> -<body> -<div class="ibox-content" id="app"> - <div id="print" style="width: 220px; "> - <h1 style="text-align: center;font-size: 18px;margin: 20px auto;"> - {{order.shopName}} - </h1> - <table style="width: 100%; font-size:12px;line-height: 20px;"> - - <tr> - <td colspan="2"> - <b>订单号</b>:<span>{{order.orderNo}}</span> - </td> - </tr> - <tr> - <td colspan="2" > - <b>客户</b>:<span>{{order.vipName}}</span> - </td> - </tr> - <tr> - <td colspan="2" > - <b>消费日期</b>:<span>{{order.orderTime |format}}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <b>电话</b>:<span>{{order.vipPhone| formatPhone }}</span> - </td> - </tr> - </table> - <p>-----------------------------------</p> - <table style="width: 80%;font-size:12px;margin-top: 20px;text-align: left"> - - <tr> - <th style="text-align: left;" colspan="4">产品</th> - </tr> - <tr> - <th style="">数量</th> - <th style="">单价</th> - <th style="">小计</th> - </tr> - <template v-for="item in order.items"> - <tr > - <td style="text-align: left;" colspan="4" >{{item.shoppingGoods.name }}</td> - </tr> - <tr > - <td>{{item.count }}</td> - <td>{{item.zkPrice }}</td> - <td>{{(item.zkPrice * item.count).toFixed(1) }}</td> - </tr> - </template> - <tr> - <td> - <b>总计:</b> - </td> - <td> - - </td> - <td> - <span >{{order.zkTotal}}</span> - </td> - </tr> - </table> - <p>-----------------------------------</p> - <table style="width: 100%;font-size: 10px;line-height: 30px;"> - <tr > - <td> - <b >储值卡余额:</b><span >{{totalMoney}}</span> - </td> - </tr> - - <tr> - <td> - <b>实收金额:</b><span >{{order.zkTotal-order.arrears}}</span> - </td> - </tr> - <tr> - <td> - <b>收银人:</b><span>{{order.staffName}}</span> - </td> - </tr> - <tr> - <td> - <b>客户签名:</b> - </td> - </tr> - - - </table> - - <div style="width: 100%;text-align: center;margin: 30px auto;margin-bottom: 10px"> - <br> - *****************<br> - 谢谢惠顾<br> - *****************<br> - <br> - </div> - <div style="width: 100%;"> - 地址:{{shopInfo.shopAddr}}<br> - 电话:{{shopInfo.shopTel}}<br> - <br> - <br> - </div> - <div style="width: 100%;" > - <div style="text-align: center;"> - - <img style="width: 100%;" :src="shopInfo.qrcode" /><br> - 更多精彩请访问肽妍小程序<br> - </div> - <br> - <br> - </div> - - - </div> - <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> -</div> -<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> -<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> -<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> -<script type="text/javascript"> - - - var id = $.query.get("id"); - var app = new Vue({ - el: '#app', - data: { - order:{ - vipInfo:{}, - serviceItems:[] - }, - moneyCar:{}, - totalMoney:0 - - }, - created: function () { - - this.loadInfo(); - }, - - mounted: function () { - - }, - - methods: { - loadInfo(){ - var _this=this; - AjaxProxy.requst({ - app: _this, - url: basePath + '/admin/order/getShopOrder?id='+id, - callback: function (data) { - _this.order=data.mapInfo.order; - _this.moneyCar=data.mapInfo.moneyCar; - _this.shopInfo=data.mapInfo.shopInfo; - _this.totalMoney=data.mapInfo.totalMoney; - setTimeout(print,1000) ; - } - }); - }, - }, - - filters: - { - format: function (value) { - if (!value) return ''; - return MTools.formatDate(value, 'yyyy-MM-dd') - } , - formatPhone: function (value) { - if (!value) return ''; - return value.substr(0,3) + "****" + value.substr(value.length-4,value.length+1) - } , - }, - - - }, - ); - - - var LODOP; - - function print() { - LODOP = getLodop(); - LODOP.PRINT_INIT("HIVE打印任务"); - LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", document.getElementById("print").innerHTML); - LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW", true); - LODOP.PREVIEW(); - } - -</script> -</body> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-service.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-service.html index d40c8cf..c5dde4f 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-service.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/print-service.html @@ -1,197 +1,8 @@ <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> - <meta name="renderer" content="webkit|ie-comp|ie-stand"> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" - content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> - <meta http-equiv="Cache-Control" content="no-siteapp" /> - <LINK rel="Bookmark" href="../images/favicon.ico"> - <!-- 本框架基本脚本和样式 --> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/MBase.js}"></script> - <style> - .btn{ - position: fixed; - bottom: 10px; - left: 45%; - } - - </style> -</head> -<body> -<div class="ibox-content" id="app"> - <div id="print" style="width: 200px; margin: 5px auto;"> - <h1 style="text-align: center;font-size:18px;margin: 20px auto;"> - {{projService.shopName}} - </h1> - <table style="width: 100%; font-size:10px;line-height: 20px;"> - - <tr> - <td colspan="2"> - <b>订单号</b>:<span>{{projService.serviceNo}}</span> - </td> - </tr> - <tr> - <td colspan="2" > - <b>客户</b>:<span>{{projService.vipInfo.vipName}}</span> - </td> - </tr> - <tr> - <td colspan="2" > - <b>消费日期</b>:<span>{{projService.createTime |format}}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <b>电话</b>:<span>{{projService.vipInfo.phone| formatPhone }}</span> - </td> - </tr> - </table> - <table style="width: 80%;font-size:10px;margin-top: 20px;text-align: left"> - <tr> - <th style="text-align: left;" colspan="4">产品</th> - </tr> - <tr> - <th style="">数量</th> - <th style="">单价</th> - <th style="">余次</th> - <th style="">技师</th> - </tr> - <template v-for="item in projService.serviceItems"> - <tr > - <td style="text-align: left;" colspan="4" >{{item.projInfo.name }}</td> - </tr> - <tr > - <td>{{item.count }}</td> - <td>{{item.projUse.price }}</td> - <td >{{item.projUse.surplusCount }}</td> - <td>{{item.beautiStaffInfo?item.beautiStaffInfo.suName:''}}</td> - </tr> - </template> - </table> - <table style="width: 100%;font-size: 10px;line-height: 30px;"> - <tr> - <td> - <b>本次划扣:</b> <span >{{projService.money}}</span> - </td> - </tr> - <tr> - <td> - <b>收银人:</b> <span>{{projService.createStaffName}}</span> - </td> - </tr> - <tr> - <td> - <b>客户签名:</b> - </td> - </tr> - - - </table> - - <div style="width: 100%;text-align: center;margin: 30px auto;margin-bottom: 10px"> - <br> - *****************<br> - 谢谢惠顾<br> - *****************<br> - <br> - </div> - <div style="width: 100%;"> - 地址:{{shopInfo.shopAddr}}<br> - 电话:{{shopInfo.shopTel}}<br> - <br> - <br> - </div> - <div style="width: 100%;" > - <div style="text-align: center;"> - - <img style="width: 100%;" :src="shopInfo.qrcode" /><br> - 更多精彩请访问肽妍小程序<br> - </div> - <br> - <br> - </div> +<div th:include="'admin/hive/printTemplates/print-service-'+${page}::html" ></div> - </div> - <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> -</div> -<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> -<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> -<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> -<script type="text/javascript"> - - - var id = $.query.get("id"); - var app = new Vue({ - el: '#app', - data: { - projService:{ - vipInfo:{}, - serviceItems:[] - } - }, - created: function () { - - this.loadInfo(); - }, - - mounted: function () { - - }, - - methods: { - loadInfo(){ - var _this=this; - AjaxProxy.requst({ - app: _this, - url: basePath + '/admin/projService/findProjServiceInfo?id='+id, - callback: function (data) { - _this.projService=data.mapInfo.projService; - _this.shopInfo=data.mapInfo.shopInfo; - setTimeout(print,1000) ; - } - }); - }, - }, - - filters: - { - format: function (value) { - if (!value) return ''; - return MTools.formatDate(value, 'yyyy-MM-dd') - } , - formatPhone: function (value) { - if (!value) return ''; - return value.substr(0,3) + "****" + value.substr(value.length-4,value.length+1) - } , - }, - - - }, - ); - - - var LODOP; - - function print() { - LODOP = getLodop(); - LODOP.PRINT_INIT("HIVE打印任务"); - LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", document.getElementById("print").innerHTML); - LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW", true); - LODOP.PREVIEW(); - } - -</script> -</body> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/projUseFlow-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/projUseFlow-list.html new file mode 100644 index 0000000..3993e96 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/projUseFlow-list.html @@ -0,0 +1,128 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + +</head> +<body class=" container-fluid"> +<div class="pd-10"> + <!-- 搜索框部分start --> + <div class="row form-head"> + <form class="form-inline" id="serchform"> + + <div class="form-group mr-20"> + <label>创建时间</label> + <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- + <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + </div> + + <div class="form-group mr-20"> + <label >操作人</label> + <input autocomplete="off" name="createBy" class="form-control"> + </div> + <input type="hidden" name="projUseId" th:value="${param.projUseId}" > + <div class="form-group"> + <button onclick="myGrid.serchData(1)" type="button" + class="btn btn-sm btn-info"> + <i class="fa fa-search "></i> 搜索 + </button> + <button type="reset" class="btn btn-sm btn-info "> + <i class="fa fa-refresh "></i> 重置 + </button> + </div> + </form> + </div> + <div class="row mt-10"> + <div id="option-bar"> + <!-- 功能按钮部分 --> + </div> + <!-- 数据表格部分 --> + <table id="mgrid"> + <thead> + <tr> + <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> + <th data-field="projName" >项目名称</th> + <th data-field="optionType">操作类型</th> + <th data-field="createBy">操作人</th> + <th data-field="createTime" data-formatter="MGrid.getTime" data-sortable="true">操作时间</th> + <th data-field="surplusCount">剩余次数</th> + <th data-field="balance">余额</th> + <th data-field="status">状态</th> + <th data-field="isOver" data-formatter="getYesOrNo">是否使用完成</th> + <th data-field="failTime" data-formatter="MGrid.getTime">有效期</th> + <th data-field="price">单次扣减金额</th> + <th data-field="remark">备注</th> + </tr> + </thead> + </table> + <!-- 数据表格部分end --> + </div> + <div class="form-group "> + <div class="col-sm-12 text-center fixed-button"> + <a class="btn btn-danger radius" href="javascript:;" + onclick="MTools.closeForm()"><i class="fa fa-close"></i> 关闭</a> + </div> + </div> +</div> + +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript" th:inline="javascript" > + + //定义表格对象 + var myGrid; + + $(function () { + + //时间 + var _initParam = { + format: 'yyyy-mm-dd hh:ii', + todayBtn: true, + autoclose: true, + startView: 2, + maxView: 3, + minView: 0 + }; + MTools.ininDatetimepicker(_initParam); + //限制结束时间不小于开始时间 + var initParam = { + format: 'yyyy-mm-dd hh:ii', + todayBtn: true, + autoclose: true, + startView: 2, + maxView: 3, + minView: 0 + }; + MTools.limitStartEndTime(initParam); + + myGrid = MGrid.initGrid({ + url: basePath + "/admin/projUser/findProjUseFlow", + sortName:"createTime", + sortOrder:"desc", + }); + }); + + function getYesOrNo(value, row, index){ + switch(value){ + case 'Y': + return "是"; + case 'N': + return "否"; + default: + return value; + } + } + +</script> + +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html index 7691049..07bfb1c 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html @@ -11,6 +11,7 @@ <!-- 本框架基本脚本和样式 --> <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> <!-- 富文本编辑器 --> @@ -74,6 +75,9 @@ padding-left: 10px; margin-left:10px ; } + .openOrClose { + cursor:pointer + } </style> </head> <body> @@ -123,13 +127,17 @@ </el-tab-pane> <el-tab-pane label="套餐" name="tab2"> - <template v-for="item in taocanList" > - <p class="el-big-title">【{{item.isCourse=='N'?'固定套餐':'任选套餐'}}】{{item.projName}} - <code v-if="item.projInfo.isCourse=='Y'" > 剩余次数:{{item.surplusCount}} </code> + <template v-for="(item,index) in taocanList"> + <p class="el-big-title"> + <span class="openOrClose" v-if="!item.openOrClose" @click="openOrCloseTc(item, index, 1)"><i class="el-icon-arrow-down"></i></span> + <span class="openOrClose" v-if="item.openOrClose" @click="openOrCloseTc(item, index, 2)"><i class="el-icon-arrow-up"></i></span> + 【{{item.isCourse=='N'?'固定套餐':'任选套餐'}}】{{item.projName}} + <span style="float: right" v-if="item.failTime != null">有效期:{{item.failTime}}</span> + <code v-if="item.isCourse=='Y'" > 剩余次数:<span v-if="item.isInfinite == 'Y'">无限次</span><span v-else>{{item.surplusCount}}</span> </code> </p> <el-table :data="item.taocanProjUse" - style="width: 98%"> + style="width: 98%" v-show="item.openOrClose"> <el-table-column prop="projName" label="项目"> @@ -143,10 +151,10 @@ prop="surplusCount" label="余次"> </el-table-column> - <el-table-column - prop="failTimeStr" - label="有效期"> - </el-table-column> +<!-- <el-table-column--> +<!-- prop="failTimeStr"--> +<!-- label="有效期">--> +<!-- </el-table-column>--> <el-table-column prop="source" label="来源"> @@ -163,7 +171,10 @@ </el-table-column> </el-table> </template> - +<!-- <el-row style="text-align: center; margin-top: 5px;">--> +<!-- <el-link type="primary" v-if="!tcIsOpen && taocanList.length > 0" @click="tcIsOpen = true">点击展开</el-link>--> +<!-- <el-link type="primary" v-if="tcIsOpen" @click="tcIsOpen = false">点击隐藏</el-link>--> +<!-- </el-row>--> </el-tab-pane> </el-tabs> @@ -176,6 +187,7 @@ <el-date-picker v-model="yyTime" type="date" + value-format="yyyy-MM-dd HH:mm" placeholder="选择预约时间"> </el-date-picker> @@ -235,6 +247,7 @@ orderItemList:[], projList:[], taocanList:[], + tcIsOpen : false, yyTime:new Date(), @@ -363,6 +376,14 @@ closeFram: function () { parent.layer.close(parent.layer.getFrameIndex(window.name)); }, + openOrCloseTc : function (item, index, value) { + if (value == 1) { + item.openOrClose = true; + } else { + item.openOrClose = false; + } + Vue.set(this.taocanList, index, item); + } } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service-hk.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service-hk.html index e4f5269..bac4c1a 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service-hk.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service-hk.html @@ -160,7 +160,7 @@ title: "打印服务单", area: ['250px', '550px'], maxmin: true, - content: [basePath + '/admin/redirect/hive/beautySalon/print-service?id=' + id] + content: [basePath + '/admin/projService/printOrder?id=' + id] }); } @@ -176,7 +176,13 @@ c : false }).invoke(basePath+"/admin/projService/hkService?id="+id, function(loj) { layer.msg(loj.getValue("info"),{icon:1,time:2000},function(){ - parent.myGrid.serchData(); + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.serviceOrderQuery(); + } MTools.closeForm() }); }); diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html index 2c4ebd7..6f356c3 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html @@ -71,12 +71,18 @@ <input autocomplete="off" name="closureTime" type="text" class="form-control datetimepicker" id="endTime"> </div> - + <div class="form-group mr-20"> + <label >所属门店</label> + <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" + th:data-url="@{/admin/shopInfo/findAll}"> + <option value=''>--请选择部所属门店--</option> + </select> + </div> <input type="hidden" value="待预约" name="state" id="state"/> <div class="form-group mr-20"> <button type="button" class="btn btn-my btn-sm" id="btn4" value="">全部</button> <button type="button" class="btn btn-my btn-sm active" id="btn1" value="待预约">待预约</button> - <button type="button" class="btn btn-my btn-sm" id="btn2" value="预约成功待处理">待派单</button> + <!-- <button type="button" class="btn btn-my btn-sm" id="btn2" value="预约成功待处理">待派单</button>--> <button type="button" class="btn btn-my btn-sm" id="btn3" value="需配料">待配料</button> <button type="button" class="btn btn-my btn-sm" id="btn3" value="配料完成">待服务</button> <button type="button" class="btn btn-my btn-sm" id="btn6" value="服务中">服务中</button> @@ -111,9 +117,11 @@ <th data-field="money">消耗金额</th> <th data-field="createTime" data-sortable="true" data-formatter="MGrid.getTime">下单时间</th> <th data-field="yyTime" data-sortable="true" data-formatter="MGrid.getTime">预约时间</th> + <th data-field="consumeTime" data-sortable="true" data-formatter="MGrid.getTime">划扣时间</th> <th data-field="totalTime" data-sortable="true">服务时长</th> <th data-field="isOverTime" data-formatter="overTime">超时时间</th> <th data-field="createStaffName">下单顾问</th> + <th data-field="shopName">门店</th> <th data-sortable="true" data-field="id" data-formatter="buidOperate">操作</th> </tr> </thead> @@ -124,22 +132,22 @@ <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script type="text/javascript"> - $("#vipPhone").val($.query.get('vipPhone')); - var _initParam = {format : 'yyyy-mm-dd hh:ii', - todayBtn : true, - autoclose : true, - startView : 2, - maxView : 3, - minView : 0}; - MTools.ininDatetimepicker(_initParam); - //限制结束时间不小于开始时间 - var initParam = {format : 'yyyy-mm-dd hh:ii', - todayBtn : true, - autoclose : true, - startView : 2, - maxView : 3, - minView : 0}; - MTools.limitStartEndTime(initParam); + $("#vipPhone").val($.query.get('vipPhone')); + var _initParam = {format : 'yyyy-mm-dd hh:ii', + todayBtn : true, + autoclose : true, + startView : 2, + maxView : 3, + minView : 0}; + MTools.ininDatetimepicker(_initParam); + //限制结束时间不小于开始时间 + var initParam = {format : 'yyyy-mm-dd hh:ii', + todayBtn : true, + autoclose : true, + startView : 2, + maxView : 3, + minView : 0}; + MTools.limitStartEndTime(initParam); var myGrid; $(function () { @@ -171,9 +179,9 @@ } } - var btns=[]; - btns[0]="",btns[1]="",btns[2]="",btns[3]="",btns[4]="",btns[5]="",btns[6]=""; - function buidOperate(value, row, index) { + var btns=[]; + btns[0]="",btns[1]="",btns[2]="",btns[3]="",btns[4]="",btns[5]="",btns[6]=""; + function buidOperate(value, row, index) { var status = row.state; var html ='<a class="text-primary mr-5" onClick="selectFwz(' + value + ')" title="查看"><i class="fa fa-eye">查看</i></a> ' switch (status) { @@ -186,11 +194,16 @@ break; case '需配料': html +=btns[3].replace('VALUE',value); + html += btns[2].replace('VALUE',value); break; case '配料完成': break; case '服务完成': html +=btns[4].replace('VALUE',value); + html += btns[2].replace('VALUE',value); + break; + case '待确认': + html +=btns[7].replace('VALUE',value); break; } html += btns[5].replace('VALUE',value); @@ -205,7 +218,7 @@ title: "修改订单时间", maxmin: true, area: [MUI.SIZE_L, '500px'], - content: [basePath + '/admin/projService/toServiceOrderUpdateTime?id=' + id] + content: [basePath + '/admin/redirect/hive/beautySalon/updateServiceOrderTimeV2?id=' +id] }); } @@ -262,42 +275,60 @@ - function removeOrder(id) { - var id=myGrid.getSelectItemId(); - layer.confirm('确定取消此订单?', { - btn: ['确认', '取消'] //可以无限个按钮 - }, function(index, layero){ - $.post(basePath+'/admin/projService/cancelOrder?id='+id, {}, function(data){ - parent.layer.msg(data.info,{icon: 1}); - layer.closeAll(); - myGrid.serchData(); - }); - //按钮【按钮一】的回调 - }, function(index){ - // alert("2 = "+index); - //按钮【按钮二】的回调 - }); + function removeOrder(id) { + var id=myGrid.getSelectItemId(); + layer.confirm('确定取消此订单?', { + btn: ['确认', '取消'] //可以无限个按钮 + }, function(index, layero){ + $.post(basePath+'/admin/projService/cancelOrder?id='+id, {}, function(data){ + parent.layer.msg(data.info,{icon: 1}); + layer.closeAll(); + myGrid.serchData(); + }); + //按钮【按钮一】的回调 + }, function(index){ + // alert("2 = "+index); + //按钮【按钮二】的回调 + }); - } + } - //打开查看界面 - function openEdit2() { - var id=myGrid.getSelectItemId(); - layer.open({ - type : 2, - title : "查看服务单详情", - area : MUI.SIZE_M, - maxmin : true, - content : [ basePath+'/admin/projService/serviceInfo?pageFlae=pc&id=' + id] - }); - } + function confirmServiceOrder(id) { + layer.confirm('确定确认订单吗?', { + btn: ['确认', '取消'] //可以无限个按钮 + }, function(index, layero){ + $.post(basePath+'/admin/projService/confirmServiceOrder?id='+id, {}, function(data){ + parent.layer.msg(data.info,{icon: 1}); + layer.closeAll(); + myGrid.serchData(); + }); + //按钮【按钮一】的回调 + }, function(index){ + // alert("2 = "+index); + //按钮【按钮二】的回调 + }); - //导出 - //导出 - function exportExcel(){ - var param=MForm.toUrlParam("#serchform"); - window.location.href=basePath+"/admin/projService/exportExcel?"+param; - } + } + + + //打开查看界面 + function openEdit2() { + var id=myGrid.getSelectItemId(); + layer.open({ + type : 2, + title : "查看服务单详情", + area : MUI.SIZE_M, + maxmin : true, + content : [ basePath+'/admin/projService/serviceInfo?pageFlae=pc&id=' + id] + }); + } + + //导出 + //导出 + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/projService/exportExcel?"+param; + } </script> @@ -305,9 +336,9 @@ btns[0]='<a class="text-primary mr-5" onClick="openPb(\'VALUE\')" title="排班"><i class="fa fa-calendar">排班</i></a> ' </script> -<script matrix:btn="serviceClub-paidan" > - btns[1]='<a class="text-primary mr-5" onClick="openPd(\'VALUE\')" title="派单"><i class="fa fa-sign-in">派单</i></a>' -</script> +<!--<script matrix:btn="serviceClub-paidan" >--> +<!-- btns[1]='<a class="text-primary mr-5" onClick="openPd(\'VALUE\')" title="派单"><i class="fa fa-sign-in">派单</i></a>'--> +<!--</script>--> <script matrix:btn="serviceClub-edit" > btns[2]='<a class="text-primary mr-5" onClick="updatePd(\'VALUE\')" title="修改"><i class="fa fa-edit">修改</i></a>' @@ -327,5 +358,8 @@ <script matrix:btn="serviceClub-edit"> btns[6]='<a class="text-primary mr-5" onclick="updateTime(\'VALUE\')" title="修改时间"><i class="fa fa-edit">修改时间</i></a> ' </script> +<script matrix:btn="serviceClub-edit"> + btns[7]='<a class="text-primary mr-5" onclick="confirmServiceOrder(\'VALUE\')" title="确认服务单"><i class="fa fa-edit">确认服务单</i></a> ' +</script> </html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html index 81177eb..5bc8e86 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html @@ -40,6 +40,14 @@ <input autocomplete="off" name="endTimeVo" type="text" class="form-control datetimepicker" id="endTime"> </div> + <div class="form-group mr-20"> + <label >所属门店</label> + <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" + th:data-url="@{/admin/shopInfo/findAll}"> + <option value=''>--请选择部所属门店--</option> + </select> + </div> + <input autocomplete="off" type="hidden" name="statu" value="待付款" id="statu"/> <div class="form-group mr-20"> <button type="button" class="btn btn-my btn-sm" id="btn0" value="" >全部</button> @@ -78,13 +86,18 @@ <th data-field="orderTime" data-formatter="MGrid.getTime" data-sortable="true">下单时间</th> <th data-field="total">订单总价</th> + <th data-field="zkTotal">折后价</th> + <th data-field="payTime" data-formatter="MGrid.getTime" + data-sortable="true">支付时间</th> <th data-field="staffName">下单顾问</th> <th data-field="cashPay">现金支付金额</th> <th data-field="cardPay">卡支付金额</th> <th data-field="arrears">欠款金额</th> + <th data-field="statu">订单状态</th> <th data-field="remark">备注</th> + <th data-field="shopName">门店</th> </tr> </thead> @@ -216,20 +229,26 @@ function cancelOrder() { var id=myGrid.getSelectItemId(); layer.confirm('确定取消此订单?', { - btn: ['确认', '取消并删除', '取消'] //可以无限个按钮 + btn: ['确认', '取消'] //可以无限个按钮 }, function(index, layero){ $.post(basePath+'/admin/order/cancelOrder?id='+id+'&del=0', {}, function(data){ - parent.layer.msg(data.info,{icon: 1}); + if (data.status == '200') { + parent.layer.msg(data.info,{icon: 1}); + } else { + parent.layer.msg(data.info,{icon: 2}); + } layer.closeAll(); myGrid.serchData(); }); - }, function(index){ - $.post(basePath+'/admin/order/cancelOrder?id='+id+'&del=1', {}, function(data){ - parent.layer.msg(data.info,{icon: 1}); - layer.closeAll(); - myGrid.serchData(); - }); - }, function(index){ + }, + // function(index){ + // $.post(basePath+'/admin/order/cancelOrder?id='+id+'&del=1', {}, function(data){ + // parent.layer.msg(data.info,{icon: 1}); + // layer.closeAll(); + // myGrid.serchData(); + // }); + // }, + function(index){ //按钮【按钮二】的回调 }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateOrderTime.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateOrderTime.html index e1c132d..976e611 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateOrderTime.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateOrderTime.html @@ -55,11 +55,11 @@ <div class="form-group"> - <label class="col-sm-2 control-label">订单时间</label> + <label class="col-sm-2 control-label">收款时间</label> <div class="col-sm-4"> - <input autocomplete="off" name="orderTime" type="text" + <input autocomplete="off" name="payTime" type="text" class="form-control datetimepicker" - th:value="${#dates.format(order.orderTime, 'yyyy-MM-dd hh:mm')}" /> + th:value="${#dates.format(order.payTime, 'yyyy-MM-dd hh:mm')}" /> </div> </div> <br> @@ -83,7 +83,13 @@ var myForm = MForm.initForm({ invokeUrl : basePath+"/admin/order/updateOrderTime", afterSubmit : function(loj) { - _p.myGrid.serchData(); + if(_p.myGrid) { + _p.myGrid.serchData(); + } + + if (_p.app) { + _p.app.orderQuery(); + } }, }); diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTime.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTime.html index 95a9f36..1287221 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTime.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTime.html @@ -1,9 +1,4 @@ - - - - - -<!DOCTYPE HTML> +<!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> @@ -55,11 +50,11 @@ <div class="form-group"> - <label class="col-sm-2 control-label">订单时间</label> + <label class="col-sm-2 control-label">划扣时间</label> <div class="col-sm-4"> - <input autocomplete="off" name="createTime" type="text" + <input autocomplete="off" name="consumeTime" type="text" class="form-control datetimepicker" - th:value="${#dates.format(serviceOrder.createTime, 'yyyy-MM-dd hh:mm')}" + th:value="${#dates.format(serviceOrder.consumeTime, 'yyyy-MM-dd hh:mm')}" </div> </div> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTimeV2.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTimeV2.html new file mode 100644 index 0000000..5f36762 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTimeV2.html @@ -0,0 +1,126 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + +</head> +<body> +<div class="ibox-content" id="app" v-cloak > + <el-form :model="serviceOrder" ref="form" label-width="100px" class="demo-form"> + + + <el-form-item label="创建时间"> + <el-date-picker v-model="serviceOrder.createTime" type="datetime"></el-date-picker> + </el-form-item> + + + <el-form-item label="预约时间"> + <el-date-picker v-model="serviceOrder.yyTime" type="datetime"></el-date-picker> + </el-form-item> + + + <el-form-item label="划扣时间"> + <el-date-picker v-model="serviceOrder.consumeTime" type="datetime" ></el-date-picker> + <span>修改划扣时间才会同步修改服务单业绩</span> + </el-form-item> + + <el-form-item> + <el-button type="primary" @click="submitForm('form')" >保存</el-button> + <el-button @click="closeFram()">关闭</el-button> + </el-form-item> + + </el-form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script src="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.umd.min.js"></script> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.min.css"> + + +<script> + var id = $.query.get("id"); + + + var app = new Vue({ + el: '#app', + data: { + + //表单数据 + serviceOrder:{} + + }, + + /** + * 初始化数据表 + */ + created: function () { + this.loadData() + }, + + methods: { + loadData(){ + let _this=this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/projService/findServiceOrderInfoVo/'+id, + callback: function (data) { + _this.serviceOrder = data.data; + } + }); + }, + submitForm(){ + let _this=this; + let data={ + id:this.serviceOrder.id, + yyTime:this.serviceOrder.yyTime, + createTime:this.serviceOrder.createTime, + consumeTime:this.serviceOrder.consumeTime + } + AjaxProxy.requst({ + app: _this, + data: data, + contentType: 'application/json', + url: basePath + '/admin/projService/updateOrderTime', + callback: function (data) { + + _this.$message.success("修改成功"); + if(parent.myGrid){ + parent.myGrid.serchData() + } + if(parent.app){ + parent.app.serviceOrderQuery(); + } + setInterval(MTools.closeIframe(), 1000); + + } + }); + + }, + closeFram: function () { + + parent.layer.close(parent.layer.getFrameIndex(window.name)); + + }, + + } + + }) +</script> + +</body> +</html> + diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html index 6b949bb..cd96811 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html @@ -1,5 +1,5 @@ <!DOCTYPE HTML> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="utf-8"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> @@ -9,9 +9,12 @@ content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> <meta http-equiv="Cache-Control" content="no-siteapp"/> <!-- 本框架基本脚本和样式 --> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> <script type="text/javascript" th:src="@{/js/function/meiduCommon.js}"></script> @@ -52,234 +55,1541 @@ .userList li:hover { background: #eee; } + + .ibox-content { + background-color: rgba(240, 242, 245, 1); + } + + .col-style { + line-height: 30px; + height: 30px; + text-align: center; + padding: 0 5px; + display: inline-block; + vertical-align: top; + } + + .el-tag + .el-tag { + margin-left: 10px; + margin-bottom: 10px; + } + .button-new-tag { + margin-left: 10px; + height: 24px; + line-height: 22px; + padding-top: 0; + padding-bottom: 0; + } + .input-new-tag { + width: 90px; + margin-left: 10px; + vertical-align: bottom; + } + + .table-style { + margin: 20px 0; + padding: 20px 10px; + border: 1px solid #DCDFE6; + } + + .el-autocomplete { + display: block !important; + } + + .vip-info { + padding: 30px 20px; + } + + .vip-info p { + line-height: 30px; + } </style> </head> -<body class="ibox-content container-fluid" onkeypress="dosearch(event)"> +<body> +<div class="ibox-content container-fluid" id="app"> + <el-container> + <el-header style="background-color: white; margin: 15px; line-height: 60px"> + <el-col :span="7"> + <el-col :span="19"> + <el-autocomplete + :fetch-suggestions="querySearch" + :trigger-on-focus="false" + @select="handleSelect" + v-model="searchValue" placeholder="输入会员姓名/手机号码/编号" + @keyup.enter.native="searchVipInfo"></el-autocomplete> + </el-col> + <el-col :span="1"> + <el-button type="primary" @click="searchVipInfo">查询</el-button> + </el-col> + </el-col> + <el-col :span="8" style="float: right; margin-right: 20px;"> -<div class="row"> - <div class="row "> + <el-button type="primary" plain @click="recharge">充值</el-button> + <el-button type="warning" plain @click="addOrder">开单</el-button> + <el-button type="success" plain @click="addServiceOrder">开服务单</el-button> + <el-button type="info" plain @click="exportExcel">导出项目</el-button> + <el-button type="primary" plain @click="openAdd">会员注册</el-button> + </el-col> + </el-header> + <el-container> + <el-aside style="background-color: white; margin:0 15px; width: 400px"> + <el-row style="margin-left: 26px; margin-right: 26px;"> + <el-row type="flex" justify="center"> + <el-col :span="20" style="padding: 15px; text-align: center;"> + <el-avatar :size="150" :src="circleUrl"></el-avatar> + </el-col> + </el-row> + <el-row type="flex" justify="center"> + <el-col :span="4" style="text-align: center;"><span style="font-weight: bolder">{{vipInfo.vipName}}</span></el-col> + <el-col :span="5" style="text-align: center;">{{vipInfo.vipType}}</el-col> + </el-row> + <el-row type="flex" justify="center"> + <span class="col-style"><span v-if="vipInfo.age != null && vipInfo.age != ''">{{vipInfo.age}}</span><span v-else>-</span></span> + <span class="col-style"><span v-if="vipInfo.addr != null && vipInfo.addr != ''">{{vipInfo.addr}}</span><span v-else>-</span></span> + <span class="col-style">{{vipInfo.phone}}</span> + </el-row> + <el-row style="padding: 10px 20px;"> + <p>余额:<span v-if="vipInfo.balance != null">{{vipInfo.balance}}元</span></p> + <p>积分:<span v-if="vipInfo.pointAll != null">{{vipInfo.pointAll}}</span></p> + <p>欠款金额:<span v-if="vipInfo.arrears != null">{{vipInfo.arrears}} 元</span></p> + <p>累计消费金额:<span v-if="vipInfo.totalMoney != null">{{vipInfo.totalMoney.toFixed(2)}} 元</span></p> + <p>累计消费次数:<span v-if="vipInfo.totalTimes != null">{{vipInfo.totalTimes}} 次</span></p> + <p>上次消费时间:<span v-if="vipInfo.payTime">{{vipInfo.payTime}}</span></p> + </el-row> + <el-row style="border-top: 2px dashed #E4E7ED; border-bottom: 2px dashed #E4E7ED; padding: 10px 0px;"> + <h4>标签</h4> + <el-tag type="info" + size="small" + :key="tag.label" + v-for="tag in tags.tags" + :disable-transitions="false" + @close="handleClose(tag)"> + {{tag.label}} + </el-tag> + <el-input + class="input-new-tag" + v-if="tags.inputVisible" + v-model="tags.inputValue" + ref="saveTagInput" + size="mini" + @keyup.enter.native="handleInputConfirm" + @blur="handleInputConfirm" + ></el-input> +<!-- <el-button v-else class="button-new-tag" size="mini" @click="showInput">+</el-button>--> + </el-row> + <el-row style="padding: 10px 0;"> + <h4>消费门店</h4> + <el-row style="text-align: center"> + <el-tag v-for="item in vipInfo.shopNames" >{{item}}</el-tag> + </el-row> + </el-row> + </el-row> + </el-aside> + <el-main style="background-color: white; margin-right: 15px; padding: 20px 30px;"> + <el-tabs v-model="activeName" type="card" @tab-click="tabHandleClick"> + <el-tab-pane label="会员信息" name="vipInfo"> + <el-row class="vip-info"> + <el-col :span="10"> + <p>生日 : {{vipInfo.birthday1}}</p> + <p>会员状态 : {{vipInfo.vipState}}</p> + <p>会员编号 : {{vipInfo.vipNo}}</p> + <p>注册时间 : {{vipInfo.createTime}}</p> + <p>到店途径 : {{vipInfo.arrivalWay}}</p> + </el-col> + <el-col :span="10"> + <p>会员卡类型 : {{vipInfo.vipType}}</p> + <p>会员等级 : {{vipInfo.vipLevel == null ? "" : vipInfo.vipLevel.levelName}}</p> + <p>生肖/星座 : {{vipInfo.constell}}</p> + <p>地址 : {{vipInfo.addr}}</p> + <p>健康顾问 : {{vipInfo.staffName}}</p> + </el-col> + </el-row> + </el-tab-pane> + <el-tab-pane label="项目/套餐" name="proj"> + <el-row style="line-height: 40px;"> + <el-col :span="10" style="margin-left: 20px;"> + <el-radio-group v-model="projTab.projType" @change="refreshTable(1)"> + <el-radio label="proj">项目</el-radio> + <el-radio label="taocan">套餐</el-radio> + <el-radio label="card">卡项</el-radio> + </el-radio-group> + </el-col> + <el-col :span="3" style="float: right; margin-right: 20px;"> + <el-select v-model="projTab.projIsValid" placeholder="请选择" @change="selectChange"> + <el-option + v-for="item in projTab.projOptions" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-col> + </el-row> + <el-row class="table-style"> + <el-table id="proj" v-show="projTab.projType=='proj'" :data="projTab.projTableData" + style="width: 100%"> + <el-table-column + label="项目名称" + width="180"> + <template slot-scope="scope"> + <span >{{scope.row.projName}}({{scope.row.projInfo.code}})</span> + </template> + </el-table-column> + <el-table-column + prop="source" + label="来源" + width="180"> + </el-table-column> + <el-table-column + prop="status" + label="状态"> + </el-table-column> + <el-table-column + prop="balance" + label="项目余额"> + </el-table-column> + <el-table-column + prop="surplusCount" + label="余次"> + </el-table-column> + <el-table-column + prop="failTime" + label="到期时间"> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button matrix:btn="vipinfoClub-youxiao" v-if="scope.row.status!='有效'" type="text" size="small" @click="tabProjValid(scope.$index, scope.row)">有效</el-button> + <el-button matrix:btn="vipinfoClub-wuxiao" v-if="scope.row.status!='无效'" type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> + <el-button matrix:btn="vipinfoClub-dongjie" v-if="scope.row.status!='冻结'" type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> + <el-button matrix:btn="vipinfoClub-cardEdit" type="text" size="small" @click="tabProjEdit(scope.$index, scope.row)">编辑</el-button> + <el-button type="text" @click="openOrder(scope.$index, scope.row)" size="small">订单</el-button> + <el-button type="text" size="small" @click="openProjUseFlow(scope.$index, scope.row)">操作记录</el-button> + </template> + </el-table-column> + </el-table> - <div class="col-sm-12 ibox-content"> - <form method="post" id="dataform" class="dataform form-inline"> - <div class="pd-20 form-group"> - <div class="text-l "> - <input type="text" id="key" placeholder="输入会员姓名/手机号码/编号" autocomplete="off" - style="width: 400px" class="form-control"> - <button type="button" class="btn btn-success radius EXSerchBtn " - onclick="selectByKey();"> - <i class="fa fa-search"> </i> 查找 - </button> - <ul id="userList" class="userList " - style="width: 400px; display: none"> - </ul> + <el-table id="taocan" v-show="projTab.projType=='taocan'" :data="projTab.taocanTableData" + style="width: 100%;" + row-key="id" :tree-props="{children: 'taocanProjUse', hasChildren: 'hasChildren'}"> + <el-table-column + label="名称" + width="280"> + <template slot-scope="scope"> + <span >{{scope.row.projName}}({{scope.row.projInfo.code}})</span> + </template> + </el-table-column> + <el-table-column + prop="source" + label="来源" + width="180"> + </el-table-column> + <el-table-column + prop="status" + label="状态" + width="180"> + </el-table-column> + <el-table-column + prop="balance" + label="余额"> + </el-table-column> + <el-table-column + prop="surplusCount" + label="套餐余次"> + </el-table-column> + <el-table-column + prop="failTime" + label="到期时间"> + </el-table-column> + <el-table-column label="操作" fixed="right" width="160"> + <template slot-scope="scope"> + <el-button matrix:btn="vipInfo-youxiao" v-if="scope.row.status!='有效'" type="text" size="small" @click="tabProjValid(scope.$index, scope.row)">有效</el-button> + <el-button matrix:btn="vipInfo-wuxiao" v-if="scope.row.status!='无效'" type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> + <el-button matrix:btn="vipInfo-dongjie" v-if="scope.row.status!='冻结' && scope.row.taocanId == null" type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> + <el-button matrix:btn="vipInfo-cardEdit" v-if="scope.row.taocanId == null" type="text" size="small" @click="tabProjEdit(scope.$index, scope.row)">编辑</el-button> + <el-button type="text" v-if="scope.row.orderId != null" @click="openOrder(scope.$index, scope.row)" size="small">订单</el-button> + <el-button type="text" size="small" @click="openProjUseFlow(scope.$index, scope.row)">操作记录</el-button> + </template> + </el-table-column> + </el-table> - </div> - </div> - </form> + <el-table id="card" v-show="projTab.projType=='card'" :data="projTab.cardTableData" + style="width: 100%;"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="cardName" + label="充值卡名称" width="160"> + </el-table-column> + <el-table-column + prop="useTotal" + label="总次数"> + </el-table-column> + <el-table-column + prop="lastCount" + label="剩余次数"> + </el-table-column> + <el-table-column + prop="realMoney" + label="本金"> + </el-table-column> + <el-table-column + prop="giftMoney" + label="赠送金额"> + </el-table-column> + <el-table-column + prop="source" + label="来源"> + </el-table-column> + <el-table-column + prop="status" + label="状态"> + </el-table-column> + <el-table-column + prop="isOver" + label="是否使用完成" :formatter="cardIsOrderFormatter"> + </el-table-column> + <el-table-column + prop="failTime" + label="到期时间" width="160"> + </el-table-column> + <el-table-column + prop="remark" + label="备注"> + </el-table-column> + <el-table-column label="操作" fixed="right" width="160"> + <template slot-scope="scope"> + <el-button matrix:btn="vipInfo-youxiao" v-if="scope.row.status!='有效' && scope.row.isVipCar =='N' " type="text" size="small" @click="tabProjValid(scope.$index, scope.row)">有效</el-button> + <el-button matrix:btn="vipInfo-wuxiao" v-if="scope.row.status!='无效' && scope.row.isVipCar =='N' " type="text" size="small" @click="tabProjInvalid(scope.$index, scope.row)">无效</el-button> + <el-button matrix:btn="vipInfo-dongjie" v-if="scope.row.status!='冻结' && scope.row.isVipCar =='N' " type="text" size="small" @click="tabProjCold(scope.$index, scope.row)">冻结</el-button> + <el-button matrix:btn="vipInfo-cardEdit" type="text" size="small" @click="tabProjEdit(scope.$index, scope.row)">编辑</el-button> + <el-button type="text" v-if="scope.row.isVipCar =='N'" @click="openOrder(scope.$index, scope.row)" size="small">订单</el-button> + <el-button type="text" size="small" @click="openMoneyCardUseFlow(scope.$index, scope.row)">操作记录</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row> + <el-pagination background + @size-change="projTabSizeChange" + @current-change="projTabCurrentPage" + :current-page="projTab.page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="projTab.page.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="projTab.page.total"> + </el-pagination> + </el-row> + <el-dialog title="设置过期时间" :visible.sync="projTab.failTimeDialog"> + <el-form> + <el-form-item label="选择过期时间"> + <el-date-picker v-model="projTab.failTime" + type="date" + format="yyyy-MM-dd" + placeholder="选择日期时间"> + </el-date-picker> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="updateFailTimeFn">确 定</el-button> + <el-button @click="projTab.failTimeDialog = false">取 消</el-button> + </div> + </el-dialog> + </el-tab-pane> + <el-tab-pane label="服务单" name="serviceOrder"> + <el-row style="line-height: 40px;"> + <el-col :span="11"> + <el-date-picker v-model="serviceOrderTab.selectTime" + type="datetimerange" + range-separator="至" format="yyyy-MM-dd HH:mm" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-col> + <el-col :span="5"> + <el-select v-model="serviceOrderTab.state" placeholder="请选择"> + <el-option + v-for="item in serviceOrderTab.states" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-col> + <el-col :span="1" style="margin-left: 5px;"> + <el-button type="primary" @click="serviceOrderQuery">查询</el-button> + </el-col> + </el-row> + <el-row class="table-style"> + <el-table :data="serviceOrderTab.tableData" + style="width: 100%;"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="serviceNo" + label="服务单号" + width="160"> + </el-table-column> + <el-table-column + prop="money" + label="消耗金额"> + </el-table-column> + <el-table-column + prop="createTime" + label="下单时间" width="160"> + </el-table-column> + <el-table-column + prop="yyTime" + label="预约时间" width="160" :formatter="dateFormat"> + </el-table-column> + <el-table-column + prop="totalTime" + label="服务时长"> + </el-table-column> + <el-table-column + prop="isOverTime" + label="超时时间"> + </el-table-column> + <el-table-column + prop="createStaffName" + label="下单顾问"> + </el-table-column> + <el-table-column + prop="state" + label="状态"> + </el-table-column> + <el-table-column fixed="right" label="操作" width="200"> + <template slot-scope="scope"> + <el-button type="text" size="small" @click="lookServiceOrder(scope.$index, scope.row)">查看</el-button> + <el-button matrix:btn="serviceClub-paiban" type="text" size="small" v-if="scope.row.state=='待预约'" @click="paiban(scope.$index, scope.row)">排班</el-button> +<!-- <el-button matrix:btn="serviceClub-paidan" type="text" size="small" v-if="scope.row.state=='预约成功待处理'" @click="giveServiceOrder(scope.$index, scope.row)">派单</el-button>--> + <el-button matrix:btn="serviceClub-edit" type="text" size="small" v-if="scope.row.state=='待预约'" @click="modifyServiceOrder(scope.$index, scope.row)">修改</el-button> + <el-button matrix:btn="serviceClub-peiliao" type="text" size="small" v-if="scope.row.state=='需配料'" @click="peiliao(scope.$index, scope.row)">配料</el-button> + <el-button matrix:btn="serviceClub-huakou" type="text" size="small" v-if="scope.row.state=='服务完成'" @click="hkService(scope.$index, scope.row)">划扣</el-button> + <el-button matrix:btn="serviceClub-edit" type="text" size="small" @click="modifyTime(scope.$index, scope.row)">修改时间</el-button> + <el-button matrix:btn="serviceClub-del" type="text" size="small" v-if="scope.row.state!='预约取消'" @click="cancelServiceOrder(scope.$index, scope.row)">取消</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row> + <el-pagination + background + @size-change="serviceOrderSizeChange" + @current-change="serviceOrderCurrentChange" + :current-page="serviceOrderTab.page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="serviceOrderTab.page.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="serviceOrderTab.page.total"> + </el-pagination> + </el-row> + </el-tab-pane> + <el-tab-pane label="订单" name="order"> + <el-row style="line-height: 40px;"> + <el-col :span="11"> + <el-date-picker v-model="orderTab.selectTime" + type="datetimerange" + range-separator="至" + format="yyyy-MM-dd HH:mm" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-col> + <el-col :span="5"> + <el-select v-model="orderTab.state" placeholder="请选择"> + <el-option + v-for="item in orderTab.states" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-col> + <el-col :span="1" style="margin-left: 5px;"> + <el-button type="primary" @click="orderQuery">查询</el-button> + </el-col> + </el-row> + <el-row class="table-style"> + <el-table :data="orderTab.orderTableData" + style="width: 100%;"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="orderNo" + label="订单号" width="180"> + </el-table-column> + <el-table-column + prop="orderTime" + label="下单时间" width="160" :formatter="oderTimeFormat"> + </el-table-column> + <el-table-column + prop="total" + label="总价"> + </el-table-column> + <el-table-column + prop="zkTotal" + label="折后价"> + </el-table-column> + <el-table-column + prop="staffName" + label="下单顾问"> + </el-table-column> + <el-table-column + prop="arrears" + label="欠款金额"> + </el-table-column> + <el-table-column + prop="statu" + label="订单状态"> + </el-table-column> + <el-table-column + prop="remark" + label="备注" width="100"> + </el-table-column> + <el-table-column label="操作" fixed="right" width="160"> + <template slot-scope="scope"> + <el-button type="text" size="small" @click="lookOrderInfo(scope.$index, scope.row)">查看</el-button> + <el-button matrix:btn="orderClub-payment" v-if="scope.row.statu == '欠款'" type="text" size="small" @click="bjMoney(scope.$index, scope.row)">补交</el-button> + <el-button matrix:btn="orderClub-gathering" v-if="scope.row.statu == '待付款'" type="text" size="small" @click="skMoney(scope.$index, scope.row)">收款</el-button> + <el-button matrix:btn="orderClub-edit" type="text" size="small" @click="updateTime(scope.$index, scope.row)">修改时间</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row> + <el-pagination + background + @size-change="orderSizeChange" + @current-change="orderCurrentChange" + :current-page="orderTab.page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="orderTab.page.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="orderTab.page.total"> + </el-pagination> + </el-row> + </el-tab-pane> + <el-tab-pane label="积分记录" name="scoreTab"> + <el-row style="line-height: 40px;"> + <el-col :span="8"> + <el-date-picker v-model="scoreTab.selectTime" + type="daterange" + range-separator="至" + format="yyyy-MM-dd" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-col> + <el-col :span="8"> <el-input v-model="scoreTab.remarks" placeholder="请输入备注查询" ></el-input></el-col> + <el-col :span="6" style="margin-left: 5px;"> + <el-button type="primary" @click="scoreCheckQuery">查询</el-button> + <el-button type="primary" @click="changeScore">调整</el-button> + </el-col> + </el-row> + <el-row class="table-style"> + <el-table :data="scoreTab.scoreTableDate" + style="width: 100%;"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="createTime" + label="时间"> + </el-table-column> + <el-table-column + prop="optionName" + label="操作人员"> + </el-table-column> + <el-table-column + prop="shopName" + label="门店"> + </el-table-column> + <el-table-column + prop="recNum" + label="修改数量"> + </el-table-column> + <el-table-column + prop="nowScore" + label="余额"> + </el-table-column> + <el-table-column + prop="remarks" + label="备注"> + </el-table-column> + </el-table> + </el-row> + <el-row> + <el-pagination + background + @size-change="scoreCheckSizeChange" + @current-change="scoreCheckCurrentChange" + :current-page="scoreTab.page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="scoreTab.page.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="scoreTab.page.total"> + </el-pagination> + </el-row> + </el-tab-pane> + <el-tab-pane label="皮肤检测" name="skinCheck"> + <el-row style="line-height: 40px;"> + <el-col :span="11"> + <el-date-picker v-model="skinTab.selectTime" + type="daterange" + range-separator="至" + format="yyyy-MM-dd" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-col> + <el-col :span="6" style="margin-left: 5px;"> + <el-button type="primary" @click="skinCheckQuery">查询</el-button> + <el-button type="success" @click="addSkinCheck">新增</el-button> + </el-col> + </el-row> + <el-row class="table-style"> + <el-table :data="skinTab.skinTableDate" + style="width: 100%;"> + <el-table-column + type="index" + width="50"> + </el-table-column> + <el-table-column + prop="checkUserName" + label="检测人员"> + </el-table-column> + <el-table-column + prop="shopName" + label="门店"> + </el-table-column> + <el-table-column + prop="checkTime" + label="检测时间"> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="text" size="small" @click="editSkinCheck(scope.$index, scope.row)">编辑</el-button> + <el-button type="text" size="small" @click="delSkinCheck(scope.$index, scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row> + <el-pagination + background + @size-change="skinCheckSizeChange" + @current-change="skinCheckCurrentChange" + :current-page="skinTab.page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="skinTab.page.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="skinTab.page.total"> + </el-pagination> + </el-row> + </el-tab-pane> + + + </el-tabs> + </el-main> + </el-container> + </el-container> + + <el-dialog title="积分调整" :visible.sync="scoreTab.showChangePaln"> + <el-form :model="scoreTab.form"> + <h3>可用积分:{{vipInfo.pointAll}}</h3> + <el-form-item label="调整数量" > + <el-input v-model="scoreTab.form.amount" autocomplete="off"></el-input> + </el-form-item> + <el-form-item label="调整备注" > + <el-input v-model="scoreTab.form.remarks" autocomplete="off"></el-input> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button @click="scoreTab.showChangePaln = false">取 消</el-button> + <el-button type="primary" @click="submitChangeScore" >确 定</el-button> </div> - </div> - <input autocomplete="off" type="hidden" id="vipId"> - <div class="row"> - <div class=" col-sm-9 "> - <div class="panel panel-default"> - <div class="panel-heading">会员信息</div> - - <table class="table table-bordered table-striped " - style="width: 100%;"> - <tr> - <td width="10%" class="text-r"><b>会员姓名:</b></td> - <td width="20%" name="vipName" id="vipName"></td> - <td width="10%" class="text-r"><b>性别:</b></td> - <td width="20%" name="sex" id="sex"></td> - <td width="10%" class="text-r"><b>生日:</b></td> - <td width="20%" name="birthday1" id="birthday1"></td> - </tr> - - <tr> - <td width="10%" class="text-r"><b>会员类型:</b></td> - <td width="20%" name="vipType" id="vipType"></td> - <td width="10%" class="text-r"><b>会员状态:</b></td> - <td width="20%" name="vipState" id="vipState"></td> - <td width="10%" class="text-r"><b>会员等级:</b></td> - <td width="20%" name="levelName" id="levelName"></td> - - </tr> - <tr> - <td width="10%" class="text-r"><b>会员编号:</b></td> - <td width="20%" name="animalSign" id="vipNo"></td> - <td width="10%" class="text-r"><b>生肖/星座:</b></td> - <td width="20%" name="constell" id="constell"></td> - <td width="10%" class="text-r"><b>注册时间:</b></td> - <td width="20%" name="createTime" id="createTime"></td> - </tr> - <tr> - <td width="10%" class="text-r"><b>手机号码:</b></td> - <td width="20%" name="phone" id="phone"></td> - <td width="10%" class="text-r"><b>入会时间:</b></td> - <td width="20%" name="inDate" id="inDate"></td> - <td width="10%" class="text-r"><b>地址:</b></td> - <td width="20%" name="addr" id="addr"></td> - </tr> - <tr> - <td width="10%" class="text-r"><b>到店途径:</b></td> - <td width="20%" name="arrivalWay" id="arrivalWay"></td> - <td width="10%" class="text-r"><b>总佣金:</b></td> - <td width="20%" name="commissionAll" id="commissionAll"></td> - <td width="10%" class="text-r"><b>总积分:</b></td> - <td width="20%" name="pointAll" id="pointAll"></td> - </tr> - - <tr> - <td width="10%" class="text-r"><b>储值卡余额:</b></td> - <td width="20%" name="bal" id="bal"></td> - <td width="10%" class="text-r"><b>备注:</b></td> - <td width="20%" name="remark" id="remark"></td> - <td width="10%" class="text-r"><b>健康顾问:</b></td> - <td width="20%" name="staffName" id="staffName"></td> - <td style="display: none" id="id" name="id"></td> - </tr> - <tr> - <td class="text-center" colspan="6"> - - <button matrix:btn="vipinfoClub-recharge" class="btn btn-success radius size-S isActive " - disabled="disabled" onclick='openCz()'> - <i class="fa fa-jpy"></i> 充值 - </button> - - <button matrix:btn="vipinfoClub-payment" class="btn btn-success radius size-S isActive" - disabled="disabled" onclick='openOrderList("欠款")'> - <i class="fa fa-paypal"></i> 补交 - </button> - - <button matrix:btn="vipinfoClub-gathering" class="btn btn-success radius size-S isActive" - disabled="disabled" onclick='openOrderList("待付款")'> - <i class="fa fa-paypal"></i> 收款 - </button> - <button matrix:btn="vipinfoClub-newService" class="btn btn-success radius size-S isActive" - disabled="disabled" onclick='toRefundOrder()'> - <i class="fa fa-paypal"></i> 退款 - </button> - <button matrix:btn="vipinfoClub-newService" class="btn btn-success radius size-S isActive" - disabled="disabled" onclick='openAddOrder()'> - <i class="fa fa-paypal"></i> 开单 - </button> - <button matrix:btn="vipinfoClub-newService" class="btn btn-success radius size-S isActive" - disabled="disabled" onclick='openAddService()'> - <i class="fa fa-paypal"></i> 开服务单 - </button> - - </td> - </tr> - </table> - </div> - </div> - <div class="col-sm-3"> - <div class="panel panel-default "> - <div class="panel-heading">最近查询会员</div> - <ul class="list-group c " id="historyList"> - </ul> - </div> - </div> - </div> - <div class="row"> - <div class="col-sm-9 text-center"> + </el-dialog> - <button class="btn btn-success radius size-S isActive" - onclick='openOrderList("全部")' disabled="disabled"> - <i class="fa fa-arrows-alt "></i> 订单 - </button> - - <button class="btn btn-success radius size-S isActive" - onclick="openServiceList()" disabled="disabled"> - <i class="fa fa-arrows-alt "></i> 服务单 - </button> - || - <button matrix:btn="vipinfoClub-projTaocan" class="btn btn-success radius size-S isActive" - onclick="openProj()" disabled="disabled"> - <i class="fa fa-star-half-o "></i> 项目管理 - </button> - - - <button matrix:btn="vipinfoClub-projTaocan" class="btn btn-success radius size-S isActive" - onclick="openTc()" disabled="disabled"> - <i class="fa fa-share-alt-square "></i> 套餐管理 - </button> - - - <button matrix:btn="vipinfoClub-projTaocan" class="btn btn-success radius size-S isActive" - onclick="openMoneyCard()" disabled="disabled"> - <i class="fa fa-gbp "></i>充值卡管理 - </button> - || - <button matrix:fn="servicefollow" onclick="openFollow()" type="button" class="btn btn-success isActive" disabled="disabled"> - <i class="fa fa-edit"></i> 跟进记录 - </button> - - <button matrix:btn="vipInfo-edit" onclick="openArchieves()" type="button" class="btn btn-success isActive" disabled="disabled"><i - class="fa fa-edit"></i> 客户档案 - </button> - <button matrix:btn="vipInfo-edit" onclick="openEdit()" type="button" class="btn btn-success isActive" disabled="disabled"><i - class="fa fa-edit"></i> 基本资料 - </button> - - </div> - </div> </div> </body> - - +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script th:inline="javascript"> - //初始带入vip的电话 - var key = $.query.get("vipPhone"); - if(key){ - selectList(key); - } + var app = new Vue({ + el: '#app', + data : { + circleUrl : "", + activeName : 'vipInfo', + tags : { + tags : [], + inputVisible: false, + inputValue: '' + }, + searchValue : "", + vipInfo : {}, + // 项目/套餐 tab + projTab : { + projType : "proj", + projTypeBak : "proj", + projOptions : [{ value : '', label : "全部" }, { value : '有效', label : "有效" }, { value : '无效', label : "无效" }, { value : "冻结", label : "冻结" }, { value : "转让", label : "转让" }, { value : "退款", label : "退款" }], + projIsValid : "", + failTimeDialog : false, + failTime : "", + row : '', - $(function () { - $("#key").keyup( - function () { - var $input = $("#key"); - if ($input.val().length > 1) { - $.AjaxProxy({ - p: { - keyWord: $input.val(), - }, - c: false, - }) - .invoke( - basePath + "/admin/vipInfo/findUserByPhotoOrName", - function (loj) { - var html = ""; - for (var i = 0; i < loj - .getRowCount(); i++) { - html += '<li onclick="selectList(\'' + loj.getString(i, 'phone') + '\')" >' - + loj.getString(i, 'phone') + "-" + loj.getString(i, 'vipName') - + "-" + loj.getString(i, 'vipNo') - + '</li>'; - } - $("#userList").html(html).show(); - }); - } else { - $("#userList").hide(); + projTableData : [], + taocanTableData : [], + cardTableData : [], + page : { + currentPage : 1, + pageSize : 10, + total : 0 } - }); - updateHistory(); - $("#userList").mouseleave(function () { - $(this).hide(); - }) - }) + }, + // 服务单tab + serviceOrderTab : { + tableData : [], + selectTime : '', + state : '', + states : [ { value : '', label : '全部' }, { value : '待预约', label : '待预约' },{ value : '预约成功待处理', label : '待派单' },{ value : '需配料', label : '待配料' }, + { value : '配料完成', label : '待服务' },{ value : '服务中', label : '服务中' }, + { value : '服务完成', label : '服务完成' },{ value : '服务单结束', label : '服务单结束' }, ], + page : { + currentPage : 1, + pageSize : 10, + total : 0 + } + }, + // 订单 tab + orderTab : { + orderTableData : [], + selectTime : '', + state : '', + states : [ { value : '', label : '全部' }, { value : '待付款', label : '待付款' }, { value : '已付款', label : '已付款' }, { value : '欠款', label : '欠款' }, { value : '已取消', label : '已取消' } ], + page : { + currentPage : 1, + pageSize : 10, + total : 0 + } + }, + //用户积分tab + scoreTab : { + scoreTableDate : [], + selectTime : '', + remarks:'', + showChangePaln:false, + page : { + currentPage : 1, + pageSize : 10, + total : 0 + }, + form:{ + amount:'', + remarks:'', + } + + }, + // 皮肤检测tab + skinTab : { + skinTableDate : [], + selectTime : '', + page : { + currentPage : 1, + pageSize : 10, + total : 0 + } + } + }, + created : function() { + var key = $.query.get("vipPhone"); + let _this = this; + + if (key) { + _this.vipInfoFn(key); + } + }, + methods : { + openAdd(){ + layer.full(layer.open({ + type : 2, + title : "添加会员信息", + area : [ MUI.SIZE_L, '450px' ], + content : [ basePath+'/admin/vipInfo/editForm' ] + })); + }, + //打开订单详情页面 + openOrder(index,row){ + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + content : [ basePath + '/admin/order/orderItem?id=' + row.orderId ] + })); + }, + querySearch(queryString, cb) { + $.AjaxProxy({ + p: { + keyWord: queryString, + }, + c: false, + }).invoke( basePath + "/admin/vipInfo/findUserByPhotoOrName", function (loj) { + var results = []; + for (var i = 0; i < loj.getRowCount(); i++) { + var result = {}; + result.value = loj.getString(i, 'phone') + "-" + loj.getString(i, 'vipName') + "-" + loj.getString(i, 'vipNo'); + result.key = loj.getString(i, 'phone'); + results.push(result); + } + cb(results); + }); + }, + handleSelect(row) { + this.vipInfoFn(row.key); + this.searchValue=row.key; + }, + // 请求会员信息 + vipInfoFn(key) { + let _this = this; + if (!key) { + key = _this.vipInfo.phone; + } + // 请求用户信息 + $.AjaxProxy({ + p: { + keyWord: key + } + }).invoke(basePath + "/admin/vipInfo/showVipInfo", function (loj) { + if (loj.getRowCount() == 0) { + layer.msg('未查询到客户信息', { + icon: 5 + }); + return false; + } + let data = loj[0].result.rows[0]; + _this.vipInfo = {}; + _this.vipInfo = data; + _this.circleUrl= _this.vipInfo.photo; + if (data.sysOrder != null) { + _this.vipInfo.totalMoney = data.sysOrder.zkTotal; + _this.vipInfo.totalTimes = data.sysOrder.times; + _this.vipInfo.payTime = data.sysOrder.payTime; + + if (data.sysOrder.shopName) { + var shopNames = data.sysOrder.shopName.split(','); + _this.vipInfo.shopNames = shopNames; + } + } + _this.vipInfo.payTime = moment(_this.vipInfo.payTime).format("YYYY-MM-DD HH:mm:ss") + _this.tags.tags = data.labels; + _this.projTableQueryFn(); + _this.serviceOrderTableQueryFn(); + _this.orderTableDataQueryFn(); + _this.skinCheckTableDataQueryFn(); + _this.refreshTable(); + }); + }, + addLabelFn(key) { + let _this = this; + // 请求用户信息 + $.AjaxProxy({ + p: { + vipId: _this.vipInfo.id, + label : key + } + }).invoke(basePath + "/admin/label/add", function (loj) { + let label = loj.getResult().mapInfo.label; + _this.tags.tags.push(label); + }); + }, + delLabelFn(id) { + $.AjaxProxy({ + p: { + id: id + } + }).invoke(basePath + "/admin/label/del", function (loj) { + }); + }, + searchVipInfo() { + let _this = this; + let inputVisible = _this.tags.inputVisible; + console.log(inputVisible) + if (!inputVisible) { + if (_this.searchValue) { + _this.vipInfoFn(_this.searchValue); + } + } + + }, + + /** ############## 项目/套餐Tab页 start #################### **/ + projTabTableParams() { + let _this = this; + let currentPage = _this.projTab.page.currentPage; + let pageSize = _this.projTab.page.pageSize + return { + vipId: _this.vipInfo.id, + offset: (currentPage - 1) * pageSize, + limit: pageSize, + status: _this.projTab.projIsValid, + }; + }, + // 项目tab页,请求项目数据 + projTableQueryFn() { + let _this = this; + $.AjaxProxy({ + p:_this.projTabTableParams() + }).invoke(basePath + "/admin/projUser/showList", function (loj) { + _this.projTab.page.total = loj.getResult().total; + _this.projTab.projTableData = loj.getValue("rows"); + }); + }, + // 套餐表格数据请求 + taocanTableQueryFn() { + let _this = this; + $.AjaxProxy({ + p:_this.projTabTableParams() + }).invoke(basePath + "/admin/taoCanUser/showTc", function (loj) { + _this.projTab.page.total = loj.getResult().total; + _this.projTab.taocanTableData = loj.getValue("rows"); + }); + }, + // 卡项表格数据请求 + cardTableQueryFn() { + let _this = this; + $.AjaxProxy({ + p:_this.projTabTableParams() + }).invoke(basePath + "/admin/moneyCardUse/showVipMoneyCardList", function (loj) { + _this.projTab.page.total = loj.getResult().total; + _this.projTab.cardTableData = loj.getValue("rows"); + }); + }, + cardIsVipFormatter (row, column) { + if (column.isVipCar === 'Y') { + return "是"; + } else { + return "否" + } + }, + cardIsOrderFormatter(row, column) { + if (column.isOver === 'Y') { + return '是'; + } else { + return "否"; + } + }, + projTabSizeChange(val) { + this.projTab.page.pageSize = val; + this.refreshTable(); + }, + projTabCurrentPage(val) { + this.projTab.page.currentPage = val; + this.refreshTable(); + }, + // 单选框切换 + refreshTable(val) { + let _this = this; + if (val) { + this.projTab.page = { + currentPage : 1, + pageSize : 10, + total : 0 + }; + } + + if (_this.projTab.projType === 'proj') { + _this.projTableQueryFn(); + } + + if (_this.projTab.projType === 'taocan') { + _this.taocanTableQueryFn(); + } + + if (_this.projTab.projType === 'card') { + _this.cardTableQueryFn(); + } - function selectList(phone) { - $("#userList").hide(); - $("#key").val(phone); - selectByKey(); - } + }, + // 下拉框选择 + selectChange() { + this.refreshTable(); + }, + tabProjValid(index, row, val) { + let _this = this; + let projType = _this.projTab.projType; + var url; + if (projType === 'proj') { + url = "/admin/projUser/activeProj"; + } + + if (projType === 'taocan') { + url = "/admin/taoCanUser/activeTc"; + } + + if (projType === 'card') { + url = "/admin/moneyCardUse/active"; + } + + var params = { + id : row.id, + }; + if (val === 1) { + if (_this.projTab.failTime) { + params.failTime = moment(_this.projTab.failTime).format("YYYY-MM-DD"); + } else { + this.$message.error('过期时间不能为空'); + return; + } + } + + $.AjaxProxy({ + p : params + }).invoke(basePath + url, function(loj) { + var rs = loj.attr("result"); + if (rs.info == '已过期') { + _this.projTab.failTimeDialog = true; + _this.projTab.row = row; + } else { + layer.alert(loj.getValue("info"), { + icon : 1 + }); + _this.refreshTable(); + } + + if (val === 1) { + _this.projTab.failTimeDialog = false; + } + }); + + }, + tabProjEdit(index, row) { + let _this = this; + let projType = _this.projTab.projType; + var url; + if (projType === 'proj') { + url = '/admin/projUser/editForm?id='; + } + + if (projType === 'taocan') { + url = '/admin/taoCanUser/editForm?id='; + } + + if (projType === 'card') { + url = '/admin/moneyCardUse/editForm?id='; + } + + layer.open({ + type : 2, + title : "编辑", + area : MUI.SIZE_M, + maxmin : true, + content : [ basePath + url + row.id ] + }); + }, + + + openProjUseFlow(index, row) { + layer.open({ + type : 2, + title : "操作记录", + area : MUI.SIZE_M, + maxmin : true, + content : [ basePath + "/admin/redirect/hive/beautySalon/projUseFlow-list?projUseId=" + row.id ] + }); + }, + + openMoneyCardUseFlow(index, row) { + layer.open({ + type : 2, + title : "充值卡变更记录", + area : MUI.SIZE_M, + maxmin : true, + content : [ basePath + "/admin/redirect/hive/vip/moneyCardUseFlow-list?vipId=" + row.vipId + "&cardId=" + row.id ] + }); + }, + + tabProjInvalid(index, row) { + let _this = this; + let projType = _this.projTab.projType; + var url; + if (projType === 'proj') { + url = '/admin/projUser/invalidProj'; + } + + if (projType === 'taocan') { + url = '/admin/taoCanUser/invalidTc'; + } + + if (projType === 'card') { + url = '/admin/moneyCardUse/invalid'; + } + + _this.projTabQuery(row.id, url); + }, + tabProjCold(index, row) { + let _this = this; + let projType = _this.projTab.projType; + var url; + if (projType === 'proj') { + url = '/admin/projUser/freezeProj'; + } + + if (projType === 'taocan') { + url = '/admin/taoCanUser/freezeTc'; + } + + if (projType === 'card') { + url = '/admin/moneyCardUse/freeze'; + } + + _this.projTabQuery(row.id, url); + }, + projTabQuery(id, url) { + let _this = this; + $.AjaxProxy({ + p : { + id : id + } + }).invoke(basePath + url, function(loj) { + layer.alert(loj.getValue("info"), { + icon : 1 + }); + _this.refreshTable(); + }); + }, + updateFailTimeFn() { + this.tabProjValid(1, this.projTab.row, 1); + }, + /** ############## 项目/套餐Tab页 end #################### **/ + + /********* 服务单tab start ***********/ + serviceOrderQuery() { + this.serviceOrderTableQueryFn() + }, + serviceOrderTableQueryFn() { + let _this = this; + let serviceOrderTab = _this.serviceOrderTab; + let page = serviceOrderTab.page; + var params = {}; + + if (!_this.vipInfo.id) { + return; + } + + params.limit = page.pageSize; + params.offset = (page.currentPage - 1) * page.pageSize; + params.state = serviceOrderTab.state; + params.vipId = _this.vipInfo.id; + if (serviceOrderTab.selectTime) { + params.beginTime = serviceOrderTab.selectTime?moment(serviceOrderTab.selectTime[0]).format("YYYY-MM-DD HH:mm"):''; + params.closureTime = serviceOrderTab.selectTime?moment(serviceOrderTab.selectTime[1]).format("YYYY-MM-DD HH:mm"):''; + } + $.AjaxProxy({ + p:params + }).invoke(basePath + "/admin/projService/showList", function (loj) { + serviceOrderTab.page.total = loj.getResult().total; + serviceOrderTab.tableData = loj.getValue("rows"); + }); + }, + serviceOrderSizeChange(val) { + this.serviceOrderTab.page.pageSize = val; + this.serviceOrderTableQueryFn() + }, + serviceOrderCurrentChange(val) { + this.serviceOrderTab.page.currentPage = val; + this.serviceOrderTableQueryFn() + }, + // 查看 + lookServiceOrder(index, row) { + selectFwz(row.id); + }, + // 排班 + paiban(index, row) { + openPb(row.id); + }, + // 派单 + giveServiceOrder(index, row) { + MTools.handleItem(basePath + "/admin/projService/paidan?id=" + row.id, "确定派单吗?", this.serviceOrderQuery) + }, + // 修改 + modifyServiceOrder(index, row) { + updatePd(row.id); + }, + // 配料 + peiliao(index, row) { + layer.full(layer.open({ + type: 2, + title: "开始配料", + maxmin: true, + area: [MUI.SIZE_L, '450px'], + content: [basePath + '/admin/projService/startpl?id=' + row.id] + })); + }, + // 划扣 + hkService(index, row) { + openHkServcie(row.id); + }, + // 取消 + cancelServiceOrder(index, row) { + MTools.handleItem(basePath + "/admin/projService/cancelOrder?id=" + row.id, "确定取消订单吗?", this.serviceOrderQuery); + }, + // 修改时间 + modifyTime(index, row) { + layer.open({ + type: 2, + title: "修改订单时间", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content: [basePath + '/admin/redirect/hive/beautySalon/updateServiceOrderTimeV2?id=' + row.id] + }); + }, + /********* 服务单tab end ***********/ + + /********* 订单Tab start ***********/ + orderQuery() { + this.orderTableDataQueryFn(); + }, + orderTableDataQueryFn() { + let _this = this; + let orderTab = _this.orderTab; + let page = orderTab.page; + var params = {}; + + if (!_this.vipInfo.id) { + return; + } + + params.limit = page.pageSize; + params.offset = (page.currentPage - 1) * page.pageSize; + params.statu = orderTab.state; + params.vipId = _this.vipInfo.id; + if (orderTab.selectTime) { + params.beginTimeVo = orderTab.selectTime?moment(orderTab.selectTime[0]).format("YYYY-MM-DD HH:mm"):''; + params.endTimeVo = orderTab.selectTime?moment(orderTab.selectTime[1]).format("YYYY-MM-DD HH:mm"):''; + } + $.AjaxProxy({ + p:params + }).invoke(basePath + "/admin/order/showList", function (loj) { + orderTab.page.total = loj.getResult().total; + orderTab.orderTableData = loj.getValue("rows"); + }); + + }, + orderSizeChange(val) { + this.orderTab.page.pageSize = val; + this.orderTableDataQueryFn(); + }, + orderCurrentChange(val) { + this.orderTab.page.currentPage = val; + this.orderTableDataQueryFn(); + }, + lookOrderInfo(index, row) { + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + area : [ MUI.SIZE_L, '500px' ], + content : [ basePath + '/admin/order/orderItem?id=' + row.id ] + })); + }, + bjMoney(index, row) { + layer.full(layer.open({ + type : 2, + title : "补交", + area : [ MUI.SIZE_L, '400px' ], + maxmin : true, + content : [ basePath+'/admin/moneyCardUse/toBj?id=' + row.id] + })); + }, + skMoney(index, row) { + layer.full(layer.open({ + type : 2, + title : "收款", + area : [ MUI.SIZE_L, '400px' ], + maxmin : true, + content : [ basePath+'/admin/redirect/hive/beautySalon/order-form?id=' + row.id] + })); + }, + updateTime(index, row) { + layer.open({ + type : 2, + title : "修改订单时间", + maxmin : true, + area : [ MUI.SIZE_L, '500px' ], + content : [ basePath + '/admin/order/toUpdateTime?id=' + row.id ] + }); + }, + /********* 订单Tab end ***********/ + + /************** 积分tab start **************/ + submitChangeScore(){ + let _this=this; + + var params={ + amount:this.scoreTab.form.amount, + remarks:this.scoreTab.form.remarks, + vipId:this.vipInfo.id + }; + + + + $.AjaxProxy({ + p:params, + json:"json" + }).invoke(basePath + "/admin/score/changeUserScore", function (loj) { + _this.$message.success('调整成功'); + _this.scoreTab.showChangePaln=false; + _this.scoreTab.form={ + amount:'', + remarks:'' + } + _this.vipInfoFn(_this.searchValue); + _this.scoreCheckQuery(); + + }); + + }, + changeScore(){ + if (!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + }else { + this.scoreTab.showChangePaln=true; + } + + }, + + scoreCheckQuery() { + this.scoreCheckTableDataQueryFn(); + }, + scoreCheckTableDataQueryFn() { + let _this = this; + let scoreTab = _this.scoreTab; + let page = scoreTab.page; + var params = {}; + + if (!_this.vipInfo.id) { + return; + } + + params.pageSize = page.pageSize; + params.pageNum =page.currentPage ; + params.vipId = _this.vipInfo.id; + params.remarks = scoreTab.remarks; + if (scoreTab.selectTime) { + params.beginTime = scoreTab.selectTime?moment(scoreTab.selectTime[0]).format("YYYY-MM-DD"):''; + params.endTime = scoreTab.selectTime?moment(scoreTab.selectTime[1]).format("YYYY-MM-DD"):''; + } + $.AjaxProxy({ + p:params, + json:"json" + }).invoke(basePath + "/admin/score/getFlowList", function (loj) { + scoreTab.page.total = loj.getResult().total; + scoreTab.scoreTableDate = loj.getValue("rows"); + }); + }, + scoreCheckSizeChange(val) { + this.scoreTab.page.pageSize = val; + this.scoreCheckTableDataQueryFn() + }, + scoreCheckCurrentChange(val) { + this.scoreTab.page.currentPage = val; + this.scoreCheckTableDataQueryFn() + }, + /************** 积分tab end **************/ + + + + /************** 皮肤检测tab start **************/ + skinCheckQuery() { + this.skinCheckTableDataQueryFn(); + }, + skinCheckTableDataQueryFn() { + let _this = this; + let skinTab = _this.skinTab; + let page = skinTab.page; + var params = {}; + + if (!_this.vipInfo.id) { + return; + } + + params.limit = page.pageSize; + params.offset = (page.currentPage - 1) * page.pageSize; + params.userId = _this.vipInfo.id; + if (skinTab.selectTime) { + params.beginTime = skinTab.selectTime?moment(skinTab.selectTime[0]).format("YYYY-MM-DD"):''; + params.endTime = skinTab.selectTime?moment(skinTab.selectTime[1]).format("YYYY-MM-DD"):''; + } + $.AjaxProxy({ + p:params + }).invoke(basePath + "/admin/sysSkinCheckRecord/showList", function (loj) { + skinTab.page.total = loj.getResult().total; + skinTab.skinTableDate = loj.getValue("rows"); + }); + }, + skinCheckSizeChange(val) { + this.skinTab.page.pageSize = val; + this.skinCheckTableDataQueryFn() + }, + skinCheckCurrentChange(val) { + this.skinTab.page.currentPage = val; + this.skinCheckTableDataQueryFn() + }, + addSkinCheck() { + let _this = this; + if (!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + } + + layer.full(layer.open({ + type : 2, + title : "新增皮肤检测", + area : [ MUI.SIZE_L, '400px' ], + maxmin : true, + content : [ basePath+'/admin/redirect/hive/vip/sysSkinCheckRecord-form?vipId=' + _this.vipInfo.id] + })); + }, + delSkinCheck(index, row) { + let _this = this; + $.AjaxProxy().invoke(basePath + "/admin/sysSkinCheckRecord/del?keys=" + row.id, function (loj) { + _this.skinCheckQuery(); + }); + }, + editSkinCheck(index, row) { + let _this = this; + layer.full(layer.open({ + type : 2, + title : "编辑皮肤检测", + area : [ MUI.SIZE_L, '400px' ], + maxmin : true, + content : [ basePath+'/admin/redirect/hive/vip/sysSkinCheckRecord-form?vipId='+ _this.vipInfo.id +'&id=' + row.id] + })); + }, + /************** 皮肤检测tab end **************/ + + // tab标签切换 + tabHandleClick(tab, event) { + let _this = this; + if (tab.name === "serviceOrder") { + if (_this.serviceOrderTab.tableData.length <= 0) { + this.serviceOrderTableQueryFn(); + } + } + + if (tab.name === "order") { + if (_this.orderTab.orderTableData.length <= 0) { + this.orderTableDataQueryFn(); + } + } + + if (tab.name === "skinCheck") { + if (_this.skinTab.skinTableDate.length <= 0) { + this.skinCheckTableDataQueryFn(); + } + } + if (tab.name === "scoreTab") { + if (_this.scoreTab.scoreTableDate.length <= 0) { + this.scoreCheckTableDataQueryFn(); + } + } + }, + + /********** 标签代码 start ************/ + handleClose(tag) { + this.tags.tags.splice(this.tags.tags.indexOf(tag), 1); + this.delLabelFn(tag.id); + }, + showInput() { + if(!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + } + + this.tags.inputVisible = true; + this.$nextTick(_ => { + this.$refs.saveTagInput.$refs.input.focus(); + }); + }, + handleInputConfirm() { + let inputValue = this.tags.inputValue; + if (inputValue) { + this.addLabelFn(inputValue); + } + this.tags.inputVisible = false; + this.tags.inputValue = ''; + }, + /********** 标签代码 end ************/ + + /********** 顶部按钮 start **********/ + // 充值 + recharge() { + if (!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + } + vipId = this.vipInfo.id; + openCz(); + }, + // 开服务单 + addServiceOrder() { + if (!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + } + vipId = this.vipInfo.id; + openAddService(vipId); + }, + exportExcel(){ + if (!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + } + vipId = this.vipInfo.id; + window.location.href=basePath+"/admin/vipInfo/exportExcel/"+vipId; + }, + // 开订单 + addOrder() { + if (!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + } + vipId = this.vipInfo.id; + openAddOrder(); + }, + // 退款 + returnMoney() { + if (!this.vipInfo.id) { + this.$message.error('请选择用户'); + return; + } + vipId = this.vipInfo.id; + toRefundOrder(); + }, + /********** 顶部按钮 start **********/ + + dateFormat(row, column) { + return moment(row.yyTime).format("YYYY-MM-DD HH:mm"); + }, + oderTimeFormat(row, column) { + return moment(row.orderTime).format("YYYY-MM-DD HH:mm:ss"); + }, + } + }); </script> </body> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip_bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip_bak.html new file mode 100644 index 0000000..ae7dd75 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip_bak.html @@ -0,0 +1,284 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + + <script type="text/javascript" th:src="@{/js/function/vip.js}"></script> + <script type="text/javascript" th:src="@{/js/function/meiduCommon.js}"></script> + + <style type="text/css"> + .c { + cursor: pointer; + overflow: scroll; + height: 258px; + overflow-x: hidden; + } + + .c li:HOVER { + background: #efefef; + } + + .userList { + list-style: none; + padding-left: 0px; + border: 1px solid rgb(238, 238, 238); + position: fixed; + z-index: 99999999; + background: #FFFFFF; + box-shadow: 1px 2px 10px 1px #BFBFBF; + height: 300px; + overflow: scroll; + overflow-x: hidden; + } + + .userList li { + padding-left: 13px; + padding-top: 5px; + padding-bottom: 5px; + cursor: pointer; + border-bottom: 1px solid #efefef; + } + + .userList li:hover { + background: #eee; + } + </style> + +</head> +<body class="ibox-content container-fluid" onkeypress="dosearch(event)"> + +<div class="row"> + <div class="row "> + + <div class="col-sm-12 ibox-content"> + <form method="post" id="dataform" class="dataform form-inline"> + <div class="pd-20 form-group"> + <div class="text-l "> + <input type="text" id="key" placeholder="输入会员姓名/手机号码/编号" autocomplete="off" + style="width: 400px" class="form-control"> + <button type="button" class="btn btn-success radius EXSerchBtn " + onclick="selectByKey();"> + <i class="fa fa-search"> </i> 查找 + </button> + <ul id="userList" class="userList " + style="width: 400px; display: none"> + </ul> + + </div> + </div> + </form> + + </div> + </div> + <input autocomplete="off" type="hidden" id="vipId"> + <div class="row"> + <div class=" col-sm-9 "> + <div class="panel panel-default"> + <div class="panel-heading">会员信息</div> + + <table class="table table-bordered table-striped " + style="width: 100%;"> + <tr> + <td width="10%" class="text-r"><b>会员姓名:</b></td> + <td width="20%" name="vipName" id="vipName"></td> + <td width="10%" class="text-r"><b>性别:</b></td> + <td width="20%" name="sex" id="sex"></td> + <td width="10%" class="text-r"><b>生日:</b></td> + <td width="20%" name="birthday1" id="birthday1"></td> + </tr> + + <tr> + <td width="10%" class="text-r"><b>会员类型:</b></td> + <td width="20%" name="vipType" id="vipType"></td> + <td width="10%" class="text-r"><b>会员状态:</b></td> + <td width="20%" name="vipState" id="vipState"></td> + <td width="10%" class="text-r"><b>会员等级:</b></td> + <td width="20%" name="levelName" id="levelName"></td> + + </tr> + <tr> + <td width="10%" class="text-r"><b>会员编号:</b></td> + <td width="20%" name="animalSign" id="vipNo"></td> + <td width="10%" class="text-r"><b>生肖/星座:</b></td> + <td width="20%" name="constell" id="constell"></td> + <td width="10%" class="text-r"><b>注册时间:</b></td> + <td width="20%" name="createTime" id="createTime"></td> + </tr> + <tr> + <td width="10%" class="text-r"><b>手机号码:</b></td> + <td width="20%" name="phone" id="phone"></td> + <td width="10%" class="text-r"><b>入会时间:</b></td> + <td width="20%" name="inDate" id="inDate"></td> + <td width="10%" class="text-r"><b>地址:</b></td> + <td width="20%" name="addr" id="addr"></td> + </tr> + <tr> + <td width="10%" class="text-r"><b>到店途径:</b></td> + <td width="20%" name="arrivalWay" id="arrivalWay"></td> + <td width="10%" class="text-r"><b>总佣金:</b></td> + <td width="20%" name="commissionAll" id="commissionAll"></td> + <td width="10%" class="text-r"><b>总积分:</b></td> + <td width="20%" name="pointAll" id="pointAll"></td> + </tr> + + <tr> + <td width="10%" class="text-r"><b>储值卡余额:</b></td> + <td width="20%" name="bal" id="bal"></td> + <td width="10%" class="text-r"><b>备注:</b></td> + <td width="20%" name="remark" id="remark"></td> + <td width="10%" class="text-r"><b>健康顾问:</b></td> + <td width="20%" name="staffName" id="staffName"></td> + <td style="display: none" id="id" name="id"></td> + </tr> + <tr> + <td class="text-center" colspan="6"> + + <button matrix:btn="vipinfoClub-recharge" class="btn btn-success radius size-S isActive " + disabled="disabled" onclick='openCz()'> + <i class="fa fa-jpy"></i> 充值 + </button> + + <button matrix:btn="vipinfoClub-payment" class="btn btn-success radius size-S isActive" + disabled="disabled" onclick='openOrderList("欠款")'> + <i class="fa fa-paypal"></i> 补交 + </button> + + <button matrix:btn="vipinfoClub-gathering" class="btn btn-success radius size-S isActive" + disabled="disabled" onclick='openOrderList("待付款")'> + <i class="fa fa-paypal"></i> 收款 + </button> + <button matrix:btn="vipinfoClub-newService" class="btn btn-success radius size-S isActive" + disabled="disabled" onclick='toRefundOrder()'> + <i class="fa fa-paypal"></i> 退款 + </button> + <button matrix:btn="vipinfoClub-newService" class="btn btn-success radius size-S isActive" + disabled="disabled" onclick='openAddOrder()'> + <i class="fa fa-paypal"></i> 开单 + </button> + <button matrix:btn="vipinfoClub-newService" class="btn btn-success radius size-S isActive" + disabled="disabled" onclick='openAddService()'> + <i class="fa fa-paypal"></i> 开服务单 + </button> + + </td> + </tr> + </table> + </div> + </div> + <div class="col-sm-3"> + <div class="panel panel-default "> + <div class="panel-heading">最近查询会员</div> + <ul class="list-group c " id="historyList"> + </ul> + </div> + </div> + </div> + <div class="row"> + <div class="col-sm-9 text-center"> + + + <button class="btn btn-success radius size-S isActive" + onclick='openOrderList("全部")' disabled="disabled"> + <i class="fa fa-arrows-alt "></i> 订单 + </button> + + <button class="btn btn-success radius size-S isActive" + onclick="openServiceList()" disabled="disabled"> + <i class="fa fa-arrows-alt "></i> 服务单 + </button> + || + <button matrix:btn="vipinfoClub-projTaocan" class="btn btn-success radius size-S isActive" + onclick="openProj()" disabled="disabled"> + <i class="fa fa-star-half-o "></i> 项目管理 + </button> + + + <button matrix:btn="vipinfoClub-projTaocan" class="btn btn-success radius size-S isActive" + onclick="openTc()" disabled="disabled"> + <i class="fa fa-share-alt-square "></i> 套餐管理 + </button> + + + <button matrix:btn="vipinfoClub-projTaocan" class="btn btn-success radius size-S isActive" + onclick="openMoneyCard()" disabled="disabled"> + <i class="fa fa-gbp "></i>充值卡管理 + </button> + || + <button matrix:fn="servicefollow" onclick="openFollow()" type="button" class="btn btn-success isActive" disabled="disabled"> + <i class="fa fa-edit"></i> 跟进记录 + </button> + + <button matrix:btn="vipInfo-edit" onclick="openArchieves()" type="button" class="btn btn-success isActive" disabled="disabled"><i + class="fa fa-edit"></i> 客户档案 + </button> + <button matrix:btn="vipInfo-edit" onclick="openEdit()" type="button" class="btn btn-success isActive" disabled="disabled"><i + class="fa fa-edit"></i> 基本资料 + </button> + + </div> + </div> + +</div> +</body> + + +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script th:inline="javascript"> + //初始带入vip的电话 + var key = $.query.get("vipPhone"); + if(key){ + selectList(key); + } + + $(function () { + $("#key").keyup( + function () { + var $input = $("#key"); + if ($input.val().length > 1) { + $.AjaxProxy({ + p: { + keyWord: $input.val(), + }, + c: false, + }) + .invoke( + basePath + "/admin/vipInfo/findUserByPhotoOrName", + function (loj) { + var html = ""; + for (var i = 0; i < loj + .getRowCount(); i++) { + html += '<li onclick="selectList(\'' + loj.getString(i, 'phone') + '\')" >' + + loj.getString(i, 'phone') + "-" + loj.getString(i, 'vipName') + + "-" + loj.getString(i, 'vipNo') + + '</li>'; + } + $("#userList").html(html).show(); + }); + } else { + $("#userList").hide(); + } + }); + $("#userList").mouseleave(function () { + $(this).hide(); + }) + }) + + + function selectList(phone) { + $("#userList").hide(); + $("#key").val(phone); + selectByKey(); + } +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html new file mode 100644 index 0000000..7259054 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html @@ -0,0 +1,360 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + + <!-- 富文本编辑器 --> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + + + <style> + + .mform{ + display: flex; + align-items: center; + margin-top: 10px; + } + + + .mixSearchBox .searchResultTable { + position: absolute; + padding: 10px; + border: 1px solid #e4e7ed; + border-radius: 4px; + background-color: #fff; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); + box-sizing: border-box; + margin: 10px 0; + z-index: 99999999; + } + .el-icon-delete{ + cursor: pointer; + } + .el-icon-delete:hover{ + color: #F56C6C; + } + .tabs { + margin-bottom: 80px; + } + .foot_bar2 { + top: 98%; + position: absolute; + width: 98%; + height: 80px; + overflow: hidden; + left: 0px; + display: flex; + align-items: center; + z-index: 99; + justify-content: center; + + } + .max-height{ + height: 98%; + } + .orderBox{ + position: relative; + border-left: 1px solid #EFEFEF; + padding-left: 10px; + margin-left:10px ; + } + .openOrClose { + cursor:pointer + } + </style> +</head> +<body> +<div class="ibox-content max-height" id="app" v-cloak> + + <el-row class="max-height"> + <el-col :span="16" > + <el-tabs class="tabs" type="card" v-model="activeName" > + <el-tab-pane label="项目" name="tab1"> + + <el-table + :data="projList" + style="width: 98%"> + <el-table-column + prop="projName" + label="项目"> + </el-table-column> + <el-table-column + prop="balance" + label="余额" + width="180"> + </el-table-column> + <el-table-column + prop="surplusCount" + label="余次"> + </el-table-column> + <el-table-column + prop="failTimeStr" + label="有效期"> + </el-table-column> + <el-table-column + prop="source" + label="来源"> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button v-if="scope.row.surplusCount>0" type="primary" + size="mini" + @click="selected(scope.$index, scope.row)">添加 + </el-button> + </template> + </el-table-column> + </el-table> + + + </el-tab-pane> + <el-tab-pane label="套餐" name="tab2"> + <template v-for="(item,index) in taocanList"> + <p class="el-big-title"> + <span class="openOrClose" v-if="!item.openOrClose" @click="openOrCloseTc(item, index, 1)"><i class="el-icon-arrow-down"></i></span> + <span class="openOrClose" v-if="item.openOrClose" @click="openOrCloseTc(item, index, 2)"><i class="el-icon-arrow-up"></i></span> + 【{{item.isCourse=='N'?'固定套餐':'任选套餐'}}】{{item.projName}} + <span style="float: right" v-if="item.failTime != null">有效期:{{item.failTime}}</span> + <code v-if="item.isCourse=='Y'" > 剩余次数:<span v-if="item.isInfinite == 'Y'">无限次</span><span v-else>{{item.surplusCount}}</span> </code> + </p> + <el-table + :data="item.taocanProjUse" + style="width: 98%" v-show="item.openOrClose"> + <el-table-column + prop="projName" + label="项目"> + </el-table-column> + <el-table-column + prop="balance" + label="余额" + width="180"> + </el-table-column> + <el-table-column + prop="surplusCount" + label="余次"> + </el-table-column> +<!-- <el-table-column--> +<!-- prop="failTimeStr"--> +<!-- label="有效期">--> +<!-- </el-table-column>--> + <el-table-column + prop="source" + label="来源"> + </el-table-column> + <el-table-column + prop="address" + label="操作"> + <template slot-scope="scope"> + <el-button v-if="scope.row.surplusCount>0" type="primary" + size="mini" + @click="selected(scope.$index, scope.row, item.projName)">添加 + </el-button> + </template> + </el-table-column> + </el-table> + </template> +<!-- <el-row style="text-align: center; margin-top: 5px;">--> +<!-- <el-link type="primary" v-if="!tcIsOpen && taocanList.length > 0" @click="tcIsOpen = true">点击展开</el-link>--> +<!-- <el-link type="primary" v-if="tcIsOpen" @click="tcIsOpen = false">点击隐藏</el-link>--> +<!-- </el-row>--> + </el-tab-pane> + + </el-tabs> + </el-col> + <el-col :span="7" class="orderBox max-height" > + <p class="el-big-title">服务开单</p> + <el-row class="mform" v-for="(item,index) in orderItemList" > + <el-col :span="16" >{{item.projUse.projName}}</el-col> + <el-col :span="6" > + <el-input @blur="checkCount(item)" type="number" v-model="item.count"> + </el-input> + </el-col> + <el-col :offset="1" :span="1" > + <i @click="remove(index)" class="el-icon-delete "></i> + </el-col> + </el-row> + <el-row class="foot_bar2"> + <el-button :loading="submiting" type="primary" @click="submitForm('form')" >添加</el-button> + <el-button @click="closeFram()">取消</el-button> + </el-row> + </el-col> + </el-row> + + + +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script src="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.umd.min.js"></script> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.min.css"> + + +<script> + var id = $.query.get("id"); + //校验方法 + var ValidatorFactory = { + validateUseCount: function (rule, value, callback) { + if ((true)) { + return callback; + } else { + return callback(new Error('请输入套餐最大使用次数')); + } + } + }; + + Vue.component('ValidatorFactory', ValidatorFactory); + Vue.component('treeselect', VueTreeselect.Treeselect) + + var app = new Vue({ + el: '#app', + data: { + submiting:false, + activeName:"tab1", + orderItemList:[], + projList:[], + taocanList:[], + tcIsOpen : false, + yyTime:new Date(), + + + }, + + /** + * 初始化数据表 + */ + created: function () { + this.loadinfo(); + }, + + methods: { + /** + * 提交表单 + * */ + submitForm(formName) { + let _this=this; + _this.submiting = true; + if(_this.orderItemList.length<1){ + _this.$message.error('请选择下单项目'); + return false; + } + let formData={ + vipId:id, + serviceItems:[], + } + + parent.app.addProjItems(_this.orderItemList); + _this.closeFram(); + }, + open(data) { + let _this=this; + this.$confirm('服务创建成功是否马上排班?', '确认信息', { + distinguishCancelAndClose: true, + confirmButtonText: '马上排班', + cancelButtonText: '暂不排班' + }).then(() => { + window.location.href=basePath+"/admin/projService/yypb?pageFlae=1&id="+data.rows[0].id; + }) + .catch(action => { + if(action === 'cancel'){ + _this.submiting = false; + _this.closeFram(); + } + }); + }, + + remove(index){ + this.orderItemList.splice(index, 1); + }, + checkCount(item){ + if(item.count>item.projUse.surplusCount){ + item.count=item.projUse.surplusCount; + this.$message.error('下单次数不能大于余次'); + }else if(item.count<0){ + item.count=1; + this.$message.error('下单次数不能小于0'); + } + }, + /** + * 选择产品 + * */ + selected(index, row, name) { + + //是否已经被选择了 + let selected = false; + this.orderItemList.forEach(item => { + if (item.projUse.id == row.id) { + selected = true; + //叠加次数 + if(item.count<item.projUse.surplusCount){ + item.count=item.count+1; + }else{ + this.$message.error('下单次数不能大于余次'); + } + + return; + } + }); + if (!selected) { + if(row.surplusCount>0){ + this.orderItemList.push({ + projUse: row, + count: 1, + name : name + }); + } + + } + + }, + loadinfo(){ + let _this=this; + AjaxProxy.requst({ + app: _this, + url: basePath + "/admin/projService/getUserProjInfo?vipId="+id, + callback: function (data) { + _this.projList = data.mapInfo.projList; + _this.taocanList = data.mapInfo.taoCanList; + } + }); + }, + closeFram: function () { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + openOrCloseTc : function (item, index, value) { + if (value == 1) { + item.openOrClose = true; + } else { + item.openOrClose = false; + } + Vue.set(this.taocanList, index, item); + } + } + + }) +</script> + +</body> +</html> + diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form-bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form-bak.html new file mode 100644 index 0000000..9a6be74 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form-bak.html @@ -0,0 +1,498 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> +</head> +<body> +<div class="ibox-content" id="app" v-cloak> + <form class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> + <input autocomplete="off" type="hidden" v-model="projService.id"> + + <div class="form-group"> + <label class="col-md-2 control-label"> </label> + <div class="col-md-12"> + <div class="panel panel-primary"> + <div class="panel-heading"> + <div class="row"> + <div class="col-md-6"> + <h2>客户:{{projService.vipInfo.vipName}}</h2> + </div> + <div class="col-md-6 text-right"> + <sapn style="line-height: 30px;">订单编号:{{projService.serviceNo}}</sapn> + </div> + </div> + </div> + <div class="panel-body"> + <div class="form-group"> + <label class="col-md-1 control-label">预约时间:</label> + <div class="col-md-3"> + <el-date-picker @change="changeYyTime()" + v-model="projService.yyTime" + type="date" + placeholder="选择日期"> + </el-date-picker> + </div> + <label class="col-md-1 control-label">服务时长</label> + <div class="col-md-3"> + <!-- <el-input @change="changeYyTime()" v-model="projService.totalTime"></el-input>--> + <label class="control-label">{{projService.totalTime}}</label> + </div> + </div> + <div class="form-group"> + + <label class="col-md-1 control-label">床位准备时间</label> + <div class="col-md-3 "> + <el-time-select + @change="getFreedBed()" + v-model="projService.bedState.startTimeForm" + :picker-options="{ + start: startTime, + step: '00:10', + end: endTime + }" + placeholder="选择时间"> + </el-time-select> + + </div> + <label class="col-md-1 control-label">选择床位</label> + <div class="col-md-3" style="display: flex;"> + <el-select style="flex: 5" v-model="projService.bedId" placeholder="请选择床位"> + <el-option + v-for="item in beds" + :key="item.id" + :label="item.bedName" + :value="item.id"> + </el-option> + </el-select> + <button style="flex: 1" type="button" class="btn btn-success btn-sm " + onclick="selectCwqk()" + title="查看床位情况"> + <i style="font-size: 18px;" class="el-icon-search"></i> + </button> + </div> + </div> + + + <div class="form-group"> + <label class="col-md-1 control-label">配料师</label> + <div class="col-md-3"> + <el-select v-model="projService.devisionId" placeholder="请选择"> + <el-option + v-for="item in pls" + :key="item.suId" + :label="item.suName" + :value="item.suId"> + </el-option> + </el-select> + </div> + </div> + <div class="form-group"> + <label class="col-md-1 control-label">服务设置</label> + <div class="col-md-11"> + <table class="table table-bordered"> + <tr> + <th>项目名称</th> + <th width="100px">服务时长(分钟)</th> + <th>服务时间</th> + <th width="300px">美疗师</th> + <th style="width: 100px;">提成</th> + </tr> + + <tr v-for="(item,index) in projService.serviceItems"> + <td>{{item.projInfo.name}}</td> + <td><el-input @change="changeTimeLength" v-model="item.projInfo.timeLength"></el-input></td> + + <td> + <div style="display: flex;"> + <el-time-select style="flex: 6" @change="getFreedBeautyd(index)" + v-model="item.beginTimeForm" + :picker-options="{ + start: startTime, + step: '00:10', + end: endTime, + }" + placeholder="选择时间"> + </el-time-select> + <span style="flex: 2;text-align: center;line-height: 30px">至</span> + <el-time-select style="flex: 6" @change="getFreedBeautyd(index)" + v-model="item.endTimeForm" + :picker-options="{ + start: startTime, + step: '00:10', + end: endTime, + minTime: item.beginTimeForm + }" + placeholder="选择时间"> + </el-time-select> + </div> + </td> + <td> + <el-select v-model="item.staffId" placeholder="请选择美疗师"> + <el-option + v-for="item in beauty" + :key="item.suId" + :label="item.suName" + :value="item.suId"> + </el-option> + </el-select> + </td> + <td> + <el-input v-model="item.extract"></el-input> + </td> + + </tr> + + </table> + </div> + </div> + <div class="form-group"> + <label class="col-md-1 control-label">备 注:</label> + <div class="col-md-7"> + <textarea name="remark" type="text" id="remark" + class="form-control" rows="4" + v-model="projService.remark"></textarea> + </div> + </div> + + <div class="form-group "> + <div class="col-md-12 text-center"> + <a href="javascript:;" @click="submit()" + class="btn btn-success radius">保存</a> + <button @click="closeFram()" class="btn btn-danger radius" type="button">取消</button> + </div> + </div> + </div> + </div> + + </div> + </div> + + </form> +</div> +</div> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript"> + + var id = $.query.get("id"); + var app = new Vue({ + el: '#app', + data: { + projService: { + bedState: {startTimeForm: ''} + }, + //美疗师分配列表 + serviceItems: [], + //美疗师 + beauty: [], + pls: [], + beds: [], + startTime:'08:00', + endTime:'23:00', + }, + created: function () { + this.loadWorkTime(); + this.loadInfo(); + }, + + mounted: function () { + + }, + + methods: { + + + loadWorkTime:function(){ + var _this=this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/workTime/getWorkTime', + callback: function (data) { + _this.startTime=data.rows[0]; + _this.endTime=data.rows[1]; + } + }); + }, + + loadInfo: function () { + + console.log('加载服务器数据'); + var _this = this; + + + + + AjaxProxy.requst({ + app: _this, + async: false, + url: basePath + '/admin/projService/findProjServiceInfo?id=' + id, + callback: function (data) { + + + //处理空对象和时间 + let projService = data.mapInfo.projService; + + let serviceItems = projService.serviceItems; + + //转换床位时间格式 + if (!projService.bedState) { + projService.bedState = {} + projService.bedState.startTimeForm= MTools.formatDate(new Date(), 'hh:mm'); + } else { + projService.bedState.startTimeForm = MTools.formatDate(projService.bedState.startTime, 'hh:mm') + } + + _this.projService = projService; + + //转换时间格式,服务加载的时间格式要做处理,截取时分展示 + for (let i = 0; i < serviceItems.length; i++) { + let beStates = serviceItems[i]; + if(beStates.beginTime){ + beStates.beginTimeForm = MTools.formatDate(beStates.beginTime, 'hh:mm'); + beStates.endTimeForm = MTools.formatDate(beStates.endTime, 'hh:mm'); + }else{ + beStates.beginTimeForm = MTools.formatDate(new Date(), 'hh:mm'); + var today=new Date(); + today.setMinutes(today.getMinutes()+beStates.projInfo.timeLength) + beStates.endTimeForm= MTools.formatDate(today, 'hh:mm'); + } + _this.getFreedBeautyd(i); + + + } + + //加载床位 + _this.getFreedBed(); + + //获取配料师 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/getShopStaffByRoleName?roleName=配料师', + callback: function (data) { + _this.pls = data.rows; + } + }); + + + } + }); + + + } + , + closeFram: function () { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }, + + submit: function () { + console.log("提交"); + let _this = this; + let projService = _this.projService; + + //床位时间 + let dateStr = MTools.formatDate(projService.yyTime, 'yyyy/MM/dd') + " " + projService.bedState.startTimeForm + ":00"; + let startTime = new Date(dateStr); + + let serviceItems = []; + for (let i = 0; i < projService.serviceItems.length; i++) { + let beStates = projService.serviceItems[i]; + let beginTimeStr = MTools.formatDate(_this.projService.yyTime, 'yyyy/MM/dd') + " " + beStates.beginTimeForm + ":00"; + let beginTime = new Date(beginTimeStr); + let endTimeStr = MTools.formatDate(_this.projService.yyTime, 'yyyy/MM/dd') + " " + beStates.endTimeForm + ":00"; + let endTime = new Date(endTimeStr); + + serviceItems.push({ + beginTime: beginTime, + endTime: endTime, + staffId: beStates.staffId, + extract: beStates.extract, + excTime : beStates.projInfo.timeLength, + id: beStates.id, + }); + + } + + + var params = { + id: projService.id, + totalTime: projService.totalTime, + remark: projService.remark, + bedId: projService.bedId, + devisionId: projService.devisionId, + yyTime: projService.yyTime, + serviceItems: serviceItems, + //床位时间 + bedState: { + startTime: startTime, + } + } + + + if (_this.validate(params)) { + AjaxProxy.requst({ + app: _this, + data: params, + url: basePath + '/admin/projService/servicePaiBan', + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success', + onClose: function () { + _this.closeFram(); + } + }); + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.serviceOrderQuery(); + } + } + }); + } + } + , + validate: function (params) { + if (!params.bedId) { + this.$message({ + message: '床位不能为空', + type: 'error' + }); + return false; + } + if (!params.totalTime) { + this.$message({ + message: '请填写服务时长', + type: 'error' + }); + return false; + } + if (!params.yyTime) { + this.$message({ + message: '请填写预约时间', + type: 'error' + }); + return false; + } + for (let i = 0; i < params.serviceItems.length; i++) { + let b = params.serviceItems[i]; + if (!b.staffId) { + this.$message({ + message: '请选择第' + (i + 1) + '位美疗师', + type: 'error' + }); + return false; + } + } + return true; + } + , + + //触发预约时间修改 + changeYyTime: function () { + this.getFreedBed(); + this.getFreedBeautyd(); + } + , + getFreedBed: function () { + console.log('获取空闲床位'); + let _this = this; + let dateStr = MTools.formatDate(_this.projService.yyTime, 'yyyy/MM/dd') + " " + _this.projService.bedState.startTimeForm + ":00"; + let startTime = new Date(dateStr); + if (!_this.projService.bedState.startTimeForm || !_this.projService.totalTime) { + return; + } + AjaxProxy.requst({ + app: _this, + data: { + startTime: startTime, + totalTime: _this.projService.totalTime, + id: _this.projService.id + }, + url: basePath + '/admin/bedInfo/showFreedBed', + callback: function (data) { + _this.beds = data.rows; + } + }); + } + , + getFreedBeautyd: function (index) { + console.log("获取美疗师"); + let _this = this; + let projService = _this.projService; + let beStates = projService.serviceItems[index]; + + if (beStates == null || MTools.isBlank(beStates.beginTimeForm) || MTools.isBlank(beStates.endTimeForm ) ){ + return; + } + let beginTimeStr = MTools.formatDate(_this.projService.yyTime, 'yyyy/MM/dd') + " " + beStates.beginTimeForm + ":00"; + let beginTime = new Date(beginTimeStr); + let endTimeStr = MTools.formatDate(_this.projService.yyTime, 'yyyy/MM/dd') + " " + beStates.endTimeForm + ":00"; + let endTime = new Date(endTimeStr); + + AjaxProxy.requst({ + app: _this, + data: { + beginTime: beginTime, + endTime: endTime, + servicesId: _this.projService.id + }, + url: basePath + '/admin/beautiWork/getPaiBanBeauticianList', + callback: function (data) { + + if (data.rows.length > 0) { + _this.beauty = data.rows; + } + + } + }); + + + }, + changeTimeLength:function() { + let _this = this; + + var totalTime = 0; + _this.projService.serviceItems.forEach(item => { + totalTime += parseInt(item.projInfo.timeLength); + }); + _this.projService.totalTime = totalTime; + _this.changeYyTime(); + } + + }, + filters: + { + format: function (value, patten) { + if (!value) return ''; + return MTools.formatDate(value, patten) + } + , + } + , + + }) + + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html index 43e23bb..5723d51 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html @@ -19,7 +19,7 @@ <body> <div class="ibox-content" id="app" v-cloak> <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> + onsubmit="javascript:return false;"> <input autocomplete="off" type="hidden" v-model="projService.id"> <div class="form-group"> @@ -48,7 +48,8 @@ </div> <label class="col-md-1 control-label">服务时长</label> <div class="col-md-3"> - <el-input @change="changeYyTime()" v-model="projService.totalTime"></el-input> +<!-- <el-input @change="changeYyTime()" v-model="projService.totalTime"></el-input>--> + <label class="control-label">{{projService.totalTime}}</label> </div> </div> <div class="form-group"> @@ -100,20 +101,31 @@ </div> </div> <div class="form-group"> + <label class="col-md-1 control-label"></label> + <div class="col-md-11"> + <el-button size="medium" type="primary" @click="addProjForm">新增项目</el-button> + </div> + </div> + <div class="form-group"> <label class="col-md-1 control-label">服务设置</label> <div class="col-md-11"> <table class="table table-bordered"> <tr> <th>项目名称</th> - <th width="50px">服务时长</th> + <th>次数</th> + <th>划扣金额</th> + <th width="100px">服务时长(分钟)</th> <th>服务时间</th> <th width="300px">美疗师</th> <th style="width: 100px;">提成</th> + <th>操作</th> </tr> <tr v-for="(item,index) in projService.serviceItems"> - <td>{{item.projInfo.name}}</td> - <td>{{item.projInfo.timeLength}}(分钟)</td> + <td>{{item.projInfo.name}}【{{item.projUse.source}}】</td> + <td>{{item.count}}</td> + <td>{{item.projUse.price * item.count}}</td> + <td><el-input @change="changeTimeLength" v-model="item.projInfo.timeLength"></el-input></td> <td> <div style="display: flex;"> @@ -152,6 +164,10 @@ <td> <el-input v-model="item.extract"></el-input> </td> + <td> + <el-button size="mini" type="danger" + @click="handleDelete(index)">删除</el-button> + </td> </tr> @@ -185,6 +201,7 @@ </div> <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> @@ -200,6 +217,8 @@ }, //美疗师分配列表 serviceItems: [], + // 删除的服务单明细 + deleteItems : [], //美疗师 beauty: [], pls: [], @@ -248,7 +267,7 @@ //处理空对象和时间 let projService = data.mapInfo.projService; - + console.log(projService); let serviceItems = projService.serviceItems; //转换床位时间格式 @@ -323,6 +342,7 @@ endTime: endTime, staffId: beStates.staffId, extract: beStates.extract, + excTime : beStates.projInfo.timeLength, id: beStates.id, }); @@ -331,12 +351,14 @@ var params = { id: projService.id, + state : projService.state, totalTime: projService.totalTime, remark: projService.remark, bedId: projService.bedId, devisionId: projService.devisionId, yyTime: projService.yyTime, serviceItems: serviceItems, + deleteItems : _this.deleteItems, //床位时间 bedState: { startTime: startTime, @@ -357,7 +379,13 @@ _this.closeFram(); } }); - parent.myGrid.serchData(); + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.serviceOrderQuery(); + } } }); } @@ -427,12 +455,12 @@ }); } , - getFreedBeautyd: function (index) { + getFreedBeautyd: function () { console.log("获取美疗师"); let _this = this; let projService = _this.projService; - let beStates = projService.serviceItems[index]; - + let beStates = projService.serviceItems[0]; + console.log(beStates); if (beStates == null || MTools.isBlank(beStates.beginTimeForm) || MTools.isBlank(beStates.endTimeForm ) ){ return; } @@ -459,8 +487,102 @@ }); - } - , + }, + changeTimeLength:function() { + let _this = this; + + var totalTime = 0; + _this.projService.serviceItems.forEach(item => { + totalTime += parseInt(item.projInfo.timeLength); + }); + _this.projService.totalTime = totalTime; + _this.changeYyTime(); + }, + handleDelete : function(index) { + let _this = this; + var items = this.projService.serviceItems; + if (items.length > 1) { + let delItem = items.splice(index, 1); + if (delItem[0].servicesId) { + AjaxProxy.requst({ + app: _this, + url: basePath + "/admin/projService/delServiceOrderItems?id="+delItem[0].id, + callback: function (data) { + _this.$message({ + message: data.info, + type: 'success' + }); + } + }); + } + + } else { + this.$message({ + message: '需保留一个项目', + type: 'error' + }); + } + }, + addProjForm() { + var vipId = this.projService.vipInfo.id; + layer.full(layer.open({ + type: 2, + title: "添加项目", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content: [basePath + '/admin/redirect/hive/beautySalon/yyServiceAddForm?id='+vipId] + })); + }, + addProjItems(rows) { + let _this = this; + var serviceItems = this.projService.serviceItems; + + for (let i = 0; i < rows.length; i++) { + let row = rows[i] + + let flag = false; + for (let j = 0; j < serviceItems.length; j++) { + let item = serviceItems[j]; + if (item.puseId == row.projUse.id) { + flag = true; + break; + } + } + + if (flag) { + continue; + } + + let items = []; + row.projUse.projInfo.name = row.name + "--" + row.projUse.projName; + items.push({ + puseId : row.projUse.id, + count : row.count, + projUse : row.projUse, + projInfo : row.projUse.projInfo + }); + + let data = {}; + data.id = _this.projService.id; + data.state = _this.projService.state; + data.serviceItems = items; + + AjaxProxy.requst({ + app: _this, + data : data, + url: basePath + "/admin/projService/addService", + callback: function (data) { + _this.$message({ + message: "添加成功", + type: 'success' + }); + + _this.loadInfo(); + } + }); + } + + }, }, diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/instore/instoreinfo-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/instore/instoreinfo-list.html index 6bc7c70..a7befd8 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/instore/instoreinfo-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/instore/instoreinfo-list.html @@ -244,7 +244,9 @@ if (checkStatus == "待审核" || checkStatus == "审核未通过") { //没有审核并且登入者是审核者才显示审核的按钮, // if ((staffId == row.appmanId)) { + if (checkStatus == "待审核") { html += btns[2].replace('VALUE', value); + } // } if (isSame) { html += btns[1].replace('VALUE', value); diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list-pl.html b/zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list-pl.html new file mode 100644 index 0000000..99e8c74 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list-pl.html @@ -0,0 +1,182 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + +</head> +<body class=" container-fluid"> +<div class="pd-10"> + <!-- 搜索框部分start --> + <div class="row form-head"> + <form class="form-inline" id="serchform"> + <div class="form-group mr-20 "> + <div class="btn-group search-list " data-for="search-text"> + <button type="button" + class="btn btn-default dropdown-toggle searchlist" + data-toggle="dropdown"> + 产品名称 <span class="caret "></span> + </button> + <ul class="dropdown-menu" role="menu"> + <li data-field="goods.name"><a>产品名称</a></li> + <li data-field="goods.goodsNo"><a>产品编号 </a></li> + </ul> + </div> + <input autocomplete="off" id="search-text" name="goods.name" placeholder="输入查询关键词" + type="text" class="form-control"> + </div> + + <div class="form-group mr-20"> + <label for="goodsSortId">产品分类</label> <select + class=" form-control select2" size="1" + name="goods.goodsSortId" id="goodsSortId"> + <option value=''>--选择产品分类--</option> + </select> + </div> + <div class="form-group mr-20"> + <label for="isAlarm">库存报警状态</label> <select class="form-control" + name="isAlarm" id="isAlarm"> + <option value=''>--请选择库存报警状态--</option> + <option value='1'>是</option> + <option value='2'>否</option> + </select> + + </div> + <div class="form-group"> + <button onclick="myGrid.serchData(1)" type="button" + class="btn btn-sm btn-info"> + <i class="fa fa-search "></i> 搜索 + </button> + <button type="reset" class="btn btn-sm btn-info "> + <i class="fa fa-refresh "></i> 重置 + </button> + </div> + </form> + </div> + <div class="row mt-10"> + <div id="option-bar"> + <button onclick="savePl()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download"></i>选择配料</button> + <!-- 功能按钮部分 --> + </div> + <!-- 数据表格部分 --> + <table id="mgrid"> + <thead> + <tr> + <th data-checkbox="true"></th> + <th data-formatter="MGrid.indexfn" data-align="center" + data-width="30px">序号 + </th> + <th data-field="goods.code">产品编号</th> + <th data-field="goods.name">产品名称</th> + <th data-field="goods.unit">产品单位</th> + <th data-field="storeTotal" data-formatter="overTime" + data-sortable="true">库存量 + </th> + <th data-field="goodsPrice">入库平均价</th> + <th data-field="batchCount">批次数</th> + <th data-field="goods.alarmNum">库存预警值</th> + <th data-field="storeName">所属仓库</th> +<!-- <th data-field="goods.goodType">产品用途</th>--> + <th data-field="goods.goodsSortName">分类</th> + </tr> + </thead> + </table> + <!-- 数据表格部分end --> + </div> +</div> + +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script type="text/javascript"> + + var myGrid; + $(function () { + $(".select2").select2(); + //初始化商品类型搜索列表 + initGoodsTypes(); + //初始化商品属性搜索列表 + MTools.autoFullSelect(); + + myGrid = MGrid.initGrid({ + url: basePath + "/admin/store/showCountList", + sortName: "c.goodsNo", + sortOrder: "asc", + mutexClick : false, + clickToSelect : true + + }); + }); + + function buidOperate(value, row, index) { + var html = []; + html[0] = '<a onClick="openStoreFlow(\'' + row.goods.code + + '\')" class="text-primary " >流向明细</a>' + return html.join(""); + } + + function openStoreFlow(productCode){ + layer.full(layer.open({ + type : 2, + title : "库存流向明细", + maxmin : true, + area : MUI.SIZE_M, + content : [ basePath + '/admin/redirect/hive/statistics/store-inout-list?productCode='+productCode ] + })); + } + + + + + /** + * 初始化产品列表 + */ + function initGoodsTypes() { + $.AjaxProxy({ + a: false, + c: false + }).invoke(basePath + "/admin/goodstype/all", function (loj) { + $("#goodsSortId").createSelectTree(loj.attr("result").rows, { + append: true, + value: "typeName" + }); + }); + + } + + /** + * 库存警戒 + */ + function overTime(value, row, index) { + var html = ""; + var alarmNum = 0; + if (row.sku != null) { + alarmNum = row.alarmNum; + } + var storeNum = parseInt(value); + if (alarmNum > storeNum) { + html = '<span class="label-danger" > ' + value + + ' </span>'; + } else { + html = '<span>' + value + '</span>'; + } + return html; + + } + + function savePl() { + var rows = $("#mgrid").bootstrapTable('getAllSelections'); + parent.selectPl(rows); + parent.layer.close(parent.layer.getFrameIndex(window.name)); + } +</script> + +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list.html index fd4c63e..a3c1d02 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list.html @@ -181,7 +181,8 @@ alarmNum = row.alarmNum; } var storeNum = parseInt(value); - if (alarmNum >= storeNum) { + console.log(alarmNum,storeNum); + if (alarmNum > storeNum) { html = '<span class="label-danger" > ' + value + ' </span>'; } else { diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-card.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-card.html deleted file mode 100644 index 66fd807..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-card.html +++ /dev/null @@ -1,161 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingCRMcard.css}"> -<style type="text/css"> -body { - background: #eee; -} - -.am-list-news { - margin: 1.6rem 1.6rem; -} - -.am-list-news li { - margin: 1.0rem 0; -} - -.am-list-news-default .am-list>li { - border: none; - border-top: 5px solid red; - border-radius: 5px; -} - -.half-card { - width: 1rem; - height: 1rem; - border-radius: 50%; - position: relative; - background: #eee; - left: -0.5rem; - z-index: 10; -} - -.half-card2 { - width: 1rem; - height: 1rem; - border-radius: 50%; - position: relative; - background: #eee; - float: right; - left: 0.5rem; - top: -1.1rem; - z-index: 10; -} - -.am-list-date { - top: 0; - right: 2rem; -} - -.line-card { - size: 1px; - width: 100%; - top: -1.5rem; - position: relative; - border: none; - height: 1px; - background: #333; - background-image: linear-gradient(to right, #ccc, #EFE3E3, #F51515); - margin: 0; -} - -.card-name { - padding: 0 1rem; - height: 4rem; - line-height: 4rem; -} - -.am-list-item-text { - height: 3rem; - padding: 0 1rem; -} -</style> -</head> -<body> - <!-- 会员注册页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w am-header-fixed back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-account}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 会员卡信息 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="user.html" class=""> <i - class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <div class="am-list-news-bd"> - - <div th:if="${#lists.size(session.lookVipInfo.cards) eq 0}" class="no-msg">该会员无卡!</div> - - <ul th:if="${#lists.size(session.lookVipInfo.cards) ne 0}" class="am-list"> - <li th:each="item:${session.lookVipInfo.cards }" class="am-g am-list-item-dated"> - <div class="card-name"> - <a href="##" class="am-list-item-hd " th:text="${item.cardName }"></a> - <span class="am-list-date"> - 余额: <span th:text="${item.money }" ></span> 余次: - <strong th:if="${item.lastCount >100000}" th:text="不限"></strong> - <strong th:if="${item.lastCount < 100000}" th:text="${item.lastCount}"></strong> - </span> - </div> - <div class="half-card"></div> - <div class="half-card2"></div> - <hr class="line-card"></hr> - <div class="am-list-item-text" - th:value="'失效时间'+${#dates.format(item.failTime,'yyyy-MM-dd')}" > - </div> - </li> - </ul> - </div> - </div> - - - - - - - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-choice.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-choice.html deleted file mode 100644 index 34fed68..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-choice.html +++ /dev/null @@ -1,176 +0,0 @@ - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - - - - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> - -</head> -<script> - -</script> - - -<body > - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="back-m1 am-header color-w am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/CRM-account}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">点牌客户 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - <form class="am-form am-form-horizontal" action=""> - <!-- <input autocomplete="off" class="am-form-field am-input-sm" type="text" placeholder=""> - <br/> --> - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-1 "> - <span> </span> - </div> - <div class="am-u-sm-8 search"> - <input autocomplete="off" type="text" class="searchIn" placeholder="用户姓名/手机号"/> - </div> - <div class="am-u-sm-3 btn"> - <button class="am-btn am-btn-default am-radius searchBtn" >搜索</button> - </div> - - </div> - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">客户姓名</h2> - </div> - <div class="am-u-sm-5 "> - <h2 class="am-list-news-more am-fr">电话 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">等级 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作 </h2> - </div> - - </div> - - <div class="am-list-news-bd"> - <ul class="am-list"> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd" th:href="@{/admin/redirect/CRM-account-msg}">详情</a> - </div> - - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd">详情</a> - </div> - - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd">详情</a> - </div> - - </li> - </ul> - </div> - - </div> - - - <!-- 商品展示结束 --> - <!-- 测试 --> - - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - - - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-detail.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-detail.html deleted file mode 100644 index 5a97c3e..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-detail.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text=" ${webTitle }"></title> - - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingCRMdetail.css}"> - -</head> -<script> - -</script> - - -<body > - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/CRM-account}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 会员详细信息 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <form class="am-form am-form-horizontal" id="myForm" name="hobbyform" onsubmit="javascripr:return false;"> - <div class="main main1"> - <section data-am-widget="accordion" - class="am-accordion am-accordion-gapped" data-am-accordion='{ }'> - <input autocomplete="off" type="hidden" name="id" th:value="${session.lookVipInfo.id }"> - - <c:set var="num" value="0"/> - <c:forEach items="${questions}" var="items" varStatus="st" > - <dl class="am-accordion-item am-active"> - <dt class="am-accordion-title">${items[0].category}</dt> - <dd class="am-accordion-bd am-collapse am-in"> - <c:forEach items="${items}" var="item" varStatus="itemSt"> - <div class="am-accordion-content"> - <input autocomplete="off" type="hidden" name="vipAnswers[${num }].quesionId" th:value="${item.id }"> - <input autocomplete="off" type="hidden" name="vipAnswers[${num }].vipId" th:value="${session.lookVipInfo.id }"> - <div class="am-input-group am-form-group am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">${item.question}</span> - </div> - <c:choose> - <c:when test="${item.type eq '标题' }"> - </c:when> - <c:when test="${item.type eq '长文本' }"> - <div class="am-u-sm-8"> - <textarea class="form-control" name="vipAnswers[${num }].answerText" cols="30px">${item.vipAnswer.answerText }</textarea> - </div> - </c:when> - <c:when test="${item.type eq '文本' }"> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="form-control" name="vipAnswers[${num }].answerText" th:value="${item.vipAnswer.answerText }" /> - </div> - <c:set var="index" th:value="${index+1}" ></c:set> - </c:when> - <c:otherwise> - <div class="am-u-sm-8"> - <select name="vipAnswers[${num }].answerId" class="form-control select2" <c:if test="${item.type eq '多选'}">multiple="multiple"> - <c:if test="${item.type eq '单选'}"> - <option value="">--请选择-- </option> - - - <c:forEach items="${item.answers }" var="answer" > - <c:set var="temp" th:value="${answer.id}"/> - <option th:value="${answer.id}" <c:if test="${fn:contains(item.vipAnswer.answerId,temp) }">selected="selected"> - ${answer.answer} </option> - </c:forEach> - </select> - </div> - </c:otherwise> - </c:choose> - </div> - </div> - <c:set var="num" th:value="${num+1 }"/> - </c:forEach> - </dd> - </dl> - </c:forEach> - - - - </section> - - </div> - </form> - - </div> - <div class="inputBtn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" - class="am-btn btn-m1 am-radius am-btn-block" value="保存"></input> - </div> - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - - - <script> - $(".select2").select2(); - /* 会员爱好表单条件 */ - var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/customer/addOrModifyVipAnswer", - formSelecter : "#myForm", - afterSubmit : function(loj) { - layer.open({ - shade:false, - content : '操作成功', - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/CRM-account"); - } - }); - } - }); - - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow-add.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow-add.html deleted file mode 100644 index 13621db..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow-add.html +++ /dev/null @@ -1,218 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - - - - - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingUserVip.css}"> - <style type="text/css"> - .loadingbig{ - max-width: 100%; - } - -</style> - -</head> -<script> - -</script> - - -<body> - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-account-follow}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 新增跟进记录 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main2" > - <form class="am-form am-form-horizontal" method="post" id="dataform" onsubmit="javascripr:return false;"> - - <input autocomplete="off" type="hidden" name="id" th:value="${obj?.id}" > - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label ">会员姓名</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field " th:value="${session.lookVipInfo.vipName}" - readonly="readonly" /> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">项目</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" th:value="${obj?.info0}" class="am-form-field " name="info0" > - </div> - </div> - - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">导入仪器</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" th:value="${obj?.info1}" class="am-form-field " name="info1" > - </div> - </div> - - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">产品搭配</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" th:value="${obj?.info2}" class="am-form-field " name="info2" > - </div> - </div> - - - - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">家居产品</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" th:value="${obj?.info3}" class="am-form-field " name="info3" > - </div> - </div> - - - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">回访时间</span> - </div> - <div class="am-u-sm-8"> - - <input autocomplete="off" type="date" th:value="${#dates.format(obj?.followTime,'yyyy-MM-dd')}" id="voInDate" name="followTime" class="am-form-field " /> - </div> - </div> - - - - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">肌肤现状</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" th:value="${obj?.info5}" class="am-form-field " dataType="*1-100" name="info5" > - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">效果图1</span> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-12"> - <input autocomplete="off" th:value="${obj?.info6}" name="info6" id="img1" - class="form-control upload-input" type="text" /> <a - class="btn btn-primary radius upload-a">选择图片 - </a> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">效果图2</span> - </div> - - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - - <div class="am-u-sm-12"> - <input autocomplete="off" th:value="${obj?.info7}" name="info7" id="img2" - class="form-control upload-input" type="text" /> <a - class="btn btn-primary radius upload-a">选择图片 - </a> - </div> - </div> - - - - <div class="inputBtn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" class="am-btn btn-m1 am-radius am-btn-block" value="保存"></input> - </div> - <!-- 测试 --> - - </form> - </div> - </div> - - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script th:src="@{/js/systools/AjaxProxyVue.js}"></script> - - - <script> - MTools.initImgUpload(".upload-input"); - var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/serviceRecord/addOrModify", - beforeSubmit:function(){ - - }, - afterSubmit : function(loj) { - - var msg = ''; - if (loj.attr("result").status == '200') { - msg = '添加成功'; - layer.open({ - shade : false, - content : msg, - className : 'showBox', - time : 1, - end : function(elem) { - MTools.redirect( basePath+"/admin/redirect/hive/mobile/CRM-account-follow"); - } - }); - } - } - }); - - - - - </script> - <!-- index js --> -</body> -</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow.html deleted file mode 100644 index 19e830e..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow.html +++ /dev/null @@ -1,188 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingCRMaccount-service.css}"> -<!-- <style type="text/css"> - .divList{ - _height:200px; - min-height:100px; - border:1px solid #000; - } - -</style> --> - -</head> -<script> - -</script> - - -<body> - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-account}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="" th:text="${session.lookVipInfo.vipName}+'跟进记录'"> </a> - </h1> - - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - - <div class="am-g"> - <div class="col-sm-12" style="text-align: right"><a th:href="@{/admin/redirect/hive/mobile/CRM-account-follow-add}" - class="am-btn am-btn-primary">新增跟进记录</a></div> - </div> - - - <!-- 套餐表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default divList" style="margin-bottom: 60px"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g" id="ul_title"> - <!--带更多链接--> - <div class="am-u-sm-4 "> - <h2 class="am-list-news-more am-fr">计划跟进时间</h2> - </div> - <div class="am-u-sm-6 "> - <h2 class="am-list-news-more am-fr">肌肤现状</h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作</h2> - </div> - - </div> - - <div class="am-list-news-bd " > - <ul class="am-list" id="showdataBox"> - - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px;margin-bottom: 100px"> - - </div> - </div> - - - - </div> - </div> - <form class="am-form" method="post" - id="dataform" onsubmit="javascripr:return false;"> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" id="limit" name="limit" value="10" /> - </form> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - - <script> - var delBtn=""; - </script> - - <script matrix:btn="servicefollow-dels" > - delBtn='<a class="am-list-item-hd" onClick="del(\'VALUE\')" >删除</a>'; - </script> - - - <script> - - - - - /** - 加载数据 - **/ - $(function(){ - - var pageSize=$("#limit").val(); - var flag = $.query.get("flag"); - if(flag){ - $("#order-select").val(flag); - } - Pagination.init({ - url: basePath+"/admin/serviceRecord/showList", - pageSize : pageSize, - builderDate:function(loj){ - var html=''; - if(loj.getRowCount() >0){ - for(var i=0 ; i<loj.getRowCount(); i++ ){ - html+=' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> <div class="am-u-sm-4 "> <h3 class="am-list-item-hd">' - +loj.getDateYMH(i,"followTime") - +'</h3> </div> <div class="am-u-sm-6 "><h3 class="am-list-item-hd">' - +loj.getString(i,"info5") - +'</h3> </div> <div class="am-u-sm-2 ">' - +'<a class="am-list-item-hd" href="'+basePath+'/admin/serviceRecord/editForm?id='+loj.getString(i,"id")+'" >编辑</a> ' - +delBtn.replace("VALUE",loj.getString(i,"id"))+'</div></li>'; - } - }else{ - html ='<Div style="text-align: center;width:100%;">暂无跟进记录</div>' - $("#pagingBox").hide(); - } - return html; - } - }).serchDate(); - }) - - - function del(id){ - layer.open({ - content: '确认要删除这条记录吗?', - btn: ['确认', '取消'], - shadeClose: false, - yes: function(){ - $.AjaxProxy({p:{keys:id}}).invoke( basePath+"/admin/serviceRecord/del",function(loj){ - layer.open({content: '删除成功', time: 1}); - Pagination.serchDate(); - }); - - } - }); - } - </script> - - - - - - - - <!-- index js --> -</body> -</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-mealuse.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-mealuse.html deleted file mode 100644 index 17cf4c8..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-mealuse.html +++ /dev/null @@ -1,177 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href= "@{/css/dingOrderUseNew.css}"> -<link rel="stylesheet" type="text/css" - th:href= "@{/plugin/LCalendar/src/css/LCalendar.css}"> - -</head> - -<body> - <!-- 购物车页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-account}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 套餐项目情况 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="###" class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 购物车表单开始 --> - <div class="main main1"> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <div class="am-list-news-bd"> - <ul class="am-list" id="ul_order_use"> - - </ul> - </div> - </div> - </div> - - <!-- 购物车表单结束 --> - - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/LCalendar/src/js/LCalendar.js}"></script> - <!-- index js --> - <script type="text/javascript"> - /* $('.datetimepicker').datetimepicker({ - format : "yyyy-mm-dd hh:ii", - autoclose: true, - }); */ - - $(function() { - MTools.autoFullSelect(); - $(".check").uCheck('enable'); - $ - .AjaxProxy() - .invoke( - basePath+"/admin/projUser/findAllUseService", - function(loj) { - var html = ""; - var taocanProjMap = loj.attr("result")["mapInfo"].taocanProjMap; //mapInfo对象 - - - if (loj.getRowCount() > 0 || taocanProjMap.length> 0) { - - //循环取出套餐的信息 - - for ( var i=0 ; i<taocanProjMap.length;i++ ) { - var taocanInfo =taocanProjMap[i]; - html += '<div class="card">' - + '<li class="lic am-g " >' - + '<div class=" am-u-sm-8 am-list-main"><h2 class="am-list-item-hd">' - + taocanInfo.tcName - + '</h2></div><div class=" am-u-sm-3 am-list-main"><h3 class="am-list-item-hd">余额 ¥' - + taocanInfo.balance - + '</h3></li>'; - - //循环取出一个套餐中包含的项目 - for (var j = 0; j < taocanInfo.taocanProjUse.length; j++) { - - var projUse = taocanInfo.taocanProjUse[j]; - - html += '<li class="lic am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left " >' - - + '<div class=" am-u-sm-4 "><h3 class="am-list-item-hd">' - + projUse.name - + '</h3></div><div class=" am-u-sm-3 "><h3 class="am-list-item-hd">余额¥' - + projUse.balance - + '</h3></div><div class="am-u-sm-3 "> <span>余' - + projUse.surplusCount - + '次</span></div></li>'; - } - html += '<div class="taocan"></div>' - + '</div>'; - } - //循环取出项目列表 - for (var i = 0; i < loj.getRowCount(); i++) { - - html += '<div class="card">' - + ' <li class=" lic am-g " >' - - + '<div class=" am-u-sm-4 am-list-main"><h3 class="am-list-item-hd">' - + loj.getString(i, "projInfo").projName - + '</h3></div><div class=" am-u-sm-3 am-list-main"><h3 class="am-list-item-hd">余额¥' - + loj.getString(i, "balance") - + '</h3></div><div class="am-u-sm-3 am-list-thumb"> <span>余' - + loj.getString(i, - "surplusCount") - + '次</span></div></li>' - + '<div class="taocan"></div></div>'; - } - - } else { - html = '<div class="empty-car">' - + '<p id="empty-car">没有可消耗项目</p>' - + '<p>' - + '<a href='+basePath+'"/admin/redirect/hive/mobile/order-list"> 马上去选购! </a>' - + '</p>' - + '</div>' - $("#submitBtn").hide(); - } - //显示数据 - $("#ul_order_use").html(html); - }); - - }) - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-msg.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-msg.html deleted file mode 100644 index c80fda5..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-msg.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingUserVip.css}"> - -</head> -<body> - <!-- 会员注册页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-account}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 会员信息 - </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="user.html" class=""> - - <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - - - <!-- 会员注册表单开始 --> - <div class="main main2" > - <form class="am-form am-form-horizontal" method="post" id="dataform" onsubmit="javascripr:return false;"> - - <input autocomplete="off" type="hidden" th:value="${session.lookVipInfo.id }" name="id"> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">会员姓名</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${session.lookVipInfo.vipName }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">会员电话</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" id="input-bottom" th:value="${session.lookVipInfo.phone }" placeholder="会员手机号" name="phone" - type="text" dataType="m" nullmsg="请填写会员手机号" errormsg="请填写正确手机号"/> - </div> - </div> - <div class="Validform_checktip"></div> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">会员地址</span> - </div> - - <div class="am-u-sm-8"> - <input autocomplete="off" id="input-bottom" th:value="${session.lookVipInfo.addr }" placeholder="会员地址" name="addr" - type="text" dataType="*" nullmsg="请填写会员地址"/> - </div> - </div> - <div class="Validform_checktip"></div> - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">会员星座</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${session.lookVipInfo.constell }"></span> - </div> - </div> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">会员生肖</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${session.lookVipInfo.animalSign }"></span> - </div> - </div> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">到店途径</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${session.lookVipInfo.arrivalWay }"></span> - </div> - </div> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g" > - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">性 别</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${session.lookVipInfo.sex }"></span> - </div> - </div> - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">会员类型</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${session.lookVipInfo.vipType }"> - </span> - </div> - </div> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">会员生日</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:value="${#dates.format(session.lookVipInfo.birthday1, 'yyyy-MM-dd')}"></span> - </div> - </div> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">疾病历史</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${session.lookVipInfo.disease }"> - </span> - </div> - </div> - <div class="inputBtn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" class="am-btn btn-m1 am-radius am-btn-block" value="保存"></input> - </div> - - </form> - </div> - <!-- 会员到访表单结束 --> - - - - - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> -/*会员注册判断 */ -var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/vipInfo/modifyVip", - afterSubmit : function(loj) { - layer.open({ - shade:false, - content : '保存成功', - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobile/CRM-account-my"); - } - }); - } -}); -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-my.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-my.html deleted file mode 100644 index 2bfecaa..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-my.html +++ /dev/null @@ -1,259 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> -<style type="text/css"> -.m_ul{ - list-style: none; -} - -.m_ul li span{ -margin-left: 2em; -} -</style> -</head> - - - -<body> - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 我的客户 </a> - </h1> - - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1" id="main" style="display: none;"> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-6 margin-b1"> - <select class="form-control autoFull border" - th:data-url="@{/admin/vipInfo/findVipLevel}" - data-filed="levelName" - name="levelId"> - <option value=''>等级</option> - </select> - </div> - - <!-- <label class="col-sm-2 control-label">会员活跃度</label> --> - <div class="am-u-sm-6 margin-b1" > - <select class="form-control autoFull border" - th:data-url="@{/admin/dataDictionary/showDataDictionary}" - data-param="{type:'会员活跃度'}" - data-value="name" - name="vipState"> - <option value=''>活跃度</option> - </select> - </div> - <div class="am-u-sm-6 margin-b1"> - <select name="select" id="select" onchange="option()"> - <option value=''>--类型选择--</option> - <option value="absentDay">未到店日期</option> - <option value="birthdays">生日</option> - <option value="followDays">跟进</option> - <option value="appointDays">预约</option> - </select> - </div> - <div class="am-u-sm-6 margin-b1"> - <select name="time" id="time"> - <option value='' class="option time">--时间选择--</option> - <option value="3" class="option option1 ">3天</option> - <option value="7" class="option option1">7天</option> - <option value="14" class="option option1">14天</option> - <option value="1" class="option option2">今天</option> - <option value="3" class="option option2">3天内</option> - <option value="30" class="option option2">一个月</option> - </select> - </div> - - <div class="am-u-sm-8 "> - <input autocomplete="off" type="text" class="searchIn" name="keyWord" placeholder="用户姓名/手机号" /> - - </div> - <div class="am-u-sm-4 "> - <button type="button" - class="am-btn am-btn-default am-radius searchBtn" - onclick="Pagination.serchDate()">搜索</button> - </div> - - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" id="limit" value="10" /> - </div> - - - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">客户姓名</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">电话</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">会员等级</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">操作</h2> - </div> - </div> - <div class="am-list-news-bd"> - <ul class="am-list am-list-striped" id="showdataBox"> - - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"></div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - /** - 加载数据 - **/ - $(function() { - var pageSize=$("#limit").val(); - Pagination - .init( - { - url : basePath+"/admin/customer/showMyCustomerByModel", - pageSize : pageSize, - builderDate : function(loj) { - if (loj.getRowCount() > 0) { - $("#main").show(); - var html = ""; - //构建数据 - for (var i = 0; i < loj.getRowCount(); i++) { - var phone=' '; - var tphone=' '; - if(loj.getString(i, "phone")&&loj.getString(i, "phone")!=''){ - phone=loj.getString(i, "phone"); - if(phone.length=11){ - tphone=phone.substring(0,3)+"****"+phone.substring(8,11); - }else{ - tphone=phone; - } - } - - html += ' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">'+ loj.getString(i,"vipName") + '</h3> </div>' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + tphone + '</h3> </div> ' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' +(loj.getString(i, "vipLevel").levelName==null?' ':loj.getString(i, "vipLevel").levelName) + '</h3> </div> ' - +'<div class="am-u-sm-3 "><a class="am-list-item-hd" href="tel:'+phone+'">拨号</a> <a class="am-list-item-hd" href="sms:'+phone+'">短信</a> <a class="am-list-item-hd" href="'+basePath+'/admin/customer/toVipInfoSearch?id='+ loj.getString(i, "id")+ '&lookInfo=0">详情</a></div></li>'; - } - return html; - } else { - $("#pagingBox").hide(); - - - } - } - }).serchDate(); - - - //筛选点击事件 - - - - $(".m_ul li span").click(function(){ - - var normal="am-badge am-badge-secondary am-radius"; - var selected="am-badge am-badge-warning am-radius"; - var myAttr= $(this).attr("class"); - if(myAttr==selected){ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",normal); - Pagination.serchDate(); - }else{ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",selected); - onserch($(this).attr("kind"),$(this).attr("day")) - } - - }); - - //下拉框 - MTools.autoFullSelect(); - // - //style="display:none" - $(".option1").css("display","none"); - $(".option2").css("display","none"); - - } - ); - function option(){ - $(".option").removeAttr("selected"); - $('.time').attr('selected', true); - if($("#select").val() != null && $("#select").val() != ""){ - if($("#select").val() != "absentDay"){ - $(".option1").css("display","none"); - $(".option2").css("display","block"); - }else{ - $(".option2").css("display","none"); - $(".option1").css("display","block"); - } - }else{ - $(".option1").css("display","none"); - $(".option2").css("display","none"); - } - } - - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-potential.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-potential.html deleted file mode 100644 index f536b1a..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-potential.html +++ /dev/null @@ -1,184 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> - -</head> -<script> - -</script> - - -<body > - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/CRM-account}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 潜在客户 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - <form class="am-form am-form-horizontal" action=""> - <!-- <input autocomplete="off" class="am-form-field am-input-sm" type="text" placeholder=""> - <br/> --> - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-1 "> - <span> </span> - </div> - <div class="am-u-sm-8 search"> - <input autocomplete="off" type="text" class="searchIn" placeholder="用户姓名/手机号"/> - </div> - <div class="am-u-sm-3 btn"> - <button class="am-btn am-btn-default am-radius searchBtn" >搜索</button> - </div> - - </div> - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">客户姓名</h2> - </div> - <div class="am-u-sm-5 "> - <h2 class="am-list-news-more am-fr">电话 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">等级 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作 </h2> - </div> - - </div> - - <div class="am-list-news-bd"> - <ul class="am-list"> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd" th:href="@{/admin/redirect/CRM-account-msg}">详情</a> - </div> - - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd">详情</a> - </div> - - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd">详情</a> - </div> - - </li> - </ul> - </div> - - </div> - - - <!-- 商品展示结束 --> - <!-- 测试 --> - - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - - - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-service.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-service.html deleted file mode 100644 index 1cc29ab..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-service.html +++ /dev/null @@ -1,186 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingCRMaccount-service.css}"> - -</head> -<script> - -</script> - - -<body > - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/CRM-account}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 服务记录 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - - - - <!-- 套餐表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">服务人</h2> - </div> - <div class="am-u-sm-4 "> - <h2 class="am-list-news-more am-fr">跟进时间</h2> - </div> - <div class="am-u-sm-5 "> - <h2 class="am-list-news-more am-fr">服务项目</h2> - </div> - - </div> - <div class="am-list-news-bd"> - <ul class="am-list" id="showdataBox"> - <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <span class="am-list-item-hd">罗总</span> - </div> - <div class="am-u-sm-4 "> - <span class="am-list-item-hd">1993/12/01</span> - </div> - <div class="am-u-sm-5 "> - <span class="am-list-item-hd">大保健</span> - </div> - </li> - <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <span class="am-list-item-hd">丁川</span> - </div> - <div class="am-u-sm-4 "> - <span class="am-list-item-hd">1999/02/12</span> - </div> - <div class="am-u-sm-5 "> - <span class="am-list-item-hd">大保健</span> - </div> - </li> - </ul> - </div> - - <div id="pagingBox" > - </div> - </div> - <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default " id=""> - <ul class="am-navbar-nav am-cf am-avg-sm-1"> - <li > - <div> - <form class="am-form"> - - - - <div class="am-form-group "> - - - <span class="color-w">服务时间</span> <button type="submit" class="am-btn am-btn-default btn-add">添加</button> - <input autocomplete="off" type="date" class="" id="doc-ipt-email-1" > - - - - - <span class="color-w">服务项目</span> - <select id="doc-select-1"> - <option value="option1">大保健</option> - <option value="option2">小暴击</option> - <option value="option3">选项三</option> - </select> - - </div> - - - - </form> - </div> - </li> - - </ul> - </div> - - <!-- 商品展示结束 --> - <!-- 测试 --> - - </div> - <!-- 订单内容结束 --> - - </div> - - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - /** - 加载数据 - **/ - /* $(function(){ - Pagination.init({url: basePath+"/admin/customer/showMyCustomer", - builderDate:function(loj){ - var html=""; - //构建数据 - for(var i=0 ; i<loj.getRowCount(); i++ ){ - html+=' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> <div class="am-u-sm-3 "> <h3 class="am-list-item-hd">' - +loj.getString(i,"vipName") - +'</h3> </div> <div class="am-u-sm-4 "><h3 class="am-list-item-hd">' - +loj.getString(i,"phone") - +'</h3> </div> <div class="am-u-sm-3 "> <h3 class="am-list-item-hd">' - +'待做' - +'</h3> </div> <div class="am-u-sm-2 ">' - +'<a class="am-list-item-hd" th:href="@{/admin/redirect/CRM-account?id='+loj.getString(i,"id")+'" >详情</a></div></li>'; - } - return html; - } - }).serchDate(); - }) - */ - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-turn.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-turn.html deleted file mode 100644 index c6dbdc7..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-turn.html +++ /dev/null @@ -1,184 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> - -</head> -<script> - -</script> - - -<body > - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/CRM-account}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 轮牌客户 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - <form class="am-form am-form-horizontal" action=""> - <!-- <input autocomplete="off" class="am-form-field am-input-sm" type="text" placeholder=""> - <br/> --> - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-1 "> - <span> </span> - </div> - <div class="am-u-sm-8 search"> - <input autocomplete="off" type="text" class="searchIn" placeholder="用户姓名/手机号"/> - </div> - <div class="am-u-sm-3 btn"> - <button class="am-btn am-btn-default am-radius searchBtn" >搜索</button> - </div> - - </div> - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">客户姓名</h2> - </div> - <div class="am-u-sm-5 "> - <h2 class="am-list-news-more am-fr">电话 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">等级 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作 </h2> - </div> - - </div> - - <div class="am-list-news-bd"> - <ul class="am-list"> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd" th:href="@{/admin/redirect/CRM-account-msg}">详情</a> - </div> - - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd">详情</a> - </div> - - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">张全蛋</h3> - </div> - - - <div class="am-u-sm-5 "> - <h3 class="am-list-item-hd">15095828513</h3> - </div> - <div class="am-u-sm-2 "> - <h3 class="am-list-item-hd">尊贵会</h3> - </div> - <div class="am-u-sm-2 "> - <a class="am-list-item-hd">详情</a> - </div> - - </li> - </ul> - </div> - - </div> - - - <!-- 商品展示结束 --> - <!-- 测试 --> - - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - - - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account.html deleted file mode 100644 index f7f90b0..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account.html +++ /dev/null @@ -1,126 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingCRMAccount.css}"> - -</head> -<body> -<!-- 我的客户页面 --> -<!-- 头部开始 --> -<header data-am-widget="header" class="am-header color-w back-m1 "> - <div class="am-header-left am-header-nav"> - - <a th:if="${lookInfo >0}" th:href="@{/admin/redirect/hive/mobile/CRM-vipInfo-search}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - - <a th:if="${lookInfo <=0}" th:href="@{/admin/redirect/hive/mobile/CRM-account-my}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - - </div> - <h1 class="am-header-title"> - <a href="#title-link" class="" th:text="${session.lookVipInfo.vipName}+'客户信息'"> </a> - </h1> - <!-- <div class="am-header-right am-header-nav"> - <a href="user.html" class=""> <i - class="am-header-icon am-icon-bars"></i> - </a> - </div> --> -</header> -<!-- 头部结束 --> -<!-- 内容开始 --> -<ul class="am-avg-sm-3 boxes" id="boxs"> - - <li class="box box-1"><a - th:href="@{/admin/redirect/hive/mobile/CRM-account-msg}"> <img - th:src="@{/images/dingImg/jbmsg.png}"></img><br> - <small class="boxs">会员基本信息</small> - </a></li> - - - <li class="box box-2"><a - th:href="@{/admin/redirect/hive/mobile/CRM-account-card}"> <img - th:src="@{/images/dingImg/vipmsg.png}"></img><br> - <small class="boxs">会员卡信息</small> - </a></li> - - - <li class="box box-3"><a - th:href="@{/admin/redirect/hive/mobile/CRM-account-mealuse}"> <img - th:src="@{/images/dingImg/tcuse.png}"></img><br> - <small class="boxs">套餐项目使用情况</small> - </a></li> - - - <li class="box box-5"><a - th:href="'/admin/customer/showVipMoneyCardList?vipId='+${session.lookVipInfo?.id}"> <img - th:src="@{/images/dingImg/xjdd.png}"></img><br> <small - class="boxs">充值卡使用情况</small> - </a></li> - <li class="box box-6"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-account-follow}"> <img - th:src="@{/images/dingImg/gjjl.png}"><br> <small class="boxs">跟进记录</small> - </a></li> - <li class="box box-6"> - <a th:href="@{/admin/redirect/hive/mobile/vip-archives?id=__${session.lookVipInfo.id}__}"> <img - th:src="@{/images/dingImg/gjjl.png}"><br> <small class="boxs">会员档案</small> - </a></li> -</ul> -<!-- 内容结束 --> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - $(function () { - var count = $("#boxs").find("li").length; - var index = count % 3; - if (index == 1) { - $("#boxs").append(" <li class='box'>" + "</li>"); - $("#boxs").append(" <li class='box'>" + "</li>"); - - } - if (index == 2) { - $("#boxs").append(" <li class='box'>" + "</li>"); - - } - - }) -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-card-user.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-card-user.html deleted file mode 100644 index 888adfe..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-card-user.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingOrderMsg3.css}"> - -</head> -<body> -<!-- 套餐详情页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a href="javascript:history.back(-1)" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 充值卡使用详情 - </a> - </h1> - </header> - <!-- 头部结束 --> - <div class=" main1 all" > - <div data-am-widget="list_news" class="am-list-news am-list-news-default" > - <!-- 项目详情 --> - <div th:each="item:${list}" class="am-panel am-panel-secondary" id="vipLevel"> - <div class="am-panel-hd"> - <h2 class="am-panel-title" th:text="${item.cardName}" ></h2> - <span class="down down1" ></span> - </div> - <div class="vipMsg"> - <ul class="am-list am-list-static am-list-border" id="projDetails"> - <li th:text="'总次数:'+${item.useTotal }"></li> - <li th:text="'剩余次数:'+${item.lastCount }"></li> - <li th:text="'本金:'+${item.realMoney }"></li> - <li th:text="'赠送金额:'+${item.giftMoney }"></li> - <li th:text="'来源:'+${item.source }"></li> - <li th:text="'状态:'+${item.status }"></li> - <li th:text="'到期时间: '+${#dates.format(item.failTime,'yyyy-MM-dd')}" > </li> - </ul> - </div> - </div> - <!-- 项目详情结束 --> - <input autocomplete="off" type="hidden" id="hidval" value="0"> - </div> - </div> - <!-- 客户到访表单结束 --> - - - - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> -$(function () { - $("#vipLevel").bind("click", function () { - if ($("#hidval").val() == 1) { - $(".down1").css("transform","rotate(0deg)"); - $(".vipMsg").slideUp(500,function(){ - $("#hidval").val(0); - - }) - } else { - $(".down1").css("transform","rotate(180deg)"); - $(".vipMsg").slideDown(500,function(){ - $("#hidval").val(1); - }) - } - }) -}); -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-search.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-search.html deleted file mode 100644 index 24d6d0d..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-search.html +++ /dev/null @@ -1,127 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href= "@{/css/dingCRMAccount.css}"> - -</head> -<body> - <!-- 我的客户页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 "> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/CRM-vipInfo-search}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> 我的客户 </a> - </h1> - <!-- <div class="am-header-right am-header-nav"> - <a href="user.html" class=""> <i - class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - <!-- 内容开始 --> - <ul class="am-avg-sm-3 boxes" id="boxs"> - <matrix:fn value="accountMsg"> - <li class="box box-1"><a - th:href="@{/admin/redirect/CRM-account-msg}"> <img - th:src="@{/images/dingImg/jbmsg.png}"></img><br> - <small class="boxs">会员基本信息</small> - </a></li> - - <matrix:fn value="vipInfoMsg"> - <li class="box box-5"><a - th:href="@{/admin/customer/findVipDetailByVipId}"> - <img th:src="@{/images/dingImg/xxmsg.png}"></img><br> - <small class="boxs">会员详细信息</small> - </a></li> - - <matrix:fn value="vipCardMsg"> - <li class="box box-2"><a - th:href="@{/admin/redirect/CRM-account-card"> <img - th:src="@{/images/dingImg/vipmsg.png}"></img><br> - <small class="boxs">会员卡信息</small> - </a></li> - - <matrix:fn value="mealuse"> - <li class="box box-3"><a - th:href="@{/admin/redirect/CRM-account-mealuse"> <img - th:src="@{/images/dingImg/tcuse.png}"></img><br> - <small class="boxs">套餐项目使用情况</small> - </a></li> - - <matrix:fn value="CRMAccountFollow"> - <li class="box box-5"><a - th:href="@{/admin/redirect/CRM-account-follow"> <img - th:src="@{/images/dingImg/gjjl.png}"></img><br> <small - class="boxs">跟进记录</small> - </a></li> - - <li class="box box-6"><a> - - </a></li> - </ul> - <!-- 内容结束 --> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - $(function(){ - var count=$("#boxs").find("li").length; - var index=count%3; - if(index==1){ - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - - } - if(index==2){ - $("#boxs").append(" <li class='box'>"+"</li>"); - - } - - }) - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vip.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vip.html deleted file mode 100644 index 3b0e67d..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vip.html +++ /dev/null @@ -1,245 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingUserVip.css}"> - -</head> -<body> - <!-- 会员注册页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class=""> - - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 会员注册 - </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="user.html" class=""> - - <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - - - <!-- 会员注册表单开始 --> - <div class="main main2" > - <form class="am-form am-form-horizontal" method="post" id="dataform" onsubmit="javascripr:return false;"> - - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label ">会员姓名</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field " name="vipName" - placeholder="会员姓名" dataType="*1-20" nullmsg="请填写会员姓名" errormsg="长度为1-20" /> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">会员电话</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field " name="phone" placeholder="手机号" nullmsg="请填写会员手机号" errormsg="请填写正确手机号"> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">会员地址</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field " name="addr" - placeholder="会员地址" dataType="*" nullmsg="请填写会员地址"> - </div> - </div> - - - - <!-- <input autocomplete="off" class="am-form-field am-input-sm" type="text" placeholder=""> - <br/> --> - - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">到店途径</span> - </div> - <div class="am-u-sm-8"> - <select class="" name="arrivalWay" datatype="*" nullmsg="请选择到店途径"> - <option value="">-- 请选择到店途径 --</option> - <option th:each="item:${ddtj}" th:value="${item.value}" th:text="${item.value}"></option> - </select> - </div> - </div> - <div class="Validform_checktip"></div> - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot" > - <div class="am-u-sm-4"> - <span class="am-input-group-label">性 别</span> - </div> - <div class="am-u-sm-8"> - <select class=" " name="sex" datatype="*" nullmsg="请选择性别"> - <option value="女">女</option> - <option value="男">男</option> - </select> - </div> - </div> - <div class="Validform_checktip"></div> - - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">会员生日</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="date" id="voInDate" name="voBirthday" - class="am-form-field " datatype="*" nullmsg="请选择会员生日" onchange="changeBirthday(this.value)"/> - </div> - </div> - <div class="Validform_checktip"></div> - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">会员星座</span> - </div> - <div class="am-u-sm-8"> - <select name="constell" id="constell"> - <option value="">-- 请选择会员星座 --</option> - <option th:each="item:${xz}" th:value="${item.name}" th:text="${item.name}"></option> - </select> - </div> - </div> - <div class="Validform_checktip"></div> - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label ">会员生肖</span> - </div> - <div class="am-u-sm-8"> - <select class=" " name="animalSign" id="animalSign" ><!-- datatype="*" nullmsg="请选择会员生肖" --> - <option value="">-- 请选择会员生肖 --</option> - <option th:each="item:${sx}" th:value="${item.name}" th:text="${item.name}"></option> - </select> - </div> - </div> - <div class="Validform_checktip"></div> - <div class="am-form-group am-input-group am-input-group-primary am-g "> - <div class="am-u-sm-4"> - <span class="am-input-group-label ">备 注</span> - </div> - <div class="am-u-sm-8"> - <textarea name="remark" class="border " clos="100" rows="3" warp="virtual"></textarea> - </div> - </div> - - <div class="inputBtn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" class="am-btn btn-m1 am-radius am-btn-block" value="注册"></input> - </div> - <!-- 测试 --> - - </form> - </div> - <!-- 会员到访表单结束 --> - - - - - -<script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - - /*会员注册判断 */ -var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/vipInfo/registerVipInfo", - afterSubmit : function(loj) { - layer.open({ - shade:false, - content : '注册成功', - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobile/CRM?foot=3"); - } - }); - } -}); - - function changeBirthday(birthday){ - /* $("#constell").removeAttr("option:selected"); */ - $.AjaxProxy({gs_parameter:{birthday1:birthday}}).invoke( - basePath+"/admin/vipInfo/getBirthday" , function(loj){ - if(loj.getRowCount()>0){ - $("#constell option:selected").html(loj.getString(0,"constell")); - $("#animalSign option:selected").html(loj.getString(0,"animalSign")); - - /* console.log($("#constell").find("option:selected").html()); - $("#constell").find("option[text="+loj.getString(0,"constell")+"]").attr("selected",true); - $("#animalSign").find("option[text="+loj.getString(0,"animalSign")+"]").attr("selected",true); */ - } - }); - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vipInfo-search.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vipInfo-search.html deleted file mode 100644 index 4dd0d14..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vipInfo-search.html +++ /dev/null @@ -1,265 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href= "@{/css/dingOrderSearch.css}"> -<style type="text/css"> -#userList { - height: 200px; - overflow: scroll; - overflow-x: hidden; -} -</style> -</head> -<body onkeypress="dosearch(event)"> - <header data-am-widget="header" class="am-header color-w back-m1 back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> 会员搜索 </a> - </h1> - </header> - <!-- 商品搜索页面 --> - <div class="wrap"> - <div class="am-g"> - <div class="am-u-sm-9 no-right"> - <input autocomplete="off" id="userName" name="acctNo" type="text" - class="am-form-field id-in am-dropdown-up" placeholder="请输入手机号或者姓名" /> - <ul id="userList" class="userList " style="display: none"> - </ul> - - </div> - <div class="am-u-sm-3 no-left"> - <button class="am-btn am-btn-default" type="button" - onclick="searchUser()"> - <span class="am-icon-search"></span> - </button> - </div> - </div> - </div> - - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script> - $(function() { - - $("#userName").bind('input propertychange', function() { - - var $input = $("#userName"); - if ($input.length < 1) { - return false; - } - - if ($input.val().length > 1) { - $ - .AjaxProxy({ - p : { - keyWord : $input.val(), - }, - c : false, - a : false, - }) - .invoke( - basePath+"/admin/vipInfo/findUserByPhoto", - function(loj) { - var html = ""; - if (loj.getRowCount() > 0) { - for (var i = 0; i < loj - .getRowCount(); i++) { - html += '<li onclick="selectList(\'' - + loj - .getString( - i, - 'phone') - + '\')" >' - + loj - .getString( - i, - 'phone') - + "-" - + loj - .getString( - i, - 'vipName') - + "-" - + loj - .getString( - i, - 'vipNo') - + '</li>'; - } - $("#userList") - .html(html) - .show(); - } else { - $("#userList") - .empty() - .hide(); - } - - }); - } else { - $("#userList").hide(); - } - }); - - /* $("#userName") - .keyup( - function() { - var $input = $("#userName"); - if ($input.length < 1) { - return false; - } - - if ($input.val().length > 1) { - $ - .AjaxProxy({ - p : { - keyWord : $input.val(), - }, - c : false, - a : false, - }) - .invoke( - basePath+"/admin/vipInfo/findUserByPhoto", - function(loj) { - var html = ""; - if (loj.getRowCount() > 0) { - for (var i = 0; i < loj - .getRowCount(); i++) { - html += '<li onclick="selectList(\'' - + loj - .getString( - i, - 'phone') - + '\')" >' - + loj - .getString( - i, - 'phone') - + "-" - + loj - .getString( - i, - 'vipName') - + "-" - + loj - .getString( - i, - 'vipNo') - + '</li>'; - } - $("#userList") - .html(html) - .show(); - } else { - $("#userList") - .empty() - .hide(); - } - - }); - } else { - $("#userList").hide(); - } - }); */ - }) - function searchUser() { - if($("#userName").val().length<1){ - layer - .open({ - shade : false, - content : "请输入关键词后再查询", - className : 'showBox', - time : 1, - }); - return false; - } - $.AjaxProxy({p : {keyWord : $("#userName").val(),}, - c : false, - }) - .invoke( - basePath+"/admin/vipInfo/findUserByPhoneOrNo", - function(loj) { - if (loj.getRowCount() > 0) { - layer - .open({ - shade : false, - content : "查找成功", - className : 'showBox', - time : 1, - end : function(elem) { - MTools.redirect( basePath+"/admin/customer/toVipInfoSearch?id="+loj.getString(0,"id")+"&lookInfo=1"); - } - }); - - } else { - layer.open({ - shade : false, - content : "未查询到此会员", - className : 'showBox', - time : 2 - }); - } - }); - } - function dosearch(e) { - if (e.keyCode == 13) { - e.preventDefault(); - window.event.returnValue = false; - searchUser(); - return false; - } - } - - function selectList(phone){ - $("#userList").hide(); - $("#userName").val(phone); - searchUser(); - } - - - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-info.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-info.html deleted file mode 100644 index cb567f2..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-info.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> -<style type="text/css"> - .span1{ - white-space:nowrap; - overflow:hidden; - text-overflow:ellipsis; - padding-top: 10px ; - } - -</style> - -</head> -<body> - <!-- 会员注册页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-visit-list}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">访问记录详情</a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="user.html" class=""> <i - class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - - - <!-- 会员注册表单开始 --> - <div class="main3"> - <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">客户姓名</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.custName }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">客户手机号</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.custTel }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">客户编号</span> - </div> - - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.arrivalWay }"></span> - - </div> - </div> - - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">咨询版块</span> - </div> - <div class="am-u-sm-8 span1" th:text="${obj?.advicePlate }"> - - </div> - </div> - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">业务类型</span> - </div> - <div class="am-u-sm-8 span1" th:text="${obj?.businessType }"> - - </div> - </div> - - - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">拜访门店</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.shopName }"></span> - </div> - </div> - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">健康顾问</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.adviser }"></span> - </div> - </div> - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">美疗师</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.beautician }"></span> - </div> - </div> - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">是否老客</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.isOld }"></span> - </div> - </div> - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">备注</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.remark }"></span> - </div> - </div> - <div th:if="${flag eq 1}" class="input-btn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" - class="am-btn btn-m1 am-radius am-btn-block" value="提交"> - </div> - <!-- 测试 --> - </form> - </div> - <!-- 会员到访表单结束 --> - - - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/chance/modifyChange", - afterSubmit : function(loj) { - layer.open({ - shade:false, - content : loj.getValue("info"), - className : 'showBox', - time : 2, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobiel/CRM-business-no"); - } - }); - }, - - }); - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-list.html deleted file mode 100644 index 083d838..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-list.html +++ /dev/null @@ -1,161 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> - -</head> -<script> - -</script> - - -<body > - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">到访记录</a> - </h1> - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1" id="main" style="display: none;"> - <form class="am-form am-form-horizontal" id="dataform" onsubmit="javascripr:return false;"> - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-1 "> - <span> </span> - </div> - <div class="am-u-sm-8 search"> - <input autocomplete="off" type="text" class="searchIn" name="keyWord" placeholder="姓名/手机号/编号"/> - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" value="10" /> - </div> - <div class="am-u-sm-3 btn"> - <button type="button" class="am-btn am-btn-default am-radius searchBtn" onclick="Pagination.serchDate()">搜索</button> - </div> - </div> - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">姓名</h2> - </div> - <div class="am-u-sm-5 "> - <h2 class="am-list-news-more am-fr">时间</h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">创建人</h2> - </div> - - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作</h2> - </div> - </div> - <div class="am-list-news-bd"> - <ul class="am-list" id="showdataBox"> - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"> - </div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - /** - 加载数据 - **/ - $(function(){ - Pagination.init({url: basePath+"/admin/vipInfo/visitorList", - builderDate:function(loj){ - if(loj.getRowCount()>0){ - $("#main").show(); - var html=""; - //构建数据 - for(var i=0 ; i<loj.getRowCount(); i++ ){ - html+=' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> <div class="am-u-sm-3 "> <h3 class="am-list-item-hd">' - +loj.getString(i,"custName") - +'</h3> </div> <div class="am-u-sm-5 "><h3 class="am-list-item-hd">' - +loj.getDate(i,"arrivalTime") - +'</h3> </div> <div class="am-u-sm-2 "><h3 class="am-list-item-hd">' - +loj.getString(i,"adviser") - +'</h3> </div> <div class="am-u-sm-2 ">' - +'<a class="am-list-item-hd" href="'+basePath+'/admin/vipInfo/lookVisitInfo?id='+loj.getString(i,"id")+'&flag=2" >详情</a></div></li>'; - } - return html; - }else{ - $("#pagingBox").hide(); - - } - } - }).serchDate(); - }) - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit.html deleted file mode 100644 index 62d8ea1..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit.html +++ /dev/null @@ -1,273 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu SiteFapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> - -</head> -<body> - <!-- 访客登记页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w am-header-fixed back-m1"> - <div class="am-header-left am-header-nav "> - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 客户到访登记 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="user.html" class=""> <i - class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - - <!-- 客户到访表单开始 --> - <div class="main main2"> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">新客/老客</span> - </div> - <div class="am-u-sm-8" style="padding-top: 10px"> - <input autocomplete="off" class="static-form-control" name="isOld" type="radio" value="新客"/>新客 - <input autocomplete="off" class="static-form-control" name="isOld" type="radio" value="老客"/>老客 - </div> - </div> - <div class="Validform_checktip" style="margin-bottom: 10px"></div> - - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">客户电话</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" onchange="getVipData('phone')" id="custTel" name="custTel" type="text" class="am-form-field " placeholder="输入电话后自动查询" - datatype="m" nullmsg="请填写客户手机号" errormsg="请填写正确手机号"> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">客户姓名</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" name="custName" onchange="getVipData('vipName')" id="vipName" type="text" class="am-form-field " - placeholder="客户姓名" datatype="*1-20" nullmsg="请填写客户姓名" errormsg="长度为1-20"> - </div> - </div> - - - <!-- 客户后来添加了一个会员编号,去掉了到店途径,因此性别这个字段实际存储的是会员编号 --> - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">会员编号</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" name="arrivalWay" onchange="getVipData('vipNo')" id="vipNo" type="text" class="am-form-field " placeholder="会员编号" ignore="ignore" - datatype="*1-20" nullmsg="请填写会员编号" errormsg="长度为1-20"> - </div> - </div> - - - - <div class="Validform_checktip"></div> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g "> - <div class="am-u-sm-4"> - <span class="am-input-group-label">业务类型</span> - </div> - <div class="am-u-sm-8"> - <select class=" " name="businessType" multiple="multiple"> - <!-- <option value="">-- 请选择业务类型 --</option> --> - <option th:each="item:${ywlx}" th:value="${item.name}" th:text="${item.name}"></option> - </select> - </div> - </div> - <div class="Validform_checktip"></div> - - - - - <div class="am-form-group am-input-group am-input-group-primary am-g "> - <div class="am-u-sm-4"> - <span class="am-input-group-label">所属门店</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field" readonly="readonly" th:value="${shopNmae}"> - </div> - </div> - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">到店途径</span> - </div> - <div class="am-u-sm-8"> - <select class=" " name="arrivalWay" datatype="*" nullmsg="请选择到店途径"> - <!-- 动态添加 --> - <option value="">-- 请选择到店途径 --</option> - <option th:each="item:${ddtj}" th:value="${item.name}" th:text="${item.name}"></option> - </select> - </div> - </div> - <div class="Validform_checktip"></div> - - - - - - <div class="am-form-group am-input-group am-input-group-primary am-g "> - <div class="am-u-sm-4"> - <span class="am-input-group-label ">健康顾问</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field " readonly="readonly" - th:value="${staffName}"> - </div> - </div> - - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">美 疗 师</span> - </div> - <div class="am-u-sm-8"> - <select class=" " name="beauticianId" datatype="*" nullmsg="请选择美疗师"> - <option value="">-- 请选择美疗师--</option> - <option th:each="item:${mls}" th:value="${item.suId}" th:text="${item.suName}"></option> - </select> - </div> - </div> - <div class="Validform_checktip"></div> - - <div class="am-form-group am-input-group am-input-group-primary am-g "> - <div class="am-u-sm-4"> - <span class="am-input-group-label ">备 注</span> - </div> - <div class="am-u-sm-8"> - <textarea name="remark" class="border " clos="100" rows="3" warp="virtual"></textarea> - </div> - </div> - <div class="inputBtn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" - class="am-btn btn-m1 am-radius am-btn-block" value="提交"></input> - </div> - <!-- 测试 --> - - </form> - </div> - - - <!-- 客户到访表单结束 --> - - - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - - //自动填充 - function getVipData(key){ - if($("input[name='isOld']:checked").val() == "老客"){ - if(key=="phone"){ - $("#vipName").val(""); - $("#vipNo").val(""); - //$("input[name=isOld]").removeAttr("checked"); - queryInfo($("#custTel").val(),"",""); - }else if(key == "vipName"){ - $("#custTel").val(""); - $("#vipNo").val(""); - //$("input[name=isOld]").removeAttr("checked"); - queryInfo("",$("#vipName").val(),""); - }else if(key == "vipNo"){ - $("#custTel").val(""); - $("#vipName").val(""); - //$("input[name=isOld]").removeAttr("checked"); - queryInfo("","",$("#vipNo").val()); - } - } - } - - - - function queryInfo(phone,vipName,vipNo){ - $.AjaxProxy({gs_parameter:{phone:phone,vipName:vipName,vipNo:vipNo}}).invoke( - basePath+"/admin/vipInfo/findUserPho" , function(loj){ - if(loj.getRowCount()>0){ - $("#custTel").val(loj.getString(0,"phone")); - $("#vipName").val(loj.getString(0,"vipName")); - $("#vipNo").val(loj.getString(0,"vipNo")); - //$("input[name=isOld]").get(1).checked=true; - } - }); - return false; - } - - - - - var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/vipInfo/visitorInfo", - afterSubmit : function(loj) { - layer.open({ - shade:false, - content : '操作成功', - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobile/CRM?foot=3"); - } - }); - } - }); - $(document).ready(function(){ - - $("input[name=isOld]").get(0).checked=true; - }); - - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM.html deleted file mode 100644 index cacf522..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM.html +++ /dev/null @@ -1,226 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta http-equiv="Cache-Control" content="no-transform" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrder.css}"> - -</head> -<body> - <!-- 商机管理页面--> - <div class="wrap"> - <!-- 图片栏开始 --> - <div data-am-widget="slider" class="am-slider am-slider-c2" - data-am-slider='{"directionNav":false}'> - <ul class="am-slides" > - <li><img th:src="@{/images/dingImg/banner-img5.jpg}"> - <div class="am-slider-desc" th:text="${session.userInfo.shopName }"></div></li> - </ul> - </div> - <!-- 图片结束 --> - <!-- 表格部分开始 --> - <ul class="am-avg-sm-4 boxes" id="boxs"> - - <li class="box box-1"><a th:href="@{/admin/vipInfo/toVisitInfo}"> - <img th:src="@{/images/dingImg/dfdj2.png}"></img><br> - <small class="boxs">到访登记</small> - </a></li> - - - <li class="box box-1"><a th:href="@{/admin/redirect/hive/mobile/CRM-visit-list}"> - <img th:src="@{/images/dingImg/khcx.png}"></img><br> - <small class="boxs">到访记录</small> - </a></li> - - - <li class="box box-2"><a th:href="@{/admin/vipInfo/toRegister}"> - <img th:src="@{/images/dingImg/hyzc.png}"></img><br> - <small class="boxs">会员注册</small> - </a></li> - - - <li class="box box-3"><a - th:href="@{/admin/redirect/hive/mobile/CRM-account-my}"> <img - th:src="@{/images/dingImg/wdkh.png}"></img><br> <small - class="boxs">我的客户</small> - </a></li> - - <li class="box box-3"><a - th:href="@{/admin/redirect/hive/mobile/CRM-vipInfo-search}"> <img - th:src="@{/images/dingImg/wdkh.png}"></img><br> <small - class="boxs">客户查询</small> - </a></li> - - - </ul> - - - <!-- foot开始 --> - <div class="footr" th:fragment="footr"> - <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default " - id=""> - <ul class="am-navbar-nav am-cf am-avg-sm-4"> - <li > - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}"class="change1" > - <img th:src="@{\images\dingImg\grzx2.png}" alt="个人中心"/> - <span class="am-navbar-label ">个人中心</span> - </a> - </li> - - <li > - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class="change3"> - <img th:src="@{\images\dingImg\crm1.png}" alt="订单管理"/> - <span class="am-navbar-label">CRM</span> - </a> - </li> - <li > - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class="change4"> - <img th:src="@{\images\dingImg\ddgl1.png}" alt="商机管理"/> - <span class="am-navbar-label">订单管理</span> - </a> - </li> - - </ul> - </div> - </div> - - - <!-- foot结束 --> - </div> - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - $(function() { - $("#vipLevel").bind("click", function() { - if ($("#hidval").val() == 1) { - $(".down").css("transform", "rotate(0deg)"); - $(".vipMsg").slideUp(500, function() { - $("#hidval").val(0); - - }) - } else { - $(".down").css("transform", "rotate(180deg)"); - $(".vipMsg").slideDown(500, function() { - $("#hidval").val(1); - }) - } - }) - }); - $(function(){ - var count=$("#boxs").find("li").length; - var index=count%4; - if(index==1){ - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - } - if(index==2){ - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - } - if(index==3){ - $("#boxs").append(" <li class='box'>"+"</li>"); - } - }) - - - - $(function(){ - var id=$.query.get('foot'); - - - - - $(".change"+id).children("span").css('color','#dfbd88'); - switch(id){ - case 1: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/grzx.png'); - - break; - - case 2: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/customer3.png'); - - break; - case 3: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/crm.png'); - - break; - - case 4: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/ddgl.png'); - - break; - default: - $(".change1").children("span").css('color','#dfbd88'); - $(".change1").children("img").attr('src',basePath+'/images/dingImg/grzx.png'); - - } - - - - }); - - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/_foot.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/_foot.html deleted file mode 100644 index 4c097f7..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/_foot.html +++ /dev/null @@ -1,19 +0,0 @@ -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<!-- foot开始 --> - - - - <script type="text/javascript"> -<!-- - -//--> - // 控制footer部分变色 - - - -</script> - - - - - <!-- foot结束 --> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/_pageNav.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/_pageNav.html deleted file mode 100644 index 39fe65e..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/_pageNav.html +++ /dev/null @@ -1,67 +0,0 @@ - - -<% - String path = request.getContextPath(); - String basePath = request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + path + "/"; -%> - - <div class="pageNav" > - <b>共<span class='text-primary'>${pageVo.pageCount}</span>页 当前 <span class='text-primary'>${pageVo.pageNow}</span>页</b> - <%--上一页 --%> - <c:choose> - <c:when test="${pageVo.pageNow eq 1 }"> - <a class="pageNum"><上一页</a> - </c:when> - <c:otherwise> - <a onclick="changePage(${pageVo.pageNow-1 })" href="javascript:void(0)" class="pageNum"><上一页</a> - </c:otherwise> - </c:choose> - <c:choose> - <c:when test="${pageVo.pageCount <= 6 }"> - <c:set var="begin" value="1" /> - <c:set var="end" th:value="${pageVo.pageCount }" /> - </c:when> - <c:otherwise> - <c:set var="begin" th:value="${pageVo.pageNow-2 }" /> - <c:set var="end" th:value="${pageVo.pageNow + 3}" /> - <c:if test="${begin < 1 }"> - <c:set var="begin" value="1" /> - <c:set var="end" value="6" /> - - <c:if test="${end > pageVo.pageCount }"> - <c:set var="begin" th:value="${pageVo.pageCount-5 }" /> - <c:set var="end" th:value="${pageVo.pageCount }" /> - - </c:otherwise> - </c:choose> - - <c:if test="${pageVo.pageNow >3 }"> - <a class="pageNum" onclick="changePage(1)" href="javascript:void(0)" >首页</a> - - - - <c:forEach begin="${begin }" end="${end }" var="i"> - <c:choose> - <c:when test="${i eq pageVo.pageNow }"> - <b>${i }</b><!-- 当前页 --> - </c:when> - <c:otherwise> - <a class="pageNum" onclick="changePage(${i })" href="javascript:void(0)">${i }</a> - </c:otherwise> - </c:choose> - </c:forEach> - <c:if test="${end < pageVo.pageCount }"> - <a class="pageNum" onclick="changePage(${pageVo.pageCount })" href="javascript:void(0)" >尾页</a> - - <%--下一页 --%> - <c:choose> - <c:when test="${pageVo.pageNow eq pageVo.pageCount }"> - <a class="pageNum">下san页></a> - </c:when> - <c:otherwise> - <a class="pageNum" onclick="changePage(${pageVo.pageNow+1 })" href="javascript:void(0)">下san页></a> - </c:otherwise> - </c:choose> -</div> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/cwqk-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/cwqk-list.html deleted file mode 100644 index 34485d0..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/cwqk-list.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingPersonalAchieveReport.css}"> -<style> - .table-box{ - width:initial; - overflow-y: scroll; - overflow-x: inherit; - } - .warptable{ - width:initial; - overflow-y: scroll; - overflow-x: inherit; - } -</style> -</head> -<body> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> 床位占用</a> - </h1> - <div class="am-header-right am-header-nav"> - <div class="am-dropdown" data-am-dropdown> - <button class="am-btn am-dropdown-toggle am-btn-secondary" - data-am-dropdown-toggle> - - <i class="am-header-icon am-icon-bars"></i> - </button> - <ul class="am-dropdown-content"> - <li class="am-active"><a - th:href="@{/admin/occupancy/showCwzyList}">床位占用</a></li> - <li><a th:href="@{/admin/occupancy/editMlsForm}">美疗师占用</a></li> - </ul> - - </div> - </div> - </header> - <!-- 头部结束 --> - - <div class="report "> - <div class="am-g"> - <a href="##" class="am-u-sm-2 center" onclick="last()"><i - class="am-icon-arrow-circle-left am-icon-fw"></i></a> <input autocomplete="off" type="date" - class="choice-time am-u-sm-8 " id="date" th:value="${timeStr}"> - <a class="am-u-sm-2 center" onclick="next()"><i - class="am-icon-arrow-circle-right am-icon-fw"></i></a> - </div> - </div> - <div class="table-box"> - - <table th:if="${mlsList eq null && timePark eq null}" class="box-table"> - <thead style="display: table-footer-group;"> - <tr class="am-primary"> - <th align="center">门店暂无排班情况</th> - </tr> - </thead> - </table> - - - - <div class="warptable"> - <table class="box-table " id="mgridThead"> - <thead style="display: table-footer-group;"> - <tr class="am-primary"> - <th>时 间</th> - <th th:each="item:${bedList }" ><span th:text="${item.bedName }"></span></th> - </tr> - </thead> - <tbody> - - <tr th:each="item,counter:${timePark }" > - <td th:text="${#dates.format(item,'HH:mm')}" - </td > - <td th:each="td,counter:${chart[counter.index] }" th:class="${td.css }+ ' msg'" th:msg="${td.msg}"> - <span th:if="${ td.msg ne null }" th:class="${td.css }+ ' msg'" th:msg="${td.msg}"></span> - <span th:if="${ td.msg eq null}" th:class="${td.css } " ></span> - </td> - </tr> - - </tbody> - </table> - </div> - - </div> - <div> - <div class="exp-warp"> - <div class="exp-box box_success"></div> - <div class="exp-title">可预约</div> - </div> - <div class="exp-warp"> - <div class="exp-box box_warning"></div> - <div class="exp-title">已预约</div> - </div> - <div class="exp-warp"> - <div class="exp-box box_primary"></div> - <div class="exp-title">服务中</div> - </div> - <div class="exp-warp"> - <div class="exp-box box_danger"></div> - <div class="exp-title">服务结束</div> - </div> - </div> - <script type="text/javascript"> - $(function() { - /*修改表格宽度*/ - var o = document.getElementById("mgridThead"); - /*scrollWidth取得真实宽度,不包括滚动条,但是可以取得被隐藏的宽度*/ - var h = o.scrollWidth; - console.log(h); - console.log('aaa') - $(".warptable").css('width',h); - /*事件*/ - $(".msg").mouseenter(function(event) { - var adNode = $("#ad"); - adNode.html($(this).attr("msg")); - adNode.css("left", event.pageX + 10 + "px"); - adNode.css("top", event.pageY + 10 + "px"); - adNode.show(); - }); - $(".msg").mouseleave(function(event) { - $("#ad").hide(); - }); - }) - - function next() { - var myDate = new Date(); - var ndate = $("#date").val(); - console.log(ndate); - var newms = Date.parse(ndate); - var msdate = newms + (60 * 60 * 24 * 1000); - - myDate.setTime(msdate); - - var mon = myDate.getMonth() + 1; - var da = myDate.getDate(); - if (myDate.getMonth() + 1 < 10) { - mon = "0" + (myDate.getMonth() + 1); - } - if (myDate.getDate() < 10) { - da = "0" + myDate.getDate(); - } - var date2 = myDate.getFullYear() + "-" + mon + "-" + da; - $("#date").val(date2); - var time = $("#date").val(); - if (time != '') { - MTools - .redirect( basePath+"/admin/occupancy/showCwzyList?timeStr=" - + time); - } - } - function last() { - var myDate = new Date(); - var ndate = $("#date").val(); - var newms = Date.parse(ndate); - var msdate = newms - (60 * 60 * 24 * 1000); - myDate.setTime(msdate); - var mon = myDate.getMonth() + 1; - var da = myDate.getDate(); - if (myDate.getMonth() + 1 < 10) { - mon = "0" + (myDate.getMonth() + 1); - } - if (myDate.getDate() < 10) { - da = "0" + myDate.getDate(); - } - var date2 = myDate.getFullYear() + "-" + mon + "-" + da; - $("#date").val(date2); - var time = $("#date").val(); - if (time != '') { - MTools - .redirect( basePath+"/admin/occupancy/showCwzyList?timeStr=" - + time); - } - } - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/mls-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/mls-list.html deleted file mode 100644 index 958e025..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/mls-list.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingPersonalAchieveReport.css}"> -<link rel="stylesheet" type="text/css" - href= basePath+"/css/common-style.css"> -<style> - .table-box{ - width:initial; - overflow-y: scroll; - overflow-x: inherit; - } - .warptable{ - width:initial; - overflow-y: scroll; - overflow-x: inherit; - } -</style> -</head> -<body> - <!-- 个人业绩 --> - <!-- 头部开始 --> - - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> 美疗师占用</a> - </h1> - <div class="am-header-right am-header-nav"> - <div class="am-dropdown" data-am-dropdown> - <button class="am-btn am-dropdown-toggle am-btn-secondary" - data-am-dropdown-toggle> - - <i class="am-header-icon am-icon-bars"></i> - </button> - <ul class="am-dropdown-content"> - <li><a th:href="@{/admin/occupancy/showCwzyList}">床位占用</a></li> - <li class="am-active"><a - th:href="@{/admin/occupancy/editMlsForm}">美疗师占用</a></li> - </ul> - - </div> - </div> - </header> - <!-- 头部结束 --> - <div class="report "> - <div class="am-g"> - <a href="##" class="am-u-sm-2 center" onclick="last()"><i - class="am-icon-arrow-circle-left am-icon-fw"></i></a> <input autocomplete="off" type="date" - class="choice-time am-u-sm-8 " id="date" th:value="${timeStr}"> - <a class="am-u-sm-2 center" onclick="next()"><i - class="am-icon-arrow-circle-right am-icon-fw"></i></a> - </div> - </div> - - <div class="table-box"> - <table th:if="${mlsList eq null && timePark eq null}" class="box-table"> - <thead style="display: table-footer-group;"> - <tr class="am-primary"> - <th align="center">门店暂无排班情况</th> - </tr> - </thead> - </table> - - - <table th:if="${mlsList ne null && timePark ne null}" class="box-table" id="mgridThead"> - <thead> - <tr class="am-primary"> - <th>时 间</th> - <th th:each="item:${mlsList }" > - <span th:text="${item.staffName }"></span> - </th> - </tr> - </thead> - </table> - <div class="warptable"> - <table class="box-table"> - <thead style="display: table-footer-group;"> - <tr class="am-primary"> - <th>时 间</th> - <th th:each="item:${mlsList }" > - <span th:text="${item.staffName }"></span> - </th> - </tr> - </thead> - <tbody> - - <tr th:each="item,counter:${timePark }" > - <td th:text="${#dates.format(item, 'HH:mm')}" > - </td> - <th:block th:each="td:${chart[counter.index] }"> - <td th:if="${td.msg ne null }" th:class="${td.css } msg" th:msg="${td.msg}"></td> - <td th:if="${td.msg eq null}" th:class="${td.css }"></td> - </th:block> - </tr> - - </tbody> - </table> - </div> - - </div> - <div> - <div class="exp-warp"> - <div class="exp-box box_success"></div> - <div class="exp-title">可预约</div> - </div> - <div class="exp-warp"> - <div class="exp-box box_warning"></div> - <div class="exp-title">已预约</div> - </div> - <div class="exp-warp"> - <div class="exp-box box_primary"></div> - <div class="exp-title">服务中</div> - </div> - <div class="exp-warp"> - <div class="exp-box box_danger"></div> - <div class="exp-title">服务结束</div> - </div> - <div class="exp-warp"> - <div class="exp-box box_no"></div> - <div class="exp-title">未上班</div> - </div> - - </div> - - - <div id="ad" class="adbox" style="display: none"></div> - - - <script type="text/javascript"> - $(function() { - /*修改表格宽度*/ - var o = document.getElementById("mgridThead"); - /*scrollWidth取得真实宽度,不包括滚动条,但是可以取得被隐藏的宽度*/ - var h = o.scrollWidth; - console.log(h); - console.log('aaa') - $(".warptable").css('width',h); - /*事件*/ - $(".msg").mouseenter(function(event) { - var adNode = $("#ad"); - adNode.html($(this).attr("msg")); - adNode.css("left", event.pageX + 10 + "px"); - adNode.css("top", event.pageY + 10 + "px"); - adNode.show(); - }); - $(".msg").mouseleave(function(event) { - $("#ad").hide(); - }); - }); - - function next() { - var myDate = new Date(); - var ndate = $("#date").val(); - console.log(ndate); - var newms = Date.parse(ndate); - var msdate = newms + (60 * 60 * 24 * 1000); - - myDate.setTime(msdate); - - var mon = myDate.getMonth() + 1; - var da = myDate.getDate(); - if (myDate.getMonth() + 1 < 10) { - mon = "0" + (myDate.getMonth() + 1); - } - if (myDate.getDate() < 10) { - da = "0" + myDate.getDate(); - } - var date2 = myDate.getFullYear() + "-" + mon + "-" + da; - $("#date").val(date2); - var time = $("#date").val(); - if (time != '') { - MTools.redirect( basePath+"/admin/occupancy/editMlsForm?timeStr=" - + time); - } - } - function last() { - var myDate = new Date(); - var ndate = $("#date").val(); - var newms = Date.parse(ndate); - var msdate = newms - (60 * 60 * 24 * 1000); - myDate.setTime(msdate); - var mon = myDate.getMonth() + 1; - var da = myDate.getDate(); - if (myDate.getMonth() + 1 < 10) { - mon = "0" + (myDate.getMonth() + 1); - } - if (myDate.getDate() < 10) { - da = "0" + myDate.getDate(); - } - var date2 = myDate.getFullYear() + "-" + mon + "-" + da; - $("#date").val(date2); - var time = $("#date").val(); - if (time != '') { - MTools.redirect( basePath+"/admin/occupancy/editMlsForm?timeStr=" - + time); - } - } - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/mobileLogin.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/mobileLogin.html deleted file mode 100644 index 7fbcdfa..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/mobileLogin.html +++ /dev/null @@ -1,142 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<html class="no-js"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/> - <title>HIVE</title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingLogin.css}"> - -</head> -<body onkeypress="dologin(event)"> -<!-- 登陆页面--> -<div class="wrap"> - <img th:src="@{/images/dingIcon.png}" class="login-img"></img> - <div class="am-g"> - <div class="main am-u-sm-9 am-u-sm-centered"> - <form class="am-form am-form-horizontal dataForm "> - <div class=" am-g"> - <input autocomplete="off" id="account" name="account" - type="text" class="back-hui am-form-field id-in" placeholder="账号"> - </div> - - <div class=" am-g"> - <input autocomplete="off" id="password" name="password" - type="password" class="back-hui am-form-field psw-in" - placeholder="密码"> - </div> - - <div class=" am-g"> - <input autocomplete="off" id="reId" type="checkbox" checked="" name=""> - 记住密码 - </div> - - - <!--登陆按钮--> - <div class="am-form-group am-g"> - - <button type="button" onclick="login()" - class="am-btn am-btn-default am-u-sm-12 back-hui">登      入 - </button> - - </div> - <input autocomplete="off" type="hidden" name="isDing" value="1"/> - </form> - </div> - </div> -</div> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - -<script th:src="@{/js/function/MCookies.js}"></script> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/jsencrypt.min.js}"></script> - - -<!-- index js --> -<script type="text/javascript" th:inline="javascript"> - - var crypt = new JSEncrypt(); - - /*<![CDATA[*/ - - var publicKey =/*[[${session.publicKey}]]*/ - - /*]]>*/ - - crypt.setKey(publicKey); - - - //登陆 - - function login() { - if ($("#account").val() == "") { - layer - .open({ - content: '请输入账号!', - className: 'showBox', - time: 2 - }); - return false; - } else if ($("#password").val() == "") { - layer - .open({ - content: '请输入密码!', - className: 'showBox', - time: 2 - }); - return false; - } - - - var encAcc = crypt.encrypt($("#account").val()); - var encPwd = crypt.encrypt($("#password").val()); - $.AjaxProxy({ - p: { - suAccount: encAcc, - suPassword: encPwd - } - }).invoke("/common/doHiveMobilelogin", function (loj) { - if ($('#reId').is(':checked')) { - // do something - MCookies.add("account",$("#account").val()); - MCookies.add("password",$("#password").val()); - }else{ - MCookies.del("account"); - MCookies.del("password"); - } - MTools.redirect("/" + loj.getValue("page")); - }); - - } - - - $(function () { - if (MCookies.isExist("account")) { - $("#reId").attr("checked", 'true'); - $("#account").val(MCookies.get("account")); - $("#password").val(MCookies.get("password")); - } - }) -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-car.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-car.html deleted file mode 100644 index 6e2ddd7..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-car.html +++ /dev/null @@ -1,308 +0,0 @@ - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingPersonalCar.css}" > - -</head> -<style> - .foot-c { - background: #999 - } - - .am-navbar .am-navbar-nav { - padding-left: 0; - } - - .am-header-right a { - color: #fff; - } -</style> -<script th:if="${session.CURRENT_CUSTOMER eq null}"> - - MTools.redirect(basePath + "/admin/redirect/hive/mobile/order-search"); - -</script> -<body> -<!-- 购物车页面 --> -<!-- 头部开始 --> -<header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 我的购物车 </a> - </h1> - - <div class="am-header-right am-header-nav"> - <a id="clearCar"> 清空 </a> - </div> -</header> -<!-- 头部结束 --> - - -<!-- 购物车表单开始 --> -<div class="main main1" id="carItemsBox"> - <div class="empty-car" th:if="${session.SHOPPING_CAR} eq null or ${#lists.size(session.SHOPPING_CAR)} eq 0"> - <p id="empty-car">购物车空空的~</p> - <p> - <a th:href="@{/admin/redirect/hive/mobile/order-list}"> 马上去选购! </a> - </p> - </div> - <form th:if="${session.SHOPPING_CAR} ne null and ${#lists.size(session.SHOPPING_CAR)} ne 0" class="am-form am-form-horizontal" action="" - id="dataform" - onsubmit="javascripr:return false;"> - <!-- <input class="am-form-field am-input-sm" type="text" placeholder=""> - <br/> --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - - <div class="am-list-news-bd"> - <ul class="am-list"> - <!--缩略图在标题右边--> - <!-- 如果是商品 --> - <li th:each="item,flag:${session.SHOPPING_CAR}" - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-right"> - <div class=" am-u-sm-2 am-list-thumb am-checkbox"> - <label class="am-checkbox"> - <input type="checkbox" onclick="caculateMoney()" th:isF="${item.isFree}" - th:name="'carItems['+${flag.index}+'].id'" - th:value="${item.id}" class="check" data-am-ucheck> - - </label> - <!-- 增加隐藏域名 --> - - - <input type="hidden" th:name="'carItems['+${flag.index}+'].type'" th:value="${item.type}"> - <input type="hidden" th:name="'carItems['+${flag.index}+'].isFree'" - th:value="${item.isFree }"> - <input type="hidden" th:name="'carItems['+${flag.index}+'].goodsId'" - th:value="${item.goodsId}"> - </div> - - <div class=" am-u-sm-10 am-list-main am-list-item-thumb-left"> - - <h3 class="am-list-item-hd"> - <span th:text="${item.shoppingGoods.name }"> </span> - <br/> - <span>价格<strong class="color-r" th:text="${item.shoppingGoods.sealPice }"></strong></span> - <span th:if="${item.isFree eq '是'}">【赠】 </span> - </h3> - <div class="am-list-item-text"> - <div class="am-input-group am-input-group-primary"> - <a class="am-input-group-label reduce"> - <i class="am-header-icon am-icon-minus"></i> - </a> - <input th:name="'carItems['+${flag.index}+'].count'" type="tel" - id="num" class="am-form-field " th:value="${item.count }"/> - <a class="am-input-group-label add"> - <i class="am-header-icon am-icon-plus"></i> - </a> - </div> - </div> - - </div> - </li> - - <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-right"> - <div class=" am-u-sm-2 am-list-thumb am-checkbox"> - <label class="am-checkbox"> - <input type="checkbox" onclick="sellectAll(this)" class="check" data-am-ucheck> - </label> - </div> - <div class=" am-u-sm-10 am-list-main am-list-item-thumb-left"> - <h3 class="am-list-item-hd"> <span>全选</span><br/> </h3> - </div> - </li> - </ul> - </div> - <div> - - - - </div> - - - <div class="ps"> - <textarea name="remark" class=" border " clos="100" - rows="2" warp="virtual" placeholder="备注信息"></textarea> - </div> - - - <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default back-m1" id=""> - <ul class="am-navbar-nav am-cf am-avg-sm-3 back-m1"> - <li class="foot-c"> - <a href="" class=""> - <span class="">共<span id="goodsNum">0</span>件商品</span> - </a> - </li> - <li class="foot-c "> - <a href="###" class=""> - - <span class="">合计:¥<strong id="orderTotalMoney">0</strong></span> - - </a> - </li> - <li class="back-m1"> - <a href="###" onclick="myForm.submit()"> - <span class="">下单</span> - - </a> - </li> - - </ul> - </div> - - - </div> - - </form> - - - - - -</div> - - -<!-- 购物车表单结束 --> -<!-- 弹出 --> -<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm"> - <div class="am-modal-dialog"> - <div class="am-modal-hd">提示</div> - <div class="am-modal-bd">你确定要清空购物车吗?</div> - <div class="am-modal-footer"> - <span class="am-modal-btn" data-am-modal-cancel>取消</span> <span - class="am-modal-btn" data-am-modal-confirm>确定</span> - </div> - </div> -</div> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - $(function () { - $(".select2").select2({'width': '100%'}); - MTools.autoFullSelect(); - //数量 - $(".add").bind("click", function () { - if ($(this).prev().val() >= 0) { - $(this).prev().val(parseInt($(this).prev().val()) + 1); - } - caculateMoney(); - }); - $(".reduce").bind("click", function () { - if ($(this).next().val() > 1) { - $(this).next().val(parseInt($(this).next().val()) - 1); - } - caculateMoney(); - }); - }); - - function sellectAll(node) { - // - var checked=node.checked; - $(".am-ucheck-checkbox").each(function(){ - this.checked=checked; - }); - caculateMoney(); - - } - //下单 - var myForm = MForm.initForm({ - invokeUrl: basePath + "/admin/order/addOrder", - isvalid: false, - afterSubmit: function (loj) { - var msg = ''; - if (loj.attr("result").status == '200') { - msg = '下单成功'; - layer.open({ - shade: false, - content: msg, - className: 'showBox', - time: 1, - end: function (elem) { - MTools.redirect(basePath + "/admin/redirect/hive/mobile/order?foot=4"); - } - }); - } - } - }); - - /* 弹出JS */ - $(function () { - $('#clearCar').on('click', function () { - $('#my-confirm').modal({ - relatedTarget: this, - onConfirm: function (options) { - //请求服务器清空session - $.AjaxProxy().invoke( - basePath + "/admin/shoppingCar/clearShoppingCar", - function (loj) { - location.reload(); - }) - }, - }); - //清空列表 - }); - }); - - function caculateMoney() { - // 找到所有被选中的元素 - var money = 0.00; - var goodsNum = 0; - $("input:checked").each(function (i) { - var _this = $(this); - var freeFlag = _this.attr("isF"); - if (freeFlag == '否') { - m = parseFloat(_this.parent().parent().next('div').find('strong').html()); - n = parseInt(_this.parent().parent().next('div').find('#num').val()); - money += m * n; - goodsNum += n; - } - }); - console.log(money); - $("#orderTotalMoney").html(money); - $("#goodsNum").html($("input:checked").length); - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history-msg.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history-msg.html deleted file mode 100644 index 5a66a8f..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history-msg.html +++ /dev/null @@ -1,280 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> - -</head> -<style> - .msg { - padding-left: 0; - } -</style> -<body> -<!-- 会员注册页面 --> -<!-- 头部开始 --> - -<header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - - <a onclick="window.history.go(-1)" > <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - - - - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 订单详情 </a> - </h1> - -</header> -<!-- 头部结束 --> - - -<!-- 会员注册表单开始 --> -<div class=" main2"> - <form class="am-form am-form-horizontal " method="post" - id="dataform" onsubmit="javascripr:return false;"> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">订单编号</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label " th:text="${order.orderNo }"></span> - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">订单日期</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label " th:text=" ${#dates.format(order.orderTime,'yyyy-MM-dd')}"> </span> - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">订单总价</span> - </div> - - <div class="am-u-sm-8"> - <strong class="am-input-group-label color-r" th:text="'¥'+${order.zkTotal }"></strong> - - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - <div th:if="${order.statu ne '待付款'}"> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">现金付款</span> - </div> - - <div class="am-u-sm-8"> - <strong class="am-input-group-label color-r" th:text="'¥'+${order.cashPay }"></strong> - - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">卡付款</span> - </div> - - <div class="am-u-sm-8"> - <strong class="am-input-group-label color-r" th:text="'¥'+${order.cardPay }"></strong> - - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - </div> - - <div th:if="${order.statu eq '欠款'}"> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">欠款</span> - </div> - - <div class="am-u-sm-8"> - <strong class="am-input-group-label color-r" th:text="'¥'+${order.arrears }"></strong> - - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">购买人</span> - </div> - - <div class="am-u-sm-8"> - <span class="am-input-group-label " th:text="${order.vipName }"></span> - - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">备注</span> - </div> - - <div class="am-u-sm-8"> - <span class="am-input-group-label " th:text="${order.remark }"></span> - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label color-gray">订单状态</span> - </div> - - <div class="am-u-sm-8"> - <span class="am-input-group-label " th:text="${order.statu }"></span> - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-12 "> - <h2 class="msghead color-gray">订单明细</h2> - </div> - </div> - <div th:if="${order.items!= null}"> - <div th:each="item:${order.items }"> - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - - - <div class="am-u-sm-6"> - <span class="msg" th:text="${item.shoppingGoods.name }"></span> - </div> - <div class="am-u-sm-6"> - <span class="msg color-r" th:text="'¥'+${item.zkPrice * item.count }"></span> - </div> - <div class="am-u-sm-6"> - <span class=" msg" th:text="'数量:'+${item.count }"></span> - </div> - <div class="am-u-sm-6"> - <span class=" msg" th:text="${item.shoppingGoods.name }"></span> - </div> - <div class="am-u-sm-12 "> - <div class="line"></div> - </div> - </div> - - - </div> - </div> - - <div th:if="${order.items eq null}" - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">暂无商品详情</span> - </div> - </div> - - <div th:if="${order.statu eq '待付款' }" class="inputBtn"> - <button class="am-btn am-btn-danger am-radius am-btn-block" - type="button" onclick="cancelOrder()">取消订单 - </button> - </div> - <input type="hidden" id="orderId" th:value="${order.id}"> - </form> -</div> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - function cancelOrder() { - $ - .AjaxProxy({p: {id: $("#orderId").val()}}) - .invoke( - basePath + "/admin/order/cancelOrder", - function (loj) { - if (loj.status = '200') { - layer - .open({ - content: "订单已取消", - className: 'shouBox', - time: 2, - end: function (elem) { - MTools - .redirect(basePath + "/admin/redirect/hive/mobile/order-dfk"); - } - }); - - } - }) - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history.html deleted file mode 100644 index c8ffea0..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history.html +++ /dev/null @@ -1,194 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> - -</head> -<body > - - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 订单 </a> - </h1> - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - <form class="am-form am-form-horizontal" id="dataform" onsubmit="javascripr:return false;"> - - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - - <div id="orderSelect" class="am-u-sm-4"> - <select name="statu" id="statu" > - <option value=''>订单状态</option> - <option value='欠款'>欠款</option> - <option value='待付款'>待付款</option> - <option value='已付款'>已付款</option> - <option value='已取消'>已取消</option> - <option value='退款'>退款</option> - </select> - </div> - <div class="am-u-sm-5 search"> - <input autocomplete="off" type="text" class="searchIn" name="keyWordVo" placeholder="姓名/编号/手机号码" /> - <!-- <label>开始时间:</label> - <input autocomplete="off" type="date" name="beginTimeVo" id="beginTime"/> - <label>结束时间:</label> - <input autocomplete="off" type="date" name="endTimeVo" id="endTime"/> --> - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" value="10" /> - </div> - <div class="am-u-sm-3 btn"> - <button type="button" class="am-btn am-btn-default am-radius searchBtn" onclick="Pagination.serchDate()">搜索</button> - </div> - - </div> - - <!-- 订单表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g" id="ur_title"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">订单号 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr ">购买人 </h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">时间 </h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr ">总价</h2> - - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作 </h2> - </div> - </div> - - <div class="am-list-news-bd"> - <ul class="am-list" id="showdataBox"></ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"> - </div> - - </div> - - - <!-- 商品展示结束 --> - <!-- 测试 --> - - </form> - </div> - <!-- 订单内容结束 --> - - </div> - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script type="text/javascript"> - /* - *加载订单信息 - */ - $(function(){ - Pagination.init({ - url : basePath+"/admin/order/showStaffOrder", - builderDate:function(loj){ - var html=""; - if(loj.getRowCount()>0){ - $("#pagingBox").show(); - $("#ur_title").show(); - //构建数据 - for(var i=0; i<loj.getRowCount(); i++){ - html += "<li class='am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left'><div class='am-u-sm-3 '><h3 class='am-list-item-hd'>" - +loj.getString(i,'orderNo') - +"</h3></div><div class='am-u-sm-2 '><h3 class='am-list-item-hd'>" - +loj.getString(i,'vipName') - +"</h3></div><div class='am-u-sm-3 '><h3 class='am-list-item-hd'>" - +loj.getDate(i,'orderTime') - +"</h3></div><div class='am-u-sm-2 color-r'><h3 class='am-list-item-hd'><strong>" - +loj.getString(i,'total') - +"</strong></h3></div><div class='am-u-sm-2 '>" - +"<a class='am-list-item-hd' href='"+basePath+"/admin/order/findOrderDetailById?id="+loj.getString(i,'id')+"'>详情</a></div></li>"; - } - return html; - }else{ - $("#pagingBox").hide(); - $("#ur_title").hide(); - - } - - - } - }).serchDate(); - - //开始时间小于结束时间 - $("#beginTime").change(function(){ - var beginTime = $("#beginTime").val(); - if(beginTime!=""){ - $("#endTime").attr("min",beginTime); - } - }); - - }); - - - - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-list.html deleted file mode 100644 index 135fb76..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-list.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> -<style type="text/css"> -.box-2{ -width: 50px; - text-align: center; - position: fixed; - bottom: 30px; - right: 5px; - z-index: 999999; - background: #fff; - -} -.dot{ - width: 14px; - height: 14px; - border-radius: 7px; - background: red; - display: inline-block; - font-size: 5px; - color: #fff; - line-height: 15px; - position: relative; - top: 15px; - left: 15px;} -</style> -</head> -<script th:if="${session.CURRENT_CUSTOMER eq null}"> - - MTools.redirect(basePath + "/admin/redirect/hive/mobile/order-search"); - -</script> - - -<body > - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 商品列表 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - <form class="am-form am-form-horizontal" id="dataform" onsubmit="javascripr:return false;"> - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div id="orderSelect" class="am-u-sm-4"> - <select name=type id="order-select"> - <option value="家居产品">商品</option> - <option value="项目">项目</option> - <option value="套餐">套餐</option> - <option value="充值卡">充值卡</option> - <option value="综合卡">综合卡</option> - </select> - </div> - <div class="am-u-sm-5 search"> - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" id="limit" name="limit" value="10" /> - <input autocomplete="off" type="text" class="searchIn" placeholder="产品名称" name="keyword" /> - </div> - <div class="am-u-sm-3 btn"> - <button class="am-btn am-btn-default am-radius searchBtn" onclick="Pagination.serchDate()">搜索</button> - </div> - </div> - <div id="main" style="display: none"> - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-5 "> - <h2 class="am-list-news-more am-fr">商品名</h2> - </div> - <div class="am-u-sm-4 " id="isgoods"> - <h2 class="am-list-news-more am-fr">价格</h2> - - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">操作 </h2> - </div> - </div> - <div class="am-list-news-bd" > - <ul class="am-list" id="showdataBox"> - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"> - </div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </div> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - <div class="box box-2"> - <span class="dot" id="dot" th:if="${session.SHOPPING_CAR ne null}" th:text="${#lists.size(session.SHOPPING_CAR)}"></span> - <span class="dot" id="dot" th:if="${session.SHOPPING_CAR eq null}" >0</span> - - <a th:href="@{/admin/redirect/hive/mobile/order-car}"> - <img width="50px" th:src= "@{/images/dingImg/gwc.png}"><br> - </a></div> - - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - var $dot=$("#dot"); - - function addCar(_id,_type,_assembleId){ - var param={ - isFree:'否', - type:_type, - goodsId:_id, - count:1, - assembleId:_assembleId - } - - $.AjaxProxy({p:param}).invoke( basePath+"/admin/shoppingCar/addItemToCar",function(){ - msg='成功加入购物车'; - layer.open({ - shade:false, - content :msg, - className : 'showBox', - time : 1, - }); - var count=$dot.html(); - if(!count){ - count=0 - } - count=parseInt(count)+1; - $dot.html(count); - - }); - } - //获取详情 - var getOrderDetialPath=["order-msg","order-msg2","order-msg3","order-msg4","order-msg5"]; - - - /** - 加载数据 - **/ - $(function(){ - var pageSize=$("#limit").val(); - var flag = $.query.get("flag"); - if(flag){ - $("#order-select").val(flag); - } - Pagination.init({ - url: basePath+"/admin/shoppinggoods/showGoodsList", - pageSize : pageSize, - builderDate:function(loj){ - var initType=$("#order-select").val(); - if(loj.getRowCount()>0){ - $("#main").show(); - //构建数据 - var html=""; - var name; - var price; - var priceFlag='¥'; - var pageType=0; - var car='<i style="font-size:12px; line-height: 25px; width:25px; height:25px;" class="am-icon-btn am-success am-icon-cart-plus am-success am-icon-sm " ></i> '; - if(initType=='家居产品'){ - pageType=1; - } - else if(initType=='项目'){ - pageType=2; - } - else if(initType=='套餐'){ - pageType=3; - }else if(initType=='充值卡'){ - pageType=4; - }else if(initType=='综合卡'){ - pageType=5; - } - for(var i=0 ; i<loj.getRowCount(); i++ ){ - html +='<li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-5 ">'; - console.log(initType); - if(initType=='家居产品'){ - html +='<h3 onclick="addCar('+loj.getString(i,'id')+',\''+initType+'\','+''+')" class="am-list-item-hd">'+car+loj.getString(i,"name")+'</h3>' - } - else if(initType=='项目'){ - //var assembleId=loj.getString(i,"assembleProj")[0].id; - //console.log(assembleId); - html +='<h3 onclick="addCar('+loj.getString(i,'id')+',\''+initType+'\','+''+')" class="am-list-item-hd">'+car+loj.getString(i,"name")+'</h3>'; - } - else{ html +='<h3 onclick="addCar('+loj.getString(i,'id')+',\''+initType+'\')" class="am-list-item-hd">'+car+loj.getString(i,"name")+'</h3>'; - } - var sealPice=loj.getString(i,"sealPice"); - if(!sealPice){sealPice=0} - - html+='</div>' - +'<div class="am-u-sm-4 ">' - +' <h3 class="am-list-item-hd color-r">'+priceFlag+sealPice+'</h3>' - +'</div>' - +'<div class="am-u-sm-3 ">' - +'<a href="'+getOrderDetialPath[pageType-1]+'?ding_order_id='+loj.getString(i,"id")+'">详情</a>' - +'</div>' - +'</li>'; - } - return html; - }else{ - $("#main").hide(); - $("#pagingBox").hide(); - - } - } - }).serchDate(); - }) - - //fn2 下拉列表,添加change事件 - $("#order-select").change(function(){ - $("#_offset").val(0) - Pagination.serchDate(); - }); - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg.html deleted file mode 100644 index acfa11f..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg.html +++ /dev/null @@ -1,253 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderMsg3.css}"> - -</head> -<style> -</style> -<body> -<!-- 商品详情页面 --> -<!-- 头部开始 --> -<header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-list?flag=家居产品}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 商品详情 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="###" class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> -</header> -<!-- 头部结束 --> -<form class="am-form am-form-horizontal " action="" id="dataform" - onsubmit="javascripr:return false;"> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default all"> - <div class="goods-img"> - <img id="shopImg"> - </div> - - <div class="am-list-news-bd"> - - <ul class="am-list"> - <li class="am-g am-list-item-dated"><a href="##" - class="am-list-item-hd "> 商品名称</a> <strong - class="am-list-date color-black" id="name"></strong></li> - <li class="am-g am-list-item-dated"><a href="##" - class="am-list-item-hd "> 商品销量</a> <strong - class="am-list-date color-r" id="sealCount"></strong></li> - <li class="am-g am-list-item-dated"><a href="##" - class="am-list-item-hd "> 商品价格</a> <strong - class="am-list-date color-r" id="price"></strong></li> - <!-- <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 绑定数量</a> - <strong class="am-list-date color-black" id="total"></strong> - </li> --> - <li class="am-g am-list-item-dated"><a href="##" - class="am-list-item-hd "> 商品介绍</a> <span - class="am-list-date" - id="introduction"></span></li> - <li class="am-g "> - - <div class=" am-u-sm-12 guige "> - <!-- 数量选择 --> - <div - class="am-input-group am-form-group am-input-group-primary "> - <span class="am-input-group-label num">项目数量</span> <a - onclick="num(1)" class="am-input-group-label"> <i - class="am-header-icon am-icon-minus"></i> - </a> <input autocomplete="off" type="tel" id="num" class="am-form-field " - readonly="readonly" value="1" name="count"/> <a - onclick="num(2)" class=" am-input-group-label"> <i - class="am-header-icon am-icon-plus"></i> - </a> - </div> - </div> - - </li> - - <li class="am-g "> - <div class="am-u-sm-4 guige"> - <span class="am-list-item-hd color-gray"> 详细描述</span> - </div> - </li> - <li class="am-g "> - - <div class=" am-u-sm-12 guige "> - <p id="description" class="color-gray"></p> - </div> - - </li> - - - </ul> - </div> - - - <!-- 测试 --> - <!-- 增加隐藏域 --> - <input type="hidden" name="goodsId" id="goodsId"> - <input type="hidden" name="assembleId" id="assembleId"> - <input type="hidden" name="type" value="家居产品" id="type"> - </div> - <div class="inputBtn am-g"> - <div class="am-u-sm-4" id="isPresent" style="display: none"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="mysubmit('是')">赠送 - </button> - - </div> - - <div class="am-u-sm-4 "> - <button class="am-btn btn-m1 am-btn-block" type="button" - onclick="mysubmit('否')">加入购物车 - </button> - </div> - - </div> -</form> -<!-- 客户到访表单结束 --> - - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - //数量 - function num(obj) { - if (obj == 1) { - if ($("#num").val() > 1) { - $("#num").val($("#num").val() - 1); - } - - } - if (obj == 2) { - if ($("#num").val() >= 0) { - $("#num").val(parseInt($("#num").val()) + 1); - } - } - } - - // 弹出页面层 - - function showBox() { - var myForm = MForm.initForm({ - invokeUrl: basePath + "/admin/shoppingCar/addItemToCar", - isvalid: false - - }); - } - - $(function () { - var ding_order_id = $.query.get('ding_order_id'); - $.AjaxProxy({ - p: { - id: ding_order_id - }, - a: true, - c: true, - }) - .invoke( - basePath + "/admin/shoppinggoods/findShoppingGoods", - function (loj) { - - $("#name").html(loj.getString(0, "name")); - $("#sealCount").html( - loj.getString(0, "sealCount")); - $("#introduction").html( - loj.getString(0, "introduction")); - $("#price").html( - '¥' + loj.getString(0, "sealPice")); - $("#goodsId").val(loj.getString(0, "id")); - $("#shopImg").attr("src", - loj.getString(0, "img")); - $("#description").html( - loj.getString(0, "description")); - var isPresent = loj.getString(0, "isPresent"); - if (isPresent == '是') { - $("#isPresent").show(); - } - - }); - }) - - function changePrice() { - - } - - function mysubmit(isFree) { - var myForm = MForm - .initForm({ - invokeUrl: basePath + "/admin/shoppingCar/addItemToCar", - isvalid: false, - extendParam: { - isFree: isFree - }, - beforeSubmit: function () { - - }, - afterSubmit: function (loj) { - var msg = ''; - if (loj.attr("result").status == '200') { - msg = '操作成功'; - layer - .open({ - shade: false, - content: msg, - className: 'showBox', - time: 1, - end: function (elem) { - MTools - .redirect(basePath + "/admin/redirect/hive/mobile/order-list?flag=家居产品"); - } - }); - } - } - }); - myForm.submit(); - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg2.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg2.html deleted file mode 100644 index 8ebc6de..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg2.html +++ /dev/null @@ -1,264 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingOrderMsg3.css}"> - -</head> -<body> - <!-- 项目详情页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-list?flag=项目}" class=""> - - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 项目详情 - </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="###" class=""> - - <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - <form class="am-form am-form-horizontal" action="" id="dataform" onsubmit="javascripr:return false;"> - <div data-am-widget="list_news" class="am-list-news am-list-news-default all" > - <div class="goods-img"><img id="shopImg" ></div> - <div class="am-list-news-bd"> - <ul class="am-list"> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 项目名称</a> - - <strong class="am-list-date color-black"id="projName"></strong> - - - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 项目价格</a> - - <strong class="am-list-date color-r"id="projPrice"></strong> - - - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 销量</a> - - <strong class="am-list-date color-r"id="sealCount"></strong> - - - </li> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 项目编号</a> - - <span class="am-list-date" id="projNo"></span> - - - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 项目服务时长</a> - - <span class="am-list-date color-y" id="timeLength"></span> - - </li> - <li class="am-g "> - - <div class=" am-u-sm-12 guige "> - <!-- 数量选择 --> - <div - class="am-input-group am-form-group am-input-group-primary "> - <span class="am-input-group-label num">项目数量</span> <a - onclick="num(1)" class="am-input-group-label"> <i - class="am-header-icon am-icon-minus"></i> - </a> <input autocomplete="off" type="tel" id="num" class="am-form-field " - readonly="readonly" value="1" name="count" /> <a - onclick="num(2)" class=" am-input-group-label"> <i - class="am-header-icon am-icon-plus"></i> - </a> - </div> - </div> - </li> - - <!-- 详细描述 --> - <li class="am-g "> - <div class="am-u-sm-4 guige"> - <span class="am-list-item-hd color-gray"> 详细描述</span> - </div> - </li> - <li class="am-g "> - - <div class=" am-u-sm-12 guige " > - <p id="description" class="color-gray"></p> - </div> - - </li> - <!-- 详细描述结束 --> - </ul> - </div> - - - - - - - - <!-- 测试 --> - <!-- 增加隐藏域 --> - <input autocomplete="off" type="hidden" name="goodsId" id="goodsId"> - <input autocomplete="off" type="hidden" name="type" value="项目" id="type"> - </div> - <div class="inputBtn am-g"> - <div class="am-u-sm-4" id="isPresent" style="display:none"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="mysubmit('是')">赠送</button> - - </div> - - <div class="am-u-sm-4 "> - <button class="am-btn btn-m1 am-btn-block" - type="button" onclick="mysubmit('否')">加入购物车</button> - </div> - - </div> - </form> - - <!-- 客户到访表单结束 --> - - - - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> -//数量 - function num(obj){ - if(obj==1){ - if($("#num").val()>1){ - $("#num").val($("#num").val()-1); - } - - } - if(obj==2){ - if($("#num").val()>=0){ - $("#num").val(parseInt($("#num").val())+1); - } - } - } - - // 弹出页面层 - - function showBox() { - layer.open({ - type: 0, - content: '操作成功', - style: 'position:fixed; left:10%; top:25%; width:80%; height:30%; border-radius:5%;' - }); -} - - //項目详情页面 - $(function(){ - var ding_order_id=$.query.get('ding_order_id'); - $.AjaxProxy({ - p : { - id:ding_order_id - }, - a : true, - c : true, - }).invoke( basePath+"/admin/shoppinggoods/findShoppingGoods", function(loj){ - - // 获取组合中包含的项目信息 - $("#projName").html(loj.getString(0,"name")==''?' ':loj.getString(0,"name")); - $("#projPrice").html('¥'+loj.getString(0,"sealPice")); - $("#sealCount").html(loj.getString(0,"sealCount")); - $("#projNo").html(loj.getString(0,"code")); - $("#timeLength").html(loj.getString(0,"timeLength")+" 分钟"); - $("#goodsId").val(loj.getString(0,"id")); - $("#shopImg").attr("src",loj.getString(0, "img")); - $("#description").html(loj.getString(0, "description")); - //商品类型为项目时候,只有一个项目,因此直接去下表为0的项目 - var isPresent=loj.getString(0, "isPresent"); - if(isPresent=='是'){ - $("#isPresent").show(); - } - - }); - }) - //加入购物车和赠送 - function mysubmit(isFree){ - var myForm=MForm.initForm({ - invokeUrl: basePath+"/admin/shoppingCar/addItemToCar", - isvalid:false, - extendParam:{isFree:isFree}, - afterSubmit:function(loj){ - var msg=''; - if(loj.attr("result").status=='200'){ - msg='操作成功'; - layer.open({ - shade:false, - content :msg, - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobile/order-list?flag=项目"); - } - }); - } - else{ - msg='操作失败'; - layer.open({ - shade:false, - content :msg, - className : 'showBox', - time : 2 - }); - } - } - }); - myForm.submit(); - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg3.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg3.html deleted file mode 100644 index 2e12c06..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg3.html +++ /dev/null @@ -1,289 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingOrderMsg3.css}"> - -</head> -<body> -<!-- 套餐详情页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-list?flag=套餐}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 套餐详情 - </a> - </h1> - </header> - <!-- 头部结束 --> - <form class="am-form am-form-horizontal" action="" id="dataform" onsubmit="javascripr:return false;"> - <div class=" main1 all" > - <div data-am-widget="list_news" class="am-list-news am-list-news-default" > - - <div class="goods-img"><img src="" id="shopImg" ></div> - <div class="am-list-news-bd"> - <ul class="am-list"> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 套餐名称</a> - <span class="am-list-date color-black" id="taocanName"></span> - </li> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 套餐价格</a> - <span class="am-list-date color-r" id="sale"></span> - </li> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 销量</a> - <span class="am-list-date color-r" id="sealCount"></span> - </li> - - - <li class="am-g am-list-item-dated"> - <a class="am-list-item-hd "> 有效期限</a> - <span class="am-list-date" id="validity"></span> - </li> - <li class="am-g am-list-item-dated"></li> - </ul> - </div> - - - <!-- 数量选择 --> - <div class="am-input-group am-form-group am-input-group-primary"> - <span class="am-input-group-label num">套餐数量</span> - <a onclick="num(1)" class="am-input-group-label"> - <i class="am-header-icon am-icon-minus"></i> - </a> - <input autocomplete="off" type="tel" id="num"class="am-form-field " readonly="readonly" value="1" name="count"> - <a onclick="num(2)" class=" am-input-group-label"> - <i class="am-header-icon am-icon-plus"></i> - </a> - </div> - <!-- 项目详情 --> - <div class="am-panel am-panel-secondary" id="vipLevel"> - <div class="am-panel-hd"> - <h2 class="am-panel-title" >项目详情</h2> - <span class="down down1" ></span> - </div> - <div class="vipMsg"> - <ul class="am-list am-list-static am-list-border" id="projDetails"> - </ul> - </div> - </div> - <!-- 项目详情结束 --> - <!-- 商品详情开始 --> - <div class="am-panel am-panel-secondary" id="vipLevel2"> - <div class="am-panel-hd"> - <h2 class="am-panel-title" >商品详情</h2> - <span class="down down2" ></span> - </div> - <div class="vipMsg2"> - <ul class="am-list am-list-static am-list-border" id="goodsDetails"> - </ul> - - </div> - </div> - <!-- 商品详情结束 --> - - <ul class="am-list"> - <li class="am-g "> - <div class="am-u-sm-4 guige"> - <span class="am-list-item-hd color-gray"> 详细描述</span> - </div> - <div class=" am-u-sm-7 guige " > - <p id="description" class="color-gray"></p> - </div> - - </li> - </ul> - - - - <!-- 测试 --> - <!-- 增加隐藏域 --> - <input autocomplete="off" type="hidden" name="goodsId" id="goodsId"> - <input autocomplete="off" type="hidden" name="type" value="套餐" id="type"> - <input autocomplete="off" type="hidden" id="hidval" value="0"> - <input autocomplete="off" type="hidden" id="hidval2" value="0"> - </div> - </div> - <div class="inputBtn am-g"> - <div class="am-u-sm-4" id="isPresent" style="display:none"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="mysubmit('是')">赠送</button> - - </div> - - <div class="am-u-sm-4 "> - <button class="am-btn btn-m1 am-btn-block" - type="button" onclick="mysubmit('否')">加入购物车</button> - </div> - -</div> -</form> - <!-- 客户到访表单结束 --> - - - - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - - // 数量增加减少js - function num(obj){ - if(obj==1){ - if($("#num").val()>1){ - $("#num").val($("#num").val()-1); - } - - } - if(obj==2){ - if($("#num").val()>=0){ - $("#num").val(parseInt($("#num").val())+1); - } - } - } - // 商品项目详情js - $(function () { - $("#vipLevel").bind("click", function () { - if ($("#hidval").val() == 1) { - $(".down1").css("transform","rotate(0deg)"); - $(".vipMsg").slideUp(500,function(){ - $("#hidval").val(0); - - }) - } else { - $(".down1").css("transform","rotate(180deg)"); - $(".vipMsg").slideDown(500,function(){ - $("#hidval").val(1); - }) - } - }) - }); - $(function () { - $("#vipLevel2").bind("click", function () { - if ($("#hidval2").val() == 1) { - $(".down2").css("transform","rotate(0deg)"); - $(".vipMsg2").slideUp(500,function(){ - $("#hidval2").val(0); - - }) - } else { - $(".down2").css("transform","rotate(180deg)"); - $(".vipMsg2").slideDown(500,function(){ - $("#hidval2").val(1); - - }) - } - }); - - }); - - - - //套餐详情页面 - $(function(){ - var ding_order_id=$.query.get('ding_order_id'); - $.AjaxProxy({ - p : { - id:ding_order_id - }, - a : true, - c : true, - }).invoke( basePath+"/admin/shoppinggoods/findShoppingGoods", function(loj) { - - //销售套餐的基本信息 - $("#taocanName").html(loj.getString(0,"name")==''?' ':loj.getString(0,"name")); - $("#sale").html('¥'+(loj.getString(0,"sealPice")==''?' ':loj.getString(0,"sealPice"))); - $("#sealCount").html(loj.getString(0,"sealCount")==''?' ':loj.getString(0,"sealCount")); - $("#validity").html(loj.getString(0,"validity")==''?' ':loj.getString(0,"validity")+" 月"); - $("#goodsId").val(loj.getString(0,"id")); - $("#shopImg").attr("src",loj.getString(0, "img")); - $("#description").html(loj.getString(0, "description")); - var isPresent=loj.getString(0, "isPresent"); - if(isPresent=='是'){ - $("#isPresent").show(); - } - - }); - }) - //赠送和加入购物车 - function mysubmit(isFree){ - var myForm=MForm.initForm({ - invokeUrl: basePath+"/admin/shoppingCar/addItemToCar", - isvalid:false, - extendParam:{isFree:isFree}, - afterSubmit:function(loj){ - var msg=''; - if(loj.attr("result").status=='200'){ - msg='操作成功'; - layer - .open({ - shade:false, - content :msg, - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobile/order-list?flag=套餐"); - } - }); - } - else{ - msg='操作失败'; - layer - .open({ - shade:false, - content :msg, - className : 'showBox', - time : 2 - }); - } - } - }); - myForm.submit(); - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg4.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg4.html deleted file mode 100644 index 17b9cb9..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg4.html +++ /dev/null @@ -1,245 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingOrderMsg3.css}"> - -</head> -<body> -<!-- 套餐详情页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-list?flag=充值卡}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 充值卡详情 - </a> - </h1> - </header> - <!-- 头部结束 --> - <form class="am-form am-form-horizontal" action="" id="dataform" onsubmit="javascripr:return false;"> - <div class=" main1 all" > - <div data-am-widget="list_news" class="am-list-news am-list-news-default" > - - <div class="goods-img"><img src="" id="shopImg" ></div> - <div class="am-list-news-bd"> - <ul class="am-list"> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 卡名</a> - <span class="am-list-date color-black" id="taocanName"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 价格</a> - <span class="am-list-date color-r" id="sale"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 赠送金额</a> - <span class="am-list-date " id="referencePice"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 可消费总金额</a> - <span class="am-list-date color-r" id="totalMoney"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 会籍卡</a> - <span class="am-list-date " id="isVipCar"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 使用次数</a> - <span class="am-list-date " id="carUseCount"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 最大发卡次数</a> - <span class="am-list-date " id="carMaxSaleCount"></span> - </li> - <li class="am-g am-list-item-dated"> - <a class="am-list-item-hd "> 有效期限</a> - <span class="am-list-date" id="validity"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 销量</a> - <span class="am-list-date color-r" id="sealCount"></span> - </li> - - <li class="am-g am-list-item-dated"></li> - </ul> - </div> - - - <!-- 数量选择 --> - <div class="am-input-group am-form-group am-input-group-primary"> - <span class="am-input-group-label num">套餐数量</span> - <a onclick="num(1)" class="am-input-group-label"> - <i class="am-header-icon am-icon-minus"></i> - </a> - <input autocomplete="off" type="tel" id="num"class="am-form-field " readonly="readonly" value="1" name="count"> - <a onclick="num(2)" class=" am-input-group-label"> - <i class="am-header-icon am-icon-plus"></i> - </a> - </div> - - <ul class="am-list"> - <li class="am-g "> - <div class="am-u-sm-4 guige"> - <span class="am-list-item-hd color-gray"> 详细描述</span> - </div> - <div class=" am-u-sm-7 guige " > - <p id="description" class="color-gray"></p> - </div> - - </li> - </ul> - <!-- 增加隐藏域 --> - <input autocomplete="off" type="hidden" name="goodsId" id="goodsId"> - <input autocomplete="off" type="hidden" name="type" value="充值卡" id="type"> - </div> - </div> - <div class="inputBtn am-g"> - <div class="am-u-sm-4" id="isPresent" style="display:none"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="mysubmit('是')">赠送</button> - - </div> - - <div class="am-u-sm-4 "> - <button class="am-btn btn-m1 am-btn-block" - type="button" onclick="mysubmit('否')">加入购物车</button> - </div> - -</div> -</form> - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - - // 数量增加减少js - function num(obj){ - if(obj==1){ - if($("#num").val()>1){ - $("#num").val($("#num").val()-1); - } - - } - if(obj==2){ - if($("#num").val()>=0){ - $("#num").val(parseInt($("#num").val())+1); - } - } - } - - - - - //套餐详情页面 - $(function(){ - var ding_order_id=$.query.get('ding_order_id'); - $.AjaxProxy({ - p : { - id:ding_order_id - }, - a : true, - c : true, - }).invoke( basePath+"/admin/shoppinggoods/findShoppingGoods", function(loj) { - - //销售套餐的基本信息 - $("#taocanName").html(loj.getString(0,"name")==''?' ':loj.getString(0,"name")); - $("#sale").html('¥'+(loj.getString(0,"sealPice")==''?' ':loj.getString(0,"sealPice"))); - $("#sealCount").html('¥'+loj.getString(0,"sealCount")==''?' ':loj.getString(0,"sealCount")); - $("#referencePice").html(loj.getString(0,"referencePice")); - $("#validity").html(loj.getString(0,"validity")==''?' ':loj.getString(0,"validity")+" 月"); - $("#goodsId").val(loj.getString(0,"id")); - $("#shopImg").attr("src",loj.getString(0, "img")); - $("#isVipCar").html(loj.getString(0, "isVipCar")); - $("#description").html(loj.getString(0, "description")); - var sealPice =loj.getString(0, "sealPice") == '' ? 0 : loj.getString(0, "sealPice"); - var referencePice = loj.getString(0, "referencePice") == '' ? 0 :loj.getString(0, "referencePice"); - var totalMoney = parseFloat(sealPice) + parseFloat(referencePice); - $("#totalMoney").html('¥'+totalMoney); - $("#carMaxSaleCount").html(loj.getString(0, "carMaxSaleCount")==0?'无限制':loj.getString(0, "carMaxSaleCount")); - $("#carUseCount").html(loj.getString(0, "carUseCount")==0?'无限制':loj.getString(0, "carUseCount")); - var isPresent=loj.getString(0, "isPresent"); - if(isPresent=='是'){ - $("#isPresent").show(); - } - - }); - }) - //赠送和加入购物车 - function mysubmit(isFree){ - var myForm=MForm.initForm({ - invokeUrl: basePath+"/admin/shoppingCar/addItemToCar", - isvalid:false, - extendParam:{isFree:isFree}, - afterSubmit:function(loj){ - var msg=''; - if(loj.attr("result").status=='200'){ - msg='操作成功'; - layer - .open({ - shade:false, - content :msg, - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobile/order-list?flag=充值卡"); - } - }); - } - else{ - msg='操作失败'; - layer - .open({ - shade:false, - content :msg, - className : 'showBox', - time : 2 - }); - } - } - }); - myForm.submit(); - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg5.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg5.html deleted file mode 100644 index 88e91b3..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg5.html +++ /dev/null @@ -1,269 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingOrderMsg3.css}"> - -</head> -<body> -<!-- 套餐详情页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-list?flag=综合卡}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 综合卡详情 - </a> - </h1> - </header> - <!-- 头部结束 --> - <form class="am-form am-form-horizontal" action="" id="dataform" onsubmit="javascripr:return false;"> - <div class=" main1 all" > - <div data-am-widget="list_news" class="am-list-news am-list-news-default" > - - <div class="goods-img"><img src="" id="shopImg" ></div> - <div class="am-list-news-bd"> - <ul class="am-list"> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 卡名</a> - <span class="am-list-date color-black" id="taocanName"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 价格</a> - <span class="am-list-date color-r" id="sale"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 赠送金额</a> - <span class="am-list-date " id="referencePice"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 可消费总金额</a> - <span class="am-list-date color-r" id="totalMoney"></span> - </li> - - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 使用次数</a> - <span class="am-list-date " id="carUseCount"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 最大发卡次数</a> - <span class="am-list-date " id="carMaxSaleCount"></span> - </li> - <li class="am-g am-list-item-dated"> - <a class="am-list-item-hd "> 有效期限</a> - <span class="am-list-date" id="validity"></span> - </li> - <li class="am-g am-list-item-dated"> - <a href="##" class="am-list-item-hd "> 销量</a> - <span class="am-list-date color-r" id="sealCount"></span> - </li> - - <li class="am-g am-list-item-dated"></li> - </ul> - </div> - - - <!-- 数量选择 --> - <div class="am-input-group am-form-group am-input-group-primary"> - <span class="am-input-group-label num">数量</span> - <a onclick="num(1)" class="am-input-group-label"> - <i class="am-header-icon am-icon-minus"></i> - </a> - <input autocomplete="off" type="tel" id="num"class="am-form-field " readonly="readonly" value="1" name="count"> - <a onclick="num(2)" class=" am-input-group-label"> - <i class="am-header-icon am-icon-plus"></i> - </a> - </div> - <!-- 项目详情 --> - <div class="am-panel am-panel-secondary" id="vipLevel"> - <div class="am-panel-hd"> - <h2 class="am-panel-title" >综合卡详情</h2> - <span class="down down1" ></span> - </div> - <div class="vipMsg"> - <ul class="am-list am-list-static am-list-border" id="projDetails"> - </ul> - </div> - </div> - - - <ul class="am-list"> - <li class="am-g "> - <div class="am-u-sm-4 guige"> - <span class="am-list-item-hd color-gray"> 详细描述</span> - </div> - <div class=" am-u-sm-7 guige " > - <p id="description" class="color-gray"></p> - </div> - - </li> - </ul> - <!-- 增加隐藏域 --> - <input autocomplete="off" type="hidden" name="goodsId" id="goodsId"> - <input autocomplete="off" type="hidden" name="type" value="综合卡" id="type"> - </div> - </div> - <div class="inputBtn am-g"> - <div class="am-u-sm-4" id="isPresent" style="display:none"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="mysubmit('是')">赠送</button> - - </div> - - <div class="am-u-sm-4 "> - <button class="am-btn btn-m1 am-btn-block" - type="button" onclick="mysubmit('否')">加入购物车</button> - </div> - -</div> -</form> - <input autocomplete="off" type="hidden" id="hidval" value="0"> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - -$("#vipLevel").bind("click", function () { -console.log($("#hidval").val()); - if ($("#hidval").val() == 1) { - $(".down1").css("transform","rotate(0deg)"); - $(".vipMsg").slideUp(500,function(){ - $("#hidval").val(0); - - }) - } else { - $(".down1").css("transform","rotate(180deg)"); - $(".vipMsg").slideDown(500,function(){ - $("#hidval").val(1); - }) - } -}) - - // 数量增加减少js - function num(obj){ - if(obj==1){ - if($("#num").val()>1){ - $("#num").val($("#num").val()-1); - } - - } - if(obj==2){ - if($("#num").val()>=0){ - $("#num").val(parseInt($("#num").val())+1); - } - } - } - - - - - //套餐详情页面 - $(function(){ - var ding_order_id=$.query.get('ding_order_id'); - $.AjaxProxy({ - p : { - id:ding_order_id - }, - a : true, - c : true, - }).invoke( basePath+"/admin/shoppinggoods/findShoppingGoods", function(loj) { - - //销售套餐的基本信息 - $("#taocanName").html(loj.getString(0,"name")==''?' ':loj.getString(0,"name")); - $("#sale").html('¥'+(loj.getString(0,"sealPice")==''?' ':loj.getString(0,"sealPice"))); - $("#sealCount").html('¥'+loj.getString(0,"sealCount")==''?' ':loj.getString(0,"sealCount")); - $("#referencePice").html(loj.getString(0,"referencePice")); - $("#validity").html(loj.getString(0,"validity")==''?' ':loj.getString(0,"validity")+" 月"); - $("#goodsId").val(loj.getString(0,"id")); - $("#shopImg").attr("src",loj.getString(0, "img")); - $("#description").html(loj.getString(0, "description")); - var sealPice =loj.getString(0, "sealPice") == '' ? 0 : loj.getString(0, "sealPice"); - var referencePice = loj.getString(0, "referencePice") == '' ? 0 :loj.getString(0, "referencePice"); - var totalMoney = parseFloat(sealPice) + parseFloat(referencePice); - $("#totalMoney").html('¥'+totalMoney); - $("#carMaxSaleCount").html(loj.getString(0, "carMaxSaleCount")==0?'无限制':loj.getString(0, "carMaxSaleCount")); - $("#carUseCount").html(loj.getString(0, "carUseCount")==0?'无限制':loj.getString(0, "carUseCount")); - var isPresent=loj.getString(0, "isPresent"); - if(isPresent=='是'){ - $("#isPresent").show(); - } - - }); - }) - //赠送和加入购物车 - function mysubmit(isFree){ - var myForm=MForm.initForm({ - invokeUrl: basePath+"/admin/shoppingCar/addItemToCar", - isvalid:false, - extendParam:{isFree:isFree}, - afterSubmit:function(loj){ - var msg=''; - if(loj.attr("result").status=='200'){ - msg='操作成功'; - layer - .open({ - shade:false, - content :msg, - className : 'showBox', - time : 1, - end: function(elem){ - MTools.redirect( basePath+"/admin/redirect/hive/mobile/order-list?flag=综合卡"); - } - }); - } - else{ - msg='操作失败'; - layer - .open({ - shade:false, - content :msg, - className : 'showBox', - time : 2 - }); - } - } - }); - myForm.submit(); - } -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-search.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-search.html deleted file mode 100644 index cfc9102..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-search.html +++ /dev/null @@ -1,209 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href= "@{/css/dingOrderSearch.css}"> -<style type="text/css"> -#userList { - height: 200px; - overflow: scroll; - overflow-x: hidden; -} -</style> -</head> -<body onkeypress="dosearch(event)"> - <header data-am-widget="header" - class="am-header color-w back-m1 back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - <h1 class="am-header-title"> - <a href="#title-link" class=""> 会员搜索 </a> - </h1> - </header> - <!-- 商品搜索页面 --> - <div class="wrap"> - <div class="am-g"> - <div class="am-u-sm-9 no-right"> - <input autocomplete="off" id="userName" name="acctNo" type="text" - class="am-form-field id-in am-dropdown-up" placeholder="请输入手机号或者姓名" /> - <ul id="userList" class="userList " style="display: none"> - </ul> - - </div> - <div class="am-u-sm-3 no-left"> - <button class="am-btn am-btn-default" type="button" - onclick="searchUser()"> - <span class="am-icon-search"></span> - </button> - </div> - </div> - </div> - - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script> - $(function() { - - $("#userName").bind('input propertychange', function() { - console.log(1); - var $input = $("#userName"); - if ($input.length < 1) { - return false; - } - - if ($input.val().length > 1) { - $ - .AjaxProxy({ - p : { - keyWord : $input.val(), - }, - c : false, - }) - .invoke( - basePath+"/admin/vipInfo/findUserByPhoto", - function(loj) { - var html = ""; - if (loj.getRowCount() > 0) { - for (var i = 0; i < loj - .getRowCount(); i++) { - html += '<li onclick="selectList(\'' - + loj - .getString( - i, - 'phone') - + '\')" >' - + loj - .getString( - i, - 'phone') - + "-" - + loj - .getString( - i, - 'vipName') - + "-" - + loj - .getString( - i, - 'vipNo') - + '</li>'; - } - $("#userList") - .html(html) - .show(); - } else { - $("#userList") - .empty() - .hide(); - } - - }); - } else { - $("#userList").hide(); - } - }); - }) - - function searchUser() { - if ($("#userName").val().length < 1) { - layer.open({ - shade : false, - content : "请输入关键词后再查询", - className : 'showBox', - time : 1, - }); - return false; - } - - $ - .AjaxProxy({ - p : { - keyWord : $("#userName").val(), - }, - c : false, - }) - .invoke( - basePath+"/admin/vipInfo/showVipInfo", - function(loj) { - if (loj.getRowCount() > 0) { - layer - .open({ - shade : false, - content : "查找成功", - className : 'showBox', - time : 1, - end : function(elem) { - MTools - .redirect( basePath+"/admin/redirect/hive/mobile/order?foot=4"); - } - }); - - } else { - layer.open({ - shade : false, - content : "未查询到此会员", - className : 'showBox', - time : 2 - }); - } - }); - } - function dosearch(e) { - if (e.keyCode == 13) { - e.preventDefault(); - window.event.returnValue = false; - searchUser(); - return false; - } - } - - function selectList(phone) { - $("#userList").hide(); - $("#userName").val(phone); - searchUser(); - } - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-service.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-service.html deleted file mode 100644 index 56c22fc..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-service.html +++ /dev/null @@ -1,289 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="description" content=""> - <meta name="keywords" content=""> - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <title th:text="${session.userInfo.shopName }"></title> - - - - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" href= basePath+"/css/dingOrderService.css"> - -</head> -<body> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class=""> - - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> - 服务列表 - </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a class=""> - - <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - <div data-am-widget="tabs" - class="am-tabs am-tabs-d2" - > - <ul class="am-tabs-nav am-cf"> - <li class="am-active"><a href="[data-tab-panel-0]">完成服务单</a></li> - <li class=""><a href="[data-tab-panel-1]">未完成服务单</a></li> - - </ul> - <div class="am-tabs-bd"> - <div data-tab-panel-0 class="am-tab-panel am-active"> - <div class="main main1"> - <form class="am-form am-form-horizontal" action=""> - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-1"> - <span> </span> - </div> - <div class="am-u-sm-7 search"> - <input autocomplete="off" type="search" class="searchIn" /> - </div> - <div class="am-u-sm-3 btn"> - <button class="am-btn am-btn-default am-radius searchBtn" >搜索</button> - </div> - <div class="am-u-sm-1"> - <span> </span> - </div> - - </div> - - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">编号</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">总价</h2> - - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">时间 </h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">购买人 </h2> - </div> - - </div> - - <div class="am-list-news-bd"> - <ul class="am-list"> - <li - class="am-g "> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">110</h3> - </div> - - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2000</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2014-02-02</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">周杰伦</h3> - </div> - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">110</h3> - </div> - - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2000</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2014-02-02</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">小外</h3> - </div> - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">110</h3> - </div> - - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2000</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2014-02-02</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">小外</h3> - </div> - </li> - </ul> - </div> - - </div> - - - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - </div> - <div data-tab-panel-1 class="am-tab-panel "> - <div class="main main1"> - <form class="am-form am-form-horizontal" action=""> - - <div - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-1"> - <span> </span> - </div> - <div class="am-u-sm-7 search"> - <input autocomplete="off" type="search" class="searchIn" /> - </div> - <div class="am-u-sm-3 btn"> - <button class="am-btn am-btn-default am-radius searchBtn" >搜索</button> - </div> - <div class="am-u-sm-1"> - <span> </span> - </div> - - </div> - - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">编号</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">总价</h2> - - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">时间 </h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">购买人 </h2> - </div> - - </div> - - <div class="am-list-news-bd"> - <ul class="am-list"> - <li - class="am-g "> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">110</h3> - </div> - - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2000</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2014-02-02</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">陈奕迅</h3> - </div> - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">110</h3> - </div> - - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2000</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2014-02-02</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">小外</h3> - </div> - </li> - <li - class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">110</h3> - </div> - - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2000</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">2014-02-02</h3> - </div> - <div class="am-u-sm-3 "> - <h3 class="am-list-item-hd">小外</h3> - </div> - </li> - </ul> - </div> - - </div> - - - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - </div> - - </div> - </div> - - - - - - - - </div> - - - - - -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - - - - -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-completed.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-completed.html deleted file mode 100644 index d1053e2..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-completed.html +++ /dev/null @@ -1,234 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> - -</head> -<script> - -</script> - - -<body > - <!-- 已完成列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 服务单 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1"> - <form class="am-form am-form-horizontal" id="dataform" onsubmit="javascripr:return false;"> - <div id="serach" style="display: none" - class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div id="orderSelect" class="am-u-sm-4"> - <select name="state" id="state" > - <option value=''>服务单状态</option> - <option value="待预约">待预约</option> - <option value="预约成功待处理">预约成功待处理</option> - <option value="预约失败">预约失败</option> - <option value="预约取消">预约取消</option> - <option value="需配料">需配料</option> - <option value="配料完成">配料完成</option> - <option value="服务中">服务中</option> - <option value="服务完成">服务完成</option> - <option value="服务单结束">服务单结束</option> - </select> - </div> - <div class="am-u-sm-5 search"> - <input autocomplete="off" type="text" class="searchIn" name="vipName" placeholder="用户姓名"/> - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" value="10" /> - </div> - <div class="am-u-sm-3 btn"> - <button type="button" class="am-btn am-btn-default am-radius searchBtn" onclick="Pagination.serchDate()">搜索</button> - </div> - </div> - - <!-- 商品表格 --> - <div data-am-widget="list_news" id="context" style="display: none;" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <div class="am-u-sm-4 "> - <h2 class="am-list-news-more am-fr">编号</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">客户姓名</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">状态</h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作</h2> - </div> - </div> - <div class="am-list-news-bd"> - <ul class="am-list" id="showdataBox"> - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"> - </div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - <script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - /** - 加载数据 - **/ - $(function(){ - Pagination.init({ - url: basePath+"/admin/projService/getStaffServiceOrder", - builderDate:function(loj){ - var html=""; - //构建数据 - if(loj.getRowCount()>0){ - $("#serach").show(); - $("#context").show(); - - - - for(var i=0 ; i<loj.getRowCount(); i++ ){ - var option=''; - var id=loj.getString(i,"id"); - if(loj.getString(i,"state")=='配料完成'){ - option='<a class="am-list-item-hd" onclick="startService('+id+')" >开始服务</a>'; - }else if(loj.getString(i,"state")=='服务中'){ - option='<a class="am-list-item-hd" onclick="endService('+id+')" >结束服务</a>'; - } - - html+=' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left"> <div class="am-u-sm-4 "> <h3 class="am-list-item-hd">' - +loj.getString(i,"serviceNo")+ - '</h3> </div> <div class="am-u-sm-3 "><h3 class="am-list-item-hd">' - +loj.getString(i,"vipInfo.vipName")+ - '</h3> </div> <div class="am-u-sm-3 "> <h3 class="am-list-item-hd">' - +loj.getString(i,"state")+ - '</h3> </div><div class="am-u-sm-2 ">' - +'<a class="am-list-item-hd" href="'+basePath+'/admin/projService/serviceInfo?id='+loj.getString(i,"id")+'&page=mobile" >详情</a> | ' +option+ '</div></li>' - } - //显示数据 - //$("#showdataBox").html(html); - return html; - }else{ - $("#pagingBox").hide(); - - } - } - }).serchDate(); - }) - - function endService(id) { - - var url = basePath + "/admin/projService/endService?id=" + id; - $ - .AjaxProxy() - .invoke( - url, - function (loj) { - console.log(loj); - if (loj.status = '200') { - layer - .open({ - content: "服务结束~", - className: 'shouBox', - time: 2, - end: function (elem) { - Pagination.serchDate(); - } - }); - - } - }) - } - - function startService(id) { - var url = basePath + "/admin/projService/startService?id=" + id; - $ - .AjaxProxy() - .invoke( - url, - function (loj) { - console.log(loj); - if (loj.status = '200') { - layer - .open({ - content: "服务开始~", - className: 'shouBox', - time: 2, - end: function (elem) { - Pagination.serchDate(); - } - }); - } - }) - } - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-end-service.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-end-service.html deleted file mode 100644 index 8804a15..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-end-service.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - href= basePath+"/css/dingOrderUseNew.css"> -<link rel="stylesheet" type="text/css" - th:href="@{/plugin/LCalendar/src/css/LCalendar.css"> - -</head> -<script> - -</script> -<body> - <!-- 待预约详情页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-use-inservice" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">服务单</a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - - </div> --> - </header> - <!-- 头部结束 --> - - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="main main2"> - <input autocomplete="off" type="hidden" id="serviceId" name="id" - value="${projServices.id }" /> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务编号</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.serviceNo }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">客户姓名</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.vipName }"></span> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">下单顾问</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.createStaffName }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">创建时间</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" - th:text="${#dates.format(projServices.createTime,'yyyy-MM-dd HH:mm')}" - > </span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">配料师</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.plsName }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">美疗师</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:each="item:${projServices.beauticianStates }"> - <span th:if="${projServices.beauticianId eq item.beautiStaffInfo.suId}" th:text="'【主:'+${item.beautiStaffInfo.suName }+'】'" ></span> - <span th:if="${projServices.beauticianId ne item.beautiStaffInfo.suId}" th:text="'【'+${item.beautiStaffInfo.suName }+'】'"></span> - <br> - </span> - </div> - </div> - - - <c:if test=""> - <div th:if="${not empty projServices.projUses}" th:each="item:${projServices.projUses }"> - <hr> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">项目名称</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.name }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">剩余次数</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.surplusCount }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务时长</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.projInfo.timeLength }"></span> - </div> - </div> - - </div> - - <hr> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约时间</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${#dates.format(projServices.yyTime,'yyyy-MM-dd HH:mm')}" > - </span> - </div> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务开始时间</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${#dates.format(projServices.startTime,'yyyy-MM-dd HH:mm')}"> - </span> - </div> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务预计时长</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${projServices.totalTime }"> - 分钟 </span> - </div> - </div> - </div> - - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约床位</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${projServices.bedName }"> - </span> - </div> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">备注</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.remark }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">皮肤状况</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.skinCond }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">其他信息</span> - </div> - - </div> - <div class="Validform_checktip"></div> - - - <div th:if=" " class="inputBtn"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="toResult()">结束服务</button> - </div> - - </div> - </form> - - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/LCalendar/src/js/LCalendar.js}"></script> - <!-- index js --> - <script type="text/javascript"> - function toResult() { - var id = $("#serviceId").val(); - var url = basePath+"/admin/projService/endService?id=" + id; - $ - .AjaxProxy() - .invoke( - url, - function(loj) { - console.log(loj); - if (loj.status = '200') { - layer - .open({ - content : "服务结束~", - className : 'shouBox', - time : 2, - end : function(elem) { - MTools - .redirect( basePath+"/admin/redirect/hive/mobile/order-use-inservice"); - } - }); - - } - }) - } - </script> - -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-look-endService.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-look-endService.html deleted file mode 100644 index 003014f..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-look-endService.html +++ /dev/null @@ -1,320 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/plugin/LCalendar/src/css/LCalendar.css}"> - -</head> -<script> - -</script> -<body> -<!-- 待预约详情页面 --> -<!-- 头部开始 --> -<!-- 头部开始 --> -<header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a onclick="javascript:history.back(-1)" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">服务单</a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - - </div> --> -</header> -<!-- 头部结束 --> -<div th:if="${obj== null}"> - <p id="empty-car">查询失败</p> -</div> -<div class="main3"> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <!-- <div class="main main1"> --> - <input autocomplete="off" type="hidden" id="serviceId" name="id" - th:value="${obj.id }"/> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务编号</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.serviceNo }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">客户姓名</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.vipInfo.vipName }"></span> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">下单顾问</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.createStaffName }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">创建时间</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" - th:text="${#dates.format(obj.createTime,'yyyy-MM-dd HH:mm')}" - > </span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">配料师</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.plsName }"></span> - </div> - </div> - - <div th:each="item:${obj.serviceItems }"> - <hr> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">项目名称</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.projInfo.name }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">美疗师</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.beautiStaffInfo?.suName }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">剩余次数</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.projUse.surplusCount }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务时长</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.projInfo.timeLength }"></span> - </div> - </div> - - </div> - - <hr> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约时间</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${#dates.format(obj.yyTime,'yyyy-MM-dd HH:mm')}" > - </span> - </div> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务开始时间</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${#dates.format(obj.startTime,'yyyy-MM-dd HH:mm')}"> - </span> - </div> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务预计时长</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${obj?.totalTime }"> - 分钟 </span> - </div> - </div> - </div> - - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约床位</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${obj?.bedName }"> - </span> - </div> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">备注</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.remark }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">皮肤状况</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${obj?.skinCond }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">其他信息</span> - </div> - - </div> - - <div th:if="${obj.state eq '配料完成'}" class="inputBtn"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="startService()">开始服务 - </button> - </div> - <div th:if="${obj.state eq '服务中' }" class="inputBtn"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="endService()">结束服务 - </button> - </div> - </form> -</div> - -<script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<script th:src="@{/plugin/LCalendar/src/js/LCalendar.js}"></script> -<!-- index js --> -<script type="text/javascript"> - function endService() { - var id = $("#serviceId").val(); - var url = basePath + "/admin/projService/endService?id=" + id; - $ - .AjaxProxy() - .invoke( - url, - function (loj) { - console.log(loj); - if (loj.status = '200') { - layer - .open({ - content: "服务结束~", - className: 'shouBox', - time: 2, - end: function (elem) { - history.back(-1); - } - }); - - } - }) - } - - function startService() { - var id = $("#serviceId").val(); - var url = basePath + "/admin/projService/startService?id=" + id; - $ - .AjaxProxy() - .invoke( - url, - function (loj) { - console.log(loj); - if (loj.status = '200') { - layer - .open({ - content: "服务开始~", - className: 'shouBox', - time: 2, - end: function (elem) { - history.back(-1); - } - }); - - } - }) - } -</script> - -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-new.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-new.html deleted file mode 100644 index 0ce22aa..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-new.html +++ /dev/null @@ -1,320 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderUseNew.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/plugin/LCalendar/src/css/LCalendar.css}"> - <style> - .am-form .input-num[type=number] { - padding: 0; - text-align: center; - border: 1px solid #eee - } - </style> -</head> -<script th:if="${session.CURRENT_CUSTOMER eq null}"> - - MTools.redirect(basePath + "/admin/redirect/hive/mobile/order-search"); - -</script> - -<body> -<!-- 购物车页面 --> -<!-- 头部开始 --> -<header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a onclick="javascript:history.back(-1)" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 新建服务 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="###" class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> -</header> -<!-- 头部结束 --> - -<!-- 购物车表单开始 --> -<form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <input type="hidden" th:value="${session.CURRENT_CUSTOMER?.id }" name="vipId" /> - <div class="main main1"> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <h3 style="text-align: center;" id="tite">可消耗的项目</h3> - <div class="am-list-news-bd"> - <ul class="am-list" id="ul_order_use"> - - </ul> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g" id="ps"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">备注</span> - </div> - <div class="am-u-sm-8"> - <div> - <textarea rows="3" name="remark"></textarea> - </div> - </div> - </div> - <div id="submitBtn"> - - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约时间</span> - </div> - <div class="am-u-sm-8"> - <!-- <div> - <input id="demo1" style="display: none" type="text" readonly="" - placeholder="日期选择特效" /> - </div> --> - <div> - <input id="time" name="yyTime" type="text" readonly="" - placeholder="请选择时间" dataType="*" nullmsg="请选择时间" data-lcalendar="2016-05-11,2016-05-11"/> - </div> - </div> - </div> - <input type="hidden" id="projIds" name="projIds"/> - - <div class="Validform_checktip"></div> - <div class="inputBtn"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="myForm.submit()">新建服务 - </button> - </div> - - </div> - </div> - -</form> - -<!-- 购物车表单结束 --> -<script type="text/javascript"> - - /* $("#time").attr("data-lcalendar",date2+","+date3); */ - -</script> - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<script th:src="@{/plugin/LCalendar/src/js/LCalendar.js}"></script> -<!-- index js --> -<script type="text/javascript"> - /* $('.datetimepicker').datetimepicker({ - format : "yyyy-mm-dd hh:ii", - autoclose: true, - }); */ - - - $(function () { - /* 计算当前时间 */ - - - MTools.autoFullSelect(); - - $ - .AjaxProxy() - .invoke( - basePath + "/admin/projService/getUserProjInfo", - function (loj) { - var html = ""; - var taoCanList = loj.attr("result")["mapInfo"].taoCanList; - - var projList=loj.attr("result")["mapInfo"].projList; - - if (projList.length > 0 || taoCanList.length > 0) { - - var flag = -1; //用来设置不同name的值 - //循环取出套餐的信息 - - for (var i = 0; i < taoCanList.length; i++) { - var taocanInfo = taoCanList[i]; - html += '<li class="lic am-g " >' - + '<div class=" am-u-sm-9 am-list-main"><h3 class="am-list-item-hd">' - + taocanInfo.projName - + '</h3></div><div class=" am-list-main"><h3 class="am-list-item-hd color-r"> <strong>余次' - + taocanInfo.surplusCount - + '</strong></h3></li>'; - - //循环取出一个套餐中包含的项目 - for (var j = 0; j < taocanInfo.taocanProjUse.length; j++) { - flag += 1; - var projUse = taocanInfo.taocanProjUse[j]; - - html += '<li class="lic am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left " >' - + '<div class=" am-u-sm-1 am-list-thumb ">' - + '<label class=" am-checkbox ">' - + '<input id="box' + flag + '" type="checkbox" name="projBox" class="check" value=' - + projUse.id - + '></label></div>' - + '<div class=" am-u-sm-5 am-list-main"><h3 class="am-list-item-hd">' - + projUse.projName - + '</h3></div><div class=" am-u-sm-2 am-list-main"><h3 class="am-list-item-hd color-y">' - + projUse.projInfo.timeLength - + ' 分钟</h3></div><div class="am-u-sm-2 am-list-thumb color-num"> <span>' - + projUse.surplusCount - + '</span></div>' - + '<div class="am-u-sm-2 am-list-thumb color-num">' - + '<input class="input-num" id="inputbox' + flag + '" placeholder="次数" value="1" type="number" max="8" min="1"/>' - + '</div>' - + '</li>'; - } - html += '<div class="taocan"></div>' - + '</div>'; - } - - if (projList.length > 0) { - //循环取出项目列表 - for (var i = 0; i < projList.length; i++) { - var projUse=projList[i]; - flag += 1; - html += ' <li class=" lic am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left " >' - + '<div class=" am-u-sm-1 am-list-thumb "><label class=" am-checkbox ">' - + '<input id="box' + flag + '" type="checkbox" name="projBox" class="check " value=' - + projUse.id - + '></label></div>' - + '<div class=" am-u-sm-5 am-list-main"><h3 class="am-list-item-hd">' - + projUse.projName - + '</h3></div><div class="am-u-sm-2 am-list-thumb color-num"> <span>余' - + projUse.surplusCount - + '次</span></div>' - + '<div class="am-u-sm-2 am-list-thumb color-num">' - + '<input class="input-num" type="number" id="inputbox' + flag + '" value="1" max="8" min="1"/>' - + '</div></li><div class="taocan"></div>'; - } - } - - - } else { - $("#ps").remove(); - $("#tite").remove(); - html = '<p style="text-align:center">没有可消耗的项目!</p>' - + '<p style="text-align:center"><a href="' + basePath + '/admin/redirect/hive/mobile/order-list"> 马上去选购! </a></p>' - $("#submitBtn").hide(); - } - //显示数据 - $("#ul_order_use").html(html); - //初始化表单 - myForm = MForm - .initForm({ - invokeUrl: basePath + "/admin/projService/addServiceForForm", - - beforeSubmit: function () { - - var projIds = ""; - - var param = this.extendParam; - - $('input:checkbox[name=projBox]:checked').each(function (i) { - var num = $("#input" + $(this).attr("id")).val(); - var puseId = $(this).val(); - param["serviceItems[" + i + "].puseId"] = puseId; - param["serviceItems[" + i + "].count"] = num; - projIds += puseId; - }); - - if (projIds == "") { - layer.alert("请选择要消耗的项目!"); - return false; - } - return true; - }, - afterSubmit: function (loj) { - var msg = ''; - if (loj.attr("result").status == '200') { - msg = '消耗成功'; - layer - .open({ - shade: false, - content: msg, - className: 'showBox', - time: 1, - end: function ( - elem) { - history.back(-1); - } - }); - } - } - }); - $(".check").uCheck('enable'); - - - }); - - }) -</script> - -<script type="text/javascript"> - - $(function () { - var d = new Date(); - if (d.getMonth() + 1 < 10) { - var mon = "0" + d.getMonth(); - } - if (d.getDate() < 10) { - var da = "0" + d.getDate(); - } - - var date1 = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate(); - var date2 = d.getFullYear() + "-" + (d.getMonth() + 2) + "-" + d.getDate(); - - - var calendardatetime = new LCalendar(); - calendardatetime.init({ - 'trigger': '#time', - 'type': 'datetime', - 'minDate': date1, //最小日期 - 'maxDate': date2 //最大日期 - }); - }); - - -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-start-service.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-start-service.html deleted file mode 100644 index 249976b..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-start-service.html +++ /dev/null @@ -1,298 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderUseNew.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/plugin/LCalendar/src/css/LCalendar.css}"> -<style> - .inputBtn{ - margin-bottom:10px; - } -</style> -</head> -<script> - -</script> -<body> - <!-- 待预约详情页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-use-waitservice}" class=""> - <i class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">开始服务</a> - </h1> - - <!-- <div class="am-header-right am-header-nav"></div> --> - </header> - <!-- 头部结束 --> - - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="main main2"> - <input autocomplete="off" type="hidden" id="serviceId" name="id" - value="${projServices.id }" /> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务编号</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.serviceNo }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">客户姓名</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.vipName }"></span> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">下单顾问</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.createStaffName }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">创建时间</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" - th:text="${#dates.format(projServices.createTime,'yyyy-MM-dd HH:mm')}" - > </span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">配料师</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.plsName }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">美疗师</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:each="item:${projServices.beauticianStates }"> - <span th:if="${projServices.beauticianId eq item.beautiStaffInfo.suId}" th:text="'【主:'+${item.beautiStaffInfo.suName }+'】' >"></span> - <span th:if="${projServices.beauticianId ne item.beautiStaffInfo.suId}" th:text="'【'+${item.beautiStaffInfo.suName }+'】' >"></span> - <br> - </span> - </div> - </div> - - - <c:if test=""> - <div th:if="${not empty projServices.projUses}" th:each="item:${projServices.projUses }"> - <hr> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">项目名称</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.name }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">剩余次数</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.surplusCount }"></span> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务时长</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${item.projInfo.timeLength }"></span> - </div> - </div> - - </div> - - <hr> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约时间</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${#dates.format(projServices.yyTime,'yyyy-MM-dd HH:mm')}" > - </span> - </div> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务开始时间</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${#dates.format(projServices.startTime,'yyyy-MM-dd HH:mm')}"> - </span> - </div> - </div> - </div> - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">服务预计时长</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${projServices.totalTime }"> - 分钟 </span> - </div> - </div> - </div> - - - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约床位</span> - </div> - <div class="am-u-sm-8"> - <div> - <span class="am-input-group-label" th:text="${projServices.bedName }"> - </span> - </div> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">备注</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.remark }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">皮肤状况</span> - </div> - <div class="am-u-sm-8"> - <span class="am-input-group-label" th:text="${projServices.skinCond }"></span> - </div> - </div> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">其他信息</span> - </div> - - </div> - - <div class="inputBtn"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="toResult()">开始服务</button> - - </div> - </form> - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/LCalendar/src/js/LCalendar.js}"></script> - <!-- index js --> - <script type="text/javascript"> - function toResult() { - var id = $("#serviceId").val(); - var url = basePath+"/admin/projService/startService?id=" + id; - $ - .AjaxProxy() - .invoke( - url, - function(loj) { - console.log(loj); - if (loj.status = '200') { - layer - .open({ - content : "服务开始~", - className : 'shouBox', - time : 2, - end : function(elem) { - MTools - .redirect( basePath+"/admin/redirect/hive/mobile/order-use-waitservice"); - } - }); - - } - }) - } - </script> - -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-time.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-time.html deleted file mode 100644 index b4e9595..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-time.html +++ /dev/null @@ -1,260 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingPersonalCar.css}" > - - - - -<link rel="stylesheet" type="text/css" - th:href="@{/plugin/LCalendar/src/css/LCalendar.css}"> -</head> -<body> - <!-- 购物车页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" class="am-header color-w back-m1"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/order-use?foot=3}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 新建消耗 </a> - </h1> - - <!-- <div class="am-header-right am-header-nav"> - <a href="###" class=""> <i class="am-header-icon am-icon-bars"></i> - </a> - </div> --> - </header> - <!-- 头部结束 --> - - <!-- 购物车表单开始 --> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="main main1"> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <div class="am-list-news-bd"> - <ul class="am-list" id="ul_order_use"> - - </ul> - </div> - </div> - <div id="submitBtn"> - <div class="am-input-group am-form-group am-input-group-primary am-g"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">预约时间</span> - </div> - <!-- - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" readonly="readonly" - name="yyTime" class="am-form-field datetimepicker" /> - --> - </div> - <div class="am-u-sm-8"> - <div> - <input autocomplete="off" id="demo2" type="text" readonly="" placeholder="日期和时间选择特效" value="2016-05-11 17:44" data-lcalendar="2016-05-11,2016-05-11" /> - </div> - </div> - </div> - <div class="inputBtn"> - <button class="am-btn btn-m1 am-radius am-btn-block" - type="button" onclick="myForm.submit()">消耗</button> - </div> - </div> - </div> - </form> - <div> - <input autocomplete="off" id="demo1" type="text" readonly="" placeholder="日期选择特效" data-lcalendar="2016-05-11,2016-05-11" /> - </div> - - <div> - <input autocomplete="off" id="demo3" type="text" readonly="" placeholder="时间选择特效" /> - </div> - <div> - <input autocomplete="off" id="demo4" type="text" readonly="" placeholder="年月选择特效" /> - </div> - - <!-- 购物车表单结束 --> - - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - $('.datetimepicker').datetimepicker({ - format : "yyyy-mm-dd hh:ii", - autoclose: true, - }); - - //查询消耗列表 isOver=1表示完成,isOver=2未完成 - $(function() { - $ - .AjaxProxy({ - p : { - isOver : 2 - } - }) - .invoke( - basePath+"/admin/projService/findAllUnUseService", - function(loj) { - var html = ""; - var ids = ""; - if(loj.getRowCount()>0){ - - for (var i = 0; i < loj.getRowCount(); i++) { - html += ' <li class=" lic am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-right " >' - + '<div class=" am-u-sm-2 am-list-thumb ">' - + '<label class=" am-checkbox ">' - + '<input autocomplete="off" type="checkbox" name="projUses['+i+'].id" class="check " value=' - + loj.getString(i, "id") - + '>' - + '</label>' - + '</div>' - + '<div class=" am-u-sm-7 am-list-main">' - + '<h3 class="am-list-item-hd">'; - if (loj.getString(i, "projInfo")) { - html += loj.getString(i, "projInfo").projName - } else { - html += loj.getString(i, "taocanInfo").name - } - html += '</h3>' - - + ' </div>' - + '<div class="am-u-sm-3 am-list-thumb">' - + ' <span>余' - + loj.getString(i, "surplusCount") - + '次</span>' + '</div>' + ' </li>'; - - } - }else{ - html="没有可消耗的项目!" - $("#submitBtn").hide(); - } - //显示数据 - $("#ul_order_use").html(html); - - //初始化表单 - myForm = MForm - .initForm({ - invokeUrl : basePath+"/admin/projService/addService", - afterSubmit : function(loj) { - var msg = ''; - if (loj.attr("result").status == '200') { - msg = '消耗成功'; - layer - .open({ - shade : false, - content : msg, - className : 'showBox', - time : 1, - end : function( - elem) { - MTools - .redirect( basePath+"/admin/redirect/hive/mobile/order-use"); - } - }); - } - } - }); - - }); - }); - - $(function() { - $(".check").uCheck('enable'); - }) - </script> -</body> - <script - th:src="@{/plugin/LCalendar/src/js/LCalendar.js}"></script> - <script> - var calendar = new LCalendar(); - calendar.init({ - 'trigger': '#demo1', //标签id - 'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择, - 'minDate': '1900-1-1', //最小日期 - 'maxDate': new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate() //最大日期 - }); - var calendardatetime = new LCalendar(); - calendardatetime.init({ - 'trigger': '#demo2', - 'type': 'datetime' - }); - var calendartime = new LCalendar(); - calendartime.init({ - 'trigger': '#demo3', - 'type': 'time' - }); - var calendarym = new LCalendar(); - calendarym.init({ - 'trigger': '#demo4', - 'type': 'ym', - 'minDate': '1900-1', - 'maxDate': new Date().getFullYear() + '-' + (new Date().getMonth() + 1) - }); - </script> - - -</html> - diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order.html deleted file mode 100644 index 4a95988..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/order.html +++ /dev/null @@ -1,255 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<meta http-equiv="Cache-Control" content="no-transform" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> -<head> -<script> - if (window.top !== window.self) { - window.top.location = window.location - }; -</script> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - - -<!-- Tile icon for Win8 (144x144 + tile color) --> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrder.css}"> - -</head> -<body> - <!-- 订单管理页面 --> - <!-- 判断会员是否存在 --> - - <div class="wrap"> - <!-- 图片栏开始 --> - <div data-am-widget="slider" class="am-slider am-slider-c2" - data-am-slider='{"directionNav":false}'> - <ul class="am-slides"> - <li><img th:src="@{/images/dingImg/banner-img6.jpg}"> - <div class="am-slider-desc" th:text="${session.userInfo.shopName }"></div></li> - </ul> - </div> - <!-- 图片结束 --> - <!-- 会员信息开始 --> - - - <div class="am-panel am-panel-secondary"> - <div class="am-panel-hd"> - <!-- 用来记录等级信息是否显示 --> - <input autocomplete="off" type="hidden" vlaue="1" id="hidval"> - <h2 class="am-panel-title" id="vipLevel" th:if="${session.CURRENT_CUSTOMER ne null }" > - <span th:text="${session.CURRENT_CUSTOMER?.vipName }" ></span> - <a th:href="@{/admin/redirect/hive/mobile/order-search}"> |<small>切换会员</small></a> - </h2> - <h2 class="am-panel-title" id="vipLevel" th:if="${session.CURRENT_CUSTOMER eq null }"> - <a th:href="@{/admin/redirect/hive/mobile/order-search}"> |<small>切换会员</small></a> - </h2> - <span class="down" alt="等级详情"></span> - </div> - <div class="vipMsg"> - <ul class="am-list am-list-static am-list-border"> - <li th:text="'会员手机: '+${session.CURRENT_CUSTOMER?.phone }"></li> - <li th:text="'会员积分:'+${session.CURRENT_CUSTOMER?.pointAll }"></li> - </ul> - </div> - </div> - - <!--会员信息结束 --> - <!-- 表格部分开始 --> - <ul class="am-avg-sm-4 boxes " id="boxs"> - - <li class="box box-1"><a - th:href="@{/admin/redirect/hive/mobile/order-list}"> <img - th:src="@{/images/dingImg/xjdd.png}"></img><br> - <small class="boxs">新建订单</small> - </a></li> - - - <li class="box box-2"><a - th:href="@{/admin/redirect/hive/mobile/order-car}"> <img - th:src="@{/images/dingImg/gwc.png}"></img><br> - <small class="boxs">购物车</small> - </a></li> - - - - <li class="box box-3"><a - th:href="@{/admin/redirect/hive/mobile/order-history}"> <img - th:src="@{/images/dingImg/wcdd.png}"></img><br> <small - class="boxs">订单</small> - </a></li> - - <li class="box box-1"><a - th:href="@{/admin/redirect/hive/mobile/order-use-new}"> <img - th:src="@{/images/dingImg/cjff.png}"></img><br> <small - class="boxs">创建服务</small> - </a></li> - - <li class="box box-4"><a - th:href="@{/admin/redirect/hive/mobile/order-use-completed}"> <img - th:src="@{/images/dingImg/xmfw.png}"></img><br> - <small class="boxs">项目服务</small> - </a></li> - - - </ul> - <!-- 表格结束 --> - <!-- 表格结束 --> - - <!-- foot开始 --> - <div class="footr" th:fragment="footr"> - <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default " - id=""> - <ul class="am-navbar-nav am-cf am-avg-sm-4"> - <li > - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}"class="change1" > - <img th:src="@{/images/dingImg/grzx2.png}" alt="个人中心"/> - <span class="am-navbar-label ">个人中心</span> - </a> - </li> - - <li > - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class="change3"> - <img th:src="@{/images/dingImg/crm1.png}" alt="订单管理"/> - <span class="am-navbar-label">CRM</span> - </a> - </li> - <li > - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class="change4"> - <img th:src="@{/images/dingImg/ddgl1.png}" alt="商机管理"/> - <span class="am-navbar-label">订单管理</span> - </a> - </li> - - </ul> - </div> - </div> - - <!-- foot结束 --> - - </div> - - - - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - $(function() { - $("#vipLevel").bind("click", function() { - - if ($("#hidval").val() == 1) { - $(".vipMsg").find('li').css('border','0'); - $(".down").css("transform", "rotate(0deg)"); - $(".vipMsg").slideUp(500, function() { - $("#hidval").val(0); - - - }) - } else { - $(".down").css("transform", "rotate(180deg)"); - $(".vipMsg").slideDown(500, function() { - $("#hidval").val(1); - $(".vipMsg").find('li').css('border-bootom','1px solid #eee'); - - }) - } - - }) - }); - $(function(){ - var count=$("#boxs").find("li").length; - var index=count%4; - if(index==1){ - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - } - if(index==2){ - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - } - if(index==3){ - $("#boxs").append(" <li class='box'>"+"</li>"); - } - }) - - - $(function(){ - var id=$.query.get('foot'); - - - - - $(".change"+id).children("span").css('color','#dfbd88'); - switch(id){ - case 1: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/grzx.png'); - - break; - - case 2: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/customer3.png'); - - break; - case 3: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/crm.png'); - - break; - - case 4: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/ddgl.png'); - - break; - default: - $(".change1").children("span").css('color','#dfbd88'); - $(".change1").children("img").attr('src',basePath+'/images/dingImg/grzx.png'); - - } - - - - }); - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-msg.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-msg.html deleted file mode 100644 index c5971e3..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-msg.html +++ /dev/null @@ -1,288 +0,0 @@ - - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> -<style> - #img1_img { - width: 100px; - height: 100px; - } -</style> -</head> -<body> - - <!-- 个人资料修改页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 个人资料 </a> - </h1> - - </header> - <!-- 头部结束 --> - - <!-- 会员注册表单开始 --> - <div class="main main2"> - <form class="am-form am-form-horizontal" method="post" id="dataform" - onsubmit="javascripr:return false;"> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">头像</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" th:value="${obj.suPhoto}" name="suPhoto" id="img1" - class="form-control upload-input" type="text" /> <a - class="btn btn-primary radius upload-a"> - </a> - </div> - </div> - - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">姓名</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="*1-20" class="am-form-field" - name="suName" th:value="${obj.suName}"> - </div> - </div> - - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">英文名</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="*1-20" class="am-form-field" - th:value="${obj.enName }" name="enName" ignore="ignore"> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">编号</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="*1-30" class="am-form-field" - readonly="readonly" th:value="${obj.suJobNo}" /> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">身份证号码</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="*1-30" class="am-form-field" - name="suIdcard" th:value="${obj.suIdcard}"> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">联系电话</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="m" class="am-form-field" - ignore="ignore" name="suTel" th:value="${obj.suTel}"> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">紧急联系电话</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="m" class="am-form-field" - ignore="ignore" name="emergTel" th:value="${obj.emergTel}"> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">住址</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="*1-200" class="am-form-field" - ignore="ignore" name="suAddress" th:value="${obj.suAddress}"> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">微信号</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" dataType="*1-40" class="am-form-field" - ignore="ignore" name="wxNo" th:value="${obj.wxNo}"> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">生日</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="date" class="am-form-field" name="suBirthday" - dataType="*" th:value="${obj.suBirthday}"> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">所属门店</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field" readonly="readonly" - dataType="*" th:value="${obj.shopName}"> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">所属岗位</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field" readonly="readonly" dataType="*" - th:value="${obj.roleName}"> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">上级领导</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field" readonly="readonly" - th:value="${obj.parDirectName}"> - </div> - </div> - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">工作经历</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="text" class="am-form-field" name="workExp" - ignore="ignore" dataType="*1-200" th:value="${obj.workExp}"> - </div> - </div> - <div - class="am-form-group am-input-group am-input-group-primary am-g "> - <div class="am-u-sm-4"> - <span class="am-input-group-label ">服务签名</span> - </div> - <div class="am-u-sm-8"> - <textarea name="serviceSignature" class="border" clos="100" - rows="3" warp="virtual" dataType="*1-300" ignore="ignore" th:text="${obj?.serviceSignature }" ></textarea> - </div> - </div> - - <div class="inputBtn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" - class="am-btn btn-m1 am-radius am-btn-block" value="保存"></input> - </div> - </form> - </div> - <!-- 会员到访表单结束 --> - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/js/systools/AjaxProxyVue.js}"></script> - <!-- index js --> - <script type="text/javascript"> - MTools.initImgUpload(".upload-input"); - var myForm; - $(function() { - myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/updateStaffInfo", - afterSubmit : function(loj) { - if (loj.status = '200') { - layer.open({ - shade : false, - content : '修改成功', - className : 'showBox', - time : 2 - }); - } - } - }); - - - }); - - - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-resetPassWord.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-resetPassWord.html deleted file mode 100644 index 4970371..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-resetPassWord.html +++ /dev/null @@ -1,156 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> - -</head> -<body> - <!-- 个人资料修改页面 --> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 重置密码 </a> - </h1> - - </header> - <!-- 头部结束 --> - - <div class="main main2"> - - <form class="am-form am-form-horizontal" method="post" id="dataform" - onsubmit="javascripr:return false;"> - - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">原始密码</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="password" class="am-form-field " dataType="*" - name="oldPassword" placeholder="原始密码" nullmsg="请填写原始密码"> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">新密码</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="password" class="am-form-field " dataType="*" - name="newPassword" placeholder="新密码" nullmsg="请填写新密码" - errormsg="长度为6至16"> - </div> - </div> - - <div - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-4"> - <span class="am-input-group-label">确认密码</span> - </div> - <div class="am-u-sm-8"> - <input autocomplete="off" type="password" class="am-form-field " dataType="*" - name="reNewPassword" recheck="newPassword" placeholder="重复新密码" - nullmsg="请重复新密码" errormsg="请填写相同密码"> - </div> - </div> - - <div class="inputBtn"> - <input autocomplete="off" type="button" onclick="myForm.submit()" - class="am-btn btn-m1 am-radius am-btn-block" value="保存"></input> - </div> - - </form> - </div> - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - - - var myForm = MForm - .initForm({ - invokeUrl : basePath+"/admin/updatePassword", - afterSubmit : function(loj) { - if (loj.status = '200') { - layer - .open({ - shade : false, - content : '密码修改成功', - className : 'showBox', - time : 2, - end : function(elem) { - MTools - .redirect( basePath+"/admin/redirect/hive/mobile/personal?foot=1"); - } - }); - } - } - }); - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-shop-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-shop-list.html deleted file mode 100644 index c0bcf1e..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-shop-list.html +++ /dev/null @@ -1,279 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> -<style type="text/css"> -.m_ul{ - list-style: none; -} - -.m_ul li span{ -margin-left: 2em; -} -</style> -</head> - - - -<body> - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/personal?foot=1" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">门店列表 </a> - </h1> - - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1" id="main" style="display: none;"> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - - <!-- <div class="am-u-sm-4 margin-b1"> - <select name=absentDay id="order-select" class=" border" > - <option value=''>未到店日期</option> - <option value="3">3天</option> - <option value="7">7天</option> - <option value="14">14天</option> - </select> - </div> - <div class="am-u-sm-4 margin-b1"> - <select name="birthdays" class=" border" > - <option value=''>生日</option> - <option value="1">今天</option> - <option value="3">3天内</option> - <option value="30">一个月</option> - </select> - </div> - <div class="am-u-sm-4 margin-b1"> - <select name="followDays" class=" border" > - <option value=''>跟进</option> - <option value="1">今天</option> - <option value="3">3天内</option> - <option value="30">一个月</option> - </select> - </div> - <label class="col-sm-2 control-label">会员活跃度</label> - <div class="am-u-sm-4 margin-b1" > - <select name="appointDays" class=" border" > - <option value=''>预约</option> - <option value="1">今天</option> - <option value="3">3天内</option> - <option value="30">一个月</option> - </select> - </div> --> - - <div class="am-u-sm-8 "> - <input autocomplete="off" type="text" class="searchIn" name="shopName" placeholder="门店名称" /> - <!-- <label class="col-sm-2 control-label">会员等级</label> --> - - - </div> - <div class="am-u-sm-4 "> - <button type="button" - class="am-btn am-btn-default am-radius searchBtn" - onclick="Pagination.serchDate()">搜索</button> - </div> - - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" id="limit" value="10" /> - </div> - <!-- <ul class="m_ul"> - <li>生日:<span class="am-badge am-badge-secondary am-radius" kind="1" day="0" > 今天 </span> - <span class="am-badge am-badge-secondary am-radius" kind="1" day="3" > 3天内 </span> - <span class="am-badge am-badge-secondary am-radius" kind="1" day="30" > 一月内 </span></li> - - <li>跟进:<span class="am-badge am-badge-secondary am-radius" kind="2" day="0" > 今天 </span> - <span class="am-badge am-badge-secondary am-radius" kind="2" day="3" > 3天内 </span> - <span class="am-badge am-badge-secondary am-radius" kind="2" day="30" > 一月内 </span></li> - <li>预约:<span class="am-badge am-badge-secondary am-radius" kind="3" day="0" > 今天 </span> - <span class="am-badge am-badge-secondary am-radius" kind="3" day="3" > 3天内 </span> - <span class="am-badge am-badge-secondary am-radius" kind="3" day="30" > 一月内 </span></li> - </ul> --> - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-9 "> - <h2 class="am-list-news-more am-fr">门店名称</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">操作</h2> - </div> - </div> - <div class="am-list-news-bd"> - <ul class="am-list am-list-striped" id="showdataBox"> - - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"></div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - /** - 加载数据 - **/ - $(function() { - var pageSize=$("#limit").val(); - Pagination - .init( - { - url : basePath+"/admin/achieveTargetShop/showList", - pageSize : pageSize, - builderDate : function(loj) { - if (loj.getRowCount() > 0) { - $("#main").show(); - var html = ""; - //构建数据 - for (var i = 0; i < loj.getRowCount(); i++) { - - html += ' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + loj.getString(i,"shopName") + '</h3> </div> ' - +'<div class="am-u-sm-3 "><a class="am-list-item-hd" th:href="@{/admin/achieveTargetShop/dayAchieve?id='+ loj.getString(i, "id")+ '&lookInfo=0">查看业绩</a></div></li>'; - } - return html; - } else { - $("#pagingBox").hide(); - - - } - } - }).serchDate(); - - - //筛选点击事件 - - - - $(".m_ul li span").click(function(){ - - var normal="am-badge am-badge-secondary am-radius"; - var selected="am-badge am-badge-warning am-radius"; - var myAttr= $(this).attr("class"); - if(myAttr==selected){ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",normal); - Pagination.serchDate(); - }else{ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",selected); - onserch($(this).attr("kind"),$(this).attr("day")) - } - - }); - - //下拉框 - MTools.autoFullSelect(); - // - //style="display:none" - $(".option1").css("display","none"); - $(".option2").css("display","none"); - - } - ); - function option(){ - $(".option").removeAttr("selected"); - $('.time').attr('selected', true); - if($("#select").val() != null && $("#select").val() != ""){ - if($("#select").val() != "absentDay"){ - $(".option1").css("display","none"); - $(".option2").css("display","block"); - }else{ - $(".option2").css("display","none"); - $(".option1").css("display","block"); - } - }else{ - $(".option1").css("display","none"); - $(".option2").css("display","none"); - } - } - - /*条件筛选加载 - function onserch(kind,day){ - - $.AjaxProxy({p:{"kind":kind,"day":day}}).invoke( basePath+"/admin/customer/showCustomerByDay",function(loj){ - - if (loj.getRowCount() > 0) { - var html = ""; - //构建数据 - for (var i = 0; i < loj.getRowCount(); i++) { - html += ' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">'+ loj.getString(i,"vipName") + '</h3> </div>' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + loj.getString(i, "phone") + '</h3> </div> ' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + loj.getString(i, "vipLevel").levelName + '</h3> </div> ' - +'<div class="am-u-sm-3 "><a class="am-list-item-hd" href="tel:'+phone+'">拨号</a><a class="am-list-item-hd" th:href="@{/admin/customer/toVipInfoList?id='+ loj.getString(i, "id")+ '">详情</a></div></li>'; - } - $("#showdataBox").html(html); - $("#pagingBox").html(""); - } else { - $("#showdataBox").html("<hr><div class='am-u-sm-6 am-u-sm-centered '>没有查询到相关数据~</div>"); - $("#pagingBox").html(""); - - }})}; - - */ - - - - - - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-staff-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-staff-list.html deleted file mode 100644 index 86314bc..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-staff-list.html +++ /dev/null @@ -1,302 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> -<style type="text/css"> -.m_ul{ - list-style: none; -} - -.m_ul li span{ -margin-left: 2em; -} -</style> -</head> - - - -<body> - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/personal?foot=1" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">员工列表 </a> - </h1> - - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1" id="main" style="display: none;"> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-6 margin-b1"> - <select class="form-control autoFull" - th:data-url="@{/admin/achieveTargetShop/findShopByRole}" - data-value="id" - data-filed="shopName" - name="shopId" - id="shopId"> - <option value="">--门店选择--</option> - </select> - </div> - - <!-- <label class="col-sm-2 control-label">会员活跃度</label> --> - <div class="am-u-sm-6 margin-b1" > - <select class="form-control" name="staffPost"> - <option value=''>--员工岗位--</option> - <option value='1'>健康顾问</option> - <option value='2'>美疗师</option> - </select> - </div> - - <!-- <div class="am-u-sm-4 margin-b1"> - <select name=absentDay id="order-select" class=" border" > - <option value=''>未到店日期</option> - <option value="3">3天</option> - <option value="7">7天</option> - <option value="14">14天</option> - </select> - </div> - <div class="am-u-sm-4 margin-b1"> - <select name="birthdays" class=" border" > - <option value=''>生日</option> - <option value="1">今天</option> - <option value="3">3天内</option> - <option value="30">一个月</option> - </select> - </div> - <div class="am-u-sm-4 margin-b1"> - <select name="followDays" class=" border" > - <option value=''>跟进</option> - <option value="1">今天</option> - <option value="3">3天内</option> - <option value="30">一个月</option> - </select> - </div> - <label class="col-sm-2 control-label">会员活跃度</label> - <div class="am-u-sm-4 margin-b1" > - <select name="appointDays" class=" border" > - <option value=''>预约</option> - <option value="1">今天</option> - <option value="3">3天内</option> - <option value="30">一个月</option> - </select> - </div> --> - - <div class="am-u-sm-8 "> - <input autocomplete="off" type="text" class="searchIn" name="staffName" placeholder="员工姓名" /> - <!-- <label class="col-sm-2 control-label">会员等级</label> --> - - - </div> - <div class="am-u-sm-4 "> - <button type="button" - class="am-btn am-btn-default am-radius searchBtn" - onclick="Pagination.serchDate()">搜索</button> - </div> - - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" id="limit" value="10" /> - </div> - <!-- <ul class="m_ul"> - <li>生日:<span class="am-badge am-badge-secondary am-radius" kind="1" day="0" > 今天 </span> - <span class="am-badge am-badge-secondary am-radius" kind="1" day="3" > 3天内 </span> - <span class="am-badge am-badge-secondary am-radius" kind="1" day="30" > 一月内 </span></li> - - <li>跟进:<span class="am-badge am-badge-secondary am-radius" kind="2" day="0" > 今天 </span> - <span class="am-badge am-badge-secondary am-radius" kind="2" day="3" > 3天内 </span> - <span class="am-badge am-badge-secondary am-radius" kind="2" day="30" > 一月内 </span></li> - <li>预约:<span class="am-badge am-badge-secondary am-radius" kind="3" day="0" > 今天 </span> - <span class="am-badge am-badge-secondary am-radius" kind="3" day="3" > 3天内 </span> - <span class="am-badge am-badge-secondary am-radius" kind="3" day="30" > 一月内 </span></li> - </ul> --> - - <!-- 商品表格 --> - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-4 "> - <h2 class="am-list-news-more am-fr">员工姓名</h2> - </div> - <div class="am-u-sm-4 "> - <h2 class="am-list-news-more am-fr">所属门店</h2> - </div> - <div class="am-u-sm-4 "> - <h2 class="am-list-news-more am-fr">操作</h2> - </div> - </div> - <div class="am-list-news-bd"> - <ul class="am-list am-list-striped" id="showdataBox"> - - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"></div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - /** - 加载数据 - **/ - $(function() { - var pageSize=$("#limit").val(); - Pagination - .init( - { - url : basePath+"/admin/achieveTarget/showAllMlsAndJkgw", - pageSize : pageSize, - builderDate : function(loj) { - if (loj.getRowCount() > 0) { - $("#main").show(); - var html = ""; - //构建数据 - for (var i = 0; i < loj.getRowCount(); i++) { - - html += ' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">'+ loj.getString(i,"staffName") + '</h3> </div>' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + loj.getString(i,"shopName") + '</h3> </div> ' - +'<div class="am-u-sm-3 "><a class="am-list-item-hd" th:href="@{/admin/achieveTarget/dayAchieve?id='+ loj.getString(i, "id")+ '&lookInfo=0">查看业绩</a></div></li>'; - } - return html; - } else { - $("#pagingBox").hide(); - - - } - } - }).serchDate(); - - - //筛选点击事件 - - - - $(".m_ul li span").click(function(){ - - var normal="am-badge am-badge-secondary am-radius"; - var selected="am-badge am-badge-warning am-radius"; - var myAttr= $(this).attr("class"); - if(myAttr==selected){ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",normal); - Pagination.serchDate(); - }else{ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",selected); - onserch($(this).attr("kind"),$(this).attr("day")) - } - - }); - - //下拉框 - MTools.autoFullSelect(); - // - //style="display:none" - $(".option1").css("display","none"); - $(".option2").css("display","none"); - - } - ); - function option(){ - $(".option").removeAttr("selected"); - $('.time').attr('selected', true); - if($("#select").val() != null && $("#select").val() != ""){ - if($("#select").val() != "absentDay"){ - $(".option1").css("display","none"); - $(".option2").css("display","block"); - }else{ - $(".option2").css("display","none"); - $(".option1").css("display","block"); - } - }else{ - $(".option1").css("display","none"); - $(".option2").css("display","none"); - } - } - - /*条件筛选加载 - function onserch(kind,day){ - - $.AjaxProxy({p:{"kind":kind,"day":day}}).invoke( basePath+"/admin/customer/showCustomerByDay",function(loj){ - - if (loj.getRowCount() > 0) { - var html = ""; - //构建数据 - for (var i = 0; i < loj.getRowCount(); i++) { - html += ' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">'+ loj.getString(i,"vipName") + '</h3> </div>' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + loj.getString(i, "phone") + '</h3> </div> ' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + loj.getString(i, "vipLevel").levelName + '</h3> </div> ' - +'<div class="am-u-sm-3 "><a class="am-list-item-hd" href="tel:'+phone+'">拨号</a><a class="am-list-item-hd" th:href="@{/admin/customer/toVipInfoList?id='+ loj.getString(i, "id")+ '">详情</a></div></li>'; - } - $("#showdataBox").html(html); - $("#pagingBox").html(""); - } else { - $("#showdataBox").html("<hr><div class='am-u-sm-6 am-u-sm-centered '>没有查询到相关数据~</div>"); - $("#pagingBox").html(""); - - }})}; - - */ - - - - - - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-data.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-data.html deleted file mode 100644 index 17140db..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-data.html +++ /dev/null @@ -1,114 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> - -</head> -<body> - <!-- 个人资料修改页面 --> - <!-- 头部开始 --> - <input autocomplete="off" type="hidden" id="typeId" th:value="${param.id}"> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a href="javascript:history.back(-1)" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">HIVE学院</a> - </h1> - - </header> - <!-- 头部结束 --> - - <div class="" > - <ul class="am-list" id="accordion"> - - - - </ul> - </div> - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - <script type="text/javascript"> - //文章加载 - $(function(){ - $.AjaxProxy({p:{typeId:$("#typeId").val()},a:false}).invoke( basePath+"/admin/trainingArticle/queryTrainingMaterials",function(loj) { - var html=""; - for (var i = 0; i < loj.getRowCount(); i++) { - html=html+" <li class='am-g'>" - +"<a href='"+basePath+"/admin/trainingArticle/queryOne?id="+loj.getString(i, "id")+"\' class='am-list-item-hd ' style='padding-left: 10px;color: black;'>" - +loj.getString(i, "title") - +"</a>" - +"<span class='am-list-date am-icon-angle-right go-right'></span> </li>" - } - $("#accordion").empty().html(html); - if(html==""){ - - } - }) - - }) - - </script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-info.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-info.html deleted file mode 100644 index 15fcbf5..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-info.html +++ /dev/null @@ -1,98 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<!-- Add to homescreen for Chrome on Android --> -<meta name="mobile-web-app-capable" content="yes"> - - -<!-- Add to homescreen for Safari on iOS --> -<meta name="apple-mobile-web-app-capable" content="yes"> -<meta name="apple-mobile-web-app-status-bar-style" content="black"> -<meta name="apple-mobile-web-app-title" content="Amaze UI" /> - -<meta name="msapplication-TileColor" content="#0e90d2"> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> -<style type="text/css"> -img { - max-width:100% !important; -} -.writer{ - padding:10px; -} -</style> -</head> -<body> - <!-- 个人资料修改页面 --> - <!-- 头部开始 --> - - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a href="javascript:history.back(-1)" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="" th:text="${article.title}"> </a> - </h1> - - </header> - <!-- 头部结束 --> - - <div class="writer" th:utext="${article.content}" > - - - </div> - - <script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> - <script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <!-- index js --> - -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials1.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials1.html deleted file mode 100644 index 0842fdd..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials1.html +++ /dev/null @@ -1,104 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> - - -</head> -<body> -<!-- 个人资料修改页面 --> -<!-- 头部开始 --> -<header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a href="javascript:history.back(-1)" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">HIVE学院 </a> - </h1> - -</header> -<!-- 头部结束 --> -<div class=""> - <ul class="am-list" id="accordion"> - - - <li class="am-g" th:each="item:${articlelist}"> - <a th:href="@{/admin/trainingArticle/queryM?id=}+${item.id}" id="a1" class="am-list-item-hd" th:text=" ${item.articleTypeName}" - style="padding-left: 10px;color: black;"> - - </a> - </li> - - - </ul> -</div> - -<script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - $(function () { - if ('${empty articleList}' == 'true') { - - } - }) -</script> - -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials2.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials2.html deleted file mode 100644 index f5a576e..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials2.html +++ /dev/null @@ -1,104 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" - th:href="@{/css/dingUserVip.css}"> - - -</head> -<body> -<!-- 个人资料修改页面 --> -<!-- 头部开始 --> -<header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a href="javascript:history.back(-1)" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">HIVE学院 </a> - </h1> - -</header> -<!-- 头部结束 --> -<div class=""> - <ul class="am-list" id="accordion"> - - - - <li class="am-g" th:each="item:${articleList}"> - <a th:href="@{/admin/redirect/hive/mobile/personal-trainingMaterials-data?id=}+${item.id}" id="a1" class="am-list-item-hd" th:text=" ${item.articleTypeName}" - style="padding-left: 10px;color: black;"> - </a> - </li> - - - </ul> -</div> - -<script type="text/x-handlebars-template" id="amz-tpl"> - {{>header header}} - - {{>menu menu}} - - {{>slider slider}} - - {{>list_news list1}} - - {{>gallery gallery}} - - {{>list_news list2}} - - {{>footer footer}} - - {{>navbar navbar}} -</script> -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> - $(function () { - if ('${empty articleList}' == 'true') { - - } - }) -</script> - -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal.html deleted file mode 100644 index b077c2d..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal.html +++ /dev/null @@ -1,229 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> - <meta http-equiv="Cache-Control" content="no-transform" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - - <!-- No Baidu Siteapp--> - <meta http-equiv="Cache-Control" content="no-siteapp"/> - - - - <!-- Add to homescreen for Chrome on Android --> - <meta name="mobile-web-app-capable" content="yes"> - - - <!-- Add to homescreen for Safari on iOS --> - <meta name="apple-mobile-web-app-capable" content="yes"> - <meta name="apple-mobile-web-app-status-bar-style" content="black"> - <meta name="apple-mobile-web-app-title" content="Amaze UI"/> - - - <!-- Tile icon for Win8 (144x144 + tile color) --> - - <meta name="msapplication-TileColor" content="#0e90d2"> - <script type="text/javascript"th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript"th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingOrder.css}"> - -</head> -<body> - <!-- 个人中心页面 --> - <div class="wrap"> - - <!-- 图片栏开始 --> - <div data-am-widget="slider" class="am-slider am-slider-c2" data-am-slider='{"directionNav":false}' > - <ul class="am-slides"> - <li> - <img th:src="@{/images/dingImg/banner-img4.jpg}"> - <div class="am-slider-desc" th:text="${session.userInfo.shopName }"></div> - </li> - </ul> - </div> - <!-- 图片结束 --> - <!-- 表格部分开始 --> - <ul class="am-avg-sm-4 boxes" id="boxs"> - - <li class="box box-4"> - <a th:href="@{/admin/goStaffEditForm}" > - <img th:src="@{/images/dingImg/grzl.png}" ></img><br> - <small class="boxs">个人资料</small> - </a> - </li> - <li class="box box-4"> - <a th:href="@{/admin/trainingArticle/queryMaterials}" > - <img th:src="@{/images/dingImg/mdxy.png}" ></img><br> - <small class="boxs">HIVE学院</small> - </a> - </li> - <li class="box box-4"> - <a th:href="@{/admin/occupancy/editMlsForm}" > - <img th:src="@{/images/dingImg/mdxy.png}" ></img><br> - <small class="boxs">占用情况</small> - </a> - </li> - - <li class="box box-4"> - <a th:href="@{/admin/redirect/hive/mobile/store-check}" > - <img th:src="@{/images/dingImg/mdxy.png}" /><br> - <small class="boxs">库存盘点</small> - </a> - </li> - - <li class="box box-5"> - <a th:href="@{/admin/redirect/hive/mobile/personal-resetPassWord}" > - <img th:src="@{/images/dingImg/xgmm.png}" ></img><br> - <small class="boxs">修改密码</small> - </a> - </li> - <li class="box box-6"> - <a id="doc-confirm-toggle"> - <img th:src="@{/images/dingImg/aqtc.png}" ></img><br> - <small class="boxs">退出</small> - </a> - </li> - - </ul> - <!-- 表格结束 --> - - <div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm"> - <div class="am-modal-dialog"> - <div class="am-modal-hd">提示</div> - <div class="am-modal-bd"> - 确定返回登录页面么? - </div> - <div class="am-modal-footer"> - <span class="am-modal-btn" data-am-modal-cancel>取消</span> - <span class="am-modal-btn" data-am-modal-confirm>确定</span> - </div> - </div> - </div> - <!-- foot开始 --> - <div class="footr" th:fragment="footr"> - <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default " - id=""> - <ul class="am-navbar-nav am-cf am-avg-sm-4"> - <li > - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}"class="change1" > - <img th:src="@{/images/dingImg/grzx2.png}" alt="个人中心"/> - <span class="am-navbar-label ">个人中心</span> - </a> - </li> - - <li > - <a th:href="@{/admin/redirect/hive/mobile/CRM?foot=3}" class="change3"> - <img th:src="@{/images/dingImg/crm1.png}" alt="订单管理"/> - <span class="am-navbar-label">CRM</span> - </a> - </li> - <li > - <a th:href="@{/admin/redirect/hive/mobile/order?foot=4}" class="change4"> - <img th:src="@{/images/dingImg/ddgl1.png}" alt="商机管理"/> - <span class="am-navbar-label">订单管理</span> - </a> - </li> - - </ul> - </div> - </div> - - - <!-- foot结束 --> - </div> - - -<script th:src="@{/plugin/amazingUI/js/handlebars.min.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<!-- index js --> -<script type="text/javascript"> -$(function() { - $('#doc-confirm-toggle').on('click', function() { - $('#my-confirm').modal({ - relatedTarget: this, - onConfirm: function(options) { - MTools.redirect(basePath + "/common/hiveMobileLoginOut"); - - }, - // closeOnConfirm: false, - onCancel: function() { - - } - }); - }); - }); -$(function(){ - var count=$("#boxs").find("li").length; - var index=count%4; - if(index==1){ - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - } - if(index==2){ - $("#boxs").append(" <li class='box'>"+"</li>"); - $("#boxs").append(" <li class='box'>"+"</li>"); - } - if(index==3){ - $("#boxs").append(" <li class='box'>"+"</li>"); - } -}) - - - - -$(function(){ - var id=$.query.get('foot'); - - - - - $(".change"+id).children("span").css('color','#dfbd88'); - switch(id){ - case 1: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/grzx.png'); - - break; - - case 2: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/customer3.png'); - - break; - case 3: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/crm.png'); - - break; - - case 4: - - $(".change"+id).children("img").attr('src',basePath+'/images/dingImg/ddgl.png'); - - break; - default: - $(".change1").children("span").css('color','#dfbd88'); - $(".change1").children("img").attr('src',basePath+'/images/dingImg/grzx.png'); - - } - - - -}); - - - -</script> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check-detail.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check-detail.html deleted file mode 100644 index d56899e..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check-detail.html +++ /dev/null @@ -1,248 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> -<style type="text/css"> -.m_ul{ - list-style: none; -} - -.m_ul li span{ -margin-left: 2em; -} -</style> -</head> - - - -<body> - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/store-check}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 库存盘点 </a> - </h1> - - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1" id="main" style="display: none;"> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-4 "> - <input autocomplete="off" type="text" class="searchIn" name="goods.name" placeholder="产品名称" /> - </div> - <div class="am-u-sm-4 "> - <button type="button" - class="am-btn am-btn-default am-radius searchBtn" - onclick="Pagination.serchDate()">搜索</button> - </div> - - <div class="am-u-sm-4 "> - <button type="button" - class="am-btn am-btn-default am-radius searchBtn" - onclick="submitDetail()">保存</button> - </div> - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" id="limit" value="10" /> - <input autocomplete="off" type="hidden" name="checkId" id="checkId" th:value="${obj.id }" /> - </div> - - - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">存货编号</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">存货名称</h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">库存数量</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">实盘数</h2> - </div> -<!-- <div class="am-u-sm-2 ">--> -<!-- <h2 class="am-list-news-more am-fr">操作</h2>--> -<!-- </div>--> - </div> - <div class="am-list-news-bd"> - <ul class="am-list am-list-striped" id="showdataBox"> - - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"></div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - var temp; - var a=[[${obj.makingManId}]]; - var b=[[${session.userInfo.suId}]]; - if (a == b) { - temp = true; - } else { - temp = false; - } - - var myForm = MForm.initForm({ - invokeUrl : basePath+"/admin/checkDetail/editCheckDetail", - afterSubmit : function() { - Pagination.serchDate(); - }, - }); - - function submitDetail() { - myForm.submit(); - } - /** - 加载数据 - **/ - $(function() { - var pageSize=$("#limit").val(); - Pagination - .init( - { - url : basePath+"/admin/checkDetail/showList", - pageSize : pageSize, - builderDate : function(loj) { - if (loj.getRowCount() > 0) { - $("#main").show(); - var html = ""; - //构建数据 - for (var i = 0; i < loj.getRowCount(); i++) { - var result = loj[0].result.rows[i]; - - // if (temp) { - // html = '<input autocomplete="off" type="hidden" name="checkDetails['+index+'].id" width="50px" value="'+id+'"/> ' - // + '<input autocomplete="off" type="number" maxlength="8" style="width: 60px" name="checkDetails['+index+'].actuallySum" width="50px" value="'+actuallySum+'" /> '; - // return html; - // } else { - // return actuallySum; - // } - var id = result.id; - var actuallySum = result.actuallySum; - - html += ' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">'+ result.goods.goodsNo + '</h3> </div>' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + result.goods.name + '</h3> </div> ' - +'<div class="am-u-sm-2 "><h3 class="am-list-item-hd">' + result.beginBalance + '</h3> </div> ' - +'<div class="am-u-sm-3 "><input autocomplete="off" type="hidden" name="checkDetails['+i+'].id" width="50px" value="'+id+'"/> <input autocomplete="off" type="number" maxlength="8" style="width: 60px" name="checkDetails['+i+'].actuallySum" width="50px" value="'+actuallySum+'" /></div> '; - // +'<div class="am-u-sm-2 "><a class="am-list-item-hd" href="'+basePath+'/admin/customer/toVipInfoSearch?id='+ loj.getString(i, "id")+ '&lookInfo=0">查看盘点</a></div></li>'; - } - return html; - } else { - $("#pagingBox").hide(); - - - } - } - }).serchDate(); - - - //筛选点击事件 - - - - $(".m_ul li span").click(function(){ - - var normal="am-badge am-badge-secondary am-radius"; - var selected="am-badge am-badge-warning am-radius"; - var myAttr= $(this).attr("class"); - if(myAttr==selected){ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",normal); - Pagination.serchDate(); - }else{ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",selected); - onserch($(this).attr("kind"),$(this).attr("day")) - } - - }); - - //下拉框 - MTools.autoFullSelect(); - // - //style="display:none" - $(".option1").css("display","none"); - $(".option2").css("display","none"); - - } - ); - function option(){ - $(".option").removeAttr("selected"); - $('.time').attr('selected', true); - if($("#select").val() != null && $("#select").val() != ""){ - if($("#select").val() != "absentDay"){ - $(".option1").css("display","none"); - $(".option2").css("display","block"); - }else{ - $(".option2").css("display","none"); - $(".option1").css("display","block"); - } - }else{ - $(".option1").css("display","none"); - $(".option2").css("display","none"); - } - } - - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check.html deleted file mode 100644 index a7920bf..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check.html +++ /dev/null @@ -1,261 +0,0 @@ - - -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> - -<meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport" /> -<title th:text="${session.userInfo.shopName }"></title> - -<!-- Set render engine for 360 browser --> -<meta name="renderer" content="webkit"> - -<!-- No Baidu Siteapp--> -<meta http-equiv="Cache-Control" content="no-siteapp" /> - - - -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" - th:src="@{/js/systools/DDMBase.js}"></script> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> -<link rel="stylesheet" - th:href="@{/plugin/amazingUI/css/app.css}"> -<link rel="stylesheet" type="text/css" - th:href="@{/css/dingOrderList.css}"> -<style type="text/css"> -.m_ul{ - list-style: none; -} - -.m_ul li span{ -margin-left: 2em; -} -</style> -</head> - - - -<body> - <!-- 商品列表页面 --> - <div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/personal?foot=1}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class=""> 库存盘点 </a> - </h1> - - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main1" id="main" style="display: none;"> - <form class="am-form am-form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <div class="am-form-group am-form-select am-input-group am-input-group-primary am-g title"> - <div class="am-u-sm-6 margin-b1"> - <select class="form-control" name="checkStatus" id="checkStatus" > - <option value=''>--请选择盘点状态--</option> - <option value='待审核' >待审核</option> - <option value='已完成'>已完成</option> - </select> - </div> -<!-- --> -<!-- <!– <label class="col-sm-2 control-label">会员活跃度</label> –>--> -<!-- <div class="am-u-sm-6 margin-b1" >--> -<!-- <select class="form-control autoFull border" --> -<!-- th:data-url="@{/admin/dataDictionary/showDataDictionary}"--> -<!-- data-param="{type:'会员活跃度'}" --> -<!-- data-value="name"--> -<!-- name="vipState"> --> -<!-- <option value=''>活跃度</option> --> -<!-- </select>--> -<!-- </div>--> -<!-- <div class="am-u-sm-6 margin-b1">--> -<!-- <select name="select" id="select" onchange="option()"> --> -<!-- <option value=''>--类型选择--</option>--> -<!-- <option value="absentDay">未到店日期</option>--> -<!-- <option value="birthdays">生日</option>--> -<!-- <option value="followDays">跟进</option>--> -<!-- <option value="appointDays">预约</option>--> -<!-- </select>--> -<!-- </div>--> -<!-- <div class="am-u-sm-6 margin-b1">--> -<!-- <select name="time" id="time">--> -<!-- <option value='' class="option time">--时间选择--</option>--> -<!-- <option value="3" class="option option1 ">3天</option>--> -<!-- <option value="7" class="option option1">7天</option>--> -<!-- <option value="14" class="option option1">14天</option>--> -<!-- <option value="1" class="option option2">今天</option>--> -<!-- <option value="3" class="option option2">3天内</option>--> -<!-- <option value="30" class="option option2">一个月</option>--> -<!-- </select>--> -<!-- </div>--> - -<!-- <div class="am-u-sm-8 ">--> -<!-- <input autocomplete="off" type="text" class="searchIn" name="keyWord" placeholder="用户姓名/手机号" />--> - -<!-- </div>--> - <div class="am-u-sm-4 "> - <button type="button" - class="am-btn am-btn-default am-radius searchBtn" - onclick="Pagination.serchDate()">搜索</button> - </div> - - <!-- 记录当前页 --> - <input autocomplete="off" type="hidden" name="offset" id="_offset" value="0" /> - <input autocomplete="off" type="hidden" name="limit" id="limit" value="10" /> - </div> - - - <div data-am-widget="list_news" - class="am-list-news am-list-news-default"> - <!--列表标题--> - <div class="am-list-news-hd am-cf am-g"> - <!--带更多链接--> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">盘点编号</h2> - </div> - <div class="am-u-sm-3 "> - <h2 class="am-list-news-more am-fr">盘点时间</h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">制单人</h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">盘点状态</h2> - </div> - <div class="am-u-sm-2 "> - <h2 class="am-list-news-more am-fr">操作</h2> - </div> - </div> - <div class="am-list-news-bd"> - <ul class="am-list am-list-striped" id="showdataBox"> - - </ul> - </div> - <div id="pagingBox" align="center" style="margin-top: 10px"></div> - </div> - <!-- 商品展示结束 --> - <!-- 测试 --> - </form> - </div> - <!-- 订单内容结束 --> - - </div> - - <script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> - <script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> - <script> - - /** - 加载数据 - **/ - $(function() { - var pageSize=$("#limit").val(); - Pagination - .init( - { - url : basePath+"/admin/check/showList", - pageSize : pageSize, - builderDate : function(loj) { - if (loj.getRowCount() > 0) { - $("#main").show(); - var html = ""; - //构建数据 - for (var i = 0; i < loj.getRowCount(); i++) { - var createTime=' '; - var status=' '; - if(loj.getString(i, "createDate")&&loj.getString(i, "createDate")!=''){ - createTime = MGrid.getTime(loj.getString(i, "createDate")); - } - - if(loj.getString(i, "checkStatus")&&loj.getString(i, "checkStatus")!=''){ - createTime = MGrid.getTime(loj.getString(i, "createDate")); - } - - html += ' <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">'+ loj.getString(i,"checkNo") + '</h3> </div>' - +'<div class="am-u-sm-3 "><h3 class="am-list-item-hd">' + createTime + '</h3> </div> ' - +'<div class="am-u-sm-2 "><h3 class="am-list-item-hd">' + loj.getString(i,"makingManName") + '</h3> </div> ' - +'<div class="am-u-sm-2 "><h3 class="am-list-item-hd">' + loj.getString(i,"checkStatus") + '</h3> </div> ' - +'<div class="am-u-sm-2 "><a class="am-list-item-hd" href="'+basePath+'/admin/check/toMobileCheckDetail?checkId='+ loj.getString(i, "id")+ '&lookInfo=0">查看盘点</a></div></li>'; - } - return html; - } else { - $("#pagingBox").hide(); - - - } - } - }).serchDate(); - - - //筛选点击事件 - - - - $(".m_ul li span").click(function(){ - - var normal="am-badge am-badge-secondary am-radius"; - var selected="am-badge am-badge-warning am-radius"; - var myAttr= $(this).attr("class"); - if(myAttr==selected){ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",normal); - Pagination.serchDate(); - }else{ - $(".m_ul li span").attr("class",normal); - $(this).attr("class",selected); - onserch($(this).attr("kind"),$(this).attr("day")) - } - - }); - - //下拉框 - MTools.autoFullSelect(); - // - //style="display:none" - $(".option1").css("display","none"); - $(".option2").css("display","none"); - - } - ); - function option(){ - $(".option").removeAttr("selected"); - $('.time').attr('selected', true); - if($("#select").val() != null && $("#select").val() != ""){ - if($("#select").val() != "absentDay"){ - $(".option1").css("display","none"); - $(".option2").css("display","block"); - }else{ - $(".option2").css("display","none"); - $(".option1").css("display","block"); - } - }else{ - $(".option1").css("display","none"); - $(".option2").css("display","none"); - } - } - - - - </script> - <!-- index js --> -</body> -</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/vip-archives.html b/zq-erp/src/main/resources/templates/views/admin/hive/mobile/vip-archives.html deleted file mode 100644 index 162f4b7..0000000 --- a/zq-erp/src/main/resources/templates/views/admin/hive/mobile/vip-archives.html +++ /dev/null @@ -1,251 +0,0 @@ -<!doctype html> -<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - - <meta - content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" - name="viewport"/> - <title th:text="${session.userInfo.shopName }"></title> - - <!-- Set render engine for 360 browser --> - <meta name="renderer" content="webkit"> - <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> - <script type="text/javascript" th:src="@{/js/systools/DDMBase.js}"></script> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/amazeui.min.css}"> - <link rel="stylesheet" th:href="@{/plugin/amazingUI/css/app.css}"> - <link rel="stylesheet" type="text/css" th:href="@{/css/dingUserVip.css}"> - <style type="text/css"> - .loadingbig { - max-width: 100%; - } - - </style> - -</head> -<script> - -</script> - - -<body> -<!-- 商品列表页面 --> -<div class="wrap"> - <!-- 头部开始 --> - <header data-am-widget="header" - class="am-header color-w back-m1 am-header-fixed"> - <div class="am-header-left am-header-nav"> - <a th:href="@{/admin/redirect/hive/mobile/CRM-account}" class=""> <i - class="am-header-icon am-icon-chevron-left"></i> - </a> - </div> - - <h1 class="am-header-title"> - <a href="#title-link" class="">客户档案</a> - </h1> - - </header> - <!-- 头部结束 --> - - <!-- 订单内容 --> - <div class="main main2" id="app"> - <form class="am-form am-form-horizontal" method="post" id="dataform" onsubmit="javascripr:return false;"> - - <div class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-12"> - <span class="am-input-group-label ">会员姓名</span> - </div> - <div class="am-u-sm-12"> - <input autocomplete="off" type="text" class="am-form-field " th:value="${session.lookVipInfo.vipName}" - readonly="readonly"/> - </div> - </div> - - - <template v-for="question in questions"> - <div v-if="question.type=='标题'" - class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-12"> - <span class="am-input-group-label">{{question.question}}</span> - </div> - </div> - - - <div v-if="question.type=='文本'" class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-12"> - <span class="am-input-group-label">{{question.question}}</span> - </div> - <div class="am-u-sm-12"> - <input autocomplete="off" type="text" v-model="question.vipAnswer.answerText" class="am-form-field "> - </div> - </div> - - <div v-if="question.type=='单选'" class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-12"> - <span class="am-input-group-label">{{question.question}}</span> - </div> - <div class="am-u-sm-12"> - <select v-model="question.vipAnswer.answerId"> - <option v-for="item in question.answers" v-bind:value="item.id" >{{item.answer}}</option> - </select> - </div> - </div> - - <div v-if="question.type=='多选'" class="am-input-group am-form-group am-input-group-primary am-g bot"> - <div class="am-u-sm-12"> - <span class="am-input-group-label">{{question.question}}</span> - </div> - <div class="am-u-sm-12"> - <div class="am-checkbox"> - <template v-for="item in question.answers" > - <div class="am-checkbox"> - <label> - <input autocomplete="off" type="checkbox" v-model="question.vipAnswer.answerId" v-bind:value="item.id" > {{item.answer}} - </label> - </div> - </template> - </div> - </div> - </div> - - - - - </template> - - - <div class="inputBtn"> - <input autocomplete="off" type="button" @click="submit()" class="am-btn btn-m1 am-radius am-btn-block" - value="保存"></input> - </div> - <!-- 测试 --> - - </form> - </div> -</div> - -<script - th:src="@{/plugin/amazingUI/js/amazeui.widgets.helper.js}"></script> -<script th:src="@{/plugin/amazingUI/js/amazeui.min.js}"></script> -<script th:src="@{/js/systools/mobile/AjaxProxyVue-mobile.js}"></script> -<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> -<script> - - - var id = $.query.get("id"); - var app = new Vue({ - el: '#app', - data: { - id: id, - questions: [{ - answers: [{}], - category: "", - id: "", - orderField: "", - question: "", - type: "", - vipAnswer: {vipAnswer:''}, - }] - }, - created: function () { - this.loadInfo(); - }, - - mounted: function () { - - }, - - methods: { - - - loadInfo: function () { - - console.log('加载服务器数据'); - var _this = this; - AjaxProxy.requst({ - async: false, - url: basePath + '/admin/vipInfo/getVipQuestions?id=' + id, - callback: function (data) { - var questions= data.mapInfo.questions; - for(let i =0;i<questions.length;i++){ - if(questions[i].vipAnswer==null){ - questions[i].vipAnswer={vipAnswer:'',answerId:''}; - } - if(questions[i].type=='多选'){ - if(questions[i].vipAnswer){ - questions[i].vipAnswer.answerId=questions[i].vipAnswer.answerId.split(","); - } - }else if(questions[i].type=='单选'){ - if(questions[i].vipAnswer){ - questions[i].vipAnswer.answerId= parseInt( - questions[i].vipAnswer.answerId - ) ; - } - } - } - _this.questions = questions; - } - }); - - - } - , - submit: function () { - console.log("提交"); - let _this = this; - let vipAnswers=[]; - for(let i=0; i<_this.questions.length ; i++){ - var quesion=_this.questions[i]; - - let vipAnswer=quesion.vipAnswer.answerId; - if(quesion.type=='多选'){ - vipAnswer=quesion.vipAnswer.answerId.join(","); - } - let obj={ - quesionId:quesion.id, - vipId:id, - answerId:vipAnswer, - answerText:quesion.vipAnswer.answerText, - } - - vipAnswers.push(obj); - } - var params = { - id:id, - vipAnswers:vipAnswers - } - - - if (_this.validate(params)) { - AjaxProxy.requst({ - app: _this, - data: params, - url: basePath + '/admin/vipInfo/modifyVipArchives', - callback: function (data) { - layer.open({ - content: data.info - ,time: 2 //2秒后自动关闭 - - }); - } - }); - } - } - , - validate: function (params) { - - return true; - } - , - - - }, - - }) - - -</script> -<!-- index js --> -</body> -</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/operate/label-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/operate/label-form.html new file mode 100644 index 0000000..6614330 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/operate/label-form.html @@ -0,0 +1,59 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> +</head> +<body> +<div class="ibox-content"> + <form class="form-horizontal" id="dataform" onsubmit="javascript:return false;"> + <input autocomplete="off" type="hidden" name="id" th:value="${obj?.id}"> + <div class="form-group"> + <label class="col-sm-2 control-label">标签<span class="text-danger">*</span></label> + <div class="col-sm-4"> + <input autocomplete="off" dataType="*" class="form-control" th:value="${obj?.label}" name="label" ></input> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group "> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="myForm.submit()" + class="btn btn-success radius"><i class="fa fa-check"></i> 保存</a> <a + class="btn btn-danger radius" href="javascript:;" onclick="MTools.closeForm()" ><i class="fa fa-close"></i> 关闭</a> + </div> + </div> + </form> + </div> +</body> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script th:inline="javascript"> + MTools.autoFullSelect(); + $(".select2").select2(); + + /*<![CDATA[*/ + var obj=/*[[${obj}]]*/ + /*]]>*/ + + var invokeUrl=basePath+"/admin/label/add"; + if(obj!=null&& obj.id!=null){ + invokeUrl = basePath+"/admin/label/modify"; + } + var myForm=MForm.initForm({ + invokeUrl:invokeUrl, + afterSubmit:function(){ + parent.myGrid.serchData(); + }, + }); +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/operate/label-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/operate/label-list.html new file mode 100644 index 0000000..9d6bce4 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/operate/label-list.html @@ -0,0 +1,146 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> +</head> +<body class="container-fluid"> +<div class="pd-10"> + <!-- 搜索框部分start --> + <div class="row form-head"> + <form class="form-inline" id="serchform"> +<!-- <div class="input-group">--> +<!-- <div class="btn-group search-list " data-for="search-text">--> +<!-- <button type="button"--> +<!-- class="btn btn-default dropdown-toggle searchlist"--> +<!-- data-toggle="dropdown">--> +<!-- 用户姓名 <span class="caret "></span>--> +<!-- </button>--> +<!-- <ul class="dropdown-menu" role="menu">--> +<!-- <li data-field="suName"><a>用户姓名</a></li>--> +<!-- <li data-field="suAccount"><a>账号 </a></li>--> +<!-- </ul>--> +<!-- </div>--> +<!-- <div class="form-group mr-20 ml-20">--> +<!-- <input id="search-text" name="suName" placeholder="输入查询关键词"--> +<!-- type="text" class="form-control">--> +<!-- </div>--> +<!-- <div class="form-group">--> +<!-- <button onclick="myGrid.serchData(1)" type="button"--> +<!-- class="btn btn-info">--> +<!-- <i class="fa fa-search "></i> 搜索--> +<!-- </button>--> +<!-- <button type="reset" class="btn btn-info ">--> +<!-- <i class="fa fa-refresh "></i> 重置--> +<!-- </button>--> +<!-- </div>--> +<!-- </div>--> + </form> + </div> + + <div class="row mt-10" > + <div id="option-bar"> + <!-- 功能按钮部分 --> + <button onclick="openAdd()" type="button" class="btn btn-info btn-sm"><i class="fa fa-add" ></i> 新增</button> + </div> + <table id="mgrid"> + <thead> + <tr> + <th data-checkbox="true"></th> + <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" >序号</th> + <th data-align="center" data-formatter="buidOperate" data-field="id">操作</th> + <th data-field="label" data-align="center">标签内容</th> + <th data-field="createBy" data-align="center">创建人</th> + <th data-field="shopName" data-align="center">门店名称</th> + <th data-field="isAll" data-align="center" data-formatter="isAllFormat">是否所有门店</th> + </tr> + </thead> + </table> + </div> +</div> +<script type="text/javascript" + th:src="@{/js/systools/MJsBase.js}"></script> + <script type="text/javascript"> + var myGrid; + $(function(){ + var delUrl=""; + delUrl=basePath+"/admin/label/del" ; + myGrid=MGrid.initGrid({ + url:basePath+"/admin/label/showList", + delUrl:delUrl, + }); + + }); + + + function del() { + var i = $("#mgrid").bootstrapTable('getSelections').length; + if (i > 1) { + layer.msg("仅可选择一条记录", { + icon: 5 + }); + return false; + } + myGrid.delItems(); + } + + function isAllFormat(value) { + if (value == 1) { + return "是" + } else { + return "否"; + } + } + + function buidOperate(value, row, index){ + var html = ""; + html += '<div class="btn-group">' + + '<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">' + + '操作 <span class="caret"></span>' + '</button>' + + '<ul class="dropdown-menu" role="menu">' + + '<li><a href="javascript:void(0)" style="display:' + + value + + '" onClick="openEdit(\'' + + value + + '\')" title="编辑">编辑</a></li>' + + '<li><a href="javascript:void(0)" style="display:' + + value + + '" onClick="myGrid.delItem(\'' + + value + + '\')" title="删除">删除</a></li>' + '</ul>' + '</div>'; + html += ''; + return html; + } + //打开添加界面 + function openAdd() { + layer.open({ + type : 2, + title : "添加标签", + area : [ MUI.SIZE_L, '400px' ], + maxmin : true, + content : [ basePath+'/admin/label/edit'] + }); + } + + function openEdit(id) { + layer.open({ + type : 2, + title : "添加标签", + area : [ MUI.SIZE_L, '400px' ], + maxmin : true, + content : [ basePath+'/admin/label/edit?id=' + id] + }); + } + </script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/operate/trainingMaterialsManage-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/operate/trainingMaterialsManage-form.html index 346b695..2896219 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/operate/trainingMaterialsManage-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/operate/trainingMaterialsManage-form.html @@ -13,14 +13,14 @@ th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> <!-- 富文本编辑器 --> - <link rel="stylesheet" - th:href="@{/plugin/kindeditor/themes/default/default.css}"/> - <link rel="stylesheet" - th:href="@{/plugin/kindeditor/plugins/code/prettify.css}"/> - <script th:src="@{/plugin/kindeditor/kindeditor.js}"></script> - <script th:src="@{/plugin/kindeditor/lang/zh_CN.js}"></script> - <script - th:src="@{/plugin/kindeditor/plugins/code/prettify.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.config.js}"></script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/ueditor.all.js}"> + </script> + <script type="text/javascript" charset="utf-8" + th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> + <style type="text/css"> #projBox { max-height: 400px; @@ -58,10 +58,10 @@ th:value="${obj?.title }" datatype="*" nullmsg="标题不能为空"> </div> <div class="Validform_checktip"></div> - <label class="col-sm-2 control-label">排序<span class="text-danger">*</span></label> + <label class="col-sm-2 control-label">排序</label> <div class="col-sm-3"> <input autocomplete="off" type="text" class="form-control" name="sort" - th:value="${obj?.sort }" datatype="n" nullmsg="序号不能为空" + th:value="${obj?.sort }" datatype="n" ignore="ignore" errormsg="序号只能为数字"> </div> <div class="Validform_checktip"></div> @@ -86,10 +86,16 @@ <div class="col-sm-3"> <div th:if="${obj ne null }" class="checkbox checkbox-inline"> - <input autocomplete="off" name="isPublish" type="radio" id="inlineCheckbox1" value="是" > + + <input autocomplete="off" th:if="${obj.isPublish eq '是' }" checked name="isPublish" type="radio" id="inlineCheckbox1" value="是" > + <input autocomplete="off" th:if="${obj.isPublish eq '否' }" name="isPublish" type="radio" id="inlineCheckbox1" value="是" > <label for="inlineCheckbox1">是 </label> - <input autocomplete="off" name="isPublish" type="radio" id="inlineCheckbox2" value="否"> + + <input autocomplete="off" th:if="${obj.isPublish eq '是' }" name="isPublish" type="radio" id="inlineCheckbox2" value="否"> + <input autocomplete="off" th:if="${obj.isPublish eq '否' }" checked name="isPublish" type="radio" id="inlineCheckbox2" value="否"> <label for="inlineCheckbox2">否 </label> + + </div> <div th:if="${obj eq null }" class="checkbox checkbox-inline"> @@ -105,30 +111,11 @@ <div class="form-group"> <label class="col-sm-2 control-label">文章内容</label> <div class="col-sm-8"> - <textarea name="content" id="artcontent" th:text="${obj?.content}"> - - </textarea> + <script style="width: 100%; height: 500px" id="artcontent" name="content" + type="text/plain" th:utext="${obj?.content}" ></script> </div> <div class="Validform_checktip"></div> </div> - <!-- - <div class="form-group"> - <label class="col-sm-2 control-label">上传图片</label> - <div class="col-sm-9"> - <input autocomplete="off" onclick="MTools.chooesFile('#fileText')" - class="input-text upload-url radius form-control" type="text" id="showFileName" - readonly style="width: 30%;display: inline;"> - <a onclick="MTools.chooesFile('#fileText')" class="btn btn-success radius"> - <i class="fa fa-cloud-upload"></i> 浏览文件 </a> - <input autocomplete="off" type="button" class='btn btn-success radius' - onclick="MTools.upFile('#submitBtn')" value="上传"> - <a id="selectInServices" class="btn btn-success radius"> - <i class="fa fa-cloud"></i> 远程图库 - </a> - </div> - </div> --> - - <div class="form-group "> <div class="col-sm-12 text-center"> @@ -143,11 +130,14 @@ <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script th:inline="javascript"> var obj=[[${obj}]]; - var editor = null; + + //百度编辑器 + var ue = {}; + var myForm=MForm.initForm({ invokeUrl:basePath+"/admin/article/addOrModify", beforeSubmit:function(){ - editor.sync(); + }, afterSubmit:function(){ parent.myGrid.serchData(); @@ -156,11 +146,10 @@ $(function() { $(".select2").select2({'width':'100%'}); - MUI.createEdit("content", '100%', '400px', 'editor'); - MUI.openServiceImgSpace(function(url) { - $("#img_1").attr("src", url).show(); - $("#hiddenImg").val(url); - }, "#selectInServices"); + + //初始化编辑器 + ue = UE.getEditor('artcontent'); + initFunctionList(); }); @@ -185,7 +174,7 @@ function autoZy() { - var text = editor.text(); + var text = ue.getContentTxt(); $("#zy-input").val(text.substring(0, 100)); } function cleanZy() { diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/orgment/shopInfo-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/orgment/shopInfo-form.html index 1b8cfba..d9702b7 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/orgment/shopInfo-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/orgment/shopInfo-form.html @@ -13,7 +13,7 @@ th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> - <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=Oego4OzlvPRPNyjCPTctXtuVNsSissOX"></script> + <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=Oego4OzlvPRPNyjCPTctXtuVNsSissOX"></script> </head> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/meidu.html b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/meidu.html new file mode 100644 index 0000000..b760539 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/meidu.html @@ -0,0 +1,201 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + <style> + + .btn{ + position: fixed; + bottom: 10px; + left: 45%; + } + + </style> +</head> +<body> +<div class="ibox-content" id="app"> + + + <div id="print" style="width: 220px; "> + <h1 style="text-align: center;font-size: 18px;margin: 20px auto;"> + {{order.shopName}} + </h1> + <table style="width: 100%; font-size:12px;"> + + <tr> + <td colspan="2"> + <b>订单号</b>:<span>{{order.orderNo}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>客户</b>:<span>{{order.vipName}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>消费日期</b>:<span>{{order.orderTime |format}}</span> + </td> + </tr> + <tr> + <td colspan="2"> + <b>电话</b>:<span>{{order.vipPhone| formatPhone }}</span> + </td> + </tr> + </table> + <p>--------------------------------</p> + <table style="width: 80%;font-size:12px;margin-top: 10px;text-align: left; margin-bottom: 5px;"> + + <tr> + <th style="text-align: left;" colspan="4">产品</th> + </tr> + <tr> + <th style="">数量</th> + <th style="">单价</th> + <th style="">小计</th> + </tr> + <template v-for="item in order.items"> + <tr > + <td style="text-align: left;" colspan="4" >{{item.shoppingGoods.name }}</td> + </tr> + <tr > + <td>{{item.count }}</td> + <td>{{item.zkPrice }}</td> + <td>{{(item.zkPrice * item.count).toFixed(1) }}</td> + </tr> + </template> + <tr> + <td> + <b>总计:</b> + </td> + <td> + + </td> + <td> + <span >{{order.zkTotal}}</span> + </td> + </tr> + </table> + <p>--------------------------------</p> + <table style="width: 100%;font-size: 10px; margin-bottom: 5px;"> + <tr > + <td> + <b >储值卡余额:</b><span >{{totalMoney}}</span> + </td> + </tr> + + <tr> + <td> + <b>实收金额:</b><span >{{order.zkTotal-order.arrears}}</span> + </td> + </tr> + <tr> + <td> + <b>收银人:</b><span th:utext="${session.userInfo.suName}" ></span> + </td> + </tr> + <tr> + <td> + <b>客户签名:</b> + </td> + </tr> + + + </table> + <div style="width: 100%;"> + 地址:{{shopInfo.shopAddr}}<br> + 电话:{{shopInfo.shopTel}}<br> + </div> + </div> + <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> +</div> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript"> + + + var id = $.query.get("id"); + var app = new Vue({ + el: '#app', + data: { + order:{ + vipInfo:{}, + serviceItems:[] + }, + moneyCar:{}, + totalMoney:0, + shopInfo:{} + + }, + created: function () { + + this.loadInfo(); + }, + + mounted: function () { + + }, + + methods: { + loadInfo(){ + var _this=this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/order/getShopOrder?id='+id, + callback: function (data) { + _this.order=data.mapInfo.order; + _this.moneyCar=data.mapInfo.moneyCar; + _this.shopInfo=data.mapInfo.shopInfo; + _this.totalMoney=data.mapInfo.totalMoney; + setTimeout(print,1000) ; + } + }); + }, + }, + + filters: + { + format: function (value) { + if (!value) return ''; + return MTools.formatDate(value, 'yyyy-MM-dd') + } , + formatPhone: function (value) { + if (!value) return ''; + return value.substr(0,3) + "****" + value.substr(value.length-4,value.length+1) + } , + }, + + + }, + ); + + + var LODOP; + + function print() { + LODOP = getLodop(); + LODOP.PRINT_INIT("HIVE打印任务"); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", document.getElementById("print").innerHTML); + LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW", true); + LODOP.PREVIEW(); + } + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html new file mode 100644 index 0000000..62f8f07 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html @@ -0,0 +1,177 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + <style> + + .btn{ + position: fixed; + bottom: 10px; + left: 45%; + } + + </style> +</head> +<body> +<div class="ibox-content" id="app"> + <div id="print" style="width: 200px; margin: 5px auto;"> + <h1 style="text-align: center;font-size:18px;margin: 20px auto;"> + {{projService.shopName}} + </h1> + <table style="width: 100%; font-size:10px;"> + + <tr> + <td colspan="2"> + <b>订单号</b>:<span>{{projService.serviceNo}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>客户</b>:<span>{{projService.vipInfo.vipName}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>消费日期</b>:<span>{{projService.createTime |format}}</span> + </td> + </tr> + <tr> + <td colspan="2"> + <b>电话</b>:<span>{{projService.vipInfo.phone| formatPhone }}</span> + </td> + </tr> + </table> + <table style="width: 80%;font-size:10px;margin-top: 10px;text-align: left; margin-bottom: 5px;"> + <tr> + <th style="text-align: left;" colspan="4">产品</th> + </tr> + <tr> + <th style="">数量</th> + <th style="">单价</th> + <th style="">余次</th> + <th style="">技师</th> + </tr> + <template v-for="item in projService.serviceItems"> + <tr > + <td style="text-align: left;" colspan="4" >{{item.projInfo.name }}【{{item.projUse.source}}】</td> + </tr> + <tr > + <td>{{item.count }}</td> + <td>{{item.projUse.price }}</td> + <td >{{item.projUse.remainCount == null ? "-" : item.projUse.remainCount}}</td> + <td>{{item.beautiStaffInfo?item.beautiStaffInfo.suName:''}}</td> + </tr> + </template> + </table> + <table style="width: 100%;font-size: 10px; margin-bottom: 5px;"> + <tr> + <td> + <b>本次划扣:</b> <span >{{projService.money}}</span> + </td> + </tr> + <tr> + <td> + <b>收银人:</b> <span>{{projService.createStaffName}}</span> + </td> + </tr> + <tr> + <td> + <b>客户签名:</b> + </td> + </tr> + </table> + + + <div style="width: 100%;"> + 地址:{{shopInfo.shopAddr}}<br> + 电话:{{shopInfo.shopTel}}<br> + </div> + + + </div> + <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> +</div> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript"> + + + var id = $.query.get("id"); + var app = new Vue({ + el: '#app', + data: { + projService:{ + vipInfo:{}, + serviceItems:[] + } + }, + created: function () { + + this.loadInfo(); + }, + + mounted: function () { + + }, + + methods: { + loadInfo(){ + var _this=this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/projService/findProjServiceInfo?id='+id, + callback: function (data) { + _this.projService=data.mapInfo.projService; + _this.shopInfo=data.mapInfo.shopInfo; + setTimeout(print,1000) ; + } + }); + }, + }, + + filters: + { + format: function (value) { + if (!value) return ''; + return MTools.formatDate(value, 'yyyy-MM-dd') + } , + formatPhone: function (value) { + if (!value) return ''; + return value.substr(0,3) + "****" + value.substr(value.length-4,value.length+1) + } , + }, + + + }, + ); + + + var LODOP; + + function print() { + LODOP = getLodop(); + LODOP.PRINT_INIT("HIVE打印任务"); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", document.getElementById("print").innerHTML); + LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW", true); + LODOP.PREVIEW(); + } + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-taiyan.html b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-taiyan.html new file mode 100644 index 0000000..d549df3 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-taiyan.html @@ -0,0 +1,197 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + <style> + + .btn{ + position: fixed; + bottom: 10px; + left: 45%; + } + + </style> +</head> +<body> +<div class="ibox-content" id="app"> + <div id="print" style="width: 200px; margin: 5px auto;"> + <h1 style="text-align: center;font-size:18px;margin: 20px auto;"> + {{projService.shopName}} + </h1> + <table style="width: 100%; font-size:10px;line-height: 20px;"> + + <tr> + <td colspan="2"> + <b>订单号</b>:<span>{{projService.serviceNo}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>客户</b>:<span>{{projService.vipInfo.vipName}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>消费日期</b>:<span>{{projService.createTime |format}}</span> + </td> + </tr> + <tr> + <td colspan="2"> + <b>电话</b>:<span>{{projService.vipInfo.phone| formatPhone }}</span> + </td> + </tr> + </table> + <table style="width: 80%;font-size:10px;margin-top: 20px;text-align: left"> + <tr> + <th style="text-align: left;" colspan="4">产品</th> + </tr> + <tr> + <th style="">数量</th> + <th style="">单价</th> + <th style="">余次</th> + <th style="">技师</th> + </tr> + <template v-for="item in projService.serviceItems"> + <tr > + <td style="text-align: left;" colspan="4" >{{item.projInfo.name }}</td> + </tr> + <tr > + <td>{{item.count }}</td> + <td>{{item.projUse.price }}</td> + <td >{{item.projUse.surplusCount }}</td> + <td>{{item.beautiStaffInfo?item.beautiStaffInfo.suName:''}}</td> + </tr> + </template> + </table> + <table style="width: 100%;font-size: 10px;line-height: 30px;"> + <tr> + <td> + <b>本次划扣:</b> <span >{{projService.money}}</span> + </td> + </tr> + <tr> + <td> + <b>收银人:</b> <span>{{projService.createStaffName}}</span> + </td> + </tr> + <tr> + <td> + <b>客户签名:</b> + </td> + </tr> + + + </table> + + <div style="width: 100%;text-align: center;margin: 30px auto;margin-bottom: 10px"> + <br> + *****************<br> + 谢谢惠顾<br> + *****************<br> + <br> + </div> + <div style="width: 100%;"> + 地址:{{shopInfo.shopAddr}}<br> + 电话:{{shopInfo.shopTel}}<br> + <br> + <br> + </div> + <div style="width: 100%;" > + <div style="text-align: center;"> + + <img style="width: 100%;" :src="shopInfo.qrcode" /><br> + 更多精彩请访问小程序<br> + </div> + <br> + <br> + </div> + + + + </div> + <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> +</div> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript"> + + + var id = $.query.get("id"); + var app = new Vue({ + el: '#app', + data: { + projService:{ + vipInfo:{}, + serviceItems:[] + } + }, + created: function () { + + this.loadInfo(); + }, + + mounted: function () { + + }, + + methods: { + loadInfo(){ + var _this=this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/projService/findProjServiceInfo?id='+id, + callback: function (data) { + _this.projService=data.mapInfo.projService; + _this.shopInfo=data.mapInfo.shopInfo; + setTimeout(print,1000) ; + } + }); + }, + }, + + filters: + { + format: function (value) { + if (!value) return ''; + return MTools.formatDate(value, 'yyyy-MM-dd') + } , + formatPhone: function (value) { + if (!value) return ''; + return value.substr(0,3) + "****" + value.substr(value.length-4,value.length+1) + } , + }, + + + }, + ); + + + var LODOP; + + function print() { + LODOP = getLodop(); + LODOP.PRINT_INIT("HIVE打印任务"); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", document.getElementById("print").innerHTML); + LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW", true); + LODOP.PREVIEW(); + } + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/taiyan.html b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/taiyan.html new file mode 100644 index 0000000..f53a04d --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/taiyan.html @@ -0,0 +1,219 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + <style> + + .btn{ + position: fixed; + bottom: 10px; + left: 45%; + } + + </style> +</head> +<body> +<div class="ibox-content" id="app"> + + <div id="print" style="width: 220px; "> + <h1 style="text-align: center;font-size: 18px;margin: 20px auto;"> + {{order.shopName}} + </h1> + <table style="width: 100%; font-size:12px;line-height: 20px;"> + + <tr> + <td colspan="2"> + <b>订单号</b>:<span>{{order.orderNo}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>客户</b>:<span>{{order.vipName}}</span> + </td> + </tr> + <tr> + <td colspan="2" > + <b>消费日期</b>:<span>{{order.orderTime |format}}</span> + </td> + </tr> + <tr> + <td colspan="2"> + <b>电话</b>:<span>{{order.vipPhone| formatPhone }}</span> + </td> + </tr> + </table> + <p>-----------------------------------</p> + <table style="width: 80%;font-size:12px;margin-top: 20px;text-align: left"> + + <tr> + <th style="text-align: left;" colspan="4">产品</th> + </tr> + <tr> + <th style="">数量</th> + <th style="">单价</th> + <th style="">小计</th> + </tr> + <template v-for="item in order.items"> + <tr > + <td style="text-align: left;" colspan="4" >{{item.shoppingGoods.name }}</td> + </tr> + <tr > + <td>{{item.count }}</td> + <td>{{item.zkPrice }}</td> + <td>{{(item.zkPrice * item.count).toFixed(1) }}</td> + </tr> + </template> + <tr> + <td> + <b>总计:</b> + </td> + <td> + + </td> + <td> + <span >{{order.zkTotal}}</span> + </td> + </tr> + </table> + <p>-----------------------------------</p> + <table style="width: 100%;font-size: 10px;line-height: 30px;"> + <tr > + <td> + <b >储值卡余额:</b><span >{{totalMoney}}</span> + </td> + </tr> + + <tr> + <td> + <b>实收金额:</b><span >{{order.zkTotal-order.arrears}}</span> + </td> + </tr> + <tr> + <td> + <b>收银人:</b><span>{{order.staffName}}</span> + </td> + </tr> + <tr> + <td> + <b>客户签名:</b> + </td> + </tr> + + + </table> + + <div style="width: 100%;text-align: center;margin: 30px auto;margin-bottom: 10px"> + <br> + *****************<br> + 谢谢惠顾<br> + *****************<br> + <br> + </div> + <div style="width: 100%;"> + 地址:{{shopInfo.shopAddr}}<br> + 电话:{{shopInfo.shopTel}}<br> + <br> + <br> + </div> + <div style="width: 100%;" > + <div style="text-align: center;"> + + <img style="width: 100%;" :src="shopInfo.qrcode" /><br> + 更多精彩请访问小程序<br> + </div> + <br> + <br> + </div> + </div> + <a href="javascript:;" onclick="print()" class="btn btn-success radius">打印</a> +</div> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/LodopFuncs.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript"> + + + var id = $.query.get("id"); + var app = new Vue({ + el: '#app', + data: { + order:{ + vipInfo:{}, + serviceItems:[] + }, + moneyCar:{}, + totalMoney:0, + shopInfo:{} + + }, + created: function () { + + this.loadInfo(); + }, + + mounted: function () { + + }, + + methods: { + loadInfo(){ + var _this=this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/order/getShopOrder?id='+id, + callback: function (data) { + _this.order=data.mapInfo.order; + _this.moneyCar=data.mapInfo.moneyCar; + _this.shopInfo=data.mapInfo.shopInfo; + _this.totalMoney=data.mapInfo.totalMoney; + setTimeout(print,1000) ; + } + }); + }, + }, + + filters: + { + format: function (value) { + if (!value) return ''; + return MTools.formatDate(value, 'yyyy-MM-dd') + } , + formatPhone: function (value) { + if (!value) return ''; + return value.substr(0,3) + "****" + value.substr(value.length-4,value.length+1) + } , + }, + + + }, + ); + + + var LODOP; + + function print() { + LODOP = getLodop(); + LODOP.PRINT_INIT("HIVE打印任务"); + LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", document.getElementById("print").innerHTML); + LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW", true); + LODOP.PREVIEW(); + } + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html index a4a4c29..e748a60 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html @@ -83,6 +83,19 @@ </el-form-item> </el-col> + <el-col :offset="2" :span="10" v-if="form.goodType!='家居产品'"> + <el-form-item label="业绩规则" prop="achieveRuleId"> + <el-select v-model="form.achieveRuleId" filterable placeholder="请选择业绩规则"> + <el-option + v-for="item in achieveRulsList" + :key="item.id" + :label="item.name" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> <el-row> @@ -190,8 +203,16 @@ </el-radio-group> </el-form-item> </el-col> - <el-col :offset="2" :span="10"> - <el-form-item prop="carUseCount" label-width="120px" label="最大使用次数" v-if="form.isCourse=='Y'"> + <el-col :offset="2" :span="3"> + <el-form-item label="是否无限次数" v-if="form.isCourse=='Y'"> + <el-radio-group v-model="form.isInfinite"> + <el-radio label="N">否</el-radio> + <el-radio label="Y">是</el-radio> + </el-radio-group> + </el-form-item> + </el-col> + <el-col :offset="1" :span="5"> + <el-form-item prop="carUseCount" label-width="120px" label="最大使用次数" v-if="form.isCourse=='Y' && form.isInfinite=='N'"> <el-input v-model="form.carUseCount"></el-input> </el-form-item> </el-col> @@ -201,14 +222,25 @@ <el-col :span="10"> <el-form-item label="充值卡使用范围" label-width="150px" prop="isCourse"> <el-radio-group v-model="form.carIsAll"> - <el-radio label="是">所有产品</el-radio> - <el-radio label="否">部分产品(设置部分产品则充值卡内的金额只能消费指定范围的产品)</el-radio> + <el-radio label="是" value="是">所有产品</el-radio> + <el-radio label="否" value="是">部分产品(设置部分产品则充值卡内的金额只能消费指定范围的产品)</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :offset="2" :span="10"> <el-form-item label-width="120px" label="最大使用次数"> <el-input v-model="form.carUseCount"></el-input> + </el-form-item> + </el-col> + </el-row> + + <el-row> + <el-col :span="10"> + <el-form-item label="是否合作项目"> + <el-radio-group v-model="form.isCooperate"> + <el-radio label="2">否</el-radio> + <el-radio label="1">是</el-radio> + </el-radio-group> </el-form-item> </el-col> </el-row> @@ -893,6 +925,76 @@ </el-form-item> </el-col> </el-row> + <el-row v-if="form.goodType!='家居产品'"> + <el-form-item label="购买有效期"> + <el-col :span="4"> + <el-form-item label="" prop="isNum"> + <el-input v-model.number="form.buyDateNum"></el-input> + </el-form-item> + </el-col> + <el-col :span="2"> + <el-form-item lable=""> + <el-select v-model="form.buyDateUnit" placeholder="请选择"> + <el-option + v-for="item in dateList" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="6" style="margin-left: 10px; color: #C0C4CC;"> + <span>用户从购买日开始计算多长时间自动失效</span> + </el-col> + </el-form-item> + </el-row> + <el-row v-if="form.goodType!='家居产品'"> + <el-form-item label="消耗有效期"> + <el-col :span="4"> + <el-form-item label="" prop="isNum"> + <el-input v-model.number="form.useDateNum"></el-input> + </el-form-item> + </el-col> + <el-col :span="2"> + <el-select v-model="form.useDateUnit" placeholder="请选择"> + <el-option + v-for="item in dateList" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-col> + <el-col :span="6" style="margin-left: 10px; color: #C0C4CC;"> + <span>用户从第一次使用后开始计算多长时间自动生效</span> + </el-col> + </el-form-item> + </el-row> + <el-row v-if="form.goodType!='家居产品'"> + <el-form-item label="统一到期时间"> + <el-col :span="6"> + <el-date-picker + v-model="form.invalidTime" + type="date" + placeholder="选择日期"> + </el-date-picker> + </el-col> + <el-col :span="10" style="margin-left: 10px; color: #C0C4CC;"> + <span>在指定日期所有购买过本商品的统一失效,且在统一失效时间之后产品会自动下架</span> + </el-col> + </el-form-item> + </el-row> + <p class="el-big-title">支付方式</p> + <el-row> + <el-col :offset="1"> + <el-checkbox-group v-model="payMethodList"> + <el-checkbox label="1">充值本金</el-checkbox> + <el-checkbox label="2">赠送金额</el-checkbox> + <el-checkbox label="3">积分</el-checkbox> + </el-checkbox-group> + </el-col> + </el-row> <el-row v-if="shopInfo.shopType==1"> <el-col :span="10"> <p class="el-big-title">产品可用门店<code>不选默认为所有门店可用</code></p> @@ -944,7 +1046,8 @@ var app = new Vue({ el: '#app', data: { - + payMethodList : ['1', '2', '3'], + dateList : [{value : 'Y', label : '年'}, {value : 'M', label : '月'}, { value : 'D' , label : '日' }], selectTreeParam: { holder: '请选择商品类型', treeData: [], @@ -1018,7 +1121,8 @@ loading_zhk: false, /******综合卡表格数据END********/ - + //提成规则 + achieveRulsList:[], //默认充值卡选中项 defaultCates: [], @@ -1052,6 +1156,7 @@ //表单数据 form: { isPresent: '否', + isCooperate: '2', staus: '上架', //产品组合 assembleGoods: [], @@ -1061,7 +1166,13 @@ cardAssembles: [], //充值卡绑定产品分类 isCourse: 'N', + isInfinite : 'N', carIsAll: '否', + useDateNum : '', + buyDateNum : '', + payMethods : '', + achieveRuleId:'', + }, submitUrl: '/admin/shoppinggoods/addShoppingGoods', modifySubmitUrl: '/admin/shoppinggoods/modifyShoppingGoods', @@ -1070,13 +1181,7 @@ name: [{required: true, message: '请输入商品名称', trigger: 'blur'}], code: [{required: true, message: '请输入商品编码', trigger: 'blur'}], cateId: [{required: true, message: '请选择商品分类', trigger: 'blur'}], - goodsSortId: [{required: true, message: '请选择库存分类', trigger: 'blur'}], - unit: [{required: true, message: '请填写规格', trigger: 'change'}], - volume: [{required: true, message: '请填写容量', trigger: 'blur'}], - measure: [{required: true, message: '请填写单位', trigger: 'change'}], - isCourse: [{required: true, message: '请选择套餐类型', trigger: 'change'}], sealPice: [{required: true, message: '请填写售价', trigger: 'blur'}], - timeLength: [{required: true, message: '请填写服务时长', trigger: 'blur'}], }, }, @@ -1090,6 +1195,7 @@ this.getGoodstype(); this.getDictionary(); this.getShopInfo(); + this.getAchieveRule(); if(goodType=='家居产品'){ this.getSupplierList(); } @@ -1108,6 +1214,21 @@ }, methods: { + + /** + * 获取规则 + */ + getAchieveRule(){ + let _this = this; + AjaxProxy.requst({ + app: _this, + data: {pageNum:1,pageSize:1000}, + url: basePath + "/admin/achieveRule/selectList", + callback: function (data) { + _this.achieveRulsList=data.rows; + } + }); + }, /** * 商品分类树形组件格式化 @@ -1471,15 +1592,20 @@ _this.form.useShop=_this.form.useShop.join(","); } + if (_this.payMethodList.length != 0) { + _this.form.payMethods = this.payMethodList.join(","); + } else { + _this.form.payMethods = ''; + } if (this.validFormData()) { this.$refs[formName].validate((valid) => { - + console.log(valid); if (valid) { - if ( _this.form.goodType == '套餐' && _this.form.isCourse == 'Y' && !_this.form.carUseCount) { + if ( _this.form.goodType == '套餐' && _this.form.isCourse == 'Y' && _this.form.isInfinite == 'N' && !_this.form.carUseCount) { this.$message.error('请输入套餐最大使用次数!'); _this.submiting = false; return false; @@ -1564,16 +1690,14 @@ ue.setContent(_this.form.description, true); } _this.form.useShop=MTools.strToArray(_this.form.useShop,",",true); - + _this.payMethodList = MTools.strToArray(_this.form.payMethods,",",false); _this.fileList[0].url = _this.form.img; _this.defaultCates = data.mapInfo.cates; _this.userAdbleEdit(); //如果是总产品加载总部分类信息 - _this.getShoppinggoodscategory(1); + // _this.getShoppinggoodscategory(1); _this.getGoodstype(1); - - } }); }, diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html index e3e4b38..9efa91b 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html @@ -62,6 +62,16 @@ <option value=''>请选择项目状态</option> </select> </div> + <div class="form-group mr-20"> + <label for="staus">业绩规则</label> + <select class="form-control autoFull" name="achieveRuleId" + data-filed="name" + data-value="id" + th:data-url="@{/admin/achieveRule/selectListForm}" + data-param="{pageNum:1,pageSize:1000}"> + <option value=''>请选择业绩规则</option> + </select> + </div> <div class="form-group mr-20"> <label for="isPresent">是否赠送</label> @@ -105,16 +115,17 @@ <tr> <th data-checkbox="true"></th> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> - <th data-field="code">商品编号</th> - <th data-field="name">商品名称</th> - <th data-field="sealPice">售价/(本金)</th> + <th data-field="code" data-sortable="true">商品编号</th> + <th data-field="name" data-sortable="true">商品名称</th> + <th data-field="sealPice" data-sortable="true">售价/(本金)</th> <th data-field="giftMoney">赠送金额</th> - <th data-field="realSealCount">真实销量</th> - <th data-field="staus">状态</th> + <th data-field="realSealCount" data-sortable="true">真实销量</th> + <th data-field="staus" data-sortable="true">状态</th> <th data-field="isPresent">是否赠送</th> - <th data-field="goodType">类型</th> + <th data-field="goodType" data-sortable="true">类型</th> <th data-field="cateName">分类</th> - <th data-field="createTime" data-formatter="MGrid.getTime">创建时间</th> + <th data-field="achieveRuleName" >业绩规则</th> + <th data-field="createTime" data-sortable="true" data-formatter="MGrid.getTime">创建时间</th> </tr> </thead> </table> @@ -140,7 +151,7 @@ delUrl = basePath + "/admin/shoppinggoods/del"; myGrid = MGrid.initGrid({ - url: basePath + "/admin/shoppinggoods/showList", + url: basePath + "/admin/shoppinggoods/showAllList", delUrl: delUrl }); }); diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html index 0e1ef0e..b15b2d8 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html @@ -63,6 +63,16 @@ <option value=''>请选择项目状态</option> </select> </div> + <div class="form-group mr-20"> + <label for="staus">业绩规则</label> + <select class="form-control autoFull" name="achieveRuleId" + data-filed="name" + data-value="id" + th:data-url="@{/admin/achieveRule/selectListForm}" + data-param="{pageNum:1,pageSize:1000}"> + <option value=''>请选择业绩规则</option> + </select> + </div> <div class="form-group mr-20"> <label for="isPresent">是否赠送</label> @@ -101,16 +111,17 @@ <tr> <th data-checkbox="true"></th> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> - <th data-field="code">商品编号</th> - <th data-field="name">商品名称</th> - <th data-field="sealPice">售价/(本金)</th> + <th data-field="code" data-sortable="true">商品编号</th> + <th data-field="name" data-sortable="true">商品名称</th> + <th data-field="sealPice" data-sortable="true">售价/(本金)</th> <th data-field="giftMoney">赠送金额</th> - <th data-field="realSealCount">真实销量</th> - <th data-field="staus">状态</th> + <th data-field="realSealCount" data-sortable="true">真实销量</th> + <th data-field="staus" data-sortable="true">状态</th> <th data-field="isPresent">是否赠送</th> - <th data-field="goodType">类型</th> - <th data-field="cateName">分类</th> - <th data-field="createTime" data-formatter="MGrid.getTime">创建时间</th> + <th data-field="goodType" data-sortable="true">类型</th> + <th data-field="cateName" >分类</th> + <th data-field="achieveRuleName" >业绩规则</th> + <th data-field="createTime" data-sortable="true" data-formatter="MGrid.getTime">创建时间</th> </tr> </thead> </table> @@ -136,7 +147,7 @@ delUrl = basePath + "/admin/shoppinggoods/del"; myGrid = MGrid.initGrid({ - url: basePath + "/admin/shoppinggoods/showList", + url: basePath + "/admin/shoppinggoods/showAllList", delUrl: delUrl }); }); diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/custom-consume-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/custom-consume-list.html new file mode 100644 index 0000000..05550de --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/custom-consume-list.html @@ -0,0 +1,161 @@ + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + +</head> +<body class="gray-bg"> + + + <div class="ibox-content"> + <!-- 搜索框部分start --> + <form class="form-inline" id="serchform"> + <div class="form-group mr-20"> + <label>日期范围</label> + <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- + <input name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + </div> + + <div class="form-group mr-20"> + <label>会员</label> + <input autocomplete="off" placeholder="姓名/编号/电话" name="vipName" type="text" class="form-control" > + </div> + + <div class="form-group mr-20"> + <label>美疗师</label> + <select class="form-control autoFull select2" + th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" + data-value="suId" + data-filed="suName" + name="beaultId" + id="beaultId"> + <option value="">--请选择美容师--</option> + </select> + </div> + + <div class="form-group mr-20"> + <label>门店</label> + <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" + th:data-url="@{/admin/shopInfo/findAllWithPermi}"> + <option value=''>--请选择部所属门店--</option> + </select> + </div> + + <div class="form-group mr-20"> + <label> + <input type="checkbox" name="t1"> 指定客 + </label> + </div> + + <div class="row mb-10"> + <div class="col-sm-8"> + <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> + <button type="reset" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> +<!-- <button matrix:btn="ygyjbb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>--> + </div> + </div> + </form> + + + <table id="mgrid"> + <thead> + <tr> + <th data-formatter="MGrid.indexfn" data-align="center" + data-width="30px">序号</th> + <th data-field="vipName" data-formatter="buildVipNameJump">姓名</th> + <th data-field="meiliao">美疗师</th> + <th data-field="arriveCnt">到店次数</th> + <th data-field="goodsCash" data-formatter="countColumn">消费金额</th> + <th data-field="hisConsume" data-formatter="countColumn">消耗本金</th> + <th data-field="freeConsume" data-formatter="countColumn">消耗赠送</th> + + </tr> + </thead> + </table> + </div> + + <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/public.js}"></script> + <script type="text/javascript"> + var myGrid; + var initParam = { + format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss" + minView: "hour", //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour" + } + MTools.ininDatetimepicker(initParam); + //限制结束时间不小于开始时间 + MTools.limitStartEndTime({}); + + $(function() { + MTools.autoFullSelect(); + $(".select2").select2(); + myGrid = MGrid.initGrid({ + url : basePath+"/admin/vipStatistics/vipConsumeStatistics", + showExport : true, + showFooter : false, + height:'auto', + width:'auto', + exportDataType : "basic", //basic', 'all', 'selected'. + exportTypes : [ 'excel', 'xlsx' ], //导出类型 + exportOptions : { + ignoreColumn : [ 0 ], + fileName : "客户消费统计" + MTools.getTime(), //文件名称设置 + worksheetName : 'Sheet1', //表格工作区名称 + tableName : '客户消费统计', + excelstyles : [ 'background-color', 'color', 'font-size', + 'font-weight' ], + } + }); + + $('[data-toggle="tooltip"]').tooltip() + + }); + + function footCountTitle(data) { + return "<b>合计</b>"; + }; + function countColumn(data) { + if (data) { + var resultsumQuantity = parseFloat(data).toFixed(2);//保留有效数字 + return resultsumQuantity; + } else { + return "-"; + } + }; + + function buildVipNameJump(value, row, index) { + return '<a onClick="vipDetail(\'' + row.t9 +'\')" class="text-primary " >'+value+'</a>'; + } + + function vipDetail(value) { + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + area : MUI.SIZE_M, + content : [basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ] + })); + } + + function exportExcel(){ + + var param=MForm.toUrlParam("#serchform"); + + window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param; + } + + </script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-beauty-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-beauty-list.html new file mode 100644 index 0000000..809c75c --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-beauty-list.html @@ -0,0 +1,223 @@ + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + <script type="text/javascript" th:src="@{/js/function/public.js}"></script> +</head> +<style> + .table-style { + margin: 20px 0; + padding: 20px 10px; + border: 1px solid #DCDFE6; + background-color: white; + } + .search-form { + background-color: white; + padding-top: 10px; + padding-left: 20px; + padding-bottom: 10px; + } +</style> +<body> +<div id="app" style=""> + <el-row class="search-form"> + <el-form ref="form" :model="form" inline> + <el-form-item label="日期范围"> + <el-date-picker v-model="form.timeRange" + type="datetimerange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-form-item> + <el-form-item label="业绩归属人"> + <el-select v-model="form.beaultId" placeholder="请选择"> + <el-option v-for="item in achieveUsers" + :key="item.suId" + :label="item.suName" + :value="item.suId"></el-option> + </el-select> + </el-form-item> + <el-form-item label="会员"> + <el-input v-model="form.vipQueryKey"></el-input> + </el-form-item> + + <el-form-item label="门店"> + <el-select v-model="form.shopId" placeholder="请选择所属门店"> + <el-option v-for="item in shopList" + :key="item.id" + :label="item.shopName" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + <!-- <el-button type="warning" @click="exportExcel">导出</el-button>--> + </el-form> + </el-row> + <el-row class="table-style"> + <el-table :data="tableData" style="width: 100%"> + <el-table-column type="index" width="30" fixed="left"></el-table-column> + <el-table-column prop="datatime" width="150" label="时间" fixed="left"></el-table-column> + <el-table-column prop="beautyName" label="美疗师" fixed="left"></el-table-column> + <el-table-column prop="vipName" label="客户" fixed="left"></el-table-column> + <el-table-column prop="isAppoint" label="是否指定客" width="100"> + <template slot-scope="scope"> + <span v-if="scope.row.isAppoint ==1 ">是</span> + <span v-else>否</span> + </template> + </el-table-column> + <el-table-column label="客流" align="center"> + <el-table-column prop="orderCnt" label="是否会员"> + <template slot-scope="scope"> + <span v-if="scope.row.orderCnt > 0">是</span> + <span v-else>否</span> + </template> + </el-table-column> + <el-table-column prop="arrivalWay" label="到店途径"></el-table-column> + <el-table-column prop="arriveCnt" label="当月到店次数" width="120"></el-table-column> + </el-table-column> + <el-table-column label="实操业绩" align="center"> + <el-table-column prop="projInfo" label="项目->消耗产品" width="230"></el-table-column> + <el-table-column prop="projCnt" label="项目数量"></el-table-column> + <el-table-column prop="ticheng" label="手工费"></el-table-column> + <el-table-column prop="consume" label="耗卡"></el-table-column> + </el-table-column> + <el-table-column label="现金业绩" align="center"> + <el-table-column prop="payMethods" label="消费类型" width="200"></el-table-column> + <el-table-column prop="orderType" label="特色项目"></el-table-column> + <el-table-column prop="teamPay" label="团购销售"></el-table-column> + <el-table-column prop="tcAndProjCash" label="卡项销售"></el-table-column> + <el-table-column prop="productCash" label="产品销售"></el-table-column> + <el-table-column prop="cardCash" label="会员充值"></el-table-column> + <el-table-column prop="cashPay" label="总业绩"></el-table-column> + <el-table-column prop="cardPay" label="划卡"></el-table-column> + </el-table-column> + </el-table> + <el-row style="margin-top: 10px;"> + <el-pagination + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="page.size" + layout="total, sizes, prev, pager, next, jumper" + :total="page.total"> + </el-pagination> + </el-row> + </el-row> +</div> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript"> + var vue = new Vue({ + el : "#app", + data : { + tableData : [], + shopList : [], + form : { + timeRange : '', + vipQueryKey : '', + beaultId : '', + shopId : '' + }, + page : { + currentPage : 1, + size : 10, + total : 0 + } + }, + created : function() { + this.queryTableData(); + }, + methods : { + queryTableData() { + let _this = this; + let params = {}; + let page = _this.page; + let form = _this.form; + + if (form.timeRange) { + params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):''; + params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):''; + } + params.vipQueryKey=form.vipQueryKey; + params.beaultId=form.beaultId; + params.limit = page.size; + params.offset = (page.currentPage - 1) * page.size; + AjaxProxy.requst({ + app: _this, + data: params, + url: basePath + "/admin/achieve/findDailyBeautyList", + callback: function (loj) { + _this.tableData = loj.rows; + _this.page.total = loj.total; + + _this.queryAchieveUsers(); + _this.queryShops(); + } + }); + }, + queryAchieveUsers() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/getShopStaffByRoleName', + callback: function (data) { + _this.achieveUsers = data.rows; + } + }); + }, + resetForm(formName) { + // this.$refs[formName].resetFields(); + this.form = { + timeRange : '', + vipQueryKey : '', + beaultId : '' + } + }, + search() { + this.queryTableData(); + }, + queryShops() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopInfo/findAllWithPermi', + callback: function (data) { + _this.shopList = data.rows; + } + }); + }, + handleSizeChange(val) { + this.page.size = val; + this.queryTableData(); + }, + handleCurrentChange(val) { + this.page.currentPage = val; + this.queryTableData(); + }, + } + }) +</script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new-bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new-bak.html new file mode 100644 index 0000000..3bcdc67 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new-bak.html @@ -0,0 +1,229 @@ + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + +</head> +<body class="gray-bg"> + + + <div class="ibox-content"> + <!-- 搜索框部分start --> + <form class="form-inline" id="serchform"> + <div class="row mb-10"> + <div class="col-sm-8"> + <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> + <button onclick="myGrid.resetForm()" type="button" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> + <button matrix:btn="ygyjbb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> + </div> + </div> + <div class="form-group mr-20"> + <label >选择年月</label> <select + class="form-control" name="year" id="select_year"> + <option value="">年份</option> + <option value="2010">2010</option> + <option value="2011">2011</option> + <option value="2012">2012</option> + <option value="2013">2013</option> + <option value="2014">2014</option> + <option value="2015">2015</option> + <option value="2016">2016</option> + <option value="2017">2017</option> + <option value="2018">2018</option> + <option value="2019">2019</option> + <option value="2020">2020</option> + <option value="2021">2021</option> + </select> <select class="form-control" name="month" id="select_month"> + <option value="01">1</option> + <option value="02">2</option> + <option value="03">3</option> + <option value="04">4</option> + <option value="05">5</option> + <option value="06">6</option> + <option value="07">7</option> + <option value="08">8</option> + <option value="09">9</option> + <option value="10">10</option> + <option value="11">11</option> + <option value="12">12</option> + </select> + <select class="form-control" name="day" id="select_day"> + <option value="">日</option> + <th:block th:each="i:${#numbers.sequence(1, 31)}" > + <option th:value="${i }" th:text="${i }"></option> + </th:block> + </select> + </div> + <div class="form-group mr-20"> + <label>日期范围</label> + <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- + <input name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + </div> + + <div class="form-group mr-20"> + <label>会员</label> + <input autocomplete="off" placeholder="姓名/编号/电话" name="vipQueryKey" type="text" class="form-control" > + </div> + + <div class="form-group mr-20"> + <label>业绩归属人</label> + <select class="form-control autoFull select2" + th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" + data-value="suId" + data-filed="suName" + name="beaultId" + id="beaultId"> + <option value="">--请选择--</option> + </select> + </div> + + <div class="form-group mr-20"> + <label>门店</label> + <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" + th:data-url="@{/admin/shopInfo/findAllWithPermi}"> + <option value=''>--请选择部所属门店--</option> + </select> + </div> + </form> + + + <table id="mgrid"> + <thead> + <tr> + <th data-formatter="MGrid.indexfn" data-align="center" + data-width="30px" data-footer-formatter="footCountTitle">序号</th> + <th data-field="datatime">时间</th> + <th data-field="orderNo" data-formatter="buildOpenDetail" >订单编号</th> + <th data-field="orderType">订单类型</th> + <th data-field="vipName">会员姓名</th> + <th data-field="proName">产品</th> + <th data-field="cateName">产品分类</th> + <th data-field="zkTotal" data-footer-formatter="countColumn">订单金额</th> + <th data-field="goodsCash" data-footer-formatter="countColumn">订单业绩</th> + <th data-field="payMethod">收款方式</th> + <th data-field="achieveType">业绩类型</th> + <th data-field="meiliao">员工</th> + <th data-field="hisConsume" data-footer-formatter="countColumn">本金消耗 + <i data-toggle="tooltip" data-placement="top" title="消耗金额:客户做服务时划扣的本金" class="fa fa-question-circle"></i> + </th> + <th data-field="freeConsume" data-footer-formatter="countColumn">赠送消耗 + <i data-toggle="tooltip" data-placement="top" title="赠送消耗:客户做服务时划扣的赠送金额" class="fa fa-question-circle"></i> + </th> + <th data-field="projPercentage" data-footer-formatter="countColumn">服务提成 + <i data-toggle="tooltip" data-placement="top" title="服务提成:为美疗师手动设置的项目服务提成" class="fa fa-question-circle"></i> + </th> + <th data-field="numberOfPeople" data-footer-formatter="countColumn">人头</th> + <th data-field="projNum" data-footer-formatter="countColumn">项目个数</th> + <th data-field="projTime" data-footer-formatter="countColumn">项目时间</th> + <th data-field="guwen">操作人</th> + <th data-field="shopName">门店</th> + + </tr> + </thead> + </table> + </div> + + <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/public.js}"></script> + <script type="text/javascript"> + var myGrid; + var initParam = { + format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss" + minView: "hour", //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour" + } + MTools.ininDatetimepicker(initParam); + //限制结束时间不小于开始时间 + MTools.limitStartEndTime({}); + + var date = new Date(); + var year = date.getFullYear(); + var month = date.getMonth() + 1; + var year_options = ""; + for (var i = 9; i > 0; i--) { + year_options += "<option value='" + (year - i) + "'>" + (year - i) + + "</option>"; + } + year_options += "<option value='"+year+"' selected='selected'>" + year + + "</option>"; + $("#select_year").html(year_options); + $("#select_month").find("option").each(function(row) { + var option_month = $(this).val(); + if (month == option_month) { + $(this).attr("selected", true); + } + }); + + function buildOpenDetail(value, row, index){ + var html = []; + if(row.orderType=='服务单'){ + html[0] = '<a onClick="fnPublci.showServiceOrder(1 , \'' + value +'\')" class="text-primary " >'+value+'</a>' + }else{ + html[0] = '<a onClick="fnPublci.showOrder(1 , \'' + value +'\')" class="text-primary " >'+value+'</a>' + } + + return html.join(""); + } + + + + + $(function() { + MTools.autoFullSelect(); + myGrid = MGrid.initGrid({ + url : basePath+"/admin/achieve/findDailyInfoNew", + showExport : true, + showFooter : true, + height:'auto', + width:'auto', + exportDataType : "basic", //basic', 'all', 'selected'. + exportTypes : [ 'excel', 'xlsx' ], //导出类型 + exportOptions : { + ignoreColumn : [ 0 ], + fileName : "每日单据统计" + MTools.getTime(), //文件名称设置 + worksheetName : 'Sheet1', //表格工作区名称 + tableName : '每日单据统计', + excelstyles : [ 'background-color', 'color', 'font-size', + 'font-weight' ], + } + }); + + $('[data-toggle="tooltip"]').tooltip() + + }); + + function footCountTitle(data) { + return "<b>合计</b>"; + }; + function countColumn(data) { + console.log(data) + field = this.field; + var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { + console.log(sum,row[field]); + return sum + (+row[field]); + }, 0)).toFixed(2));//保留有效数字 + return "<b>"+resultsumQuantity+"</b>"; + }; + + + function exportExcel(){ + + var param=MForm.toUrlParam("#serchform"); + + window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param; + } + + </script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html index cb72dd9..e1eed9a 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html @@ -2,219 +2,323 @@ <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> <head> -<meta charset="utf-8"> -<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> -<meta name="renderer" content="webkit|ie-comp|ie-stand"> -<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -<meta name="viewport" - content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> -<LINK rel="Bookmark" href="../images/favicon.ico"> -<!-- 本框架基本脚本和样式 --> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> - -</head> -<body class="gray-bg"> - - - <div class="ibox-content"> - <!-- 搜索框部分start --> - <form class="form-inline" id="serchform"> - <div class="row mb-10"> - <div class="col-sm-8"> - <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> - <button onclick="myGrid.resetForm()" type="button" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> - <button matrix:btn="ygyjbb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> - </div> - </div> - <div class="form-group mr-20"> - <label >选择年月</label> <select - class="form-control" name="year" id="select_year"> - <option value="">年份</option> - <option value="2010">2010</option> - <option value="2011">2011</option> - <option value="2012">2012</option> - <option value="2013">2013</option> - <option value="2014">2014</option> - <option value="2015">2015</option> - <option value="2016">2016</option> - <option value="2017">2017</option> - <option value="2018">2018</option> - <option value="2019">2019</option> - <option value="2020">2020</option> - <option value="2021">2021</option> - </select> <select class="form-control" name="month" id="select_month"> - <option value="01">1</option> - <option value="02">2</option> - <option value="03">3</option> - <option value="04">4</option> - <option value="05">5</option> - <option value="06">6</option> - <option value="07">7</option> - <option value="08">8</option> - <option value="09">9</option> - <option value="10">10</option> - <option value="11">11</option> - <option value="12">12</option> - </select> - <select class="form-control" name="day" id="select_day"> - <option value="">日</option> - <th:block th:each="i:${#numbers.sequence(1, 31)}" > - <option th:value="${i }" th:text="${i }"></option> - </th:block> - </select> - </div> - <div class="form-group mr-20"> - <label>日期范围</label> - <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- - <input name="endTime" type="text" class="form-control datetimepicker" id="endTime"> - </div> - </form> - - - <table id="mgrid"> - <thead> - <tr> - <th data-formatter="MGrid.indexfn" data-align="center" - data-width="30px" data-footer-formatter="footCountTitle">序号</th> - <th data-field="datatime">时间</th> - <th data-field="orderType">订单类型</th> - <th data-field="orderNo" data-formatter="buildOpenDetail" >订单编号</th> - <th data-field="levelName">会员级别</th> - <th data-field="vipName">姓名</th> - <th data-field="proName">项目名称</th> - <th data-field="zkTotal" data-footer-formatter="countColumn">总现金业绩 - <i data-toggle="tooltip" data-placement="top" title="总现金业绩=售卡+项目+产品" class="fa fa-question-circle"></i> - </th> - - <th data-field="cardCash" data-footer-formatter="countColumn" >售卡业绩 - <i data-toggle="tooltip" data-placement="top" title="售卡业绩:现金购买充值卡,套餐,充值的收款金额" class="fa fa-question-circle"></i> - </th> - - <th data-field="projCash" data-footer-formatter="countColumn">项目业绩 - <i data-toggle="tooltip" data-placement="top" title="项目业绩:现金购买单个项目的业绩" class="fa fa-question-circle"></i> - </th> - - <th data-field="goodsCash" data-footer-formatter="countColumn">产品业绩 - <i data-toggle="tooltip" data-placement="top" title="产品业绩:现金购买产品的业绩" class="fa fa-question-circle"></i> - </th> - - <th data-field="consume" data-footer-formatter="countColumn">余额划扣业绩 - <i data-toggle="tooltip" data-placement="top" title="余额划扣业绩:从客户的充值卡余额中划扣消费的金额" class="fa fa-question-circle"></i> - </th> - - <th data-field="hisConsume" data-footer-formatter="countColumn">本金消耗 - <i data-toggle="tooltip" data-placement="top" title="消耗金额:客户做服务时划扣的本金" class="fa fa-question-circle"></i> - </th> - <th data-field="freeConsume" data-footer-formatter="countColumn">赠送消耗 - <i data-toggle="tooltip" data-placement="top" title="赠送消耗:客户做服务时划扣的赠送金额" class="fa fa-question-circle"></i> - </th> - <th data-field="projPercentage" data-footer-formatter="countColumn">服务提成 - <i data-toggle="tooltip" data-placement="top" title="服务提成:为美疗师手动设置的项目服务提成" class="fa fa-question-circle"></i> - </th> - <th data-field="guwen">顾问</th> - <th data-field="meiliao">美疗师</th> - <th data-field="numberOfPeople" data-footer-formatter="countColumn">人头</th> - <th data-field="projNum" data-footer-formatter="countColumn">项目个数</th> - <th data-field="projTime" data-footer-formatter="countColumn">项目时间</th> - <th data-field="shopName">门店</th> - - </tr> - </thead> - </table> - </div> - - <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> + <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> <script type="text/javascript" th:src="@{/js/function/public.js}"></script> - <script type="text/javascript"> - var myGrid; - var initParam = { - format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss" - minView: "hour", //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour" +</head> +<style> + .table-style { + margin: 20px 0; + padding: 20px 10px; + border: 1px solid #DCDFE6; + background-color: white; + } + .search-form { + background-color: white; + padding-top: 10px; + padding-left: 20px; + padding-bottom: 10px; + } +</style> +<body> +<div id="app" style=""> + <el-row class="search-form"> + <el-form ref="form" :model="form" inline> + <el-form-item label="选择年月"> + <el-select v-model="form.year" style="width:120px;" placeholder="请选择年份"> + <el-option v-for="item in years" + :key="item" + :label="item" + :value="item"></el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-select v-model="form.month" style="width:120px;" placeholder="请选择月份"> + <el-option v-for="item in months" + :key="item" + :label="item" + :value="item"></el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-select v-model="form.day" style="width:120px;" placeholder="请选择日"> + <el-option v-for="item in days" + :key="item" + :label="item" + :value="item"></el-option> + </el-select> + </el-form-item> + <el-form-item label="日期范围"> + <el-date-picker v-model="form.timeRange" + type="datetimerange" + range-separator="至" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-form-item> + <el-form-item label="业绩规则" prop="achieveRuleId"> + <el-select v-model="form.achieveRuleId" filterable placeholder="请选择业绩规则"> + <el-option + v-for="item in achieveRulsList" + :key="item.id" + :label="item.name" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="会员"> + <el-input v-model="form.vipQueryKey"></el-input> + </el-form-item> + + <el-form-item label="业绩归属人"> + <el-select v-model="form.beaultId" placeholder="请选择"> + <el-option v-for="item in achieveUsers" + :key="item.suId" + :label="item.suName" + :value="item.suId"></el-option> + </el-select> + </el-form-item> + + <el-form-item label="门店"> + <el-select v-model="form.shopId" placeholder="请选择所属门店"> + <el-option v-for="item in shopList" + :key="item.id" + :label="item.shopName" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + <el-button type="warning" @click="exportExcel">导出</el-button> + </el-form> + + </el-row> + <el-row class="table-style"> + <el-table :data="tableData" style="width: 100%"> + <el-table-column type="index" width="30"></el-table-column> + <el-table-column prop="datatime" width="150" label="时间"></el-table-column> + <el-table-column prop="orderNo" width="180" label="订单编号"> + <template slot-scope="scope"> + <el-link @click="jumpOrder(scope.row.orderType, scope.row.orderNo)" type="primary">{{scope.row.orderNo}}</el-link> + </template> + </el-table-column> + <el-table-column prop="orderType" label="订单类型"></el-table-column> + <el-table-column prop="vipName" label="会员姓名"></el-table-column> + <el-table-column prop="proName" label="产品" width="200"></el-table-column> + <el-table-column prop="achieveRuleName" label="业绩规则" width="200"></el-table-column> + <el-table-column prop="cateName" label="产品分类"></el-table-column> + <el-table-column prop="zkTotal" label="订单金额"></el-table-column> + <el-table-column prop="goodsCash" label="现金"></el-table-column> + <el-table-column prop="cardCash" label="划扣"></el-table-column> + <!-- <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>--> + <el-table-column prop="meiliao" label="员工"></el-table-column> + <el-table-column v-for="(item, index) in customColumns" width="120" :key="index" :label="item.value"> + <template slot-scope="scope"> + <span v-if="item.value == scope.row.achieveType">{{scope.row.goodsCash}}</span> + </template> + </el-table-column> + <el-table-column prop="hisConsume" label="本金消耗"></el-table-column> + <el-table-column prop="freeConsume" label="赠送消耗"></el-table-column> + <el-table-column prop="projPercentage" label="服务提成"></el-table-column> + <el-table-column prop="numberOfPeople" label="人头"></el-table-column> + <el-table-column prop="projNum" label="项目个数"></el-table-column> + <el-table-column prop="projTime" label="服务时间"></el-table-column> + <el-table-column prop="guwen" label="操作人"></el-table-column> + <el-table-column prop="shopName" label="门店"></el-table-column> + </el-table> + <el-row style="margin-top: 10px;"> + <el-pagination + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="page.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="page.size" + layout="total, sizes, prev, pager, next, jumper" + :total="page.total"> + </el-pagination> + </el-row> + </el-row> +</div> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript" th:inline="javascript"> + var vue = new Vue({ + el : "#app", + data : { + tableData : [], + customColumns : [], + achieveRulsList : [], + shopList : [], + achieveUsers : [], + years : [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022], + months : ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"], + days : [], + form : { + year : '', + month : '', + day : '', + timeRange : '', + vipQueryKey : '', + beaultId : '', + achieveRuleId : '', + shopId : '' + }, + page : { + currentPage : 1, + size : 10, + total : 0 } - MTools.ininDatetimepicker(initParam); - //限制结束时间不小于开始时间 - MTools.limitStartEndTime({}); - - var date = new Date(); - var year = date.getFullYear(); - var month = date.getMonth() + 1; - var year_options = ""; - for (var i = 9; i > 0; i--) { - year_options += "<option value='" + (year - i) + "'>" + (year - i) - + "</option>"; - } - year_options += "<option value='"+year+"' selected='selected'>" + year - + "</option>"; - $("#select_year").html(year_options); - $("#select_month").find("option").each(function(row) { - var option_month = $(this).val(); - if (month == option_month) { - $(this).attr("selected", true); - } - }); + }, + created : function() { + this.initDays(); + this.queryCustomColumns(); + this.queryShops(); + this.queryAchieveUsers(); + this.getAchieveRule(); + }, + methods : { + queryTableData () { - function buildOpenDetail(value, row, index){ - var html = []; - if(row.orderType=='服务单'){ - html[0] = '<a onClick="fnPublci.showServiceOrder(1 , \'' + value +'\')" class="text-primary " >'+value+'</a>' - }else{ - html[0] = '<a onClick="fnPublci.showOrder(1 , \'' + value +'\')" class="text-primary " >'+value+'</a>' - } + let _this = this; + let form = _this.form; + let page = _this.page; + let params = {}; + params.year=form.year; + params.achieveRuleId=form.achieveRuleId; + params.month=form.month; + params.year=form.year; + params.day=form.day; + params.vipQueryKey=form.vipQueryKey; + params.beaultId=form.beaultId; + params.shopId=form.shopId; + params.limit = page.size; + params.offset = (page.currentPage - 1) * page.size; - return html.join(""); - } - - - - - $(function() { - MTools.autoFullSelect(); - myGrid = MGrid.initGrid({ - url : basePath+"/admin/achieve/findDailyInfoNew", - showExport : true, - showFooter : true, - height:'auto', - width:'auto', - exportDataType : "basic", //basic', 'all', 'selected'. - exportTypes : [ 'excel', 'xlsx' ], //导出类型 - exportOptions : { - ignoreColumn : [ 0 ], - fileName : "每日单据统计" + MTools.getTime(), //文件名称设置 - worksheetName : 'Sheet1', //表格工作区名称 - tableName : '每日单据统计', - excelstyles : [ 'background-color', 'color', 'font-size', - 'font-weight' ], + if (form.timeRange) { + params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):''; + params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):''; } - }); - $('[data-toggle="tooltip"]').tooltip() - - }); - - function footCountTitle(data) { - return "<b>合计</b>"; - }; - function countColumn(data) { - console.log(data) - field = this.field; - var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { - console.log(sum,row[field]); - return sum + (+row[field]); - }, 0)).toFixed(2));//保留有效数字 - return "<b>"+resultsumQuantity+"</b>"; - }; - - - function exportExcel(){ - - var param=MForm.toUrlParam("#serchform"); - - window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param; + AjaxProxy.requst({ + app: _this, + data: params, + url: basePath + "/admin/achieve/findDailyInfoNew", + callback: function (loj) { + _this.tableData = loj.rows; + _this.page.total = loj.total; + } + }); + }, + queryCustomColumns() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX', + callback: function (data) { + _this.customColumns = data.rows; + _this.queryTableData(); + } + }); + }, + /** + * 获取规则 + */ + getAchieveRule(){ + let _this = this; + AjaxProxy.requst({ + app: _this, + data: {pageNum:1,pageSize:1000}, + url: basePath + "/admin/achieveRule/selectList", + callback: function (data) { + _this.achieveRulsList=data.rows; + } + }); + }, + queryShops() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopInfo/findAllWithPermi', + callback: function (data) { + _this.shopList = data.rows; + } + }); + }, + queryAchieveUsers() { + let _this = this; + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/getShopStaffByRoleName?roleName=美疗师', + callback: function (data) { + _this.achieveUsers = data.rows; + } + }); + }, + resetForm(formName) { + // this.$refs[formName].resetFields(); + this.form = { + timeRange : '', + vipQueryKey : '', + beaultId : '', + shopId : '' + } + }, + search() { + this.queryTableData(); + }, + handleSizeChange(val) { + this.page.size = val; + this.queryTableData(); + }, + handleCurrentChange(val) { + this.page.currentPage = val; + this.queryTableData(); + }, + initDays() { + let _this = this; + for (var i = 1; i <= 31 ; i++) { + _this.days.push(i); + } + }, + getRequestParam() { + var form = this.form; + var params = form; + if (form.timeRange) { + params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):''; + params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):''; + } + return params; + }, + exportExcel() { + window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+MTools.jsonToUrlParam(this.getRequestParam()); + }, + jumpOrder(type, value) { + if(type=='服务单') { + fnPublci.showServiceOrder(1, value); + } else { + fnPublci.showOrder(1, value); + } + } } - - </script> + }); +</script> </body> </html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html new file mode 100644 index 0000000..7541632 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html @@ -0,0 +1,156 @@ + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + +</head> +<body class="gray-bg"> + + + <div class="ibox-content"> + <!-- 搜索框部分start --> + <form class="form-inline" id="serchform"> + <div class="form-group mr-20"> + <label>日期范围</label> + <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- + <input name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + </div> + + <div class="form-group mr-20"> + <label>门店</label> + <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" + th:data-url="@{/admin/shopInfo/findAllWithPermi}"> + <option value=''>--请选择部所属门店--</option> + </select> + </div> + + <div class="row mb-10"> + <div class="col-sm-8"> + <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> + <button type="reset" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> +<!-- <button matrix:btn="ygyjbb-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>--> + </div> + </div> + </form> + + + <table id="mgrid"> + <thead> + <tr> + <th data-formatter="MGrid.indexfn" data-align="center" + data-width="30px">序号</th> + <th data-field="dataTime">日期</th> + <th data-field="shopName">门店名称</th> + <th data-field="shouldPay" data-formatter="shouldPayFormat">应收金额</th> + <th data-field="totalPay">实收金额</th> + <th data-field="shouldPay" data-formatter="zkAmountFormat">折扣金额</th> + <th data-field="perCustomCnt">客单数</th> + <th data-field="customGoodsCnt">客品数</th> + <th data-field="cost">成本</th> + <th data-field="grossProfit">毛利</th> + <th data-field="grossProfitRate">毛利率</th> + <th data-field="wechat">微信</th> + <th data-field="alipay">支付宝</th> + <th data-field="cash">现金</th> + <th data-field="bankCard">银行卡</th> + <th data-field="tuan">团购</th> + <th data-field="cardBj">本金收款</th> + <th data-field="cardFree">赠金收款</th> + <th data-field="arrears">欠款</th> + </tr> + </thead> + </table> + </div> + + <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> + <script type="text/javascript" th:src="@{/js/function/public.js}"></script> + <script type="text/javascript"> + var myGrid; + var initParam = { + format : "yyyy-mm-dd", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss" + minView: "month", //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour" + } + MTools.ininDatetimepicker(initParam); + //限制结束时间不小于开始时间 + MTools.limitStartEndTime({}); + + $(function() { + MTools.autoFullSelect(); + $(".select2").select2(); + myGrid = MGrid.initGrid({ + url : basePath+"/admin/sysBusinessData/findDailySaleData", + showExport : true, + showFooter : false, + exportDataType : "basic", //basic', 'all', 'selected'. + exportTypes : [ 'excel', 'xlsx' ], //导出类型 + exportOptions : { + ignoreColumn : [ 0 ], + fileName : "客户消费统计" + MTools.getTime(), //文件名称设置 + worksheetName : 'Sheet1', //表格工作区名称 + tableName : '客户消费统计', + excelstyles : [ 'background-color', 'color', 'font-size', + 'font-weight' ], + } + }); + + $('[data-toggle="tooltip"]').tooltip() + + }); + + function shouldPayFormat(value, row, index) { + return row.shouldPay + row.refund; + } + + function zkAmountFormat(value, row, index) { + var result = row.shouldPay + row.refund - row.arrears - row.totalPay; + return result.toFixed(2); + } + + function footCountTitle(data) { + return "<b>合计</b>"; + }; + function countColumn(data) { + if (data) { + var resultsumQuantity = parseFloat(data).toFixed(2);//保留有效数字 + return resultsumQuantity; + } else { + return "-"; + } + }; + + function buildVipNameJump(value, row, index) { + return '<a onClick="vipDetail(\'' + row.t9 +'\')" class="text-primary " >'+value+'</a>'; + } + + function vipDetail(value) { + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + area : MUI.SIZE_M, + content : [basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ] + })); + } + + function exportExcel(){ + + var param=MForm.toUrlParam("#serchform"); + + window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param; + } + + </script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html index 98c6e83..6d0fc17 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html @@ -28,9 +28,9 @@ </div> <div class="form-group mr-20"> - <label>日期范围</label> - <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- - <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + <label>日期</label> + <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime"> +<!-- <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime">--> </div> </form> @@ -41,14 +41,27 @@ <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" data-footer-formatter="footCountTitle">序号</th> - <th data-field="time">日期</th> - <th data-field="cashPay" data-footer-formatter="countColumn">收现金额</th> - <th data-field="cardPay" data-footer-formatter="countColumn">实收余额支付</th> - <th data-field="consumePay" data-footer-formatter="countColumn">消耗金额</th> - <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="dataTime">日期</th> + <th data-field="cashPay" data-footer-formatter="countColumn">现金收款</th> + <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="" data-footer-formatter="countColumn">还款</th> + <th data-field="productAchieve" data-footer-formatter="countColumn">产品业绩</th> + <th data-field="cardAchieve" data-footer-formatter="countColumn">卡项业绩</th> <th data-field="refundCashPay" data-footer-formatter="countColumn">现金退款</th> <th data-field="refundCardPay" data-footer-formatter="countColumn">卡项退款</th> - <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="cardAmount" data-footer-formatter="countColumn">储值卡本金扣款</th> + <th data-field="cardFreeAmount" data-footer-formatter="countColumn">储值卡赠送扣款</th> + <th data-field="consumePay" data-footer-formatter="countColumn">本金消耗</th> + <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="peopleCnt" data-footer-formatter="countColumn">人头数</th> + <th data-field="projConsumeCnt" data-footer-formatter="countColumn">项目消耗数</th> + <th data-field="timeLength" data-footer-formatter="countColumn">服务时长</th> + <th data-field="perCustomCnt" data-footer-formatter="countColumn">客单数</th> + <th data-field="customGoodsCnt" data-footer-formatter="countColumn">客品数</th> + <th data-field="perCustomPrice" data-footer-formatter="countColumn">客单价</th> + <th data-field="cost" data-footer-formatter="countColumn">成本</th> + <th data-field="grossProfit" data-footer-formatter="countColumn">毛利</th> + <th data-field="grossProfitRate" data-footer-formatter="countColumn">毛利率</th> </tr> </thead> </table> @@ -69,7 +82,7 @@ $(function() { MTools.autoFullSelect(); myGrid = MGrid.initGrid({ - url : basePath+"/admin/sysBusinessData/showList", + url : basePath+"/admin/sysBusinessData/findShopBusinessesData", showExport : true, showFooter : true, height:'', @@ -91,10 +104,8 @@ return "<b>合计</b>"; }; function countColumn(data) { - console.log(data) field = this.field; var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { - console.log(sum,row[field]); return sum + (+row[field]); }, 0)).toFixed(2));//保留有效数字 return "<b>"+resultsumQuantity+"</b>"; diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html new file mode 100644 index 0000000..b77076e --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html @@ -0,0 +1,311 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> + <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> + <title></title> + <style> + .panel-body{ + overflow: hidden; + } + .buttonPanel{ + background: #ffffff; + padding: 10px 10px ; + margin: 0px 0px 10px 0px; + } + .rowPanel{ + background: #ffffff; + padding: 0px 10px ; + padding-top: 10px; + margin: 0px 0px 10px 0px; + } + .paginationStyle{ + background: #ffffff; + padding: 10px 10px; + margin: 0px 0px 10px 0px; + text-align: right; + } + </style> +</head> +<body> +<div class="panel-body" id="app"> + + <el-row class="buttonPanel"> + <el-button @click="exportExcel" type="primary" >导出</el-button> + </el-row> + + <el-row class="rowPanel" > + <el-form ref="form" :model="form" inline > + <el-form-item label="会员" prop="queryKey"> + <el-input v-model="form.queryKey" placeholder="请输入会员姓名/手机"></el-input> + </el-form-item> + + <el-form-item label="操作人" prop="oprationMan" > + <el-input v-model="form.oprationMan"></el-input> + </el-form-item> + + <el-form-item label="订单号" prop="orderNo"> + <el-input v-model="form.orderNo"></el-input> + </el-form-item> + + <el-form-item label="交易类型" prop="flowType"> + <el-select v-model="form.flowType" placeholder="请选择"> + <el-option + v-for="item in flowTypeList" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + + <el-form-item label="支付方式" prop="payMethod"> + <el-select v-model="form.payMethod" placeholder="请选择"> + <el-option + v-for="item in payMethodList" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + + <el-form-item label="时间" prop="datetimeArr"> + <el-date-picker + v-model="form.datetimeArr" + type="daterange" + range-separator="至" format="yyyy-MM-dd HH:mm" + start-placeholder="开始日期" + end-placeholder="结束日期"> + </el-date-picker> + </el-form-item> + + <el-button type="primary" @click="search" >搜索</el-button> + <el-button @click="resetForm('form')">重置</el-button> + </el-form> + </el-row> + + <el-row class="table-style" > + + <el-table id="proj" :data="table.rows" :height="height" stripe @sort-change="sortChange"> + <el-table-column + prop="orderNo" + label="订单号" + width="180"> + </el-table-column> + <el-table-column + prop="flowContent" + label="交易内容" + show-overflow-tooltip + width="240"> + </el-table-column> + <el-table-column + prop="createTime" + sortable="custom" + label="交易时间" + show-overflow-tooltip + width="180"> + </el-table-column> + <el-table-column + prop="flowType" + sortable="custom" + label="交易类型"> + </el-table-column> + <el-table-column + prop="amount" + sortable="custom" + label="交易金额"> + </el-table-column> + <el-table-column + prop="vipName" + label="会员姓名"> + </el-table-column> + <el-table-column + prop="payMethod" + sortable="custom" + label="支付方式"> + </el-table-column> + <el-table-column + prop="cardName" + sortable="custom" + label="储值卡名称"> + </el-table-column> + <el-table-column + prop="flowNo" + label="支付流水号"> + </el-table-column> + <el-table-column + prop="staffName" + label="操作人"> + </el-table-column> + <el-table-column + prop="shopName" + label="门店名称"> + </el-table-column> + <el-table-column label="操作"> + <template slot-scope="scope"> + <el-button type="text" @click="openOrder(scope.$index, scope.row)" size="small">订单详情</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + <el-row class="paginationStyle" > + <el-pagination background + @size-change="changePageSize" + @current-change="changeCurrentPage" + :current-page="table.currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="table.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="table.total"> + </el-pagination> + </el-row> + +</div> +</body> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> +<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> +<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> +<script type="text/javascript" th:inline="javascript"> + + var vue = new Vue({ + el: '#app', + data: { + table:{ + rows:[], + total:0, + pageSize:10, + currentPage:1, + }, + form:{ + name:null, + datetimeArr:'', + payMethod:'', + flowType:'', + orderNo:'', + oprationMan:'', + queryKey:'', + order:'', + sort:'' + }, + height:'calc(100vh - 240px)', + flowTypeList:[ + {value:'',label:'全部'}, + {value:'购买',label:'购买'}, + {value:'退款',label:'退款'}, + {value:'还款',label:'还款'} + ], + payMethodList:[ + {value:'',label:'全部'}, + {value:'现金',label:'现金'}, + {value:'微信',label:'微信'}, + {value:'支付宝',label:'支付宝'}, + {value:'银行卡',label:'银行卡'}, + {value:'团购',label:'团购'}, + {value:'储值卡',label:'储值卡'}, + {value:'欠款',label:'欠款'} + ], + }, + created: function () { + this.loadData(); + window.addEventListener("keydown", this.keydown); + }, + methods: { + changePageSize(val) { + this.table.pageSize = val; + this.loadData(); + }, + changeCurrentPage(val) { + this.table.currentPage = val; + this.loadData(); + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + }, + sortChange:function (column){ + if(column.order){ + if(column.order.indexOf("desc")){ + this.form.order="desc"; + }else{ + this.form.order="asc"; + } + this.form.sort=column.prop; + this.loadData(); + } + }, + loadData:function(){ + let _this = this; + let data=_this.getRequestParam(); + data.limit=_this.table.pageSize; + data.offset=_this.table.pageSize*(_this.table.currentPage-1); + AjaxProxy.requst({ + app: _this, + data:data, + url: basePath + '/admin/orderFlow/findOrderFlow', + callback: function (data) { + _this.table.rows = data.rows; + _this.table.total=data.total; + } + }); + }, + getRequestParam(){ + let _this = this; + return { + name:_this.form.name, + payMethod:_this.form.payMethod, + flowType:_this.form.flowType, + orderNo:_this.form.orderNo, + oprationMan:_this.form.oprationMan, + queryKey:_this.form.queryKey, + startTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[0]).format("YYYY-MM-DD HH:mm"):'', + endTime:_this.form.datetimeArr?moment(_this.form.datetimeArr[1]).format("YYYY-MM-DD HH:mm"):'', + shopId:_this.form.shopId, + order:_this.form.order, + sort:_this.form.sort, + } + }, + search:function(){ + this.table.currentPage=1; + this.loadData(); + }, + keydown(evt){ + if(evt.keyCode==13) { + this.search(); + } + }, + + openOrder(index,row){ + layer.full(layer.open({ + type : 2, + title : "订单详情", + maxmin : true, + content : [ basePath + '/admin/order/orderItem?id=' + row.orderId ] + })); + }, + //导出 + exportExcel(){ + window.location.href=basePath+"/admin/orderFlow/exportOrderFlowExcel?"+MTools.jsonToUrlParam(this.getRequestParam()); + } + + } + }); + + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-item.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-item.html index 73307ce..31773f5 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-item.html @@ -27,7 +27,7 @@ </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label>储值卡名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> @@ -103,18 +103,15 @@ url:basePath+"/admin/moneyCardUseStatistics/showList" }); }); - + function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/moneyCardUseStatistics/exportShowList?"+param; } - function initFunctionList() { + + function initFunctionList() { $.AjaxProxy({ a: false, c: false, diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-summary.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-summary.html index a5952d6..dc775ce 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-summary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-summary.html @@ -25,30 +25,28 @@ <button onclick="myGrid.resetForm()" type="button" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> </div> </div> - <div class="form-group mr-20"> - <label >产品名称</label> + <label>储值卡名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> +<!-- <div class="form-group mr-20">--> +<!-- <label for="parentId">商品分类</label>--> +<!-- <select class="form-control select2" size="1" name="cateId" id="parentId">--> +<!-- <option value="" selected="selected">--选择分类--</option>--> +<!-- </select>--> +<!-- </div>--> - <div class="form-group mr-20"> - <label for="parentId">商品分类</label> - <select class="form-control select2" size="1" name="cateId" id="parentId"> - <option value="" selected="selected">--选择分类--</option> - </select> - </div> - - <div class="form-group mr-20"> - <label>会员</label> - <input autocomplete="off" placeholder="姓名/编号/电话" name="vipQueryKey" type="text" class="form-control" > - </div> +<!-- <div class="form-group mr-20">--> +<!-- <label>会员</label>--> +<!-- <input autocomplete="off" placeholder="姓名/编号/电话" name="vipQueryKey" type="text" class="form-control" >--> +<!-- </div>--> - <div class="form-group mr-20"> - <label>到期时间</label><!-- 入库时间的查询增加一个查询的其实时间两个字段 --> - <input autocomplete="off" id="select_begin" name="beginTime" type="text" class="form-control datetimepicker">- - <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="select_end"> - </div> +<!-- <div class="form-group mr-20">--> +<!-- <label>到期时间</label><!– 入库时间的查询增加一个查询的其实时间两个字段 –>--> +<!-- <input autocomplete="off" id="select_begin" name="beginTime" type="text" class="form-control datetimepicker">- --> +<!-- <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="select_end">--> +<!-- </div>--> </form> <div id="option-bar" > <button matrix:btn="bedList-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> @@ -87,15 +85,12 @@ url:basePath+"/admin/moneyCardUseStatistics/summaryItemDetail" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/moneyCardUseStatistics/exportSummaryItemDetail?"+param; + } + function initFunctionList() { diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html index dd2eb32..b714909 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html @@ -27,7 +27,7 @@ </div> <div class="form-group mr-20"> <label >订单状态</label> - <select class="form-control " name="status" > + <select class="form-control " name="statu" > <option value=''>--请选择订单状态--</option> <option value='欠款'>欠款</option> <option value='待付款'>待付款</option> @@ -84,9 +84,10 @@ <th data-field="VIP_NAME" >客户名</th> <th data-field="COUNT" data-sortable="true" >购买数量</th> <th data-field="ZK_PRICE" data-sortable="true" >单价</th> + <th data-field="total" >小计</th> <th data-field="su_name" >健康顾问</th> <th data-field="pay_method" >支付方式</th> - <th data-field="status" >状态</th> + <th data-field="statu" >状态</th> </tr> </thead> </table> @@ -111,15 +112,11 @@ url:basePath+"/admin/orderStatistics/showList" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/orderStatistics/exportShowList?"+param; + } function initFunctionList() { diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-summary.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-summary.html index 2796f48..e256d5c 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-summary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-summary.html @@ -90,17 +90,13 @@ url:basePath+"/admin/orderStatistics/summaryItemDetail" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/projUseStatistics/exportSummaryItemDetail?"+param; + } + function initFunctionList() { $.AjaxProxy({ a: false, diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-item.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-item.html index 68abe4f..7fe7948 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-item.html @@ -36,14 +36,14 @@ </select> </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label >服务名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> @@ -77,15 +77,18 @@ <thead> <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" >序号</th> - <th data-field="consume_time" data-formatter="MGrid.getTime" data-sortable="true" >服务日期</th> + <th data-field="SHOP_NAME" >门店</th> + <th data-field="yy_time" data-formatter="MGrid.getTime" data-sortable="true" >预约时间</th> + <th data-field="consume_time" data-formatter="MGrid.getTime" data-sortable="true" >划扣时间</th> <th data-field="SERVICE_NO" >服务单号</th> <th data-field="PROJ_NAME" >服务名称</th> <th data-field="TYPE_NAME" >分类</th> <th data-field="VIP_NAME" >客户名</th> - <th data-field="COUNT" data-sortable="true" >次数</th> - <th data-field="PRICE" data-sortable="true" >单价</th> - <th data-field="su_name" >美疗师</th> - <th data-field="SOURCE" >来源</th> + <th data-field="COUNT" data-sortable="true" >次数</th> + <th data-field="PRICE" data-sortable="true" >划扣单价</th> + <th data-field="extract" data-sortable="true" >提成</th> + <th data-field="su_name" >美疗师</th> + <th data-field="SOURCE" >来源</th> </tr> </thead> </table> @@ -107,28 +110,28 @@ //有删除权限 var delUrl=""; myGrid=MGrid.initGrid({ - url:basePath+"/admin/serviceStatistics/showList" + url:basePath+"/admin/serviceStatistics/showList", + sortName:"yy_time", + sortOrder:"desc" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/serviceStatistics/exportShowList?"+param; + } function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-sumary.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-sumary.html index 685c269..aa6588b 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-sumary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-sumary.html @@ -26,7 +26,7 @@ </div> </div> <div class="form-group mr-20"> - <label >订单状态</label> + <label>订单状态</label> <select class="form-control " name="state" > <option value=''>--请选择订单状态--</option> <option value='待预约'>待预约</option> @@ -36,14 +36,14 @@ </select> </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label>服务名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> @@ -91,25 +91,20 @@ url:basePath+"/admin/serviceStatistics/summaryItemDetail" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } - + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/serviceStatistics/exportSummaryItemDetail?"+param; + } function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-item.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-item.html index afb532f..0df5c9d 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-item.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-item.html @@ -27,14 +27,14 @@ </div> <div class="form-group mr-20"> - <label >产品名称</label> + <label>服务名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> @@ -42,7 +42,14 @@ <label>会员</label> <input autocomplete="off" placeholder="姓名/编号/电话" name="vipQueryKey" type="text" class="form-control" > </div> - + <div class="form-group mr-20"> + <label >所属门店</label> <select + class="form-control autoFull" + data-url="/admin/shopInfo/findShops" data-value="id" + data-filed="shopName" name="shopId"> + <option value="">--请选择所属门店--</option> + </select> + </div> <div class="form-group mr-20"> <label>到期时间</label><!-- 入库时间的查询增加一个查询的其实时间两个字段 --> @@ -58,6 +65,7 @@ <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" >序号</th> <th data-field="VIP_NAME" >客户名</th> + <th data-field="SHOP_NAME" >客户所属门店</th> <th data-field="PROJ_NAME" >服务名称</th> <th data-field="FAIL_TIME" data-formatter="MGrid.getTime" data-sortable="true" >到期日期</th> <th data-field="SURPLUS_COUNT" data-sortable="true" >剩余次数</th> @@ -104,25 +112,24 @@ url:basePath+"/admin/projUseStatistics/showList" }); }); - + + function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/projUseStatistics/exportShowList?"+param; } + function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-sumary.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-sumary.html index 2ab1687..cfcd41c 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-sumary.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-sumary.html @@ -25,13 +25,13 @@ </div> </div> <div class="form-group mr-20"> - <label>产品名称</label> + <label>服务名称</label> <input autocomplete="off" name="projName" type="text" class="form-control" > </div> <div class="form-group mr-20"> - <label for="projTypeId">项目分类</label> + <label for="projTypeId">商品分类</label> <select class="form-control select2" size="1" name ="cateId" id="projTypeId"> - <option value=''>--选择项目分类--</option> + <option value=''>--选择分类--</option> </select> </div> </form> @@ -73,25 +73,23 @@ url:basePath+"/admin/projUseStatistics/summaryItemDetail" }); }); - - function exportExcel(){ - var select_begin = $("#select_begin").val(); - var select_end = $("#select_end").val(); - var select_id = $("#select_id").val(); - var goodsName = $("#goodsName").val(); - var guwen = $("#goodsName").val(); - window.location.href=basePath+"/form/furnsale/exportFurn?startTime="+select_begin+"&endTime="+select_end+"&goodsName="+goodsName+"&shopId="+select_id+"&guwen="+guwen; - } + + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/projUseStatistics/exportSummaryItemDetail?"+param; + } function initFunctionList() { $.AjaxProxy({ - a : false, - c : false - }).invoke(basePath+"/admin/projtype/all", function(loj) { + a: false, + c: false, + p: {salePlatform: '线下'} + }).invoke(basePath + "/admin/shoppinggoodscategory/all", function (loj) { $("#projTypeId").createSelectTree(loj.attr("result").rows, { - append : true, - value:"typeName" + append: true, + value: "name", }); }); } diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/store-inout-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/store-inout-list.html index 224124e..04ef257 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/store-inout-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/store-inout-list.html @@ -77,7 +77,7 @@ <th data-field="amount" data-footer-formatter="countColumn">出库数量</th> <th data-field="goodsPrice" >出库单价</th> <th data-field="totalPrice" data-footer-formatter="countColumn">出库金额</th> - <th data-field="orderNo">单据编号</th> + <th data-field="orderNo" data-formatter="buildJumpToDetailInfo" >单据编号</th> <th data-field="orderType">单据类型</th> <th data-field="batch">库存批次</th> <th data-field="userName">操作人</th> @@ -162,7 +162,38 @@ }); } + function buildJumpToDetailInfo(value, row, index) { + console.log(row) + var html = []; + if (row.orderType.indexOf("入库") > 0) { + html[0] = '<a onClick="lookInstore( \'' + row.id +'\')" class="text-primary " >'+value+'</a>'; + } else { + html[0] = '<a onClick="lookOutstore( \'' + row.id +'\')" class="text-primary " >'+value+'</a>'; + } + return html; + } + function lookInstore(id) { + layer.full( + layer.open({ + type: 2, + title: "查看入库单", + area: [MUI.SIZE_L, '400px'], + maxmin: true, + content: [basePath+'/admin/instore/lookInfo?id=' + id] + })); + } + + function lookOutstore(id){ + layer.full( + layer.open({ + type : 2, + title : "查看出库单", + area : [ MUI.SIZE_L, '400px' ], + maxmin : true, + content : [ basePath+'/admin/outstore/lookForm?id=' + id] + })); + } </script> </body> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/vip-arrears-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/vip-arrears-list.html new file mode 100644 index 0000000..5798f72 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/vip-arrears-list.html @@ -0,0 +1,79 @@ + +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<LINK rel="Bookmark" href="../images/favicon.ico"> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> +</head> +<body class="gray-bg"> + <div class="ibox-content"> + <!-- 搜索框部分start --> + <form class="form-inline" id="serchform"> + <div class="row mb-10"> + <div class="col-sm-8"> + <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> + <button onclick="myGrid.resetForm()" type="button" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> + </div> + </div> + <div class="form-group mr-20"> + <input autocomplete="off" placeholder="会员姓名/手机/编号" name="vipName" type="text" class="form-control" /> + </div> + <div class="form-group mr-20"> + <label for="staffId">健康顾问</label> + <select class="form-control autoFull select2" + th:data-url="@{/admin/shopAll}" + data-value="suId" + id="staffId" + data-filed="suName" + name="staffId"> + <option value="">--请选择顾问--</option> + </select> + </div> + </form> + <div id="option-bar" > + <button matrix:btn="bedList-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> + </div> + <table id="mgrid" data-url="" > + <thead> + <tr> + <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" >序号</th> + <th data-field="vipName">会员名称</th> + <th data-field="phone">手机号码</th> + <th data-field="shopName">所属门店</th> + <th data-field="arrears" data-sortable="true">欠款金额</th> + <th data-field="cnt" data-sortable="true">欠款订单</th> + <th data-field="staffName">所属顾问</th> + </tr> + </thead> + </table> + </div> + <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> + var myGrid; + $(function(){ + //初始化项目属性搜索列表 + MTools.autoFullSelect(); + $(".select2").select2(); + + myGrid=MGrid.initGrid({ + url:basePath+"/admin/vipStatistics/vipArrearsStatistics" + }); + }); + + // function exportExcel(){ + // var param=MForm.toUrlParam("#serchform"); + // window.location.href=basePath+"/admin/moneyCardUseStatistics/exportSummaryItemDetail?"+param; + // } + + </script> +</body> +</html> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/store/outStore-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/store/outStore-form.html index 2eee6c7..0a1d22f 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/store/outStore-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/store/outStore-form.html @@ -233,7 +233,7 @@ <el-table-column label="数量"> <template slot-scope="scope"> - <el-form-item :prop="'assembleGoods.'+ scope.$index +'.amount'" :rules="rules.count"> + <el-form-item :prop="'assembleGoods.'+ scope.$index +'.amount'" > <el-input v-model.number="scope.row.amount"></el-input> </el-form-item> </template> @@ -279,10 +279,6 @@ ], warehouseData : [ { required: true, message: '请选择仓库', trigger: 'change' } - ], - count : [ - { required: true, message: '请输入信息', trigger: 'blur' }, - { type : 'number', message: '请输入数字', trigger: 'blur' } ], }, outStoreTypeData : [], diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/store/projService-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/store/projService-list.html index 6fbfe73..df57798 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/store/projService-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/store/projService-list.html @@ -31,10 +31,7 @@ <label>客户姓名</label> <input autocomplete="off" name="vipName" id="vipName" type="text" class="form-control" > </div> - <div class="form-group mr-20"> - <label >超时时长 > </label> - <input autocomplete="off" name="isOverTime" type="text" class="form-control" placeholder="单位分钟" id="isOverTime"> - </div> + <div class="form-group mr-20"> <label >所属门店</label> <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId" diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list-bak.html b/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list-bak.html new file mode 100644 index 0000000..f547d4c --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list-bak.html @@ -0,0 +1,105 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org"> +<head> +<meta charset="utf-8"> +<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> +<meta name="renderer" content="webkit|ie-comp|ie-stand"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> +<meta http-equiv="Cache-Control" content="no-siteapp" /> +<!-- 本框架基本脚本和样式 --> +<script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> +</head> +<body> + <div class="ibox-content"> + <form class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> + + <input autocomplete="off" type="hidden" name="id" th:value="${serviceId} " > + + <table class="table table-bordered" id="waptable"> + <tbody th:each="projInfo,outList:${projInfoList}"> + + <tr class="success"> + <td colspan="6" th:text="'项目名称:'+${projInfo.name}"></td> + </tr> + <tr> + <td colspan="6"> + <table class="table"> + <thead> + <tr> + <th>序号</th> + <th>配料名称</th> + <th>推荐消耗</th> + <th>实际消耗</th> + <th>配料备注</th> + </tr> + </thead> + <tbody > + + <tr class="group" th:each="projGoods,list:${projInfo.assembleGoods}"> + <td th:text="${list.index+1}" ></td> + <td th:text="${projGoods.shoppingGoods.name}"></td> + <td > + <span th:text="${projGoods.total}+''+${projGoods.shoppingGoods.measure}"></span> + </td> + <td > + <input autocomplete="off" class="form-control" style="width: 200px;float: left;" type="text" name="amount" placeholder="实际用量" > + <span style="line-height: 30px;margin-left: 10px;" th:text="${projGoods.shoppingGoods.measure}"></span> + </td> + <td> + <input autocomplete="off" type="hidden" name="skuId" th:value="${projGoods.assembleGoodId} " > + + <input autocomplete="off" type="text" name="remark" class="form-control" placeholder="配料备注"></td> + + </tr> + </tbody> + </table> + </td> + </tr> + + </tbody> + </table> + <div class="form-group " style="position: fixed;bottom: 0px;left: 49%;z-index: 9999;background: #ffffff;text-align: center;"> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="myForm.submit()" + class="btn btn-success radius">配料完成</a> + </div> + </div> + </form> + </div> +</body> + + +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script th:inline="javascript"> + + var myForm=MForm.initForm({ + invokeUrl:basePath+"/admin/projService/endPl", + afterSubmit:function(){ + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.serviceOrderQuery(); + } + }, + }); + + var index=0; + //设置namename + $(".group").each(function(){ + + var inputs=$(this).find("input"); + inputs.each(function(){ + $(this).attr("name","outStoreItem["+index+"]."+$(this).attr("name")); + }); + index++; + }); + </script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html index 7333c1f..71c4cae 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html @@ -1,86 +1,98 @@ <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> -<meta charset="utf-8"> -<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> -<meta name="renderer" content="webkit|ie-comp|ie-stand"> -<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -<meta name="viewport" - content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> -<!-- 本框架基本脚本和样式 --> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> </head> <body> - <div class="ibox-content"> - <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> +<div class="ibox-content"> + <form class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> - <input autocomplete="off" type="hidden" name="id" th:value="${serviceId} " > + <input autocomplete="off" type="hidden" name="id" th:value="${serviceId} " > - <table class="table table-bordered" id="waptable"> - <tbody th:each="projInfo,outList:${projInfoList}"> + <table class="table table-bordered" id="waptable"> + <tbody th:each="projInfo,outList:${projInfoList}"> - <tr class="success"> - <td colspan="6" th:text="'项目名称:'+${projInfo.name}"></td> - </tr> - <tr> - <td colspan="6"> - <table class="table"> - <thead> - <tr> - <th>序号</th> - <th>配料名称</th> - <th>推荐消耗</th> - <th>实际消耗</th> - <th>配料备注</th> - </tr> - </thead> - <tbody > + <tr class="success"> + <td colspan="5" th:text="'项目名称:'+${projInfo.name}"></td> + <td colspan="1" ><button type="button" class="btn btn-primary btn-xs" th:onclick="'javascript:openPlList('+ ${outList.index} +')'">添加配料</button></td> + </tr> + <tr> + <td colspan="6"> + <table class="table"> + <thead> + <tr> + <th>序号</th> + <th>配料名称</th> + <th>推荐消耗</th> + <th>实际消耗</th> + <th>配料备注</th> + </tr> + </thead> + <tbody th:attrappend="id=${outList.index}" > - <tr class="group" th:each="projGoods,list:${projInfo.assembleGoods}"> - <td th:text="${list.index+1}" ></td> - <td th:text="${projGoods.shoppingGoods.name}"></td> - <td > - <span th:text="${projGoods.total}+''+${projGoods.shoppingGoods.measure}"></span> - </td> - <td > - <input autocomplete="off" class="form-control" style="width: 200px;float: left;" type="text" name="amount" placeholder="实际用量" > - <span style="line-height: 30px;margin-left: 10px;" th:text="${projGoods.shoppingGoods.measure}"></span> - </td> - <td> - <input autocomplete="off" type="hidden" name="skuId" th:value="${projGoods.assembleGoodId} " > + <tr class="group" th:each="projGoods,list:${projInfo.assembleGoods}"> + <td th:text="${list.index+1}" ></td> + <td th:text="${projGoods.shoppingGoods.name}"></td> + <td > + <span th:text="${projGoods.total}+''+${projGoods.shoppingGoods.measure}"></span> + </td> + <td > + <input autocomplete="off" class="form-control" style="width: 200px;float: left;" type="text" name="amount" placeholder="实际用量" > + <span style="line-height: 30px;margin-left: 10px;" th:text="${projGoods.shoppingGoods.measure}"></span> + </td> + <td><input autocomplete="off" type="hidden" name="skuId" th:value="${projGoods.assembleGoodId} " > - <input autocomplete="off" type="text" name="remark" class="form-control" placeholder="配料备注"></td> + <input autocomplete="off" type="text" name="remark" class="form-control" placeholder="配料备注"></td> - </tr> - </tbody> - </table> - </td> - </tr> + </tr> + </tbody> + </table> + </td> + </tr> - </tbody> - </table> - <div class="form-group " style="position: fixed;bottom: 0px;left: 49%;z-index: 9999;background: #ffffff;text-align: center;"> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="myForm.submit()" - class="btn btn-success radius">配料完成</a> - </div> + </tbody> + </table> + <div class="form-group " style="position: fixed;bottom: 0px;left: 49%;z-index: 9999;background: #ffffff;text-align: center;"> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="myForm.submit()" + class="btn btn-success radius">配料完成</a> </div> - </form> - </div> + </div> + </form> +</div> </body> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script th:inline="javascript"> + var plList = [[${projInfoList}]]; + var projIndex = 0; var myForm=MForm.initForm({ invokeUrl:basePath+"/admin/projService/endPl", + beforeSubmit : function() { + var fieldArray = $("#dataform").serializeArray(); + console.log(fieldArray); + }, afterSubmit:function(){ - parent.myGrid.serchData(); + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.serviceOrderQuery(); + } }, }); @@ -94,6 +106,47 @@ }); index++; }); - </script> + + function openPlList(value) { + projIndex = value; + layer.full(layer.open({ + type: 2, + title: "选择配料", + maxmin: true, + area: [MUI.SIZE_L, '450px'], + content: [basePath + '/admin/redirect/hive/instore/store-list-pl'] + })); + } + + function selectPl(rows) { + console.log(rows); + if (rows) { + var projInfo = plList[projIndex]; + var idSelect = "#"+projIndex; + var allGroup = $(".group").length; + console.log(idSelect); + var groupLength = $(idSelect + " .group").length; + for(var i = 0; i < rows.length; i++) { + var row = rows[i]; + var nextIndex = groupLength + i + 1; + var outItemIndex = allGroup + i; + var html = '<tr class="group">' + + '<td>'+ nextIndex +'</td>' + + '<td>'+ row.goods.name +'</td>' + + '<td><span></span></td>' + + '<td ><input autocomplete="off" class="form-control" style="width: 200px;float: left;" type="text" name="outStoreItem['+ outItemIndex +'].amount" placeholder="实际用量" >' + + '<span style="line-height: 30px;margin-left: 10px;">'+ row.goods.measure +'</span></td>' + + '<td><input autocomplete="off" type="hidden" name="outStoreItem['+ outItemIndex +'].skuId" value="'+ row.goods.id +'">' + + '<input autocomplete="off" type="text" name="outStoreItem['+ outItemIndex +'].remark" class="form-control" placeholder="配料备注"></td></tr>'; + + if ($(idSelect).children(':last').length <= 0) { + $(idSelect).html(html); + } else { + $(idSelect).children(':last').after(html); + } + } + } + } +</script> </body> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUse-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUse-form.html index 08ab9f2..8dc1d12 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUse-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUse-form.html @@ -71,7 +71,7 @@ <div class="form-group"> <label class="col-sm-2 control-label">充值卡备注</label> - <div class="col-sm-10"> + <div class="col-sm-4"> <textarea class="form-control" name="remark" rows="4" th:text="${obj?.remark}"></textarea> <div class="Validform_checktip"></div> </div> @@ -80,7 +80,7 @@ <div class="form-group"> <label class="col-sm-2 control-label">本次修改说明<span class="text-danger">*</span></label> - <div class="col-sm-10"> + <div class="col-sm-4"> <input dataType="*1-200" errormsg="修改充值卡必须填写修改说明" class="form-control" name="changeRemark"/> <div class="Validform_checktip"></div> </div> @@ -114,8 +114,14 @@ var myForm = MForm.initForm({ invokeUrl: basePath + "/admin/moneyCardUse/modify", afterSubmit: function () { - parent.myGrid.serchData(); - parent.myGrid2.serchData(); + if(parent.myGrid) { + parent.myGrid.serchData(); + parent.myGrid2.serchData(); + } + + if (parent.app) { + parent.app.refreshTable(); + } }, }); diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUseFlow-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUseFlow-list.html index aa2d486..67062b7 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUseFlow-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUseFlow-list.html @@ -16,25 +16,12 @@ </head> <body class=" container-fluid"> <div class="pd-10"> - <!-- 搜索框部分start --> - <div class="row form-head"> - <form class="form-inline" id="serchform"> - <!-- 用于套餐的查询 --> - <input autocomplete="off" type="hidden" name="vipId" value="" id="vipId"> - <div class="form-group mr-20"> - <label>操作内容</label> - <input autocomplete="off" name="content" type="text" class="form-control"> - </div> - <div class="form-group"> - <button onclick="myGrid.serchData(1)" type="button" - class="btn btn-sm btn-info"> - <i class="fa fa-search "></i> 搜索 - </button> - <button type="reset" class="btn btn-sm btn-info "> - <i class="fa fa-refresh "></i> 重置 - </button> - </div> + <div class="row form-head"> + <form class="form-inline" id="serchform2"> + <!-- 用于套餐的查询 --> + <input autocomplete="off" type="hidden" name="vipId" th:value="${param.vipId}" class="vipId"> + <input autocomplete="off" type="hidden" name="carUseId" th:value="${param.cardId}" /> </form> </div> <div class="row mt-10"> @@ -42,48 +29,46 @@ </div> <!-- 数据表格部分 --> - <table id="mgrid"> + <table id="mgrid2"> <thead> <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> - <th data-field="vipName">客户姓名</th> - <!-- - <th data-field="orderNo">订单编号/服务单编号</th> - --> - <th data-field="content" data-sortable="true">操作内容</th> - <th data-field="staffName">操作人</th> <th data-field="createTime" data-formatter="MGrid.getTime">操作时间</th> + <th data-field="cardName">充值卡名称</th> + <th data-field="vipName">客户姓名</th> + <th data-field="type">变更类型</th> + <th data-field="orderNo">单据编号</th> + <th data-field="total" data-formatter="MGrid.getYk" >本金</th> + <th data-field="giftMoney" data-formatter="MGrid.getYk" >赠送金额</th> + <th data-field="balance">余额</th> + <th data-field="times">次数</th> + <th data-field="staffName">操作人</th> + <th data-field="content" data-sortable="true">备注</th> </tr> </thead> </table> <!-- 数据表格部分end --> + <div class="form-group "> + <div class="col-sm-12 text-center fixed-button"> + <a class="btn btn-danger radius" href="javascript:;" + onclick="MTools.closeForm()"><i class="fa fa-close"></i> 关闭</a> + </div> + </div> </div> </div> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script type="text/javascript"> //初始化表格 - var myGrid; - myGrid=MGrid.initGrid({ - url:basePath+"/admin/moneyCardUseFlow/showList?vipId="+$.query.get("vipId"), + //初始化表格 + var myGrid2; + myGrid2=MGrid.initGrid({ + tableSelecter: "#mgrid2",// 表格选择器 请保持唯一 + serchFormSelecter: "#serchform2",// 搜索表单选择器 + url:basePath+"/admin/moneyCardUse/showCardFlowList", }); - function buidOperate(value, row, index){ - return html; - } - - - function getYesOrNo(value, row, index){ - switch(value){ - case 'Y': - return "是"; - case 'N': - return "否"; - default: - return value; - } - } </script> </body> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/projUse-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/projUse-form.html index 9ef758e..936a6ae 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/projUse-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/projUse-form.html @@ -38,6 +38,14 @@ </div> </div> <div class="form-group"> + <label class="col-sm-2 control-label">单次划扣<span class="text-danger">*</span></label> + <div class="col-sm-4"> + <input autocomplete="off" type="text" class="form-control" name="price" + th:value="${obj?.price}" datatype="*1-20" nullmsg="单次划扣余额不能为空"> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group"> <label class="col-sm-2 control-label">到期时间</label> <div class="col-sm-4"> <input autocomplete="off" name="failTime" type="text" datatype="*" @@ -58,9 +66,16 @@ </div> </div> <div class="form-group"> - <label class="col-sm-2 control-label">备注</label> - <div class="col-sm-10"> - <textarea class="form-control" name="remark" rows="4" th:text="${obj?.remark}" ></textarea> + <label class="col-sm-2 control-label">项目备注</label> + <div class="col-sm-4"> + <textarea class="form-control" name="remark" rows="4" th:text="${obj?.remark}" ></textarea> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group"> + <label class="col-sm-2 control-label">修改备注<span class="text-danger">*</span></label> + <div class="col-sm-4"> + <textarea datatype="*1-200" class="form-control" name="updateRemark" rows="4" ></textarea> <div class="Validform_checktip"></div> </div> </div> @@ -90,7 +105,13 @@ var myForm=MForm.initForm({ invokeUrl:basePath +"/admin/projUser/addOrModify", afterSubmit:function(){ - parent.myGrid.serchData(); + if(parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.refreshTable(); + } }, }); </script> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-form.html index acad6d3..d556c5f 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-form.html @@ -41,7 +41,7 @@ th:data-url="@{/admin/dataDictionary/showDataDictionary}" data-filed="name" data-value="name" - data-param="{type:'字段类型'}" + data-param="{type:'问卷类型'}" th:data-def="${obj?.type }" > <option value="">--请选择字段类型--</option> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-list.html index 0ee705e..d57d3a0 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/question-list.html @@ -45,7 +45,7 @@ th:data-url="@{/admin/dataDictionary/showDataDictionary}" data-filed="name" data-value="name" - data-param="{type:'字段类型'}" + data-param="{type:'问卷类型'}" > <option value="">请选择字段类型</option> </select> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/sysSkinCheckRecord-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/sysSkinCheckRecord-form.html index e41aa02..08d79ba 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/sysSkinCheckRecord-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/sysSkinCheckRecord-form.html @@ -540,7 +540,13 @@ _this.closeForm(); } }); - parent.myGrid.serchData(); + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.skinCheckQuery(); + } } }); }, diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/tc-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/tc-form.html index c0e8b27..a59a80f 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/tc-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/tc-form.html @@ -25,7 +25,15 @@ <label class="col-sm-2 control-label">套餐余额<span class="text-danger">*</span></label> <div class="col-sm-4"> <input type="text" class="form-control" name="balance" - th:value="${obj.balance}" datatype="*1-20" nullmsg="项目余次不能为空"> + th:value="${obj.balance}" datatype="*1-20" nullmsg="套餐余额不能为空"> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group"> + <label class="col-sm-2 control-label">套餐余次<span class="text-danger">*</span></label> + <div class="col-sm-4"> + <input type="text" class="form-control" name="surplusCount" + th:value="${obj.surplusCount}" datatype="*1-20" nullmsg="套餐余次不能为空"> <div class="Validform_checktip"></div> </div> </div> @@ -50,7 +58,7 @@ </div> <div class="form-group"> - <div class="col-sm-8 col-md-offset-2" id="projBox"> + <div class="col-sm-4 col-md-offset-2" id="projBox"> <table class="table table-striped table-hover table-bordered" id="mgrid"> <thead> @@ -90,9 +98,16 @@ </div> <div class="form-group"> - <label class="col-sm-2 control-label">备注</label> - <div class="col-sm-10"> - <textarea class="form-control" name="remark" rows="4" >[[${obj.remark}]]</textarea> + <label class="col-sm-2 control-label">套餐备注</label> + <div class="col-sm-4"> + <textarea class="form-control" name="remark" rows="4" th:text="${obj?.remark}" ></textarea> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group"> + <label class="col-sm-2 control-label">修改备注<span class="text-danger">*</span></label> + <div class="col-sm-4"> + <textarea datatype="*1-200" class="form-control" name="updateRemark" rows="4" ></textarea> <div class="Validform_checktip"></div> </div> </div> @@ -121,7 +136,13 @@ myForm = MForm.initForm({ invokeUrl : basePath+"/admin/taoCanUser/addOrModify", afterSubmit : function() { - parent.myGrid.serchData(); + if(parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.refreshTable(); + } }, }); }); diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-form.html index 2d7895b..4d6314b 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-form.html @@ -175,9 +175,9 @@ </div> <div class="form-group"> - <label class="col-sm-2 control-label">美疗师<span class="text-danger">*</span></label> + <label class="col-sm-2 control-label">美疗师</label> <div class="col-sm-4"> - <select class="form-control autoFull select2" dataType="*" nullmsg="请选择美疗师" + <select class="form-control autoFull select2" dataType="*" nullmsg="请选择美疗师" ignore="ignore" th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}" data-value="suId" data-filed="suName" th:data-def="${obj?.beatuyId}" name="beatuyId" @@ -217,6 +217,32 @@ <div class="Validform_checktip"></div> </div> </div> + + <div class="form-group"> + + <label class="col-sm-2 control-label">所属门店<span + class="text-danger">*</span></label> + <div class="col-sm-4"> + <select class="form-control autoFull" dataType="*" + nullmsg="所属门店不能为空" th:data-url="@{/hiveErp/shopInfo/findShopByRole}" + data-value="id" data-filed="shopName" + th:data-def="${obj?.shopId}" + name="shopId"> + <option value=''>--选择所属门店--</option> + </select> + <div class="Validform_checktip"></div> + </div> + + <label class="col-sm-2 control-label">资金密码</label> + <div class="col-sm-4"> + <input autocomplete="off" type="input" class="form-control" name="passWord" + th:value="${obj?.passWord}" datatype="*0-500" ignore="ignore"> + <div class="Validform_checktip"></div> + </div> + + </div> + + </div> </div> </div> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html index fa3bdd4..2ad4dad 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html @@ -116,12 +116,12 @@ <button matrix:btn="vipInfo-projTaocan" onclick="openTc()" type="button" class="btn btn-info btn-sm"><i class="fa fa-cubes"></i> 套餐管理</button> <button matrix:btn="vipInfo-projTaocan" onclick="openMoneyCard()" type="button" class="btn btn-info btn-sm"><i class="fa fa-credit-card"></i> 充值卡管理</button> - <button onclick="importProjUse()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 导入项目</button> + <button onclick="importProjUse()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 导入项目</button> <button matrix:fn="orderClub" onclick="openOrder()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 消费订单</button> <button matrix:fn="serviceClub" onclick="openServiceOrder()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 服务单</button> <button matrix:btn="vipInfo-add" onclick="openAdd()" type="button" class="btn btn-info btn-sm"><i class="fa fa-plus" ></i> 新增</button> - <button matrix:btn="vipInfo-excelOut" onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> + <button matrix:btn="vipInfo-exportExcel" onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> <button matrix:btn="vipInfo-allot" onclick="updateVipInfos()" type="button" class="btn btn-info btn-sm"><i class="" ></i>批量设置健康顾问</button> <button onclick="skinCheck()" type="button" class="btn btn-info btn-sm"><i class="" ></i>皮肤检测管理</button> <button onclick="importVipInfo()" type="button" class="btn btn-info btn-sm"><i class="" ></i>导入会员</button> @@ -142,6 +142,7 @@ <th data-field="vipState">会员活跃度</th> <th data-field="arrivalWay">到店途径</th> <th data-field="staffName">健康顾问</th> + <th data-field="staffName" data-formatter="buildOperation">操作</th> </tr> </thead> </table> @@ -168,6 +169,34 @@ }); }); + + var btns=[]; + btns[0]=""; + function buildOperation(value, row, index) { + var html = ""; + html += '<a class="text-info" href="javascript:void(0)" onClick="openVipDetail(\''+row.phone+'\')">查看详情</a> ' + return html; + } + + function openVipDetail(value) { + layer.full(layer.open({ + type : 2, + title : "会员详情", + area : [ MUI.SIZE_L, '450px' ], + maxmin : true, + content : [ basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ] + })); + } + + function openVipDetail2(value) { + layer.full(layer.open({ + type : 2, + title : "会员详情", + area : [ MUI.SIZE_L, '450px' ], + maxmin : true, + content : [ basePath+'/admin/redirect/hive/beautySalon/vip_detail?vipPhone=' + value ] + })); + } function updateVipInfos() { if(myGrid.getSelectItemsIds()==""){ layer.msg("请至少选择一名会员!", { @@ -190,7 +219,7 @@ * 构建会员名称 */ function getVipName(value, row, index){ - if(row.isDeal==1){ + if(row.isDeal==2){ return value+" <span class='label-danger'>新</span>" }else{ return value; @@ -373,20 +402,10 @@ } //导出 - function exportExcel() { - var name = $("#search-text").attr("name"); - var value = $("#search-text").val(); - var vipType = $("#vipType").val(); - var arrivalWay = $("#arrivalWay").val(); - var vipState = $("#vipState").val(); - var staffId = $("#staffId").val(); - window.location.href = basePath+"/admin/vipInfo/exportExcel?vipType=" - + encodeURI(encodeURI(vipType)) + "&arrivalWay=" - + encodeURI(encodeURI(arrivalWay)) + "&"+name+"=" - + encodeURI(encodeURI(value)) + "&vipState=" - + encodeURI(encodeURI(vipState)) - + "&staffId=" + staffId; - } + function exportExcel() { + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/vipInfo/exportExcel?"+param; + } </script> diff --git a/zq-erp/src/main/resources/templates/views/admin/index.html b/zq-erp/src/main/resources/templates/views/admin/index.html index 2e93ffd..1e6217d 100644 --- a/zq-erp/src/main/resources/templates/views/admin/index.html +++ b/zq-erp/src/main/resources/templates/views/admin/index.html @@ -5,7 +5,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="renderer" content="webkit"> <meta http-equiv="Cache-Control" content="no-siteapp"/> - <title>HIVE管理系统</title> + <title>讯聪管理系统</title> <!-- 本框架基本脚本和样式 --> <link rel="stylesheet" type="text/css" th:href="@{/plugin/layer/skin/layer.css}"> <script type="text/javascript" @@ -37,7 +37,7 @@ <a id="dLabel" data-toggle="dropdown" class="dropdown-toggle" href="#" aria-haspopup="true" aria-expanded="true"> <span class="clear" style="height: auto;"> <span class="block m-t-xs"> - <strong class="font-bold">HIVE</strong> + <strong class="font-bold">讯聪管理系统</strong> </span> </span> </a> @@ -85,11 +85,13 @@ </div> <div class=" hidden-xs"> <div style="text-align:right;font-size: 14px; " > - <span style="line-height: 35px; display: inline-block; " th:utext="${session.userInfo.shopName}+' | '"></span> <i class="fa fa-user" ></i> - <span style="line-height: 35px; color: #333; " th:utext="${session.userInfo.suName}"> + <span style="line-height: 35px; color: #333; " th:utext="${session.userInfo.suName}+' | '"> </span> + <a style="line-height: 35px; color: #333; " target="_blank" href="https://www.yuque.com/books/share/7b10c3aa-f289-4f36-b402-5031fbd7f038" > + <i class="fa fa-book" aria-hidden="true"></i> + 帮助手册</a> </div> </div> diff --git a/zq-erp/src/main/resources/templates/views/admin/oa/assets/fixeAssets-list.html b/zq-erp/src/main/resources/templates/views/admin/oa/assets/fixeAssets-list.html index e55eed3..35684c2 100644 --- a/zq-erp/src/main/resources/templates/views/admin/oa/assets/fixeAssets-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/oa/assets/fixeAssets-list.html @@ -55,6 +55,7 @@ <button matrix:btn="oaFixedAssets-add" onclick="openAdd()" type="button" class="btn btn-info btn-sm"><i class="fa fa-plus" ></i> 新增</button> <button matrix:btn="oaFixedAssets-edit" onclick="openEdit()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 编辑</button> <button matrix:btn="oaFixedAssets-dels" onclick="myGrid.delItems('id')" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash" ></i>批量删除</button> + <button onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> </div> <!-- 数据表格部分 --> <table id="mgrid"> @@ -115,6 +116,12 @@ content: [basePath + '/admin/oaFixedAssets/editForm?id=' + id] }); } + + function exportExcel(){ + var param=MForm.toUrlParam("#serchform"); + window.location.href=basePath+"/admin/oaFixedAssets/exportExcel?"+param; + } + </script> </body> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/logisticsImport-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/logisticsImport-form.html new file mode 100644 index 0000000..a1ea86c --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/shop/logisticsImport-form.html @@ -0,0 +1,125 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" + th:src="@{/js/systools/MBase.js}"></script> + <script src="https://cdn.jsdelivr.net/gh/jquery-form/form@4.2.2/dist/jquery.form.min.js" integrity="sha384-FzT3vTVGXqf7wRfy8k4BiyzvbNfeYjK+frTVqZeNDFl8woCbF0CYG6g2fMEFFo/i" crossorigin="anonymous"></script> +</head> +<body> +<div class="ibox-content"> + <form name="uploadExcel" + style="display: contents; margin-left: 20px;" + action="/admin/shopOrder/logisticsImport" method="post" + enctype="multipart/form-data" id="uploadForm"> + + <div class="form-group"> + <input onclick="importChances()" + class="input-text upload-url radius form-control" type="text" + id="showFileName" readonly + style="width: 200px; display: inline; margin-left: 50px;"> + <a onclick="importChances()" class="btn btn-primary radius"> + <i class="fa fa-cloud-upload"></i> 浏览文件 + </a> + <input type="file" name="file" accept=".xls,.xlsx" + id="chanceUploadId" style="display: none"> + <button type="button" onclick="download()" + class="btn btn-success radius">下载模板</button></div> + <div class="form-group "> + <div class="col-sm-12 text-center"> + + <button type="submit" onclick="return submitFile()" + class="btn btn-success radius">导入快递单</button> + <a + class="btn btn-danger radius" href="javascript:;" onclick="MTools.closeForm()" ><i class="fa fa-close"></i> 关闭</a> + </div> + </div> + </form> +</div> +</body> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script th:inline="javascript"> + MTools.autoFullSelect(); + $(".select2").select2(); + + /*<![CDATA[*/ + var obj=/*[[${obj}]]*/ + /*]]>*/ + + var invokeUrl=basePath+"/admin/shopOrder/showList"; + var myForm=MForm.initForm({ + invokeUrl:invokeUrl, + afterSubmit:function(){ + parent.myGrid.serchData(); + }, + }); + + + //绑定文件的点击事件 + function importChances() { + var file = $("#chanceUploadId").click(); + + //选中文件,文件名字显示在文本框中 + $("#chanceUploadId").change( + function() { + $("#showFileName").val(''); + var fileName = $(this).val(); + fileName = fileName.substring( + fileName.lastIndexOf("\\") + 1, fileName + .lastIndexOf(".")); + $("#showFileName").val(fileName); + }) + } + //提交文件 + function submitFile() { + if ($("#showFileName").val() == '' + || $("#showFileName").val().length < 1) { + layer.msg("请选择上传文件!", { + icon : 2 + }); + return false; + } + + layer.load(2, { + time : 100 * 1000, + shade : [ 0.4, '#aeaeae' ] + }); + + $("#uploadForm").ajaxForm(function (data) { + layer.closeAll('loading'); + console.log(data) + if (data.status == "200") { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + parent.myGrid.serchData(); + } else { + layer.open({ + title: '导入快递单,部分失败', + content: data.info + }); + var url = basePath + "/admin/shopOrder/exportLogisticsImportExcel"; + window.open(url); + parent.myGrid.serchData(); + } + $("#showFileName").val(''); + var file = $("#chanceUploadId"); + file.after(file.clone().val('')); + file.remove(); + }); + } + + + function download() { + window.location.href=basePath + "/uploadfile/image/logisticsImport.xls"; + } +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html index 751099b..0fbaf6f 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html @@ -71,6 +71,14 @@ </el-checkbox-group> </div> </div> + + <div class="form-group" v-if="paramSetting.type==5"> + <label class="col-md-2 control-label">{{paramSetting.name}}</label> + <div class="col-md-8"> + <el-input type="textarea" :rows="2" v-model="paramSetting.userValue"></el-input> + </div> + </div> + </template> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html index 020f4fc..000a29b 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html @@ -92,6 +92,34 @@ .drawer { overflow: scroll; } + + .assembly-style .el-form-item__content{ + margin-left: 0px !important; + display: flex; + align-items: center; + } + .assembly-style .el-input{ + width: 100px !important; + } + .assembly-style i{ + font-size: 30px; + } + .assembly-style .active{ + color: #409eff; + } + + .module-property{ + display: flex; + flex-wrap: wrap; + } + .module-property .el-form-item__content{ + margin-left: 0px !important; + display: flex; + align-items: center; + } + .module-property .el-input{ + width: 100px !important; + } </style> </head> <body> @@ -244,7 +272,7 @@ <el-table :data="currentNode.ads" :default-sort="{prop: '', order: 'descending'}" - style="width: 100%" max-height="250"> + style="width: 100%" > <el-table-column label="排序" @@ -320,12 +348,36 @@ </el-col>--> </el-form-item> - <el-form-item label="CSS样式"> - <el-input v-model="currentNode.nodeStyleStr"></el-input> +<!-- <el-form-item label="CSS样式">--> +<!-- <el-input v-model="currentNode.nodeStyleStr"></el-input>--> +<!-- </el-form-item>--> + <el-form-item label="组件宽高" class="assembly-style"> + <el-input v-model="zjwidth" v-on:input="widthChange"></el-input> + <i :class="selected ? 'el-icon-link active' : 'el-icon-link'" @click="fixedProportion"></i> + <el-input v-model="zjheight" v-on:input="heightChange"></el-input> </el-form-item> - <el-form-item label="节点属性"> - <el-input v-model="currentNode.nodeAttribute"></el-input> +<!-- <el-form-item label="节点属性">--> +<!-- <el-input v-model="currentNode.nodeAttribute"></el-input>--> +<!-- </el-form-item>--> + <el-form-item label="组件属性"> +<!-- 1.图片--> +<!-- 6.滑块--> +<!-- 3.轮播图--> +<!-- 4.视频--> +<!-- 5.跑马灯文字--> + <el-from class="module-property" > + <el-form-item label="自动切换时间间隔(毫秒)"> + <el-input v-model="interval"></el-input> + </el-form-item> + <el-form-item label="前边距"> + <el-input v-model="previousMargin"></el-input> + </el-form-item> + <el-form-item label="后边距"> + <el-input v-model="nextMargin"></el-input> + </el-form-item> + </el-from> </el-form-item> + <el-form-item label="页面组"> <el-input v-model="currentNode.pageCode"></el-input> @@ -366,7 +418,6 @@ <script> - var id = $.query.get("id"); @@ -390,6 +441,14 @@ pageList:[], //当前编辑页面 currentPage:{}, + zjwidth:'', + zjheight:'', + selected:false, + //宽高比 + aspectRatio:'', + interval:'', + previousMargin:'', + nextMargin:'', }, created: function () { @@ -414,8 +473,17 @@ mounted: function () { }, - methods: { + widthChange(){ + if(this.selected){ + this.zjheight = parseInt(this.zjwidth/this.aspectRatio) + } + }, + heightChange(){ + if(this.selected){ + this.zjwidth = parseInt(this.zjheight*this.aspectRatio) + } + }, getHeight() { this.height = window.innerHeight - 40 + 'px'; }, @@ -431,15 +499,32 @@ spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); + let f = e.target.files[0]; + let reader = new FileReader(); + reader.onload = function (e) { + let data = e.target.result; + //加载图片获取图片真实宽度和高度 + let image = new Image(); + image.onload=function(){ + let width = image.width; + let height = image.height; + _this.aspectRatio= width/height + }; + image.src= data; + }; + reader.readAsDataURL(f); + uploadForImage( basePath + "/admin/multipleUploadFile/doUpload", e.target.files[0], function (d, result) { + _this.process = d + "%"; if (d == 100) { if (result) { if (result.status == 200) { + loading.close(); _this.currentNode.ads[index].imgUrl = result.path; } else { @@ -512,13 +597,45 @@ }, clickNode(node) { + console.log(node) + var _this = this; this.currentNode = node; this.drawer = !this.drawer; + this.zjwidth = node.nodeStyle.width.substring(0,node.nodeStyle.width.length-2); + this.zjheight = node.nodeStyle.height.substring(0,node.nodeStyle.height.length-2); + let nodeAttribute = JSON.parse(node.nodeAttribute) + console.log(1111) + console.log(nodeAttribute) + if(nodeAttribute.interval){ + _this.interval = nodeAttribute['interval']; + _this.previousMargin = nodeAttribute['previous-margin']; + _this.nextMargin = nodeAttribute['next-margin']; + } + + + + + let image = new Image(); + image.onload = function() { + let width = image.width; // 宽 px + let height = image.height; // 高 px + _this.aspectRatio = width/height; + console.log(1111); + console.log(_this.aspectRatio); + } + if(node.ads){ + image.src = node.ads[0].imgUrl; + }else { + image.src = node.nodeValue; + } + }, //改变编辑页面,切换页面元素 changePage(index){ + this.currentPage=this.pageList[index]; + this.currentPageCode=this.pageList[index].code; this.loadPageAds(); }, loadPageAds() { @@ -534,6 +651,8 @@ if (node.nodeStyle != null && node.nodeStyle.length > 1) { node.nodeStyleStr = node.nodeStyle; node.nodeStyle = JSON.parse(node.nodeStyle); + _this.zjwidth = node.nodeStyle.width.substring(0,node.nodeStyle.width.length-2); + _this.zjheight = node.nodeStyle.height.substring(0,node.nodeStyle.height.length-2); } } _this.adNodes = data.rows; @@ -598,9 +717,18 @@ if (!this.validation(cNode)) { return false; } + let zjw = this.zjwidth; + let zjh = this.zjheight; + if(zjw != null && zjh != null){ + cNode.nodeStyleStr = '{"width":"'+zjw+'px","height":"'+zjh+'px"}'; + } + if(this.interval != null && this.previousMargin != null && this.nextMargin != null && this.interval != '' && this.previousMargin != '' && this.nextMargin != ''){ + cNode.nodeAttribute = '{\"interval\":'+this.interval+',\"previous-margin\":'+this.previousMargin+',\"next-margin\":'+this.nextMargin+'}'; + } if (cNode.nodeStyleStr != null && cNode.nodeStyleStr.length > 1) { cNode.nodeStyle = JSON.parse(cNode.nodeStyleStr); + } let data = { @@ -670,7 +798,14 @@ "1" ); }, - + fixedProportion(){ + let _this = this; + _this.selected = !_this.selected + if(_this.selected){ + _this.zjwidth = 0 + _this.zjheight = 0 + } + }, }, destroyed() { diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopCoupon-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopCoupon-form.html index d410873..7c83e1e 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopCoupon-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopCoupon-form.html @@ -143,9 +143,14 @@ <!--<span class="text-danger">*</span>--> </label> <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" name="tag" - ignore="ignore" - th:value="${obj.tag}"nullmsg="优惠券名称不能为空"> + <select class="form-control" dataType="*" nullmsg="请选择" name="tag"> + <!-- <option value=''>请选择</option>--> + <option value='zqyhq' th:if="${obj.tag == 'zqyhq'}" selected>专区券</option> + <option value='zqyhq' th:unless="${obj.tag == 'zqyhq'}">专区券</option> + <option value='gmyhq' th:if="${obj.tag == 'gmyhq'}" selected>全场券</option> + <option value='gmyhq' th:unless="${obj.tag == 'gmyhq'}">全场券</option> + </select> + </div> </div> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopDeliveryInfo-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopDeliveryInfo-list.html index 6f8ee2c..6001df2 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopDeliveryInfo-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopDeliveryInfo-list.html @@ -60,7 +60,7 @@ <div class="form-group mr-20 ml-20"> <span class="serch-title">物流公司:</span> <select class="form-control autoFull" style="width: 190px" - th:data-url="@{/wxapi/dataDictionary/getListByParentCode/kdgs}" data-value="typeCode" + th:data-url="@{/admin/customerDictionary/getListByParentCode/kdgs}" data-value="typeCode" data-filed="typeName" name="logisticsCompanyCode"> <option value=''>--请选择物流公司--</option> </select> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-form.html index 0030e60..ff23851 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-form.html @@ -94,8 +94,8 @@ <label class="col-sm-2 control-label">配送方式 </label> <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" readonly="readonly" - th:value="${orderInfo.shippingMethod}" nullmsg="订单备注不能为空"> + <input autocomplete="off" type="text" class="form-control" readonly="readonly" th:if="${orderInfo.shippingMethod==1}" th:value="物流配送" > + <input autocomplete="off" type="text" class="form-control" readonly="readonly" th:if="${orderInfo.shippingMethod==2}" th:value="门店自提" > </div> </div> <div class="form-group"> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html index 29e3350..ae18480 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html @@ -13,120 +13,113 @@ th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <style type="text/css"> + + .btn-my { + background-color: #f8ac59; + border-color: #f8ac59; + color: #fff + } + + .btn-my:hover { + background-color: #FFD19F; + border-color: #FFD19F; + color: #fff + } + + .btn-my:focus { + outline: 0 !important; + } + + .btn-my.active { + background-color: rgb(185, 136, 85); + border-color: rgb(185, 136, 85); + color: #fff; + outline: 0; + } + + </style> + + </head> <body class=" container-fluid"> <div class="pd-10"> <!-- 搜索框部分start --> + <!-- 搜索框部分start --> <div class="row form-head"> - <div class="col-md-2 col-xs-12"> - <!-- 功能按钮部分 --> - <div class=""> - <!--<button onclick="myGrid.delItems('id')" type="button"--> - <!--class="btn btn-danger btn-sm">--> - <!--<i class="fa fa-trash"></i>批量删除--> - <!--</button>--> - </div> - </div> - <div class="col-md-10 col-xs-12"> - <div class="row"> - <div class="col-md-11" style="text-align: right"> - <form class="form-inline" id="serchform"> - <div class="input-group"> - <div class="btn-group search-list " data-for="search-text"> - <button type="button" - class="btn btn-default dropdown-toggle searchlist" - data-toggle="dropdown"> - 用户姓名 <span class="caret "></span> - </button> - <ul class="dropdown-menu" role="menu"> - <li data-field="userName"><a>用户姓名</a></li> - <li data-field="userTel"><a>用户电话 </a></li> - <li data-field="orderNo"><a>订单号 </a></li> - <li data-field="storeName"><a>门店名称 </a></li> - </ul> - </div> - <div class="form-group mr-20 ml-20"> - <input autocomplete="off" id="search-text" name="userName" placeholder="输入查询关键词" - type="text" class="form-control"> - </div> - <div class="form-group"> - <button onclick="myGrid.serchData(1)" type="button" - class="btn btn-info"> - <i class="fa fa-search "></i> 搜索 - </button> - <button onclick="exportExcel()" type="button" - class="btn btn-info" - matrix:btn="order-exportExcel"> - <i class="fa fa-search "></i> 导出EXCEL - </button> - <button type="reset" class="btn btn-info "> - <i class="fa fa-refresh "></i> 重置 - </button> - <button type="reset" class="btn btn-info " onclick="applyMoney()"> - <i class="fa fa-bank "></i> 申请提现 - </button> - </div> - </div> - <!-- 高级搜索 --> - <div class="senior-content"> - <!-- <div><a class="serch-close closestyle">×</a></div> --> - <div class="serch-headline">高级搜索</div> - <div> - <div style="margin-bottom: 20px!important;"> - <div class="col-sm-6" style="text-align: right!important;"> - <label class="col-sm-12 control-label"> - 开始日期: - </label> - </div> - <div class="col-sm-6"> - <input autocomplete="off" name="orderBeginTime" readonly="readonly" - type="text" class="form-control datetimepicker" style="width: 98%"> - </div> - </div> - <div style="margin-bottom: 20px!important;"> - <div class="col-sm-6" style="text-align: right!important;"> - <label class="col-sm-12 control-label"> - 结束日期: - </label> - </div> - <div class="col-sm-6"> - <input autocomplete="off" name="orderEndTime" readonly="readonly" - type="text" class="form-control datetimepicker" style="width: 98%"> - </div> - </div> + <!-- ------------搜索服务单开始---------------- --> + <form class="form-inline" id="serchform"> - <div style="margin-bottom: 20px!important;"> - <div class="col-sm-6" style="text-align: right!important;"> - <label class="col-sm-12 control-label"> - 订单状态: - </label> - </div> - <div class="col-sm-6"> - <select class="form-control autoFull select2" dataType="*" - th:data-url="@{/admin/shopOrder/getOrderStatusSelectValue}" - data-value="code" - data-filed="name" name="orderStatus" style="width: 98%"> - <option value=''>请选择</option> - </select> - </div> - </div> - </div> - <div class="button col-sm-12"> - <button type="button" class="btn btn-sm btn-info mr20" onclick="myGrid.serchData()">确认 - </button> - <button type="button" class="btn btn-warning serch-close">取消</button> - </div> - </div> - </form> - </div> - <div class="col-md-1 text-r layui-anim" data-anim="layui-anim-up"> - <a class="senior-serch">高级搜索</a> + <div class="form-group mr-20"> + <div class="btn-group search-list " data-for="search-text"> + <button type="button" + class="btn btn-default dropdown-toggle searchlist" + data-toggle="dropdown"> + 用户姓名 <span class="caret "></span> + </button> + <ul class="dropdown-menu" role="menu"> + <li data-field="userName"><a>用户姓名</a></li> + <li data-field="userTel"><a>用户电话 </a></li> + <li data-field="orderNo"><a>订单号 </a></li> + <li data-field="storeName"><a>门店名称 </a></li> + </ul> </div> </div> - </div> + <div class="form-group mr-20"> + <input autocomplete="off" id="search-text" name="userName" placeholder="输入查询关键词" + type="text" class="form-control"> + </div> + + <div class="form-group mr-20"> + <label>开始日期:</label> + <input autocomplete="off" name="orderBeginTime" type="text" + class="form-control datetimepicker" id="orderBeginTime"> + </div> + <div class="form-group mr-20"> + <label>结束日期:</label> + <input autocomplete="off" name="orderEndTime" type="text" + class="form-control datetimepicker" id="orderEndTime"> + </div> + + <input type="hidden" value="2" name="orderStatus" id="orderStatus"/> + <div class="form-group mr-20"> + <button type="button" class="btn btn-my btn-sm" id="btn0" value="">全部</button> + <button type="button" class="btn btn-my btn-sm" id="btn1" value="1">待付款</button> + <button type="button" class="btn btn-my btn-sm active" id="btn2" value="2">待配送</button> + <button type="button" class="btn btn-my btn-sm" id="btn3" value="3">待收货</button> + <button type="button" class="btn btn-my btn-sm" id="btn4" value="4">待评价</button> + <button type="button" class="btn btn-my btn-sm" id="btn5" value="5">已评价</button> + <button type="button" class="btn btn-my btn-sm" id="btn6" value="6">申请退款</button> + <button type="button" class="btn btn-my btn-sm" id="btn7" value="7">退款成功</button> + <button type="button" class="btn btn-my btn-sm" id="btn8" value="8">退款拒绝</button> + <button type="button" class="btn btn-my btn-sm" id="btn9" value="9">已取消</button> + </div> + <div class="form-group mr-20"> + <button onclick="myGrid.serchData(1)" type="button" + class="btn btn-info"> + <i class="fa fa-search "></i> 搜索 + </button> + <button onclick="exportExcel()" type="button" + class="btn btn-info" + matrix:btn="order-exportExcel"> + <i class="fa fa-search "></i> 导出EXCEL + </button> + <button onclick="importLogisticsInfo()" type="button" + class="btn btn-info" + matrix:btn="order-exportExcel"> + <i class="fa fa-search "></i> 导入快递单 + </button> + <button type="reset" class="btn btn-info "> + <i class="fa fa-refresh "></i> 重置 + </button> + <!--<button type="reset" class="btn btn-info " onclick="applyMoney()"> + <i class="fa fa-bank "></i> 申请提现 + </button>--> + </div> + </form> </div> <div class="row"> @@ -137,18 +130,17 @@ <th data-checkbox="true"></th> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th> <th data-align="center" data-width="195px" data-field="id" data-formatter="buidOperate">操作</th> - <th data-field="userName">客户姓名</th> - <th data-field="userTel">客户电话</th> - <th data-field="storeName">店铺名称</th> + <th data-field="userName">客户</th> + <th data-field="details" data-formatter="buildDetails">购买商品</th> + <th data-field="deliveryInfo.receiveAddress" data-formatter="buildLogistics">收货信息</th> <th data-field="orderStatus" data-formatter="buildOrderStatus">订单状态</th> + <th data-field="deliveryInfo.waybillNo" data-formatter="buildDelivery">物流信息</th> <th data-field="orderTime" data-formatter="MGrid.getTime">下单时间</th> - <th data-field="purchaseQuantity">购买件数</th> <th data-field="orderMoney">订单金额</th> <th data-field="discountAmount">优惠总金额</th> - <th data-field="shippingMethod" >配送方式</th> - <th data-field="orderType" data-formatter="orderTypeFormatter">订单类型</th> <th data-field="orderNo">订单编号</th> - <th data-field="applyStatus" data-formatter="applyStatusFormatter">是否已提现</th> + <th data-field="shippingMethod" data-formatter="buildShippingMethod" >配送方式</th> + <th data-field="storeName">店铺名称</th> </tr> </thead> </table> @@ -172,6 +164,26 @@ }); + $(".btn-my").click(function () { + var btnValue = $(this).val(); + $("#orderStatus").val(btnValue); + myGrid.serchData(); + /* $("#state").val(""); */ + $(".btn-my").removeClass("active"); + $(this).addClass("active"); + }); + + function importLogisticsInfo() { + layer.open({ + type: 2, + title: "导入快递单", + area: [MUI.SIZE_L, '400px'], + content : [ basePath+'/admin/redirect/shop/logisticsImport-form'] + }); + } + + + function exportExcel() { var userName = $('input[name=userName]').val(); if (typeof userName == 'undefined') { @@ -191,7 +203,7 @@ } var orderBeginTime = $('input[name=orderBeginTime]').val(); var orderEndTime = $('input[name=orderEndTime]').val(); - var orderStatus = $('select[name=orderStatus]').val(); + var orderStatus = $('input[name=orderStatus]').val(); var url = basePath + "/admin/shopOrder/exportOrderExcel"; url += "?userName=" + userName; url += "&orderNo=" + orderNo; @@ -201,6 +213,25 @@ url += "&userTel=" + userTel; url += "&storeName=" + storeName; window.open(url); + } + + function buildDetails(value, row, index) { + var details = ""; + for(var i= 0;i<value.length;i++){ + details = details +value[i].shopProduct.title+ "("+value[i].shopSku.name+ ")*"+value[i].count+";"; + } + return details; + } + + // 发货信息 + function buildLogistics(value, row, index) { + return (row.userName==null?"":row.userName)+" <br/>"+ (row.userTel==null?"":row.userTel) +" <br/>"+value ; + } + // 物流信息 + function buildDelivery(value, row, index) { + return (row.deliveryInfo.logisticsCompanyCode==null?"":"快递编码:"+row.deliveryInfo.logisticsCompanyCode) + +" <br/>"+ (row.deliveryInfo.logisticsCompany==null?"":"快递名称:"+row.deliveryInfo.logisticsCompany) + +" <br/>"+(value==null?"":"快递单号:"+value) ; } @@ -227,6 +258,16 @@ return ""; } + function buildShippingMethod(value, row, index) { + if (value == 1) { + return "物流配送"; + } else if (value == 2) { + return "<lable class='label label-warning' >门店自取</lable>"; + }else { + return "-"; + } + } + var btns = []; btns[0] = "", btns[1] = "", btns[2] = ""; @@ -237,11 +278,16 @@ + '操作 <span class="caret"></span>' + '</button>' + '<ul class="dropdown-menu" role="menu">' + btns[0].replace('VALUE', value) + if (row.deliveryInfo.waybillNo != null && typeof row.deliveryInfo.waybillNo != 'undefined' && row.deliveryInfo.waybillNo != '') { + html += btns[3].replace('orderId',row.id).replace('waybillNo',row.deliveryInfo.waybillNo); + } if (row.orderStatus == 2) { - html += btns[1].replace('VALUE', value) + html += btns[1].replace('VALUE', value); + html += btns[4].replace('orderId',row.id); } if (row.orderStatus == 3) { - html += btns[2].replace('VALUE', value) + html += btns[2].replace('VALUE', value); + html += btns[4].replace('orderId',row.id); } html += '</ul>' + '</div>'; return html; @@ -258,6 +304,40 @@ content: [basePath + '/admin/shopOrder/editForm?id=' + id] }) ) + } + + /** + * 查看物流信息 + * @param id + */ + function showLogisticsInfo(orderId,waybillNo){ + if(waybillNo == '' || waybillNo == null){ + layer.msg("订单还未发货,暂无物流信息", { + icon : 2, + time : 2000 + }); + return false; + } + layer.open({ + type : 2, + title : "查看物流信息", + area : [ MUI.SIZE_L, '500px' ], + maxmin : true, + content : [ basePath+'/admin/redirect/shop/shopLogisticsInfo-list?orderId=' + orderId] + }); + } + /** + * 编辑物流信息 + * @param id + */ + function editDeliveryInfo(orderId){ + layer.open({ + type : 2, + title : "编辑物流信息", + area : [ MUI.SIZE_L, '500px' ], + maxmin : true, + content : [ basePath + '/admin/shopDeliveryInfo/editDeliveryInfoForm?orderId=' + orderId] + }); } //修改订单为发货 @@ -334,6 +414,8 @@ btns[0] = '<li><a href="javascript:void(0)" onClick="openEdit(\'VALUE\')" title="编辑">编辑</a></li>' btns[1] = '<li><a href="javascript:void(0)" onClick="openSendPackage(\'VALUE\')" title="开始发货">开始发货</a></li>' btns[2] = '<li><a href="javascript:void(0)" onClick="openSendPackageOver(\'VALUE\')" title="配送完成">配送完成</a></li>' +btns[3] = '<li><a href="javascript:void(0)" onclick="showLogisticsInfo(\'orderId\',\'waybillNo\')" title="查看物流">查看物流</a></li>' +btns[4] = '<li><a href="javascript:void(0)" onclick="editDeliveryInfo(\'orderId\')" title="编辑快递">编辑快递</a></li>' </script> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html index d9e813a..d3ad1c5 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html @@ -42,7 +42,7 @@ <div class="panel-heading">基本信息</div> <div class="panel-body"> <div class="form-group"> - <label class="col-sm-2 control-label">分类ID + <label class="col-sm-2 control-label">产品分类 <span class="text-danger">*</span> </label> <div class="col-sm-4"> @@ -69,6 +69,40 @@ maxLength="1000" dataType="*" th:value="${obj.briefIntroduction}" nullmsg="产品简介不能为空"> </div> + <label class="col-sm-2 control-label">是否可分销 + <span class="text-danger">*</span> + </label> + <div class="col-sm-4"> + <select th:field="${obj.ableSales}" class="form-control select2 " size="1" + name="ableSales" + id="ableSales" style="width: 100%"> + <option value="1" th:selected="${obj.ableSales == '1'}">可分销</option> + <option value="2" th:selected="${obj.ableSales == '2'}">不可分销</option> + </option> + </select> + </div> + </div> + <div class="form-group"> + <label class="col-sm-2 control-label">是否积分抵 + <span class="text-danger">*</span> + </label> + <div class="col-sm-4"> + <select th:field="${obj.ableScorePay}" class="form-control select2 " size="1" + name="ableScorePay" + id="ableScorePay" style="width: 100%"> + <option value="2" th:selected="${obj.ableScorePay == '2'}">不可抵扣</option> + <option value="1" th:selected="${obj.ableScorePay == '1'}">可抵扣</option> + </option> + </select> + </div> + <label class="col-sm-2 control-label">积分商城分类 + <span class="text-danger">*</span> + </label> + <div class="col-sm-4"> + <select class="form-control select2 " size="1" name="scoreCategoryId" + id="scoreCategoryId" style="width: 100%"> + </select> + </div> </div> <div class="form-group"> @@ -87,14 +121,7 @@ dataType="n" nullmsg="展示销量不能为空" th:value="${obj.dsVolume}" errormsg="请填写数字"> </div> - <!--<label class="col-sm-2 control-label">运费 - <span class="text-danger">*</span> - </label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" name="carriage" - maxLength="250" datatype="*" - th:value="${obj.carriage}" nullmsg="运费不能为空"> - </div>--> + </div> <div class="form-group"> <label class="col-sm-2 control-label">限购数量 @@ -117,42 +144,7 @@ </div> </div> - <div class="form-group"> - <label class="col-sm-2 control-label">是否为服务项目 - </label> - <div class="col-sm-4"> - <select th:field="${obj.isService}" class="form-control " size="1" - name="isService" - id="isService" style="width: 100%"> - <option value="2" th:selected="${obj.isService == '2'}">否</option> - <option value="1" th:selected="${obj.isService == '1'}">是</option> - </option> - - </select> - </div> - - <label class="col-sm-2 control-label">服务时长 - </label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" name="serviceTime" - maxLength="50" - th:value="${obj.serviceTime}" > - </div> - - - </div> - - <!--<div class="form-group"> - - <label class="col-sm-2 control-label">真实销量 - </label> - <div class="col-sm-4"> - <input autocomplete="off" type="text" class="form-control" name="rsVolume" - - th:value="${obj.rsVolume}" errormsg="请填写数字"> - </div> - </div>--> <div class="form-group"> <label class="col-sm-2 control-label">属性设置 </label> <input autocomplete="off" name="attrs" id="attrs" type="hidden" > @@ -204,6 +196,22 @@ </div> + + <div class="form-group"> + <label class="col-sm-2 control-label">是否虚拟产品 + </label> + <div class="col-sm-4"> + <select th:field="${obj.isUnrealProduct}" class="form-control select2 " size="1" + name="isUnrealProduct" + style="width: 100%"> + <option value="2" th:selected="${obj.isUnrealProduct == '2'}">否</option> + <option value="1" th:selected="${obj.isUnrealProduct == '1'}">是</option> + </option> + + </select> + </div> + + </div> </div> </div> </div> @@ -226,9 +234,14 @@ <th>规格图片地址<span class="text-danger">*</span></th> <th>库存<span class="text-danger">*</span></th> <th>价格<span class="text-danger">*</span></th> - <th>积分</th> + <th>消费可得积分</th> <th>关联ERP产品</th> <th>排序</th> + <th>自购返佣</th> + <th>推广提成</th> + <th>邀请提成</th> + <th>兑换所需金额</th> + <th>兑换所需积分</th> <th>操作</th> </tr> </table> @@ -357,6 +370,11 @@ <input autocomplete="off" type="hidden" class="form-control" name="erpGoodsCode"> </div></td> <td><input autocomplete="off" type="text" class="form-control" name=""></td> + <td><input autocomplete="off" type="text" class="form-control" name=""></td> + <td><input autocomplete="off" type="text" class="form-control" name=""></td> + <td><input autocomplete="off" type="text" class="form-control" name=""></td> + <td><input autocomplete="off" type="text" class="form-control" name=""></td> + <td><input autocomplete="off" type="text" class="form-control" name=""></td> <td><i class="fa fa-trash form-control-static" onclick="delThis('trId')"></i></td> </tr> </script> @@ -391,6 +409,9 @@ }); $(function () { initSeclect("#parentId",[[${obj.categoryId}]]); + initScoreSeclect("#scoreCategoryId",[[${obj.scoreCategoryId}]]); + + initAttrSeclect("#attrIds"); $("#mobileDetails").html(obj.mobileDetails); $("#pcDetails").html(obj.pcDetails); @@ -525,6 +546,27 @@ if (goodsName == null || typeof stockCode == 'undefined') { goodsName = ""; } + var selfPrice = shopSkus[c].selfPrice; + if (selfPrice == null || typeof selfPrice == 'undefined') { + selfPrice = ""; + } + var sealesPrice = shopSkus[c].sealesPrice; + if (sealesPrice == null || typeof sealesPrice == 'undefined') { + sealesPrice = ""; + } + var invitationPrice = shopSkus[c].invitationPrice; + if (invitationPrice == null || typeof invitationPrice == 'undefined') { + invitationPrice = ""; + } + var scorePrice = shopSkus[c].scorePrice; + if (scorePrice == null || typeof scorePrice == 'undefined') { + scorePrice = ""; + } + var scoreCount = shopSkus[c].scoreCount; + if (scoreCount == null || typeof scoreCount == 'undefined') { + scoreCount = ""; + } + var html= '<tr id="'+trId+'">' @@ -538,6 +580,11 @@ +'<td><div id="erpNoDiv"><button class="btn btn-info" onclick="selectProduct(\'shopIdValue\',\''+trId+'\')"><i class="fa fa-plus"></i></button>' +'<p class="form-control-static erpGoodsName">'+ goodsName +'</p><input autocomplete="off" class="form-control" type="hidden" value="'+stockCode+'" name="erpGoodsCode"></div></td>' +'<td><input autocomplete="off" type="text" class="form-control" value="'+sort+'" name=""></td>' + +'<td><input autocomplete="off" type="text" class="form-control" value="'+selfPrice+'" name=""></td>' + +'<td><input autocomplete="off" type="text" class="form-control" value="'+sealesPrice+'" name=""></td>' + +'<td><input autocomplete="off" type="text" class="form-control" value="'+invitationPrice+'" name=""></td>' + +'<td><input autocomplete="off" type="text" class="form-control" value="'+scorePrice+'" name=""></td>' + +'<td><input autocomplete="off" type="text" class="form-control" value="'+scoreCount+'" name=""></td>' +'<td><i class="fa fa-trash form-control-static" onclick="delThis(\''+trId+'\')"></i></td>' +'</tr>'; $("#skutable").find("tbody").append(html); @@ -601,10 +648,6 @@ layer.msg(result.info, { icon : 2, time : 1000, - end:function(){ - parent.myGrid.serchData(); - MTools.closeForm() - } }); return null; } @@ -617,7 +660,7 @@ //初始化属性下拉选 function initAttrSeclect(seler, def) { - $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=service", + $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=productColumn", function (loj) { $(seler).createSelectTree( loj.attr("result").rows, @@ -639,6 +682,22 @@ //初始化分类ID function initSeclect(seler, def) { $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=cpfl&status=1", + function (loj) { + $(seler).createSelectTree( + loj.attr("result").rows, + { + id: "attrId", + parent: "parentId", + value: "attrName", + append: false, + defaultValue: def, + defaultHtml: '' + }); + }); + } + //初始化分积分商城分类ID + function initScoreSeclect(seler, def) { + $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=jfsccpfl&status=1", function (loj) { $(seler).createSelectTree( loj.attr("result").rows, @@ -708,61 +767,86 @@ if (i != 0) { var tds = $(this).find("td"); var length = tds.length - 1; - var id = tds.eq(length - 8).find("input").val(); + var id = tds.eq(length - 13).find("input").val(); if(id == null){ id =""; } sku.id = id; //规格名称 - var name = tds.eq(length - 7).find("input").val(); + var name = tds.eq(length - 12).find("input").val(); if(name == null){ name = ""; } sku.name = name; //图片地址 - var path = tds.eq(length - 6).find("img").attr("src"); + var path = tds.eq(length - 11).find("img").attr("src"); if(path == null){ path = ""; } sku.imgPath = path; //库存 - var stock = tds.eq(length - 5).find("input").val(); + var stock = tds.eq(length - 10).find("input").val(); if(stock == ""){ stock = 0; } sku.stock = stock; //价格 - var price = tds.eq(length - 4).find("input").val(); + var price = tds.eq(length -9).find("input").val(); if(price == ""){ price =0; } sku.price = price; //积分 - var score = tds.eq(length - 3).find("input").val(); + var score = tds.eq(length - 8).find("input").val(); if(score == ""){ score = 0; } sku.score = score; //品种编码 - var stockCode = tds.eq(length - 2).find("input").val(); + var stockCode = tds.eq(length - 7).find("input").val(); if(stockCode == null || typeof stockCode == 'undefined'){ stockCode = ''; } sku.stockCode = stockCode; //排序 - var sort = tds.eq(length - 1).find("input").val(); + var sort = tds.eq(length - 6).find("input").val(); if(sort == ""){ sort = 0; } sku.sort = sort; + //推广提成 + var selfPrice = tds.eq(length - 5).find("input").val(); + if(selfPrice == ""){ + selfPrice = 0; + } + sku.selfPrice = selfPrice; + //推广提成 + var sealesPrice = tds.eq(length - 4).find("input").val(); + if(sealesPrice == ""){ + sealesPrice = 0; + } + sku.sealesPrice = sealesPrice; + //邀请提成 + var invitationPrice = tds.eq(length - 3).find("input").val(); + if(invitationPrice == ""){ + invitationPrice = 0; + } + sku.invitationPrice = invitationPrice; + + //兑换所需金额 + var scorePrice = tds.eq(length - 2).find("input").val(); + sku.scorePrice = scorePrice; + //兑换所需积分 + var scoreCount = tds.eq(length - 1).find("input").val(); + sku.scoreCount = scoreCount; skus.push(sku); } @@ -771,8 +855,14 @@ return skus; } + /*验证sku表格中的参数*/ function getSkusValues() { + + var ableScorePay=$("#ableScorePay").val(); + var ableSales=$("#ableSales").val(); + + var flag = false; var reg = new RegExp("(^[1-9]([0-9]+)?(\\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\\.[0-9]([0-9])?$)"); $("#skutable tbody").find("tr").each(function(i) { @@ -780,7 +870,24 @@ if (i != 0) { var tds = $(this).find("td"); var length = tds.length - 1; - var name = tds.eq(length - 7).find("input").val(); + + + if(ableScorePay==1){ + //兑换所需金额 + var scorePrice = tds.eq(length - 2).find("input").val(); + //兑换所需积分 + var scoreCount = tds.eq(length - 1).find("input").val(); + if(scorePrice == ""||scoreCount==""){ + layer.msg("请填写兑换所需金额和积分",{ + icon : 2, + time : 2000 + }); + flag = true; + return false; + } + } + + var name = tds.eq(length - 12).find("input").val(); if(name == ""){ layer.msg("请填写规格名称",{ icon : 2, @@ -797,16 +904,8 @@ flag = true; return false; } - var path = tds.eq(length - 6).find("img").attr("src"); - if(path == null){ - layer.msg("请填写规格图片",{ - icon : 2, - time : 2000 - }); - flag = true; - return false; - } - var stock = tds.eq(length - 5).find("input").val(); + + var stock = tds.eq(length -10).find("input").val(); if(stock == ""){ layer.msg("请填写库存",{ icon : 2, @@ -815,7 +914,7 @@ flag = true; return false; } - var price = tds.eq(length - 4).find("input").val(); + var price = tds.eq(length - 9 ).find("input").val(); if(price == ""){ layer.msg("请填写价格",{ icon : 2, @@ -832,15 +931,7 @@ flag = true; return false; } - var erpNo = tds.eq(length - 2).find("input").val(); - if(erpNo == ""){ - layer.msg("请填写erp产品编号,否则订单无法和erp同步",{ - icon : 2, - time : 2000 - }); - flag = true; - return false; - } + } diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html index a7e7d16..6f7468a 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html @@ -35,10 +35,18 @@ <input autocomplete="off" id="search-text" name="title" placeholder="输入查询关键词" type="text" class="form-control"> </div> - + <div class="form-group"> + <label class="control-label">积分抵扣</label> + <select style="width:100px;" class="form-control select2" size="1" + name="ableScorePay" > + <option value="">请选择</option> + <option value="1">可抵扣</option> + <option value="2">不可抵扣</option> + </select> + </div> <div class="form-group"> <label class="control-label">是否上架</label> - <select style="width:200px;" class="form-control select2" size="1" + <select style="width:100px;" class="form-control select2" size="1" name="status" id="status"> <option value="">请选择</option> @@ -47,10 +55,10 @@ </select> </div> <div class="form-group"> - <label class="control-label">是否为服务</label> - <select style="width:200px;" class="form-control select2" size="1" - name="isService" - id="isService"> + <label class="control-label">是否可分销</label> + <select style="width:100px;" class="form-control select2" size="1" + name="ableSales" + id="ableSales"> <option value="">请选择</option> <option value="1">是</option> <option value="2">否</option> @@ -114,12 +122,13 @@ <tr> <th data-checkbox="true"></th> <th data-formatter="MGrid.indexfn" data-align="center">序号</th> - <th data-field="id" data-align="center">产品ID</th> + <th data-field="id" data-align="center" >ID</th> + <th data-field="ableScorePay" data-align="center" data-formatter="ableScorePay">积分抵扣</th> <th data-field="title" data-align="center">产品名称</th> <th data-field="imgMobile" data-align="center" data-formatter="MGrid.getImage">产品图片</th> <th data-field="attrValues" data-align="center" data-formatter="formatAttr">产品属性</th> <th data-field="price" data-align="center">价格</th> - <th data-field="score" data-align="center">积分</th> + <th data-field="scorePrice" data-align="center">兑换所需积分</th> <th data-field="status" data-align="center" data-formatter="isStatus">是否上架</th> <th data-field="rsVolume" data-align="center">真实销量</th> @@ -275,7 +284,7 @@ //初始化属性下拉选 function initAttrsSeclect(seler, def) { console.log(1); - $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=cpfl", + $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=productColumn", function (loj) { $(seler).createSelectTree( loj.attr("result").rows, @@ -290,6 +299,16 @@ }); } + function ableScorePay(value, row, index) { + var html = ""; + if (value ==1) { + html="可抵扣" + }else{ + html="不可抵扣" + } + return html; + } + /** * 格式化属性 */ diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopProductComment-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopProductComment-list.html index 4bbe610..c2634e8 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopProductComment-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopProductComment-list.html @@ -52,6 +52,22 @@ <input autocomplete="off" id="search-text" name="nickName" placeholder="输入查询关键词" type="text" class="form-control"> </div> + <div class="form-group mr-20 ml-20"> + <select class="form-control select2" size="1" + name="comAuditStatus" + id="comAuditStatus" style="width: 98%"> + <option value="">请选择</option> + <option value="0" >未审核</option> + <option value="1" >审核通过</option> + <option value="2" >审核不通过</option> + </select> + </div> + <div class="form-group mr-20 ml-20"> + <input autocomplete="off" name="commentBeginTime" + type="text" class="form-control datetimepicker" > + <input autocomplete="off" name="commentEndTime" + type="text" class="form-control datetimepicker"> + </div> <div class="form-group"> <button onclick="myGrid.serchData(1)" type="button" class="btn btn-info"> @@ -62,64 +78,10 @@ </button> </div> </div> - <!-- 高级搜索 --> - <div class="senior-content"> - <!-- <div><a class="serch-close closestyle">×</a></div> --> - <div class="serch-headline">高级搜索</div> - <div> - <div style="margin-bottom: 20px!important;"> - <div class="col-sm-6" style="text-align: right!important;"> - <label class="col-sm-12 control-label"> - 开始日期: - </label> - </div> - <div class="col-sm-6"> - <input autocomplete="off" name="commentBeginTime" readonly="readonly" - type="text" class="form-control datetimepicker" style="width: 98%"> - </div> - </div> - <div style="margin-bottom: 20px!important;"> - <div class="col-sm-6" style="text-align: right!important;"> - <label class="col-sm-12 control-label"> - 结束日期: - </label> - </div> - <div class="col-sm-6"> - <input autocomplete="off" name="commentEndTime" readonly="readonly" - type="text" class="form-control datetimepicker" style="width: 98%"> - </div> - </div> - - <div style="margin-bottom: 20px!important;"> - <div class="col-sm-6" style="text-align: right!important;"> - <label class="col-sm-12 control-label"> - 审核状态: - </label> - </div> - <div class="col-sm-6"> - <select class="form-control select2" size="1" - name="comAuditStatus" - id="comAuditStatus" style="width: 98%"> - <option value="">请选择</option> - <option value="0" >未审核</option> - <option value="1" >审核通过</option> - <option value="2" >审核不通过</option> - </select> - </div> - </div> - - </div> - <div class="button col-sm-12"> - <button type="button" class="btn btn-sm btn-info mr20" onclick="myGrid.serchData()">确认</button> - <button type="button" class="btn btn-warning serch-close">取消</button> - </div> - </div> </form> </div> - <div class="col-md-1 text-r layui-anim" data-anim="layui-anim-up"> - <a class="senior-serch">高级搜索</a> - </div> + </div> </div> </div> @@ -151,7 +113,14 @@ <script type="text/javascript"> var myGrid; $(function(){ - MTools.ininDatetimepicker(".datetimepicker"); + var _initParam = {format : 'yyyy-mm-dd hh:ii', + todayBtn : true, + autoclose : true, + startView : 2, + maxView : 3, + minView : 0}; + MTools.ininDatetimepicker(_initParam); + MTools.limitStartEndTime(_initParam); var delUrl=""; delUrl=basePath+"/admin/shopProductComment/del" ; myGrid=MGrid.initGrid({ diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html index 04342bd..108bb79 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html @@ -21,14 +21,7 @@ <div class="col-md-2 col-xs-12"> <!-- 功能按钮部分 --> <div class=""> - <button onclick="setUserSales('1')" type="button" - class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> - <i class="fa fa-plus"></i>设为销售员 - </button> - <button onclick="setUserSales('0')" type="button" - class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> - <i class="fa fa-minus-square"></i> 解除销售员 - </button> + </div> </div> <div class="col-md-10 col-xs-12"> @@ -137,7 +130,7 @@ <th data-field="totalScore" data-align="center">获得总积分</th> <th data-field="currentScore" data-align="center">可兑换积分</th> <th data-field="isSales" data-align="center" data-formatter="buildIsSales">是否为销售员</th> - <th data-align="center" data-width="195px" data-field="userId" data-formatter="buildOperate">操作</th> + <th data-align="center" data-width="195px" data-field="userId" data-formatter="buildOperation">操作</th> </tr> </thead> </table> @@ -152,7 +145,7 @@ MTools.ininDatetimepicker(".datetimepicker"); var delUrl=""; myGrid=MGrid.initGrid({ - url:basePath+"/admin/bizUser/showList", + url:basePath+"/admin/vipInfo/showVipInfoList", delUrl:delUrl, }); @@ -196,66 +189,22 @@ var btns = []; btns[0] = "", btns[1] = ""; - function buildOperate(value, row, index){ + function buildOperation(value, row, index) { var html = ""; - html += '<div class="btn-group">' - if (row.userVip == 1) { - html += btns[0].replace('VALUE',value) - html += btns[1].replace('VALUE',value) - } - html += '</div>'; + html += '<a class="text-info" href="javascript:void(0)" onClick="setSalesMan(\''+row.id+'\')">设置推广员</a> ' return html; } - function exchangeScore(_userId) { - layer.open({ - type : 2, - title : "兑换积分", - area : [ MUI.SIZE_L, '400px' ], - maxmin : true, - content : [ basePath+'/admin/bizUserScore/intoExchangePage?userId=' + _userId] - }) + function setSalesMan(val) { + MTools.handleItem(basePath + "/fenXiao/fenXiaoUser/setSaleMan?id=" + val, "确定将该用户设置为推广员?", + function () { + myGrid.serchData(); + }); } - function getScoreFlow(_userId) { - layer.open({ - type : 2, - title : "积分流水", - area : [ MUI.SIZE_L, '400px' ], - maxmin : true, - content : [ basePath+'/admin/redirect/shop/user-score-flow?userId=' + _userId] - }) - } - //设置用户销售员身份 - function setUserSales(_status) { - var ids = myGrid.getSelectItemsIds("userId"); - if(ids.length < 1){ - layer.msg("请选择要操作的数据", { - icon : 5 - }); - return false; - } - var url = basePath + "/admin/bizUser/setUserSales?ids=" + ids + "&status=" + _status; +</script> - if(_status == '1'){ - MTools.handleItem(url,"确认要将这" + ids.split(",").length + "个用户设置为销售员吗?",function(){ - myGrid.serchData(1) - }); - } else { - MTools.handleItem(url,"确认要取消这" + ids.split(",").length + "个用户的销售员身份吗?",function(){ - myGrid.serchData(1) - }); - } - } -</script> -<!--权限按钮--> -<script matrix:btn="shopUser-exchangeScore"> - btns[0] = '<button type="button" class="btn btn-info mr10" onClick="exchangeScore(\'VALUE\')">兑换积分</button>' -</script> -<script matrix:btn="shopUser-scoreFlow"> - btns[1] = '<button type="button" class="btn btn-primary ml10" onClick="getScoreFlow(\'VALUE\')">查看流水</button>' -</script> </body> </html> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-form.html index a48b207..27a2914 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-form.html @@ -36,6 +36,19 @@ th:value="${obj.uuid}"nullmsg="模板id不能为空"> </div> </div> + <div class="form-group"> + <label class="col-sm-2 control-label">类型 + <span class="text-danger">*</span> + </label> + <div class="col-sm-4"> + <select class="form-control" dataType="*" nullmsg="请选择状态" name="tempType"> + <option value='1' th:if="${obj.tempType == 1}" selected>公众号</option> + <option value='1' th:unless="${obj.tempType == 1}">公众号</option> + <option value='2' th:if="${obj.tempType == 2}" selected>小程序</option> + <option value='2' th:unless="${obj.tempType == 2}">小程序</option> + </select> + </div> + </div> <div class="form-group"> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-list.html index f3c70ac..6bfb688 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-list.html @@ -86,6 +86,7 @@ <th data-field="name">名称</th> <th data-field="uuid">模板ID</th> <th data-field="dicMap.status">是否启用</th> + <th data-field="dicMap.tempType">模板类型</th> <th data-field="remark">备注</th> </tr> </thead> diff --git a/zq-erp/src/main/resources/templates/views/admin/sys/admin-form.html b/zq-erp/src/main/resources/templates/views/admin/sys/admin-form.html index a56d2cb..a797e09 100644 --- a/zq-erp/src/main/resources/templates/views/admin/sys/admin-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/sys/admin-form.html @@ -234,7 +234,7 @@ <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script th:inline="javascript"> - var invokeUrl=basePath +"/admin/addAdmin"; + var invokeUrl=basePath +"/admin/addShopAdmin"; /*<![CDATA[*/ var obj=/*[[${obj}]]*/ /*]]>*/ diff --git a/zq-erp/src/main/resources/templates/views/admin/sys/customerDataDictionary-list.html b/zq-erp/src/main/resources/templates/views/admin/sys/customerDataDictionary-list.html index 38260b0..3bf4210 100644 --- a/zq-erp/src/main/resources/templates/views/admin/sys/customerDataDictionary-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/sys/customerDataDictionary-list.html @@ -87,7 +87,7 @@ </div> <label class="col-sm-2 control-label">排序</label> <div class="col-sm-4"> - <input autocomplete="off" name="fnSequence" type="number" class="form-control" + <input autocomplete="off" name="sort" type="number" class="form-control" id="sortIndex"> </div> </div> @@ -150,7 +150,7 @@ initFunctionSelected(loj.getString(0,"parentId")); $("#id").val(loj.getString(0, "id")); $("#value").val(loj.getString(0, "value")); - $("#sort").val(loj.getString(0, "sort")); + $("#sortIndex").val(loj.getString(0, "sort")); $("#typeCode").val(loj.getString(0, "typeCode")); }); diff --git a/zq-erp/src/main/resources/templates/views/admin/sys/sysRole-form.html b/zq-erp/src/main/resources/templates/views/admin/sys/sysRole-form.html index f28fefb..1209561 100644 --- a/zq-erp/src/main/resources/templates/views/admin/sys/sysRole-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/sys/sysRole-form.html @@ -60,7 +60,13 @@ </div> </div> <div class="form-group"> - + <label class="col-sm-2 control-label">可查询所有门店客户</label> + <div class="col-sm-4"> + <select class="form-control" name="customer"> + <option th:selected="${obj?.customer == '是'}" >是</option> + <option th:selected="${obj?.customer == '否'}" >否</option> + </select> + </div> <label class="col-sm-2 control-label">是否允许门店分配本角色</label> <div class="col-sm-4"> <select class="form-control" name="shopAble"> diff --git a/zq-erp/src/main/resources/templates/views/common/login.html b/zq-erp/src/main/resources/templates/views/common/login.html index f8bf84f..5bc7de7 100644 --- a/zq-erp/src/main/resources/templates/views/common/login.html +++ b/zq-erp/src/main/resources/templates/views/common/login.html @@ -24,6 +24,7 @@ background: #fff; height: 450px; } + .download-bar { margin-top: 15px; color: #4968bd; @@ -36,10 +37,12 @@ .download-bar a:hover { text-decoration: underline; - color: #fff; + color: #4968bd; } </style> <script> + + var isoldIE = false; if (navigator.userAgent.indexOf("MSIE") > 0) { if (navigator.userAgent.indexOf("MSIE 6.0") > 0 @@ -67,7 +70,8 @@ display: block; padding: 20px 12px; width: 100%; - font-size: 14px -webkit-box-shadow: none !important; + font-size: 14px + -webkit-box-shadow: none !important; box-shadow: none !important; border-radius: 0px !important; } @@ -114,6 +118,78 @@ height: 200px; } } + + .qrloginBox { + float: right; + } + + .qrloginSpan { + background: #edf4ff; + border: 1px solid #155bd4; + position: relative; + padding: 4px 8px; + border-radius: 2px; + font-size: 14px; + color: #155bd4; + cursor: pointer; + } + + .qrImg { + width: 50px; + cursor: pointer; + } + + #qrCodeIcon { + margin: 20px auto; + text-align: center; + overflow: hidden; + width: 220px; + height: 220px; + border: 1px solid #dcd0d0; + } + + #qrCodeIcon img { + margin: 10px; + } + #scanResult{ + text-align: center; + color: #333333; + } + #scanResult{ + text-align: center; + } + #scanResult img{ + width: 50px; + margin: 50px auto; + } + #wxQrcode{ + text-align: center; + color: #333333; + width: 220px; + height: 220px; + overflow: hidden; + position: relative; + margin: 20px auto; + } + .wxQrcodeInfo{ + position: absolute; + top: 0px; + background: rgb(255 255 255 / 94%); + width: 220px; + height: 220px; + display: flex; + z-index: 999999; + justify-content: center; + align-items: center; + flex-direction: column; + } + .wxQrcodeImg{ + position: absolute; + width: 200px; + top: 10px; + z-index: 11; + left: 10px; + } </style> </head> @@ -122,33 +198,69 @@ <div class="signinpanel"> <div class="row" style="box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);"> <div class="col-sm-6"></div> - <div class="col-sm-6"> - <form method="post" class="dataForm"> - <h3 class="no-margins text-center title" style="color: #666666;font-size: 24px;font-weight: bold">欢迎登录</h3> - <div> - <input autocomplete="off" id="account" type="text" placeholder="请输入用户名" - class="form-control uname"/> - <img alt="" src="../../images/user.png"> - </div> - <br> - <div> - <input autocomplete="off" id="password" - type="password" class="form-control pword m-b" nullmsg="密码不能为空" - placeholder="请输入密码"/> - <img alt="" src="../../images/locked.png"> - </div> - <br> <br> + <div class="col-sm-6 " style="padding: 0px;"> + <div id="accountWarp"> + <div onclick="changeLoginType()" class="qrloginBox"><span class="qrloginSpan">扫码登录</span><img + class="qrImg" + src="../../images/qrcode.png"></div> + <form method="post" class="dataForm"> + <h3 class="no-margins text-center title" style="color: #666666;font-size: 24px;font-weight: bold"> + 密码登录</h3> + <div> + <input autocomplete="off" id="account" type="text" placeholder="请输入用户名" + class="form-control uname"/> + <img alt="" src="../../images/user.png"> + </div> + <br> + <div> + <input autocomplete="off" id="password" + type="password" class="form-control pword m-b" nullmsg="密码不能为空" + placeholder="请输入密码"/> + <img alt="" src="../../images/locked.png"> + </div> + <br> <br> - <button type="button" onclick="login()" style="background-color: #4f6cff;border: none;font-size: 18px;" - class="btn btn-success btn-block">登录 - </button> + <button type="button" onclick="login()" + style="background-color: #4f6cff;border: none;font-size: 18px;" + class="btn btn-success btn-block">登录 + </button> - </form> + </form> + </div> + <div id="qrCodeWarp"> + <div onclick="changeLoginType()" class="qrloginBox"><span class="qrloginSpan">密码登录</span><img + class="qrImg" + src="../../images/pc.png"></div> + <div style="border-radius: 3px; + padding: 30px;"> + <h3 class="no-margins text-center title" style="color: #666666;font-size: 24px;font-weight: bold"> + 扫码登录</h3> + <div id="qrCodeIcon"> + + </div> + <div id="wxQrcode"> + + <img class="wxQrcodeImg" src=" ../../images/qrcodeBack.png"> + <div class="wxQrcodeInfo"> + <p>二维码已失效</p> + <button onclick="flushQrcode()" class="btn btn-primary">刷新二维码</button> + </div> + + + </div> + <div id="scanResult" style="display: none"> + + <img src="../../images/dui.png"> + <p>扫描成功!</p> + <p>请在手机上根据提示确认登录</p> + </div> + </div> + </div> </div> </div> <div class="signup-footer" style="color: #4968bd;"> - <div class="" style="font-size: 16px;">HIVE管理系统V2.2.0</div> + <div class="" style="font-size: 16px;">讯聪管理系统V2.3.0</div> <div class=""> <p class="download-bar" style="font-size: 12px;"><strong>浏览器:</strong>Win7以上<a @@ -159,7 +271,9 @@ href="https://pubstorage-bucket.oss-cn-shenzhen.aliyuncs.com/tools/xp/49.0.2623.112_chrome_installer.exe " target="_blank">谷歌浏览器(推荐)</a><span>|</span><strong>打印控件:</strong><a href="https://pubstorage-bucket.oss-cn-shenzhen.aliyuncs.com/tools/CLodop_Setup_for_Win32NT_https_3.056Extend.exe" - target="_blank">下载控件</a><span>|</span> + target="_blank">下载控件</a><span>|</span><!--<strong>APP:</strong><a + href="http://testfile.hive.jyymatrix.cc/mobile/download.html" + target="_blank">下载APP客户端</a>--> </p> </div> </div> @@ -167,9 +281,46 @@ </body> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script type="text/javascript" th:src="@{/js/plugin/jsencrypt.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/qrcode.js}"></script> <script th:inline="javascript"> var crypt = new JSEncrypt(); + let loginType = 1; + $("#qrCodeWarp").hide(); + $("#wxQrcode").hide(); + function changeLoginType() { + if (loginType == 1) { + $("#accountWarp").hide(); + $("#qrCodeWarp").show(); + loginType = 2; + } else { + $("#accountWarp").show(); + $("#qrCodeWarp").hide(); + loginType = 1; + } + } + + //soket用户标识 + let webClientId = "webClientId_" + MTools.randomStr(); + let loginQrCodeKey=""; + + + markQrcode(); + function markQrcode(){ + + var qrcode = new QRCode(document.getElementById("qrCodeIcon"), { + width: 200, + height: 200 + }); + loginQrCodeKey="loginQrCodeKey_" + MTools.randomStr(); + let qrInfo={webClientId:webClientId,loginQrCodeKey:loginQrCodeKey} + qrcode.makeCode(JSON.stringify(qrInfo)); + $('#qrCodeIcon canvas').show(); + + } + + + openSocket(); /*<![CDATA[*/ var publicKey =/*[[${session.publicKey}]]*/ @@ -178,7 +329,25 @@ crypt.setKey(publicKey); + + function flushQrcode(){ + + $("#scanResult").hide(); + $("#wxQrcode").hide(); + webClientId = "XCMY_SCAN_QRCODE" + MTools.randomStr(); + + $("#qrCodeIcon").html(""); + $("#qrCodeIcon").show(); + markQrcode(); + + + + + } + + function login() { + if ($("#account").val() == "") { layer.tips('请输入账号!', '#account'); return false; @@ -191,12 +360,16 @@ $.AjaxProxy({ p: { suAccount: encAcc, - suPassword: encPwd + suPassword: encPwd, + loginType: 1 } }).invoke("/common/dologin", function (loj) { MTools.redirect("/" + loj.getValue("page")); }); } + + + function dologin(e) { if (e.keyCode == 13) { @@ -206,5 +379,87 @@ return false; } } + + + + var socket; + function openSocket() { + if(typeof(WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + }else{ + console.log("您的浏览器支持WebSocket"); + //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接 + let wsPath= getRootPath(); + var socketUrl= wsPath.replace("http","ws")+ "/webSocketServer?userId="+webClientId; + + if(socket!=null){ + socket.close(); + socket=null; + } + socket = new WebSocket(socketUrl); + //打开事件 + socket.onopen = function() { + console.log("websocket已打开"); + sendMessage(); + }; + //获得消息事件 + socket.onmessage = function(msg) { + + var serverMsg = JSON.parse(msg.data); + + if(serverMsg.msgType==1){ + + $("#scanResult").show(); + $("#qrCodeIcon").hide(); + + }else if(serverMsg.msgType==2){ + + if(serverMsg.loginOperation==1){ + $.AjaxProxy({ + p: { + loginQrCodeKey: loginQrCodeKey, + loginType: 2 + } + }).invoke("/common/dologin", function (loj) { + MTools.redirect("/" + loj.getValue("page")); + }); + }else if(serverMsg.loginOperation==2){ + layer.msg("取消登录", { + icon : 2 + }); + $("#scanResult").hide(); + $("#wxQrcode").show(); + } + } + }; + //关闭事件 + socket.onclose = function() { + console.log("websocket已关闭"); + }; + //发生了错误事件 + socket.onerror = function() { + console.log("websocket发生了错误"); + } + } + } + + function sendMessage() { + if(typeof(WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + }else { + var msg = '{ }'; + socket.send(msg); + } + } + function colseSocket() { + if(typeof(WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + }else { + socket.close(); + } + } + + + </script> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/common/showprojException.html b/zq-erp/src/main/resources/templates/views/common/showprojException.html new file mode 100644 index 0000000..4fca1cd --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/common/showprojException.html @@ -0,0 +1,51 @@ +<!DOCTYPE HTML> +<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> + <meta http-equiv="Cache-Control" content="no-siteapp"/> + <LINK rel="Bookmark" href="../images/favicon.ico"> + <!-- 本框架基本脚本和样式 --> + + <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> + <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> +</head> +<body> +<div class="ibox-content" id="app"> + <table class="table table-striped table-bordered" style="width: 800px;"> + <tr> + <td>ID</td> + <td th:text="${obj.id}" ></td> + <td >姓名</td> + <td th:text="${obj.owner}" ></td> + </tr> + <tr> + <td >异常类型</td> + <td th:text="${obj.simpleMsg}" ></td> + <td >发生时间</td> + <td th:text="${#dates.format(obj.createTime, 'yyyy-MM-dd HH:mm:sss')}" > + </tr> + <tr> + <td >访问地址</td> + <td th:text="${obj.cause}" ></td> + <td >mdc</td> + <td th:text="${obj.mdc}" ></td> + </tr> + </table> + <pre th:text="${obj.errorMsg}" ></pre> + +</div> +<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> +<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> +<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> + +<script type="text/javascript"> + + +</script> +</body> +</html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/super/sysCompany-form.html b/zq-erp/src/main/resources/templates/views/super/sysCompany-form.html index 73347ad..ea1c420 100644 --- a/zq-erp/src/main/resources/templates/views/super/sysCompany-form.html +++ b/zq-erp/src/main/resources/templates/views/super/sysCompany-form.html @@ -1,199 +1,211 @@ <!DOCTYPE HTML> <html> <head> -<meta charset="utf-8"> -<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> -<meta name="renderer" content="webkit|ie-comp|ie-stand"> -<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -<meta name="viewport" - content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> -<!-- 本框架基本脚本和样式 --> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> -<!-- 界面单独引入的其他样式和脚本 --> -<link rel="stylesheet" - th:href="@{/plugin/zTree/zTreeStyle/zTreeStyle.css}" type="text/css"> -<script type="text/javascript" - th:src="@{/plugin/zTree/jquery.ztree.core-3.5.min.js}"></script> -<script type="text/javascript" - th:src="@{/plugin/zTree/jquery.ztree.excheck.min.js}"></script> + <!-- 界面单独引入的其他样式和脚本 --> + <link rel="stylesheet" + th:href="@{/plugin/zTree/zTreeStyle/zTreeStyle.css}" type="text/css"> + <script type="text/javascript" + th:src="@{/plugin/zTree/jquery.ztree.core-3.5.min.js}"></script> + <script type="text/javascript" + th:src="@{/plugin/zTree/jquery.ztree.excheck.min.js}"></script> <style> - #treeDemo{ - height: 500px; - overflow: scroll; - width: 300px; - } + #treeDemo{ + height: 500px; + overflow: scroll; + width: 300px; + } </style> </head> <body> - <div class="ibox-content"> - <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> - <input type="hidden" name="tokenUrl" th:value="${tokenUrl}"> <input - type="hidden" name="token" th:value="${token}"> <input - type="hidden" name="comId" th:value="${obj.comId }"> - <div class="form-group"> - <label class="col-sm-2 control-label">公司名称<span +<div class="ibox-content"> + <form class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> + <input type="hidden" name="tokenUrl" th:value="${tokenUrl}"> <input + type="hidden" name="token" th:value="${token}"> <input + type="hidden" name="comId" th:value="${obj.comId }"> + <div class="form-group"> + <label class="col-sm-2 control-label">公司名称<span class="text-danger">*</span></label> - <div class="col-sm-4"> - <input type="text" dataType="*1-100" class="form-control" - name="comName" th:value="${obj.comName }" - nullmsg="公司名称不能为空"> - <div class="Validform_checktip"></div> - </div> - <label class="col-sm-2 control-label">联系人<span - class="text-danger">*</span></label> - <div class="col-sm-4"> - <input type="text" dataType="*1-50" class="form-control" - th:value="${obj.comBoss }" name="comBoss" nullmsg="联系人不能为空"> - <div class="Validform_checktip"></div> - </div> + <div class="col-sm-4"> + <input type="text" dataType="*1-100" class="form-control" + name="comName" th:value="${obj.comName }" + nullmsg="公司名称不能为空"> + <div class="Validform_checktip"></div> </div> - <div class="form-group"> - <label class="col-sm-2 control-label">联系电话</label> - <div class="col-sm-4"> - <input type="text" dataType="m" class="form-control" - name="comBossTel" ignore="ignore" th:value="${obj.comBossTel }" + <label class="col-sm-2 control-label">联系人<span + class="text-danger">*</span></label> + <div class="col-sm-4"> + <input type="text" dataType="*1-50" class="form-control" + th:value="${obj.comBoss }" name="comBoss" nullmsg="联系人不能为空"> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group"> + <label class="col-sm-2 control-label">联系电话</label> + <div class="col-sm-4"> + <input type="text" dataType="*11-11" class="form-control" + name="comBossTel" ignore="ignore" th:value="${obj.comBossTel }" nullmsg="联系电话不能为空"> - <div class="Validform_checktip"></div> - </div> - <label class="col-sm-2 control-label">地址</label> - <div class="col-sm-4"> - <input type="text" dataType="*1-510" class="form-control" - ignore="ignore" th:value="${obj.comAddress }" name="comAddress" - nullmsg="地址不能为空"> - <div class="Validform_checktip"></div> - </div> + <div class="Validform_checktip"></div> </div> - <div class="form-group"> - <label class="col-sm-2 control-label">网站地址</label> - <div class="col-sm-4"> - <input type="text" dataType="url" class="form-control" - ignore="ignore" th:value="${obj.comWebUrl }" name="comWebUrl" - nullmsg="网站不能为空"> - <div class="Validform_checktip"></div> - </div> - <label class="col-sm-2 control-label">企业可以用店铺数</label> - <div class="col-sm-4"> - <input type="text" dataType="n" class="form-control" - ignore="ignore" th:value="${obj.comAge}" name="comAge" - nullmsg="企业可以用店铺数不能为空"> - <div class="Validform_checktip"></div> - </div> + <label class="col-sm-2 control-label">地址</label> + <div class="col-sm-4"> + <input type="text" dataType="*1-510" class="form-control" + ignore="ignore" th:value="${obj.comAddress }" name="comAddress" + nullmsg="地址不能为空"> + <div class="Validform_checktip"></div> </div> - <div class="form-group"> - <label class="col-sm-2 control-label">企业功能</label> - <div class=" ztree col-sm-9" id="treeDemo"></div> + </div> + <div class="form-group"> + <label class="col-sm-2 control-label">网站地址<span + class="text-danger">*</span></label> + <div class="col-sm-4"> + <input type="text" class="form-control" + ignore="ignore" dataType="*1-100" th:value="${obj.comWebUrl }" name="comWebUrl" + nullmsg="网站不能为空"> + <div class="Validform_checktip"></div> </div> - <div class="form-group "> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="myForm.submit()" - class="btn btn-success radius"><i class="fa fa-check"></i> 保存</a> - <a class="btn btn-danger radius" href="javascript:;" - onclick="MTools.closeForm()"><i class="fa fa-close"></i> 关闭</a> - </div> + <label class="col-sm-2 control-label">企业可以用店铺数</label> + <div class="col-sm-4"> + <input type="text" dataType="n" class="form-control" + ignore="ignore" th:value="${obj.comAge}" name="comAge" + nullmsg="企业可以用店铺数不能为空"> + <div class="Validform_checktip"></div> </div> - </form> - </div> - <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> - <script th:inline="javascript"> - var invokeUrl = basePath+"/admin/sysCompany/addCompany"; - /*<![CDATA[*/ - var obj=/*[[${obj}]]*/ - /*]]>*/ + </div> + + <div class="form-group"> + <label class="col-sm-2 control-label">公司编码<span + class="text-danger">*</span></label> + <div class="col-sm-4"> + <input type="text" dataType="*1-100" class="form-control" + name="comCode" th:value="${obj.comCode }" + nullmsg="公司编码不能为空"> + <div class="Validform_checktip"></div> + </div> + </div> + <div class="form-group"> + <label class="col-sm-2 control-label">企业功能</label> + <div class=" ztree col-sm-9" id="treeDemo"></div> + </div> + <div class="form-group "> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="myForm.submit()" + class="btn btn-success radius"><i class="fa fa-check"></i> 保存</a> + <a class="btn btn-danger radius" href="javascript:;" + onclick="MTools.closeForm()"><i class="fa fa-close"></i> 关闭</a> + </div> + </div> + </form> +</div> +<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> +<script th:inline="javascript"> + var invokeUrl = basePath+"/admin/sysCompany/addCompany"; + /*<![CDATA[*/ + var obj=/*[[${obj}]]*/ + /*]]>*/ + if(obj.comId!=null){ + invokeUrl = basePath+"/admin/sysCompany/modifyCompany"; + } + + var myForm = null; + var tree = null; + $(function() { + MTools.autoFullSelect(); + $(".select2").select2({ + 'width' : '100%' + }); + myForm = MForm.initForm({ + invokeUrl : invokeUrl, + beforeSubmit : function() { + var items = tree.getCheckedNodes(); + var keys = ""; + for (var i = 0; i < items.length; i++) { + keys += items[i]["id"] + ","; + } + myForm.initParam.extendParam = { + "comFunctions" : keys + }; + }, + afterSubmit : function() { + parent.myGrid.serchData(); + }, + }); + initFunctionList(); + }); + + function initFunctionList() { + var zNodes = new Array(); + $.AjaxProxy().invoke( + basePath+"/admin/sysFunction/all", + function(loj) { + for (var i = 0; i < loj.getRowCount(); i++) { + zNodes[i] = createNode(loj.getString(i, "fnId"), + loj.getString(i, "fnParentId"), loj + .getString(i, "fnName")); + } + initTree(zNodes); + }); + } + + function initTree(zNodes) { + var setting = { + check : { + enable : true, + chkStyle : "checkbox", + radioType : "level", + chkboxType : { + "Y" : "ps", + "N" : "ps" + } + }, + view : { + dblClickExpand : false, + showLine : true, + }, + data : { + simpleData : { + enable : true, + idKey : "id", + pIdKey : "pId", + rootPId : "" + } + }, + + }; + tree = $.fn.zTree.init($("#treeDemo"), setting, zNodes); + } + + function createNode(id, parentId, name) { + var o = new Object(); + o.id = id; + o.pId = parentId; + o.name = name; + o.open = true; + //如果是编辑则设置节点选中 if(obj.comId!=null){ - invokeUrl = basePath+"/admin/sysCompany/modifyCompany"; + //var fns = "${obj.comFunctions}"; + var fns = obj.comFunctions; + if (fns.indexOf(id) != -1) { + o.checked = true; + } } - var myForm = null; - var tree = null; - $(function() { - MTools.autoFullSelect(); - $(".select2").select2({ - 'width' : '100%' - }); - myForm = MForm.initForm({ - invokeUrl : invokeUrl, - beforeSubmit : function() { - var items = tree.getCheckedNodes(); - var keys = ""; - for (var i = 0; i < items.length; i++) { - keys += items[i]["id"] + ","; - } - myForm.initParam.extendParam = { - "comFunctions" : keys - }; - }, - afterSubmit : function() { - parent.myGrid.serchData(); - }, - }); - initFunctionList(); - }); - - function initFunctionList() { - var zNodes = new Array(); - $.AjaxProxy().invoke( - basePath+"/admin/sysFunction/all", - function(loj) { - for (var i = 0; i < loj.getRowCount(); i++) { - zNodes[i] = createNode(loj.getString(i, "fnId"), - loj.getString(i, "fnParentId"), loj - .getString(i, "fnName")); - } - initTree(zNodes); - }); - } - - function initTree(zNodes) { - var setting = { - check : { - enable : true, - chkStyle : "checkbox", - radioType : "level", - chkboxType : { - "Y" : "ps", - "N" : "ps" - } - }, - view : { - dblClickExpand : false, - showLine : true, - }, - data : { - simpleData : { - enable : true, - idKey : "id", - pIdKey : "pId", - rootPId : "" - } - }, - - }; - tree = $.fn.zTree.init($("#treeDemo"), setting, zNodes); - } - - function createNode(id, parentId, name) { - var o = new Object(); - o.id = id; - o.pId = parentId; - o.name = name; - o.open = true; - //如果是编辑则设置节点选中 - if(obj.comId!=null){ - //var fns = "${obj.comFunctions}"; - var fns = obj.comFunctions; - if (fns.indexOf(id) != -1) { - o.checked = true; - } - } - - return o; - } - </script> + return o; + } +</script> </body> </html> \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/super/sysCompany-list.html b/zq-erp/src/main/resources/templates/views/super/sysCompany-list.html index 9717af5..635c5fb 100644 --- a/zq-erp/src/main/resources/templates/views/super/sysCompany-list.html +++ b/zq-erp/src/main/resources/templates/views/super/sysCompany-list.html @@ -82,6 +82,7 @@ <th data-field="comBossTel">联系电话</th> <th data-field="comAddress">地址</th> <th data-field="comWebUrl" data-formatter="MGrid.getUrl">网站</th> + <th data-field="comCode">公司编码</th> <th data-align="center" data-width="150px" data-field="comId" data-formatter="buidOperate">操作 </th> diff --git "a/zq-erp/src/main/resources/\346\235\203\351\231\220" "b/zq-erp/src/main/resources/\346\235\203\351\231\220" index 2ae0118..2b38d8a 100644 --- "a/zq-erp/src/main/resources/\346\235\203\351\231\220" +++ "b/zq-erp/src/main/resources/\346\235\203\351\231\220" @@ -1,22 +1,2 @@ -<button matrix:btn="orderClub-exportExcel" onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button> -<button matrix:btn="orderClub-del" class="btn btn-danger btn-sm mr-5" onClick="cancelOrder()" ><i class="fa fa-trash-o fa-fw"></i> 取消</button> - -<script matrix:btn="orderClub-look" > - btns[0]='<li> <button class="btn btn-default btn-sm mr-5" onClick="openLook(\'VALUE\')" title="查看详情"><i class="fa fa-eye fa-trash-o">查看</i></buttoun></li>' -</script> -<script matrix:btn="orderClub-payment" > - btns[1]='<li> <button class="btn btn-default btn-sm mr-5" onclick="openBj(\'VALUE\')" title=补交"><i class="fa fa-sign-in">补交</i></button></li>' -</script> -<script matrix:btn="orderClub-gathering" > - btns[2]='<li> <button class="btn btn-default btn-sm mr-5" onclick="openEdit(\'VALUE\')" title="收款"><i class="fa fa-edit">收款</i></button></li>' -</script> -<script matrix:btn="orderClub-edit" > - btns[3]='<li> <button class="btn btn-default btn-sm mr-5" onclick="updateTime(\'VALUE\')" title="修改时间"><i class="fa fa-edit">修改时间</i></button></li>' -</script> - - - var btns=[]; - btns[0]="",btns[1]="",btns[2]="",btns[3]="",btns[4]=""; - - - btns[0].replace('VALUE',value); \ No newline at end of file +select ID, NAME, TYPE, code from sys_data_dictionary where 1=1 and TYPE like CONCAT('%',?,'%') + 2021-06-26 16:36:49.487-[ TR = rGpKxAflK1Qt5O66 ] [ DEBUG ]-[ http-nio-8080-exec-3 ] ==> Parameters: 字段类型(String) \ No newline at end of file diff --git a/zq-erp/src/test/java/com/matrix/BizUserToVipInfoTool.java b/zq-erp/src/test/java/com/matrix/BizUserToVipInfoTool.java new file mode 100644 index 0000000..81bed05 --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/BizUserToVipInfoTool.java @@ -0,0 +1,93 @@ +package com.matrix; + +import com.matrix.core.tools.StringUtils; +import com.matrix.system.constance.Dictionary; +import com.matrix.system.fenxiao.dao.BizUserDao; +import com.matrix.system.fenxiao.entity.BizUser; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.hive.service.SysVipInfoService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashMap; +import java.util.List; + +/** + * bizuser转到vipinfo表工具类 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) +public class BizUserToVipInfoTool { + + @Autowired + BizUserDao bizUserDao; + + @Autowired + SysVipInfoDao sysVipInfoDao; + + @Autowired + CodeService codeService; + + @Autowired + SysVipInfoService sysVipInfoService; + + @Test + @Transactional + public void addSettings(){ + HashMap columnMap=new HashMap(); + columnMap.put("company_id",17); + List<BizUser> bizUsers = bizUserDao.selectByMap(columnMap); + for (BizUser bizUser : bizUsers) { + SysVipInfo sysVipInfo = sysVipInfoDao.selectByPhone(bizUser.getPhoneNumber(),17L); + if(sysVipInfo!=null){ + sysVipInfo=sysVipInfoService.findByOpenId(bizUser.getOpenId()); + } + if(sysVipInfo!=null){ + sysVipInfo.setNickName(bizUser.getNickName()); + sysVipInfo.setAvatarUrl(bizUser.getAvatarUrl()); + sysVipInfo.setOpenId(bizUser.getOpenId()); + sysVipInfo.setSessionKey(bizUser.getSessionKey()); + sysVipInfoDao.update(sysVipInfo); + }else{ + SysVipInfo sysVipInfoNew = new SysVipInfo(); + if(bizUser.getGender()!=null){ + sysVipInfoNew.setSex(bizUser.getGender().equals("1")?"男":"女"); + } + sysVipInfoNew.setNickName(bizUser.getNickName()); + sysVipInfoNew.setAvatarUrl(bizUser.getAvatarUrl()); + sysVipInfoNew.setIsSales(SysVipInfo.NOT_SALES); + sysVipInfoNew.setOpenId(bizUser.getOpenId()); + sysVipInfoNew.setSessionKey(bizUser.getSessionKey()); + sysVipInfoNew.setCompanyId(17L); + sysVipInfoNew.setShopId(13L); + sysVipInfoNew.setArrivalWay("微商城"); + sysVipInfoNew.setVipName("微信用户"); + sysVipInfoNew.setVipState(Dictionary.VIP_STATE_HY); + sysVipInfoNew.setVipType(Dictionary.VIP_TYPE_NOCARD); + sysVipInfoNew.setIsDeal(SysVipInfo.UNDEAL_VIP); + sysVipInfoNew.setVipNo(StringUtils.getRandomString(10)); + sysVipInfoNew.setCity(bizUser.getCity()); + sysVipInfoNew.setArea(bizUser.getArea()); + sysVipInfoNew.setProvince(bizUser.getProvince()); + sysVipInfoNew.setPhone(bizUser.getPhoneNumber()); + sysVipInfoNew.setPhoto(bizUser.getAvatarUrl()); + sysVipInfoService.add(sysVipInfoNew); + } + System.out.println("处理进度"+ bizUsers.indexOf(bizUser)+"/"+bizUsers.size()); + } + } + + + + +} diff --git a/zq-erp/src/test/java/com/matrix/FenxiaoSoreInitTest.java b/zq-erp/src/test/java/com/matrix/FenxiaoSoreInitTest.java new file mode 100644 index 0000000..b6d5350 --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/FenxiaoSoreInitTest.java @@ -0,0 +1,728 @@ +package com.matrix; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUnit; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.activity.dao.ActivitySignAwardSetDao; +import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; +import com.matrix.system.activity.dao.ActivitySignRecordDao; +import com.matrix.system.activity.dao.ActivitySignWriteoffDao; +import com.matrix.system.activity.entity.ActivitySignAwardSet; +import com.matrix.system.activity.entity.ActivitySignReceiveRecord; +import com.matrix.system.activity.entity.ActivitySignRecord; +import com.matrix.system.activity.entity.ActivitySignWriteoff; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.score.entity.ScoreVipDetail; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.api.dto.SeeAwardTextDto; +import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; +import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; +import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo; +import com.matrix.system.shopXcx.api.vo.LuckyDrawBasicInfoJsonVo; +import com.matrix.system.shopXcx.api.vo.LuckyDrawSuccessVo; +import com.matrix.system.shopXcx.api.vo.SeeAwardTextVo; +import com.matrix.system.shopXcx.bean.*; +import com.matrix.system.shopXcx.dao.*; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; + +import java.text.SimpleDateFormat; +import java.util.*; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) +public class FenxiaoSoreInitTest { + + @Autowired + private ShopActivitiesDao shopActivitiesDao; + + @Autowired + private ActivitySignAwardSetDao activitySignAwardSetDao; + + @Autowired + private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; + + @Autowired + private ActivitySignWriteoffDao activitySignWriteoffDao; + + @Autowired + private ActivitySignRecordDao activitySignRecordDao; + + @Autowired + ShopDeliveryInfoDao shopDeliveryInfoDao; + + @Autowired + private ShopLogisticsInfoDao shopLogisticsInfoDao; + + @Autowired + private WxShopLogisticsQueryService wxShopLogisticsQueryService; + @Autowired + private ScoreVipDetailService scoreVipDetailService; + @Autowired + private ShopCouponDao shopCouponDao; + @Autowired + private WxShopCouponUtil wxShopCouponUtil; + @Autowired + private ShopCouponRecordDao shopCouponRecordDao; + @Autowired + SysVipInfoDao sysVipInfoDao; + + //获取奖品并索引+1 已领取+1 + public synchronized ActivitySignAwardSet updateShopActivityAndAwardSet(Long actId){ + //通过活动ID获取对应的活动 + ShopActivities shopActivities = shopActivitiesDao.selectById(actId); + String actContent = shopActivities.getActContent(); + LuckyDrawBasicInfoJsonVo luckyDrawBasicInfoJsonVo = JSON.parseObject(actContent, LuckyDrawBasicInfoJsonVo.class); + + //中奖索引 + Integer awrdLineIndex = luckyDrawBasicInfoJsonVo.getAwrdLineIndex(); + //中奖序列 + String awardLine = luckyDrawBasicInfoJsonVo.getAwardLine(); + ActivitySignAwardSet activitySignAwardSet = null; + if(awardLine.length() > 0) { + String substring = awardLine.substring(1, awardLine.length() - 1); + List<String> awardList = StrUtil.splitTrim(substring, ","); + if(awrdLineIndex < awardList.size()){ + //中奖 + Long awardId = Long.parseLong(awardList.get(awrdLineIndex + 1)); + ActivitySignAwardSet activitySignAwardSetGet = activitySignAwardSetDao.selectById(awardId); + //奖项库存数量 + int awardInventoryCnt = activitySignAwardSetGet.getAwardInventoryCnt(); + //已派发数量 + int awardDistributeCnt = activitySignAwardSetGet.getAwardDistributeCnt(); + if(awardDistributeCnt < awardInventoryCnt){ + activitySignAwardSet = activitySignAwardSetGet; + activitySignAwardSetGet.setAwardDistributeCnt(awardDistributeCnt +1); + activitySignAwardSetDao.updateById(activitySignAwardSetGet); + + //将基本信息转换成JSON字符串存储到活动主表的act_content字段 + luckyDrawBasicInfoJsonVo.setAwrdLineIndex(awrdLineIndex + 1); + String json= JSON.toJSONString(luckyDrawBasicInfoJsonVo); + shopActivities.setActContent(json); + shopActivitiesDao.updateByModel(shopActivities); + } + } + } + return activitySignAwardSet; + } + + @Test + public void getLuckDraw(){ + long actId = 85L; + Long userId = 85L; + Long companyId = 36L; + SysVipInfo user = sysVipInfoDao.selectById(userId); + /** + * 活动是否存在 + * 活动是否已经开始 + * 免费抽奖还是积分抽奖 + * 积分抽奖一次一次换 + * 减少积分 + * 是否中奖 + * 中奖规则 + * 奖品处理 + * + */ + //活动是否存在 + ShopActivities shopActivities = shopActivitiesDao.selectById(actId); + if (ObjectUtil.isEmpty(shopActivities)) { + // return AjaxResult.buildFailInstance("活动不存在"); + } + //活动是否已经开始 + Integer actStatus = shopActivities.getActStatus(); + if(ShopActivities.ACTSTATUS_STATUS_ING != actStatus) { + //return AjaxResult.buildFailInstance("活动未开始"); + } + //获取今日抽奖总次数 + String actContent = shopActivities.getActContent(); + LuckyDrawBasicInfoJsonVo luckyDrawBasicInfoJsonVo = JSON.parseObject(actContent, LuckyDrawBasicInfoJsonVo.class); + List<ActivitySignRecord> activityRecords = activitySignRecordDao.selectListByActIdAndUserIdLikesignTime(actId,userId, DateUtil.date()); + if(CollUtil.isNotEmpty(activityRecords)){ + Integer wmkcjjh = luckyDrawBasicInfoJsonVo.getWmkcjjh(); + Integer jfdhcs = luckyDrawBasicInfoJsonVo.getJfdhcs(); + if(activityRecords.size() >= (wmkcjjh+jfdhcs)){ + //return AjaxResult.buildFailInstance("明天再来抽奖吧"); + } + } + + //生成抽奖记录 + ActivitySignRecord activitySignRecordAdd = new ActivitySignRecord(); + activitySignRecordAdd.setCompanyId(companyId); + activitySignRecordAdd.setCreateBy(user.getVipName()); + activitySignRecordAdd.setCreateTime(DateUtil.date()); + activitySignRecordAdd.setUpdateBy(user.getVipName()); + activitySignRecordAdd.setUpdateTime(DateUtil.date()); + activitySignRecordAdd.setActivityId(actId); + activitySignRecordAdd.setSignTime(DateUtil.date()); + activitySignRecordAdd.setUserId(userId); + activitySignRecordDao.insert(activitySignRecordAdd); + + /** + 获取中奖概率 + 中奖了获取奖品ID + 没有中奖则获取谢谢参与的奖品ID + 每个人最多中奖次数 + */ + + List<LuckyDrawSuccessVo> luckyDrawSuccessVos = new ArrayList<>(); + + //获取谢谢参与奖 + QueryWrapper<ActivitySignAwardSet> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("award_rule",ActivitySignAwardSet.AWARDRULE_NORMAL); + queryWrapper.eq("company_id",companyId); + queryWrapper.eq("activity_id",actId); + ActivitySignAwardSet activitySignAwardSetNormal = activitySignAwardSetDao.selectOne(queryWrapper); + //每个人最多中奖次数 + Integer zzjcs = luckyDrawBasicInfoJsonVo.getZzjcs(); + QueryWrapper<ActivitySignReceiveRecord> queryWrapperActivitySignReceiveRecord = new QueryWrapper<>(); + queryWrapperActivitySignReceiveRecord.eq("company_id", companyId); + queryWrapperActivitySignReceiveRecord.eq("activity_id", actId); + queryWrapperActivitySignReceiveRecord.eq("user_id", userId); + queryWrapperActivitySignReceiveRecord.ne("award_id", activitySignAwardSetNormal.getId()); + List<ActivitySignReceiveRecord> activitySignReceiveRecordDone = activitySignReceiveRecordDao.selectList(queryWrapperActivitySignReceiveRecord); + if(CollUtil.isNotEmpty(activitySignReceiveRecordDone)){ + if(activitySignReceiveRecordDone.size() >= zzjcs){ + //生成领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(1); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetNormal.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetNormal.getIntroduceImg()); + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + //return ajaxResult; + } + } + //总中奖率 + int zzjl = luckyDrawBasicInfoJsonVo.getZzjl(); + int randomInt = RandomUtil.randomInt(1, 100); + //不中奖的分界线 + int failureScope = 0; + if(failureScope >= randomInt){ + //生成领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(1); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetNormal.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetNormal.getIntroduceImg()); + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + //return ajaxResult; + } + //中奖 + if(failureScope < randomInt){ + //获取奖品 + ActivitySignAwardSet activitySignAwardSetCumulativeDay = updateShopActivityAndAwardSet(actId); + + if(ObjectUtil.isNotEmpty(activitySignAwardSetCumulativeDay)){ + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(2); + luckyDrawSuccessVo.setAwardType(activitySignAwardSetCumulativeDay.getAwardType()); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetCumulativeDay.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetCumulativeDay.getIntroduceImg()); + luckyDrawSuccessVo.setAwardState(activitySignAwardSetCumulativeDay.getAwardState()); + //新增奖品领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetCumulativeDay.getId()); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + /** + * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) + * + * todo:4:店铺商品 + */ + //1:自定义产品 + if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_ING); + String randomString = StringUtils.getRandomString(8); + activitySignReceiveRecord.setWriteOffCode(randomString); + + /** + * 获取对应奖品的领取方式(兑奖方式(1:线下兑换2:物流配送3:客服兑换) + */ + luckyDrawSuccessVo.setWriteOffCode(randomString); + luckyDrawSuccessVo.setAwardWay(activitySignAwardSetCumulativeDay.getAwardWay()); + //2:物流配送 + luckyDrawSuccessVo.setOperationTip(activitySignAwardSetCumulativeDay.getOperationTip()); + //1:线下兑换 + if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay()) { + luckyDrawSuccessVo.setIntroduceTip(activitySignAwardSetCumulativeDay.getIntroduceTip()); + luckyDrawSuccessVo.setPrizeAddress(activitySignAwardSetCumulativeDay.getPrizeAddress()); + luckyDrawSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); + luckyDrawSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); + } + //3:客服兑换 + if(ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { + luckyDrawSuccessVo.setWechatImg(activitySignAwardSetCumulativeDay.getWechatImg()); + luckyDrawSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); + luckyDrawSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); + } + } + //2:积分 + if(ActivitySignAwardSet.AWARDTYPE_SCORE == activitySignAwardSetCumulativeDay.getAwardType()) { + luckyDrawSuccessVo.setScoreCnt(activitySignAwardSetCumulativeDay.getScoreCnt()); + } + //3:优惠券 + if(ActivitySignAwardSet.AWARDTYPE_COUPON == activitySignAwardSetCumulativeDay.getAwardType()) { + luckyDrawSuccessVo.setCouponName(activitySignAwardSetCumulativeDay.getCouponName()); + //获取优惠券 + int couponId = Integer.parseInt(activitySignAwardSetCumulativeDay.getCouponId()); + ShopCoupon shopCoupon = shopCouponDao.selectById(couponId); + // 如果没有找到该优惠券 + if (shopCoupon == null) { + // return new AjaxResult(AjaxResult.STATUS_FAIL, "没有找到该优惠券!"); + } + // 如果优惠券有数量限制并且已经领完 + if (shopCoupon.getMaxQuantity() >= 0 && (shopCoupon.getMaxQuantity() <= shopCoupon.getQuantityReceive())) { + //return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券已领完!"); + } + boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(userId); + // 如果改券是新人专属且当前用户不是新人 + if (AppConstance.COUPON_GET_LIMT_NEW.equals(shopCoupon.getGetLimit()) && !newPeople) { + // return new AjaxResult(AjaxResult.STATUS_FAIL, "该优惠券为新人专享优惠券!"); + } + ShopCouponRecord insertRecord = new ShopCouponRecord(); + insertRecord.setCreateBy(AppConstance.SYSTEM_USER); + insertRecord.setUpdateBy(AppConstance.SYSTEM_USER); + insertRecord.setCId(couponId); + insertRecord.setUserId(userId); + insertRecord.setIsUsing(2); + int i = shopCouponRecordDao.insert(insertRecord); + // 如果插入领取记录表失败 + if (i < 0) { + //return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券领取失败!"); + } + shopCoupon.setQuantityReceive(shopCoupon.getQuantityReceive() + 1); + shopCouponDao.updateByModel(shopCoupon); + } + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + //累计奖励积分,对应用户积分加减 + if(ActivitySignAwardSet.AWARDTYPE_SCORE == activitySignAwardSetCumulativeDay.getAwardType()) { + int awardType = activitySignAwardSetCumulativeDay.getAwardType(); + if(ActivitySignAwardSet.AWARDTYPE_SCORE == awardType){ + int scoreCnt = activitySignAwardSetCumulativeDay.getScoreCnt(); + if(scoreCnt > 0){ + scoreVipDetailService.addScore(userId,null,null,scoreCnt, + activitySignReceiveRecord.getId(), ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"签到积分"); + } + } + } + //生成核销记录 + if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { + ActivitySignWriteoff activitySignWriteoff = new ActivitySignWriteoff(); + //线下兑换和客服兑换 + if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay() + || ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { + activitySignWriteoff.setWriteoffCode(activitySignReceiveRecord.getWriteOffCode()); + } + activitySignWriteoff.setActId(actId); + activitySignWriteoff.setAwardId(activitySignAwardSetCumulativeDay.getId()); + activitySignWriteoff.setWinTime(DateUtil.date()); + if(ActivitySignAwardSet.AWARDWAY_TWO == activitySignAwardSetCumulativeDay.getAwardWay()) { + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_TWO); + }else { + activitySignWriteoff.setState(ActivitySignWriteoff.STATE_ONE); + } + activitySignWriteoff.setUserId(userId); + activitySignWriteoff.setCompanyId(companyId); + activitySignWriteoff.setReceiveId(activitySignReceiveRecord.getId()); + activitySignWriteoff.setCreateBy(user.getVipName()); + activitySignWriteoff.setCreateTime(new Date()); + activitySignWriteoff.setUpdateBy(user.getVipName()); + activitySignWriteoff.setUpdateTime(new Date()); + activitySignWriteoffDao.insert(activitySignWriteoff); + } + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + }else{ + //生成领取记录 + ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); + activitySignReceiveRecord.setUserId(userId); + activitySignReceiveRecord.setReceiveTime(DateUtil.date()); + activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); + activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); + activitySignReceiveRecord.setActivityId(actId); + activitySignReceiveRecord.setCompanyId(companyId); + activitySignReceiveRecord.setCreateBy(user.getVipName()); + activitySignReceiveRecord.setCreateTime(new Date()); + activitySignReceiveRecord.setUpdateBy(user.getVipName()); + activitySignReceiveRecord.setUpdateTime(new Date()); + activitySignReceiveRecordDao.insert(activitySignReceiveRecord); + + LuckyDrawSuccessVo luckyDrawSuccessVo = new LuckyDrawSuccessVo(); + luckyDrawSuccessVo.setType(1); + luckyDrawSuccessVo.setAwardName(activitySignAwardSetNormal.getAwardName()); + luckyDrawSuccessVo.setAwardImg(activitySignAwardSetNormal.getIntroduceImg()); + luckyDrawSuccessVos.add(luckyDrawSuccessVo); + + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + //return ajaxResult; + } + } + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); + ajaxResult.setData(luckyDrawSuccessVos); + //return ajaxResult; + } + + @Test + public void awardInsert() { + //获取奖品的抽奖顺序 + List<ActivitySignAwardSetVo> activitySignAwardSetVos = new ArrayList<>(); + ActivitySignAwardSetVo activitySignAwardSetVo1 = new ActivitySignAwardSetVo(); + activitySignAwardSetVo1.setAwardInventoryCnt(10); + activitySignAwardSetVo1.setId(1L); + activitySignAwardSetVos.add(activitySignAwardSetVo1); + ActivitySignAwardSetVo activitySignAwardSetVo2 = new ActivitySignAwardSetVo(); + activitySignAwardSetVo2.setAwardInventoryCnt(10); + activitySignAwardSetVo2.setId(2L); + activitySignAwardSetVos.add(activitySignAwardSetVo2); + ActivitySignAwardSetVo activitySignAwardSetVo3 = new ActivitySignAwardSetVo(); + activitySignAwardSetVo3.setAwardInventoryCnt(2); + activitySignAwardSetVo3.setId(3L); + activitySignAwardSetVos.add(activitySignAwardSetVo3); + ActivitySignAwardSetVo activitySignAwardSetVo4 = new ActivitySignAwardSetVo(); + activitySignAwardSetVo4.setAwardInventoryCnt(1); + activitySignAwardSetVo4.setId(4L); + activitySignAwardSetVos.add(activitySignAwardSetVo4); + + //插入所有奖品后的集合 + LinkedList awardIdFinalList = new LinkedList<>(); + if(CollUtil.isNotEmpty(activitySignAwardSetVos)){ + //总数 + int maxCount = 0; + HashMap<Long, ActivitySignAwardSetVo> integerStringHashMap = new HashMap<>(); + for(ActivitySignAwardSetVo activitySignAwardSetVo : activitySignAwardSetVos){ + //总共派发数量 + int awardInventoryCnt = activitySignAwardSetVo.getAwardInventoryCnt(); + integerStringHashMap.put(activitySignAwardSetVo.getId(),activitySignAwardSetVo); + maxCount = maxCount + awardInventoryCnt; + } + HashMap<Long, ActivitySignAwardSetVo> sortHashMap = sortHashMap(integerStringHashMap,2); + HashMap<Long, ActivitySignAwardSetVo> sortHashMapAec = sortHashMap(integerStringHashMap,1); + //获取奖品最多的ID + Long maxAwardIds = sortHashMap.keySet().stream().findFirst().get(); + Long minAwardIds = sortHashMapAec.keySet().stream().findFirst().get(); + //获取最大长度的奖品集合 + List awardIdList = new LinkedList<Long>(); + for(int i = 0; i< maxCount ; i++){ + awardIdList.add(maxAwardIds); + } + + Iterator<Map.Entry<Long, ActivitySignAwardSetVo>> entries = sortHashMap.entrySet().iterator(); + //插入奖品 + while (entries.hasNext()) { + Map.Entry<Long, ActivitySignAwardSetVo> entry = entries.next(); + ActivitySignAwardSetVo activitySignAwardSetVo = entry.getValue(); + int awardInventoryCnt = activitySignAwardSetVo.getAwardInventoryCnt(); + Long awardIdNew = entry.getKey(); + if(awardIdNew != maxAwardIds){ + //分段之后的List + List splitLists = getSplitList(awardInventoryCnt, awardIdList); + for(int j = 0; j<awardInventoryCnt; j++){ + List splitList = (List) splitLists.get(j); + //中间插入对应的奖品ID,如果和maxAwardIds相同,则索引+1 + List<Long> listInsert = getListInsert(maxAwardIds, awardIdNew, splitList); + if(minAwardIds == awardIdNew){ + awardIdFinalList.addAll(listInsert); + } + } + } + } + + } + String awrdList = awardIdFinalList.toString(); + String substring = awrdList.substring(1, awrdList.length() - 1); + List<String> strings = Arrays.asList(substring); + System.out.println(strings); + + } + + + + //中间插入对应的奖品ID,如果和maxAwardIds相同,则索引+1 + public static List<Long> getListInsert(Long awardOld,Long awardNew,List splitList){ + //中间位置索引 + LinkedList<Integer> indexs = new LinkedList<>(); + int groupFlag = splitList.size() % 2 == 0 ? (splitList.size() / 2) : (splitList.size() / 2 + 1); + for(int j = groupFlag-1; j < splitList.size();j++){ + if(splitList.get(j) == awardOld){ + indexs.add(j); + } + } + if(CollUtil.isNotEmpty(indexs)){ + splitList.set(indexs.get(0),awardNew); + }else{ + splitList.add(groupFlag,awardNew); + } + return splitList; + } + + //等份平分数组,最后剩余的添加到倒数第二个集合中 + public static List<List<Long>> getSplitList(int splitNum, List<Long> list) { + LinkedList<List<Long>> splitList = new LinkedList<>(); + // groupFlag >= 1 + int groupFlag = list.size() % splitNum == 0 ? (list.size() / splitNum) : (list.size() / splitNum); + if(groupFlag * splitNum < list.size()){ + for (int j = 1; j <= splitNum +1; j++) { + if ((j * groupFlag) <= list.size() ) { + splitList.add(list.subList(j * groupFlag - groupFlag, j * groupFlag)); + } else if ((j * groupFlag) > list.size()) { + splitList.add(list.subList(j * groupFlag - groupFlag, list.size())); + } + } + }else if(groupFlag * splitNum > list.size()){ + for (int j = 1; j < splitNum; j++) { + if ((j * groupFlag) <= list.size() ) { + splitList.add(list.subList(j * groupFlag - groupFlag, j * groupFlag)); + } else if ((j * groupFlag) > list.size()) { + splitList.add(list.subList(j * groupFlag - groupFlag, list.size())); + } + } + }else{ + for (int j = 1; j <= splitNum; j++) { + if ((j * groupFlag) <= list.size() ) { + splitList.add(list.subList(j * groupFlag - groupFlag, j * groupFlag)); + } else if ((j * groupFlag) > list.size()) { + splitList.add(list.subList(j * groupFlag - groupFlag, list.size())); + } + } + } + return splitList; + } + + + //对于奖品排序 1:升序进行排,2是倒序就是o2-o1 + public static HashMap<Long, ActivitySignAwardSetVo> sortHashMap(HashMap<Long, ActivitySignAwardSetVo> map,int type) { + // 首先拿到 map 的键值对集合 + Set<Map.Entry<Long, ActivitySignAwardSetVo>> entrySet = map.entrySet(); + // 将 set 集合转为 List 集合,为什么,为了使用工具类的排序方法 + List<Map.Entry<Long, ActivitySignAwardSetVo>> list = new ArrayList<Map.Entry<Long, ActivitySignAwardSetVo>>(entrySet); + // 使用 Collections 集合工具类对 list 进行排序,排序规则使用匿名内部类来实现 + Collections.sort(list, new Comparator<Map.Entry<Long, ActivitySignAwardSetVo>>() { + @Override + public int compare(Map.Entry<Long, ActivitySignAwardSetVo> o1, Map.Entry<Long, ActivitySignAwardSetVo> o2) { + if(type == 2){ + //按照要求根据 升序进行排,如果是倒序就是o2-o1 + return o2.getValue().getAwardInventoryCnt() - o1.getValue().getAwardInventoryCnt(); + } + return o1.getValue().getAwardInventoryCnt() - o2.getValue().getAwardInventoryCnt(); + } + }); + //创建一个新的有序的 HashMap 子类的集合 + LinkedHashMap<Long, ActivitySignAwardSetVo> linkedHashMap = new LinkedHashMap<Long, ActivitySignAwardSetVo>(); + //将 List 中的数据存储在 LinkedHashMap 中 + for (Map.Entry<Long, ActivitySignAwardSetVo> entry : list) { + linkedHashMap.put(entry.getKey(), entry.getValue()); + } + //返回结果 + return linkedHashMap; + } + + /** + * 获取当月的 天数 + * */ + public static int getCurrentMonthDay(Date date) { + Date beginOfMonth = DateUtil.beginOfMonth(date); + Date endOfMonth = DateUtil.endOfMonth(date); + long betweenDay = DateUtil.between(beginOfMonth, endOfMonth, DateUnit.DAY); + return Integer.parseInt(String.valueOf(betweenDay))+1; + } + /** + * java 获取 获取某年某月 所有日期(yyyy-mm-dd格式字符串) + * @param year + * @param month + * @return + */ + public static List<String> getMonthFullDay(int year , int month){ + SimpleDateFormat dateFormatYYYYMMDD = new SimpleDateFormat("yyyy-MM-dd"); + List<String> fullDayList = new ArrayList<>(32); + // 获得当前日期对象 + Calendar cal = Calendar.getInstance(); + cal.clear();// 清除信息 + cal.set(Calendar.YEAR, year); + // 1月从0开始 + cal.set(Calendar.MONTH, month-1 ); + // 当月1号 + cal.set(Calendar.DAY_OF_MONTH,1); + int count = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + for (int j = 1; j <= count ; j++) { + fullDayList.add(dateFormatYYYYMMDD.format(cal.getTime())); + cal.add(Calendar.DAY_OF_MONTH,1); + } + return fullDayList; + } +// @Test +// public void getinterger() { +// Long userId = 30L; +// Long companyId = 36L; +// int size = activitySignReceiveRecordDao.getSignAwardReceiveCount(userId,companyId); +// } +// /** +// * 获取累计签到天数 +// * @param actId +// * @param userId +// * @param date +// * @return +// */ +// public int getCumulativeDay(long actId, long userId,Date date, int i) { +// ActivitySignRecord activitySignRecordOld = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,date); +// if(ObjectUtil.isEmpty(activitySignRecordOld)) { +// return i; +// } +// i++; +// DateTime offsetDay = DateUtil.offsetDay(date, -i); +// return getCumulativeDay(actId,userId,offsetDay,i); +// } + @Test + public void clickSign() { + long awardId = 10; + Long userId = 30L; + Long companyId = 36L; + SeeAwardTextDto seeAwardTextDto = new SeeAwardTextDto(); + seeAwardTextDto.setAwardId(awardId); + seeAwardTextDto.setCompanyId(companyId); + seeAwardTextDto.setUserId(userId); + logisticsInsure(seeAwardTextDto); + + } + public AjaxResult logisticsInsure(@RequestBody @Validated SeeAwardTextDto seeAwardTextDto) { + SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); + if(ObjectUtil.isEmpty(seeAwardTextVO)){ + return AjaxResult.buildFailInstance("奖品信息无法查看"); + } + long receiveId = seeAwardTextVO.getId(); + //获取核销记录的ID + ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectActivitySignWriteoffByUserIDAndReceiveId(seeAwardTextDto.getUserId(),receiveId); + if(ObjectUtil.isNotEmpty(activitySignWriteoff)){ + Integer logisticsId = activitySignWriteoff.getLogisticsId(); + ShopDeliveryInfo shopDeliveryInfo = shopDeliveryInfoDao.selectById(logisticsId); + if(ObjectUtil.isNotEmpty(shopDeliveryInfo)){ + //查看物流信息 + wxShopLogisticsQueryService.selectLogisticsInfo(shopDeliveryInfo); + List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); + seeAwardTextVO.setShopLogisticsInfos(shopLogisticsInfos); + } + } + AjaxResult result=AjaxResult.buildSuccessInstance(seeAwardTextVO); + return result; + } + /** + * 获取累计签到天数 + * @param actId + * @param userId + * @param date + * @return + */ + public int getCumulativeDay(long actId, long userId,Date date, int i) { + ActivitySignRecord activitySignRecordOld = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,date); + if(ObjectUtil.isEmpty(activitySignRecordOld)) { + return i; + } + i++; + DateTime offsetDay = DateUtil.offsetDay(date, -i); + return getCumulativeDay(actId,userId,offsetDay,i); + } + public void InitByCompanyId() { + //对应的公司ID +// long companyId = 36L; +// initBusParameterSetting(companyId); +// //initBusParameterFenxiaoSetting(companyId); + } + +// /** +// * 初始化默认积分规则设置 +// */ +// public void initBusParameterSetting(long companyId) { +// List<BusParameterSettings> ruleSettings=new ArrayList<>(); +// +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CREDIT_POINTS_CASH, companyId)); +// +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.GIVE_CONSUMPTION, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.REFERRALS_CONSUMPTION, companyId)); +// +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, companyId)); +// ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, companyId)); +// +// busParameterSettingsDao.batchInsert(ruleSettings); +// } +// +// /** +// * 初始化默认分销规则设置 +// */ +// public void initBusParameterFenxiaoSetting(long companyId) { +// List<BusParameterSettings> ruleSettings=new ArrayList<>(); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_SWITCH, companyId)); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_MODEL, companyId)); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_WAY, companyId)); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_AUDIT_METHOD, companyId)); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId)); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_PLAN, companyId)); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_POSTER, companyId)); +// ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_ZGFY, companyId)); +// busParameterSettingsDao.batchInsert(ruleSettings); +// } +// +// private BusParameterSettings addScoreRuleSetting(String code,long companyId) { +// BusParameterSettings busParameterSetting = new BusParameterSettings(); +// busParameterSetting.setParamCode(code); +// busParameterSetting.setCompanyId(companyId); +// return busParameterSetting; +// } + +} diff --git a/zq-erp/src/test/java/com/matrix/JyyTests.java b/zq-erp/src/test/java/com/matrix/JyyTests.java new file mode 100644 index 0000000..3f4c132 --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/JyyTests.java @@ -0,0 +1,114 @@ +package com.matrix; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.matrix.system.hive.bean.MoneyCardUse; +import com.matrix.system.hive.dao.MoneyCardUseDao; +import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; +import com.matrix.system.shopXcx.mqTask.OrderDingDingNoticeTask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.Rollback; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.IOException; +import java.util.List; + +/** + * 测试类示例 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class JyyTests { + + + @Autowired + private ShopOrderV2Dao shopOrderV2Dao; + + @Autowired + ScoreVipDetailDao scoreVipDetailDao; + + @Autowired + ScoreVipDetailService scoreVipDetailService; + + + @Autowired + SysVipInfoServiceImpl sysVipInfoService; + + + + @Autowired + OrderDingDingNoticeTask orderDingDingNoticeTask; + + @Autowired + MoneyCardUseDao moneyCardUseDao; + + + @Test + public void finxMoneyCardUserId() throws IOException { + long id=2531; + final List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectList(new LambdaQueryWrapper<MoneyCardUse>().gt(MoneyCardUse::getId, 2531)); + + for (MoneyCardUse moneyCardUs : moneyCardUses) { + moneyCardUseDao.updateId(moneyCardUs.getId(),++id); + } + + System.out.println(moneyCardUses.size()); + } + + + @Test + @Rollback + public void testNoticeTask() throws IOException { + // orderDingDingNoticeTask.handle("",new Delivery(null,null,"1295".getBytes())); + + + + + } + + + @Test + public void testRedis() { + + /*List<SysFunction> fnList = new ArrayList<>(); + fnList.add(new SysFunction()); + + Map map = new HashMap(); + map.put("a", fnList); + redisClient.saveMapValue("map", map); +*/ + + } + + + @Test + public void testRedis2() { +/* + + String map = redisClient.getCachedValue("map"); + JSONObject json = JSONUtil.parseObj(map); + String a = json.get("a").toString(); + + + JSONArray jsonArray = JSONUtil.parseArray(a); + for (int i=0;i<jsonArray.size();i++){ + SysFunction sysFunction = jsonArray.get(i, SysFunction.class); + System.out.println(sysFunction.getHasThisFn()); + } +*/ + + + + + } + +} diff --git a/zq-erp/src/test/java/com/matrix/JyyTests2.java b/zq-erp/src/test/java/com/matrix/JyyTests2.java new file mode 100644 index 0000000..0304fff --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/JyyTests2.java @@ -0,0 +1,241 @@ +package com.matrix; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.matrix.component.redis.RedisClient; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.tools.LogUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysFunction; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysOrderDao; +import com.matrix.system.hive.dao.SysOrderItemDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.hive.service.ShoppingGoodsService; +import com.matrix.system.hive.service.SysOrderService; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl; +import com.matrix.system.score.dao.ScoreVipDetailDao; +import com.matrix.system.score.service.ScoreVipDetailService; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.bean.ShopOrderDetails; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.dao.ShopOrderDao; +import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; +import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; +import com.matrix.system.shopXcx.mqTask.OrderDingDingNoticeTask; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.Rollback; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.IOException; +import java.util.*; + +/** + * 测试类示例 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class JyyTests2 { + + @Autowired + ShopOrderDao shopOrderDao; + @Autowired + ShopOrderDetailsDao shopOrderDetailsDao; + + @Autowired + SysVipInfoService sysVipInfoService; + + + @Autowired + private SysVipInfoDao vipDap; + + @Autowired + SysVipInfoDao vipDao; + + @Autowired + CodeService codeService; + + @Autowired + SysOrderDao sysOrderDao; + + @Autowired + ShoppingGoodsService shoppingGoodsService; + + @Autowired + SysOrderItemDao orderItemDao; + + @Autowired + SysOrderService orderService; + + @Autowired + ShopSkuDao shopSkuDao; + + @Autowired + BusParameterSettingsDao parameterSettingsDao; + + + @Autowired + private ShopSalesmanOrderDao shopSalesmanOrderDao; + + @Autowired + private ShopSalesmanGradeDao shopSalesmanGradeDao; + + + @Test + @Rollback + public void testNoticeTask() throws IOException { + // orderDingDingNoticeTask.handle("",new Delivery(null,null,"1295".getBytes())); + + ShopOrder order=shopOrderDao.selectById(1353); + //判读客户是否存在上级,存在则产生上级的收益 + SysVipInfo sysVipInfo = sysVipInfoService.findById(order.getUserId()); + LogUtil.debug("处理分销订单userOpid={}",sysVipInfo.getOpenId()); + //判断是否重复生成 + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("order_id",order.getId()); + Integer orderCount = shopSalesmanOrderDao.selectCount(queryWrapper); + ShopSalesmanOrder salesmanOrder=new ShopSalesmanOrder(); + salesmanOrder.setCompanyId(order.getCompanyId()); + salesmanOrder.setCreateBy(MatrixConstance.SYSTEM_USER); + salesmanOrder.setUpdateBy(MatrixConstance.SYSTEM_USER); + salesmanOrder.setCreateTime(new Date()); + salesmanOrder.setUpdateTime(new Date()); + salesmanOrder.setOrderId(Long.parseLong(order.getId()+"")); + salesmanOrder.setUserId(order.getUserId()); + salesmanOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_SALES); + salesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_DJS); + Double selfAmount=0D; + Double zk=1D; + //分销订单总额 + Double orderTotal=0D; + for (ShopOrderDetails item:order.getDetails() ){ + if(item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + orderTotal+=item.getTotalPrice().doubleValue(); + } + } + //自购返佣 + Integer isSales = sysVipInfo.getIsSales(); + if(SysVipInfo.IS_SALES == isSales){ + for (ShopOrderDetails item:order.getDetails() ){ + if(item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + //分销规则是否开启自购返佣 + BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, sysVipInfo.getCompanyId()); + //按分销等级计算 + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); + if(ObjectUtil.isNotEmpty(zgfy)) { + //获取商品的自购返佣价格,如果没有设置,在去获取当前推广人的等级的自购返佣比例 + if(StrUtil.isNotEmpty(zgfy.getParamValue()) && + FenxiaoSettingConstant.FX_ZGFY_YES.equals(zgfy.getParamValue())) { + if(item.getShopSku().getSelfPrice() == null + ||item.getShopSku().getSealesPrice().doubleValue() == 0){ + selfAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSelfCommission()/100); + }else { + //按产品设置的自购返佣金额计算 + selfAmount+=item.getShopSku().getSelfPrice().doubleValue()*item.getCount(); + } + } + } + } + } + //自购返佣记录 + if(selfAmount > 0) { + //整体的优惠金额折算成折扣,* 佣金 + zk=(order.getOrderMoney().doubleValue()-order.getPostage().doubleValue())/orderTotal; + selfAmount=selfAmount*zk; + salesmanOrder.setAmount(selfAmount); + salesmanOrder.setSalesUserId(order.getUserId()); + shopSalesmanOrderDao.insert(salesmanOrder); + } + } + + //存在上级 + if(sysVipInfo.getRecommendId()!=null) { + SysVipInfo salesMan=sysVipInfoService.findById(sysVipInfo.getRecommendId()); + Double salesAmount=0D; + Double invitationAmount=0D; + SysVipInfo invitationMan=null; + ShopSalesmanOrder invitationOrder=null; + boolean hasInvitationMan=salesMan.getRecommendId()!=null; + //判断推广员是否还存在上级,存在则计算邀请收益 + if(hasInvitationMan){ + invitationMan=sysVipInfoService.findById(salesMan.getRecommendId()); + invitationOrder=new ShopSalesmanOrder(); + BeanUtils.copyProperties(salesmanOrder,invitationOrder); + invitationOrder.setSalesUserId(invitationMan.getId()); + invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION); + } + //收益计算 + for (ShopOrderDetails item:order.getDetails() ){ + if(item.getShopProduct().getAbleSales()== ShopProduct.ABLE_SALES){ + //按分销等级计算 + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(salesMan.getSalesmanGrade()); + //推广提成,按分销等级计算或者按产品设置的推广金额计算 + if(item.getShopSku().getSealesPrice()==null + ||item.getShopSku().getSealesPrice().doubleValue()==0){ + salesAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSealesCommission()/100); + }else{ + salesAmount+=item.getShopSku().getSealesPrice().doubleValue()*item.getCount(); + } + //邀请提成,获取商品的邀请提成价格和是否有上级推广人,如果没有设置,在去获取当前推广人的等级的自购返佣比例 + if(hasInvitationMan) { + if(item.getShopSku().getInvitationPrice() == null + ||item.getShopSku().getInvitationPrice().doubleValue() == 0){ + //获取上级的推广等级设置 + ShopSalesmanGrade invitationManGrade = shopSalesmanGradeDao.selectById(invitationMan.getSalesmanGrade()); + invitationAmount+=item.getTotalPrice().doubleValue()*(invitationManGrade.getInvitationCommission()/100); + }else { + //按产品设置的邀请提成价格计算 + invitationAmount+=item.getShopSku().getInvitationPrice().doubleValue()*item.getCount(); + } + } + } + } + //推广提成记录 + if(salesAmount>0){ + //整体的优惠金额折算成折扣,* 佣金 + zk=(order.getOrderMoney().doubleValue()-order.getPostage().doubleValue())/orderTotal; + salesAmount=salesAmount*zk; + salesmanOrder.setAmount(salesAmount); + salesmanOrder.setSalesUserId(sysVipInfo.getRecommendId()); + shopSalesmanOrderDao.insert(salesmanOrder); + } + //邀请提成记录 + if(invitationAmount > 0) { + //整体的优惠金额折算成折扣,* 佣金 + invitationAmount=invitationAmount*zk; + invitationOrder.setAmount(invitationAmount); + shopSalesmanOrderDao.insert(invitationOrder); + } + }else{ + LogUtil.debug("不存在父级userOpid={}",sysVipInfo.getOpenId()); + } + + + + + } + + + +} diff --git a/zq-erp/src/test/java/com/matrix/LocalCacheTest.java b/zq-erp/src/test/java/com/matrix/LocalCacheTest.java new file mode 100644 index 0000000..df54f35 --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/LocalCacheTest.java @@ -0,0 +1,35 @@ +/** + * projectName: zq-erp + * fileName: LocalCacheTest.java + * packageName: com.matrix + * date: 2021-10-25 14:03 + * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. + */ +package com.matrix; + +import com.matrix.system.common.init.LocalCache; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; + +/** + * @version: V1.0 + * @author: JiangYouYao + * @className: LocalCacheTest + * @packageName: com.matrix + * @description: LocalCache + * @data: 2021-10-25 14:03 + **/ +public class LocalCacheTest { + + @Test + public void testNoticeTask() throws IOException, InterruptedException { + LocalCache.save("name","jyy",1000*3); + System.out.println("放入对象"); + Assert.assertNotNull(LocalCache.get("name")); + Thread.sleep(1000*5); + Assert.assertNull(LocalCache.get("name")); + } + +} \ No newline at end of file diff --git a/zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java b/zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java new file mode 100644 index 0000000..d261d4e --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java @@ -0,0 +1,161 @@ +package com.matrix; + +import cn.hutool.core.collection.CollectionUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysCompany; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.common.dao.SysCompanyDao; +import com.matrix.system.constance.Dictionary; +import com.matrix.system.hive.bean.ParameterSettings; +import com.matrix.system.hive.dao.ParameterSettingsDao; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; +import java.util.List; + +/** + * 配置工具 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) +public class ParameterSettingsTool { + + + @Autowired + private ParameterSettingsDao parameterSettingsDao; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + @Autowired + private SysCompanyDao sysCompanyDao; + + /* + 给所有公司加上多个配置,如果已经存在则跳过 + */ + @Test + public void addSettings(){ + + List<ParameterSettings> newSettings=new ArrayList<>(); + + + ParameterSettings newSetting1=new ParameterSettings(); + newSetting1.setCode("APP_BANNER_GL"); + newSetting1.setName("APP管理模块Banner"); + newSetting1.setType(1); + newSetting1.setCategory("APP设置"); + newSettings.add(newSetting1); + + ParameterSettings newSetting2=new ParameterSettings(); + newSetting2.setCode(AppConstance.WAREHOUSE_MANAGE_STOCK); + newSetting2.setName("是否管理产品库存"); + newSetting2.setType(1); + newSetting2.setCategory("仓库设置"); + newSettings.add(newSetting2); + + ParameterSettings newSetting3=new ParameterSettings(); + newSetting3.setCode(AppConstance.WECHARPAY_RECHARGE_NOTIFYURL); + newSetting3.setName("储值卡充值回调地址"); + newSetting3.setType(1); + newSetting3.setCategory("微信开发配置"); + newSettings.add(newSetting3); + + ParameterSettings newSetting4=new ParameterSettings(); + newSetting4.setCode(AppConstance.SHOP_MANAGE_JJCPAS_CONSUME); + newSetting4.setName("家居产品销售是否生成消耗业绩"); + newSetting4.setType(1); + newSetting4.setCategory("店务配置"); + newSettings.add(newSetting4); + + ParameterSettings newSetting5=new ParameterSettings(); + newSetting5.setCode(AppConstance.WX_ORDER_NOTICE_DINGDING_TOKEN); + newSetting5.setName("钉钉通知token"); + newSetting5.setType(1); + newSetting5.setCategory("微商城配置"); + newSettings.add(newSetting5); + + ParameterSettings newSetting6=new ParameterSettings(); + newSetting6.setCode(Dictionary.ZS_CONSUME_ACHIEVE); + newSetting6.setName("赠送项目是否计算消耗业绩"); + newSetting6.setType(1); + newSetting6.setCategory("店务配置"); + newSettings.add(newSetting6); + + ParameterSettings newSetting7=new ParameterSettings(); + newSetting7.setCode(AppConstance.SHOP_MANAGE_GIFTISFREE); + newSetting7.setName("赠送金额购买产品算赠送购买"); + newSetting7.setType(1); + newSetting7.setCategory("店务配置"); + newSettings.add(newSetting7); + + + ParameterSettings newSetting8=new ParameterSettings(); + newSetting8.setCode(AppConstance.SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER); + newSetting8.setName("门店是否只能取消待付款订单,服务单"); + newSetting8.setType(1); + newSetting8.setCategory("店务配置"); + newSettings.add(newSetting8); + + ParameterSettings newSetting9=new ParameterSettings(); + newSetting9.setCode(AppConstance.SERVICE_FLOW_TEMPLATE); + newSetting9.setName("跟进记录模板"); + newSetting9.setType(5); + newSetting9.setCategory("店务配置"); + newSettings.add(newSetting9); + + ParameterSettings newSetting10=new ParameterSettings(); + newSetting10.setCode(AppConstance.OPEN_SMS_NOTICE); + newSetting10.setName("是否开启短信提醒"); + newSetting10.setType(1); + newSetting10.setCategory("店务配置"); + newSettings.add(newSetting10); + + ParameterSettings newSetting11=new ParameterSettings(); + newSetting11.setCode(AppConstance.OPEN_SERVICE_ORDER_AUTO_BATCHING); + newSetting11.setName("开启服务单自动配料"); + newSetting11.setType(1); + newSetting11.setCategory("店务配置"); + newSettings.add(newSetting11); + + for (ParameterSettings newSetting : newSettings) { + List<ParameterSettings> parameterSettings = parameterSettingsDao.selectByModel(newSetting); + if(CollectionUtil.isEmpty(parameterSettings)){ + parameterSettingsDao.insert(newSetting); + System.out.println("新增配置"+newSetting.getName()); + } + addSettingsTOAllCompany(newSetting); + } + } + + private void addSettingsTOAllCompany(ParameterSettings newSetting) { + + List<SysCompany> allCompany = sysCompanyDao.selectByModel(null); + + for (SysCompany sysCompany : allCompany) { + BusParameterSettings checkExist = busParameterSettingsDao.selectCompanyParamByCode(newSetting.getCode(), sysCompany.getComId()); + if(checkExist==null){ + BusParameterSettings busParameterSettings=new BusParameterSettings(); + busParameterSettings.setCompanyId(sysCompany.getComId()); + busParameterSettings.setParamCode(newSetting.getCode()); + busParameterSettings.setParamValue(""); + busParameterSettingsDao.insert(busParameterSettings); + System.out.println(sysCompany.getComName()+"新增成功"); + } + + } + + + + } + + +} diff --git a/zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java b/zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java new file mode 100644 index 0000000..196c2c1 --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java @@ -0,0 +1,247 @@ +package com.matrix; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.matrix.system.hive.bean.SysVipInfo; +import com.matrix.system.hive.service.SysVipInfoService; +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; +import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; +import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; +import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; +import com.matrix.system.hive.dao.SysOrderDao; +import com.matrix.system.hive.dao.SysOrderItemDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.hive.service.ShoppingGoodsService; +import com.matrix.system.hive.service.SysOrderService; +import com.matrix.system.shopXcx.bean.ShopOrder; +import com.matrix.system.shopXcx.bean.ShopOrderDetails; +import com.matrix.system.shopXcx.bean.ShopProduct; +import com.matrix.system.shopXcx.bean.ShopSku; +import com.matrix.system.shopXcx.dao.ShopOrderDao; +import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; +import com.matrix.system.shopXcx.dao.ShopSkuDao; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) +public class SalesOrderTaskTest { + + + + + @Autowired + ShopOrderDao shopOrderDao; + @Autowired + ShopOrderDetailsDao shopOrderDetailsDao; + + @Autowired + SysVipInfoService sysVipInfoService; + + + @Autowired + SysVipInfoDao vipDap; + + @Autowired + SysVipInfoDao vipDao; + + @Autowired + CodeService codeService; + + @Autowired + SysOrderDao sysOrderDao; + + @Autowired + ShoppingGoodsService shoppingGoodsService; + + @Autowired + SysOrderItemDao orderItemDao; + + @Autowired + SysOrderService orderService; + + @Autowired + ShopSkuDao shopSkuDao; + + @Autowired + BusParameterSettingsDao parameterSettingsDao; + + + @Autowired + private ShopSalesmanOrderDao shopSalesmanOrderDao; + + @Autowired + private ShopSalesmanGradeDao shopSalesmanGradeDao; + + /** + * 处理分销订单 + * @param order + */ + @Test + public void handleExtensionOrder() { + ShopOrder order = new ShopOrder(); + + order.setId(1190); + order.setCompanyId(36L); + + List<ShopOrderDetails> details = new ArrayList<ShopOrderDetails>(); + ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); + shopOrderDetails.setTotalPrice(new BigDecimal(0.01)); + + ShopProduct shopProduct = new ShopProduct(); + shopProduct.setAttrValues("测试"); + shopProduct.setAbleSales(1); + + ShopSku shopSku = new ShopSku(); + shopOrderDetails.setShopSku(shopSku); + shopOrderDetails.setShopProduct(shopProduct); + shopOrderDetails.setCount(1); + details.add(shopOrderDetails); + + order.setDetails(details); + order.setOrderMoney(new BigDecimal(0.01)); + //判读客户是否存在上级,存在则产生上级的收益 + SysVipInfo sysVipInfo = sysVipInfoService.findById(order.getUserId()); + LogUtil.debug("处理分销订单userOpid={}",sysVipInfo.getId()); + //判断是否重复生成 + QueryWrapper queryWrapper=new QueryWrapper(); + queryWrapper.eq("order_id",order.getId()); + Integer orderCount = shopSalesmanOrderDao.selectCount(queryWrapper); + if(orderCount==0){ + ShopSalesmanOrder salesmanOrder=new ShopSalesmanOrder(); + salesmanOrder.setCompanyId(order.getCompanyId()); + salesmanOrder.setCreateBy(MatrixConstance.SYSTEM_USER); + salesmanOrder.setUpdateBy(MatrixConstance.SYSTEM_USER); + salesmanOrder.setCreateTime(new Date()); + salesmanOrder.setUpdateTime(new Date()); + salesmanOrder.setOrderId(Long.parseLong(order.getId()+"")); + salesmanOrder.setUserId(order.getUserId()); + salesmanOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_SALES); + salesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_DJS); + Double selfAmount=0D; + Double zk=1D; + //分销订单总额 + Double orderTotal=0D; + for (ShopOrderDetails item:order.getDetails() ){ + if(StringUtils.isNotBlank(item.getShopProduct().getAttrValues()) + && item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + orderTotal+=item.getTotalPrice().doubleValue(); + } + } + //自购返佣 + for (ShopOrderDetails item:order.getDetails() ){ + if(StringUtils.isNotBlank(item.getShopProduct().getAttrValues()) + && item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + //分销规则是否开启自购返佣 + BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, sysVipInfo.getCompanyId()); + //按分销等级计算 + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); + if(ObjectUtil.isNotEmpty(zgfy)) { + //获取商品的自购返佣价格,如果没有设置,在去获取当前推广人的等级的自购返佣比例 + if(StrUtil.isNotEmpty(zgfy.getParamValue()) && + FenxiaoSettingConstant.FX_ZGFY_YES.equals(zgfy.getParamValue())) { + if(item.getShopSku().getSelfPrice() == null + ||item.getShopSku().getSealesPrice().doubleValue() == 0){ + selfAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSelfCommission()/100); + }else { + //按产品设置的自购返佣金额计算 + selfAmount+=item.getShopSku().getSelfPrice().doubleValue()*item.getCount(); + } + } + } + } + } + //自购返佣记录 + if(selfAmount > 0) { + //整体的优惠金额折算成折扣,* 佣金 + zk=order.getOrderMoney().doubleValue()/orderTotal; + selfAmount=selfAmount*zk; + salesmanOrder.setAmount(selfAmount); + salesmanOrder.setSalesUserId(order.getUserId()); + shopSalesmanOrderDao.insert(salesmanOrder); + } + //存在上级 + if(sysVipInfo.getRecommendId()!=null) { + SysVipInfo salesMan=sysVipInfoService.findById(sysVipInfo.getRecommendId()); + Double salesAmount=0D; + Double invitationAmount=0D; + SysVipInfo invitationMan=null; + ShopSalesmanOrder invitationOrder=null; + boolean hasInvitationMan=salesMan.getRecommendId()!=null; + //判断推广员是否还存在上级,存在则计算邀请收益 + if(hasInvitationMan){ + invitationMan=sysVipInfoService.findById(salesMan.getRecommendId()); + invitationOrder=new ShopSalesmanOrder(); + BeanUtils.copyProperties(salesmanOrder,invitationOrder); + invitationOrder.setSalesUserId(invitationMan.getId()); + invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION); + } + //收益计算 + for (ShopOrderDetails item:order.getDetails() ){ + if(StringUtils.isNotBlank(item.getShopProduct().getAttrValues()) + && item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ + //按分销等级计算 + ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(salesMan.getSalesmanGrade()); + //推广提成,按分销等级计算或者按产品设置的推广金额计算 + if(item.getShopSku().getSealesPrice()==null + ||item.getShopSku().getSealesPrice().doubleValue()==0){ + salesAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSealesCommission()/100); + }else{ + salesAmount+=item.getShopSku().getSealesPrice().doubleValue()*item.getCount(); + } + //邀请提成,获取商品的邀请提成价格和是否有上级推广人,如果没有设置,在去获取当前推广人的等级的自购返佣比例 + if(hasInvitationMan) { + if(item.getShopSku().getInvitationPrice() == null + ||item.getShopSku().getInvitationPrice().doubleValue() == 0){ + //获取上级的推广等级设置 + ShopSalesmanGrade invitationManGrade = shopSalesmanGradeDao.selectById(invitationMan.getSalesmanGrade()); + invitationAmount+=item.getTotalPrice().doubleValue()*(invitationManGrade.getInvitationCommission()/100); + }else { + //按产品设置的邀请提成价格计算 + invitationAmount+=item.getShopSku().getInvitationPrice().doubleValue()*item.getCount(); + } + } + } + } + //推广提成记录 + if(salesAmount>0){ + //整体的优惠金额折算成折扣,* 佣金 + zk=order.getOrderMoney().doubleValue()/orderTotal; + salesAmount=salesAmount*zk; + salesmanOrder.setAmount(salesAmount); + salesmanOrder.setSalesUserId(sysVipInfo.getRecommendId()); + shopSalesmanOrderDao.insert(salesmanOrder); + } + //邀请提成记录 + if(invitationAmount > 0) { + //整体的优惠金额折算成折扣,* 佣金 + invitationAmount=invitationAmount*zk; + invitationOrder.setAmount(invitationAmount); + shopSalesmanOrderDao.insert(invitationOrder); + } + }else{ + LogUtil.debug("不存在父级userOpid={}",sysVipInfo.getId()); + } + }else{ + LogUtil.debug("重复订单id={}",order.getId()); + } + } + +} diff --git a/zq-erp/src/test/java/com/matrix/SourceFlowTests.java b/zq-erp/src/test/java/com/matrix/SourceFlowTests.java index df6c349..9583c8c 100644 --- a/zq-erp/src/test/java/com/matrix/SourceFlowTests.java +++ b/zq-erp/src/test/java/com/matrix/SourceFlowTests.java @@ -1,15 +1,11 @@ package com.matrix; +import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; import com.matrix.core.tools.StringUtils; -import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.MoneyCardUse; -import com.matrix.system.hive.bean.ShoppingGoods; -import com.matrix.system.hive.bean.SysSourceFlow; -import com.matrix.system.hive.bean.SysVipInfo; -import com.matrix.system.hive.dao.MoneyCardUseDao; -import com.matrix.system.hive.dao.ShoppingGoodsDao; -import com.matrix.system.hive.dao.SysSourceFlowDao; -import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.*; +import com.matrix.system.hive.service.CodeService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -19,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.sql.DataSource; +import java.math.BigDecimal; import java.util.List; /** @@ -29,7 +26,7 @@ * @date 2019年2月25日 */ @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) public class SourceFlowTests { @Autowired @@ -51,7 +48,29 @@ @Autowired private SysVipInfoDao vipInfoDao; +@Autowired +WeixinServiceUtil weixinServiceUtil; + /** + * 企业付款到个人 + * @throws InterruptedException + */ + @Test + public void testPay() throws InterruptedException { + weixinServiceUtil.comPay("提现","TX123",1,"oJkRK4yelehsY4S7I6Ee1ydWtQMI",36L); + } + + + + /** + * 发送订阅消息 + * @throws InterruptedException + */ + @Test + public void testTopic() throws InterruptedException { + // rabiitMqTemplate.sendTopicMsg(RabbitMqConfig.MQ_EXCHANGE_TOPIC +"dev", MQTaskRouting.CREATE_ORDER+"dev", "123"); + Thread.sleep(10000); + } @Test @Transactional @@ -102,5 +121,81 @@ } + @Autowired + private SysOrderDao sysOrderDao; + + @Autowired + private CodeService codeService; + + @Autowired + private SysOrderItemDao sysOrderItemDao; + + @Autowired + private SysOrderFlowDao sysOrderFlowDao; + + /** + * sysOrderFlowDao.xml insert语句需将createTime和updateTime修改 + * SysOrderDao.xml insert语句需将update语句中cashPay加上 or cashPay == 0 + * + */ + @Test + public void orderTransfer() { + SysOrder query = new SysOrder(); + query.setStatu("已付款"); + List<SysOrder> sysOrders = sysOrderDao.selectByModel(query); + + for (SysOrder sysOrder : sysOrders) { + sysOrder.setCashPay(sysOrder.getZkTotal()); + sysOrder.setCardPay(0D); + sysOrderDao.update(sysOrder); + + List<SysOrderItem> items = sysOrderItemDao.selectByOrderId(sysOrder.getId()); + + SysOrderFlow flow = new SysOrderFlow(); + flow.setFlowNo("F" + sysOrder.getOrderNo().substring(1) + "-" + 1); + if (items.size() <= 0) { + continue; + } + Long goodsId = items.get(0).getGoodsId(); + ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); + + int j = 1; + boolean flag = false; + while (goods == null) { + if (items.size() <= 1) { + flag = true; + break; + } + goodsId = items.get(j).getGoodsId(); + goods = shoppingGoodsDao.selectById(goodsId); + j++; + if (j + 1 >= items.size()) { + flag = true; + break; + } + } + + if (flag) { + continue; + } + + flow.setFlowContent(goods.getName().trim() + "等" + items.size() + "件产品"); + flow.setOrderId(sysOrder.getId()); + flow.setAmount(BigDecimal.valueOf(sysOrder.getZkTotal())); + flow.setVipId(sysOrder.getVipId()); + flow.setFlowType(SysOrderFlow.FLOW_TYPE_BUY); + flow.setPayMethod("现金"); + flow.setShopId(sysOrder.getShopId()); + flow.setCreateTime(sysOrder.getOrderTime()); + flow.setUpdateTime(sysOrder.getOrderTime()); + flow.setCompanyId(sysOrder.getCompanyId()); + sysOrderFlowDao.insert(flow); + } + } + + @Autowired + private ShopSalesmanApplyDao salesmanApplyDao; + + } diff --git a/zq-erp/src/test/java/com/matrix/TaiYanAliyunSmsServiceTest.java b/zq-erp/src/test/java/com/matrix/TaiYanAliyunSmsServiceTest.java new file mode 100644 index 0000000..58b7772 --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/TaiYanAliyunSmsServiceTest.java @@ -0,0 +1,39 @@ +package com.matrix; + +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.service.SysProjServicesService; +import com.matrix.system.hive.service.TaiYanAliyunSmsService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) +public class TaiYanAliyunSmsServiceTest { + + + + @Autowired + private TaiYanAliyunSmsService taiYanAliyunSmsService; + @Autowired + SysProjServicesService projServicesService; + + + @Test + public void addSendYycgNotice(){ + SysProjServices byId = projServicesService.findById(215550L); + byId.setVipId(5949L); + taiYanAliyunSmsService.sendYycgNotice(byId); + taiYanAliyunSmsService.sendHkNotice(byId); + + } + + +} diff --git a/zq-erp/src/test/java/com/matrix/TcProjTest.java b/zq-erp/src/test/java/com/matrix/TcProjTest.java new file mode 100644 index 0000000..c1e7cf5 --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/TcProjTest.java @@ -0,0 +1,67 @@ +package com.matrix; + +import com.matrix.core.tools.StringUtils; +import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.bean.SysOrderFlow; +import com.matrix.system.hive.dao.AchieveNewDao; +import com.matrix.system.hive.dao.SysOrderFlowDao; +import com.matrix.system.hive.dao.SysProjUseDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wzy + * @date 2021-04-12 + **/ + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) +public class TcProjTest { + + @Autowired + private SysProjUseDao sysProjUseDao; + + @Autowired + AchieveNewDao achieveNewDao; + + @Autowired + SysOrderFlowDao orderFlowDao; + + @Test + public void tcProjTest() { + List<AchieveNew> achieveNewList=achieveNewDao.selectInPage(null,null); + ArrayList<Long> ids=new ArrayList<>(); + ArrayList<Long> xjs=new ArrayList<>(); + ArrayList<Long> hks=new ArrayList<>(); + + for (int i = 0; i < achieveNewList.size(); i++) { + AchieveNew item=achieveNewList.get(i); + if(StringUtils.isBlank(item.getPayMethod())){ + List<SysOrderFlow> orderFlows = orderFlowDao.selectByOrderId(item.getOrderId()); + if(orderFlows.size()==1){ + if(orderFlows.get(0).getPayMethod().equals("现金支付")){ + xjs.add(item.getId()); + }else{ + hks.add(item.getId()); + } + }else{ + ids.add(item.getOrderId()); + } + } + } + if(CollectionUtils.isNotEmpty(xjs)){ + achieveNewDao.setPayMethod("现金",xjs); + } + if(CollectionUtils.isNotEmpty(hks)){ + achieveNewDao.setPayMethod("划扣",hks); + } + System.out.println("未处理订单id"+ StringUtils.collToStr(ids,",")); + } +} diff --git a/zq-erp/src/test/java/com/matrix/TesatAsyncMessage.java b/zq-erp/src/test/java/com/matrix/TesatAsyncMessage.java new file mode 100644 index 0000000..c0f38ea --- /dev/null +++ b/zq-erp/src/test/java/com/matrix/TesatAsyncMessage.java @@ -0,0 +1,42 @@ +package com.matrix; + +import com.matrix.component.asyncmessage.AsyncMessageManager; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * 测试类示例 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class TesatAsyncMessage { + + + @Autowired + AsyncMessageManager asyncMessageManager; + + @Test + public void test() throws IOException { + + Map<String, Object> param =new HashMap<>(); + param.put("test","123"); + asyncMessageManager.sendMsg("testkey",param); + asyncMessageManager.sendMsg("testkey","test=%s","123456"); + + + } + + + +} diff --git "a/zq-erp/src/test/java/com/matrix/\345\233\233\346\234\210\344\273\275\345\256\266\345\261\205\344\272\247\345\223\201\344\270\232\347\273\251\346\201\242\345\244\215.java" "b/zq-erp/src/test/java/com/matrix/\345\233\233\346\234\210\344\273\275\345\256\266\345\261\205\344\272\247\345\223\201\344\270\232\347\273\251\346\201\242\345\244\215.java" new file mode 100644 index 0000000..4b1f86b --- /dev/null +++ "b/zq-erp/src/test/java/com/matrix/\345\233\233\346\234\210\344\273\275\345\256\266\345\261\205\344\272\247\345\223\201\344\270\232\347\273\251\346\201\242\345\244\215.java" @@ -0,0 +1,61 @@ +package com.matrix; + +import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.bean.SysOrderItem; +import com.matrix.system.hive.dao.AchieveNewDao; +import com.matrix.system.hive.dao.SysOrderDao; +import com.matrix.system.hive.dao.SysOrderItemDao; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +/** + * 测试类示例 + * + * @author jiangyouyao + * @email 512061637@qq.com + * @date 2019年2月25日 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {ZqErpApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class 四月份家居产品业绩恢复 { + + @Autowired + SysOrderDao sysOrderDao; + + @Autowired + SysOrderItemDao itemDao; + + @Autowired + AchieveNewDao achieveNewDao; + + + @Test + public void recoverAchieve() { + + AchieveNew queryAchieve=new AchieveNew(); + List<SysOrderItem> items = itemDao.selectDgd(); + for (SysOrderItem item : + items) { + if(item.getType().equals("家居产品")){ + queryAchieve.setOrderItemId(item.getId()); + List<AchieveNew> achieveNews = achieveNewDao.selectByModel(queryAchieve); + for (AchieveNew achieve : + achieveNews) { + if(achieve.getHisConsume()==null){ + achieve.setHisConsume(achieve.getGoodsCash()); + achieveNewDao.updateByModel(achieve); + System.out.println("更新业绩"+achieve.getId()); + } + } + } + } + + } + + +} diff --git a/zq-xcx/app.js b/zq-xcx/app.js index 9d5e4c2..32f21c2 100644 --- a/zq-xcx/app.js +++ b/zq-xcx/app.js @@ -3,7 +3,7 @@ var api = require('utils/service-api.js'); App({ - baseUrl: "https://xcxhive2.jyymatrix.cc", + baseUrl: "https://filehive2.jyymatrix.cc/xcxapi", // baseUrl : "http://localhost:8080", //登录后获得的token diff --git a/zq-xcx/project.config.json b/zq-xcx/project.config.json index 3188dd3..a6ed60e 100644 --- a/zq-xcx/project.config.json +++ b/zq-xcx/project.config.json @@ -1,222 +1,224 @@ { - "description": "项目配置文件。", - "packOptions": { - "ignore": [] - }, - "setting": { - "urlCheck": false, - "es6": true, - "enhance": true, - "postcss": true, - "preloadBackgroundData": false, - "minified": true, - "newFeature": true, - "coverView": true, - "nodeModules": false, - "autoAudits": false, - "showShadowRootInWxmlPanel": true, - "scopeDataCheck": false, - "uglifyFileName": false, - "checkInvalidKey": true, - "checkSiteMap": true, - "uploadWithSourceMap": true, - "compileHotReLoad": false, - "useMultiFrameRuntime": false, - "useApiHook": true, - "babelSetting": { - "ignore": [], - "disablePlugins": [], - "outputPath": "" - }, - "useIsolateContext": true, - "useCompilerModule": true, - "userConfirmedUseCompilerModuleSwitch": false, - "packNpmManually": false, - "packNpmRelationList": [], - "enableEngineNative": false, - "minifyWXSS": true - }, - "compileType": "miniprogram", - "libVersion": "1.9.98", - "appid": "wx3836ab3c1490ff29", - "projectname": "%E8%82%BD%E7%A0%94", - "isGameTourist": false, - "simulatorType": "wechat", - "simulatorPluginLibVersion": {}, - "condition": { - "search": { - "list": [] - }, - "conversation": { - "list": [] - }, - "plugin": { - "list": [] - }, - "game": { - "currentL": -1, - "list": [] - }, - "gamePlugin": { - "list": [] - }, - "miniprogram": { - "list": [ - { - "id": -1, - "name": "pages/yuyue/yyInfo", - "pathName": "pages/yuyue/yyInfo", - "query": "model=1&id=10", - "scene": null - }, - { - "id": -1, - "name": "pages/customerCenter/customerCenter", - "pathName": "pages/customerCenter/customerCenter", - "query": "", - "scene": null - }, - { - "id": -1, - "name": "pages/yuyue/order", - "pathName": "pages/yuyue/order", - "query": "status=0", - "scene": null - }, - { - "id": -1, - "name": "pages/service/service", - "pathName": "pages/service/service", - "query": "status=0", - "scene": null - }, - { - "id": -1, - "name": "pages/logistics/logistics", - "pathName": "pages/logistics/logistics", - "query": "id=911", - "scene": null - }, - { - "id": -1, - "name": "pages/yuyue/choseShop", - "pathName": "pages/yuyue/choseShop", - "query": "", - "scene": null - }, - { - "id": -1, - "name": "pages/service/service2", - "pathName": "pages/service/service2", - "query": "", - "scene": null - }, - { - "id": -1, - "name": "pages/shopCar/shopCar", - "pathName": "pages/shopCar/shopCar", - "query": "", - "scene": null - }, - { - "id": 8, - "name": "pages/groupbuy/groupList", - "pathName": "pages/groupbuy/groupList", - "query": "", - "scene": null - }, - { - "id": 9, - "name": "groupDetails", - "pathName": "pages/groupbuy/groupDetails", - "query": "", - "scene": null - }, - { - "id": -1, - "name": "pages/miaosha/msList", - "pathName": "pages/miaosha/msList", - "query": "", - "scene": null - }, - { - "id": 11, - "name": "pages/groupbuy/groupDetails", - "pathName": "pages/groupbuy/groupDetails", - "query": "id=1&shopId=16&gjId=12", - "scene": null - }, - { - "id": 12, - "name": "pages/groupbuy/groupDetails", - "pathName": "pages/groupbuy/groupDetails", - "query": "id=1&shopId=16&gjId=1", - "scene": null - }, - { - "id": 13, - "name": "pages/groupbuy/groupDetails", - "pathName": "pages/groupbuy/groupDetails", - "query": "id=1&shopId=16&gjId=1", - "scene": null - }, - { - "id": 14, - "name": "pages/groupbuy/groupDetails", - "pathName": "pages/groupbuy/groupDetails", - "query": "id=2&shopId=33&gjId=9", - "scene": null - }, - { - "id": -1, - "name": "pages/payOrder/paySuccess", - "pathName": "pages/payOrder/paySuccess", - "query": "showModel=1", - "scene": null - }, - { - "id": -1, - "name": "pages/miaosha/msList", - "pathName": "pages/miaosha/msList", - "query": "id=2&shopId=33&gjId=9", - "scene": null - }, - { - "id": -1, - "name": "pages/customerCenter/customerCenter", - "pathName": "pages/shalong/shalongList", - "query": "id=2&shopId=33&gjId=9", - "scene": null - }, - { - "id": -1, - "name": "pages/index/index", - "pathName": "pages/shalong/shalongList", - "query": "", - "scene": null - }, - { - "id": -1, - "name": "pages/groupbuy/groupDetails", - "pathName": "pages/groupbuy/groupDetails", - "query": "id=1&shopId=16&gjId=15", - "scene": null - }, - { - "id": 20, - "name": "pages/ads/showAdPage", - "pathName": "pages/ads/showAdPage", - "query": "pageCode=index", - "scene": null - }, - { - "id": -1, - "name": "pages/shalong/shalongDetail", - "pathName": "pages/shalong/shalongDetail", - "query": "id=6", - "scene": null - } - ] - } - } + "description": "项目配置文件。", + "packOptions": { + "ignore": [] + }, + "setting": { + "urlCheck": false, + "es6": true, + "enhance": true, + "postcss": true, + "preloadBackgroundData": false, + "minified": true, + "newFeature": true, + "coverView": true, + "nodeModules": false, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, + "uglifyFileName": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "compileHotReLoad": false, + "useMultiFrameRuntime": true, + "useApiHook": true, + "useApiHostProcess": false, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "enableEngineNative": false, + "bundle": false, + "useIsolateContext": true, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, + "userConfirmedBundleSwitch": false, + "packNpmManually": false, + "packNpmRelationList": [], + "minifyWXSS": true + }, + "compileType": "miniprogram", + "libVersion": "1.9.98", + "appid": "wx3836ab3c1490ff29", + "projectname": "%E8%82%BD%E7%A0%94", + "isGameTourist": false, + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": { + "plugin": { + "list": [] + }, + "game": { + "list": [] + }, + "gamePlugin": { + "list": [] + }, + "miniprogram": { + "list": [ + { + "id": -1, + "name": "pages/yuyue/yyInfo", + "pathName": "pages/yuyue/yyInfo", + "query": "model=1&id=10", + "scene": null + }, + { + "id": -1, + "name": "pages/customerCenter/customerCenter", + "pathName": "pages/customerCenter/customerCenter", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/yuyue/order", + "pathName": "pages/yuyue/order", + "query": "status=0", + "scene": null + }, + { + "id": -1, + "name": "pages/service/service", + "pathName": "pages/service/service", + "query": "status=0", + "scene": null + }, + { + "id": -1, + "name": "pages/logistics/logistics", + "pathName": "pages/logistics/logistics", + "query": "id=911", + "scene": null + }, + { + "id": -1, + "name": "pages/yuyue/choseShop", + "pathName": "pages/yuyue/choseShop", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/service/service2", + "pathName": "pages/service/service2", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/shopCar/shopCar", + "pathName": "pages/shopCar/shopCar", + "query": "", + "scene": null + }, + { + "id": 8, + "name": "pages/groupbuy/groupList", + "pathName": "pages/groupbuy/groupList", + "query": "", + "scene": null + }, + { + "id": 9, + "name": "groupDetails", + "pathName": "pages/groupbuy/groupDetails", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/miaosha/msList", + "pathName": "pages/miaosha/msList", + "query": "", + "scene": null + }, + { + "id": 11, + "name": "pages/groupbuy/groupDetails", + "pathName": "pages/groupbuy/groupDetails", + "query": "id=1&shopId=16&gjId=12", + "scene": null + }, + { + "id": 12, + "name": "pages/groupbuy/groupDetails", + "pathName": "pages/groupbuy/groupDetails", + "query": "id=1&shopId=16&gjId=1", + "scene": null + }, + { + "id": 13, + "name": "pages/groupbuy/groupDetails", + "pathName": "pages/groupbuy/groupDetails", + "query": "id=1&shopId=16&gjId=1", + "scene": null + }, + { + "id": 14, + "name": "pages/groupbuy/groupDetails", + "pathName": "pages/groupbuy/groupDetails", + "query": "id=2&shopId=33&gjId=9", + "scene": null + }, + { + "id": -1, + "name": "pages/payOrder/paySuccess", + "pathName": "pages/payOrder/paySuccess", + "query": "showModel=1", + "scene": null + }, + { + "id": -1, + "name": "pages/miaosha/msList", + "pathName": "pages/miaosha/msList", + "query": "id=2&shopId=33&gjId=9", + "scene": null + }, + { + "id": -1, + "name": "pages/customerCenter/customerCenter", + "pathName": "pages/shalong/shalongList", + "query": "id=2&shopId=33&gjId=9", + "scene": null + }, + { + "id": -1, + "name": "pages/index/index", + "pathName": "pages/shalong/shalongList", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/groupbuy/groupDetails", + "pathName": "pages/groupbuy/groupDetails", + "query": "id=1&shopId=16&gjId=15", + "scene": null + }, + { + "id": 20, + "name": "pages/ads/showAdPage", + "pathName": "pages/ads/showAdPage", + "query": "pageCode=index", + "scene": null + }, + { + "id": -1, + "name": "pages/shalong/shalongDetail", + "pathName": "pages/shalong/shalongDetail", + "query": "id=6", + "scene": null + }, + { + "name": "pages/yuyue/showYyInfo", + "pathName": "pages/yuyue/showYyInfo", + "query": "id=3004", + "scene": null + } + ] + } + } } \ No newline at end of file diff --git a/zq-xcx/utils/util.js b/zq-xcx/utils/util.js index 6fc81a6..8447699 100644 --- a/zq-xcx/utils/util.js +++ b/zq-xcx/utils/util.js @@ -2,7 +2,7 @@ * 通用js */ -var debugHost='www.baidu.com'; +var debugHost='taiyan'; // api地址,请求参数,回调函数,是否遮罩 function request(params) { @@ -36,8 +36,8 @@ method: "POST", header: { 'content-type': 'application/json', - 'debugHost':debugHost - // 'host':'www.jyymatrix.cc' + //'debugHost':debugHost, + 'companyCode':'debugHost' }, data: {}, success: function(res) { @@ -90,7 +90,7 @@ method: option.method, header: { 'content-type': 'application/json', - 'debugHost':debugHost, + 'companyCode':debugHost, 'token': getApp().loginToken }, data: data, @@ -172,7 +172,7 @@ header: { "Content-Type": "multipart/form-data", 'token': res.data, - 'debugHost':debugHost + 'companyCode':debugHost }, formData: formData, success: function(e) { @@ -303,7 +303,7 @@ method: "POST", header: { 'content-type': 'application/json', - 'debugHost':debugHost + 'companyCode':debugHost }, data: {}, success: function(res) { -- Gitblit v1.9.1