935090232@qq.com
2021-10-06 e7eea688585603c5a8f134d92762e8431d885d36
Merge branch 'score_shop' into api_score_meger

# Conflicts:
# zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
# zq-erp/src/main/resources/templates/views/super/sysCompany-form.html
1 files added
50 files modified
1039 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/config/CrossOriginConfig.java 33 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java 22 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/actions/CommonAction.java 8 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/actions/FileUploadAction.java 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/actions/SysCompanyAction.java 11 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/bean/SysRole.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java 99 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java 24 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java 26 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java 48 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopDeliveryInfoAction.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopProductAction.java 26 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java 1 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java 38 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java 23 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java 30 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/findC.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/application.properties 12 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/common/SysRoleDao.xml 24 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml 370 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml 4 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/sysOrder-list.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html 36 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html 14 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html 9 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html 35 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/sys/sysRole-form.html 6 ●●●● patch | view | raw | blame | history
zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java 8 ●●●●● patch | view | raw | blame | history
zq-xcx/app.js 2 ●●● patch | view | raw | blame | history
zq-xcx/utils/util.js 12 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/config/CrossOriginConfig.java
New file
@@ -0,0 +1,33 @@
package com.matrix.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
/**
 * @author JIANGYOUYAO
 * @date 2021/5/29 0029
 */
@Configuration
public class CrossOriginConfig {
    private CorsConfiguration buildConfig() {
        CorsConfiguration corsConfiguration = new CorsConfiguration();
        corsConfiguration.addAllowedOrigin("*");
        corsConfiguration.addAllowedHeader("*");
        corsConfiguration.addAllowedMethod("*");
        corsConfiguration.setAllowCredentials(true);
        return corsConfiguration;
    }
    @Bean
    public CorsFilter corsFilter() {
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        source.registerCorsConfiguration("/**", buildConfig());
        return new CorsFilter(source);
    }
}
zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java
@@ -238,6 +238,11 @@
        urlDto.setName("美度专线");
        data.add(urlDto);
        urlDto = new UrlDto();
        urlDto.setUrl("http://localhost:8080");
        urlDto.setName("开发环境");
        data.add(urlDto);
        return AjaxResult.buildSuccessInstance(data);
    }
zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java
@@ -173,7 +173,7 @@
    }
    public BigDecimal getConsumePay() {
        return consumePay;
        return consumePay.setScale(2, BigDecimal.ROUND_HALF_UP);
    }
    public void setConsumePay(BigDecimal consumePay) {
zq-erp/src/main/java/com/matrix/system/app/vo/ServiceProjVo.java
@@ -23,6 +23,9 @@
    @ApiModelProperty(value = "商品名称")
    private String name;
    @ApiModelProperty(value = "套餐来源,转让,购买")
    private String source;
    @ApiModelProperty(value = "时长")
    private Integer timeLength;
@@ -38,6 +41,9 @@
    @ApiModelProperty(value = "快过期 1-是 2-否")
    private String isInvalid;
    @ApiModelProperty(value = " 使用情况余额")
    private Double balance;
    @ApiModelProperty(value = "项目状态 有效/无效")
    private String status;
@@ -127,4 +133,20 @@
    public void setStatus(String status) {
        this.status = status;
    }
    public String getSource() {
        return source;
    }
    public void setSource(String source) {
        this.source = source;
    }
    public Double getBalance() {
        return balance;
    }
    public void setBalance(Double balance) {
        this.balance = balance;
    }
}
zq-erp/src/main/java/com/matrix/system/common/actions/CommonAction.java
@@ -11,10 +11,13 @@
import com.matrix.system.common.authority.strategy.AccountPasswordLogin;
import com.matrix.system.common.authority.strategy.LoginStrategy;
import com.matrix.system.common.authority.strategy.ScanQrCodeLogin;
import com.matrix.system.common.bean.SysCompany;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.ProjExceptionDao;
import com.matrix.system.common.dao.SysCompanyDao;
import com.matrix.system.common.dto.WebLoginDto;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.common.service.SysUsersService;
import com.matrix.system.hive.dao.SysShopInfoDao;
import com.matrix.system.hive.statistics.StatisticsBusinessDataJob;
@@ -64,6 +67,9 @@
    @Autowired
    SysShopInfoDao sysShopInfoDao;
    @Autowired
    SysCompanyDao sysCompanyDao;
    /**
     *  页面定向方法,每个权限模块公用一个,每个模块共享一个一级路径,已便于进行权限过滤
@@ -119,6 +125,8 @@
        AjaxResult result = new AjaxResult();
        authorityManager.initUserPower(result);
        SysCompany sysCompany = sysCompanyDao.selectById(user.getCompanyId());
        WebUtil.setSessionAttribute(HostInterceptor.ATTR_COMPANY, sysCompany);
        result.putInMap("user",user);
        result.setStatus(AjaxResult.STATUS_SUCCESS);
zq-erp/src/main/java/com/matrix/system/common/actions/FileUploadAction.java
@@ -1,8 +1,12 @@
package com.matrix.system.common.actions;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.FileType;
import com.matrix.core.tools.WebUtil;
import com.matrix.core.web.BaseAction;
import com.matrix.system.common.bean.SysCompany;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.common.tools.UploadUtil;
import org.apache.commons.fileupload.FileUploadException;
import org.springframework.stereotype.Controller;
@@ -41,7 +45,9 @@
    public String doImageUpload(HttpServletResponse response, MultipartHttpServletRequest request)
            throws IOException, FileUploadException, NoSuchAlgorithmException {
        SysUsers user = getSessionUser();
        Map<String, String> fileMap = UploadUtil.doUpload(request, EXT_LIST, folderType, user.getSuId());
        SysCompany company = WebUtil.getSessionAttribute(HostInterceptor.ATTR_COMPANY);
        Map<String, String> fileMap = UploadUtil.doUpload(request, EXT_LIST, folderType, company.getComId());
        String callBack = request.getParameter("callBack");
        String inputId = request.getParameter("inputId");
        request.setAttribute("callBack", callBack);
zq-erp/src/main/java/com/matrix/system/common/actions/SysCompanyAction.java
@@ -2,16 +2,13 @@
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.anotations.SaveRequestToken;
import com.matrix.core.constance.SystemErrorCode;
import com.matrix.core.constance.SystemMessageCode;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.InternationaUtil;
import com.matrix.core.tools.WebUtil;
import com.matrix.core.web.BaseAction;
import com.matrix.system.common.bean.SysCompany;
import com.matrix.system.common.constance.AppVocabularyCode;
import com.matrix.system.common.init.InitWebContainer;
import com.matrix.system.common.service.SysCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -35,6 +32,10 @@
    private SysCompanyService sysCompanyService;
    public static final String BEV = "SYSCOMPANY_BEV";
    @Autowired
    InitWebContainer initWebContainer;
    /**
     * 列表显示
@@ -80,6 +81,7 @@
    public @ResponseBody
    AjaxResult addCompany(SysCompany sysCompany) {
        int i = sysCompanyService.add(sysCompany);
        initWebContainer.initParams();
        if (i > 0) {
            return AjaxResult.buildSuccessInstance("创建成功");
        } else {
@@ -103,6 +105,7 @@
    AjaxResult modifyCompany(SysCompany sysCompany) {
        AjaxResult result = modify(sysCompanyService, WebUtil.getSessionAttribute(BEV), sysCompany,
                AppVocabularyCode.COMPANY);
        initWebContainer.initParams();
        WebUtil.removeSessionAttribute(BEV);
        return result;
    }
zq-erp/src/main/java/com/matrix/system/common/bean/SysRole.java
@@ -61,7 +61,7 @@
    /**
     * 所有客户权限
     */
    private String coustomer;
    private String customer;
    /**
     * 功能集合
@@ -81,12 +81,12 @@
    @Extend
    private String menuKeys;
    public String getCoustomer() {
        return coustomer;
    public String getCustomer() {
        return customer;
    }
    public void setCoustomer(String coustomer) {
        this.coustomer = coustomer;
    public void setCustomer(String customer) {
        this.customer = customer;
    }
    public Integer getIsDefault() {
zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java
@@ -579,6 +579,11 @@
    public static final String SHOP_MANAGE_JJCPAS_CONSUME = "shopManageJjcpasConsume";
    /**
     * 门店是否只能取消待付款订单,服务单
     */
    public static final String SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER = "shopManageAbleCancelDfkOrder";
    /**
     * 赠送金额购买产品算赠送购买
     */
    public static final String SHOP_MANAGE_GIFTISFREE = "shopManageGiftisfree";
zq-erp/src/main/java/com/matrix/system/common/interceptor/ApiUserLoginInterceptor.java
@@ -43,11 +43,11 @@
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
    if ("dev".equals(evn)) {
            SysUsers sysUsers = sysUsersDao.selectById(1022L);
            request.getSession().setAttribute(MatrixConstance.LOGIN_KEY, sysUsers);
            return true;
        }
//    if ("dev".equals(evn)) {
//            SysUsers sysUsers = sysUsersDao.selectById(1022L);
//            request.getSession().setAttribute(MatrixConstance.LOGIN_KEY, sysUsers);
//            return true;
//        }
        String token = resolveToken(request,privateKey);
        AjaxResult ajaxResult = new AjaxResult();
zq-erp/src/main/java/com/matrix/system/hive/action/CardLevelController.java
@@ -78,8 +78,6 @@
     */
    @RequestMapping(value = "/all")
    public @ResponseBody AjaxResult all(SysVipLevel sysVipLevel) {
        SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        sysVipLevel.setShopId(users.getShopId());
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, cardLevelService.findByModel(sysVipLevel), null);
    }
}
zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
@@ -12,8 +12,12 @@
import com.matrix.core.tools.excl.ExcelSheetPO;
import com.matrix.core.tools.excl.ExcelUtil;
import com.matrix.core.tools.excl.ExcelVersion;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.common.dao.SysCompanyDao;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.common.tools.ResponseHeadUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.*;
@@ -95,6 +99,9 @@
    RabiitMqTemplate rabiitMqTemplate;
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    @Autowired
    private SysProjServicesDao sysProjServicesDao;
    @Value("${evn}")
@@ -117,7 +124,7 @@
            total = total.add(new BigDecimal(item.getPrice() * item.getCount()));
        }
        SysOrder sysOrderResult = new SysOrder();
        sysOrderResult.setZkTotal(zkTotal.setScale(2,BigDecimal.ROUND_DOWN).doubleValue());
        sysOrderResult.setZkTotal(zkTotal.setScale(2, BigDecimal.ROUND_DOWN).doubleValue());
        sysOrderResult.setTotal(total.doubleValue());
        return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrderResult));
@@ -140,9 +147,9 @@
        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());
        UniformMsgParam uniformMsgParam = new UniformMsgParam(user.getCompanyId(), UniformMsgParam.GZH_GMCG);
        uniformMsgParam.put("orderId", sysOrder.getId());
        rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn, uniformMsgParam.toJSONString());
        //处理用户购买的产品
@@ -160,10 +167,10 @@
    @ResponseBody
    public AjaxResult refundOrder(@RequestBody SysOrder sysOrder) {
        //储值卡订单不能通过退款渠道退款
        if(CollectionUtils.isNotEmpty(sysOrder.getItems())){
        if (CollectionUtils.isNotEmpty(sysOrder.getItems())) {
            List<SysOrderItem> orderItem = orderItemService.findByOrderId(sysOrder.getItems().get(0).getOrderId());
            if(orderItem.size()==1){
                if(orderItem.get(0).getShoppingGoods().getCode().equals("vipCzk")){
            if (orderItem.size() == 1) {
                if (orderItem.get(0).getShoppingGoods().getCode().equals("vipCzk")) {
                    return AjaxResult.buildFailInstance("充值订单请直接冲负数金额退款!");
                }
            }
@@ -190,7 +197,6 @@
    }
    /**
     * 列表显示
     */
@@ -204,7 +210,9 @@
        if (StringUtils.isBlank(pageVo.getOrder())) {
            pageVo.setOrder("desc");
        }
        sysOrder.setShopId(getMe().getShopId());
        if (!DataAuthUtil.hasAllShopAuth()) {
            sysOrder.setShopId(getMe().getShopId());
        }
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, orderService.findInPage(sysOrder, pageVo),
                orderService.findTotal(sysOrder));
    }
@@ -229,12 +237,12 @@
    public @ResponseBody
    ModelAndView printOrder(SysOrder order) throws GlobleException {
        ModelAndView mv = new ModelAndView("admin/hive/beautySalon/print-order");
        SysUsers user=(SysUsers)WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
         String comRegisterCode = companyDao.selectById(user.getCompanyId()).getComRegisterCode();
        if(StringUtils.isNotBlank(comRegisterCode)){
            mv.addObject("page",comRegisterCode);
        }else {
            mv.addObject("page","taiyan");
        SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        String comRegisterCode = companyDao.selectById(user.getCompanyId()).getComRegisterCode();
        if (StringUtils.isNotBlank(comRegisterCode)) {
            mv.addObject("page", comRegisterCode);
        } else {
            mv.addObject("page", "taiyan");
        }
        return mv;
    }
@@ -266,7 +274,7 @@
        achieveNew.setDatatime(sysOrder.getPayTime());
        achieveNewService.modifyAchieveTime(achieveNew);
        //更新收款流水时间
        sysOrderFlowDao.updateTimeByOrderId(sysOrder.getId(),sysOrder.getPayTime());
        sysOrderFlowDao.updateTimeByOrderId(sysOrder.getId(), sysOrder.getPayTime());
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功");
@@ -285,7 +293,7 @@
        MoneyCardUse cardUseInfo = cardUseService.findByVipId(order.getVipId());
        if (cardUseInfo == null) {
            cardUseInfo=sysVipInfoService.addVipDefaultCard(order.getVipId());
            cardUseInfo = sysVipInfoService.addVipDefaultCard(order.getVipId());
        }
        //打印需求加入门店信息
@@ -295,7 +303,6 @@
        //查询会有所有有效的会员卡
        result.putInMap("totalMoney", moneyCardUseDao.selectVipCardTotalMoney(order.getVipId()));
        return result;
@@ -375,13 +382,13 @@
    @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())){
        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());
            if (byModel.size() == 1) {
                order = orderService.findById(byModel.get(0).getId());
            }
        }
        List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(order.getId());
@@ -421,10 +428,10 @@
    @RequestMapping(value = "/orderItem")
    public String orderItem(SysOrder orderVo) {
        if(orderVo.getId()!=null){
        if (orderVo.getId() != null) {
            WebUtil.getRequest().setAttribute("orderParam", orderVo.getId());
            WebUtil.getRequest().setAttribute("orderId", orderVo.getId());
        }else if(StringUtils.isNotBlank(orderVo.getOrderNo())){
        } else if (StringUtils.isNotBlank(orderVo.getOrderNo())) {
            WebUtil.getRequest().setAttribute("orderParam", orderVo.getOrderNo());
            WebUtil.getRequest().setAttribute("orderNo", orderVo.getOrderNo());
        }
@@ -441,14 +448,14 @@
    }
//=======================================页面转发END==================================
    /**
     * 2021-08-20 新增:erp系统取消订单接口,不做订单状态校验
     * 取消订单
     */
    @Transactional(rollbackFor = Exception.class)
    @RequestMapping(value = "/cancelOrder")
    @RequestMapping(value = "/erpCancelOrder")
    public @ResponseBody
    AjaxResult cancelOrder(Long id, Integer del) {
    AjaxResult erpCancelOrder(Long id) {
        AjaxResult result = new AjaxResult();
        SysOrder order = orderService.findById(id);
@@ -465,15 +472,32 @@
        }
        orderService.cancelOrder(id);
//        if (del > 0) {
//            orderService.removeById(id);
//            result.setInfo("删除成功!");
//        } else {
            result.setInfo("取消成功!");
//        }
        result.setInfo("取消成功!");
        result.setStatus(AjaxResult.STATUS_SUCCESS);
        return result;
    }
    /**
     * 取消订单
     */
    @Transactional(rollbackFor = Exception.class)
    @RequestMapping(value = "/cancelOrder")
    public @ResponseBody
    AjaxResult cancelOrder(Long id, Integer del) {
        SysOrder order = orderService.findById(id);
        BusParameterSettings shopManageAbleCancelDfkOrder = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER, order.getCompanyId());
        if (StringUtils.isNotBlank(shopManageAbleCancelDfkOrder.getParamValue())
                && shopManageAbleCancelDfkOrder.getParamValue().equals(Dictionary.FLAG_YES)) {
            if (!Dictionary.ORDER_STATU_DFK.equals(order.getStatu())) {
                return new AjaxResult(AjaxResult.STATUS_FAIL, "您只能取消待付款订单");
            }
        }
        return erpCancelOrder(id);
    }
    @RequestMapping(value = "/exportExcel")
@@ -491,17 +515,16 @@
     */
    @RequestMapping(value = "/erpExportExcel")
    public void erpExportExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response,
                       SysOrder sysOrder) throws Exception {
                               SysOrder sysOrder) throws Exception {
        doExportOrder(response, sysOrder);
        return;
    }
    /**
     * 执行订单导出,总部和门店共用,但是搜索条件不一样
     *
     * @param response
     * @param sysOrder
     * @throws IOException
zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java
@@ -14,7 +14,10 @@
import com.matrix.core.tools.excl.ExcelSheetPO;
import com.matrix.core.tools.excl.ExcelUtil;
import com.matrix.core.tools.excl.ExcelVersion;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.common.dao.SysCompanyDao;
import com.matrix.system.common.service.SysUsersService;
import com.matrix.system.common.tools.DataAuthUtil;
@@ -478,6 +481,8 @@
        }
    }
    @Autowired
    BusParameterSettingsDao busParameterSettingsDao;
    /**
     * 根据id取消预约
@@ -485,6 +490,24 @@
    @RequestMapping(value = "/cancelOrder")
    public @ResponseBody
    AjaxResult cancelOrder(SysProjServices services) {
        SysProjServices checkProjServices = sysProjServicesDao.selectById(services.getId());
        BusParameterSettings shopManageAbleCancelDfkOrder = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER, checkProjServices.getCompanyId());
        if (StringUtils.isNotBlank(shopManageAbleCancelDfkOrder.getParamValue())
                && shopManageAbleCancelDfkOrder.getParamValue().equals(Dictionary.FLAG_YES)) {
            if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY)
            && !checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DQR)) {
                return new AjaxResult(AjaxResult.STATUS_FAIL, "您只能取消待预约订单");
            }
        }
       return erpCancelOrder(services);
    }
    /**
     * 根据id取消预约
     */
    @RequestMapping(value = "/erpCancelOrder")
    public @ResponseBody
    AjaxResult erpCancelOrder(SysProjServices services) {
        int i = sysProjServicesService.modifyCancelProjServices(services);
        if (i > 0) {
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, "取消预约成功");
@@ -492,7 +515,6 @@
            return new AjaxResult(AjaxResult.STATUS_FAIL, "取消预约失败");
        }
    }
    /**
     * 设置服务单划扣成功
zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java
@@ -278,7 +278,7 @@
                List<Object> objects = taocanDataList.get(j);
                LogUtil.info("导入套餐第" + j + "行" + objects);
                Object vipName = objects.get(0);
                String vipNameStr = vipName.toString();
                String vipNameStr = vipName==null?"":vipName.toString();
                if (taocan == null
                        || (taocan != null && StringUtils.isNotBlank(vipNameStr))) {
                    //切换下一个套餐
zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java
@@ -7,8 +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.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;
@@ -114,7 +113,7 @@
    public @ResponseBody AjaxResult findAllWithPermi(SysShopInfo shopInfo) {
        QueryUtil.setQueryLimitCom(shopInfo);
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){
         if (!DataAuthUtil.hasAllShopAuth()) {
            shopInfo.setId(sysUsers.getShopId());
        }
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findByModel(shopInfo), null);
zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java
@@ -23,7 +23,6 @@
import com.matrix.system.hive.dao.SysShopInfoDao;
import com.matrix.system.hive.service.ShoppingGoodsService;
import com.matrix.system.hive.service.SysShopInfoService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
@@ -191,6 +190,7 @@
            }
        }
        shoppingGoods.setIsDel(ShoppingGoods.NORMAL);
        shoppingGoods.setStaus(Dictionary.BUSINESS_STATE_UP);
        List<ShoppingGoods> dataList = shoppingGoodsService.findInPage(shoppingGoods, pageVo);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, shoppingGoodsService.findTotal(shoppingGoods));
        return result;
zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java
@@ -61,8 +61,8 @@
    public List<AchieveNew> findSumDailyInfoNew(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo);
    List<AchieveNew> selectVipConsumeStatisticsList(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo);
    List<Map<String, Object>> selectVipConsumeStatisticsList(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo);
    int selectVipConsumeStatisticsTotal(@Param("record") AchieveNew achieveNew);
zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java
@@ -1,14 +1,14 @@
package com.matrix.system.hive.service;
import java.util.List;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.system.app.vo.UserAchieveVo;
import com.matrix.system.hive.bean.AchieveNew;
import com.matrix.system.hive.bean.SysOrder;
import com.matrix.system.hive.bean.SysProjServices;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.system.hive.plugin.util.BaseServices;
import java.util.List;
import java.util.Map;
/**
 *
@@ -109,7 +109,7 @@
    public void modifyAchieveTime(AchieveNew achieveNew);
    List<AchieveNew> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo);
    List<Map<String, Object>>  findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo);
    int findVipConsumeStatisticsTotal(AchieveNew achieveNew);
zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
@@ -390,7 +390,7 @@
    }
    @Override
    public List<AchieveNew> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo) {
    public List<Map<String, Object>> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo) {
        return achieveNewDao.selectVipConsumeStatisticsList(achieveNew, pageVo);
    }
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
@@ -1026,8 +1026,8 @@
        }
        sourceOrder.setArrears(sourceOrder.getArrears() - refundTotal);
        sourceOrder.setCardPay(sourceOrder.getCardPay() + cardPayTotal);
        sourceOrder.setCashPay(sourceOrder.getCashPay() + cashPayTotal);
        sourceOrder.setCardPay(sourceOrder.getCardPay()==null?0:sourceOrder.getCardPay() + cardPayTotal);
        sourceOrder.setCashPay(sourceOrder.getCashPay()==null?0:sourceOrder.getCashPay() + cashPayTotal);
        sysOrderDao.update(sourceOrder);
    }
@@ -1188,7 +1188,7 @@
            List<ShoppingGoodsAssemble> assembleList = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_XM);
            assembleList.forEach(item -> {
                //TODO 补综合卡逻辑
                createProjuseByAssemble(order, sysOrderItem, item, null, null);
                createProjuseByAssemble(order, sysOrderItem, item, null, null,null,0);
            });
            //处理综合卡中包含的套餐
@@ -1209,7 +1209,7 @@
     * 通过组合关系创建用户项目余次
     */
    private SysProjUse createProjuseByAssemble(SysOrder order, SysOrderItem sysOrderItem,
                                               ShoppingGoodsAssemble goodsAssemble, Long taocanId, Date failTime) {
                                               ShoppingGoodsAssemble goodsAssemble, Long taocanId, Date failTime,String source,Integer maxCount) {
        //计算折扣
        Double zk = sysOrderItem.getZkPrice() / sysOrderItem.getPrice();
@@ -1217,23 +1217,21 @@
        puse.setIsOver(Dictionary.DELETED_N);
        puse.setOrderItemId(sysOrderItem.getId());
        puse.setProjId(goodsAssemble.getAssembleGoodId());
        puse.setSurplusCount(goodsAssemble.getTotal());
        puse.setSurplusCount(goodsAssemble.getTotal()==null?maxCount: goodsAssemble.getTotal());
        puse.setDeductionNum(goodsAssemble.getDeductionNum());
        puse.setProjName(goodsAssemble.getShoppingGoods().getName());
        puse.setVipId(order.getVipId());
        puse.setStatus(Dictionary.TAOCAN_STATUS_YX);
        puse.setTaocanId(taocanId);
        puse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM);
        puse.setSource(source);
        if (taocanId == null) {
            puse.setPrice(goodsAssemble.getShoppingGoods().getPrice() * zk);
        } else {
            puse.setPrice(goodsAssemble.getPrice() * zk);
        }
        // 赠送和打折后金额为0的都视为赠送项目
        if (sysOrderItem.getIsFree().equals(Dictionary.FLAG_NO) && sysOrderItem.getZkPrice() > 0) {
            puse.setSource(Dictionary.TAOCAN_SOURCE_GM);
        } else {
            puse.setSource(Dictionary.TAOCAN_SOURCE_ZS);
            //赠送项目是否计算消耗业绩否则 赠送产品按原价计算消耗
@@ -1255,8 +1253,6 @@
                puse.setPrice(0D);
            }
        }
        puse.setBalance(MoneyUtil.mul(puse.getPrice(), Double.valueOf(puse.getSurplusCount())));
        puse.setFailTime(failTime);
        sysProjUseDao.insert(puse);
@@ -1306,19 +1302,21 @@
        //创建套餐绑定的项目
        List<ShoppingGoodsAssemble> assembleList = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(projId, ShoppingGoods.SHOPPING_GOODS_TYPE_XM);
        for (ShoppingGoodsAssemble assemble : assembleList) {
            SysProjUse tempUse = createProjuseByAssemble(order, sysOrderItem, assemble, taocanProjUse.getId(),taocanProjUse.getFailTime());
            SysProjUse tempUse = createProjuseByAssemble(order, sysOrderItem, assemble, taocanProjUse.getId(),taocanProjUse.getFailTime(),taocanProjUse.getSource(),taocanShoppingGoods.getCarUseCount());
            sumBanance += tempUse.getBalance();
            surplusCount += tempUse.getSurplusCount();
        }
        if (Dictionary.FLAG_NO_N.equals(taocanShoppingGoods.getIsCourse())) {
            //固定套餐,剩余次数等于绑定项目的次数
            taocanProjUse.setSurplusCount(surplusCount);
            //合计套餐余额
            taocanProjUse.setBalance(sumBanance);
        } else {
            //任选套餐剩余次数等于最大使用次数
            taocanProjUse.setSurplusCount(taocanShoppingGoods.getCarUseCount());
            taocanProjUse.setBalance(sysOrderItem.getZkPrice());
        }
        //合计套餐余额
        taocanProjUse.setBalance(sumBanance);
        sysProjUseDao.update(taocanProjUse);
    }
zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java
@@ -11,8 +11,8 @@
import com.matrix.core.tools.excl.ExcelVersion;
import com.matrix.system.common.bean.CustomerDataDictionary;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.common.tools.ResponseHeadUtil;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.AchieveNew;
@@ -78,7 +78,7 @@
    public @ResponseBody
    AjaxResult findSumDailyInfoNew(@RequestBody  AchieveNew achieveNew) {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){
         if (!DataAuthUtil.hasAllShopAuth()) {
            achieveNew.setShopId(sysUsers.getShopId());
        }
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, achieveNewService.findSumDailyInfoNew(achieveNew, null),
@@ -95,7 +95,7 @@
    AjaxResult findDailyInfoNew(@RequestBody  AchieveNew achieveNew) {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        achieveNew.setCompanyId(sysUsers.getCompanyId());
        if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){
         if (!DataAuthUtil.hasAllShopAuth()) {
            achieveNew.setShopId(sysUsers.getShopId());
        }
        PaginationVO pageVo = new PaginationVO();
@@ -121,7 +121,7 @@
                , "服务提成", "人头", "项目个数", "服务时间", "订单类型"};
        orderSheet.setHeaders(header);
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){
         if (!DataAuthUtil.hasAllShopAuth()) {
            queryDto.setShopId(sysUsers.getShopId());
        }
        queryDto.setCompanyId(sysUsers.getCompanyId());
@@ -198,7 +198,7 @@
        orderSheet.setHeaders(header);
        if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){
         if (!DataAuthUtil.hasAllShopAuth()) {
            achieveNew.setShopId(sysUsers.getShopId());
        }
zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java
@@ -1,12 +1,16 @@
package com.matrix.system.hive.statistics;
import cn.hutool.core.util.StrUtil;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.DateUtil;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.app.dto.BusinessesDto;
import com.matrix.system.app.vo.BusinessesDataShowVo;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.bean.SysBusinessData;
import com.matrix.system.hive.dao.SysBusinessDataDao;
import com.matrix.system.hiveErp.analysUtil.StatisticsTimeDaoParam;
import com.matrix.system.hiveErp.analysUtil.StatisticsTimeUtil;
@@ -39,7 +43,7 @@
    public @ResponseBody
    AjaxResult showList(BusinessDataShowVo businessDataShowVo, PaginationVO pageVo) {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){
         if (!DataAuthUtil.hasAllShopAuth()) {
            businessDataShowVo.setShopId(sysUsers.getShopId()+"");
        }
        pageVo.setSort("createTime");
@@ -102,4 +106,44 @@
        return AjaxResult.buildSuccessInstance(result, total);
    }
    @RequestMapping(value = "/findShopBusinessesData")
    @ResponseBody
    public AjaxResult findShopBusinessesData(BusinessDataShowVo businessDataShowVo, PaginationVO pageVo) {
        int start = pageVo.getOffset();
        int size = pageVo.getLimit();
        int calenderUnit = Calendar.DATE;
        Long shopId = null;
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if (StrUtil.isNotBlank(businessDataShowVo.getShopId())) {
            shopId = Long.parseLong(businessDataShowVo.getShopId());
        } else {
            shopId = sysUsers.getShopId();
        }
        Calendar calendar = Calendar.getInstance();
        if (businessDataShowVo.getBeginTime() != null) {
            calendar.setTime(businessDataShowVo.getBeginTime());
        }
        calendar.add(calenderUnit, 1);
        calendar.add(calenderUnit, -start);
        String endTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD);
        calendar.add(calenderUnit, -size);
        String startTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD);
        List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(startTime, endTime, "日");
        List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis);
        List<StatisticsTimeDaoParam> statisticsTimeDaoParams = timeSpaceParam.subList(0, timeSpaceParam.size() - 2);
        List<BusinessesDataShowVo> list = sysBusinessDataDao.selectApiBusinessData(statisticsTimeDaoParams, shopId, sysUsers.getCompanyId());
        List<BusinessesDataShowVo> result = new ArrayList<>();
        for (int i = list.size() - 1; i >= 0; i--) {
            BusinessesDataShowVo item = list.get(i);
            String dataTime = item.getDataTime();
            item.setDataTime(DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.DATE_FORMAT_DD), DateUtil.DATE_FORMAT_DD));
            result.add(item);
        }
        return AjaxResult.buildSuccessInstance(result, 100);
    }
}
zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java
@@ -5,7 +5,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.common.tools.DataAuthUtil;
import com.matrix.system.hive.bean.AchieveNew;
import com.matrix.system.hive.service.AchieveNewService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,8 +13,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 客户数据统计
@@ -33,10 +33,10 @@
    @ResponseBody
    public AjaxResult vipConsumeStatistics(AchieveNew achieveNew, PaginationVO pageVo) {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){
         if (!DataAuthUtil.hasAllShopAuth()) {
            achieveNew.setShopId(sysUsers.getShopId());
        }
        List<AchieveNew> list = achieveNewService.findVipConsumeStatisticsList(achieveNew, pageVo);
        List<Map<String, Object>> list = achieveNewService.findVipConsumeStatisticsList(achieveNew, pageVo);
        int total = achieveNewService.findVipConsumeStatisticsTotal(achieveNew);
        return AjaxResult.buildSuccessInstance(list, total);
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopDeliveryInfoAction.java
@@ -84,6 +84,7 @@
        pageVo.setSort("create_time");
        pageVo.setOrder("desc");
        shopDeliveryInfo.setCompanyId(sysUsers.getCompanyId());
//        shopDeliveryInfo.setShopId(sysUsers.getShopId());
        List<ShopDeliveryInfo> dataList = shopDeliveryInfoDao.selectInPage(shopDeliveryInfo, pageVo);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList,
                shopDeliveryInfoDao.selectTotalRecord(shopDeliveryInfo));
@@ -159,6 +160,7 @@
        info.setRemarks(deliveryInfo.getRemarks());
        info.setLogisticsStatus(AppConstance.LOGISTICS_STATUS_OF_RECEIVE);
        info.setDeliveryTime(new Date());
        info.setCompanyId(user.getCompanyId());
        shopDeliveryInfoDao.updateByModel(info);
        //构建需要修改订单信息Map
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopProductAction.java
@@ -2,33 +2,32 @@
import com.alibaba.fastjson.JSON;
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.anotations.SaveRequestToken;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.constance.SystemErrorCode;
import com.matrix.core.constance.SystemMessageCode;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.constance.SystemErrorCode;
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.tools.ServiceUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.action.BaseController;
import com.matrix.system.shopXcx.bean.*;
import com.matrix.system.shopXcx.dao.*;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.matrix.core.exception.GlobleException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.matrix.core.anotations.SaveRequestToken;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.List;
/**
 * @description 产品表
@@ -171,7 +170,10 @@
                    shopProductParamRef.setUpdateBy(user.getSuName());
                    newShopProductParamRefs.add(shopProductParamRef);
                }
                shopProductParamRefDao.batchInsert(newShopProductParamRefs);
                if(CollectionUtils.isNotEmpty(newShopProductParamRefs)){
                    shopProductParamRefDao.batchInsert(newShopProductParamRefs);
                }
            }
             return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, "产品表");
         }else {
zq-erp/src/main/java/com/matrix/system/shopXcx/api/WeChatApiTools.java
@@ -16,7 +16,6 @@
@Service
public class WeChatApiTools {
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java
@@ -97,16 +97,38 @@
        if (StringUtils.isBlank(bindingPhoneNumber.getPhoneNumber())) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空");
        }
        //验证通过将手机号加入相应的用户数据中
        SysVipInfo sysVipInfo = new SysVipInfo();
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        sysVipInfo.setId(loginUser.getId());
        if(loginUser.getShopId()==null){
            sysVipInfo.setShopId(bindingPhoneNumber.getShopId());
        SysVipInfo oldeUser = sysVipInfoDao.selectByPhone(bindingPhoneNumber.getPhoneNumber(), loginUser.getCompanyId());
        if(oldeUser!=null){
            oldeUser.setIsSales(loginUser.getIsSales());
            oldeUser.setOpenId(loginUser.getOpenId());
            oldeUser.setSessionKey(loginUser.getSessionKey());
            oldeUser.setPhoto(loginUser.getAvatarUrl());
            oldeUser.setAvatarUrl(loginUser.getAvatarUrl());
            sysVipInfoDao.update(oldeUser);
            sysVipInfoDao.deleteById(loginUser.getId());
            String token = redisUserLoginUtils.saveUserInfo(oldeUser);
            AjaxResult result =   AjaxResult.buildSuccessInstance("绑定成功");
            result.putInMap("token",token);
            result.putInMap("userInfo",oldeUser);
            return result;
        }else{
            //验证通过将手机号加入相应的用户数据中
            SysVipInfo sysVipInfo = new SysVipInfo();
            sysVipInfo.setId(loginUser.getId());
            if(loginUser.getShopId()==null){
                sysVipInfo.setShopId(bindingPhoneNumber.getShopId());
            }
            sysVipInfo.setPhone(bindingPhoneNumber.getPhoneNumber());
            sysVipInfoDao.update(sysVipInfo);
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, "绑定成功");
        }
        sysVipInfo.setPhone(bindingPhoneNumber.getPhoneNumber());
        sysVipInfoDao.update(sysVipInfo);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "绑定成功");
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java
@@ -1,17 +1,15 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.ImageUtil;
import com.matrix.component.tools.WxacodeUtil;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.DateUtil;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.PropertiesUtil;
import com.matrix.core.tools.UUIDUtil;
import com.matrix.core.tools.*;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysShopInfoDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.shopXcx.api.WeChatApiTools;
import com.matrix.system.shopXcx.api.pojo.QrcodeImgParam;
@@ -59,10 +57,8 @@
    @Autowired
    private SysShopInfoDao shopInfoDao;
    @Value(value = "${qrcodeBackgroundImgPath}")
    private String qrcodeBackgroundImgPath;
    @Value(value = "${qrcodeFrontImgPath}")
    private String qrcodeFrontImgPath;
@@ -251,7 +247,9 @@
        // 图片访问URL
        String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL);
        String productImg = shopProduct.getImgMobile();
        productImg = productImg.replace(baseSaveUrl, baseSavePath);
        String productPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "poster.png";
        ImageUtil.downloadPicture(productImg, productPath);
//        productImg = productImg.replace(baseSaveUrl, baseSavePath);
        String targetImg = UUIDUtil.getRandomID() + ".png";
        QrcodeImgParam qrcodeImgParam = new QrcodeImgParam();
@@ -259,7 +257,7 @@
        qrcodeImgParam.qrcodeSavePath = qrcodeSavePath;
        qrcodeImgParam.qrcodeBackgroundImgPath = qrcodeBackgroundImgPath;
        qrcodeImgParam.qrcodeFrontImgPath = qrcodeFrontImgPath;
        qrcodeImgParam.productImgPath = productImg;
        qrcodeImgParam.productImgPath = productPath;
        qrcodeImgParam.urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg;
        qrcodeImgParam.targetImg = baseSavePath + "/" + "wxacode" + "/" + targetImg;
        qrcodeImgParam.title = shopProduct.getTitle();
@@ -337,10 +335,11 @@
    public static void main(String[] args) throws Exception {
        QrcodeImgParam qrcodeImgParam = new QrcodeImgParam();
        qrcodeImgParam.qrcodeSavePath = "C:\\Users\\Administrator\\Desktop\\dd\\ewm.png";
        qrcodeImgParam.qrcodeSavePath = "C:\\Users\\Administrator\\Desktop\\ewm.png";
        qrcodeImgParam.qrcodeBackgroundImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\bj1.png";
        qrcodeImgParam.qrcodeFrontImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\qj2.png";
        qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\banner.jpg";
//        qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\dd\\banner.jpg";
        qrcodeImgParam.productImgPath = "C:\\Users\\Administrator\\Desktop\\6cbfee5df0474fe0b864be142bc474ab.jpg";
        qrcodeImgParam.targetImg = "C:\\Users\\Administrator\\Desktop\\dd\\banner111.jpg";
        qrcodeImgParam.title = "盐酸米多君片";
        qrcodeImgParam.price = "¥30";
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java
@@ -127,7 +127,7 @@
                    sysVipInfo.setVipNo(openId);
                    sysVipInfoService.add(sysVipInfo);
                }else{
                } else {
                    sysVipInfo.setSessionKey(sessionKey);
                    sysVipInfoDao.update(sysVipInfo);
                }
@@ -162,15 +162,15 @@
        sysVipInfo.setBalance(moneyCardUseDao.selectVipCardTotalMoney(loginUser.getId()));
        AjaxResult res = new AjaxResult();
        res.putInMap("couponCount", shopCouponRecordDao.countUnuseCouponRecord(loginUser.getId()));
        res.putInMap("prizeCount",activitySignReceiveRecordDao.getSignAwardReceiveCount(loginUser.getId(),loginUser.getCompanyId()));
        res.putInMap("prizeCount", activitySignReceiveRecordDao.getSignAwardReceiveCount(loginUser.getId(), loginUser.getCompanyId()));
        res.putInMap("userInfo", sysVipInfo);
        //查询会员等级
        if(sysVipInfo.getSalesmanGrade()!=null){
        if (sysVipInfo.getSalesmanGrade() != null) {
            ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade());
            res.putInMap("vipLevel", shopSalesmanGrade.getName());
        }else if(sysVipInfo.getVipLevel()!=null){
        } else if (sysVipInfo.getVipLevel() != null) {
            res.putInMap("vipLevel", sysVipInfo.getVipLevel().getLevelName());
        }else{
        } else {
            res.putInMap("vipLevel", "初级会员");
        }
        res.setStatus(AjaxResult.STATUS_SUCCESS);
@@ -184,7 +184,7 @@
    public @ResponseBody
    AjaxResult findUserInfo(@PathVariable String openId) {
        SysVipInfo sysVipInfo = sysVipInfoService.findByOpenId(openId);
        SysVipInfo bizUserQuery=new SysVipInfo();
        SysVipInfo bizUserQuery = new SysVipInfo();
        bizUserQuery.setNickName(sysVipInfo.getNickName());
        bizUserQuery.setAvatarUrl(sysVipInfo.getAvatarUrl());
        bizUserQuery.setOpenId(openId);
@@ -200,16 +200,16 @@
    AjaxResult saveUserInfo(@RequestBody XcxUserSaveUserInfoDto xcxUserSaveUserInfoDto) {
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo sysVipInfo=new SysVipInfo();
        SysVipInfo sysVipInfo = new SysVipInfo();
        sysVipInfo.setId(loginUser.getId());
        BeanUtil.copyProperties(xcxUserSaveUserInfoDto,sysVipInfo);
        BeanUtil.copyProperties(xcxUserSaveUserInfoDto, sysVipInfo);
        sysVipInfo.setPhone(xcxUserSaveUserInfoDto.getPhoneNumber());
        if(StringUtils.isBlank(loginUser.getVipName())||loginUser.getVipName().equals("微信用户")){
        if (StringUtils.isBlank(loginUser.getVipName()) || loginUser.getVipName().equals("微信用户")) {
            sysVipInfo.setVipName(xcxUserSaveUserInfoDto.getNickName());
        }
        if(StringUtils.isBlank(loginUser.getSex())){
            sysVipInfo.setSex(xcxUserSaveUserInfoDto.getGender()==1?"男":"女");
        if (StringUtils.isBlank(loginUser.getSex())) {
            sysVipInfo.setSex(xcxUserSaveUserInfoDto.getGender() == 1 ? "男" : "女");
        }
        int i = sysVipInfoDao.update(sysVipInfo);
@@ -220,7 +220,6 @@
        }
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(sysVipInfo));
    }
    void checkNeedToBeSalesman(SysVipInfo sysVipInfo, SysVipInfo loginUser) {
@@ -236,12 +235,7 @@
                    queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH);
                    ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper);
                    if (shopSalesmanApply == null) {//没有待审核记录
                        try {
                            shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, null, 2);
                        }catch (Exception e){
                            LogUtil.debug(e.getMessage());
                        }
                        shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, null, 2);
                    }
                }
            }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java
@@ -319,7 +319,7 @@
        List<CouponReceiveInfoVO> usefulCoupon = new ArrayList<>();
        CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO();
        //满足店铺活动的订单不能使用优惠券
        if (conditionsGroupCount > 0) {
        if (conditionsGroupCount <= 0) {
            //计算可用优惠券
            usefulCoupon = wxShopCouponService.getCartVoCouponList(sysVipInfo.getCompanyId(), orderItemDtos);
            //获取用户使用的优惠券
zq-erp/src/main/java/findC.java
@@ -34,7 +34,7 @@
                        traverseFolder(file2);
                    } else {
                        if(file2.length()>_1mb*100){
                        if(file2.length()>_1mb*50){
                            System.out.println( file2.length()/_1mb+"MB"+"\t"+file2.getAbsolutePath());
                        }
                    }
zq-erp/src/main/resources/config/application.properties
@@ -4,9 +4,9 @@
#线上测试环境
#
spring.datasource.username=ct_test
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_meidu?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!@#
@@ -17,9 +17,9 @@
#spring.datasource.password=hive123!@#
#spring.datasource.url=jdbc:mysql://124.70.222.34/hive_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
#spring.datasource.username=meidu_data
#spring.datasource.password=meidu_4321#&@
#spring.datasource.url=jdbc:mysql://47.111.134.136/db_meidu_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
spring.datasource.username=meidu_data
spring.datasource.password=meidu_4321#&@
spring.datasource.url=jdbc:mysql://47.111.134.136/db_meidu_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
zq-erp/src/main/resources/mybatis/mapper/common/SysRoleDao.xml
@@ -12,7 +12,7 @@
        <result property="companyId" column="company_id" />
        <result property="plates" column="plates" />
        <result property="shopAble" column="shop_able" />
        <result property="coustomer" column="coustomer" />
        <result property="customer" column="customer" />
    </resultMap>
@@ -32,7 +32,7 @@
        company_id,
        plates,
        is_default,
        coustomer,
        customer,
        shop_able
        )
        VALUES (
@@ -46,7 +46,7 @@
        #{companyId},
        #{plates},
        #{isDefault},
        #{coustomer},
        #{customer},
        #{shopAble}
        )
    </insert>
@@ -66,7 +66,7 @@
        company_id,
        plates,
        is_default,
        coustomer,
        customer,
        shop_able
        )
        VALUES
@@ -82,7 +82,7 @@
            #{item.companyId},
            #{item.plates},
            #{item.isDefault},
            #{item.coustomer},
            #{item.customer},
            #{item.shopAble}
            )
        </foreach>
@@ -115,8 +115,8 @@
            <if test="_parameter.containsKey('shopAble')">
                shop_able = #{shopAble},
            </if>
            <if test="_parameter.containsKey('coustomer')">
                coustomer = #{coustomer},
            <if test="_parameter.containsKey('customer')">
                customer = #{customer},
            </if>
        </set>
        WHERE role_id=#{roleId}
@@ -150,8 +150,8 @@
            <if test="(shopAble!=null and shopAble!='') or (shopAble!='' and shopAble==0)">
                shop_able = #{shopAble},
            </if>
            <if test="(coustomer!=null and coustomer!='') or (coustomer!='' and coustomer==0)">
                coustomer = #{coustomer},
            <if test="(customer!=null and customer!='') or (customer!='' and customer==0)">
                customer = #{customer},
            </if>
        </set>
        WHERE role_id=#{roleId}
@@ -217,7 +217,7 @@
        company_id,
        plates,
        is_default,
        coustomer,
        customer,
        shop_able
        from sys_role
        <where>
@@ -303,7 +303,7 @@
        company_id,
        plates,
        is_default,
        coustomer,
        customer,
        shop_able
        from sys_role
        where role_id=#{roleId}
@@ -336,7 +336,7 @@
        company_id,
        plates,
        is_default,
        coustomer,
        customer,
        shop_able
        from sys_role
        <where>
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.matrix.system.hive.dao.AchieveNewDao">
    <!-- 定义AchieveNew 的复杂关联map -->
@@ -101,7 +101,7 @@
            and    a.company_id = #{record.companyId}
            <if test="record!=null">
                <if
                    test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                        test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                    and a.shop_id = #{record.shopId}
                </if>
                <if test="record.achieveRuleId != null  ">
@@ -151,7 +151,7 @@
    </select>
    <select id="findDayFlowTotal"
        resultType="java.lang.Integer">
            resultType="java.lang.Integer">
        select count(*)
        from
        achieve_new a
@@ -167,7 +167,7 @@
        <where>
            <if test="record!=null">
                <if
                    test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                        test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                    and a.shop_id = #{record.shopId}
                </if>
                <if test="record.year != null and record.year !='' ">
@@ -201,41 +201,41 @@
        </where>
    </select>
<!--
    <!--
 统计员工业绩
     统计员工业绩
select
        u.name,
        g.su_name guwen,
        cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total,
        cast(SUM(a.his_consume) AS decimal(15,2)),
        cast(SUM(a.free_consume) AS decimal(15,2)),
        cast(SUM(a.proj_percentage) AS decimal(15,2)),
        cast(SUM(a.number_of_people) AS decimal(15,2)),
        cast(SUM(a.proj_num) AS decimal(15,2)),
        cast(SUM(a.proj_time) AS decimal(15,2)),
        h.shop_short_name shop_name,
        a.order_type,
        a.achieveType
        from
        achieve_new a
        left join sys_order b on a.order_id=b.id
        left join sys_vip_info c on a.vip_id=c.id
        left join sys_vip_level d on c.LEVEL_ID=d.id
        left join shopping_goods e on a.shopping_goods_id=e.id
        LEFT JOIN sys_users f on a.beault_id=f.su_id
        LEFT JOIN sys_users g on a.sale_id = g.su_id
        LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID
        LEFT JOIN shopping_goods_category i ON e.cate_id = i.id
        left join sys_proj_services l on a.service_order_id=l.id
        left join sys_order_item j on a.order_item_id=j.ID
        left join achieve_rule u on u.id=e.achieve_rule_id
 where h.shop_short_name='龙华店'
    GROUP BY g.su_name , a.order_type, h.id,a.achieveType
    ORDER BY g.su_name
    select
            u.name,
            g.su_name guwen,
            cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total,
            cast(SUM(a.his_consume) AS decimal(15,2)),
            cast(SUM(a.free_consume) AS decimal(15,2)),
            cast(SUM(a.proj_percentage) AS decimal(15,2)),
            cast(SUM(a.number_of_people) AS decimal(15,2)),
            cast(SUM(a.proj_num) AS decimal(15,2)),
            cast(SUM(a.proj_time) AS decimal(15,2)),
            h.shop_short_name shop_name,
            a.order_type,
            a.achieveType
            from
            achieve_new a
            left join sys_order b on a.order_id=b.id
            left join sys_vip_info c on a.vip_id=c.id
            left join sys_vip_level d on c.LEVEL_ID=d.id
            left join shopping_goods e on a.shopping_goods_id=e.id
            LEFT JOIN sys_users f on a.beault_id=f.su_id
            LEFT JOIN sys_users g on a.sale_id = g.su_id
            LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID
            LEFT JOIN shopping_goods_category i ON e.cate_id = i.id
            left join sys_proj_services l on a.service_order_id=l.id
            left join sys_order_item j on a.order_item_id=j.ID
            left join achieve_rule u on u.id=e.achieve_rule_id
     where h.shop_short_name='龙华店'
        GROUP BY g.su_name , a.order_type, h.id,a.achieveType
        ORDER BY g.su_name
-->
    -->
    <select id="findSumDailyInfoNew" resultMap="AchieveNewMap">
@@ -268,7 +268,7 @@
        <where>
            <if test="record!=null">
                <if
                    test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                        test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                    and a.shop_id = #{record.shopId}
                </if>
                <if test="record.year != null and record.year !='' ">
@@ -415,120 +415,120 @@
        <if test="record!=null">
            <if
                test="(record.id!=null and record.id!='') or  (record.id!='' and record.id==0)  ">
                    test="(record.id!=null and record.id!='') or  (record.id!='' and record.id==0)  ">
                and id = #{record.id}
            </if>
            <if test="record.companyId != null and record.companyId !='' ">
                and company_id = #{record.companyId}
            </if>
            <if
                test="(record.saleId!=null and record.saleId!='') or  (record.saleId!='' and record.saleId==0)  ">
                    test="(record.saleId!=null and record.saleId!='') or  (record.saleId!='' and record.saleId==0)  ">
                and sale_id = #{record.saleId}
            </if>
            <if
                test="(record.beaultId!=null and record.beaultId!='') or  (record.beaultId!='' and record.beaultId==0)  ">
                    test="(record.beaultId!=null and record.beaultId!='') or  (record.beaultId!='' and record.beaultId==0)  ">
                and beault_id = #{record.beaultId}
            </if>
            <if
                test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                    test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                and shop_id = #{record.shopId}
            </if>
            <if
                test="(record.datatime!=null and record.datatime!='') or  (record.datatime!='' and record.datatime==0)  ">
                    test="(record.datatime!=null and record.datatime!='') or  (record.datatime!='' and record.datatime==0)  ">
                and datatime = #{record.datatime}
            </if>
            <if
                test="(record.orderId!=null and record.orderId!='') or  (record.orderId!='' and record.orderId==0)  ">
                    test="(record.orderId!=null and record.orderId!='') or  (record.orderId!='' and record.orderId==0)  ">
                and order_id = #{record.orderId}
            </if>
            <if
                test="(record.orderItemId!=null and record.orderItemId!='') or  (record.orderItemId!='' and record.orderItemId==0)  ">
                    test="(record.orderItemId!=null and record.orderItemId!='') or  (record.orderItemId!='' and record.orderItemId==0)  ">
                and order_item_id = #{record.orderItemId}
            </if>
            <if
                test="(record.shoppingGoodsId!=null and record.shoppingGoodsId!='') or  (record.shoppingGoodsId!='' and record.shoppingGoodsId==0)  ">
                    test="(record.shoppingGoodsId!=null and record.shoppingGoodsId!='') or  (record.shoppingGoodsId!='' and record.shoppingGoodsId==0)  ">
                and shopping_goods_id = #{record.shoppingGoodsId}
            </if>
            <if
                test="(record.serviceOrderId!=null and record.serviceOrderId!='') or  (record.serviceOrderId!='' and record.serviceOrderId==0)  ">
                    test="(record.serviceOrderId!=null and record.serviceOrderId!='') or  (record.serviceOrderId!='' and record.serviceOrderId==0)  ">
                and service_order_id = #{record.serviceOrderId}
            </if>
            <if
                test="(record.vipId!=null and record.vipId!='') or  (record.vipId!='' and record.vipId==0)  ">
                    test="(record.vipId!=null and record.vipId!='') or  (record.vipId!='' and record.vipId==0)  ">
                and vip_id = #{record.vipId}
            </if>
            <if
                test="(record.freeConsume!=null and record.freeConsume!='') or  (record.freeConsume!='' and record.freeConsume==0)  ">
                    test="(record.freeConsume!=null and record.freeConsume!='') or  (record.freeConsume!='' and record.freeConsume==0)  ">
                and free_consume = #{record.freeConsume}
            </if>
            <if
                test="(record.hisConsume!=null and record.hisConsume!='') or  (record.hisConsume!='' and record.hisConsume==0)  ">
                    test="(record.hisConsume!=null and record.hisConsume!='') or  (record.hisConsume!='' and record.hisConsume==0)  ">
                and his_consume = #{record.hisConsume}
            </if>
            <if
                test="(record.goodsCash!=null and record.goodsCash!='') or  (record.goodsCash!='' and record.goodsCash==0)  ">
                    test="(record.goodsCash!=null and record.goodsCash!='') or  (record.goodsCash!='' and record.goodsCash==0)  ">
                and goods_cash = #{record.goodsCash}
            </if>
            <if
                test="(record.projNum!=null and record.projNum!='') or  (record.projNum!='' and record.projNum==0)  ">
                    test="(record.projNum!=null and record.projNum!='') or  (record.projNum!='' and record.projNum==0)  ">
                and proj_num = #{record.projNum}
            </if>
            <if
                test="(record.numberOfPeople!=null and record.numberOfPeople!='') or  (record.numberOfPeople!='' and record.numberOfPeople==0)  ">
                    test="(record.numberOfPeople!=null and record.numberOfPeople!='') or  (record.numberOfPeople!='' and record.numberOfPeople==0)  ">
                and number_of_people = #{record.numberOfPeople}
            </if>
            <if
                test="(record.shopName!=null and record.shopName!='') or  (record.shopName!='' and record.shopName==0)  ">
                    test="(record.shopName!=null and record.shopName!='') or  (record.shopName!='' and record.shopName==0)  ">
                and shop_name = #{record.shopName}
            </if>
            <if
                test="(record.projTime!=null and record.projTime!='') or  (record.projTime!='' and record.projTime==0)  ">
                    test="(record.projTime!=null and record.projTime!='') or  (record.projTime!='' and record.projTime==0)  ">
                and proj_time = #{record.projTime}
            </if>
            <if
                test="(record.remark!=null and record.remark!='') or  (record.remark!='' and record.remark==0)  ">
                    test="(record.remark!=null and record.remark!='') or  (record.remark!='' and record.remark==0)  ">
                and remark = #{record.remark}
            </if>
            <if
                test="(record.orderType!=null and record.orderType!='') or  (record.orderType!='' and record.orderType==0)  ">
                    test="(record.orderType!=null and record.orderType!='') or  (record.orderType!='' and record.orderType==0)  ">
                and order_type = #{record.orderType}
            </if>
            <if
                test="(record.projPercentage!=null and record.projPercentage!='') or  (record.projPercentage!='' and record.projPercentage==0)  ">
                    test="(record.projPercentage!=null and record.projPercentage!='') or  (record.projPercentage!='' and record.projPercentage==0)  ">
                and proj_percentage = #{record.projPercentage}
            </if>
            <if
                test="(record.t1!=null and record.t1!='') or  (record.t1!='' and record.t1==0)  ">
                    test="(record.t1!=null and record.t1!='') or  (record.t1!='' and record.t1==0)  ">
                and t1 = #{record.t1}
            </if>
            <if
                test="(record.t2!=null and record.t2!='') or  (record.t2!='' and record.t2==0)  ">
                    test="(record.t2!=null and record.t2!='') or  (record.t2!='' and record.t2==0)  ">
                and t2 = #{record.t2}
            </if>
            <if
                test="(record.achieveType!=null and record.achieveType!='') or  (record.achieveType!='' and record.achieveType==0)  ">
                    test="(record.achieveType!=null and record.achieveType!='') or  (record.achieveType!='' and record.achieveType==0)  ">
                and achieveType = #{record.achieveType}
            </if>
            <if
                test="(record.t4!=null and record.t4!='') or  (record.t4!='' and record.t4==0)  ">
                    test="(record.t4!=null and record.t4!='') or  (record.t4!='' and record.t4==0)  ">
                and t4 = #{record.t4}
            </if>
            <if
                test="(record.t5!=null and record.t5!='') or  (record.t5!='' and record.t5==0)  ">
                    test="(record.t5!=null and record.t5!='') or  (record.t5!='' and record.t5==0)  ">
                and t5 = #{record.t5}
            </if>
            <if
                test="(record.t6!=null and record.t6!='') or  (record.t6!='' and record.t6==0)  ">
                    test="(record.t6!=null and record.t6!='') or  (record.t6!='' and record.t6==0)  ">
                and t6 = #{record.t6}
            </if>
            <if
                test="(record.t8!=null and record.t8!='') or  (record.t8!='' and record.t8==0)  ">
                    test="(record.t8!=null and record.t8!='') or  (record.t8!='' and record.t8==0)  ">
                and t8 = #{record.t8}
            </if>
            <if
                test="(record.t9!=null and record.t9!='') or  (record.t9!='' and record.t9==0)  ">
                    test="(record.t9!=null and record.t9!='') or  (record.t9!='' and record.t9==0)  ">
                and t9 = #{record.t9}
            </if>
        </if>
@@ -537,7 +537,7 @@
    <!-- 插入方法 -->
    <insert id="insert" parameterType="com.matrix.system.hive.bean.AchieveNew"
        useGeneratedKeys="true" keyProperty="item.id">
            useGeneratedKeys="true" keyProperty="item.id">
        INSERT INTO achieve_new (
        <include refid="columns"></include>
        )
@@ -555,7 +555,7 @@
        )
        VALUES
        <foreach collection="list" item="item" index="index"
            separator=",">
                 separator=",">
            (
            <include refid="propertys"></include>
            )
@@ -668,15 +668,15 @@
        UPDATE achieve_new set datatime = #{record.datatime}
        <where>
            <if
                test="(record.id!=null and record.id!='') or  (record.id!='' and record.id==0)  ">
                    test="(record.id!=null and record.id!='') or  (record.id!='' and record.id==0)  ">
                and id = #{record.id}
            </if>
            <if
                test="(record.orderId!=null and record.orderId!='') or  (record.orderId!='' and record.orderId==0)  ">
                    test="(record.orderId!=null and record.orderId!='') or  (record.orderId!='' and record.orderId==0)  ">
                and order_id = #{record.orderId}
            </if>
            <if
                test="(record.serviceOrderId!=null and record.serviceOrderId!='') or  (record.serviceOrderId!='' and record.serviceOrderId==0)  ">
                    test="(record.serviceOrderId!=null and record.serviceOrderId!='') or  (record.serviceOrderId!='' and record.serviceOrderId==0)  ">
                and service_order_id = #{record.serviceOrderId}
            </if>
        </where>
@@ -714,7 +714,7 @@
                vip_id = #{record.vipId},
            </if>
            <if
                test="record.freeConsume != null and record.freeConsume != '' ">
                    test="record.freeConsume != null and record.freeConsume != '' ">
                free_consume = #{record.freeConsume},
            </if>
            <if test="record.hisConsume != null ">
@@ -782,7 +782,7 @@
    <delete id="deleteByIds" parameterType="java.util.List">
        delete from achieve_new where id in
        <foreach collection="list" index="index" item="item" open="("
            separator="," close=")">
                 separator="," close=")">
            #{item}
        </foreach>
    </delete>
@@ -828,7 +828,7 @@
    <!-- 查询总条数 -->
    <select id="selectTotalRecord"
        resultType="java.lang.Integer">
            resultType="java.lang.Integer">
        select count(*)
        from achieve_new
        where 1=1
@@ -865,48 +865,44 @@
    </select>
    <select id="selectVipConsumeStatisticsList" resultMap="AchieveNewMap">
    <select id="selectVipConsumeStatisticsList" resultType="java.util.HashMap">
        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
        a.VIP_NAME vipName,
        a.PHONE t9,
        b.su_name meiliao,
        (SELECT  sum(IFNULL(goods_cash,0)) from achieve_new where  pay_method='现金' and  VIP_ID=a.id
        <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if>
        <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]>     </if> )  as 'goodsCash'  ,
        (SELECT  sum(IFNULL(goods_cash,0)) from achieve_new where  pay_method='划扣' and  VIP_ID=a.id
        <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if>
        <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]>     </if>)  as 'cardCash'  ,
        (SELECT  sum(IFNULL(free_consume,0)) from achieve_new where   VIP_ID=a.id
        <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if>
        <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]>     </if>  )  as 'freeConsume'  ,
        (SELECT  sum(IFNULL(number_of_people,0)) from achieve_new where   VIP_ID=a.id
        <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if>
        <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]>     </if>  )  as 'arriveCnt'  ,
        (SELECT  sum(IFNULL(his_consume,0)) from achieve_new where   VIP_ID=a.id
        <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if>
        <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]>     </if> )  as 'hisConsume'
        from sys_vip_info a
        inner join (
            select vip_id,datatime, sum(a.free_consume) freeConsume, sum(a.his_consume) hisConsume, sum(IFNULL(goods_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 b on a.BEATUY_ID=b.su_id
        inner join sys_shop_info c on c.id=a.SHOP_ID
        <where>
        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="record.vipName != null and record.vipName !=''">
                and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName})
            </if>
            <if test="record.shopId != null">
                and a.shop_id=#{record.shopId}
            </if>
            <if test="record.beaultId != null and record.beaultId!=''">
                and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID)
            </if>
            <if test='record.t1 == "on"'>
                and a.BEATUY_ID is not null
            </if>
        </where>
        <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
            <if test="pageVo.sort !=null  and pageVo.order !=null">
                order by
@@ -922,37 +918,23 @@
    <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)  ) 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 b on a.BEATUY_ID=b.su_id
        inner join sys_shop_info c on c.id=a.SHOP_ID
        <where>
        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>
            <if test="record.vipName != null and record.vipName !=''">
                and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName})
            </if>
            <if test="record.shopId != null">
                and a.shop_id=#{record.shopId}
            </if>
            <if test="record.beaultId != null and record.beaultId!=''">
                and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID)
            </if>
            <if test='record.t1 == "on"'>
                and a.BEATUY_ID is not null
            </if>
        </where>
    </select>
@@ -960,14 +942,14 @@
        select
            sale_id id,
            (select ifnull(sum(case pay_method when '现金' then goods_cash else 0 end),0)
                from achieve_new a
            where a.beault_id=#{userId}
            and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
             from achieve_new a
             where a.beault_id=#{userId}
               and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
            ) orderCash,
            (select ifnull(sum(case pay_method when '划扣' then goods_cash else 0 end),0)
                from achieve_new a
            where  a.beault_id=#{userId}
            and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
             from achieve_new a
             where  a.beault_id=#{userId}
               and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
            ) cash,
            sum(case order_type when '订单' then proj_percentage else 0 end) cardUse,
            sum(IFNULL(his_consume, 0)) hisConsume,
@@ -975,7 +957,7 @@
            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'))
          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">
@@ -983,15 +965,15 @@
            b.su_name name,
            IFNULL(a.goods_cash, 0) achieve
        from achieve_new a
        inner join sys_users b on (a.beault_id=b.su_id or a.sale_id = b.su_id)
                 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
        b.shop_short_name name,
        b.SHOP_IMAG photo,
        sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume,0)) amount
        from achieve_new a
        left join sys_shop_info b on a.shop_id=b.ID and b.shop_type!=1
        <where>
@@ -1014,11 +996,11 @@
    <select id="selectBeauticianConsumeAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo">
        select
            b.su_name name,
            b.su_id id,
            b.su_photo photo,
            sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) ) amount,
            c.shop_short_name shopName
        b.su_name name,
        b.su_id id,
        b.su_photo photo,
        sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) ) amount,
        c.shop_short_name shopName
        from achieve_new a
        inner join sys_users b on a.beault_id=b.su_id
        left join sys_shop_info c on a.shop_id=c.ID
@@ -1052,9 +1034,9 @@
            c.su_name meiliao,
            TRUNCATE(d.count*d.zk_price,2) zk_total
        from achieve_new a
        left join shopping_goods b on a.shopping_goods_id=b.id
        left join sys_users c on a.beault_id=c.su_id
        left join sys_order_item d on a.order_item_id=d.id
                 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>
@@ -1091,9 +1073,9 @@
    <select id="selectShopSaleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo">
        select
            b.shop_short_name name,
            b.SHOP_IMAG photo,
            sum(IFNULL(a.amount,0)) amount
        b.shop_short_name name,
        b.SHOP_IMAG photo,
        sum(IFNULL(a.amount,0)) amount
        from sys_order_flow a
        inner join sys_order c on a.order_id=c.id and c.STATU != '已取消'
        inner join sys_shop_info b on a.shop_id=b.id and shop_type!=1
@@ -1132,35 +1114,35 @@
    <select id="achieveNewStatistics" resultType="com.matrix.system.hive.vo.AchieveNewStatisticsVo">
        select
            u.name ruleName,
            f.su_name guwen,
            f.su_id gwid,
            g.su_name createBy,
            g.su_id createId,
            cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total,
            cast(SUM(a.his_consume) AS decimal(15,2)) his_consume,
            cast(SUM(a.free_consume) AS decimal(15,2)) free_consume,
            cast(SUM(a.proj_percentage) AS decimal(15,2)) proj_percentage,
            cast(SUM(a.number_of_people) AS decimal(15,2)) number_of_people,
            cast(SUM(a.proj_num) AS decimal(15,2)) proj_num,
            cast(SUM(case when a.pay_method = '划扣' then goods_cash end )AS decimal(15,2)) card_cash,
            cast(SUM(a.proj_time) AS decimal(15,2)) proj_time,
            cast(SUM(case when a.pay_method = '现金' then goods_cash end )AS decimal(15,2)) goods_cash,
            h.shop_short_name shop_name,
            a.order_type
        u.name ruleName,
        f.su_name guwen,
        f.su_id gwid,
        g.su_name createBy,
        g.su_id createId,
        cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total,
        cast(SUM(a.his_consume) AS decimal(15,2)) his_consume,
        cast(SUM(a.free_consume) AS decimal(15,2)) free_consume,
        cast(SUM(a.proj_percentage) AS decimal(15,2)) proj_percentage,
        cast(SUM(a.number_of_people) AS decimal(15,2)) number_of_people,
        cast(SUM(a.proj_num) AS decimal(15,2)) proj_num,
        cast(SUM(case when a.pay_method = '划扣' then goods_cash end )AS decimal(15,2)) card_cash,
        cast(SUM(a.proj_time) AS decimal(15,2)) proj_time,
        cast(SUM(case when a.pay_method = '现金' then goods_cash end )AS decimal(15,2)) goods_cash,
        h.shop_short_name shop_name,
        a.order_type
        from
            achieve_new a
                left join sys_order b on a.order_id=b.id
                left join sys_vip_info c on a.vip_id=c.id
                left join sys_vip_level d on c.LEVEL_ID=d.id
                left join shopping_goods e on a.shopping_goods_id=e.id
                LEFT JOIN sys_users f on a.beault_id=f.su_id
                LEFT JOIN sys_users g on a.sale_id = g.su_id
                LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID
                LEFT JOIN shopping_goods_category i ON e.cate_id = i.id
                left join sys_proj_services l on a.service_order_id=l.id
                left join sys_order_item j on a.order_item_id=j.ID
                left join achieve_rule u on u.id=e.achieve_rule_id
        achieve_new a
        left join sys_order b on a.order_id=b.id
        left join sys_vip_info c on a.vip_id=c.id
        left join sys_vip_level d on c.LEVEL_ID=d.id
        left join shopping_goods e on a.shopping_goods_id=e.id
        LEFT JOIN sys_users f on a.beault_id=f.su_id
        LEFT JOIN sys_users g on a.sale_id = g.su_id
        LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID
        LEFT JOIN shopping_goods_category i ON e.cate_id = i.id
        left join sys_proj_services l on a.service_order_id=l.id
        left join sys_order_item j on a.order_item_id=j.ID
        left join achieve_rule u on u.id=e.achieve_rule_id
        <where>
            and a.company_id = #{record.companyId}
            <if test="record.shopId != null">
@@ -1171,7 +1153,7 @@
            </if>
            <if test="record.staffName != null and record.staffName!=''">
            <!-- 创建人和归属人都有业绩 -->
                <!-- 创建人和归属人都有业绩 -->
                and (f.su_name like concat('%',#{record.staffName},'%')  or g.su_name like concat('%',#{record.staffName},'%')  )
            </if>
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml
@@ -621,8 +621,10 @@
        group by b.id) t
    </select>
    <!-- 美度不显示赠送金额 IFNULL(sum(IFNULL(gift_money, 0)),0)+-->
    <select id="selectVipCardTotalMoney" resultType="java.lang.Double">
            SELECT  IFNULL(sum(IFNULL(gift_money, 0)),0)+ IFNULL(sum(IFNULL(real_money, 0)),0)  from money_card_use where vip_id=#{vipId}  and `status` ='有效'
            SELECT  IFNULL(sum(IFNULL(real_money, 0)),0)  from money_card_use where vip_id=#{vipId}  and `status` ='有效'
    </select>
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml
@@ -924,7 +924,7 @@
            left join shopping_goods f on e.proj_id=f.id
        where 1=1 and a.type='套餐' and a.TAOCAN_ID IS NULL
        <if test="record.queryKey != null and record.queryKey !='' ">
            and (instr(b.name, #{record.queryKey}) or instr(b.zjm, #{record.queryKey}) or instr(goods_no, #{record.queryKey}))
            and (instr(b.name, #{record.queryKey}) or instr(b.zjm, #{record.queryKey}) or instr(b.goods_no, #{record.queryKey}))
        </if>
        <if test="record.isOver != null and record.isOver !='' ">
            and a.IS_OVER = #{record.isOver}
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml
@@ -145,6 +145,9 @@
             <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>
    </sql>
@@ -268,6 +271,9 @@
            <if test="record.shopId != null ">
                shop_id  = #{record.shopId},
            </if>
            <if test="record.companyId != null ">
                company_id  = #{record.companyId},
            </if>
        </set>
        WHERE id=#{record.id}
    </update>
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/projService-list.html
@@ -138,7 +138,7 @@
        layer.confirm('确定取消此订单?', {
            btn: ['确认', '取消'] //可以无限个按钮
        }, function(index, layero){
            $.post(basePath+'/admin/projService/cancelOrder?id='+id, {}, function(data){
            $.post(basePath+'/admin/projService/erpCancelOrder?id='+id, {}, function(data){
                parent.layer.msg(data.info,{icon: 1});
                layer.closeAll();
                myGrid.serchData();
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/sysOrder-list.html
@@ -150,7 +150,7 @@
        layer.confirm('确定取消此订单?', {
                btn: ['确认', '取消'] //可以无限个按钮
            }, function(index, layero){
                $.post(basePath+'/admin/order/cancelOrder?id='+id+'&del=0', {}, function(data){
                $.post(basePath+'/admin/order/erpCancelOrder?id='+id+'&del=0', {}, function(data){
                    if (data.status == '200') {
                        parent.layer.msg(data.info,{icon: 1});
                    } else {
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html
@@ -28,9 +28,9 @@
            </div>
            <div class="form-group mr-20">
                <label>日期范围</label>
                <input autocomplete="off"   name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">-
                <input autocomplete="off"   name="endTime"  type="text" class="form-control datetimepicker" id="endTime">
                <label>日期</label>
                <input autocomplete="off"   name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">
<!--                <input autocomplete="off"   name="endTime"  type="text" class="form-control datetimepicker" id="endTime">-->
            </div>
            <div class="form-group mr-20">
                <label >所属门店</label> <select id="select_id"
@@ -49,15 +49,27 @@
                <tr>
                    <th data-formatter="MGrid.indexfn" data-align="center"
                        data-width="30px" data-footer-formatter="footCountTitle">序号</th>
                    <th data-field="time">日期</th>
                    <th data-field="shopName" >门店</th>
                    <th data-field="cashPay" data-footer-formatter="countColumn">收现金额</th>
                    <th data-field="cardPay" data-footer-formatter="countColumn">实收余额支付</th>
                    <th data-field="consumePay" data-footer-formatter="countColumn">消耗金额</th>
                    <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th>
                    <th data-field="dataTime">日期</th>
                    <th data-field="cashPay" data-footer-formatter="countColumn">现金收款</th>
                    <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th>
                    <th data-field="" data-footer-formatter="countColumn">还款</th>
                    <th data-field="productAchieve" data-footer-formatter="countColumn">产品业绩</th>
                    <th data-field="cardAchieve" data-footer-formatter="countColumn">卡项业绩</th>
                    <th data-field="refundCashPay" data-footer-formatter="countColumn">现金退款</th>
                    <th data-field="refundCardPay" data-footer-formatter="countColumn">卡项退款</th>
                    <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th>
                    <th data-field="cardAmount" data-footer-formatter="countColumn">储值卡本金扣款</th>
                    <th data-field="cardFreeAmount" data-footer-formatter="countColumn">储值卡赠送扣款</th>
                    <th data-field="consumePay" data-footer-formatter="countColumn">本金消耗</th>
                    <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th>
                    <th data-field="peopleCnt" data-footer-formatter="countColumn">人头数</th>
                    <th data-field="projConsumeCnt" data-footer-formatter="countColumn">项目消耗数</th>
                    <th data-field="timeLength" data-footer-formatter="countColumn">服务时长</th>
                    <th data-field="perCustomCnt" data-footer-formatter="countColumn">客单数</th>
                    <th data-field="customGoodsCnt" data-footer-formatter="countColumn">客品数</th>
                    <th data-field="perCustomPrice" data-footer-formatter="countColumn">客单价</th>
                    <th data-field="cost" data-footer-formatter="countColumn">成本</th>
                    <th data-field="grossProfit" data-footer-formatter="countColumn">毛利</th>
                    <th data-field="grossProfitRate" data-footer-formatter="countColumn">毛利率</th>
                </tr>
            </thead>
        </table>
@@ -78,7 +90,7 @@
        $(function() {
            MTools.autoFullSelect();
            myGrid = MGrid.initGrid({
                url : basePath+"/admin/sysBusinessData/showList",
                url : basePath+"/admin/sysBusinessData/findShopBusinessesData",
                showExport : true,
                showFooter : true,
                height:'',
@@ -100,10 +112,8 @@
            return "<b>合计</b>";
        };
        function countColumn(data) {
            console.log(data)
             field = this.field;
                var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { 
                    console.log(sum,row[field]);
                    return sum + (+row[field]);
                }, 0)).toFixed(2));//保留有效数字
                return "<b>"+resultsumQuantity+"</b>";
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
@@ -175,6 +175,15 @@
                </el-col>
            </el-row>
            <el-row class="vertical  ">
                 <el-select v-model="goodsType" placeholder="商品类型" style="width: 120px" >
                    <el-option
                            v-for="item in goodsTypeList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                    >
                    </el-option>
                </el-select>
                <el-input class="searchInput" @input="searchGoods()" v-model="queryKey"
                          placeholder="搜索添加产品"></el-input>
                <el-button @click="searchGoods()" type="primary">搜索</el-button>
@@ -582,7 +591,8 @@
    var app = new Vue({
        el: '#app',
        data: {
            goodsType:"",
            goodsTypeList:[{value:"",label:"全部"},{value:"套餐",label:"套餐"},{value:"项目",label:"项目"},{value:"充值卡",label:"充值卡"}],
            //业绩设置框
            drawer: false,
            direction: 'rtl',
@@ -1219,7 +1229,7 @@
                        app: _this,
                        contentType: 'application/x-www-form-urlencoded',
                        //TODO 优化下拉加载
                        data: {name: _this.queryKey, limit: pageSize, offset : offset},
                        data: {name: _this.queryKey,goodType:_this.goodsType , limit: pageSize, offset : offset},
                        url: basePath + "/admin/shoppinggoods/showList",
                        callback: function (data) {
                            _this.searchTableData = data.rows;
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html
@@ -71,7 +71,13 @@
                <input autocomplete="off"   name="closureTime" type="text"
                       class="form-control datetimepicker" id="endTime">
            </div>
            <div class="form-group mr-20">
                <label >所属门店</label>
                <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId"
                        th:data-url="@{/admin/shopInfo/findAll}">
                    <option value=''>--请选择部所属门店--</option>
                </select>
            </div>
            <input type="hidden" value="待预约" name="state" id="state"/>
            <div class="form-group mr-20">
                <button type="button" class="btn btn-my btn-sm" id="btn4" value="">全部</button>
@@ -115,6 +121,7 @@
            <th data-field="totalTime" data-sortable="true">服务时长</th>
            <th data-field="isOverTime" data-formatter="overTime">超时时间</th>
            <th data-field="createStaffName">下单顾问</th>
            <th data-field="shopName">门店</th>
            <th data-sortable="true" data-field="id" data-formatter="buidOperate">操作</th>
        </tr>
        </thead>
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html
@@ -40,6 +40,14 @@
                <input autocomplete="off"   name="endTimeVo"  type="text" class="form-control datetimepicker" id="endTime">
            </div>
            <div class="form-group mr-20">
                <label >所属门店</label>
                <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId"
                        th:data-url="@{/admin/shopInfo/findAll}">
                    <option value=''>--请选择部所属门店--</option>
                </select>
            </div>
            <input autocomplete="off"   type="hidden" name="statu" value="待付款" id="statu"/>
            <div class="form-group mr-20">
                <button type="button" class="btn btn-my btn-sm" id="btn0" value="" >全部</button>
@@ -89,6 +97,7 @@
                <th data-field="statu">订单状态</th>
                <th data-field="remark">备注</th>
                <th data-field="shopName">门店</th>
            </tr>
            </thead>
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html
@@ -122,7 +122,7 @@
                                    </tr>
                                    <tr v-for="(item,index) in projService.serviceItems">
                                        <td>{{item.projInfo.name}}</td>
                                        <td>{{item.projInfo.name}}【{{item.projUse.source}}】</td>
                                        <td>{{item.count}}</td>
                                        <td>{{item.projUse.price * item.count}}</td>
                                        <td><el-input @change="changeTimeLength" v-model="item.projInfo.timeLength"></el-input></td>
zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html
@@ -65,7 +65,7 @@
            </tr>
            <template v-for="item in projService.serviceItems">
                <tr  >
                    <td style="text-align: left;" colspan="4" >{{item.projInfo.name }}</td>
                    <td style="text-align: left;" colspan="4" >{{item.projInfo.name }}【{{item.projUse.source}}】</td>
                </tr>
                <tr  >
                    <td>{{item.count }}</td>
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html
@@ -28,9 +28,9 @@
            </div>
            <div class="form-group mr-20">
                <label>日期范围</label>
                <input autocomplete="off"   name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">-
                <input autocomplete="off"   name="endTime"  type="text" class="form-control datetimepicker" id="endTime">
                <label>日期</label>
                <input autocomplete="off"   name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">
<!--                <input autocomplete="off"   name="endTime"  type="text" class="form-control datetimepicker" id="endTime">-->
            </div>
        </form>
@@ -41,14 +41,27 @@
                <tr>
                    <th data-formatter="MGrid.indexfn" data-align="center"
                        data-width="30px" data-footer-formatter="footCountTitle">序号</th>
                    <th data-field="time">日期</th>
                    <th data-field="cashPay" data-footer-formatter="countColumn">收现金额</th>
                    <th data-field="cardPay" data-footer-formatter="countColumn">实收余额支付</th>
                    <th data-field="consumePay" data-footer-formatter="countColumn">消耗金额</th>
                    <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th>
                    <th data-field="dataTime">日期</th>
                    <th data-field="cashPay" data-footer-formatter="countColumn">现金收款</th>
                    <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th>
                    <th data-field="" data-footer-formatter="countColumn">还款</th>
                    <th data-field="productAchieve" data-footer-formatter="countColumn">产品业绩</th>
                    <th data-field="cardAchieve" data-footer-formatter="countColumn">卡项业绩</th>
                    <th data-field="refundCashPay" data-footer-formatter="countColumn">现金退款</th>
                    <th data-field="refundCardPay" data-footer-formatter="countColumn">卡项退款</th>
                    <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th>
                    <th data-field="cardAmount" data-footer-formatter="countColumn">储值卡本金扣款</th>
                    <th data-field="cardFreeAmount" data-footer-formatter="countColumn">储值卡赠送扣款</th>
                    <th data-field="consumePay" data-footer-formatter="countColumn">本金消耗</th>
                    <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th>
                    <th data-field="peopleCnt" data-footer-formatter="countColumn">人头数</th>
                    <th data-field="projConsumeCnt" data-footer-formatter="countColumn">项目消耗数</th>
                    <th data-field="timeLength" data-footer-formatter="countColumn">服务时长</th>
                    <th data-field="perCustomCnt" data-footer-formatter="countColumn">客单数</th>
                    <th data-field="customGoodsCnt" data-footer-formatter="countColumn">客品数</th>
                    <th data-field="perCustomPrice" data-footer-formatter="countColumn">客单价</th>
                    <th data-field="cost" data-footer-formatter="countColumn">成本</th>
                    <th data-field="grossProfit" data-footer-formatter="countColumn">毛利</th>
                    <th data-field="grossProfitRate" data-footer-formatter="countColumn">毛利率</th>
                </tr>
            </thead>
        </table>
@@ -69,7 +82,7 @@
        $(function() {
            MTools.autoFullSelect();
            myGrid = MGrid.initGrid({
                url : basePath+"/admin/sysBusinessData/showList",
                url : basePath+"/admin/sysBusinessData/findShopBusinessesData",
                showExport : true,
                showFooter : true,
                height:'',
@@ -91,10 +104,8 @@
            return "<b>合计</b>";
        };
        function countColumn(data) {
            console.log(data)
             field = this.field;
                var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { 
                    console.log(sum,row[field]);
                    return sum + (+row[field]);
                }, 0)).toFixed(2));//保留有效数字
                return "<b>"+resultsumQuantity+"</b>";
zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html
@@ -145,7 +145,7 @@
        MTools.ininDatetimepicker(".datetimepicker");
        var delUrl="";
        myGrid=MGrid.initGrid({
            url:basePath+"/admin/sysVipInfo/showList",
            url:basePath+"/admin/vipInfo/showVipInfoList",
            delUrl:delUrl,
        });
zq-erp/src/main/resources/templates/views/admin/sys/sysRole-form.html
@@ -62,9 +62,9 @@
        <div class="form-group">
            <label class="col-sm-2 control-label">可查询所有门店客户</label>
            <div class="col-sm-4">
                <select class="form-control" name="coustomer">
                    <option th:selected="${obj?.coustomer == '是'}" >是</option>
                    <option th:selected="${obj?.coustomer == '否'}" >否</option>
                <select class="form-control" name="customer">
                    <option th:selected="${obj?.customer == '是'}" >是</option>
                    <option th:selected="${obj?.customer == '否'}" >否</option>
                </select>
            </div>
            <label class="col-sm-2 control-label">是否允许门店分配本角色</label>
zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java
@@ -98,6 +98,14 @@
        newSettings.add(newSetting7);
        ParameterSettings newSetting8=new ParameterSettings();
        newSetting8.setCode(AppConstance.SHOP_MANAGE_ABLE_CANCEL_DFK_ORDER);
        newSetting8.setName("门店是否只能取消待付款订单,服务单");
        newSetting8.setType(1);
        newSetting8.setCategory("店务配置");
        newSettings.add(newSetting8);
        for (ParameterSettings newSetting : newSettings) {
            List<ParameterSettings> parameterSettings = parameterSettingsDao.selectByModel(newSetting);
            if(CollectionUtil.isEmpty(parameterSettings)){
zq-xcx/app.js
@@ -3,7 +3,7 @@
var api = require('utils/service-api.js');
App({
      baseUrl: "https://xcxhive2.jyymatrix.cc",
      baseUrl: "https://filehive2.jyymatrix.cc/xcxapi",
  //  baseUrl : "http://localhost:8080",
  //登录后获得的token
zq-xcx/utils/util.js
@@ -2,7 +2,7 @@
 * 通用js
 */
var debugHost='www.baidu.com';
var debugHost='taiyan';
// api地址,请求参数,回调函数,是否遮罩
function request(params) {
@@ -36,8 +36,8 @@
          method: "POST",
          header: {
            'content-type': 'application/json',
            'debugHost':debugHost
          //  'host':'www.jyymatrix.cc'
            //'debugHost':debugHost,
            'companyCode':'debugHost'
          },
          data: {},
          success: function(res) {
@@ -90,7 +90,7 @@
    method: option.method,
    header: {
      'content-type': 'application/json',
      'debugHost':debugHost,
      'companyCode':debugHost,
      'token': getApp().loginToken
    },
    data: data,
@@ -172,7 +172,7 @@
                header: {
                  "Content-Type": "multipart/form-data",
                  'token': res.data,
                  'debugHost':debugHost
                  'companyCode':debugHost
                },
                formData: formData,
                success: function(e) {
@@ -303,7 +303,7 @@
        method: "POST",
        header: {
          'content-type': 'application/json',
          'debugHost':debugHost
          'companyCode':debugHost
        },
        data: {},
        success: function(res) {