Merge branch 'ty_fix' into alpha
27 files modified
3 files added
| | |
| | | @Value("${static_resource_url}") |
| | | private String nginxUrl; |
| | | |
| | | @Value("${login_public_key}") |
| | | private String publicKey; |
| | | |
| | | @ApiOperation(value = "登陆接口", notes = "手机端登陆接口") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = UserInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/login") |
| | | public AjaxResult login(@RequestBody @Validated LoginDto loginDto) { |
| | | public AjaxResult login(@RequestBody @Validated LoginDto loginDto) throws Exception { |
| | | |
| | | SysUsers user = new SysUsers(); |
| | | user.setSuAccount(loginDto.getUsername()); |
| | |
| | | userInfoVo.setRoleName(user.getRoleName()); |
| | | userInfoVo.setPhoto(user.getSuPhoto()); |
| | | |
| | | String sb = token + "_1" + "_/api/vip/findVipInfoById/972"; |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("登陆成功"); |
| | | authorityManager.initUserPower(result,user); |
| | | result.putInMap("user", userInfoVo); |
| | | result.putInMap("token", token); |
| | | result.putInMap("rasToken", RSAUtils.encryptByPublicKey(sb, publicKey)); |
| | | return result; |
| | | } |
| | | |
| | |
| | | achieveNew.setT1(rankingDto.getType()); |
| | | return AjaxResult.buildSuccessInstance(achieveNewDao.selectBeauticianConsumeAchieveRanking(achieveNew)); |
| | | } |
| | | |
| | | @ApiOperation(value = "人头数排名", notes = "人头数排名") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = RankingVo.class) |
| | | }) |
| | | @PostMapping(value = "/findNumOfPeopleRanking") |
| | | public AjaxResult findNumOfPeopleRanking(@RequestBody RankingDto rankingDto) { |
| | | AchieveNew achieveNew = new AchieveNew(); |
| | | QueryUtil.setQueryLimitCom(achieveNew); |
| | | achieveNew.setDatatime(new Date()); |
| | | achieveNew.setT1(rankingDto.getType()); |
| | | return AjaxResult.buildSuccessInstance(achieveNewDao.selectNumOfPeopleAchieveRanking(achieveNew)); |
| | | } |
| | | } |
| | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.SettingDto; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author jyy |
| | |
| | | return result; |
| | | } |
| | | |
| | | @ApiOperation(value = "根据code获取配置", notes = "根据code获取配置") |
| | | @PostMapping(value = "/findAppSettingsByCode") |
| | | public AjaxResult findAppSettingsByCode(@RequestBody SettingDto settingDto) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | result.putInMap(settingDto.getCode(), busParameterSettingsDao.selectCompanyParamByCode(settingDto.getCode(),user.getCompanyId())); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | public static final String DAY = "1"; |
| | | public static final String MONTH = "2"; |
| | | public static final String YEAR = "3"; |
| | | public static final String WEEK = "4"; |
| | | |
| | | @ApiModelProperty(value = "数据类型 1-销售 2-消耗", example = "1") |
| | | private String dataType; |
| | | |
| | | @ApiModelProperty(value = "排行榜类型 1-日榜 2-月榜 3-年榜", example = "1") |
| | | @ApiModelProperty(value = "排行榜类型 1-日榜 2-月榜 3-年榜 4-周榜", example = "1") |
| | | private String type; |
| | | |
| | | public String getDataType() { |
New file |
| | |
| | | package com.matrix.system.app.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SettingDto", description = "根据code获取配置参数接收类") |
| | | public class SettingDto { |
| | | |
| | | @ApiModelProperty(value = "code", example = "1") |
| | | private String code; |
| | | } |
| | |
| | | @ApiModelProperty(value = "累计消费") |
| | | private BigDecimal totalShopping; |
| | | |
| | | @ApiModelProperty(value = "欠款") |
| | | private BigDecimal arrears; |
| | | |
| | | public BigDecimal getArrears() { |
| | | return arrears; |
| | | } |
| | | |
| | | public void setArrears(BigDecimal arrears) { |
| | | this.arrears = arrears; |
| | | } |
| | | |
| | | public String getPhoto() { |
| | | return photo; |
| | |
| | | public static final String OPEN_SMS_NOTICE = "OPEN_SMS_NOTICE"; |
| | | |
| | | /** |
| | | * 服务单自动配料 |
| | | */ |
| | | public static final String OPEN_SERVICE_ORDER_AUTO_BATCHING = "OPEN_SERVICE_ORDER_AUTO_BATCHING"; |
| | | |
| | | /** |
| | | * 赠送金额购买产品算赠送购买 |
| | | */ |
| | | public static final String SHOP_MANAGE_GIFTISFREE = "shopManageGiftisfree"; |
New file |
| | |
| | | package com.matrix.system.common.service; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysCompany; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class BusParameterSettingService { |
| | | |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | /** |
| | | * 判断某个设置是否是开启状态 |
| | | * 未配置,或者无效settingkey都返回false |
| | | */ |
| | | public boolean isSettingOpen(String settingKey,Long companyId) { |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(settingKey, companyId); |
| | | return ( |
| | | Objects.nonNull(busParameterSettings) |
| | | && StringUtils.isNotBlank(busParameterSettings.getParamValue()) |
| | | && AppConstance.IS_Y.equals(busParameterSettings.getParamValue()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | 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())); |
| | | vips.get(0).setArrears(sysOrderService.findVipArrearsByVipId(vips.get(0).getId())); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); |
| | | return result; |
| | | } else { |
| | |
| | | package com.matrix.system.hive.bean; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.core.tools.DateUtil; |
| | |
| | | */ |
| | | public class AchieveNew extends EntityDTOExt { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | private String name; |
| | | |
| | | private BigDecimal arrears; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | IPage<AchieveNewStatisticsVo> achieveNewStatistics(Page<AchieveNewStatisticsVo> page, @Param("record")AchieveNewStatisticsDto queryDto); |
| | | |
| | | void setPayMethod(@Param("paymethod") String paymethod, @Param("list") ArrayList<Long> ids); |
| | | |
| | | List<RankingVo> selectNumOfPeopleAchieveRanking(@Param("record") AchieveNew achieveNew); |
| | | } |
| | |
| | | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | List<ErpOrderDetailVo> selectErpOrderList(ErpOrderListDto erpOrderListDto); |
| | | |
| | | ErpOrderDetailVo findUserOrderById(Long orderId); |
| | | |
| | | BigDecimal selectArrearsByVipId(Long vipId); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | int unbundlingSaleMan(Long userId); |
| | | |
| | | int bindingRecommend(@Param("recommendId") Long recommendId,@Param("userId") Long userId); |
| | | |
| | | List<Map<String, Object>> selectVipArrearsStatistics(@Param("record") SysVipInfo sysVipInfo, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | Integer selectVipArrearsStatisticsTotal(@Param("record") SysVipInfo sysVipInfo); |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | List<RankingVo> findApiShopAchieveRanking(SysOrder sysOrder); |
| | | |
| | | BigDecimal findVipArrearsByVipId(Long vipId); |
| | | |
| | | } |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | |
| | | public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId); |
| | | |
| | | SysVipInfo findByOpenId(String openId); |
| | | |
| | | List<Map<String, Object>> findVipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo); |
| | | |
| | | Integer findVipArrearsStatisticsTotal(SysVipInfo sysVipInfo); |
| | | } |
| | |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.service.BusParameterSettingService; |
| | | import com.matrix.system.hive.bean.SysBeauticianState; |
| | | import com.matrix.system.hive.bean.SysProjServices; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | |
| | | |
| | | SysBeauticianStateService sysBeauticianStateService; |
| | | |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | BusParameterSettingService busParameterSettingService; |
| | | /** |
| | | * 预约成功短信提醒 |
| | | * |
| | |
| | | @Async |
| | | public void sendYycgNotice(SysProjServices services) { |
| | | //短信接口为肽妍公司定制,暂时写死 |
| | | if (services.getCompanyId() != 17L) { |
| | | return; |
| | | } |
| | | if (isCloseSmsNotice(services)){ |
| | | return; |
| | | } |
| | | if (chackSetting(services)) return; |
| | | |
| | | SysVipInfo sysVipInfo = vipInfoDao.selectById(services.getVipId()); |
| | | SysShopInfo shopInfo = shopInfoService.findById(services.getShopId()); |
| | | String date = DateUtil.dateFormatStr(new Date(), "yyyy年MM月dd日"); |
| | |
| | | |
| | | |
| | | /** |
| | | * 判断是否开启了短信提醒 |
| | | * @param services |
| | | * @return |
| | | */ |
| | | private boolean isCloseSmsNotice(SysProjServices services) { |
| | | BusParameterSettings openSmsNoticeSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.OPEN_SMS_NOTICE, services.getCompanyId()); |
| | | if (StringUtils.isBlank(openSmsNoticeSetting.getParamValue()) |
| | | || AppConstance.IS_N.equals(openSmsNoticeSetting.getParamValue())) { |
| | | LogUtil.debug("未开启短信提醒"); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 项目划扣短信提醒 |
| | | * |
| | | * @param services |
| | | */ |
| | | @Async |
| | | public void sendHkNotice(SysProjServices services) { |
| | | //短信接口为肽妍公司定制,暂时写死 |
| | | if (services.getCompanyId() != 17L) { |
| | | return; |
| | | } |
| | | if (isCloseSmsNotice(services)){ |
| | | return; |
| | | } |
| | | if (chackSetting(services)) return; |
| | | |
| | | SysVipInfo sysVipInfo = vipInfoDao.selectById(services.getVipId()); |
| | | SysShopInfo shopInfo = shopInfoService.findById(services.getShopId()); |
| | | String date = DateUtil.dateFormatStr(new Date(), "yyyy年MM月dd日"); |
| | |
| | | |
| | | } |
| | | |
| | | private boolean chackSetting(SysProjServices services) { |
| | | //短信接口为肽妍公司定制,暂时写死 |
| | | if (services.getCompanyId() != 17L) { |
| | | return true; |
| | | } |
| | | if (!busParameterSettingService.isSettingOpen(AppConstance.OPEN_SMS_NOTICE, services.getCompanyId())) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | boolean flag = projServicesService.skipServiceOrderStep(Dictionary.SALE_MAN_IS_CONSUME_ACHIEVE); |
| | | |
| | | |
| | | |
| | | |
| | | Set<Long> beautyIds = new HashSet<>(); |
| | | for (SysBeauticianState beauticianState : beauticianStateList) { |
| | | // 是否第一次计算改美疗师 |
| | | boolean isFirst = true; |
| | |
| | | // } |
| | | } |
| | | |
| | | List<AchieveNew> beautyList = achieveNewDao.selectBeautyManAchieveList(beauticianState.getStaffId(), projServices.getVipId(), new Date()); |
| | | if (CollUtil.isEmpty(beautyList)) { |
| | | achieveNew.setNumberOfPeople(1D / size); |
| | | } else { |
| | | achieveNew.setNumberOfPeople(1D / (size + beautyList.size())); |
| | | achieveNewDao.updateAchieveNumOfPeople(beautyList, achieveNew.getNumberOfPeople()); |
| | | } |
| | | // List<AchieveNew> beautyList = achieveNewDao.selectBeautyManAchieveList(beauticianState.getStaffId(), projServices.getVipId(), new Date()); |
| | | // if (CollUtil.isEmpty(beautyList)) { |
| | | // achieveNew.setNumberOfPeople(1D / size); |
| | | // } else { |
| | | // achieveNew.setNumberOfPeople(1D / (size + beautyList.size())); |
| | | // achieveNewDao.updateAchieveNumOfPeople(beautyList, achieveNew.getNumberOfPeople()); |
| | | // } |
| | | |
| | | achieveNew.setProjNum(1); |
| | | if (StringUtils.isNotBlank(beauticianState.getExtract())) { |
| | |
| | | achieveNew.setProjTime(beauticianState.getExcTime()); |
| | | isFirst = false; |
| | | } |
| | | |
| | | beautyIds.add(achieveNew.getBeaultId()); |
| | | achieveNewList.add(achieveNew); |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(achieveNewList)) { |
| | | achieveNewDao.batchInsert(achieveNewList); |
| | | achieveNumOfPeople(beautyIds, projServices.getVipId()); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 合并订单与服务单人头逻辑,即每一个客户对美疗师/顾问来说,每一天同一个客户只算一个人头。 |
| | | * 如若A给客户X下订单,并给客户X服务,对A来说只算一个人头 |
| | | */ |
| | | private void achieveNumOfPeople(Set<Long> beautyIds, Long vipId) { |
| | | for (Long userId : beautyIds) { |
| | | double num; |
| | | List<AchieveNew> achieveNewList = achieveNewDao.selectBeautyManAchieveList(userId, vipId, new Date()); |
| | | |
| | | if (CollUtil.isEmpty(achieveNewList)) { |
| | | num = 1D; |
| | | } else { |
| | | num = 1D / achieveNewList.size(); |
| | | } |
| | | |
| | | achieveNewDao.updateAchieveNumOfPeople(achieveNewList, num); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void addAchaeveByOrder(SysOrder pageOrder) { |
| | | List<AchieveNew> achieveNewList = new ArrayList<>(); |
| | | Set<Long> beautyIds = new HashSet<>(); |
| | | if (CollectionUtils.isNotEmpty(pageOrder.getItems())) { |
| | | for (SysOrderItem orderItem : pageOrder.getItems()) { |
| | | |
| | |
| | | if (achieveNew !=null && achieveNew.getGoodsCash()!=null) { |
| | | buildAchieve(pageOrder, orderItem, achieveNew); |
| | | achieveNewList.add(achieveNew); |
| | | |
| | | beautyIds.add(achieveNew.getBeaultId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(achieveNewList)) { |
| | | achieveNewDao.batchInsert(achieveNewList); |
| | | if (!beautyIds.isEmpty()) { |
| | | achieveNumOfPeople(beautyIds, pageOrder.getVipId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 设置顾问人头业绩 |
| | | saleAchieveNumOfPeople(achieveNew); |
| | | // saleAchieveNumOfPeople(achieveNew); |
| | | |
| | | achieveNew.setOrderType(Dictionary.ORDER_TYPE_SEAL); |
| | | achieveNew.setOrderId(pageOrder.getId()); |
| | |
| | | |
| | | sysInstoreInfoService.check(instoreInfo); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal findVipArrearsByVipId(Long vipId) { |
| | | return sysOrderDao.selectArrearsByVipId(vipId); |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.hive.service.imp; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.google.common.collect.Lists; |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.pojo.VerifyResult; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.ServiceOrderListDto; |
| | | import com.matrix.system.app.vo.ServiceOrderListVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.service.BusParameterSettingService; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | BusParameterSettingService busParameterSettingService; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | |
| | | @Autowired |
| | | ShoppingGoodsAssembleDao goodsAssembleDao; |
| | | |
| | | /** |
| | | * 新增服务单 jyy |
| | |
| | | SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getPuseId()); |
| | | |
| | | //检查是否已经处于无效状态 |
| | | if(Dictionary.TAOCAN_STATUS_WX.equals(sysProjUse.getStatus())){ |
| | | if (Dictionary.TAOCAN_STATUS_WX.equals(sysProjUse.getStatus())) { |
| | | return new VerifyResult(true, sysProjUse.getProjName() + "项目已经失效"); |
| | | } |
| | | |
| | |
| | | lastList.add(lastWork); |
| | | } |
| | | LastestWorkBeatuistaffDao.batchInsert(lastList); |
| | | return sysProjServicesDao.update(projServices); |
| | | int i = sysProjServicesDao.update(projServices); |
| | | |
| | | //根据配置是否完成自动配料 |
| | | if (busParameterSettingService.isSettingOpen(AppConstance.OPEN_SERVICE_ORDER_AUTO_BATCHING, checkProjServices.getCompanyId())){ |
| | | autoBatching(projServices); |
| | | } |
| | | |
| | | |
| | | return i; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据配置是否完成自动配料 |
| | | * |
| | | * @param projServices |
| | | */ |
| | | private void autoBatching(SysProjServices projServices) { |
| | | |
| | | //获取最新的服务单信息 |
| | | projServices=findById(projServices.getId()); |
| | | List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); |
| | | |
| | | |
| | | List<SysOutStoreItem> outStoreItemList = Lists.newLinkedList(); |
| | | beauticianStateList.stream().forEach(item -> { |
| | | |
| | | List<ShoppingGoodsAssemble> shoppingGoodsAssembles = goodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(item.getProjId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP); |
| | | |
| | | if (CollUtil.isNotEmpty(shoppingGoodsAssembles)) { |
| | | outStoreItemList.addAll(shoppingGoodsAssembles.stream().map(assemble -> { |
| | | SysOutStoreItem outStoreItem = new SysOutStoreItem(); |
| | | outStoreItem.setSkuId(assemble.getAssembleGoodId()); |
| | | outStoreItem.setAmount(Double.parseDouble(assemble.getTotal()+"")); |
| | | outStoreItem.setRemark("自动配料"); |
| | | return outStoreItem; |
| | | }).collect(Collectors.toList())); |
| | | } |
| | | }); |
| | | //组合配料参数 |
| | | projServices.setOutStoreItem(outStoreItemList); |
| | | //调用配料出库方法 |
| | | try { |
| | | modifyPLProjServices(projServices); |
| | | }catch (GlobleException e){ |
| | | LogUtil.debug("配料失败:{}",e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //发送微信公众号提醒 |
| | | UniformMsgParam uniformMsgParam = new UniformMsgParam(projServices.getCompanyId(), UniformMsgParam.GZH_FWWC); |
| | | uniformMsgParam.put("serviceId", projServices.getId()); |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG, uniformMsgParam); |
| | | //发送划扣短信提醒 |
| | | taiYanAliyunSmsService.sendHkNotice(projServices); |
| | | |
| | |
| | | int i = modify(services); |
| | | if (i > 0) { |
| | | //发送微信公众号提醒 |
| | | services=findById(services.getId()); |
| | | UniformMsgParam uniformMsgParam=new UniformMsgParam(services.getCompanyId(),UniformMsgParam.GZH_YYCG); |
| | | uniformMsgParam.put("serviceId",services.getId()); |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); |
| | | services = findById(services.getId()); |
| | | UniformMsgParam uniformMsgParam = new UniformMsgParam(services.getCompanyId(), UniformMsgParam.GZH_YYCG); |
| | | uniformMsgParam.put("serviceId", services.getId()); |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG, uniformMsgParam); |
| | | |
| | | taiYanAliyunSmsService.sendYycgNotice(services); |
| | | |
| | |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | private SysOrderDao sysOrderDao; |
| | | |
| | | |
| | | /** |
| | | * 新增会员储值卡 |
| | |
| | | |
| | | @Override |
| | | public com.matrix.system.app.vo.VipInfoVo findApiVipInfoById(Long id) { |
| | | return sysVipInfoDao.selectVipInfoById(id); |
| | | com.matrix.system.app.vo.VipInfoVo result = sysVipInfoDao.selectVipInfoById(id); |
| | | result.setArrears(sysOrderDao.selectArrearsByVipId(id)); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> findVipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo) { |
| | | return sysVipInfoDao.selectVipArrearsStatistics(sysVipInfo, pageVo); |
| | | } |
| | | |
| | | @Override |
| | | public Integer findVipArrearsStatisticsTotal(SysVipInfo sysVipInfo) { |
| | | return sysVipInfoDao.selectVipArrearsStatisticsTotal(sysVipInfo); |
| | | } |
| | | } |
| | |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.hive.bean.AchieveNew; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.service.AchieveNewService; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @Autowired |
| | | private AchieveNewService achieveNewService; |
| | | |
| | | @Autowired |
| | | private SysVipInfoService sysVipInfoService; |
| | | |
| | | @RequestMapping(value = "/vipConsumeStatistics") |
| | | @ResponseBody |
| | | public AjaxResult vipConsumeStatistics(AchieveNew achieveNew, PaginationVO pageVo) { |
| | |
| | | int total = achieveNewService.findVipConsumeStatisticsTotal(achieveNew); |
| | | return AjaxResult.buildSuccessInstance(list, total); |
| | | } |
| | | |
| | | @RequestMapping(value = "/vipArrearsStatistics") |
| | | @ResponseBody |
| | | public AjaxResult vipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo) { |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | if (!DataAuthUtil.hasAllShopAuth()) { |
| | | sysVipInfo.setShopId(sysUsers.getShopId()); |
| | | } |
| | | |
| | | int total = sysVipInfoService.findVipArrearsStatisticsTotal(sysVipInfo); |
| | | return AjaxResult.buildSuccessInstance(sysVipInfoService.findVipArrearsStatistics(sysVipInfo, pageVo), total); |
| | | } |
| | | } |
| | |
| | | #spring.datasource.password=123456 |
| | | #spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test_meidu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | spring.datasource.username=ct_test |
| | | spring.datasource.password=123456 |
| | | spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | #spring.datasource.username=xc_shop |
| | | #spring.datasource.password=xc_shop123!@# |
| | | #spring.datasource.url=jdbc:mysql://124.70.222.34/xc_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | |
| | | #spring.datasource.url=jdbc:mysql://47.111.134.136/db_meidu_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | |
| | | spring.datasource.username=root |
| | | spring.datasource.password=root |
| | | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/md_test_local?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | #spring.datasource.username=root |
| | | #spring.datasource.password=root |
| | | #spring.datasource.url=jdbc:mysql://127.0.0.1:3306/md_test_local?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | |
| | | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
| | |
| | | <if test='record.t1 == "3" and record.datatime != null'> |
| | | and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') |
| | | </if> |
| | | <if test='record.t1 == "4" and record.datatime != null'> |
| | | and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') |
| | | </if> |
| | | </where> |
| | | group by a.shop_id |
| | | order by amount desc, a.shop_id |
| | |
| | | </if> |
| | | <if test='record.t1 == "3" and record.datatime != null'> |
| | | and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') |
| | | </if> |
| | | <if test='record.t1 == "4" and record.datatime != null'> |
| | | and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') |
| | | </if> |
| | | </where> |
| | | group by a.beault_id |
| | |
| | | <if test='record.type == "3" and record.datatime != null'> |
| | | and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') |
| | | </if> |
| | | <if test='record.t1 == "4" and record.datatime != null'> |
| | | and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') |
| | | </if> |
| | | </where> |
| | | group by b.su_id |
| | | order by amount desc, b.su_id |
| | |
| | | </if> |
| | | <if test='record.t1 == "3" and record.datatime != null'> |
| | | and date_format(a.create_time, '%Y') = date_format(#{record.datatime}, '%Y') |
| | | </if> |
| | | <if test='record.t1 == "4" and record.datatime != null'> |
| | | and date_format(a.create_time, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') |
| | | </if> |
| | | </where> |
| | | group by a.shop_id |
| | |
| | | |
| | | |
| | | </update> |
| | | |
| | | <select id="selectNumOfPeopleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> |
| | | select |
| | | b.su_name name, |
| | | b.su_id id, |
| | | b.su_photo photo, |
| | | sum(number_of_people) amount, |
| | | c.shop_short_name shopName |
| | | from achieve_new a |
| | | inner join sys_users b on a.beault_id=b.su_id |
| | | left join sys_shop_info c on a.shop_id=c.ID |
| | | <where> |
| | | <if test="record.companyId != null"> |
| | | and a.company_id=#{record.companyId} |
| | | </if> |
| | | <if test="record.shopId != null"> |
| | | and a.shop_id=#{record.shopId} |
| | | </if> |
| | | <if test='record.t1 == "1" and record.datatime != null'> |
| | | and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d') |
| | | </if> |
| | | <if test='record.t1 == "2" and record.datatime != null'> |
| | | and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m') |
| | | </if> |
| | | <if test='record.t1 == "3" and record.datatime != null'> |
| | | and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') |
| | | </if> |
| | | <if test='record.t1 == "4" and record.datatime != null'> |
| | | and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') |
| | | </if> |
| | | </where> |
| | | group by a.beault_id |
| | | order by amount desc |
| | | </select> |
| | | </mapper> |
| | |
| | | MAX(pay_time) payTime, |
| | | GROUP_CONCAT(DISTINCT t2.shop_short_name) shopName |
| | | from sys_order t1 |
| | | left join sys_order_flow b on t1.id=b.ORDER_ID and pay_method!='储值卡' |
| | | left join sys_order_flow b on t1.id=b.ORDER_ID and pay_method!='储值卡' and pay_method!='欠款' |
| | | left join sys_shop_info t2 on t1.SHOP_ID=t2.ID |
| | | where t1.VIP_ID=#{vipId} and STATU='已付款'; |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectArrearsByVipId" resultType="java.math.BigDecimal"> |
| | | select sum(arrears) from sys_order |
| | | where vip_id=#{vipId} and statu='欠款' |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | |
| | | <select id="selectVipArrearsStatistics" resultType="java.util.Map"> |
| | | select |
| | | a.VIP_NAME vipName, |
| | | a.PHONE phone, |
| | | c.shop_short_name shopName, |
| | | sum(b.arrears) arrears, |
| | | count(1) cnt, |
| | | d.su_name staffName |
| | | from sys_vip_info a |
| | | inner join sys_order b on a.ID=b.VIP_ID |
| | | inner join sys_shop_info c on a.SHOP_ID=c.ID |
| | | left join sys_users d on a.STAFF_ID=d.su_id |
| | | where b.STATU='欠款' and b.arrears!=0 |
| | | <if test="record.companyId!=null"> |
| | | and a.company_id=#{record.companyId} |
| | | </if> |
| | | <if test="record.shopId!=null"> |
| | | and a.shop_id=#{record.shopId} |
| | | </if> |
| | | <if test='record.vipName!=null and record.vipName!="" '> |
| | | and (a.vip_name like concat('%', #{record.vipName}, '%') or a.vip_no like concat('%', #{record.vipName}, '%') or a.phone like concat('%', #{record.vipName}, '%')) |
| | | </if> |
| | | group by a.id |
| | | <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> |
| | | <if test="pageVo.sort !=null and pageVo.order !=null"> |
| | | order by |
| | | ${pageVo.sort} ${pageVo.order} |
| | | </if> |
| | | <if test="pageVo.offset >=0 and pageVo.limit >0"> |
| | | limit |
| | | #{pageVo.offset},#{pageVo.limit} |
| | | </if> |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectVipArrearsStatisticsTotal" resultType="java.lang.Integer"> |
| | | select count(1) from ( |
| | | select |
| | | a.VIP_NAME vipName, |
| | | a.PHONE phone, |
| | | c.shop_short_name shopName, |
| | | sum(b.arrears) arrears, |
| | | count(1) cnt, |
| | | d.su_name staffName |
| | | from sys_vip_info a |
| | | inner join sys_order b on a.ID=b.VIP_ID |
| | | inner join sys_shop_info c on a.SHOP_ID=c.ID |
| | | left join sys_users d on a.STAFF_ID=d.su_id |
| | | where b.STATU='欠款' and b.arrears!=0 |
| | | <if test="record.companyId!=null"> |
| | | and a.company_id=#{record.companyId} |
| | | </if> |
| | | <if test="record.shopId!=null"> |
| | | and a.shop_id=#{record.shopId} |
| | | </if> |
| | | |
| | | <if test='record.vipName!=null and record.vipName!="" '> |
| | | and (a.vip_name like concat('%', #{record.vipName}, '%') or a.vip_no like concat('%', #{record.vipName}, '%') or a.phone like concat('%', #{record.vipName}, '%')) |
| | | </if> |
| | | group by a.id |
| | | ) a |
| | | </select> |
| | | </mapper> |
| | | |
| | |
| | | <el-row style="padding: 10px 20px;"> |
| | | <p>余额:<span v-if="vipInfo.balance != null">{{vipInfo.balance}}元</span></p> |
| | | <p>积分:<span v-if="vipInfo.pointAll != null">{{vipInfo.pointAll}}</span></p> |
| | | <p>欠款金额:<span v-if="vipInfo.arrears != null">{{vipInfo.arrears}} 元</span></p> |
| | | <p>累计消费金额:<span v-if="vipInfo.totalMoney != null">{{vipInfo.totalMoney.toFixed(2)}} 元</span></p> |
| | | <p>累计消费次数:<span v-if="vipInfo.totalTimes != null">{{vipInfo.totalTimes}} 次</span></p> |
| | | <p>上次消费时间:<span v-if="vipInfo.payTime">{{vipInfo.payTime}}</span></p> |
New file |
| | |
| | | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp" /> |
| | | <LINK rel="Bookmark" href="../images/favicon.ico"> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" |
| | | th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> |
| | | </head> |
| | | <body class="gray-bg"> |
| | | <div class="ibox-content"> |
| | | <!-- 搜索框部分start --> |
| | | <form class="form-inline" id="serchform"> |
| | | <div class="row mb-10"> |
| | | <div class="col-sm-8"> |
| | | <button onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> |
| | | <button onclick="myGrid.resetForm()" type="button" class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> |
| | | </div> |
| | | </div> |
| | | <div class="form-group mr-20"> |
| | | <input autocomplete="off" placeholder="会员姓名/手机/编号" name="vipName" type="text" class="form-control" /> |
| | | </div> |
| | | <div class="form-group mr-20"> |
| | | <label for="staffId">健康顾问</label> |
| | | <select class="form-control autoFull select2" |
| | | th:data-url="@{/admin/shopAll}" |
| | | data-value="suId" |
| | | id="staffId" |
| | | data-filed="suName" |
| | | name="staffId"> |
| | | <option value="">--请选择顾问--</option> |
| | | </select> |
| | | </div> |
| | | </form> |
| | | <div id="option-bar" > |
| | | <button matrix:btn="bedList-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> |
| | | </div> |
| | | <table id="mgrid" data-url="" > |
| | | <thead> |
| | | <tr> |
| | | <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" >序号</th> |
| | | <th data-field="vipName">会员名称</th> |
| | | <th data-field="phone">手机号码</th> |
| | | <th data-field="shopName">所属门店</th> |
| | | <th data-field="arrears" data-sortable="true">欠款金额</th> |
| | | <th data-field="cnt" data-sortable="true">欠款订单</th> |
| | | <th data-field="staffName">所属顾问</th> |
| | | </tr> |
| | | </thead> |
| | | </table> |
| | | </div> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> |
| | | var myGrid; |
| | | $(function(){ |
| | | //初始化项目属性搜索列表 |
| | | MTools.autoFullSelect(); |
| | | $(".select2").select2(); |
| | | |
| | | myGrid=MGrid.initGrid({ |
| | | url:basePath+"/admin/vipStatistics/vipArrearsStatistics" |
| | | }); |
| | | }); |
| | | |
| | | // function exportExcel(){ |
| | | // var param=MForm.toUrlParam("#serchform"); |
| | | // window.location.href=basePath+"/admin/moneyCardUseStatistics/exportSummaryItemDetail?"+param; |
| | | // } |
| | | |
| | | </script> |
| | | </body> |
| | | </html> |
| | |
| | | <i class="fa fa-user" ></i> |
| | | <span style="line-height: 35px; color: #333; " th:utext="${session.userInfo.suName}+' | '"> |
| | | </span> |
| | | <a style="line-height: 35px; color: #333; " target="_blank" href="https://www.yuque.com/books/share/70c39d28-6aac-4763-ae92-899ea5822a0d" > |
| | | <a style="line-height: 35px; color: #333; " target="_blank" href="https://www.yuque.com/books/share/7b10c3aa-f289-4f36-b402-5031fbd7f038" > |
| | | <i class="fa fa-book" aria-hidden="true"></i> |
| | | 帮助手册</a> |
| | | </div> |
| | |
| | | newSetting10.setCategory("店务配置"); |
| | | newSettings.add(newSetting10); |
| | | |
| | | ParameterSettings newSetting11=new ParameterSettings(); |
| | | newSetting11.setCode(AppConstance.OPEN_SERVICE_ORDER_AUTO_BATCHING); |
| | | newSetting11.setName("开启服务单自动配料"); |
| | | newSetting11.setType(1); |
| | | newSetting11.setCategory("店务配置"); |
| | | newSettings.add(newSetting11); |
| | | |
| | | |
| | | |
| | | for (ParameterSettings newSetting : newSettings) { |
| | | List<ParameterSettings> parameterSettings = parameterSettingsDao.selectByModel(newSetting); |
| | | if(CollectionUtil.isEmpty(parameterSettings)){ |
| | | parameterSettingsDao.insert(newSetting); |
| | | System.out.println("新增配置"+newSetting.getName()); |
| | | }else { |
| | | System.out.println("配置"+newSetting.getName()+"已经存在"); |
| | | } |
| | | addSettingsTOAllCompany(newSetting); |
| | | } |
| | |
| | | busParameterSettings.setParamValue(""); |
| | | busParameterSettingsDao.insert(busParameterSettings); |
| | | System.out.println(sysCompany.getComName()+"新增成功"); |
| | | }else{ |
| | | System.out.println("公司"+sysCompany.getComName()+"已经存在配置"+newSetting.getName()); |
| | | } |
| | | |
| | | } |