From 4d4805096b898a6e99f31794facb81794bd1fcf7 Mon Sep 17 00:00:00 2001 From: jyy <935090232@qq.com> Date: Mon, 25 Jan 2021 09:39:24 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/hive2.0' into hive2.0 --- zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/custom-consume-list.html | 155 zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-list.html | 1 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java | 59 zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java | 44 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/wechart/templateMsg/demo/MsgDemo2.java | 71 zq-xcx/project.config.json | 6 zq-erp/src/main/resources/config/test/application.properties | 21 zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java | 48 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 | 225 zq-erp/src/main/resources/templates/views/admin/hive/statistics/store-inout-list.html | 33 zq-erp/src/main/java/com/matrix/system/hive/pojo/StoreInOutRecordVO.java | 9 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/resources/static/js/plugin/moment.mini.js | 2 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/java/com/matrix/system/hive/bean/SysVipLevel.java | 8 zq-erp/src/main/resources/config/system.properties | 14 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 | 90 zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java | 17 zq-erp/src/main/resources/templates/views/admin/hive/instore/store-list.html | 3 zq-erp/src/main/java/com/matrix/system/hive/bean/AppVersion.java | 71 zq-erp/src/main/java/com/matrix/system/app/dto/ServiceOrderListDto.java | 94 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopWxtemplateMsg.java | 89 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListVo.java | 170 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java | 99 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java | 36 zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java | 82 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java | 13 zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml | 119 zq-erp/src/main/resources/static/images/pay/zhifubao.png | 0 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysInstoreInfoServiceImpl.java | 3 zq-erp/src/main/resources/config/lhx/system.properties | 3 zq-erp/src/main/java/com/matrix/system/app/dto/ModifyUserDto.java | 116 zq-erp/src/main/java/com/matrix/system/app/mapper/MoneyCardUseMapper.java | 21 zq-erp/src/main/java/com/matrix/system/app/action/AppOccupancyController.java | 63 zq-erp/src/main/java/com/matrix/system/hive/service/imp/CodeServiceImpl.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListProjVo.java | 45 zq-erp/src/main/resources/config/lhx/application.properties | 2 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysBeauticianStateServiceImpl.java | 8 zq-erp/src/main/resources/config/test/system.properties | 134 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html | 157 zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java | 131 zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java | 11 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form-bak.html | 239 zq-erp/src/main/java/com/matrix/system/hive/service/SysBeauticianStateService.java | 2 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html | 1081 + zq-erp/src/main/java/com/matrix/system/hive/statistics/DailySaleVo.java | 412 zq-erp/src/main/java/com/matrix/system/app/dto/AddVipDto.java | 171 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java | 664 zq-erp/src/main/java/com/matrix/system/app/vo/RankingVo.java | 69 zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java | 1 zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUse-form.html | 14 zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java | 313 zq-erp/src/main/java/com/matrix/core/tools/DateUtil.java | 135 zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java | 1 zq-erp/src/main/java/com/matrix/system/app/action/ApiShopInfoAction.java | 43 zq-erp/src/main/java/com/matrix/system/app/vo/QuestionVo.java | 88 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html | 27 zq-erp/src/main/resources/config/db/increment/20210109.sql | 5 zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsCategoryController.java | 13 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java | 6 zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardAssembleDao.java | 6 zq-erp/src/main/java/com/matrix/system/hive/service/SysProjServicesService.java | 7 zq-erp/src/main/resources/mybatis/mapper/hive/SysWorkBeatuistaffDao.xml | 28 zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java | 226 zq-erp/src/main/java/com/matrix/system/app/action/TestAction.java | 24 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpOrderListDto.java | 78 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopProductDao.java | 2 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml | 205 zq-erp/src/main/java/com/matrix/system/hive/pojo/ShoppingCarItemsVo.java | 12 zq-erp/src/main/java/com/matrix/system/hiveErp/analysUtil/StatisticsParamVo.java | 35 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateOrderTime.html | 8 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardAssembleDao.xml | 20 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html | 13 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-sumary.html | 17 zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoVo.java | 67 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpServiceOrderListVo.java | 147 zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java | 63 zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java | 33 zq-erp/src/main/java/com/matrix/system/app/vo/UserInfoDetailVo.java | 116 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailVo.java | 158 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml | 2 zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java | 2 zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java | 182 zq-erp/src/main/java/com/matrix/system/hive/dao/ArticleDao.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatGzhApiTools.java | 134 zq-erp/src/main/java/com/matrix/system/hive/action/ArticleTypeController.java | 17 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopWxtemplateMsgDao.xml | 45 zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java | 129 zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderDao.java | 22 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-item.html | 2 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml | 103 zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsAssembleDao.xml | 13 zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsCategoryDao.java | 2 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-sumary.html | 19 zq-erp/src/main/java/com/matrix/system/app/mapper/SysUsersMapper.java | 53 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/java/com/matrix/system/app/dto/VipStatisticsParamDto.java | 100 zq-erp/src/main/resources/templates/views/admin/hive-erp/vip/vipInfo-list.html | 2 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/UniformMsgPojo.java | 32 zq-erp/src/main/resources/templates/views/admin/hive/vip/tc-form.html | 23 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml | 241 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 | 60 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/java/com/matrix/system/app/vo/ServiceOrderDetailItemVo.java | 107 zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml | 6 zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java | 286 zq-erp/src/main/resources/static/images/pay/cash.png | 0 zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java | 32 zq-erp/src/main/java/com/matrix/system/hive/bean/Article.java | 4 zq-erp/src/main/java/com/matrix/system/hive/action/SupplierInfoController.java | 10 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java | 304 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/resources/mybatis/mapper/hive/SysStoreInfoDao.xml | 16 zq-erp/src/main/java/com/matrix/system/constance/Dictionary.java | 9 zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java | 22 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderFlowServiceImpl.java | 71 zq-erp/src/main/java/com/matrix/system/app/vo/UserAchieveVo.java | 91 zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java | 9 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java | 87 zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailVo.java | 184 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderItemServiceImpl.java | 4 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html | 157 zq-erp/src/main/resources/mybatis/mapper/hive/ArticleTypeDao.xml | 20 zq-erp/src/main/java/com/matrix/system/app/dto/LoginDto.java | 38 zq-erp/src/main/java/com/matrix/system/hive/bean/SysSkinCheckRecord.java | 38 zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml | 408 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-item.html | 17 zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java | 54 zq-erp/src/main/java/com/matrix/system/app/action/ApiVipLabelAction.java | 82 zq-erp/src/main/resources/config/prd/application.properties | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java | 3 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/FwwcTemplateMessageBulder.java | 109 zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsListVo.java | 118 zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java | 1 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YycgTemplateMessageBulder.java | 115 zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsCategoryDao.xml | 16 zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml | 213 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceTcVo.java | 126 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderFlowDao.xml | 78 zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java | 58 zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java | 128 zq-erp/src/main/resources/config/dev/system.properties | 6 zq-erp/src/main/java/com/matrix/system/app/dto/OrderListDto.java | 84 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html | 8 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java | 112 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/hive/dao/SysVipInfoDao.java | 6 zq-erp/src/main/java/com/matrix/system/hive/pojo/CzXkVo.java | 14 zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java | 8 zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java | 56 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml | 37 zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml | 228 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-summary.html | 34 zq-erp/src/main/java/com/matrix/system/app/action/ApiServiceOrderAction.java | 299 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-summary.html | 35 zq-erp/src/main/java/com/matrix/system/app/dto/FollowupListDto.java | 135 zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderFlow.java | 200 zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java | 44 zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsCategoryServiceImpl.java | 7 zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java | 180 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-sumary.html | 19 zq-erp/src/main/java/com/matrix/system/app/dto/ModifyVipDto.java | 183 zq-erp/pom.xml | 46 zq-erp/src/main/java/com/matrix/system/app/dto/BusinessesDto.java | 45 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/serviceOrderDetail.html | 479 zq-erp/src/main/resources/static/images/pay/yinlian.png | 0 zq-erp/src/main/resources/config/xcx/system.properties | 47 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 | 8 zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderDto.java | 100 zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java | 43 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopWxtemplateMsgAction.java | 18 zq-erp/src/main/java/com/matrix/system/hive/bean/SysStoreInfo.java | 11 zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java | 62 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 | 161 zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html | 8 zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjServices.java | 30 zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java | 57 zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java | 12 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceCommentDto.java | 41 zq-erp/src/main/resources/templates/views/admin/hive/statistics/custom-consume-list.html | 161 zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html | 101 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderDetailVo.java | 140 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 | 16 zq-erp/src/main/java/com/matrix/system/app/vo/StoreListVo.java | 67 zq-erp/src/main/java/com/matrix/system/app/dto/UploadPhotoDto.java | 26 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java | 1 zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjServicesDao.java | 25 zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java | 23 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProductListVo.java | 58 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java | 96 zq-erp/src/main/java/com/matrix/system/app/dto/ServiceVipProjDto.java | 48 zq-erp/src/main/java/com/matrix/system/app/dto/VipInfoListDto.java | 122 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceOrderListProjVo.java | 47 zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java | 24 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java | 123 zq-erp/src/main/java/com/matrix/system/app/mapper/SysBeauticianStateMapper.java | 34 zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrder.java | 56 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projuse-item.html | 17 zq-erp/src/main/java/com/matrix/system/app/dto/BeauticianDto.java | 41 zq-erp/src/main/resources/templates/views/admin/shop/templateMsg-form.html | 13 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/paramProtocol/BrandWCPayRequestData.java | 6 zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUse.java | 73 zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderItemDto.java | 41 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml | 10 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 | 44 zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java | 89 zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java | 6 zq-erp/src/main/java/com/matrix/system/hiveErp/action/DataAnalysisCustomer.java | 73 zq-erp/src/main/resources/config/application.properties | 5 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projuse-sumary.html | 17 zq-erp/src/main/java/com/matrix/system/hive/service/ArticleService.java | 1 zq-erp/src/main/java/com/matrix/system/common/service/impl/SysUsersServiceImpl.java | 5 zq-erp/src/main/resources/mybatis/mapper/hive/SysSkinCheckRecordDao.xml | 15 zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml | 641 + 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/test/java/com/matrix/SourceFlowTests.java | 86 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java | 5 zq-erp/src/main/java/com/matrix/system/app/authority/AppAuthorityManager.java | 223 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 | 35 zq-erp/src/main/java/com/matrix/system/app/dto/CreateOderItemDto.java | 67 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java | 148 zq-erp/src/main/java/com/matrix/system/app/dto/BasePageDto.java | 38 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/resources/templates/views/admin/hive/beautySalon/pbxq-form.html | 297 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip_bak.html | 285 zq-erp/src/main/java/com/matrix/core/pojo/PaginationVO.java | 2 zq-erp/src/main/java/com/matrix/system/app/dto/RankingDto.java | 43 zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml | 147 zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html | 33 zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java | 220 zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoVo.java | 125 zq-erp/src/main/java/com/matrix/system/hive/action/TaocanController.java | 42 zq-erp/src/main/resources/templates/views/admin/hive/vip/sysSkinCheckRecord-form.html | 8 zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoDetailVo.java | 195 zq-erp/src/main/java/com/matrix/system/hive/bean/ArticleType.java | 21 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 | 42 zq-erp/src/main/java/com/matrix/system/hive/service/CodeService.java | 2 zq-erp/src/main/java/com/matrix/system/app/mapper/SysProjUseMapper.java | 37 zq-erp/src/main/java/com/matrix/config/SwaggerConfig.java | 57 zq-erp/src/main/java/com/matrix/system/common/actions/AdminAction.java | 25 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml | 157 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/java/com/matrix/system/app/dto/SkinCheckListDto.java | 22 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/resources/templates/views/admin/hive/beautySalon/vip.html | 1533 ++ zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java | 42 zq-erp/src/main/java/com/matrix/system/app/dto/PwdModifyDto.java | 38 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java | 139 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/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java | 94 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payComProtocol/JsApiPayComReqData.java | 6 zq-erp/src/main/java/com/matrix/system/app/vo/BeauticianVo.java | 61 zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java | 6 zq-erp/src/main/resources/config/xcx/application.properties | 40 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html | 2 zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailAchieveItemVo.java | 36 zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckListVo.java | 69 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html | 1009 + zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html | 502 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-projSercice-item.html | 17 zq-erp/src/main/java/com/matrix/system/hive/service/imp/DataAnalysisCustomerServiceImpl.java | 192 zq-erp/src/main/java/com/matrix/system/app/dto/UsersQueryDto.java | 23 zq-erp/src/main/java/com/matrix/system/app/mapper/SysSkinCheckRecordMapper.java | 38 zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml | 24 zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java | 300 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java | 187 zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml | 266 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form-bak.html | 159 zq-erp/src/main/java/com/matrix/component/tools/HttpClientUtil.java | 55 zq-erp/src/main/java/com/matrix/system/common/dao/SysUsersDao.java | 2 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java | 8 zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java | 12 zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java | 82 zq-erp/src/main/java/com/matrix/system/hive/dao/SysBeauticianStateDao.java | 4 zq-erp/src/main/resources/static/images/pay/tuan.png | 0 zq-erp/src/main/java/com/matrix/system/app/vo/VipCardListVo.java | 78 zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderFlowDao.java | 15 zq-erp/src/main/resources/templates/views/admin/sys/admin-form.html | 2 zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java | 2 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/GmcgTemplateMessageBulder.java | 106 zq-erp/src/main/java/com/matrix/system/app/action/ApiSkinCheckAction.java | 92 zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ErpOrderDetailItemVo.java | 63 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java | 62 zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java | 90 zq-erp/src/main/java/com/matrix/system/app/vo/OrderDetailItemVo.java | 125 zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java | 200 zq-erp/src/main/java/com/matrix/system/hive/service/imp/ArticleServiceImpl.java | 7 zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml | 13 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLevelDao.xml | 16 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java | 13 zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckDiagnoseItemVo.java | 31 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/payProtocol/JsApiPayReqData.java | 23 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/resources/templates/views/admin/hive/beautySalon/orderXq-form-bak.html | 140 zq-erp/src/main/resources/static/images/pay/qian.png | 0 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-item.html | 2 zq-erp/src/main/java/com/matrix/component/rabbitmq/RabiitMqTemplate.java | 1 zq-erp/src/main/resources/templates/views/admin/hive/vip/projUse-form.html | 21 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-projSercice-item.html | 17 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/wechart/templateMsg/Task/TemplateMessageBulder.java | 19 zq-erp/src/main/java/com/matrix/system/app/dto/QuestionAnswerItemDto.java | 56 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html | 8 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabelRelate.java | 41 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml | 10 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html | 561 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ErpServiceOrderListDto.java | 50 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/projUseFlow-list.html | 128 zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java | 176 zq-erp/src/main/java/com/matrix/system/app/vo/SkinCheckAnalysisItems.java | 77 zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderItem.java | 40 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopWxtemplateMsgDao.java | 2 zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java | 115 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/queryProtocol/ScanPayQueryReqData.java | 6 zq-erp/src/main/resources/templates/views/admin/hive/vip/moneyCardUseFlow-list.html | 70 zq-erp/src/main/java/com/matrix/system/app/dto/CreateOrderDto.java | 39 /dev/null | 19 zq-erp/src/main/java/com/matrix/core/tools/rr/GlueFactory.java | 23 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/WechatConfigure.java | 19 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service-hk.html | 8 zq-erp/src/main/resources/templates/views/admin/hive-erp/store/store-list.html | 2 zq-erp/src/main/java/com/matrix/core/exception/GlobalExceptionHandler.java | 34 zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java | 8 zq-erp/src/main/java/com/matrix/system/app/dto/StoreListDto.java | 23 349 files changed, 26,131 insertions(+), 2,824 deletions(-) diff --git a/zq-erp/pom.xml b/zq-erp/pom.xml index 9534212..9b8b408 100644 --- a/zq-erp/pom.xml +++ b/zq-erp/pom.xml @@ -341,7 +341,37 @@ <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> + </dependencies> <build> <resources> <resource> @@ -354,11 +384,11 @@ <exclude>config/test/*</exclude> <exclude>config/xcx/*</exclude> + <!-- --> <exclude>config/config.json</exclude> <exclude>config/application.properties</exclude> <exclude>config/system.properties</exclude> - <exclude>**/*.woff</exclude> @@ -393,6 +423,18 @@ <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> + </annotationProcessorPaths> + </configuration> </plugin> <!-- 热部署插件 --> 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/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/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/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..b0c8126 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..d38b928 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 @@ -70,16 +70,16 @@ * @param bankTrueName 收款号姓名 * @param bankCode 收款号开户行 */ - public JsApiPayComReqData(String desc, String outTradeNo, int totalFee, String bankNo, String bankTrueName, String bankCode) { + public JsApiPayComReqData(String mchID,String paySecret ,String desc, String outTradeNo, int totalFee, String bankNo, String bankTrueName, String bankCode) { //默认必须设置 - setMch_id(WechatConfigure.mchID); + setMch_id(mchID); setDesc(desc); setPartner_trade_no(outTradeNo); setAmount(totalFee); //随机字符串,不长于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(); 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..30c7d4d 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" @@ -62,7 +73,20 @@ // 创建微信支付预付接口 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 notifyUrl = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_NOTIFYURL, 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,7 +95,7 @@ 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{ @@ -115,7 +139,6 @@ * @param desc 描述 * @param outTradeNo 提现申请编号 * @param totalFee 提现金额(分) - * @param spBillCreateIP 调用接口的IP * @param openid * @return */ @@ -125,7 +148,12 @@ try { JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); // TODO 企业付款 - JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData("","",0,"","",""); + Long companyId=HostInterceptor.getCompanyId(); + BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId); + BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); + + + JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData(mchID.getParamValue(),paySecret.getParamValue(),"","",0,"","",""); JsApiPayComService jsApiPayComService=new JsApiPayComService(); result = jsApiPayBusiness.payComOrder(jsApiPayComService, jsApiPayComReqData); LogUtil.info("#提现,企业付款到个人---result:{}",result); @@ -155,15 +183,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 +229,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/MvcCoreConfig.java b/zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java index 989b5cc..c48dfe0 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; @@ -36,6 +37,9 @@ @Autowired private WbeCommonInterceptor wbeCommonInterceptor; + @Autowired + private ApiUserLoginInterceptor apiUserLoginInterceptor; + /** * 添加拦截器 @@ -46,15 +50,29 @@ */ @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/**"); + registry.addInterceptor(userLoginInterceptor) + .addPathPatterns("/**") + .excludePathPatterns("/common/**") + .excludePathPatterns("/resource/**") + .excludePathPatterns("/swagger**/**") + .excludePathPatterns("/webjars/**") + .excludePathPatterns("/api/**"); + // url权限拦截 registry.addInterceptor(suAuthorityInterceptor).addPathPatterns("/**/su/**"); //小程序公司与域名对应关系拦截 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 c2fd404..b05d58b 100644 --- a/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java +++ b/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java @@ -6,6 +6,7 @@ import com.matrix.component.rabbitmq.RabiitMqTemplateFactory; import com.matrix.core.tools.LogUtil; import com.matrix.system.shopXcx.mqTask.*; +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; @@ -49,6 +50,11 @@ return new TemplateMsgTask(); } + @Bean + UniformMsgSentTask UniformMsgSentTask(){ + return new UniformMsgSentTask(); + } + @Bean OrderOutSotoreTask OrderOutSotoreTask(){ return new OrderOutSotoreTask(); @@ -68,10 +74,10 @@ //注册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())); + taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn,MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn, UniformMsgSentTask())); rabiitMqTemplate.binding(taskList); 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..d1cc052 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/config/SwaggerConfig.java @@ -0,0 +1,57 @@ +package com.matrix.config; + +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; +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.any()).build().globalOperationParameters(parameters); +// .ignoredParameterTypes(MemberEntity.class); + } + + private ApiInfo apiInfo(){ + return new ApiInfoBuilder() + .title("Hive") + .description("This is a restful api document of Hive.") + .version("1.0") + .build(); + } +} 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/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/tools/DateUtil.java b/zq-erp/src/main/java/com/matrix/core/tools/DateUtil.java index bb10294..07a0984 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("9999-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/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/system/app/action/ApiCommonAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java new file mode 100644 index 0000000..dfd5149 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java @@ -0,0 +1,220 @@ +package com.matrix.system.app.action; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.component.redis.RedisClient; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.*; +import com.matrix.system.app.authority.AppAuthorityManager; +import com.matrix.system.app.dto.LoginDto; +import com.matrix.system.app.dto.PwdResetDto; +import com.matrix.system.app.dto.SmsCodeDto; +import com.matrix.system.app.dto.UploadPhotoDto; +import com.matrix.system.app.vo.UserInfoVo; +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.bean.SysUsers; +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 io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +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 RedisClient redisClient; + + @Value("${file_storage_path}") + private String fileStoragePath; + @Value("${static_resource_url}") + private String nginxUrl; + + @ApiOperation(value = "登陆接口", notes = "手机端登陆接口") + @ApiResponses({ + @ApiResponse(code = 200, message = "OK", response = UserInfoVo.class) + }) + @PostMapping(value = "/login") + public AjaxResult login(@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); + + 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(); + redisClient.saveValueForever(token, JSONObject.toJSONString(user)); + redisClient.saveValueForever(user.getSuId().toString(), token); + + userInfoVo.setId(user.getSuId()); + userInfoVo.setName(user.getSuName()); + userInfoVo.setRoleName(user.getRoleName()); + userInfoVo.setPhoto(user.getSuPhoto()); + + AjaxResult result = AjaxResult.buildSuccessInstance("登陆成功"); + authorityManager.initUserPower(result,user); + result.putInMap("user", userInfoVo); + result.putInMap("token", token); + 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 = redisClient.getCachedValue(smsCodeDto.getTelphone()); + if (StringUtils.isNotBlank(codeExist)) { + return AjaxResult.buildFailInstance("请勿重复发送验证码"); + } + redisClient.saveValue(smsCodeDto.getTelphone(), "123456", 120); + 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 = redisClient.getCachedValue(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) { + redisClient.removeObject(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()); + } +} 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..13455fa --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java @@ -0,0 +1,180 @@ +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.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.isBlank(zans)){ + List<Long> zanIds = StringUtils.strToCollToLong(zans, ","); + List<Long> zaned = zanIds.stream().filter(zanid -> zanid.equals(user.getSuId())).collect(Collectors.toList()); + if(CollectionUtils.isEmpty(zaned)){ + //取消赞 + List<Long> newZaned = zanIds.stream().filter(zanid -> !zanid.equals(user.getSuId())).collect(Collectors.toList()); + zans=StringUtils.collToStr(newZaned,","); + + }else{ + //点赞 + zaned.add(user.getSuId()); + zans=StringUtils.collToStr(zaned,","); + } + }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); + 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..412a3a4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiKnowledgeAction.java @@ -0,0 +1,63 @@ +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.bean.Article; +import com.matrix.system.hive.bean.ArticleType; +import com.matrix.system.hive.bean.SysShopInfo; +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()); + type.setParentId(0L); + 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(); + 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..6532389 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiOrderAction.java @@ -0,0 +1,176 @@ +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()); + return AjaxResult.buildSuccessInstance(shoppingGoodsCategoryService.findByModel(category)); + } + + @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); + shoppingGoodsListDto.setShopId(user.getShopId()); + 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..f3d4d1f --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java @@ -0,0 +1,89 @@ +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)); + } +} 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..47aae8a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiServiceOrderAction.java @@ -0,0 +1,299 @@ +package com.matrix.system.app.action; + +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.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.MQTaskRouting; +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.Arrays; +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 RabiitMqTemplate rabiitMqTemplate; + + @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.setIsOver(Dictionary.FLAG_NO_N); + } + + 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<ServiceTcVo> serviceTcVos = SysProjUseMapper.INSTANCE.entityListToTcVoList(taoCanList); + + if (CollectionUtils.isNotEmpty(serviceTcVos)) { + serviceTcVos.forEach(item -> { + List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId()); + 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; + } + + @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.isBlank(vipInfo.getPassWord())) { +// return AjaxResult.buildFailInstance("未设置资金密码"); +// } + + 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()); + orderListDto.setUserId(user.getSuId()); + } + 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) { + SysProjServices services = new SysProjServices(); + services.setId(idSubmitDto.getId()); + services.setState(Dictionary.BEATUI_STATE_DYY); + int i = projServicesService.modify(services); + if (i > 0) { + //发送微信公众号提醒 + services=projServicesService.findById(services.getId()); + UniformMsgParam uniformMsgParam=new UniformMsgParam(services.getCompanyId(),UniformMsgParam.GZH_YYCG); + uniformMsgParam.put("serviceId",services.getId()); + rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); + + return AjaxResult.buildSuccessInstance("确认成功"); + } + return AjaxResult.buildFailInstance("确认失败"); + } +} 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..71d838c --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java @@ -0,0 +1,313 @@ +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); + 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); + 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..7d83f3b --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java @@ -0,0 +1,182 @@ +package com.matrix.system.app.action; + +import com.matrix.component.redis.RedisClient; +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.*; +import com.matrix.system.app.mapper.SysBeauticianStateMapper; +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.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.SysBeauticianState; +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.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +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; + + @Autowired + private RedisClient redisClient; + + + @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() { + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + String token = redisClient.getCachedValue(sysUsers.getSuId().toString()); + + redisClient.removeObject(token); + redisClient.removeObject(sysUsers.getSuId().toString()); + 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.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..7906568 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java @@ -0,0 +1,226 @@ +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.EncrypUtil; +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.common.tools.PasswordUtil; +import com.matrix.system.hive.action.BaseController; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.MoneyCardUseDao; +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.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; +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()); + } + + 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) { + // 获取会员所有的答案,分类型 + List<Question> questions = questionSerivce.findByVipId(vipId); + 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..c82f43d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/AppOccupancyController.java @@ -0,0 +1,63 @@ +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.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +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(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..b34a8e5 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/authority/AppAuthorityManager.java @@ -0,0 +1,223 @@ +package com.matrix.system.app.authority; + +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.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; + +/** + * 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 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<>(); + + + // 获取用户所有权限 + getUserFunction(user,userFunction, userUrlMapping); + + + // TODO 这里的用户权限应该放到redis缓存中,在拦截器中做权限拦截 + 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) { + // 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..ade6a97 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/AddVipDto.java @@ -0,0 +1,171 @@ +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; + + @Length(max = 10, min = 1) + @NotBlank(message = "会员编号不能为空") + @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(min = 6, max = 6) + @NotBlank(message = "参数错误") + @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..1edf45f --- /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..a06332d --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/LoginDto.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 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; + + 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..3f04e94 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ModifyVipDto.java @@ -0,0 +1,183 @@ +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; + + @NotBlank(message = "会员编号不能为空") + @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(min = 6, max = 6) + @NotBlank(message = "参数错误") + @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..3c3d788 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/RankingDto.java @@ -0,0 +1,43 @@ +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"; + + @ApiModelProperty(value = "数据类型 1-销售 2-消耗", example = "1") + private String dataType; + + @ApiModelProperty(value = "排行榜类型 1-日榜 2-月榜 3-年榜", 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..1c0a500 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ServiceOrderListDto.java @@ -0,0 +1,94 @@ +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; + + + 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/ShoppingGoodsListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java new file mode 100644 index 0000000..62a7172 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/ShoppingGoodsListDto.java @@ -0,0 +1,82 @@ +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; + + 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/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/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..714b2bf --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java @@ -0,0 +1,300 @@ +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 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; + } + + 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; + } +} 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/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..13decc4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java @@ -0,0 +1,115 @@ +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 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 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; + + 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; + } +} 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..9c9cb10 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ServiceTcVo.java @@ -0,0 +1,126 @@ +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 = "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 = "套餐内产品") + List<ServiceProjVo> proj; + + @ApiModelProperty(value = "快过期 1-是 2-否") + private String isInvalid; + + 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; + } +} 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..5ef3256 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsDetailVo.java @@ -0,0 +1,225 @@ +package com.matrix.system.app.vo; + +import com.matrix.system.hive.bean.ShoppingGoodsCategory; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-24 + **/ +@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 String 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; + + public BigDecimal getGiftPrice() { + return giftPrice; + } + + public void setGiftPrice(BigDecimal giftPrice) { + this.giftPrice = giftPrice; + } + + public String getCarIsAll() { + return carIsAll; + } + + public void setCarIsAll(String carIsAll) { + this.carIsAll = carIsAll; + } + + 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 BigDecimal getSalePrice() { + return salePrice; + } + + public void setSalePrice(BigDecimal salePrice) { + this.salePrice = salePrice; + } + + public Integer getSaleCnt() { + return saleCnt; + } + + public void setSaleCnt(Integer saleCnt) { + this.saleCnt = saleCnt; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public Integer getVolume() { + return volume; + } + + public void setVolume(Integer volume) { + this.volume = volume; + } + + public String getMeasure() { + return measure; + } + + public void setMeasure(String measure) { + this.measure = measure; + } + + public Integer getMaxSaleCnt() { + return maxSaleCnt; + } + + public void setMaxSaleCnt(Integer maxSaleCnt) { + this.maxSaleCnt = maxSaleCnt; + } + + public String getLimitBuyCnt() { + return limitBuyCnt; + } + + public void setLimitBuyCnt(String limitBuyCnt) { + this.limitBuyCnt = limitBuyCnt; + } + + public List<ShoppingGoodsDetailVo> getAssembleProj() { + return assembleProj; + } + + public void setAssembleProj(List<ShoppingGoodsDetailVo> assembleProj) { + this.assembleProj = assembleProj; + } + + public List<ShoppingGoodsDetailVo> getAssembleTaocanProj() { + return assembleTaocanProj; + } + + public void setAssembleTaocanProj(List<ShoppingGoodsDetailVo> assembleTaocanProj) { + this.assembleTaocanProj = assembleTaocanProj; + } + + public List<ShoppingGoodsDetailVo> getAssembleTaocanProduct() { + return assembleTaocanProduct; + } + + public void setAssembleTaocanProduct(List<ShoppingGoodsDetailVo> assembleTaocanProduct) { + this.assembleTaocanProduct = assembleTaocanProduct; + } + + public List<ShoppingGoodsCategory> getCardCategory() { + return cardCategory; + } + + public void setCardCategory(List<ShoppingGoodsCategory> cardCategory) { + this.cardCategory = cardCategory; + } + + public String getIsCourse() { + return isCourse; + } + + public void setIsCourse(String isCourse) { + this.isCourse = isCourse; + } + + public Integer getMaxUseCnt() { + return maxUseCnt; + } + + public void setMaxUseCnt(Integer maxUseCnt) { + this.maxUseCnt = maxUseCnt; + } +} 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..a6a05e7 --- /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; + } + + 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..04cfadd --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoListVo.java @@ -0,0 +1,90 @@ +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 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; + } +} 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..325c469 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/vo/VipInfoVo.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; + +/** + * @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; + + + 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..0b38d90 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 @@ -139,15 +139,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); + } + } + /** * 修改公司管理员 @@ -179,6 +198,8 @@ } + + @RequestMapping(value = "/goStaffEditForm") public String goStaffEditForm() { SysUsers loginUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); 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..705a50f 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 @@ -589,4 +589,48 @@ public static final String QSFY = "QSFY"; + /** + * 小程序APPID + */ + public static final String MINIPROGRAM_APPID = "miniprogramAppid"; + /** + * 小程序Secret + */ + 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_CERTLOCAL_PATH = "certLocalPath"; + + + + + + + + + + + + + + } 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..fcb8f9a 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,6 @@ */ public int emptySignInfoById(Long id); + public List<AppVersion> selectAppVersion(); } \ 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..4fe5642 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java @@ -0,0 +1,129 @@ +package com.matrix.system.common.interceptor; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.matrix.component.redis.RedisClient; +import com.matrix.component.redis.RedisUserLoginUtils; +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.hive.bean.SysVipInfo; +import com.matrix.system.hive.dao.SysVipInfoDao; +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; + +/** + * @author wzy + * @date 2020-12-21 + **/ +@Component +public class ApiUserLoginInterceptor implements HandlerInterceptor { + + @Autowired + private RedisClient redisClient; + + @Value("${login_private_key}") + private String privateKey; + + @Value("${evn}") + private String evn; + + @Autowired + private SysUsersDao sysUsersDao; + + private final String TOKEN_HEADER = "Authorization"; + private 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(1012L); + request.getSession().setAttribute(MatrixConstance.LOGIN_KEY, sysUsers); + return true; + } + + String token = resolveToken(request); + 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; + } + + String userStr = redisClient.getCachedValue(token); +// redisClient.resetExpire(token); + if (StringUtils.isBlank(userStr)) { + ajaxResult.setInfo("login time out"); + response.getWriter().write(new ObjectMapper().writeValueAsString(ajaxResult)); + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + return false; + } + + SysUsers sysUsers = JSONObject.parseObject(userStr, SysUsers.class); + 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 + */ + private String resolveToken(HttpServletRequest request) { + 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/service/SysUsersService.java b/zq-erp/src/main/java/com/matrix/system/common/service/SysUsersService.java index 17e6205..b41f466 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,6 @@ public int findByCodeBeaStateShopCount(Long shopId, SysProjServices sysProjServices, List<String> panBanCodes); + public List<AppVersion> findAppVersion(); } \ No newline at end of file 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..8b6ce98 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 @@ -15,6 +15,7 @@ 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; @@ -258,4 +259,8 @@ } + @Override + public List<AppVersion> findAppVersion() { + return sysUsersDao.selectAppVersion(); + } } \ No newline at end of file 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..98b61a9 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 @@ -63,6 +63,12 @@ * 支付方式-卡支付 */ String PAY_TYPE_CARD = "划扣"; + + + /** + * 服务单状态-待确认 + */ + String SERVICE_STATU_DQR = "待确认"; /** * 服务单状态-待预约 */ @@ -558,5 +564,8 @@ String ORDER_TYPE_SEAL="订单"; String ORDER_TYPE_SERVICE="服务单"; + + String ACHIEVE_TYPE_CASH = "现金业绩"; + String ACHIEVE_TYPE_CARD = "划扣业绩"; } 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..3811381 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,21 @@ 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.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 +77,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,6 +115,16 @@ articleType.setType(Dictionary.ARTICEL_TYPE_NAME_MDXY); SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); articleType.setShopId(users.getShopId()); + 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) { return modify(currentService, articleType, "文章类型"); 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..b92149f 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 @@ -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, "会员卡信息"); 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..6db943c 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 @@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; 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; @@ -60,14 +61,12 @@ * @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.setVipId(id); cardUseInfo.setCardName("储值卡"); cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); cardUseInfo.setRealMoney(0D); @@ -89,7 +88,7 @@ */ @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, "充值成功"); result.putInMap("orderId",order.getId()); @@ -181,23 +180,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"; } @@ -227,7 +217,7 @@ */ @RequestMapping(value = "/bj") public @ResponseBody - AjaxResult bj(SysOrder order) throws GlobleException { + AjaxResult bj(@RequestBody SysOrder order) throws GlobleException { orderService.updateAfterMoney(order); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "补交成功"); @@ -296,7 +286,7 @@ 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, "已过期"); } 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..b6ea111 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,6 @@ package com.matrix.system.hive.action; +import com.matrix.component.rabbitmq.RabiitMqTemplate; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; @@ -15,10 +16,7 @@ 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.bean.*; import com.matrix.system.hive.dao.MoneyCardUseDao; import com.matrix.system.hive.dao.SysOrderDao; import com.matrix.system.hive.dao.SysOrderItemDao; @@ -26,11 +24,11 @@ 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.service.*; +import com.matrix.system.shopXcx.mqTask.MQTaskRouting; +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; @@ -48,6 +46,7 @@ import java.net.URLEncoder; import java.util.ArrayList; import java.util.Arrays; +import java.util.Date; import java.util.List; /** @@ -83,6 +82,16 @@ @Autowired SysShopInfoDao shopInfoDao; + @Autowired + private SysVipInfoService sysVipInfoService; + + @Autowired + private SysOrderFlowService sysOrderFlowService; + + @Autowired + RabiitMqTemplate rabiitMqTemplate; + @Value("${evn}") + private String evn; /** * 计算订单金额 @@ -120,14 +129,38 @@ //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 sysOrder = orderService.checkAndSaveOrder(sysOrder); orderService.updateReceiptMoney(sysOrder); + + //发送微信公众号提醒 + UniformMsgParam uniformMsgParam=new UniformMsgParam(user.getCompanyId(),UniformMsgParam.GZH_GMCG); + uniformMsgParam.put("orderId",sysOrder.getId()); + rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); + + //处理用户购买的产品 return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrder), "订单结算成功"); } - - - + /** + * 退款 + * + * @param sysOrder + * @return + */ + @RequestMapping(value = "/refundOrder") + @ResponseBody + @Transactional(rollbackFor = Exception.class) + public AjaxResult refundOrder(@RequestBody SysOrder sysOrder) { + SysUsers user = getMe(); + sysOrder.setShopId(user.getShopId()); + sysOrder.setStatu(Dictionary.ORDER_STATU_TK); + sysOrder.setOrderTime(new Date()); + //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 + sysOrder = orderService.checkAndSaveOrder(sysOrder); + orderService.refundOrderMoney(sysOrder); + //处理用户购买的产品 + return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrder), "订单退款成功"); + } /** @@ -144,7 +177,6 @@ //处理用户购买的产品 return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrder), "订单保存成功"); } - /** * 新建订单 @@ -175,6 +207,9 @@ } //设置过滤后的购物车条目 car.setCarItems(carItems); + + SysVipInfo info = (SysVipInfo) WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER); + car.setVipId(info.getId()); // 添加新订单 int i = orderService.createOrder(WebUtil.getSession(), car); @@ -353,6 +388,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 +437,12 @@ */ @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()); + }else if(StringUtils.isNotBlank(orderVo.getOrderNo())){ + WebUtil.getRequest().setAttribute("orderParam", orderVo.getOrderNo()); + } return "admin/hive/beautySalon/orderXq-form"; } 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..47a0a16 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 @@ -495,6 +495,7 @@ if (balanceverifyResult.isError()) { return new AjaxResult(AjaxResult.STATUS_FAIL, balanceverifyResult.getMsg()); } + sysProjServices.setState(Dictionary.SERVICE_STATU_YYCG); SysProjServices newSysProjServices = sysProjServicesService.addSysProjServices(sysProjServices); if (newSysProjServices != null) { return AjaxResult.buildSuccessInstance(Arrays.asList(newSysProjServices)); 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..3385f1e 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 @@ -12,10 +12,7 @@ import com.matrix.core.tools.excl.ExcelUtil; 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.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; @@ -60,6 +57,18 @@ @Resource private MoneyCardUseService moneyCardUseService; + @Resource + private SysProjUseDao projUseDao; + + @Autowired + SysVipInfoDao vipInfoDao; + + @Autowired + ShoppingGoodsDao shoppingGoodsDao; + + @Autowired + MoneyCardUseDao moneyCardUseDao; + public static final String fnCode = "projUse"; public static final String search = fnCode + ":search"; @@ -85,6 +94,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)); + } /** * 将项目设置为有效 @@ -217,10 +238,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 +268,7 @@ } - @Autowired - SysVipInfoDao vipInfoDao; - @Autowired - ShoppingGoodsDao shoppingGoodsDao; - - @Autowired - SysProjUseDao projUseDao; - - @Autowired - MoneyCardUseDao moneyCardUseDao; @RequestMapping(value = "/importProjUse") 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..755216d 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,6 +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.common.constance.AppConstance; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.SysShopInfo; @@ -108,6 +109,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(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + 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..b141bdd 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 @@ -111,11 +111,14 @@ @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()); + SysShopInfo zbShop = shopInfoDao.selectZbShop(getMe().getCompanyId()); + shoppingGoodsCategory.setShopId(zbShop.getId()); + 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/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..a93ef26 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/SysVipLabelController.java @@ -0,0 +1,60 @@ +package com.matrix.system.hive.action; + +import com.matrix.core.pojo.AjaxResult; +import com.matrix.system.common.bean.SysUsers; +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.Date; +import java.util.List; + +/** + * @author wzy + * @date 2020-12-17 + **/ +@Controller +@RequestMapping(value = "/admin/label") +public class SysVipLabelController extends BaseController{ + + @Autowired + private SysVipLabelDao sysVipLabelDao; + + @RequestMapping(value = "/add") + @ResponseBody + public AjaxResult add(SysVipLabel sysVipLabel) { + SysUsers sysUsers = getMe(); + + List<SysVipLabel> sysVipLabels = sysVipLabelDao.selectByModel(sysVipLabel); + if (CollectionUtils.isNotEmpty(sysVipLabels)) { + return AjaxResult.buildFailInstance("已存在该标签"); + } + + sysVipLabel.setCreateBy(sysUsers.getSuName()); + sysVipLabel.setCreateTime(new Date()); + + int i = sysVipLabelDao.insert(sysVipLabel); + if (i > 0) { + AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("添加成功"); + ajaxResult.putInMap("label", sysVipLabel); + return ajaxResult; + } + return AjaxResult.buildFailInstance("添加失败"); + } + + @RequestMapping(value = "/del") + @ResponseBody + public AjaxResult del(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/hive/action/TaocanController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/TaocanController.java index 607821c..e221d43 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; @@ -205,6 +207,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 +235,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..69717d5 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 @@ -22,6 +22,7 @@ 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.SysVipLabelDao; import com.matrix.system.hive.dao.VipAnswerDao; import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.pojo.RegisterInfo; @@ -76,10 +77,15 @@ private MoneyCardUseDao moneyCardUseDao; @Autowired + private SysVipLabelDao sysVipLabelDao; + + @Autowired private SystemDictionaryService dataDictionaryService; @Autowired private CustomerDataDictionaryDao customerDataDictionaryDao; + @Resource + private SysOrderService sysOrderService; @RequestMapping(value = "/showVipLevel") @@ -124,6 +130,7 @@ List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); if (vips.size() > 0) { // 在session存放当前查询的客户 + 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后删除一个 @@ -140,6 +147,8 @@ 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); return result; 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..6a5a4f5 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 @@ -164,8 +164,11 @@ private String t2; - - + + + /** + * 业绩种类 1-现金业绩 2-划扣业绩 + */ private String t3; @@ -200,6 +203,8 @@ private String day; + private String vipQueryKey; + /** * 订单编号 @@ -227,6 +232,8 @@ */ private String meiliao; + private Integer arriveCnt; + @@ -250,6 +257,51 @@ @Extend private Double achieveMoney; + private String goodsNo; + + private String goodsName; + + private String type; + + 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; 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..11d512f 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; 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..99d661c 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,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 com.matrix.system.hive.plugin.util.MoneyUtil; @@ -67,6 +68,7 @@ /** * 失效时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") @DateTimeFormat(pattern= DateUtil.DATE_FORMAT_DD) private Date failTime; 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..7dfeeff 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; @@ -393,7 +394,134 @@ */ 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; + + /** + * 支付方式 1-充值本金 2-赠送金额 3-积分 + */ + private String payMethods; + + 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; 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..7f34c77 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 @@ -1,5 +1,6 @@ package com.matrix.system.hive.bean; +import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.tools.DateUtil; import org.springframework.format.annotation.DateTimeFormat; @@ -114,6 +115,8 @@ * 订单明细 */ private List<SysOrderItem> items; + + private List<SysOrderFlow> flows; /** * 会员姓名 */ @@ -131,6 +134,8 @@ private String staffName; private String shopName; + + private String shopShortName; private Long searchShop; /** @@ -155,6 +160,57 @@ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date endTimeVo; + /** + * 消费次数 + */ + private Integer times; + + private String type; + + /** + * 原有订单ID 退款时使用 + */ + private Long oldOrderId; + + 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 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; 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..8c8cc65 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderFlow.java @@ -0,0 +1,200 @@ +package com.matrix.system.hive.bean; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.tools.DateUtil; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author wzy + * @date 2021-01-07 + **/ +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; + + private String isGift; + + private String orderNo; + + private Long shopId; + + private Long companyId; + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Long getCardId() { + return cardId; + } + + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + public String getIsGift() { + return isGift; + } + + public void setIsGift(String isGift) { + this.isGift = isGift; + } + + 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 Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFlowNo() { + return flowNo; + } + + public void setFlowNo(String flowNo) { + this.flowNo = flowNo; + } + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public String getFlowContent() { + return flowContent; + } + + public void setFlowContent(String flowContent) { + this.flowContent = flowContent; + } + + public String getFlowType() { + return flowType; + } + + public void setFlowType(String flowType) { + this.flowType = flowType; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public String getPayMethod() { + return payMethod; + } + + public void setPayMethod(String payMethod) { + this.payMethod = payMethod; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + 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/bean/SysOrderItem.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysOrderItem.java index 366c0d8..c572e30 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 @@ -124,6 +124,45 @@ 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 void setPreCount(int preCount) { + this.preCount = preCount; + } + public ShoppingGoods getShoppingGoods() { return shoppingGoods; } @@ -144,7 +183,6 @@ * 业绩计算 */ private List<AchieveNew> achaeveList; - public List<AchieveNew> getAchaeveList() { return achaeveList; 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..dd76b14 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,6 +37,7 @@ /** * 订单创建时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date createTime; /** @@ -230,6 +232,14 @@ * 床位名称 */ private String bedName; + /** + * 评价 + */ + private String comment; + /** + * 评价回复 + */ + private String reply; /** * 商机 */ @@ -239,6 +249,8 @@ * 服务预计时长 */ private Integer totalTime; + + @@ -253,6 +265,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 +315,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; 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..7450dda 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,14 +46,16 @@ /** * 有效期 */ + @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 不明确 @@ -115,10 +119,73 @@ private String isCourse; /** + * 任选套餐 是否无限次 Y-是 N-否 + */ + private String isInfinite; + + /** * 单次划扣次数 */ private Integer deductionNum; + private Integer timeLength; + + private String img; + + private String queryKey; + + @Extend + private String updateRemark; + + + 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..932fffb --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java @@ -0,0 +1,200 @@ +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 com.matrix.system.common.bean.EntityDTOExt; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/**项目余次操作记录 + * @date 2016-07-03 20:53 + */ +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; + + 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 Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getProjUseId() { + return projUseId; + } + + public void setProjUseId(Long projUseId) { + this.projUseId = projUseId; + } + + public Integer getSurplusCount() { + return surplusCount; + } + + public void setSurplusCount(Integer surplusCount) { + this.surplusCount = surplusCount; + } + + public String getIsOver() { + return isOver; + } + + public void setIsOver(String isOver) { + this.isOver = isOver; + } + + public Date getFailTime() { + return failTime; + } + + public void setFailTime(Date failTime) { + this.failTime = failTime; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Double getBalance() { + return balance; + } + + public void setBalance(Double balance) { + this.balance = balance; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getProjName() { + return projName; + } + + public void setProjName(String projName) { + this.projName = projName; + } + + public String getOptionType() { + return optionType; + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } +} 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..308720b 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,5 +1,6 @@ package com.matrix.system.hive.bean; +import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.tools.DateUtil; import com.matrix.system.hive.plugin.util.ExcelAnnotation; import org.springframework.format.annotation.DateTimeFormat; @@ -91,8 +92,11 @@ /** * 生日 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) private Date birthday1; + + private String age; /** * 地址 @@ -139,6 +143,7 @@ /** * 注册时间 */ + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") private Date createTime; /** * 备注 @@ -185,6 +190,26 @@ private Long companyId; + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 推荐人 + */ + private Long recommendId; + //血型 private String blood; @@ -203,6 +228,47 @@ private Date createDistributionTime; + private SysOrder sysOrder; + + 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 Long getRecommendId() { + return recommendId; + } + + public void setRecommendId(Long recommendId) { + this.recommendId = recommendId; + } + + public SysOrder getSysOrder() { + return sysOrder; + } + + public void setSysOrder(SysOrder sysOrder) { + this.sysOrder = sysOrder; + } public Integer getIsDeal() { return isDeal; @@ -349,6 +415,27 @@ */ List<VipAnswer> vipAnswers; + /** + * 会员标签 + */ + List<SysVipLabel> labels; + + public List<SysVipLabel> getLabels() { + return labels; + } + + public void setLabels(List<SysVipLabel> labels) { + this.labels = labels; + } + + public String getAge() { + return age; + } + + public void setAge(String age) { + this.age = age; + } + public Long getCompanyId() { return companyId; } 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..c71e8e9 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipLabel.java @@ -0,0 +1,112 @@ +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; + + 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..46ee09f 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,9 +1,13 @@ package com.matrix.system.hive.dao; +import java.util.Date; import java.util.List; import java.util.Map; 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 org.apache.ibatis.annotations.Param; @@ -52,6 +56,21 @@ public List<AchieveNew> findSumDailyInfoNew(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo); - - + List<AchieveNew> 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); } \ 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..1cb6338 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 @@ -31,5 +31,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..d0d0ad3 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 @@ -84,5 +84,6 @@ public Double selectVipCardTotalMoney(@Param("vipId") Long vipId); + List<MoneyCardUse> selectHasValidMoneyCardUse(); } \ 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..895c181 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,8 @@ * @return */ public ShoppingGoods selectVipCzGoods(); + + List<ShoppingGoodsListVo> selectShoppingGoodsApiInPage(@Param("record") ShoppingGoodsListDto shoppingGoodsListDto, @Param("pageVo") PaginationVO pageVo); + + int selectShopppingGoodsAipTotal(@Param("record") ShoppingGoodsListDto shoppingGoodsListDto); } \ 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..8be75a3 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,7 +1,12 @@ 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.util.Date; @@ -33,5 +38,20 @@ public int selectInPageCount(@Param("record") SysOrder sysOrder); public void updateOrderTime(@Param("orderTime") 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); } \ 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..4486858 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderFlowDao.java @@ -0,0 +1,15 @@ +package com.matrix.system.hive.dao; + +import com.matrix.system.hive.bean.SysOrderFlow; +import org.apache.ibatis.annotations.Param; + +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); +} 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..5446b22 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; @@ -58,4 +60,8 @@ public int deleteByOrderId(Long id); + + List<OrderDetailItemVo> selectApiOrderDetailItemsByOrderId(@Param("orderId") Long orderId); + + List<ErpOrderDetailItemVo> selectErpOrderItemByOrderId(String orderId); } \ 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..845b2e5 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,6 +1,11 @@ package com.matrix.system.hive.dao; +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.shopXcx.api.dto.ErpServiceOrderListDto; +import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo; +import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; import org.apache.ibatis.annotations.Param; import com.matrix.core.pojo.PaginationVO; @@ -35,6 +40,24 @@ public SysProjServices selectById(Long id); public void updateOrderTime(@Param("createTime") Date createTime, @Param("id") Long id); - + + 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); + } \ 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..c064f18 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,10 @@ public int updateTcStatus(@Param("id") Long id, @Param("status") String status); + + List<SysProjUse> selectHasValidProjUse(); + + List<SysProjUseFlow> selectProjUseFlow(@Param("record") SysProjUseFlow projUseFlow, @Param("pageVo")PaginationVO pageVo); + + Integer selectProjUseFlowTotal(@Param("record") SysProjUseFlow projUseFlow); } \ 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..2e0ba9f 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,6 +1,8 @@ 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; @@ -202,4 +204,8 @@ 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); } \ 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..6c5cf07 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipLabelDao.java @@ -0,0 +1,24 @@ +package com.matrix.system.hive.dao; + +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); + + int deleteById(@Param("id") Long id); + + List<SysVipLabel> selectByVipId(@Param("vipId") Long vipId); + + List<SysVipLabel> selectByModel(@Param("record") SysVipLabel sysVipLabel); + + int deleteRelateByVipId(@Param("vipId") Long vipId); +} 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/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/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..e502b07 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 @@ -2,6 +2,7 @@ import java.util.List; +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; @@ -108,5 +109,12 @@ public void modifyAchieveTime(AchieveNew achieveNew); + List<AchieveNew> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo); + + int findVipConsumeStatisticsTotal(AchieveNew achieveNew); + + public UserAchieveVo findUserAchieveByTime(int type); + + public List<AchieveNew> findOrderItemAchieve(Long orderid); } \ No newline at end of file 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..896518f 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,8 @@ * @throws */ public String getOrderCode(); + + public String getFlowCode(); /** * 根据一定的规则返回一个随机编号。 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..6e0e060 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; @@ -81,6 +84,8 @@ */ public void updateReceiptMoney(SysOrder sysOrder) throws GlobleException; + public void refundOrderMoney(SysOrder sysOrder); + /** * 创建订单 * @param session @@ -126,4 +131,15 @@ * @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); + } \ 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..5c48a1a 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; @@ -97,4 +99,9 @@ public VerifyResult checkArrears(SysProjServices sysProjServices); public VerifyResult checkBalance(SysProjServices sysProjServices); + + + List<ServiceOrderListVo> findApiServiceOrderListInPage(ServiceOrderListDto serviceOrderListDto, PaginationVO pageVo); + + int findApiServiceOrderListTotal(ServiceOrderListDto serviceOrderListDto); } \ 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..5d024d7 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,12 +1,19 @@ 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.SysVipInfo; import com.matrix.system.hive.plugin.util.BaseServices; import com.matrix.system.hive.pojo.VipInfoVo; import java.io.File; import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; import java.util.List; /** @@ -180,4 +187,14 @@ 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); } \ No newline at end of file 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..be82e79 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,9 +1,14 @@ package com.matrix.system.hive.service.imp; +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.SysUsers; import com.matrix.system.common.dao.SysUsersDao; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.*; @@ -16,10 +21,7 @@ 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.util.*; /** * This field was generated by Zking.software.Codegen. @@ -184,6 +186,7 @@ achieveNew.setServiceOrderId(projServices.getId()); achieveNew.setOrderItemId(beauticianState.getId()); achieveNew.setShopId(projServices.getShopId()); + achieveNew.setCompanyId(projServices.getCompanyId()); achieveNew.setShoppingGoodsId(projUse.getProjId()); achieveNew.setNumberOfPeople(1D / size); achieveNew.setProjNum(1); @@ -223,14 +226,6 @@ achieveNewList.add(achieveNew); } } - } else { - // 如果该订单明细没有设置美疗师则单独设置顾问业绩 - AchieveNew achieveNew = new AchieveNew(); - // 顾问业绩等于收款金额 - achieveNew.setT1(orderItem.getPayMoney() + ""); - buildAchieve(pageOrder, orderItem, achieveNew); - // 新增顾问业绩 - achieveNewList.add(achieveNew); } } } @@ -243,6 +238,12 @@ ShoppingGoodsDao shoppingGoodsDao; private void buildAchieve(SysOrder pageOrder, SysOrderItem orderItem, AchieveNew achieveNew) { + if (Dictionary.ORDER_STATU_TK.equals(pageOrder.getStatu())) { + achieveNew.setId(null); + achieveNew.setProjPercentage(0 - achieveNew.getProjPercentage()); + achieveNew.setT1((0 - Double.parseDouble(achieveNew.getT1())) + ""); + } + achieveNew.setVipId(pageOrder.getVipId()); achieveNew.setSaleId(pageOrder.getStaffId()); @@ -257,29 +258,15 @@ 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))) { - // 设置卡项 + if (Dictionary.ACHIEVE_TYPE_CASH.equals(achieveNew.getT3())){ achieveNew.setCardCash(Double.parseDouble(achieveNew.getT1())); - } else if (!orderItem.getPayMethod().equals(Dictionary.PAY_TYPE_CARD)) { + } else { // 设置划扣金额 achieveNew.setConsume(Double.parseDouble(achieveNew.getT1())); } @@ -308,5 +295,54 @@ achieveNewDao.updateAchieveTime(achieveNew); } + @Override + public List<AchieveNew> 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); + } } \ 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..8d7277f 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 @@ -94,5 +94,9 @@ Date date=new Date(); return fmt.format(date); } - + + @Override + public String getFlowCode() { + return "F" + getNowTimeString(); + } } \ 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/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..d8acf42 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,17 +3,18 @@ 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.SysShopInfo; +import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.MoneyCardAssembleDao; import com.matrix.system.hive.dao.ShoppingGoodsAssembleDao; import com.matrix.system.hive.dao.ShoppingGoodsDao; @@ -25,7 +26,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.validation.constraints.NotNull; import java.awt.event.WindowStateListener; +import java.math.BigDecimal; +import java.time.LocalDate; 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("9999-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("9999-12-31", DateUtil.DATE_FORMAT_DD); + } + + if (type == 2 && shoppingGoods.getUseDateNum() == null && StringUtils.isNotBlank(shoppingGoods.getBuyDateUnit())) { + return DateUtil.stringToDate("9999-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("9999-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.getGoodsNo()); + goodsDetailVo.setGoodsType(shoppingGoods.getGoodType()); + goodsDetailVo.setDesc(shoppingGoods.getDescription()); + goodsDetailVo.setMaxSaleCnt(shoppingGoods.getCarMaxSaleCount()); + goodsDetailVo.setLimitBuyCnt("否".equals(shoppingGoods.getIsOnce()) ? null : 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..9cfcdec 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 @@ -6,6 +6,12 @@ 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.SysUsers; import com.matrix.system.common.dao.BusParameterSettingsDao; import com.matrix.system.common.dao.SysUsersDao; @@ -20,15 +26,14 @@ 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 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.util.*; /** @@ -79,7 +84,29 @@ 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; + @Override public int add(SysOrder sysOrder) { @@ -139,24 +166,31 @@ @Override public SysOrder checkAndSaveOrder(SysOrder sysOrder) { - // 收款改变订单状态 - /** - * 判断订单条目的一个付款情况 - */ - // 计算现金支付金额 - double xjMoney = 0.0; - // 计算卡支付总额 - double cardMoney = 0.0; + SysOrder source = null; + if (sysOrder.getId() != null) { + source = sysOrderDao.selectById(sysOrder.getId()); + } + // 计算订单折扣金额,收款情况下 计算订单总额 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,44 +198,17 @@ 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); - } + 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.setStatu(orderStatus); + sysOrder.setStaffId(source != null ? source.getStaffId() : user.getSuId()); + sysOrder.setCompanyId(source != null ? source.getCompanyId() : user.getCompanyId()); sysOrder.setPayTime(new Date()); if(sysOrder.getId()==null){ @@ -218,7 +225,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; @@ -351,7 +367,7 @@ throw new GlobleException("没用选择购买产品"); } // 获取会员信息,判断等级 获取相应家居折扣 - SysVipInfo info = (SysVipInfo) WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER); + SysVipInfo info = sysVipInfoDao.selectById(car.getVipId()); //获取折扣----- Double zk = zk = 1.0; @@ -371,6 +387,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) { @@ -420,7 +437,6 @@ // 设置订单总价与折后价 order.setTotal(total); order.setZkTotal(zkTotal); - order.setArrears(zkTotal); sysOrderDao.update(order); return i; } @@ -484,44 +500,60 @@ * @author:姜友瑶 */ private void changeOrderStatu(SysOrder sourceOrder) { + int i = 1; + String orderStatus = Dictionary.ORDER_STATU_YFK; + String flowType = SysOrderFlow.FLOW_TYPE_BUY; + double cashPayTotal = 0D; + double cardPayTotal = 0D; + for (SysOrderFlow flow : sourceOrder.getFlows()) { + flow.setFlowNo(codeService.getFlowCode() + "-" + i); + Long goodsId = sourceOrder.getItems().get(0).getGoodsId(); + ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); + flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); - boolean haQk=false; - - for(SysOrderItem sysOrderItem:sourceOrder.getItems()){ - - if(!sysOrderItem.getStatus().equals(Dictionary.ORDER_STATU_QK)){ - SysOrderItem updateItem=new SysOrderItem(); - updateItem.setId(sysOrderItem.getId()); - updateItem.setStatus(Dictionary.ORDER_STATU_YFK); - - if (sysOrderItem.getPayMethod().equals(Dictionary.PAY_TYPE_MOENY_CARD ) ) { - - if(sysOrderItem.getPayMethodDetail()!=null){ - // 查询要支付的充值卡 - MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(Long.parseLong(sysOrderItem.getPayMethodDetail())); - // 扣除付款卡金额并添加流水 - cardPaySk(moneyCardUse, sourceOrder, sysOrderItem); - }else{ - throw new GlobleException("请选择支付的会员卡"); - } - - - } - orderItemDao.update(updateItem); - }else { - haQk=true; + if (Dictionary.ORDER_STATU_TK.equals(sourceOrder.getStatu())) { + flowType = SysOrderFlow.FLOW_TYPE_REFUND; + // 若是退款,则取负数 + flow.setAmount(flow.getAmount().negate()); + flow.setOrderId(sourceOrder.getOldOrderId()); + } else { + flow.setOrderId(sourceOrder.getId()); } - } - //更新收款状态 - if(haQk){ - sourceOrder.setStatu(Dictionary.ORDER_STATU_QK); - }else{ - sourceOrder.setStatu(Dictionary.ORDER_STATU_YFK); + + flow.setVipId(sourceOrder.getVipId()); + flow.setFlowType(flowType); + // 若使用储值卡付款 + if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { + if (flow.getCardId() != null) { + MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); + cardPaySk(moneyCardUse, sourceOrder, flow); + cardPayTotal += flow.getAmount().doubleValue(); + } + } + + if (SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod())) { + orderStatus = Dictionary.ORDER_STATU_QK; + sourceOrder.setArrears(flow.getAmount().doubleValue()); + } + + if (!SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod()) && !SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { + cashPayTotal += flow.getAmount().doubleValue(); + } + flow.setShopId(sourceOrder.getShopId()); + flow.setCompanyId(sourceOrder.getCompanyId()); + sysOrderFlowDao.insert(flow); + i++; } + if (Dictionary.ORDER_STATU_TK.equals(sourceOrder.getStatu())) { + orderStatus = Dictionary.ORDER_STATU_TK; + } + + // 更新收款状态 + sourceOrder.setStatu(orderStatus); + sourceOrder.setCardPay(cardPayTotal); + sourceOrder.setCashPay(cashPayTotal); sysOrderDao.update(sourceOrder); - - } @@ -541,8 +573,7 @@ Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId()); 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)) { @@ -560,59 +591,50 @@ * 使用充值卡付款操作 * * @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() + "余额不足"); + } } + + //设置卡项使用流水 + 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); // 达到使用次数后自动清空余额 if (!moneyCardUse.getIsVipCar().equals(Dictionary.FLAG_YES_Y) @@ -624,6 +646,12 @@ 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); @@ -699,48 +727,46 @@ // 如果购买的是充值卡 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.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 { + 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()); + } + moneyCardUse.setVipId(sourceOrder.getVipId()); + + 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,66 +778,56 @@ @Transactional(rollbackFor = Exception.class) @Override public void updateAfterMoney(SysOrder pageOrder) { - SysOrder sourceOrder = sysOrderDao.selectById(pageOrder.getId()); + + 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() + "件产品"); + + 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(); + } + + refundTotal += flow.getAmount().doubleValue(); + flow.setShopId(sourceOrder.getShopId()); + flow.setCompanyId(sourceOrder.getCompanyId()); + sysOrderFlowDao.insert(flow); + i++; + } boolean haQk=false; - double cardPayTotal=0D; - double carshPayTotal=0D; - - - 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); - + if (refundTotal == pageOrder.getArrears()) { + haQk = true; } + //更新收款状态 if(haQk){ - sourceOrder.setStatu(Dictionary.ORDER_STATU_QK); - }else{ 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() + cardPayTotal); + sourceOrder.setCashPay(sourceOrder.getCashPay() + cashPayTotal); sysOrderDao.update(sourceOrder); - - // 设置业绩 - achieveNewService.addAchaeveByOrder(pageOrder); - } @@ -954,7 +970,6 @@ } - public void addZongheCarUse(SysOrder order, SysOrderItem sysOrderItem) { @@ -1046,16 +1061,16 @@ 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) { 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; @@ -1105,9 +1120,8 @@ puse.setSource(Dictionary.TAOCAN_SOURCE_ZS); } // 设置失效时间 - Calendar cal = Calendar.getInstance(); - cal.set(2300, 1, 1); - puse.setFailTime(cal.getTime()); + Date invalidTime = shoppingGoodsService.calInvalidTime(sysOrderItem.getShoppingGoods(), 1, null); + puse.setFailTime(invalidTime); sysProjUseDao.insert(puse); } @@ -1121,11 +1135,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); @@ -1156,6 +1170,7 @@ order.setStaffId(user.getSuId()); order.setIsCross(2 + ""); order.setStatu(Dictionary.ORDER_STATU_YFK); + order.setCompanyId(user.getCompanyId()); sysOrderDao.insert(order); SysOrderItem orderItem = new SysOrderItem(); @@ -1175,6 +1190,9 @@ orderItem.setStatus(Dictionary.ORDER_STATU_YFK); orderItem.setAchaeveList(czVo.getAchaeveList()); orderItemDao.insert(orderItem); + List<SysOrderItem> items = new ArrayList<>(); + items.add(orderItem); + order.setItems(items); //设置卡项使用流水 @@ -1190,7 +1208,8 @@ moneyCardUseFlow.setBalance(cardUser.getGiftMoney()+cardUser.getRealMoney()); moneyCardUseFlowDao.insert(moneyCardUseFlow); - + order.setFlows(czVo.getFlows()); + changeOrderStatu(order); // 添加员工业绩 achieveNewService.addAchaeveByOrder(order); return order; @@ -1198,6 +1217,187 @@ } + @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 pageOrder) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + // 插入订单流水 + changeOrderStatu(pageOrder); + + List<SysOrderItem> returnItems = new ArrayList<>(); + for (SysOrderItem item : pageOrder.getItems()) { + + SysProjUse queryProjUse = new SysProjUse(); + queryProjUse.setIsOver(Dictionary.FLAG_NO_N); + queryProjUse.setStatus(Dictionary.TAOCAN_STATUS_YX); + 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())) { + returnItems.add(item); + } + } else { + SysProjUse sysProjUse = sysProjUseDao.selectByModel(queryProjUse).get(0); + + int sub = sysProjUse.getSurplusCount() - item.getCount(); + sysProjUse.setSurplusCount(sub); + if (sub <= 0) { + 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_TC.equals(item.getType())) { + queryProjUse.setTaocanId(-1L); + List<SysProjUse> sysProjUses = sysProjUseDao.selectByModel(queryProjUse); + if (item.getCount() > sysProjUses.size()) { + throw new GlobleException("数据异常"); + } + + for(int i = 0; i < item.getCount(); 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.setIsOver(Dictionary.FLAG_NO_N); + 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); + } + + // 家居产品退库存 + if (CollectionUtils.isNotEmpty(returnItems)) { + refundInstore(returnItems); + } + + // 设置业绩 + achieveNewService.addAchaeveByOrder(pageOrder); + + } + + /** + * 退款入库 + */ + 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); + } } 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..405a534 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,12 +1,14 @@ package com.matrix.system.hive.service.imp; +import com.alibaba.fastjson.JSONObject; +import com.matrix.component.rabbitmq.RabiitMqTemplate; 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.WebUtil; +import com.matrix.core.tools.*; +import com.matrix.system.app.dto.ServiceOrderListDto; +import com.matrix.system.app.vo.ServiceOrderListVo; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.dao.SysUsersDao; import com.matrix.system.constance.Dictionary; @@ -16,16 +18,17 @@ 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.shopXcx.mqTask.MQTaskRouting; +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; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -97,6 +100,15 @@ private SysOrderService sysOrderService; @Autowired WarehouseDao warehouseDao; + @Resource + private ShoppingGoodsService shoppingGoodsService; + + @Autowired + private RabiitMqTemplate rabiitMqTemplate; + + @Value("${evn}") + private String evn; + /** * 新增服务单 jyy @@ -108,17 +120,18 @@ 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()); + 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()); + } + + sysProjServices.setCreateTime(new Date()); - // 设置状态为待预约 - sysProjServices.setState(Dictionary.SERVICE_STATU_DYY); sysProjServices.setServiceNo(codeService.getServiceOrderCode()); Double hkPrice = 0.0; int i = sysProjServicesDao.insert(sysProjServices); - // 计算项目总时长 int totalTime = 0; //处理订单明细 @@ -144,6 +157,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); //如果项目是套餐 中项目则判断套餐是否失效 @@ -159,13 +180,28 @@ taocan.setSurplusCount(0); taocan.setStatus(Dictionary.TAOCAN_STATUS_WX); } else if (Dictionary.FLAG_YES_Y.equals(taocan.getIsCourse())) { - //任选套餐检查套餐整体剩余次数 - int tcSurplusCount = taocan.getSurplusCount() - sysProjUse.getDeductionNum(); - if (tcSurplusCount < 0) { - throw new GlobleException(taocan.getProjName() + "已经达到最大使用次数"); - } else { - taocan.setSurplusCount(tcSurplusCount); + if (StringUtils.isBlank(taocan.getIsInfinite()) || Dictionary.FLAG_NO_N.equals(taocan.getIsInfinite())) { + //任选套餐检查套餐整体剩余次数 + 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); } sysProjUseDao.updateSurplusCount(taocan); } @@ -176,7 +212,7 @@ //插入订单明细 sysBeauticianState.setProjId(sysProjInfo.getId()); sysBeauticianState.setServicesId(sysProjServices.getId()); - sysBeauticianState.setShopId(user.getShopId()); + sysBeauticianState.setShopId(sysProjServices.getShopId()); sysBeauticianState.setState(Dictionary.BEATUI_STATE_DYY); beauticianStateDao.insert(sysBeauticianState); } @@ -364,7 +400,7 @@ // 设置成功状态 - projServices.setState(Dictionary.SERVICE_STATU_YYCG); + projServices.setState(Dictionary.SERVICE_STATU_XPL); // 判断当前门店是否有历史美疗师 LastestWorkBeatuistaff lastWorkStaff = new LastestWorkBeatuistaff(); lastWorkStaff.setShopId(checkProjServices.getShopId()); @@ -457,8 +493,14 @@ */ private void backProjCount(SysProjServices projServices) { List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); + + Map<Long ,List<SysProjUse>> taocanMap = new HashMap<>(); // 回退项目余额 for (SysBeauticianState beauticianState : beauticianStateList) { + // 该修改为 有效日期判断更新所有 + beauticianState.setState(Dictionary.BEATUI_STATE_YYQX); + beauticianStateDao.update(beauticianState); + SysProjUse sysProjUse = sysProjUseDao.selectById(beauticianState.getPuseId()); if (sysProjUse != null && sysProjUse.getId() != null) { sysProjUse = sysProjUseDao.selectById(sysProjUse.getId()); @@ -471,12 +513,56 @@ upProjUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); if (sysProjUse.getTaocanId() != null) { //TODO 更新套餐状态为有效 + SysProjUse taocanProjUse = sysProjUseDao.selectById(sysProjUse.getTaocanId()); + taocanProjUse.setIsOver(Dictionary.DELETED_N); + taocanProjUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); + + 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); } } int surplus = sysProjUse.getSurplusCount() + beauticianState.getCount(); upProjUse.setSurplusCount(surplus); upProjUse.setBalance(MoneyUtil.add(sysProjUse.getBalance(), sysProjUse.getPrice())); + + // 取消时,判断该项目之前是否有使用过,若使用过则非第一次使用,则不更新有效日期,若未使用表明此次为第一次使用,则更新有效日期为购买日期或统一失效日期 + 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); + } } } } @@ -489,10 +575,17 @@ if (!projServices.getState().equals(Dictionary.SERVICE_STATU_FWWC)) { throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); } else { - projServices.setState(Dictionary.SERVICE_STATU_FFJS); projServices.setConsumeTime(new Date()); - return sysProjServicesDao.update(projServices); + int result=sysProjServicesDao.update(projServices); + achieveNewService.addAchieveByServiceOrder(projServices); + + //发送微信公众号提醒 + UniformMsgParam uniformMsgParam=new UniformMsgParam(projServices.getCompanyId(),UniformMsgParam.GZH_FWWC); + uniformMsgParam.put("serviceId",projServices.getId()); + rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); + + return result; } } @@ -733,4 +826,13 @@ } + @Override + public List<ServiceOrderListVo> findApiServiceOrderListInPage(ServiceOrderListDto serviceOrderListDto, PaginationVO pageVo) { + return sysProjServicesDao.selectApiServiceOrderListInPage(serviceOrderListDto, pageVo); + } + + @Override + public int findApiServiceOrderListTotal(ServiceOrderListDto serviceOrderListDto) { + return sysProjServicesDao.selectApiServiceOrderListTotal(serviceOrderListDto); + } } 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..3e21745 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 @@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.xml.crypto.Data; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -62,6 +63,9 @@ @Override public int modify(SysProjUse sysProjUse) { + //插入套餐项目操作记录 + + return sysProjUseDao.update(sysProjUse); @@ -198,24 +202,37 @@ @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); + 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); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功"); } @@ -590,6 +607,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,13 +618,19 @@ 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, "请选择无效或者冻结的套餐"); 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..026ef0b 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 @@ -6,18 +6,20 @@ import com.matrix.core.tools.*; 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.SysUsers; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.common.tools.PasswordUtil; 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; @@ -29,9 +31,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.*; /** @@ -56,6 +56,9 @@ @Autowired private MoneyCardUseDao moneyCardUseDao; + + @Autowired + private SysVipLabelDao sysVipLabelDao; /** * 新增会员储值卡 @@ -101,7 +104,7 @@ sysVipInfo.setCompanyId(user.getCompanyId()); sysVipInfo.setCreateTime(new Date()); sysVipInfo.setPointAll(0); - sysVipInfo.setIsDeal(SysVipInfo.DEAL_VIP); + sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); int i=sysVipInfoDao.insert(sysVipInfo); modifyVipWithOtherInfo(sysVipInfo); @@ -417,5 +420,165 @@ return result; } + @Override + public List<VipInfoListVo> findVipAddressBook(VipInfoListDto vipInfoListDto) { + SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + if (!DataAuthUtil.hasAllShopAuth()) { + vipInfoListDto.setShopId(sysUsers.getShopId()); + } + QueryUtil.setQueryLimitCom(vipInfoListDto); + return sysVipInfoDao.selectVipAddressBookByList(vipInfoListDto); + } + @Override + public com.matrix.system.app.vo.VipInfoVo findApiVipInfoById(Long id) { + return sysVipInfoDao.selectVipInfoById(id); + } + + @Override + public int apiAddVip(AddVipDto addVipDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + + 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())); + int i=sysVipInfoDao.insert(vipInfo); + + if (CollectionUtils.isNotEmpty(addVipDto.getLabels())) { + batchInsertLabel(addVipDto.getLabels(), vipInfo.getId()); + } + + //创建用户默认储值卡 + addVipDefaultCard(vipInfo.getId()); + return i; + } + + @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 (!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; + } } \ 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..8d5d0f9 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 @@ -12,9 +12,15 @@ 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.bean.SysOrder; +import com.matrix.system.hive.bean.SysOrderItem; import com.matrix.system.hive.service.AchieveNewService; +import com.matrix.system.hive.service.SysOrderItemService; +import com.matrix.system.hive.service.SysOrderService; +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; @@ -37,6 +43,11 @@ @Resource private AchieveNewService achieveNewService; + @Autowired + private SysOrderService sysOrderService; + + @Autowired + private SysOrderItemService sysOrderItemService; /** * 门店每日单据明细表 @@ -126,6 +137,39 @@ 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 + public AjaxResult add(@RequestBody List<AchieveNew> list) { + SysOrder order = sysOrderService.findById(list.get(0).getOrderId()); + List<SysOrderItem> orderItems = sysOrderItemService.findByOrderId(order.getId()); + orderItems.forEach(item -> { + List<AchieveNew> achieveNewList = new ArrayList<>(); + for(AchieveNew achieveNew : list) { + achieveNewService.removeById(achieveNew.getId()); + achieveNew.setId(null); + achieveNew.setConsume(null); + achieveNew.setCardCash(null); + + if (achieveNew.getOrderItemId().equals(item.getId())) { + achieveNewList.add(achieveNew); + } + } + item.setAchaeveList(achieveNewList); + }); + order.setItems(orderItems); + achieveNewService.addAchaeveByOrder(order); + return AjaxResult.buildSuccessInstance("保存成功"); + } } 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/SysBusinessDataAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java index 1cd802f..14b05f9 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 @@ -3,15 +3,21 @@ 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.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; 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; /** @@ -44,5 +50,56 @@ 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); + } } \ 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..e3a384a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java @@ -0,0 +1,43 @@ +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.constance.AppConstance; +import com.matrix.system.hive.bean.AchieveNew; +import com.matrix.system.hive.service.AchieveNewService; +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.HashMap; +import java.util.List; + +/** + * 客户数据统计 + * + * @author wzy + * @date 2020-12-18 + **/ +@Controller +@RequestMapping(value = "/admin/vipStatistics") +public class VipStatisticsAction { + + @Autowired + private AchieveNewService achieveNewService; + + @RequestMapping(value = "/vipConsumeStatistics") + @ResponseBody + public AjaxResult vipConsumeStatistics(AchieveNew achieveNew, PaginationVO pageVo) { + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + achieveNew.setShopId(sysUsers.getShopId()); + } + List<AchieveNew> list = achieveNewService.findVipConsumeStatisticsList(achieveNew, pageVo); + int total = achieveNewService.findVipConsumeStatisticsTotal(achieveNew); + return AjaxResult.buildSuccessInstance(list, total); + } +} 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 703a1dd..8b00027 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 @@ -8,6 +8,7 @@ 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; @@ -32,6 +33,8 @@ @Autowired SysShopInfoDao shopInfoDao; + @Autowired + DataAnalysisCustomerServiceImpl dataAnalysisCustomerService; /** * 会员人头数统计 @@ -43,9 +46,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 +64,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 +83,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 +96,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/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..3677903 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,90 @@ 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); + + 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/job/InvalidTimeJob.java b/zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java new file mode 100644 index 0000000..2cd048a --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java @@ -0,0 +1,48 @@ +package com.matrix.system.job; + +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.dao.MoneyCardUseDao; +import com.matrix.system.hive.dao.SysProjUseDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author wzy19 + */ +@Component +public class InvalidTimeJob { + + @Autowired + private SysProjUseDao sysProjUseDao; + + @Autowired + private MoneyCardUseDao moneyCardUseDao; + + + @Scheduled(cron = "0 0 0 * * ?") + public void setProjUseToInvalid() { + List<SysProjUse> sysProjUses = sysProjUseDao.selectHasValidProjUse(); + + List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectHasValidMoneyCardUse(); + + if (CollectionUtils.isNotEmpty(sysProjUses)) { + sysProjUses.forEach(item -> { + item.setStatus(Dictionary.MONEYCARD_STATUS_WX); + sysProjUseDao.update(item); + }); + } + + if (CollectionUtils.isNotEmpty(moneyCardUses)) { + moneyCardUses.forEach(item -> { + item.setStatus(Dictionary.MONEYCARD_STATUS_WX); + moneyCardUseDao.update(item); + }); + } + } +} 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..c790239 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 @@ -464,16 +464,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; } 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/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/action/WXShopOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java index d940ea1..54ca9f5 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 @@ -10,6 +10,7 @@ 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.constance.Dictionary; import com.matrix.system.hive.bean.ShoppingGoods; import com.matrix.system.hive.dao.ShoppingGoodsDao; 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..cb91885 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 @@ -7,7 +7,10 @@ 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.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.hive.bean.SysVipInfo; import com.matrix.system.hive.dao.SysVipInfoDao; import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; @@ -75,6 +78,11 @@ @Autowired private SysVipInfoDao sysVipInfoDao; + @Autowired + BusParameterSettingsDao busParameterSettingsDao; + + + @Value("${evn}") private String evn; /** @@ -86,7 +94,7 @@ * @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...."); @@ -111,7 +119,8 @@ // 返回状态码 SUCCESS/FAIL if (AppConstance.CODE_SUCCESS.equals(data.getReturn_code())) { // 校验签名 - if (Signature.checkIsSignValidFromResponseString(notityXml.toString())) { + BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, HostInterceptor.getCompanyId()); + if (Signature.checkIsSignValidFromResponseString(notityXml.toString(),paySecret.getParamValue())) { // 校验业务结果 if (AppConstance.CODE_SUCCESS.equals(data.getResult_code())) { // 返回SUCCESS报文 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..9a3f9f4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java @@ -0,0 +1,139 @@ +package com.matrix.system.shopXcx.api.action; + +import com.alibaba.fastjson.JSONObject; +import com.matrix.biz.bean.BizUser; +import com.matrix.component.redis.RedisClient; +import com.matrix.component.redis.RedisUserLoginUtils; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.UUIDUtil; +import com.matrix.system.app.authority.AppAuthorityManager; +import com.matrix.system.app.dto.LoginDto; +import com.matrix.system.app.dto.PwdResetDto; +import com.matrix.system.app.dto.SmsCodeDto; +import com.matrix.system.app.dto.UploadPhotoDto; +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.SysUsers; +import com.matrix.system.common.service.SysUsersService; +import com.matrix.system.common.tools.PasswordUtil; +import com.matrix.system.hive.bean.AppVersion; +import com.matrix.system.hive.bean.SysOrderFlow; +import com.matrix.system.hive.bean.SysShopInfo; +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.plugin.util.CollectionUtils; +import com.matrix.system.hive.plugin.util.ImageUtil; +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.ErpOrderDetailItemVo; +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.io.File; +import java.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; +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 RedisClient redisClient; + + @Autowired + private SysVipInfoDao vipInfoDao; + + @Autowired + RedisUserLoginUtils redisUserLoginUtils; + + @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) { + BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); + SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); + if(vipInfo!=null){ + erpOrderListDto.setVipId(vipInfo.getId()); + List<ErpOrderDetailVo> rows=sysOrderDao.selectErpOrderList(erpOrderListDto); + rows.forEach(item->{ + item.setItems(orderItemDao.selectErpOrderItemByOrderId(item.getOrderId())); + }); + return AjaxResult.buildSuccessInstance(rows,"查询成功"); + }else{ + return AjaxResult.buildFailInstance("未查询到相关订单001"); + } + + } + + @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/WxShopProduct.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java index 2b06093..6023fa5 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 @@ -161,9 +161,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); } 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..1c07d32 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,37 +1,48 @@ 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.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.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.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.dao.SysUsersDao; import com.matrix.system.common.interceptor.HostInterceptor; +import com.matrix.system.common.tools.DataAuthUtil; 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.hive.service.*; +import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; +import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; +import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo; +import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; import com.matrix.system.shopXcx.bean.ShopProduct; 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.*; 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; @@ -52,10 +63,18 @@ SysShopInfoDao shopInfoDao; @Autowired - private SysVipInfoDao vipDap; + private SysVipInfoDao vipInfoDao; @Autowired private OnlinebookingDao onlinebookingDao; + @Autowired + private SysProjServicesService projServicesService; + + @Autowired + private SysProjServicesDao projServicesDao; + + @Autowired + private SysBeauticianStateService sysBeauticianStateService; @Autowired RedisUserLoginUtils redisUserLoginUtils; @@ -72,7 +91,11 @@ @Autowired RabiitMqTemplate rabiitMqTemplate; + @Autowired + SysProjUseDao projUseDao; + @Autowired + ShopSkuDao skuDao; @Autowired ShoppingGoodsAssembleDao shoppingGoodsAssembleDao; @@ -194,48 +217,45 @@ * @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); + + 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); + queryUse.setIsOver(Dictionary.FLAG_NO_N); + 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()); + 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; } @@ -252,22 +272,52 @@ 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 vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); + 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) { + return AjaxResult.buildSuccessInstance("下单成功"); + } else { + return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); + } } @@ -277,52 +327,43 @@ * @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) { + @ApiOperation(value = "查询服务单列表", notes = "查询服务单列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = ErpServiceOrderListVo.class) + }) + @PostMapping(value = "/getServiceOrderList") + @ResponseBody + public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) { 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; + SysVipInfo vipInfo= vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); + orderListDto.setVipId(vipInfo.getId()); + List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto); + return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功"); } - /** * 取消预约订单 @@ -330,53 +371,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/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/service/impl/WxShopRefundRecordServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java index 807ab9d..6030d3e 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 @@ -78,14 +78,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; } 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/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/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/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/mqTask/MQTaskRouting.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java index 68c94d1..861de97 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 @@ -12,6 +12,12 @@ * 发送微信消息 */ String SEND_TEMPLATE_MSG = "SEND_TEMPLATE_MSG"; + + /** + * 发送小程序统一模板消息 + */ + String SEND_UNIFORM_TEMPLATE_MSG = "SEND_UNIFORM_TEMPLATE_MSG"; + /** * 订单出库 */ 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..88aab2e 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 @@ -8,13 +8,8 @@ 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.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; @@ -27,15 +22,18 @@ import com.rabbitmq.client.DeliverCallback; import com.rabbitmq.client.Delivery; 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.ArrayList; import java.util.Date; import java.util.List; /** * 微商城订单同步到erp系统 */ +@Component public class OrderTask implements DeliverCallback { @@ -75,6 +73,12 @@ @Autowired BusParameterSettingsDao parameterSettingsDao; + @Autowired + private SysOrderFlowDao sysOrderFlowDao; + + @Autowired + private ShoppingGoodsDao shoppingGoodsDao; + @Transactional(rollbackFor = Exception.class) public void createOrder(ShopOrder orderDto) { @@ -88,6 +92,7 @@ } //获取订单归属门店 + order.setCompanyId(vipInfo.getCompanyId()); order.setShopId(Long.parseLong(orderDto.getStoreId()+"")); //同步的订单订单编号保持一致 order.setOrderNo(orderDto.getOrderNo()); @@ -101,6 +106,7 @@ order.setCashPay(orderDto.getOrderMoney().doubleValue()); order.setTotal(orderDto.getOrderMoney().doubleValue()); order.setZkTotal(orderDto.getOrderMoney().doubleValue()); + order.setPayTime(new Date()); order.setArrears(0); int i = sysOrderDao.insert(order); // 创建订单明细,并计算总价与折扣总价 @@ -133,11 +139,6 @@ 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()) { @@ -193,6 +194,23 @@ // 设置销量 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); + } 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 index 5d59638..67b5bbb 100644 --- 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 @@ -5,6 +5,7 @@ import com.matrix.biz.service.BizUserService; import com.matrix.component.rabbitmq.MqTask; import com.matrix.core.tools.LogUtil; +import com.matrix.core.tools.StringUtils; import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.bean.SysVipInfo; @@ -45,16 +46,26 @@ SysVipInfo vip = vipDap.selectByPhone(userInfo.getPhoneNumber()); if (vip != null) { LogUtil.warn("会员{}已经存在", userInfo.getPhoneNumber()); + //更新信息 + vip.setOpenId(userInfo.getOpenId()); + if(StringUtils.isBlank(vip.getPhoto())){ + vip.setPhoto(userInfo.getAvatarUrl()); + } + vipDap.update(vip); } else { SysVipInfo vipInfo = new SysVipInfo(); //在备注记下微商城的用户id - vipInfo.setRemark(userInfo.getOpenId()); + vipInfo.setOpenId(userInfo.getOpenId()); vipInfo.setAddr(userInfo.getProvince() + " " + userInfo.getCity()); vipInfo.setPhone(userInfo.getPhoneNumber()); + if(StringUtils.isBlank(vipInfo.getPhoto())){ + vipInfo.setPhoto(userInfo.getAvatarUrl()); + } if (userInfo.getGender() != null) { vipInfo.setSex(userInfo.getGender().equals("1") ? "男" : "女"); } vipInfo.setVipName(userInfo.getNickName()); + vipInfo.setCompanyId(userInfo.getCompanyId()); vipInfo.setShopId(shopId); vipInfo.setArrivalWay("微商城"); vipInfo.setVipState(Dictionary.VIP_STATE_HY); 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/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..058af77 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java @@ -0,0 +1,123 @@ +package com.matrix.system.wechart.templateMsg.Task; + + +import com.alibaba.fastjson.JSONObject; +import com.matrix.biz.bean.BizUser; +import com.matrix.biz.service.BizUserService; +import com.matrix.component.tools.HttpClientUtil; +import com.matrix.core.pojo.AjaxResult; +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.constance.Dictionary; +import com.matrix.system.hive.bean.SysProjServices; +import com.matrix.system.hive.bean.SysVipInfo; +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.shopXcx.api.WeChatGzhApiTools; +import com.matrix.system.shopXcx.bean.ShopWxtemplateMsg; +import com.matrix.system.shopXcx.dao.ShopWxtemplateMsgDao; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; +import com.rabbitmq.client.DeliverCallback; +import com.rabbitmq.client.Delivery; +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.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * 小程序统一消息模板消息发送提醒 + * @author jyy + */ +@Component +public class UniformMsgSentTask implements DeliverCallback { + + @Autowired + private ShopWxtemplateMsgDao shopWxtemplateMsgDao; + + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + /** + * 发送模板消息需要传JSONO字符串作为格式 + * 例如:{"companyId":17} + * companyId 是必须属性 + * @param consumerTag + * @param message + * @throws IOException + */ + @Override + public void handle(String consumerTag, Delivery message) throws IOException { + try { + + + String messages = new String(message.getBody(), "UTF-8"); + JSONObject messageJsonParam=JSONObject.parseObject(messages); + + if(!messageJsonParam.containsKey("companyId")||(!messageJsonParam.containsKey("templateCode"))){ + LogUtil.error("小程序消息推送参数格式异常发送模板消息需要传JSONO字符串作为格式 例如:{\"companyId\":17,\"templateCode\":10000} companyId 、templateCode 是必须属性"); + return; + } + Long companyId = Long.parseLong( messageJsonParam.get("companyId").toString()); + Integer templateCode = Integer.parseInt( messageJsonParam.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", messageJsonParam); + + + //调用模板计算出消息体 + 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/DefaultTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java new file mode 100644 index 0000000..d917a1e --- /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.biz.bean.BizUser; +import com.matrix.biz.dao.BizUserDao; +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..2e70fcc --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/YycgTemplateMessageBulder.java @@ -0,0 +1,115 @@ +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 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=""; + String staffName=""; + for (SysBeauticianState beauticianState:beauticianStateList){ + projectInfo+=beauticianState.getProjInfo().getName()+beauticianState.getCount()+"次,"; + staffName+=beauticianState.getBeautiStaffInfo().getSuName()+","; + } + projectInfo=projectInfo.substring(0,projectInfo.length()-1); + staffName=staffName.substring(0,staffName.length()-1); + 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/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..db1e7cd --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java @@ -0,0 +1,35 @@ +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.Task.UniformMsgSentTask; +import com.rabbitmq.client.Delivery; +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 { + + uniformMsgSentTask.handle(null,null); + return AjaxResult.buildSuccessInstance("1"); + + } + + +} diff --git a/zq-erp/src/main/resources/config/application.properties b/zq-erp/src/main/resources/config/application.properties index 52ffc40..466f6f6 100644 --- a/zq-erp/src/main/resources/config/application.properties +++ b/zq-erp/src/main/resources/config/application.properties @@ -6,8 +6,7 @@ spring.datasource.username=chuhuan spring.datasource.password=chuhuan -spring.datasource.url=jdbc:mysql://119.3.52.84:3306/hive_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 - +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 @@ -60,7 +59,7 @@ #定时任务 scheduling.enabled=false -swagger.enable=false +swagger.enable=true swagger.security.username=admin swagger.security.password=admin 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/dev/system.properties b/zq-erp/src/main/resources/config/dev/system.properties index 78a6818..015c690 100644 --- a/zq-erp/src/main/resources/config/dev/system.properties +++ b/zq-erp/src/main/resources/config/dev/system.properties @@ -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 d62378d..44b584e 100644 --- a/zq-erp/src/main/resources/config/lhx/application.properties +++ b/zq-erp/src/main/resources/config/lhx/application.properties @@ -56,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/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/prd/application.properties b/zq-erp/src/main/resources/config/prd/application.properties index d6e840b..974efad 100644 --- a/zq-erp/src/main/resources/config/prd/application.properties +++ b/zq-erp/src/main/resources/config/prd/application.properties @@ -7,7 +7,7 @@ #spring.datasource.url=jdbc:mysql://119.3.52.84:3306/hive_prd?useUnicode=true&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_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +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 diff --git a/zq-erp/src/main/resources/config/system.properties b/zq-erp/src/main/resources/config/system.properties index e008d06..4b4664a 100644 --- a/zq-erp/src/main/resources/config/system.properties +++ b/zq-erp/src/main/resources/config/system.properties @@ -17,7 +17,7 @@ #文件保存地址 #file_storage_path=/mnt/hive/static/uploadeFile/ -file_storage_path=/Users/jiangyouyao/java/webresources/ +file_storage_path=E:\\20210116 #文件上传大小字节为单位 10MB maxUploadSize=10485760 @@ -48,8 +48,14 @@ 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 @@ -92,7 +98,7 @@ #是否启用异常上报 -is_open_exception_report=true +is_open_exception_report=false 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..ed9f167 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=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.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 + @@ -54,7 +60,12 @@ 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/test/system.properties b/zq-erp/src/main/resources/config/test/system.properties index 22568ff..c3e4615 100644 --- a/zq-erp/src/main/resources/config/test/system.properties +++ b/zq-erp/src/main/resources/config/test/system.properties @@ -1,51 +1,101 @@ -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=resource.hive.jyymatrix.cc +#文件保存地址 +file_storage_path=/mnt/upload/ +#文件上传大小字节为单位 10MB +maxUploadSize=10485760 + + +#Matser\u7684ip\u5730\u5740 +redis.hostname=118.31.227.147 +#\u7AEF\u53E3\u53F7 +redis.port=6379 +#\u5982\u679C\u6709\u5BC6\u7801 +redis.password=123456 +#\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 +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://erp.hive.jyymatrix.cc/showException + + +#异常信息查询接口 +showExcptionUrl=http://erp.hive.jyymatrix.cc/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/system.properties b/zq-erp/src/main/resources/config/xcx/system.properties index ebc6e32..12737b4 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,11 +12,12 @@ 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 @@ -28,8 +29,6 @@ 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/mybatis/mapper/common/SysUsersDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml index 321834c..ee69a10 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml @@ -960,7 +960,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)"> @@ -1318,5 +1318,7 @@ where id=#{id} </update> - + <select id="selectAppVersion" resultType="com.matrix.system.hive.bean.AppVersion"> + select * from app_version + </select> </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..48bb959 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml @@ -48,7 +48,11 @@ <result property="meiliao" column="meiliao" /> <result property="zkTotal" column="zk_total" /> + <result property="arriveCnt" column="arrive_cnt" /> + <result property="goodsNo" column="goodsNo" /> + <result property="goodsName" column="goodsName" /> + <result property="zkPrice" column="zkPrice" /> </resultMap> @@ -113,8 +117,20 @@ <if test="(record.endTime!=null )"> and a.datatime <![CDATA[ < ]]> #{record.endTime} </if> + <if test="record.beaultId != null and record.beaultId !='' "> + and a.beault_id = #{record.beaultId} + </if> <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> @@ -168,6 +184,15 @@ </if> <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> @@ -819,4 +844,245 @@ where 1=1 <include refid="where_sql"></include> </select> + + + <select id="selectVipConsumeStatisticsList" resultMap="AchieveNewMap"> + select + a.VIP_NAME, + a.PHONE t9, + GROUP_CONCAT(DISTINCT e.su_name) meiliao, + d.cnt arrive_cnt, + sum(b.buyConsume) goods_cash, + sum(b.freeConsume) free_consume, + sum(b.hisConsume) his_consume + from sys_vip_info a + inner join ( + select vip_id,datatime, sum(a.free_consume) freeConsume, sum(a.his_consume) hisConsume, sum(IFNULL(goods_cash, 0) + IFNULL(card_cash, 0)) buyConsume from achieve_new a group by vip_id + ) b on a.ID = b.vip_id + inner join ( + select vip_id, count(1) cnt from ( + select vip_id, date_format(datatime, '%Y-%m-%d') + from achieve_new + group by date_format(datatime, '%Y-%m-%d'), vip_id + ) c group by vip_id + ) d on a.ID=d.vip_id + + left join sys_users e on find_in_set(e.su_id, a.BEATUY_ID) + where 1=1 + <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.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(b.datatime, '%Y-%m-%d') >= date_format(#{record.endTime}, '%Y-%m-%d') + </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> + group by a.PHONE + <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 + inner join ( + select vip_id,datatime, sum(a.free_consume) freeConsume, sum(a.his_consume) hisConsume, sum(IFNULL(goods_cash, 0) + IFNULL(card_cash, 0)) buyConsume from achieve_new a group by vip_id + ) b on a.ID = b.vip_id + inner join ( + select vip_id, count(1) cnt from ( + select vip_id, date_format(datatime, '%Y-%m-%d') + from achieve_new + group by date_format(datatime, '%Y-%m-%d'), vip_id + ) c group by vip_id + ) d on a.ID=d.vip_id + + left join sys_users e on find_in_set(e.su_id, a.BEATUY_ID) + where 1=1 + <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.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(b.datatime, '%Y-%m-%d') >= date_format(#{record.endTime}, '%Y-%m-%d') + </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> + </select> + + + <select id="selectUserAchieveByTime" resultType="com.matrix.system.app.vo.UserAchieveVo"> + select + sale_id id, + sum(case t3 when '现金业绩' then card_cash else 0 end) orderCash, + sum(case t3 when '划扣业绩' then consume else 0 end) 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.card_cash, 0) + IFNULL(a.proj_cash, 0) + 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 + <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> + </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, + sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) + IFNULL(a.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> + </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, + d.count*d.zk_price 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(card_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> + </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.consume,0) + IFNULL(a.card_cash,0)) amount + from achieve_new a + left join sys_shop_info b on a.shop_id=b.ID + <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> + </where> + group by a.shop_id + order by amount desc, a.shop_id + </select> </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..d7b9b0c 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml @@ -437,4 +437,17 @@ </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 and 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..1cdc488 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> @@ -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..94d6c2d 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml @@ -517,9 +517,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 != '' "> @@ -616,4 +616,8 @@ </select> + <select id="selectHasValidMoneyCardUse" resultMap="MoneyCardUseSimpleMap"> + select * from money_card_use + where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') and STATUS='有效' + </select> </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..a40157c 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml @@ -160,7 +160,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 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..aa826ad 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml @@ -86,6 +86,12 @@ <result property="goodsSortName" column="goodsSortName" /> + <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" /> + </resultMap> @@ -290,7 +296,12 @@ use_shop, headquarters, is_del, - zjm + zjm, + buy_valid, + use_valid, + invalid_time, + pay_methods, + is_infinite ) VALUES ( #{id}, @@ -346,7 +357,12 @@ #{useShop}, #{headquarters}, #{isDel}, - #{zjm} + #{zjm}, + #{buyValid}, + #{useValid}, + #{invalidTime}, + #{payMethods}, + #{isInfinite} ) </insert> @@ -519,8 +535,13 @@ <if test="isDel != null and isDel !='' "> is_del = #{isDel}, </if> - - + <if test="isInfinite != null and isInfinite !='' "> + is_infinite = #{isInfinite}, + </if> + invalid_time = #{invalidTime}, + buy_valid = #{buyValid}, + use_valid = #{useValid}, + pay_methods = #{payMethods}, </set> WHERE id=#{id} </update> @@ -664,28 +685,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> @@ -701,32 +719,44 @@ and is_vip_car = #{record.isVipCar} </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> @@ -1207,4 +1237,57 @@ </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.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.goodType!=null"> + and a.good_type=#{record.goodType} + </if> + </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..7a5a0e5 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml @@ -327,6 +327,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 +358,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 @@ -455,7 +458,7 @@ </if> <if test="cateId != null and cateId != '' "> - and c.PROJ_TYPE_ID=#{cateId} + and c.cate_id=#{cateId} </if> @@ -614,4 +617,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..a857e67 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,414 @@ ) 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(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, + (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> + <if test="companyId != null"> + and company_id=#{companyId} + </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> + <if test="companyId != null"> + and company_id=#{companyId} + </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> + <if test="companyId != null"> + and company_id=#{companyId} + </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> + <if test="companyId != null"> + and company_id=#{companyId} + </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> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) refundCardPay, + (select IFNULL(sum(zk_price),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[ a.create_time > #{item.beginTime} and a.create_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),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[ a.create_time > #{item.beginTime} and a.create_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(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> + <if test="companyId != null"> + and company_id=#{companyId} + </if> + ) refund, + (select IFNULL(count(1),0) from sys_order + where STATU in ('已付款', '欠款') 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 <![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 <![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 <![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 <![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),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[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]> + <if test="shopId != null"> + and c.shop_id=#{shopId} + </if> + ) productAchieve, + (select IFNULL(sum(zk_price),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[ a.create_time > #{item.beginTime} and a.create_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 <![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 <![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 <![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 <![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..b396bbe --- /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(#{zans}, su_id) + </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..62c25ce 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml @@ -18,6 +18,7 @@ <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"/> @@ -30,6 +31,7 @@ <!-- 扩展字段 --> <result property="shopName" column="SHOP_NAME"/> + <result property="shopShortName" column="SHOP_SHORT_NAME"/> <result property="vipPhone" column="PHONE"/> @@ -321,6 +323,7 @@ a.*, c.su_name as STAFF_NAME, d.SHOP_NAME, + d.shop_short_name, b.PHONE, b.VIP_NAME from sys_order a @@ -465,4 +468,206 @@ </sql> + <select id="selectVipOrderInfoTotal" resultType="com.matrix.system.hive.bean.SysOrder"> + select + sum(ZK_TOTAL) zkTotal, + count(1) times, + MAX(pay_time) payTime, + GROUP_CONCAT(DISTINCT t2.shop_short_name) shopName + from sys_order t1 + left join sys_shop_info t2 on t1.SHOP_ID=t2.ID + where 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> + + </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..84fa609 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderFlowDao.xml @@ -0,0 +1,78 @@ +<?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="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> + + <select id="selectByOrderId" resultMap="SysOrderFlowMap"> + select a.*, b.order_no from sys_order_flow a + left join sys_order b on a.order_id=b.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> +</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..6be411c 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml @@ -33,6 +33,7 @@ resultMap="com.matrix.system.hive.dao.ShoppingGoodsDao.ShoppingGoodsSimpleMap"></association> + </resultMap> <!-- 查询会员待处理的订单商品 --> @@ -128,7 +129,7 @@ <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="isFree != null and isFree !='' "> @@ -250,11 +251,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> @@ -519,5 +520,31 @@ 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> </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..f5b7550 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,8 @@ <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="beautiName" column="beautiName"/> @@ -87,7 +89,9 @@ CHANGE_ID, OLD_SHOP_ID, consume_time, - company_id + company_id, + comment, + reply ) VALUES ( #{id}, @@ -122,7 +126,9 @@ #{changeId}, #{oldShopId}, #{consumeTime}, - #{companyId} + #{companyId}, + #{comment}, + #{reply} ) </insert> @@ -228,8 +234,18 @@ <if test="consumeTime != null "> consume_time = #{consumeTime} </if> + + <if test="reply != null "> + reply = #{reply} + </if> + <if test="comment != null "> + comment = #{comment} + </if> </set> WHERE id=#{id} + </update> + <update id="comment"> + </update> <!-- 批量删除 --> @@ -458,4 +474,197 @@ </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> + <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> + <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> + + + </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..d3edbfd 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,116 @@ <result property="projName" column="proj_name"/> <result property="deductionNum" column="deductionNum"/> <result property="isCourse" column="is_course"/> - - - - + <result property="timeLength" column="time_length"/> <!-- 对应项目信息--> <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 +283,9 @@ <if test="deductionNum != null "> deductionNum = #{deductionNum}, </if> + <if test="failTime != null "> + fail_time = #{failTime}, + </if> </set> WHERE ID = #{id} @@ -224,13 +331,17 @@ <select id="selectInPage" resultMap="SysProjUseMap"> select a.*, - b.TIME_LENGTH + 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 !='' "> 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 +374,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> @@ -397,10 +510,13 @@ <!-- 根据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 +535,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 !='' "> @@ -623,7 +742,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 +838,10 @@ group by b.id) t </select> + <select id="selectHasValidProjUse" resultMap="SysProjUseMap"> + select * from sys_proj_use + where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') and STATUS='有效' + </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..7c421b5 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysStoreInfoDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysStoreInfoDao.xml @@ -388,6 +388,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 +405,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 +482,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 +665,7 @@ FROM ( SELECT + b.id id, b.create_time as createTime, e.CODE, e.NAME, @@ -708,6 +717,7 @@ UNION ALL SELECT + t2_b.id id, t2_b.create_time, t2_e.CODE, t2_e.NAME, @@ -811,6 +821,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 +859,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..b2b7892 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"/> @@ -104,6 +108,10 @@ <!-- 扩展属性 --> <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 +282,11 @@ disease, is_deal, zjm, - company_id + company_id, + province, + city, + area, + recommend_id ) @@ -318,7 +330,11 @@ #{disease}, #{isDeal}, #{zjm}, - #{companyId} + #{companyId}, + #{province}, + #{city}, + #{area}, + #{recommendId} ) </insert> @@ -445,6 +461,18 @@ <if test="isDeal != null "> is_deal = #{isDeal}, </if> + <if test="recommendId != null "> + recommend_id = #{recommendId}, + </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> </set> @@ -509,6 +537,8 @@ <include refid="from"></include> where a.ID=#{id} </select> + + <!-- 根据手机和密码查询 --> <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap"> @@ -937,12 +967,19 @@ a.create_distribution_time, a.birthdayType, a.disease, - a.is_deal + a.is_deal, + a.province, + a.city, + a.area, + a.recommend_id, + 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> @@ -1219,5 +1256,119 @@ <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.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.gift_money, 0) + IFNULL(b.real_money, 0)) totalBalance, + sum(IFNULL(b.gift_money, 0)) giftBalance, + sum(IFNULL(d.goods_cash, 0) + IFNULL(d.proj_cash, 0) + IFNULL(d.card_cash, 0)) 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 achieve_new d on a.ID = d.vip_id + left join sys_shop_info e on a.SHOP_ID=e.ID + where a.ID=#{id} + </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..b42140a --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml @@ -0,0 +1,103 @@ +<?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> + + <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> + + + <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> +</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..aa09081 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,646 @@ </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(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> + <if test="companyId != null"> + and 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(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> + <if test="companyId != null"> + and 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),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[ a.create_time > #{item.beginTime} and a.create_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),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[ a.create_time > #{item.beginTime} and a.create_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(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> + <if test="companyId != null"> + and 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 <![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 <![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 <![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 <![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 <![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 <![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 <![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 <![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 <![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 <![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(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> + <if test="companyId != null"> + and 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(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> + <if test="companyId != null"> + and 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 t3 when '现金业绩' then card_cash else 0 end),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) cashAmount, + (select ifnull(sum(case t3 when '划扣业绩' then consume else 0 end),0) from achieve_new a where a.beault_id=#{userId} and <![CDATA[datatime > #{item.beginTime} and datatime < #{item.endTime} ]]>) cardAmount, + (select ifnull(sum(case t3 when '划扣业绩' then consume else 0 end),0) from achieve_new a 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 t3 when '现金业绩' then card_cash else 0 end),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="selectStaffCardAchieve" resultType="java.util.TreeMap"> + select + <foreach collection="list" index="index" item="item" separator="," > + (select ifnull(sum(case t3 when '划扣业绩' then consume else 0 end),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="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/xcxShop/ShopProductDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml index f12db2c..2c2cf8c 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml @@ -846,6 +846,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/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/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/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/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..a3bdf1c 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,896 @@ <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}}</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">打印</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">提交退款</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> + </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 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 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="t3" + label="业绩类型"> + </el-table-column> + <el-table-column + prop="t1" + 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="t3" + label="业绩类型"> + <template slot-scope="scope"> + <el-select v-model="scope.row.t3" placeholder="请选择业绩类型"> + <el-option + v-for="item in achieveTypeList" + :key="item.key" + :label="item.value" + :value="item.key"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + prop="achieve" + label="业绩"> + <template slot-scope="scope"> + <el-input v-model="scope.row.t1"></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"> + <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="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="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 : [ + { + "key" : "现金业绩", + "value" : "现金业绩" + },{ + "key" : "划扣业绩", + "value" : "划扣业绩" + }, + ], + orderItems : [], + achieveItems : [], + flowItems : [], + payMethodItems : [], + isRefund : false, + isReturnAchieve : false, + 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}]]*/ + this.queryOrderDetailData(this.orderParam); - function CreateOneFormPage() { - $("#date").text(getNowFormatDate()); + }, + methods : { + queryOrderDetailData(param) { + let _this = this; + AjaxProxy.requst({ + app: _this, + data: {id: param, orderNo: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 = getLodop(); + _this.flowItems = _this.order.flows; - 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.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; + } - //获取当前时间 - 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 (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; + AjaxProxy.requst({ + app: _this, + data: _this.data, + contentType: 'application/json', + url: basePath + '/admin/order/refundOrder', + callback: function (data) { + _this.isRefund = false; + _this.dialogSettleVisible = false; + _this.queryOrderDetailData(_this.data.oldOrderId); + } + }); + + }, + 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; + + 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); + } + } + + if (_this.refundMoney == 0) { + _this.$message.error("请输入退款金额或退款数量"); + return; + } + _this.dialogSettleVisible = true; + }, + calOrderTotalFormatter(row, column) { + return row.count * row.price; + }, + 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; + 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.push(row2); + }, + delAchieve(index, row) { + let _this = this; + if (row.id) { + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/achieve/del?id=' + row.id, + callback: function (data) { + } + }); + } + + _this.achieveItems.splice(index, 1); + }, + 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/redirect/hive/beautySalon/print-order?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..8aa79f5 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 @@ -54,7 +54,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> 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..3dafa6f 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,189 @@ <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.staffName}}</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="280"> + </el-table-column> + <el-table-column + prop="projInfo.timeLength" + label="服务时长" + width="200"> + </el-table-column> + <el-table-column + prop="address" + 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/redirect/hive/beautySalon/print-service?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/redirect/hive/beautySalon/print-service?id=' + id] + }); } 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-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..e738a10 --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html @@ -0,0 +1,157 @@ + +<!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, + 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 shouldPayFormat(value, row, index) { + return row.shouldPay + row.refund; + } + + function zkAmountFormat(value, row, index) { + return row.shouldPay + row.refund - row.arrears - row.totalPay; + } + + 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/statistics-moneyCar-item.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-moneyCar-item.html index 00ee7bc..70e9301 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> 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..2dfa73f 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> 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..02cf774 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> @@ -131,12 +131,13 @@ 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..ca2c7ac 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> @@ -112,12 +112,13 @@ 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..23a55cd 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> @@ -117,12 +117,13 @@ 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..018f767 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> @@ -86,12 +86,13 @@ 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..0d71ddc 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> 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..b39313f 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/redirect/hive/beautySalon/print-order?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..5c0925d --- /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/redirect/hive/beautySalon/print-order?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..76320e7 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,385 @@ <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 v-model="rechargeMoney" placeholder="0.1元起充"></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="100"> + <template slot-scope="scope"> + <el-input v-model="scope.row.achieveMoney"></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()); - - 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; - } - + //<![CDATA[ + var vue = new Vue({ + el: '#app', + data : { + cardInfo : "", + loginUser : "", + rechargeMoney : "", + 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 : [], + printPaper : false, }, - afterSubmit : function(loj) { + created : function() { + let _this = this; + this.cardInfo = /*[[${obj}]]*/ - 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(); + //获取用户列表 + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/shopAll', + callback: function (data) { + _this.userList = 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, + achieveMoney: 0, + commission : 0, + isShare: false, + }); + } + }); }, - }); + methods : { + submitRecharge() { + let _this = this; + + if (!_this.rechargeMoney) { + this.$message.warning("请输入充值金额"); + return; + } + + if (_this.rechargeMoney < 0.1) { + this.$message.warning("0.1元起充"); + 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 = item.money; + total += item.money; + flows.push(flow); + }) + 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, + t1: achieve.achieveMoney, + t3: '现金业绩', + projPercentage: achieve.commission, + }; + achaeveList.push(achieveNew); + }) + _this.cardInfo.bjmoney = _this.rechargeMoney; + _this.cardInfo.achaeveList = achaeveList; + let url = basePath + "/admin/moneyCardUse/cz"; + + console.log(_this.cardInfo); + AjaxProxy.requst({ + app: _this, + data: _this.cardInfo, + url: url, + callback: function (data) { + if (_this.printPaper) { + _this.print(); + } + + 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/redirect/hive/beautySalon/print-order?id=' + this.order.id], + cancel: function (index, layero) { + _this.closeFram(); + } + }); + } 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 (rechargeMoney < 0.1) { + this.$message.warning("0.1元起充"); + return; + } + 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.rechargeMoney - hasAmount > 0) { + 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); + }, + //删除业绩 + delAchieve(index, row) { + this.achieveList.splice(index, 1); + }, } - 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/order-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html index 43e5f22..55bf9b2 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,6 +75,47 @@ .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> @@ -247,51 +288,51 @@ </template> </el-table-column> <el-table-column - label="应付"> + label="小计"> <template slot-scope="scope"> {{scope.row.zkPrice * scope.row.count }} </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="操作"> @@ -313,8 +354,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}}</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,7 +369,8 @@ <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> @@ -371,14 +414,34 @@ prop="orderItem.payMoney" label="收款"> </el-table-column> + <el-table-column - label="业绩"> + label="业绩类型" width="150"> + <template slot-scope="scope"> + <el-select v-model="scope.row.t3" placeholder="请选择业绩类型"> + <el-option + v-for="item in achieveTypeList" + :key="item.key" + :label="item.value" + :value="item.key"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + label="业绩" width="100"> <template slot-scope="scope"> <el-input v-model="scope.row.achieveMoney"></el-input> </template> </el-table-column> <el-table-column - label="员工"> + 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,7 +454,7 @@ </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" @@ -411,6 +474,61 @@ </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="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> </body> @@ -456,26 +574,51 @@ currentVipInfo: {}, vipLoading: false, payMethods: [{ - value: '现金', - label: '现金' + 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: [], + achieveTypeList : [ + { + "key" : "现金业绩", + "value" : "现金业绩" + },{ + "key" : "划扣业绩", + "value" : "划扣业绩" + }, + ], //会员可用的充值卡 moneyCards: [], //门店信息 @@ -495,6 +638,14 @@ loading: false, /******搜索表格数据END********/ + dialogSettleVisible : false, + defaultProps: { + children: 'children', + label: 'showLable' + }, + treeSelect : [], + payMoneys : [], + printPaper : true, }, @@ -530,13 +681,15 @@ item.payMoney = item.zkPrice; } orderPayMoney += item.payMoney; - + item.uuid = MTools.uuid(); //业绩设置 _this.achieveList.push({ orderItem: item, staff: _this.loginUser, saleId: _this.loginUser.suId, achieveMoney: item.payMoney, + commission : 0, + t3 : '现金业绩', isShare: false, }); }); @@ -572,7 +725,6 @@ } }); - }, methods: { @@ -584,7 +736,7 @@ changePayMethod(item) { console.log("changePayMethod", item); - if (item.payMethod != '会员卡') { + if (item.payMethod != '储值卡') { item.payMethodDetail = ''; } }, @@ -598,17 +750,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; } } @@ -668,6 +828,8 @@ staff: this.loginUser, saleId: this.loginUser.suId, achieveMoney: item.payMoney, + t3 : '现金业绩', + commission : 0, isShare: false, }); this.order.items.push(item); @@ -713,10 +875,10 @@ _this.order.payMoney += parseFloat(item.payMoney); }); //计算欠款 - _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,47 +909,72 @@ */ submitOrder(submitType) { - - - if (this.checkSubmitOrder()) { let _this = this; - - //检查支付方式 - let hasPayMethod=true; - _this.order.items.forEach(item=>{ - if(!item.payMethod){ - hasPayMethod=false; - return; + if(submitType == 1) { + 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.order.payMoney) { + this.$message.warning("输入付款总金额与应付金额不符"); + return false; + } + _this.order.flows = flows; + } else { + this.$message.warning("请选择支付方式"); + return false; } - }); - if(!hasPayMethod){ - this.$message.warning("请选择支付方式"); - return false; } - - - - - //匹配业绩 _this.achieveList.forEach(achieve => { for (let i = 0; i < _this.order.items.length; i++) { let item = _this.order.items[i]; - item.achieveList = []; + if (!item.achaeveList){ + item.achaeveList = []; + } if (item.uuid == achieve.orderItem.uuid) { let achieveNew = { + uuid:item.uuid, beaultId: achieve.saleId, - t1: achieve.achieveMoney + t1: achieve.achieveMoney, + t3: achieve.t3, + projPercentage: achieve.commission, }; - item.achieveList.push(achieveNew); + + var flag = true; + for(var j = 0; j < item.achaeveList.length; j++) { + if(item.achaeveList[j].uuid == achieveNew.uuid && item.achaeveList[j].beaultId == achieveNew.beaultId) { + flag = false; + break; + } + } + + if (flag) { + item.achaeveList.push(achieveNew); + } break; } } }) + console.log(_this.order); //校验业绩金额 if (_this.checkAchieve()) { let url = basePath + "/admin/order/payOrder"; @@ -805,20 +992,30 @@ _this.order.orderNo = order.orderNo; //结算打印提示 if (submitType == 1) { - _this.$confirm('结算成功,是否立刻打印小票?', '提示', { - confirmButtonText: '打印', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + if (_this.printPaper) { _this.print(); - - }).catch(() => { - _this.closeFram(); - }); + } + // _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(); + } } }); } @@ -831,7 +1028,7 @@ */ checkAchieve() { /* - //TODO 前端展示不检测,因为考虑到会员卡支付问题 + //TODO 前端展示不检测,因为考虑到储值卡支付问题 let _this = this; for (let i = 0; i < _this.order.items.length; i++) { if (_this.achieveList.length > 0) { @@ -870,10 +1067,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,9 +1085,9 @@ */ chouseGoods() { let _this = this; - this.multipleSelection.forEach(item => { - _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE); - }); + // this.multipleSelection.forEach(item => { + // _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE); + // }); this.closeXm(); this.calculationTotal(); }, @@ -913,6 +1110,9 @@ } }); this.achieveList = achieveListNew; + this.order.zkTotal = 0; + this.order.total = 0; + this.order.payMoney = 0; this.calculationTotal(); }, @@ -1014,6 +1214,94 @@ }, + 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; + } + + _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..69a0a76 --- /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/redirect/hive/beautySalon/print-order?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..1797130 --- /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/redirect/hive/beautySalon/print-service?id=' + id] + }); + }, + toBack() { + MTools.closeForm(); + }, + } + }); + //]]> + 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] + }); + }; + + +</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..9ed2058 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,912 @@ <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}}</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> + </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="t3" + label="业绩类型"> + </el-table-column> + <el-table-column + prop="t1" + 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="t3" + label="业绩类型"> + <template slot-scope="scope"> + <el-select v-model="scope.row.t3" placeholder="请选择业绩类型"> + <el-option + v-for="item in achieveTypeList" + :key="item.key" + :label="item.value" + :value="item.key"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column + prop="achieve" + label="业绩"> + <template slot-scope="scope"> + <el-input v-model="scope.row.t1"></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"> + <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="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 : [ + { + "key" : "现金业绩", + "value" : "现金业绩" + },{ + "key" : "划扣业绩", + "value" : "划扣业绩" + }, + ], + 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: '储值卡' + }, ], - 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}]]*/ + this.queryOrderDetailData(this.orderParam); + }, + 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: {id: param, orderNo: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; + AjaxProxy.requst({ + app: _this, + data: _this.data, + contentType: 'application/json', + url: basePath + '/admin/order/refundOrder', + callback: function (data) { + _this.isRefund = false; + _this.dialogSettleVisible = false; + _this.queryOrderDetailData(_this.data.oldOrderId); + } + }); + + }, + 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; + + 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); + } + } + + if (_this.refundMoney == 0) { + _this.$message.error("请输入退款金额或退款数量"); + return; + } + _this.dialogSettleVisible = true; + }, + calOrderTotalFormatter(row, column) { + return row.count * row.price; + }, + 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; + 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.push(row2); + }, + delAchieve(index, row) { + let _this = this; + if (row.id) { + AjaxProxy.requst({ + app: _this, + url: basePath + '/admin/achieve/del?id=' + row.id, + callback: function (data) { + } + }); + } + + _this.achieveItems.splice(index, 1); + }, + 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/redirect/hive/beautySalon/print-order?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..b80d7fa --- /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/redirect/hive/beautySalon/print-service?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..2a9aa0e 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,181 @@ <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;">服务单号:{{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="280"> + </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; + } + } + }, + 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/redirect/hive/beautySalon/print-service?id=' + id] + }); + }, + toBack() { + MTools.closeForm(); + }, + serviceTime(row, column) { + console.log(column); + console.log(row); + // if (!column.bedState) { + // return "-"; + // } + var startTime = this.dateFormat(row.beginTime); + var endTime = this.dateFormat(row.endTime); + return startTime + " - " + endTime; + } + }, + }); + //]]> + function print() { var id = $("#serviceId").val(); layer.open({ 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..13f7806 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"/> <!-- 富文本编辑器 --> @@ -125,7 +126,8 @@ <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> + <span style="float: right" v-if="item.failTime != null">有效期:{{item.failTime}}</span> + <code v-if="item.projInfo.isCourse=='Y'" > 剩余次数:<span v-if="item.projInfo.isInfinite == 'Y'">无限次</span><span v-else>{{item.surplusCount}}</span> </code> </p> <el-table :data="item.taocanProjUse" @@ -143,10 +145,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="来源"> @@ -176,6 +178,7 @@ <el-date-picker v-model="yyTime" type="date" + value-format="yyyy-MM-dd HH:mm" placeholder="选择预约时间"> </el-date-picker> 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..da5709f 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 @@ -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..785ca3a 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 @@ -76,7 +76,7 @@ <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> @@ -305,9 +305,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>' 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..9d7bdf9 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 @@ -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/vip.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html index 6b949bb..ab0f2fc 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,1330 @@ .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;"> + <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-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.totalMoney != null">{{vipInfo.totalMoney}} 元</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" + closable + :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-col :span="10" v-for="item in vipInfo.shopNames"> + <el-avatar size="small" :src="circleUrl"></el-avatar> + <span class="col-style">{{item}}</span> + </el-col> + </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.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 + prop="projName" + label="项目名称" + width="180"> + </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="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!='冻结'" 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" size="small" @click="openProjUseFlow(scope.$index, scope.row)">操作记录</el-button> + </template> + </el-table-column> + </el-table> -<div class="row"> - <div class="row "> + <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 + prop="projName" + label="名称" + width="240"> + </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!='有效' && scope.row.taocanId == null" 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.taocanId == null" 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" 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="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="isVipCar" + label="是否是会籍卡" :formatter="cardIsVipFormatter"> + </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!='有效'" 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!='冻结'" 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" 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> - </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> - + <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="cashPay" + label="现金支付金额"> + </el-table-column> + <el-table-column + prop="cardPay" + 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="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> </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 : "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png", + 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 + 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 : { + 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); + }, + // 请求会员信息 + 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; + + 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.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 ] + }); + }, + + 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 = moment(serviceOrderTab.selectTime[0]).format("YYYY-MM-DD HH:mm"); + params.closureTime = 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.row, "确定取消订单吗?", this.serviceOrderQuery); + }, + // 修改时间 + modifyTime(index, row) { + layer.open({ + type: 2, + title: "修改订单时间", + maxmin: true, + area: [MUI.SIZE_L, '500px'], + content: [basePath + '/admin/projService/toServiceOrderUpdateTime?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 = moment(orderTab.selectTime[0]).format("YYYY-MM-DD HH:mm"); + params.endTimeVo = 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 **************/ + 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 = moment(skinTab.selectTime[0]).format("YYYY-MM-DD"); + params.endTime = 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(); + } + } + }, + + /********** 标签代码 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(); + }, + // 开订单 + 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(column.yyTime).format("YYYY-MM-DD HH:mm"); + }, + oderTimeFormat(row, column) { + return moment(column.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..6b949bb --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip_bak.html @@ -0,0 +1,285 @@ +<!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(); + } + }); + updateHistory(); + $("#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/yypb-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html index 43e23bb..c8421ac 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 @@ -357,7 +357,13 @@ _this.closeFram(); } }); - parent.myGrid.serchData(); + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.serviceOrderQuery(); + } } }); } 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.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/products/goods-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html index a4a4c29..225ed3c 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 @@ -190,8 +190,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> @@ -893,6 +901,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 +1022,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: [], @@ -1061,7 +1140,11 @@ cardAssembles: [], //充值卡绑定产品分类 isCourse: 'N', + isInfinite : 'N', carIsAll: '否', + useDateNum : '', + buyDateNum : '', + payMethods : '', }, submitUrl: '/admin/shoppinggoods/addShoppingGoods', modifySubmitUrl: '/admin/shoppinggoods/modifyShoppingGoods', @@ -1077,6 +1160,7 @@ isCourse: [{required: true, message: '请选择套餐类型', trigger: 'change'}], sealPice: [{required: true, message: '请填写售价', trigger: 'blur'}], timeLength: [{required: true, message: '请填写服务时长', trigger: 'blur'}], + isNum : [{ type : 'number', message: '请输入数字', trigger: 'blur' }], }, }, @@ -1471,6 +1555,11 @@ _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()) { @@ -1479,7 +1568,7 @@ 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,7 +1653,7 @@ 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(); @@ -1572,8 +1661,6 @@ //如果是总产品加载总部分类信息 _this.getShoppinggoodscategory(1); _this.getGoodstype(1); - - } }); }, 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-list-new.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html index cb72dd9..e833811 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 @@ -71,6 +71,31 @@ <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> @@ -136,7 +161,7 @@ } MTools.ininDatetimepicker(initParam); //限制结束时间不小于开始时间 - MTools.limitStartEndTime({}); + MTools.limitStartEndTime({}); var date = new Date(); var year = date.getFullYear(); 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..a9c2d1b --- /dev/null +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html @@ -0,0 +1,157 @@ + +<!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, + 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 shouldPayFormat(value, row, index) { + return row.shouldPay + row.refund; + } + + function zkAmountFormat(value, row, index) { + return row.shouldPay + row.refund - row.arrears - row.totalPay; + } + + 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/statistics-moneyCar-item.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-moneyCar-item.html index 73307ce..852a46c 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> 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..ca5daba 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> 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..af8c3ce 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> @@ -123,12 +123,13 @@ 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..9913565 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> @@ -104,12 +104,13 @@ 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..0ba9414 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> @@ -117,12 +117,13 @@ 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..8e3fe77 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> @@ -86,12 +86,13 @@ 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/store/projServiceStartpl-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html index 7333c1f..f547d4c 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 @@ -80,7 +80,13 @@ var myForm=MForm.initForm({ invokeUrl:basePath+"/admin/projService/endPl", afterSubmit:function(){ - parent.myGrid.serchData(); + if (parent.myGrid) { + parent.myGrid.serchData(); + } + + if (parent.app) { + parent.app.serviceOrderQuery(); + } }, }); 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..f3a0475 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,11 @@ </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"> </form> </div> <div class="row mt-10"> @@ -42,48 +28,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..e7360e3 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 @@ -58,9 +58,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 +97,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/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..e1c84b4 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 @@ -50,7 +50,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 +90,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 +128,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-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/vip/vipInfo-list.html index fa3bdd4..eb9ef2a 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,7 +116,7 @@ <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> @@ -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; 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/test/java/com/matrix/SourceFlowTests.java b/zq-erp/src/test/java/com/matrix/SourceFlowTests.java index df6c349..6cc43c8 100644 --- a/zq-erp/src/test/java/com/matrix/SourceFlowTests.java +++ b/zq-erp/src/test/java/com/matrix/SourceFlowTests.java @@ -2,14 +2,10 @@ 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.hive.bean.*; +import com.matrix.system.hive.dao.*; +import com.matrix.system.hive.service.CodeService; +import com.matrix.system.hive.service.SysOrderService; 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 @@ -102,5 +99,76 @@ } + @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(0); + 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); + } + } } diff --git a/zq-xcx/project.config.json b/zq-xcx/project.config.json index e0291bd..ca6dfcb 100644 --- a/zq-xcx/project.config.json +++ b/zq-xcx/project.config.json @@ -4,7 +4,7 @@ "ignore": [] }, "setting": { - "urlCheck": true, + "urlCheck": false, "es6": true, "enhance": true, "postcss": true, @@ -21,20 +21,20 @@ "checkSiteMap": true, "uploadWithSourceMap": true, "compileHotReLoad": false, - "useMultiFrameRuntime": false, + "useMultiFrameRuntime": true, "useApiHook": true, "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" }, - "enableEngineNative": false, "useIsolateContext": true, "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false, "userConfirmedBundleSwitch": false, "packNpmManually": false, "packNpmRelationList": [], + "enableEngineNative": false, "minifyWXSS": true }, "compileType": "miniprogram", -- Gitblit v1.9.1