935090232@qq.com
2021-03-18 5d43370b99a03391c9271d04d3f351f0fd734dae
Merge remote-tracking branch 'origin/score_shop' into score_shop
8 files added
1 files deleted
59 files modified
3890 ■■■■■ changed files
zq-erp/.gitignore 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/ZqErpApplication.java 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java 10 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java 16 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java 11 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/actions/ProjExceptionAction.java 21 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java 4 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java 37 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java 69 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/constant/FenxiaoSettingConstant.java 14 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopRevenueFlowDao.java 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java 25 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java 123 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopOrderDetailVo.java 3 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java 84 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java 21 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopShoppingCartAction.java 141 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java 7 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java 86 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java 67 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java 60 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java 262 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java 18 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java 4 ●●●● 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/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java 22 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java 404 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java 27 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java 19 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java 43 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java 143 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanApplyCondition.java 35 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/db/increment/推广员.sql 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/system.properties 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/test/system.properties 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopRevenueFlowDao.xml 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml 36 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml 1 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml 85 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml 20 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml 27 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html 86 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-setting.html 92 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html 183 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html 58 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html 39 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html 462 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html 13 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new-bak.html 229 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html 462 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html 103 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html 36 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/common/showprojException.html 51 ●●●●● patch | view | raw | blame | history
zq-erp/.gitignore
@@ -76,4 +76,5 @@
.project
.classpath
.settings
.metadata
.metadata
.gitignore
zq-erp/src/main/java/com/matrix/ZqErpApplication.java
@@ -3,6 +3,7 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
/**
 * spring boot入口
@@ -10,9 +11,7 @@
 * @author jiangyouyao
 */
@SpringBootApplication
@ComponentScan(basePackages = {"com.matrix.**"})
public class ZqErpApplication {
    public static void main(String[] args) {
zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java
@@ -27,7 +27,7 @@
    /**
     * 主键
     */
    private String  userId;
    private Long  userId;
    /**
@@ -236,15 +236,13 @@
        this.companyId = companyId;
    }
    public void setToken(String token) {
        this.token=userId;
    }
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
    public void setUserId(Long userId) {
        this.userId=userId;
    }
zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java
@@ -22,9 +22,9 @@
    
    public int updateByModel(@Param("record") BizUser bizUser);
    
    public int deleteByIds(@Param("list") List<String> list);
    public int deleteByIds(@Param("list") List<Long> list);
    
    public int deleteById(String userId);
    public int deleteById(Long userId);
    public int deleteByModel(@Param("record") BizUser bizUser);
    
@@ -34,18 +34,12 @@
    
    public int selectTotalRecord(@Param("record") BizUser bizUser);
    
    public BizUser  selectById(String userId);
    public BizUser  selectById(Long userId);
    
    public BizUser  selectForUpdate(String userId);
    public BizUser  selectForUpdate(Long userId);
    public BizUser findByOpenId(@Param("openId") String openId);
    /**
     * 批量设置销售员
     * @param list
     * @param status
     * @return
     */
    int  updateSalesByIds(@Param("list") List<String> list, @Param("status") Integer status);
}
zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java
@@ -2,7 +2,6 @@
import com.matrix.biz.bean.BizUser;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.web.BaseServices;
import java.util.List;
@@ -11,7 +10,7 @@
 * @author jyy
 * @date 2019-05-31 10:03
 */
public interface BizUserService extends BaseServices<BizUser> {
public interface BizUserService  {
    
    /**
     * 新增
@@ -33,15 +32,12 @@
     */
    public int modifyByModel(BizUser bizUser);
    
    /**
     * 批量删除
     */
    public int remove(List<String> list);
    /**
     * 根据id删除
     */
    public int removeById(String userId);
    public int removeById(Long userId);
    
    /**
     * 根据对象删除
@@ -62,11 +58,8 @@
     * 统计记录数
     */
    public int  findTotal(BizUser bizUser);
    /**
     * 根据id查询
     */
    public BizUser  findById(String userId);
    public int remove(List<Long> list);
       
    /**
@@ -74,7 +67,8 @@
     */
    public BizUser findByOpenId(String openId);
    public BizUser  findById(Long userId);
    /**
     * 保存用户信息
     */
zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java
@@ -36,7 +36,6 @@
        bizUser.setUserIsAuthorize(AppConstance.IS_NOT_AUTHORIZE);
        bizUser.setCreateBy(AppConstance.USER_TYPE_ADMIN);
        bizUser.setUpdateBy(AppConstance.USER_TYPE_ADMIN);
        bizUser.setUserId(UUIDUtil.getRandomID());
        return bizUserDao.insert(bizUser);
        
    }
@@ -90,14 +89,14 @@
    
    
    @Override
    public int remove(List<String> list){
    public int remove(List<Long> list){
        return bizUserDao.deleteByIds(list);
    }
    @Override
    public int removeById(String userId){
    public int removeById(Long userId){
    
        return bizUserDao.deleteById(userId);
    
@@ -133,7 +132,7 @@
    }
    
    @Override
    public BizUser  findById(String userId){
    public BizUser  findById(Long userId){
    
        return bizUserDao.selectById(userId);
    
zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java
@@ -51,6 +51,10 @@
    SalesOrderTask SalesOrderTask() {
        return new SalesOrderTask();
    }
    @Bean
    SalesOrderRefundTask SalesOrderRefundTask() {
        return new SalesOrderRefundTask();
    }
    @Bean
    TemplateMsgTask TemplateMsgTask(){
@@ -87,6 +91,7 @@
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_TEMPLATE_MSG + evn,MQTaskRouting.SEND_TEMPLATE_MSG + evn, TemplateMsgTask()));
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.ORDER_OUT_SOTORE + evn,MQTaskRouting.ORDER_OUT_SOTORE + evn, OrderOutSotoreTask()));
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn,MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn, UniformMsgSentTask()));
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SHOP_ORDER_REFUND + evn,MQTaskRouting.SHOP_ORDER_REFUND + evn, SalesOrderRefundTask()));
        //不同任务在不同的队列,但是routingKey一样则可以收到生产者消息
        taskList.add(new MqTask(MQ_EXCHANGE_TOPIC + evn, MQTaskRouting.CREATE_ORDER + evn,MQTaskRouting.CREATE_ORDER + evn,SalesOrderTask()));
zq-erp/src/main/java/com/matrix/system/common/actions/ProjExceptionAction.java
@@ -1,22 +1,16 @@
package com.matrix.system.common.actions;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.ProjException;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.ProjExceptionDao;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays;
import java.util.List;
/**
 * @author 姜友瑶
@@ -31,12 +25,19 @@
    ProjExceptionDao projExceptionDao;
    @RequestMapping(value = "/showException")
    public @ResponseBody
    AjaxResult showException(Long id) {
    public
    ModelAndView showException(Long id) {
        ProjException projException = projExceptionDao.selectById(id);
        return AjaxResult.buildSuccessInstance(Arrays.asList(projException));
        ModelAndView mv = new ModelAndView("common/showprojException");
        mv.addObject("obj", projException);
        return mv;
    }
    @RequestMapping(value = "/projException/del")
    public @ResponseBody
    AjaxResult del(@RequestBody ProjException projException) {
zq-erp/src/main/java/com/matrix/system/common/service/impl/InitBusParameterSettingService.java
@@ -48,13 +48,13 @@
    public void initBusParameterFenxiaoSetting(SysCompany sysCompany) {
        long companyId = sysCompany.getComId();
        List<BusParameterSettings> ruleSettings=new ArrayList<>();
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_SWITCH, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_MODEL, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_WAY, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_AUDIT_METHOD, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_PLAN, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_POSTER, companyId));
        busParameterSettingsDao.batchInsert(ruleSettings);
    }
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java
@@ -1,7 +1,6 @@
package com.matrix.system.fenxiao.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.fenxiao.dto.ChangeSaleManGradeDto;
import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto;
import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto;
import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto;
@@ -10,7 +9,6 @@
import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo;
import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo;
import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@@ -63,7 +61,7 @@
    /**
     * 结算记录
     */
    @ApiOperation(value = "分销订单")
    @ApiOperation(value = "结算记录")
    @ApiResponses({
        @ApiResponse(code = 200, message = "OK",  response = LoadSetOrderListDtoVo.class)
    })
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java
@@ -5,15 +5,19 @@
import com.matrix.biz.dao.BizUserDao;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.service.FenXiaoSettingService;
import com.matrix.system.fenxiao.vo.FenXiaoSettingVo;
import com.matrix.system.hive.bean.ShoppingGoods;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.dao.ShoppingGoodsDao;
import com.matrix.system.shopXcx.bean.ShopProduct;
import com.matrix.system.shopXcx.dao.ShopProductDao;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -37,6 +41,9 @@
    
    @Autowired
    private BizUserDao bizUserDao;
    @Autowired
    private ShopProductDao shopProductDao;
    
    /**
     *查询分销配置
@@ -87,16 +94,38 @@
                               idsList.add(parseInt);
                           }
                       }
                       List<ShoppingGoods> list = shoppingGoodsDao.selectByIds(idsList);
                       result.putInMap("order", list);
                       //List<ShoppingGoods> list = shoppingGoodsDao.selectByIds(idsList);
                       List<ShopProduct> shopProducts = shopProductDao.selectByIds(idsList);
                       result.putInMap("order", shopProducts);
                   }
               }
               }else{
                   List<ShopProduct> shopProducts = new ArrayList<>();
                   result.putInMap("order", shopProducts);
               }
           }
       }
       return result;
    }
    
    /**
     * 列表显示
     */
    @RequestMapping(value = "/selectProduct")
    public @ResponseBody
        AjaxResult selectProduct(ShopProduct shopProduct, PaginationVO pageVo) {
        QueryUtil.setQueryLimitCom(shopProduct);
        pageVo.setSort("createTime");
        pageVo.setOrder("desc");
        shopProduct.setDelFlag(AppConstance.DATA_USEABLE);
        shopProduct.setCompanyId(shopProduct.getCompanyId());
        List<ShopProduct> dataList = shopProductDao.selectInPage(shopProduct, pageVo);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList,
                shopProductDao.selectTotalRecord(shopProduct));
        return result;
    }
    /**
     *获取对应的规则设置数据
     * @param ArrayCode
     * @param ArrayName
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java
@@ -55,32 +55,81 @@
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK",  response = ShopSalesmanDetailVo.class)
    })
    @PostMapping(value = "/findShopSalesmanDetail")
    @PostMapping(value = "/loadParamSettingBasic")
    public @ResponseBody
    AjaxResult findShopSalesmanDetail(@RequestBody ShopSalesmanDetailDto shopSalesmanDetailDto) {
    AjaxResult findShopSalesmanDetail(@RequestBody LoadParamSettingBasicDto loadParamSettingBasicDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(shopSalesmanDetailDto);
        QueryUtil.setQueryLimitCom(loadParamSettingBasicDto);
        AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
        //根据OPENID查询基础信息
        String userId = shopSalesmanDetailDto.getUserId();
        String applyId = shopSalesmanDetailDto.getApplyId();
        String userId = loadParamSettingBasicDto.getUserId();
        String applyId = loadParamSettingBasicDto.getApplyId();
        SalesmanBasicDetailVo salesmanBasicDetailVo = shopSalesmanApplyService.selectShopSalesmanDetailByOpenId(userId,Long.parseLong(applyId));
        result.putInMap("basicdetail", salesmanBasicDetailVo);
        return result;
    }
    /**
     * 分销员详情页面绑定客户
     */
    @ApiOperation(value = "分销员详情页面绑定客户")
    @PostMapping(value = "/loadParamSetting")
    public @ResponseBody
    AjaxResult loadParamSetting(@RequestBody LoadParamSettingDto loadParamSettingDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(loadParamSettingDto);
        AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
        //排序
        if(StringUtils.isBlank(shopSalesmanDetailDto.getSort())){
            shopSalesmanDetailDto.setSort("create_time");
            shopSalesmanDetailDto.setOrder("desc");
        if(StringUtils.isBlank(loadParamSettingDto.getSort())){
            loadParamSettingDto.setSort("create_time");
            loadParamSettingDto.setOrder("desc");
        }
        //查询绑定客户信息
        Page<ShopCustomDetailVo> page = new Page(shopSalesmanDetailDto.getPageNum(), shopSalesmanDetailDto.getPageSize());
        IPage<ShopCustomDetailVo> customDetailRows = shopSalesmanApplyService.findCustomDetail(page,shopSalesmanDetailDto);
        Page<ShopCustomDetailVo> page = new Page(loadParamSettingDto.getPageNum(), loadParamSettingDto.getPageSize());
        IPage<ShopCustomDetailVo> customDetailRows = shopSalesmanApplyService.findCustomDetail(page,loadParamSettingDto);
        result.putInMap("customDetailRecords", customDetailRows.getRecords());
        result.putInMap("customDetailTotal", customDetailRows.getTotal());
        return result;
    }
    /**
     * 分销员详情页面邀请下级
     */
    @ApiOperation(value = "分销员详情页面邀请下级")
    @PostMapping(value = "/loadParamSettinglow")
    public @ResponseBody
    AjaxResult loadParamSettinglow(@RequestBody ShopSalesmanDetailDto shopSalesmanDetailDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(shopSalesmanDetailDto);
        AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
        //排序
        if(StringUtils.isBlank(shopSalesmanDetailDto.getSort())){
            shopSalesmanDetailDto.setSort("create_time");
            shopSalesmanDetailDto.setOrder("desc");
        }
        //查询邀请下级信息
        Page<ShopCustomDetailVo> pageLow = new Page(shopSalesmanDetailDto.getPageNum(), shopSalesmanDetailDto.getPageSize());
        IPage<ShopCustomDetailVo> customLowRows = shopSalesmanApplyService.findCustomLow(pageLow,shopSalesmanDetailDto);
        result.putInMap("customLowRecords", customLowRows.getRecords());
        result.putInMap("customLowTotal", customLowRows.getTotal());
        return result;
    }
    /**
     * 分销员详情页面收益订单
     */
    @ApiOperation(value = "分销员详情页面收益订单")
    @PostMapping(value = "/loadParamSettingOrder")
    public @ResponseBody
    AjaxResult loadParamSettingOrder(@RequestBody ShopSalesmanDetailDto shopSalesmanDetailDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(shopSalesmanDetailDto);
        AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
        //排序
        if(StringUtils.isBlank(shopSalesmanDetailDto.getSort())){
            shopSalesmanDetailDto.setSort("create_time");
            shopSalesmanDetailDto.setOrder("desc");
        }
        //查询收益订单
        Page<ShopOrderDetailVo> pageOrder = new Page(shopSalesmanDetailDto.getPageNum(), shopSalesmanDetailDto.getPageSize());
        IPage<ShopOrderDetailVo> orderRows = shopSalesmanApplyService.findShopOrderDetail(pageOrder,shopSalesmanDetailDto);
zq-erp/src/main/java/com/matrix/system/fenxiao/constant/FenxiaoSettingConstant.java
@@ -14,6 +14,14 @@
     */
    public final static String FX_APPLY_WAY = "FX_APPLY_WAY";
    /**
     * 申请方式 1自动申请通过
     */
    public final static String FX_APPLY_WAY_AUTO = "1";
    /**
     * 申请方式 2需要主动申请
     */
    public final static String FX_APPLY_WAY_CUSTOMER = "2";
    /**
     * 审核方式  1系统自动审核,2人工审核
     */
    public final static String FX_AUDIT_METHOD = "FX_AUDIT_METHOD";
@@ -26,15 +34,15 @@
     */
    public final static String FX_APPLY_CONDITION_WTJ = "1";
    /**
     * 申请条件 1 消费任意产品
     * 申请条件 2 消费任意产品
     */
    public final static String FX_APPLY_CONDITION_XFRYCP = "2";
    /**
     * 申请条件 1 消费指定产品
     * 申请条件 3 消费指定产品
     */
    public final static String FX_APPLY_CONDITION_XFZDCP = "3";
    /**
     * 申请条件 1 消费指定金额
     * 申请条件 4 消费指定金额
     */
    public final static String FX_APPLY_CONDITION_XCZDJE = "4";
    /**
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopRevenueFlowDao.java
@@ -5,7 +5,6 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.system.fenxiao.entity.ShopRevenueFlow;
import com.matrix.system.shopXcx.api.dto.RevenueFlowDto;
import com.matrix.system.shopXcx.vo.SalesOrderVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -15,5 +14,5 @@
 */
public interface ShopRevenueFlowDao extends BaseMapper<ShopRevenueFlow> {
    IPage<SalesOrderVo> selectRevenuFlowList(Page<SalesOrderVo> page, @Param("record") RevenueFlowDto revenueFlowDto);
    IPage<ShopRevenueFlow> selectRevenuFlowList(Page<ShopRevenueFlow> page, @Param("record") RevenueFlowDto revenueFlowDto);
}
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.system.fenxiao.dto.LoadParamSettingDto;
import com.matrix.system.fenxiao.dto.ShopSalesmanAppliingDto;
import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto;
import com.matrix.system.fenxiao.dto.ShopSalesmanDetailDto;
@@ -42,7 +43,7 @@
            @Param("companyId")Long companyId,@Param("applyId")long applyId);
    IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,
                                               @Param("record")ShopSalesmanDetailDto shopSalesmanDetailDto);
                                               @Param("record")LoadParamSettingDto loadParamSettingDto);
    IPage<ShopCustomDetailVo> findCustomLow(Page<ShopCustomDetailVo> pageLow,
            @Param("record")ShopSalesmanDetailDto shopSalesmanDetailDto);
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java
New file
@@ -0,0 +1,20 @@
package com.matrix.system.fenxiao.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "LoadParamSettingBasicDto", description = "查询参数")
public class LoadParamSettingBasicDto {
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="申请记录ID")
    private String applyId;
    @ApiModelProperty(hidden = true)
    private Long companyId;
}
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java
New file
@@ -0,0 +1,25 @@
package com.matrix.system.fenxiao.dto;
import com.matrix.core.pojo.BasePageQueryDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "LoadParamSettingDto", description = "查询参数")
public class LoadParamSettingDto extends BasePageQueryDto {
    @ApiModelProperty(value ="会员姓名")
    private String userName;
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="申请记录ID")
    private String applyId;
    @ApiModelProperty(hidden = true)
    private Long companyId;
}
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
@@ -14,6 +14,7 @@
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.VerificationResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.dao.BusParameterSettingsDao;
@@ -71,7 +72,7 @@
        BizUser loginUser=bizUserDao.findByOpenId(openId);
        //验证申请条件
        VerificationResult verificationResult = isAbleToBeAnSalesman(openId);
        VerificationResult verificationResult = isAbleToBeAnSalesman(openId,loginUser.getCompanyId());
        if(verificationResult.isJudgeResult()){
            //校验审核状态,和是否重复发起
            QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>();
@@ -135,42 +136,50 @@
    /**
     * 判断是否满足申请成为分销员的条件
     */
    public VerificationResult isAbleToBeAnSalesman(String openId) {
        BizUser bizUser = bizUserDao.findByOpenId(openId);
        VerificationResult verificationResult=null;
        //申请条件
        BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, bizUser.getCompanyId());
        switch (applyCondition.getParamValue()){
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ:
                VerificationResult.buildVerificationResult(true);
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP:
                VerificationResult.buildVerificationResult(true);
                int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(openId,applyCondition.getParamValue1());
                if(buyZdcpCount>0){
                    verificationResult= VerificationResult.buildVerificationResult(true);
                }else{
                    verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费指定产品后再申请!");
                }
    public VerificationResult isAbleToBeAnSalesman(String openId,Long companyId) {
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP:
                //判断用户是否有确认收货的产品
                int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(openId);
                if(receivedOrderCount>0){
        VerificationResult verificationResult=null;
        //申请模式
        BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, companyId);
        if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) {
            verificationResult= VerificationResult.buildVerificationResult(true);
        }else{
            //申请条件
            BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId);
            switch (applyCondition.getParamValue()){
                case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ:
                    verificationResult= VerificationResult.buildVerificationResult(true);
                }else{
                    verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费任意产品后再申请!");
                }
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE:
                Double zdje=Double.parseDouble(applyCondition.getParamValue2());
                Double yxfje=shopOrderV2Dao.countOrderAmount(openId);
                if(zdje<yxfje){
                    verificationResult=VerificationResult.buildVerificationResult(true);
                }else{
                    verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费满"+zdje+"元后再申请!");
                }
                VerificationResult.buildVerificationResult(true);
            default:
                VerificationResult.buildVerificationResult(true);
                    break;
                case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP:
                    int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(openId,applyCondition.getParamValue1());
                    if(buyZdcpCount>0){
                        verificationResult= VerificationResult.buildVerificationResult(true);
                    }else{
                        verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费指定产品后再申请!");
                    }
                    break;
                case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP:
                    //判断用户是否有确认收货的产品
                    int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(openId);
                    if(receivedOrderCount>0){
                        verificationResult= VerificationResult.buildVerificationResult(true);
                    }else{
                        verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费任意产品后再申请!");
                    }
                    break;
                case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE:
                    Double zdje=Double.parseDouble(applyCondition.getParamValue2());
                    Double yxfje=shopOrderV2Dao.countOrderAmount(openId);
                    if(zdje<yxfje){
                        verificationResult=VerificationResult.buildVerificationResult(true);
                    }else{
                        verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费满"+zdje+"元后再申请!");
                    }
                    break;
                default:
                    verificationResult= VerificationResult.buildVerificationResult(true);
            }
        }
        return verificationResult;
    }
@@ -232,9 +241,8 @@
        return shopSalesmanApplyDao.selectShopSalesmanDetailByOpenId(userId,companyId,applyId);
    }
    public IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,
                                                      ShopSalesmanDetailDto shopSalesmanDetailDto) {
        return shopSalesmanApplyDao.findCustomDetail(page,shopSalesmanDetailDto);
    public IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,LoadParamSettingDto loadParamSettingDto) {
        return shopSalesmanApplyDao.findCustomDetail(page,loadParamSettingDto);
    }
    public IPage<ShopCustomDetailVo> findCustomLow(Page<ShopCustomDetailVo> pageLow,
@@ -286,7 +294,7 @@
        bizUserDao.updateByModel(findByOpenId);
        shopSalesmanApplyDao.updateById(shopSalesmanApply);
        
        return AjaxResult.buildFailInstance("修改等级成功");
        return AjaxResult.buildSuccessInstance("修改等级成功");
    }
    @Transactional(rollbackFor = Exception.class)
@@ -301,7 +309,7 @@
        }
        findByOpenId.setParentOpenId("");
        bizUserDao.updateByModel(findByOpenId);
        return AjaxResult.buildFailInstance("解绑成功");
        return AjaxResult.buildSuccessInstance("解绑成功");
    }
    @Transactional(rollbackFor = Exception.class)
@@ -322,7 +330,7 @@
        ShopSalesmanApply selectById = shopSalesmanApplyDao.selectById(applyid);
        selectById.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_XTQX);
        shopSalesmanApplyDao.updateById(selectById);
        return AjaxResult.buildFailInstance("操作成功");
        return AjaxResult.buildSuccessInstance("操作成功");
    }
    public IPage<FyfaManageVo> findFyfaManageList(Page<FyfaManageVo> page, FyfaManageDto fyfaManageDto) {
@@ -351,16 +359,14 @@
            return AjaxResult.buildFailInstance("当前行数据不存在,请刷新页面");
        }
        shopSalesmanGradeDao.deleteById(gradeId);
        return AjaxResult.buildFailInstance("操作成功");
        return AjaxResult.buildSuccessInstance("操作成功");
    }
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult updateFyfa(UpdateFyfaDto updateFyfaDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(updateFyfaDto);
        ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(updateFyfaDto.getId());
        if(ObjectUtil.isEmpty(selectById)) {
            return AjaxResult.buildFailInstance("当前行数据不存在,请刷新页面");
        }
        String name = updateFyfaDto.getName();
        if(StrUtil.isEmpty(name)) {
            return AjaxResult.buildFailInstance("请输入方案名称");
@@ -373,15 +379,30 @@
        if(ObjectUtil.isEmpty(invitationCommission)) {
            return AjaxResult.buildFailInstance("请输入正确的邀请提成");
        }
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(updateFyfaDto);
        if(ObjectUtil.isEmpty(selectById)) {
            SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
            ShopSalesmanGrade shopSalesmanGrade = new ShopSalesmanGrade();
            shopSalesmanGrade.setCompanyId(updateFyfaDto.getCompanyId());
            shopSalesmanGrade.setName(updateFyfaDto.getName());
            shopSalesmanGrade.setSealesCommission(sealesCommission);
            shopSalesmanGrade.setInvitationCommission(invitationCommission);
            shopSalesmanGrade.setGradeCondition(updateFyfaDto.getGradeCondition());
            shopSalesmanGrade.setIsDefault(2);
            shopSalesmanGrade.setCreateBy(user.getSuName());
            shopSalesmanGrade.setUpdateBy(user.getSuName());
            shopSalesmanGrade.setCreateTime(new Date());
            shopSalesmanGrade.setUpdateTime(new Date());
            shopSalesmanGrade.setCompanyId(user.getCompanyId());
            shopSalesmanGradeDao.insert(shopSalesmanGrade);
            return AjaxResult.buildSuccessInstance("操作成功");
        }
        selectById.setCompanyId(updateFyfaDto.getCompanyId());
        selectById.setName(updateFyfaDto.getName());
        selectById.setSealesCommission(sealesCommission);
        selectById.setInvitationCommission(invitationCommission);
        selectById.setGradeCondition(updateFyfaDto.getGradeCondition());
        shopSalesmanGradeDao.updateById(selectById);
        return AjaxResult.buildFailInstance("操作成功");
        return AjaxResult.buildSuccessInstance("操作成功");
    }
    
    @Transactional(rollbackFor = Exception.class)
@@ -393,7 +414,7 @@
        BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, companyId);
        busParameterSettings.setParamValue3(updateTgjhDto.getTgfa());
        busParameterSettingsDao.updateByModel(busParameterSettings);
        return AjaxResult.buildFailInstance("保存成功");
        return AjaxResult.buildSuccessInstance("保存成功");
    }
    @Transactional(rollbackFor = Exception.class)
@@ -405,7 +426,7 @@
        BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, companyId);
        busParameterSettings.setParamValue(updateTgtpDto.getImageUrl());
        busParameterSettingsDao.updateByModel(busParameterSettings);
        return AjaxResult.buildFailInstance("保存成功");
        return AjaxResult.buildSuccessInstance("保存成功");
    }
    
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopOrderDetailVo.java
@@ -19,6 +19,9 @@
    @ApiModelProperty(value = "实付金额")
    private Double  orderMoney;
    @ApiModelProperty(value = "订单状态")
    private Integer orderState;
    
    @ApiModelProperty(value = "下单门店")
    private String storeName;
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java
@@ -74,10 +74,14 @@
    private String nickname;
    @ApiModelProperty(value = "头像")
    private String avatarUrl;
    @ApiModelProperty(value = "邀请人")
    @ApiModelProperty(value = "注册邀请人")
    private String parentUser;
    @ApiModelProperty(value = "下级客户数")
    @ApiModelProperty(value = "当前上级")
    private String parentUserNow;
    @ApiModelProperty(value = "推广客户")
    private Integer lowerLevelNum;
    @ApiModelProperty(value = "邀请下级")
    private Integer invitedNum;
    @ApiModelProperty(value = "累计收益")
    private BigDecimal totalRevenue;
zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
@@ -447,8 +447,10 @@
        if(orderVo.getId()!=null){
            WebUtil.getRequest().setAttribute("orderParam", orderVo.getId());
            WebUtil.getRequest().setAttribute("orderId", orderVo.getId());
        }else if(StringUtils.isNotBlank(orderVo.getOrderNo())){
            WebUtil.getRequest().setAttribute("orderParam", orderVo.getOrderNo());
            WebUtil.getRequest().setAttribute("orderNo", orderVo.getOrderNo());
        }
        return "admin/hive/beautySalon/orderXq-form";
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java
@@ -1,25 +1,10 @@
package com.matrix.system.shopXcx.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.anotations.SaveRequestToken;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.shopXcx.bean.ShopScoreExchange;
import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao;
import com.matrix.system.shopXcx.pojo.ExchangeScorePOJO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.Date;
/**
@@ -40,75 +25,6 @@
     * 记录编辑前的值Before_Edit_Value
     */
    public static final String BEV = "ShopBizUserScore_BEV";
    /**
     * 进入积分兑换界面
     */
    @SaveRequestToken
    @RequestMapping(value = "/intoExchangePage")
    public ModelAndView exchangeScore(String userId) {
        BizUser bizUser = new BizUser();
        ModelAndView modelAndView = new ModelAndView("admin/shop/user-score-exchange");
        if (StringUtils.isNotBlank(userId)) {
            bizUser = bizUserService.findById(userId);
            if (bizUser.getCurrentScore() == null) {
                bizUser.setCurrentScore(0);
            }
        }
        modelAndView.addObject("obj", bizUser);
        return modelAndView;
    }
    /**
     * 兑换积分
     */
    @Transactional(rollbackFor = Exception.class)
    @RemoveRequestToken
    @RequestMapping(value = "/exchangeScore")
    public @ResponseBody
    AjaxResult exchangeScore(ExchangeScorePOJO pojo) {
        //校验参数中用户ID和用户兑换积分是否有效
        if (pojo == null || StringUtils.isBlank(pojo.getUserId())
                || pojo.getScore() == null || pojo.getScore() == 0) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "提交参数有误!");
        }
        //兑换积分用户信息
        BizUser bizUser = bizUserService.findById(pojo.getUserId());
        if (bizUser == null) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "没有查询到相应用户!");
        }
        if (bizUser.getCurrentScore() == null) {
            bizUser.setCurrentScore(0);
        }
        //如果兑换积分大于用户当前积分
        if (pojo.getScore() > bizUser.getCurrentScore()) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "兑换积分大于用户当前积分!");
        }
        //剩余积分 = 当前积分 - 兑换积分
        Integer remainScore = bizUser.getCurrentScore() - pojo.getScore();
        //当前操作用户信息
        SysUsers loginUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        //修改用户剩余积分
        BizUser updateModel = new BizUser();
        updateModel.setUserId(bizUser.getUserId());
        updateModel.setCurrentScore(remainScore);
        updateModel.setUpdateBy(loginUser.getSuName());
        updateModel.setUpdateTime(new Date());
        bizUserService.modifyByModel(updateModel);
        //添加积分兑换记录
        ShopScoreExchange insertExchange = new ShopScoreExchange();
        insertExchange.setCreateBy(loginUser.getSuName());
        insertExchange.setUpdateBy(loginUser.getSuName());
        insertExchange.setUserId(bizUser.getOpenId());
        insertExchange.setExchangeScore(pojo.getScore());
        insertExchange.setOperateId(loginUser.getSuId());
        insertExchange.setRemark(pojo.getRemarks());
        shopScoreExchangeDao.insert(insertExchange);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "兑换成功!");
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java
@@ -1,6 +1,9 @@
package com.matrix.system.shopXcx.action;
import com.matrix.component.wechat.externalInterface.common.WechatConfigure;
import com.matrix.component.rabbitmq.RabiitMqTemplate;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxTempLateMsgUtil;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.anotations.SaveRequestToken;
import com.matrix.core.constance.MatrixConstance;
@@ -10,20 +13,17 @@
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.*;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.shopXcx.api.service.WXShopOrderService;
import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService;
import com.matrix.system.shopXcx.bean.*;
import com.matrix.system.shopXcx.dao.ShopCouponRecordDao;
import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao;
import com.matrix.system.shopXcx.dao.ShopOrderDao;
import com.matrix.system.shopXcx.dao.ShopRefundRecordDao;
import com.matrix.component.tools.WxTempLateMsgUtil;
import com.matrix.system.shopXcx.api.service.WXShopOrderService;
import com.matrix.system.shopXcx.mqTask.MQTaskRouting;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -73,6 +73,12 @@
    @Value("${wx_pay_debug_onoff}")
    private boolean isDebug;
    @Value("${evn}")
    private  String evn;
    @Autowired
    private RabiitMqTemplate rabiitMqTemplate;
    /**
     * 列表显示
@@ -522,6 +528,9 @@
                modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_MONEYBACK_SUCCESS);
                modifyMap.put("refundCharge", shopRefundRecord.getRefundMoney());
                shopOrderDao.updateByMap(modifyMap);
                rabiitMqTemplate.sendMsg(MQTaskRouting.SHOP_ORDER_REFUND+evn,shopOrder.getId()+"");
            }catch (Exception e){
                LogUtil.debug("退款成功,修改退款表和订单表状态出错。。。", id);
                e.printStackTrace();
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopShoppingCartAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java
@@ -97,7 +97,7 @@
    AjaxResult calculationCartOrder(@RequestBody AddShopOrderPOJO addShopOrderPOJO) throws Exception {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); //计算购物车中物品的优惠信息
        List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId());
        List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId(),ShopShoppingCart.CAR_TYPE_MICRO);
        //取出购物车中选中的产品
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java
@@ -5,7 +5,6 @@
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.shopXcx.api.dto.SaleProductDto;
import com.matrix.system.shopXcx.bean.ShopProduct;
import com.matrix.system.shopXcx.bean.ShopProductAttribute;
import com.matrix.system.shopXcx.dao.ShopProductAttributeDao;
import com.matrix.system.shopXcx.dao.ShopProductDao;
import com.matrix.system.shopXcx.dao.ShopSkuDao;
@@ -47,14 +46,13 @@
    })
    public AjaxResult getShopProductShowList(@RequestBody @Validated SaleProductDto saleProductDto) {
        ShopProduct shopProduct=new ShopProduct();
        ShopProductAttribute fxsc = shopProductAttributeDao.selectByCode("fxsc", HostInterceptor.getCompanyId());
        shopProduct.setLimit(saleProductDto.getPageSize());
        shopProduct.setOffset((saleProductDto.getPageNum()-1)* saleProductDto.getPageSize());
        shopProduct.setCategoryId(saleProductDto.getCategoryId());
        shopProduct.setDelFlag(AppConstance.DATA_USEABLE);
        shopProduct.setStatus(AppConstance.IS_PUTAWAY);
        shopProduct.setAbleSales(ShopProduct.ABLE_SALES);
        shopProduct.setCompanyId(HostInterceptor.getCompanyId());
        shopProduct.setAttrs(fxsc.getAttrId()+"");
        List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct);
        shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId())));
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopProducts);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java
@@ -14,7 +14,6 @@
import com.matrix.system.hive.service.CodeService;
import com.matrix.system.shopXcx.api.dto.RevenueFlowDto;
import com.matrix.system.shopXcx.api.dto.WithdrawalCashDto;
import com.matrix.system.shopXcx.vo.SalesOrderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
@@ -58,15 +57,15 @@
    CodeService codeService;
    @ApiOperation(value = "获取收支明细", notes = "")
    @PostMapping(value = "/getInvitationuserList")
    @PostMapping(value = "/getRevenueFlow")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = ShopRevenueFlow.class)
    })
    AjaxResult getInvitationuserList(@RequestBody @Validated RevenueFlowDto revenueFlowDto) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        Page<SalesOrderVo> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize());
        Page<ShopRevenueFlow> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize());
        revenueFlowDto.setUserId(loginUser.getOpenId());
        IPage<SalesOrderVo> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page,  revenueFlowDto);
        IPage<ShopRevenueFlow> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page,  revenueFlowDto);
        AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords());
        return result;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
@@ -10,6 +10,7 @@
import com.matrix.component.tools.WxacodeUtil;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.BasePageQueryDto;
import com.matrix.core.pojo.VerificationResult;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.MD5Util;
import com.matrix.core.tools.PropertiesUtil;
@@ -22,7 +23,10 @@
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.service.ShopSalesmanApplyService;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.shopXcx.api.WeChatApiTools;
import com.matrix.system.shopXcx.dao.ShopProductDao;
import com.matrix.system.shopXcx.vo.SalesmanApplyCondition;
import com.matrix.system.shopXcx.vo.SalesmanCenterInfo;
import com.matrix.system.shopXcx.vo.SalesmanVo;
import io.swagger.annotations.Api;
@@ -37,8 +41,11 @@
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @author wzy
@@ -66,6 +73,10 @@
    private BizUserDao bizUserDao;
    @Autowired
    WeChatApiTools weChatApiTools;
    @Autowired
    ShopProductDao shopProductDao;
    @ApiOperation(value = "查询推广计划", notes = "")
    @GetMapping(value = "/getTgPlan")
@@ -132,33 +143,47 @@
    }
    @ApiOperation(value = "绑定下级客户,当客户点击分销员分销的产品时调用", notes = "传入参数invitationId 必须 分销员openId 例: {invitationId:openId}")
    @ApiOperation(value = "绑定下级客户,当客户点击分销员分销的产品时调用", notes = "传入参数invitationId 必须 分销员userId例: {invitationId:userId}")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = Map.class)
    })
    @PostMapping(value = "/bindingParentSalesman")
    public AjaxResult bindingParentSalesman(@RequestBody Map<String,String> param) {
        String invitationId = param.get("invitationId");
        if (StringUtils.isBlank(invitationId)) {
            return AjaxResult.buildFailInstance("请求参数错误");
        }
        BizUser invitationUser = bizUserDao.selectById(Long.parseLong(invitationId));
        if (invitationUser==null) {
            return AjaxResult.buildFailInstance("请求参数错误");
        }
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        loginUser = bizUserDao.selectById(loginUser.getUserId());
        if (loginUser.getIsSales() == null || loginUser.getIsSales() == BizUser.NOT_SALES) {
            if (StringUtils.isBlank(loginUser.getParentOpenId())) {
        if(invitationId.equals(loginUser.getUserId())){
            return AjaxResult.buildSuccessInstance("不能绑定自己");
        }
        loginUser = bizUserDao.selectById(loginUser.getUserId());
        if(loginUser.getIsSales()==1){
            return AjaxResult.buildSuccessInstance("只有非分销员才能被绑定成客户");
        }else{
            if (StringUtils.isBlank(loginUser.getParentOpenId())) {
                Map<String, Object> updateParam = new HashMap<>();
                updateParam.put("userId", loginUser.getUserId());
                updateParam.put("parentOpenId", invitationId);
                updateParam.put("parentOpenId", invitationUser.getOpenId());
                updateParam.put("bindingParentTime",new Date());
                bizUserDao.updateByMap(updateParam);
                return AjaxResult.buildSuccessInstance("绑定成功");
            } else {
                return AjaxResult.buildSuccessInstance("已经存在上级");
            }
        } else {
            return AjaxResult.buildSuccessInstance("分销员不能被绑定");
        }
    }
@@ -249,6 +274,53 @@
        return AjaxResult.buildSuccessInstance(salesmanCenterInfo);
    }
    @ApiOperation(value = "查询分销员申请条件", notes = "")
    @PostMapping(value = "/getSalesmanApplyCondition")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class)
    })
    AjaxResult getSalesmanApplyCondition() {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getOpenId(),loginUser.getCompanyId());
        SalesmanApplyCondition applyConditionInfo=new SalesmanApplyCondition();
        applyConditionInfo.setIsAbleApply(ableToBeAnSalesman.isJudgeResult());
        applyConditionInfo.setMsg(ableToBeAnSalesman.getMsg());
        //申请条件
        BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, loginUser.getCompanyId());
        switch (applyCondition.getParamValue()){
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ:
                applyConditionInfo.setCondition("您已满足申请条件");
                break;
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP:
                applyConditionInfo.setCondition("消费指定产品并确认收货");
                List<String> strings = StringUtils.strToColl(applyCondition.getParamValue1(), ",");
                List<Integer> ids = strings.stream().filter(i -> StringUtils.isNotBlank(i)).map(i -> Integer.parseInt(i + "")).distinct().collect(Collectors.toList());
                if(CollectionUtils.isNotEmpty(ids)){
                    applyConditionInfo.setProductList(shopProductDao.selectByIds(ids));
                }else{
                    return AjaxResult.buildFailInstance("未配置消费产品,请联系管理员");
                }
                break;
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP:
                //判断用户是否有确认收货的产品
                applyConditionInfo.setCondition("消费任意产品并确认收货");
                break;
            case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE:
                Double zdje=Double.parseDouble(applyCondition.getParamValue2());
                applyConditionInfo.setCondition("消费满"+zdje+"元确认收货");
                applyConditionInfo.setMinAmount(zdje);
        }
        return AjaxResult.buildSuccessInstance(applyConditionInfo);
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java
New file
@@ -0,0 +1,67 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.shopXcx.api.dto.SaleProductDto;
import com.matrix.system.shopXcx.api.dto.ScoreProductDto;
import com.matrix.system.shopXcx.bean.ShopProduct;
import com.matrix.system.shopXcx.dao.ShopProductDao;
import com.matrix.system.shopXcx.dao.ShopSkuDao;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * @author jyy
 * @date 2021-03-10
 **/
@Api(tags = "积分商品类")
@RestController
@RequestMapping(value = "/wxapi/scoreProduct")
public class WxScoreProductAction {
    @Autowired
    private ShopProductDao shopProductDao;
    @Autowired
    private ShopSkuDao shopSkuDao;
    @ApiOperation(value = "查询积分商品", notes = "")
    @PostMapping(value = "/getScoreProductList")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response=SaleProductDto.class)
    })
    public AjaxResult getShopProductShowList(@RequestBody @Validated ScoreProductDto scoreProductDto) {
        ShopProduct shopProduct=new ShopProduct();
        shopProduct.setLimit(scoreProductDto.getPageSize());
        shopProduct.setOffset((scoreProductDto.getPageNum()-1)* scoreProductDto.getPageSize());
        shopProduct.setScoreCategoryId(scoreProductDto.getScoreCategoryId());
        shopProduct.setDelFlag(AppConstance.DATA_USEABLE);
        shopProduct.setStatus(AppConstance.IS_PUTAWAY);
        shopProduct.setAbleSales(ShopProduct.NOT_ABLE_SALES);
        shopProduct.setMallType(ShopProduct.MALL_SCORE);
        shopProduct.setCompanyId(HostInterceptor.getCompanyId());
        List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct);
        shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId())));
        return AjaxResult.buildSuccessInstance(shopProducts);
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java
@@ -314,7 +314,7 @@
        g = b2Img.createGraphics();
        g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1));
        g.drawImage(qrcordImgBuf, 320, 550, 140, 140, null);
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
        //标题
        g.setColor(new Color(0xF10D0A0A, true));
        Font font = new Font("微软雅黑", Font.PLAIN, 24);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java
@@ -146,7 +146,7 @@
    @ResponseBody
    public AjaxResult getShopProductShowList(@RequestBody ShopProduct shopProduct) {
        List<ShopProduct> shopProducts = null;
        shopProduct.setMallType(ShopProduct.MALL_MICRO);
        //查询是否匹配优惠条件
        ShopCoupon shopCoupon = shopCouponDao.getCouponByTitle(shopProduct.getTitle(),HostInterceptor.getCompanyId());
        if (shopCoupon != null && shopProduct.getOffset() < 1) {
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java
@@ -1,25 +1,25 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.constance.SystemErrorCode;
import com.matrix.core.constance.SystemMessageCode;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.shopXcx.bean.ShopShoppingCart;
import com.matrix.system.shopXcx.bean.ShopSku;
import com.matrix.system.shopXcx.dao.ShopShoppingCartDao;
import com.matrix.system.shopXcx.dao.ShopSkuDao;
import com.matrix.system.shopXcx.api.service.ShoppingCartService;
import com.matrix.system.shopXcx.api.service.WxShopCouponService;
import com.matrix.system.shopXcx.api.vo.ShopCartBillVo;
import com.matrix.system.shopXcx.api.vo.ShopCartVo;
import com.matrix.system.shopXcx.bean.ShopShoppingCart;
import com.matrix.system.shopXcx.bean.ShopSku;
import com.matrix.system.shopXcx.dao.ShopShoppingCartDao;
import com.matrix.system.shopXcx.dao.ShopSkuDao;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
@@ -32,7 +32,8 @@
 * @date 2019-06-12 19:15
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@Controller
@Api(tags = "购物车类")
@RestController
@RequestMapping(value = "wxapi/ShoppingCart")
public class WxShoppingCartAction {
    @Autowired
@@ -50,12 +51,8 @@
    ShopSkuDao skuDao;
    /**
     * 根据ID删除购物车
     *
     * @param
     * @return
     */
    @ApiOperation(value = "根据ID删除购物车", notes = "")
    @PostMapping("/deleteByCartId/{cartId}")
    @ResponseBody
    public AjaxResult deleteByCartId(@PathVariable("cartId") Integer cartId) {
@@ -66,16 +63,12 @@
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "删除成功");
    }
    /**
     * 根据用户ID查询购物车 没有分页
     *
     * @param
     * @return
     */
    @ApiOperation(value = "根据用户ID查询购物车 没有分页", notes = "")
    @PostMapping("/findShoppingCart")
    @ResponseBody
    public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) {
        List<ShopCartVo> cartList = shoppingCartService.findUserCartList(shoppingCart.getShopId());
        List<ShopCartVo> cartList = shoppingCartService.findUserCartList(shoppingCart.getShopId(),ShopShoppingCart.CAR_TYPE_MICRO);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, cartList, cartList.size());
        ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(cartList);
        result.putInMap("billTotal", shopCartBill.getBillTotal().stripTrailingZeros().toPlainString());
@@ -86,9 +79,8 @@
        return result;
    }
    /**
     * 批量删除
     */
    @ApiOperation(value = "批量删除", notes = "")
    @PostMapping(value = "/delShoppingCart/{keys}")
    public
    @ResponseBody
@@ -102,12 +94,13 @@
        }
    }
    @PostMapping(value = "/getUserCartCount/{shopId}")
    @ApiOperation(value = "查询微商城购物车数量", notes = "")
    @PostMapping(value = "/getUserCartCount/{shopId}/{cartType}")
    public
    @ResponseBody
    AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) {
    AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId,@PathVariable("cartType") Integer cartType) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId());
        Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId(),cartType);
        if (userCartCount == null) {
            userCartCount = 0;
        }
@@ -194,7 +187,7 @@
            return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败");
        }
        int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(),
                loginUser.getOpenId());
                loginUser.getOpenId(),shoppingCart.getCartType());
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功");
        result.putInMap("userCartCount", userCartCount);
        return result;
@@ -258,7 +251,7 @@
     * @param
     * @return
     */
    @RequestMapping("/updateCartSelected")
    @PostMapping("/updateCartSelected")
    @ResponseBody
    public AjaxResult updateCartSelected(@RequestBody ShopShoppingCart shoppingCart) {
        Map<String, Object> modifyMap = new HashMap<>();
@@ -274,13 +267,12 @@
     * @param
     * @return
     */
    @RequestMapping("/updateCartAllSelected/{shopId}/{isSelected}")
    @PostMapping("/updateCartAllSelected/{shopId}/{isSelected}/{cartType}")
    @ResponseBody
    public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected,
                                            @PathVariable("shopId") Long shopId) {
        Map<String, Object> modifyMap = new HashMap<>();
                                            @PathVariable("shopId") Long shopId,@PathVariable("cartType") Integer cartType) {
        BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class);
        shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected);
        shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected,cartType);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功");
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java
@@ -1,5 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.component.redis.RedisUserLoginUtils;
@@ -9,150 +10,195 @@
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.web.BaseAction;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.service.ShopSalesmanApplyService;
import com.matrix.system.shopXcx.api.WeChatApiTools;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.Date;
/**
 * @description (用户表)
 * @author jyy
 * @description (用户表)
 * @date 2019-05-31 10:03
 */
@Controller
@RequestMapping(value = "wxapi/user")
public class WxUserAction extends BaseAction {
    @Autowired
    private BizUserService bizUserService;
    @Autowired
    private BizUserService bizUserService;
    @Autowired
    private ShopSalesmanApplyService shopSalesmanApplyService;
    @Autowired
    BusParameterSettingsDao busParameterSettingsDao;
    @Autowired
    private RedisUserLoginUtils redisUserLoginUtils;
    @Autowired
    ShopSalesmanApplyDao salesmanApplyDao;
    @Autowired
    WeChatApiTools weChatApiTools;
    @Autowired
    private RedisUserLoginUtils redisUserLoginUtils;
    @Autowired
    private WeixinServiceUtil weixinServiceUtil;
    @Value("${debug}")
    private String isDebug;
    @Autowired
    WeChatApiTools weChatApiTools;
    @Autowired
    private WeixinServiceUtil weixinServiceUtil;
    @Value("${debug}")
    private String isDebug;
    /**
     * 小程序登录
     *
     * @author JIANGYOUYAO
     * @email 935090232@qq.com
     * @date 2018年5月23日
     * @param code
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/login/{keys}")
    public @ResponseBody
    /**
     * 小程序登录
     *
     * @param code
     * @return
     * @throws Exception
     * @author JIANGYOUYAO
     * @email 935090232@qq.com
     * @date 2018年5月23日
     */
    @RequestMapping(value = "/login/{keys}")
    public @ResponseBody
    AjaxResult wxLogin(@PathVariable("keys") String code) throws Exception {
        AjaxResult res = new AjaxResult();
        LogUtil.info("code:{}" + code);
        if (StringUtils.isNotBlank(code)) {
            String requrl = weChatApiTools.getXcxLoginUrl(code, HostInterceptor.getCompanyId());
            String reslutData = HttpCurlUtil.sendGetHttp(requrl, null);
            JSONObject json = JSONObject.fromObject(reslutData);
            LogUtil.debug("微信登录获取到登录信息={}", json);
        AjaxResult res = new AjaxResult();
        LogUtil.info("code:{}" + code);
        if (StringUtils.isNotBlank(code)) {
            String requrl = weChatApiTools.getXcxLoginUrl(code, HostInterceptor.getCompanyId());
            String reslutData = HttpCurlUtil.sendGetHttp(requrl, null);
            JSONObject json = JSONObject.fromObject(reslutData);
            LogUtil.debug("微信登录获取到登录信息={}", json);
            if(json.containsKey("errcode")){
                res.setStatus(AjaxResult.STATUS_FAIL);
                res.setInfo("自动登录失败");
                LogUtil.debug("微信登录获取到异常信息errcode");
                return res;
            }
            if (json.containsKey("errcode")) {
                res.setStatus(AjaxResult.STATUS_FAIL);
                res.setInfo("自动登录失败");
                LogUtil.debug("微信登录获取到异常信息errcode");
                return res;
            }
            String openId = json.getString("openid");
            String sessionKey = json.getString("session_key");
            LogUtil.debug("openId={},sessionKey={}", openId, sessionKey);
            // 查询用户是否存在
            BizUser bizUser = null;
            synchronized(this){
                bizUser = bizUserService.findByOpenId(openId);
                if (bizUser == null) {
                    // 新增用户
                    bizUser = new BizUser();
                    bizUser.setSessionKey(sessionKey);
                    bizUser.setIsSales(BizUser.NOT_SALES);
                    bizUser.setOpenId(openId);
                    bizUser.setLastLoginTime(new Date());
                    bizUser.setUserType(AppConstance.USER_TYPE_CUSTOMER);
                    bizUser.setCompanyId(HostInterceptor.getCompanyId());
                    bizUserService.add(bizUser);
            String openId = json.getString("openid");
            String sessionKey = json.getString("session_key");
            LogUtil.debug("openId={},sessionKey={}", openId, sessionKey);
            // 查询用户是否存在
            BizUser bizUser = null;
            synchronized (this) {
                bizUser = bizUserService.findByOpenId(openId);
                if (bizUser == null) {
                    // 新增用户
                    bizUser = new BizUser();
                    bizUser.setSessionKey(sessionKey);
                    bizUser.setIsSales(BizUser.NOT_SALES);
                    bizUser.setOpenId(openId);
                    bizUser.setLastLoginTime(new Date());
                    bizUser.setUserType(AppConstance.USER_TYPE_CUSTOMER);
                    bizUser.setCompanyId(HostInterceptor.getCompanyId());
                    bizUserService.add(bizUser);
                } else {
                    bizUser.setSessionKey(sessionKey);
                    bizUser.setLastLoginTime(new Date());
                    // 更新用户sessionKey
                    bizUserService.modifyByModel(bizUser);
                }
            }
            // 存放redis
            String token = redisUserLoginUtils.saveUserInfo(bizUser);
            LogUtil.info("用户token={}", token);
            res.putInMap("token", token);
            res.putInMap("userInfo", bizUser);
            res.setStatus(AjaxResult.STATUS_SUCCESS);
        } else {
            res.setStatus(AjaxResult.STATUS_FAIL);
            res.setInfo("自动登录失败");
        }
        return res;
    }
                } else {
                    bizUser.setSessionKey(sessionKey);
                    bizUser.setLastLoginTime(new Date());
                    // 更新用户sessionKey
                    bizUserService.modifyByModel(bizUser);
                }
            }
            // 存放redis
            String token = redisUserLoginUtils.saveUserInfo(bizUser);
            LogUtil.info("用户token={}", token);
            res.putInMap("token", token);
            res.putInMap("userInfo", bizUser);
            res.setStatus(AjaxResult.STATUS_SUCCESS);
        } else {
            res.setStatus(AjaxResult.STATUS_FAIL);
            res.setInfo("自动登录失败");
        }
        return res;
    }
    /**
     * 查询用户信息
     */
    @RequestMapping(value = "/findUserInfo")
    public @ResponseBody
    /**
     * 查询用户信息
     */
    @RequestMapping(value = "/findUserInfo")
    public @ResponseBody
    AjaxResult findUserInfo() {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        String openId = loginUser.getOpenId();
        BizUser bizUser = bizUserService.findByOpenId(openId);
        AjaxResult res = new AjaxResult();
        res.putInMap("userInfo", bizUser);
        res.setStatus(AjaxResult.STATUS_SUCCESS);
        return res;
    }
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        String openId = loginUser.getOpenId();
        BizUser bizUser = bizUserService.findByOpenId(openId);
        AjaxResult res = new AjaxResult();
        res.putInMap("userInfo", bizUser);
        res.setStatus(AjaxResult.STATUS_SUCCESS);
        return res;
    }
    /**
     * 根据OpenID查询用户信息
     */
    @GetMapping(value = "/findUserInfo/{openId}")
    public @ResponseBody
    AjaxResult findUserInfo(@PathVariable String openId) {
        BizUser bizUser = bizUserService.findByOpenId(openId);
        BizUser bizUserQuery=new BizUser();
        bizUserQuery.setNickName(bizUser.getNickName());
        bizUserQuery.setAvatarUrl(bizUser.getAvatarUrl());
        bizUserQuery.setOpenId(openId);
        return AjaxResult.buildSuccessInstance(bizUserQuery);
    }
    /**
     * 接收用户信息
     */
    @RequestMapping(value = "/saveUserInfo")
    public @ResponseBody
    /**
     * 接收用户信息
     */
    @RequestMapping(value = "/saveUserInfo")
    public @ResponseBody
    AjaxResult saveUserInfo(@RequestBody BizUser bizUser) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        bizUser.setUserId(loginUser.getUserId());
        // TODO 赋值操作
        int i = bizUserService.saveUserInfo(bizUser);
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        bizUser.setUserId(loginUser.getUserId());
        // TODO 赋值操作
        int i = bizUserService.saveUserInfo(bizUser);
        if (i == 0) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败");
        }
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(bizUser));
    }
        checkNeedToBeSalesman(bizUser, loginUser);
        if (i == 0) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败");
        }
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(bizUser));
    }
    void checkNeedToBeSalesman(BizUser bizUser, BizUser loginUser) {
        //查询是否需要自动成为分销员
        if ((loginUser.getIsSales() == null || loginUser.getIsSales() == 2)
                && StringUtils.isNotBlank(bizUser.getNickName())) {//目前还不是分销员
            BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId());
            if (fxSwith.getParamValue().equals("1")) {//开启分销
                BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, loginUser.getCompanyId());
                if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) {//自动成为分销员
                    QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>();
                    queryWrapper.eq("user_id", loginUser.getOpenId());
                    queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH);
                    ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper);
                    if (shopSalesmanApply == null) {//没有待审核记录
                        try {
                            shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(), null, null, 2);
                        }catch (Exception e){
                            LogUtil.debug(e.getMessage());
                        }
                    }
                }
            }
        }
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java
New file
@@ -0,0 +1,18 @@
package com.matrix.system.shopXcx.api.dto;
import com.matrix.core.pojo.BasePageQueryDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "ScoreProductDto", description = "积分产品查询参数接收类")
public class ScoreProductDto extends BasePageQueryDto {
    @ApiModelProperty(value = "产品分类", example = "1")
    private Integer scoreCategoryId;
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java
@@ -79,10 +79,10 @@
     * @return
     * @param shopId
     */
    public List<ShopCartVo> findUserCartList(Long shopId) {
    public List<ShopCartVo> findUserCartList(Long shopId,Integer cartType) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        String userId = loginUser.getOpenId();
        List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shopId,userId);
        List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shopId,userId,cartType);
        List<ShopCartVo> cartList = buildShopCart(list);
        return cartList;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java
@@ -134,7 +134,7 @@
        }
        List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId());
        List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId(),ShopShoppingCart.CAR_TYPE_MICRO);
        //购物车不能为空
        if (CollectionUtils.isEmpty(cartList)) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择您需要购买的产品");
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java
@@ -1,16 +1,17 @@
package com.matrix.system.shopXcx.api.service.impl;
import com.matrix.component.wechat.externalInterface.common.WechatConfigure;
import com.matrix.component.rabbitmq.RabiitMqTemplate;
import com.matrix.component.tools.WxTempLateMsgUtil;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.tools.DateUtil;
import com.matrix.core.tools.LogUtil;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.system.shopXcx.bean.*;
import com.matrix.system.shopXcx.dao.*;
import com.matrix.component.tools.WxTempLateMsgUtil;
import com.matrix.system.shopXcx.api.service.WXShopOrderService;
import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService;
import com.matrix.system.shopXcx.bean.*;
import com.matrix.system.shopXcx.dao.*;
import com.matrix.system.shopXcx.mqTask.MQTaskRouting;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -49,6 +50,13 @@
    @Value("${wx_pay_debug_onoff}")
    private boolean isDebug;
    @Value("${evn}")
    private  String evn;
    @Autowired
    private RabiitMqTemplate rabiitMqTemplate;
    @Override
    public Boolean refundToUser(String id, ShopRefundRecord shopRefundRecord) {
        LogUtil.debug("进入退款接口进行退款。。。", id);
@@ -134,6 +142,10 @@
                modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_MONEYBACK_SUCCESS);
                modifyMap.put("refundCharge", shopRefundRecord.getRefundMoney());
                shopOrderDao.updateByMap(modifyMap);
                rabiitMqTemplate.sendMsg(MQTaskRouting.SHOP_ORDER_REFUND+evn,shopOrder.getId()+"");
            }catch (Exception e){
                LogUtil.debug("退款成功,修改退款表和订单表状态出错。。。", id);
                e.printStackTrace();
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java
@@ -2,6 +2,7 @@
import com.matrix.core.anotations.Extend;
import com.matrix.system.common.bean.EntityDTOExt;
import lombok.Data;
import java.util.List;
@@ -10,13 +11,27 @@
 * @author jyy
 * @date 2019-06-10 10:58
 */
@Data
public class ShopProduct extends EntityDTOExt {
    /**
     * 产品类型-服务
     * 卖场-微商城
     */
    public static  final int IS_SERVICE_Y=1;
    public static  final int IS_SERVICE_N=2;
    public static  final int MALL_MICRO =1;
    /**
     * 卖场-积分商城
     */
    public static  final int MALL_SCORE=2;
    /**
     * 可分销
     */
    public static  final int ABLE_SALES =1;
    /**
     * 不可分销
     */
    public static  final int NOT_ABLE_SALES=2;
    
    /**
     * 主键
@@ -28,7 +43,12 @@
     * 分类ID
     */
    private Integer  categoryId;
    /**
     * 积分商城分类ID
     */
    private Integer  scoreCategoryId;
    
    /**
     * 标题
@@ -58,10 +78,17 @@
     * 手机端封面
     */
    private String  imgMobile;
    /**
     * 上架卖场 1 微商城,2 积分商城
     */
    private Integer  mallType;
    /**
     * 是否为分销产品 1是2不是
     */
    private Integer  ableSales;
    
    /**
     * 原价
@@ -161,6 +188,7 @@
     */
    @Extend
    private String  paramRefs;
    @Extend
    private List<ShopProductParamRef> params;
@@ -246,366 +274,4 @@
    public Long getCompanyId() {
        return companyId;
    }
    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }
    public String getBrand() {
        return brand;
    }
    public void setBrand(String brand) {
        this.brand = brand;
    }
    public String getShopIds() {
        return shopIds;
    }
    public void setShopIds(String shopIds) {
        this.shopIds = shopIds;
    }
    public ShopCoupon getShopCoupon() {
        return shopCoupon;
    }
    public void setShopCoupon(ShopCoupon shopCoupon) {
        this.shopCoupon = shopCoupon;
    }
    public Integer getCouponId() {
        return couponId;
    }
    public void setCouponId(Integer couponId) {
        this.couponId = couponId;
    }
    public String getStockNum() {
        return stockNum;
    }
    public void setStockNum(String stockNum) {
        this.stockNum = stockNum;
    }
    public Integer getIsService() {
        return isService;
    }
    public void setIsService(Integer isService) {
        this.isService = isService;
    }
    public Integer getIsSpecialPrice() {
        return isSpecialPrice;
    }
    public void setIsSpecialPrice(Integer isSpecialPrice) {
        this.isSpecialPrice = isSpecialPrice;
    }
    public Double getMarkedPrice() {
        return markedPrice;
    }
    public void setMarkedPrice(Double markedPrice) {
        this.markedPrice = markedPrice;
    }
    public Integer getId() {
        return id;
    }
       public void setId(Integer id) {
        this.id=id;
    }
    public Integer getCategoryId() {
        return categoryId;
    }
       public void setCategoryId(Integer categoryId) {
        this.categoryId=categoryId;
    }
    public String getTitle() {
        return title;
    }
       public void setTitle(String title) {
        this.title=title;
    }
    public String getBriefIntroduction() {
        return briefIntroduction;
    }
       public void setBriefIntroduction(String briefIntroduction) {
        this.briefIntroduction=briefIntroduction;
    }
    public Integer getCarriage() {
        return carriage;
    }
       public void setCarriage(Integer carriage) {
        this.carriage=carriage;
    }
    public String getImgPc() {
        return imgPc;
    }
       public void setImgPc(String imgPc) {
        this.imgPc=imgPc;
    }
    public String getImgMobile() {
        return imgMobile;
    }
       public void setImgMobile(String imgMobile) {
        this.imgMobile=imgMobile;
    }
    public Double getPrice() {
        return price;
    }
       public void setPrice(Double price) {
        this.price=price;
    }
    public String getPcDetails() {
        return pcDetails;
    }
       public void setPcDetails(String pcDetails) {
        this.pcDetails=pcDetails;
    }
    public String getMobileDetails() {
        return mobileDetails;
    }
       public void setMobileDetails(String mobileDetails) {
        this.mobileDetails=mobileDetails;
    }
    public Integer getBuyLimit() {
        return buyLimit;
    }
       public void setBuyLimit(Integer buyLimit) {
        this.buyLimit=buyLimit;
    }
    public Integer getLimitCycle() {
        return limitCycle;
    }
       public void setLimitCycle(Integer limitCycle) {
        this.limitCycle=limitCycle;
    }
    public Integer getIsCanComment() {
        return isCanComment;
    }
       public void setIsCanComment(Integer isCanComment) {
        this.isCanComment=isCanComment;
    }
    public String getMnemonicCode() {
        return mnemonicCode;
    }
       public void setMnemonicCode(String mnemonicCode) {
        this.mnemonicCode=mnemonicCode;
    }
    public Integer getStatus() {
        return status;
    }
       public void setStatus(Integer status) {
        this.status=status;
    }
    public Integer getDsVolume() {
        return dsVolume;
    }
       public void setDsVolume(Integer dsVolume) {
        this.dsVolume=dsVolume;
    }
    public Integer getRsVolume() {
        return rsVolume;
    }
       public void setRsVolume(Integer rsVolume) {
        this.rsVolume=rsVolume;
    }
    public Integer getDelFlag() {
        return delFlag;
    }
       public void setDelFlag(Integer delFlag) {
        this.delFlag=delFlag;
    }
    public String getParamRefs() {
        return paramRefs;
    }
    public void setParamRefs(String paramRefs) {
        this.paramRefs = paramRefs;
    }
    public String getAttrs() {
        return attrs;
    }
    public void setAttrs(String attrs) {
        this.attrs = attrs;
    }
    public String getShopSku() {
        return shopSku;
    }
    public void setShopSku(String shopSku) {
        this.shopSku = shopSku;
    }
    public String getShopProductImg() {
        return shopProductImg;
    }
    public void setShopProductImg(String shopProductImg) {
        this.shopProductImg = shopProductImg;
    }
    public List<ShopProductParamRef> getParams() {
        return params;
    }
    public void setParams(List<ShopProductParamRef> params) {
        this.params = params;
    }
    public List<ShopProductAttrRef> getAttrRefs() {
        return attrRefs;
    }
    public void setAttrRefs(List<ShopProductAttrRef> attrRefs) {
        this.attrRefs = attrRefs;
    }
    public List<ShopSku> getSkus() {
        return skus;
    }
    public void setSkus(List<ShopSku> skus) {
        this.skus = skus;
    }
    public List<ShopProductImg> getProductImgs() {
        return productImgs;
    }
    public void setProductImgs(List<ShopProductImg> productImgs) {
        this.productImgs = productImgs;
    }
    public Integer getStartPrice() {
        return startPrice;
    }
    public void setStartPrice(Integer startPrice) {
        this.startPrice = startPrice;
    }
    public Integer getEndPrice() {
        return endPrice;
    }
    public void setEndPrice(Integer endPrice) {
        this.endPrice = endPrice;
    }
    public String getSortType() {
        return sortType;
    }
    public void setSortType(String sortType) {
        this.sortType = sortType;
    }
    public String getQueryType() {
        return queryType;
    }
    public void setQueryType(String queryType) {
        this.queryType = queryType;
    }
    public String getAttrValues() {
        return attrValues;
    }
    public void setAttrValues(String attrValues) {
        this.attrValues = attrValues;
    }
    public String getAtrid() {
        return atrid;
    }
    public void setAtrid(String atrid) {
        this.atrid = atrid;
    }
    public String getScore() {
        return score;
    }
    public Integer getServiceTime() {
        return serviceTime;
    }
    public void setServiceTime(Integer serviceTime) {
        this.serviceTime = serviceTime;
    }
    public void setScore(String score) {
        this.score = score;
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java
@@ -14,7 +14,16 @@
 */
public class ShopShoppingCart  extends EntityDTOExt {
    @Extend
    private static final long serialVersionUID = 1L;
    private static final long serialVersionUID = 1L;
    /**
     *购物车类型-微商城
     */
    public static  final int CAR_TYPE_MICRO =1;
    /**
     *购物车类型-积分商城
     */
    public static  final int CAR_TYPE_SCORE=2;
    
    /**
@@ -50,6 +59,12 @@
     * 用户是否选中 1选中  2未选中
     */
    private Integer isSelected;
    /**
     * 购物车类型 1微商城  2积分商城
     */
    private Integer cartType;
    /**
     * 门店id
@@ -324,6 +339,12 @@
    public List<ShopCoupon> getShopCoupons() {
        return shopCoupons;
    }
    public Integer getCartType() {
        return cartType;
    }
    public void setCartType(Integer cartType) {
        this.cartType = cartType;
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java
@@ -12,7 +12,7 @@
 */
public class ShopSku  extends EntityDTO{
    @Extend
    private static final long serialVersionUID = 1L;
    private static final long serialVersionUID = 1L;
    
    /**
@@ -59,9 +59,16 @@
    private BigDecimal invitationPrice;
    /**
     * 积分
     * 消费可得积分
     */
    private Integer score;
    /**
     * 积分兑换价格
     */
    private Integer scorePrice;
    /**
     * 排序
@@ -249,6 +256,14 @@
        this.goodsName = goodsName;
    }
    public Integer getScorePrice() {
        return scorePrice;
    }
    public void setScorePrice(Integer scorePrice) {
        this.scorePrice = scorePrice;
    }
    @Override
    public boolean equals(Object obj) {
        //这里以name为判定标准。
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.matrix.system.shopXcx.bean.ShopOrder;
import com.matrix.system.shopXcx.bean.ShopProduct;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @description 订单表
@@ -16,4 +19,5 @@
    /** 统计是否消费过了指定产品 */
    int countBuyZdcp(@Param("openId") String openId, @Param("productIds")String productIds);
}
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java
@@ -36,15 +36,15 @@
    
    public ShopShoppingCart  selectById(Integer cartId);
    public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") String cartUserId);
    public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") String cartUserId,@Param("cartType") Integer cartType);
    
    public ShopShoppingCart  selectForUpdate(Integer cartId);
    public ShopShoppingCart selectBuyLimit(@Param("cartProductId") Integer cartProductId,@Param("cartSkuId") Integer cartSkuId);
    public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("openId")String openId);
    public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("openId")String openId,@Param("cartType") Integer cartType);
    public int updateAllSelected(@Param("openId") String openId,@Param("shopId") Long shopId, @Param("isSelected") Integer isSelected);
    public int updateAllSelected(@Param("openId") String openId, @Param("shopId") Long shopId,  @Param("isSelected") Integer isSelected,@Param("cartType") Integer cartType);
    /**
     * 删除用户选中的购物车明细
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java
@@ -18,6 +18,10 @@
     * 发送小程序统一模板消息
     */
    String SEND_UNIFORM_TEMPLATE_MSG = "SEND_UNIFORM_TEMPLATE_MSG";
    /**
     * 订单退款
     */
    String SHOP_ORDER_REFUND = "SHOP_ORDER_REFUND";
    /**
     * 订单出库
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java
New file
@@ -0,0 +1,43 @@
package com.matrix.system.shopXcx.mqTask;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.matrix.core.tools.LogUtil;
import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanOrder;
import com.rabbitmq.client.DeliverCallback;
import com.rabbitmq.client.Delivery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
 * 分销订单退款
 */
@Component
public class SalesOrderRefundTask implements DeliverCallback {
    @Autowired
    private ShopSalesmanOrderDao shopSalesmanOrderDao;
    @Override
    public void handle(String consumerTag, Delivery message) throws IOException {
        String orderId = new String(message.getBody(), "UTF-8");
        LogUtil.debug("收到分销订单退款任务orderId={}", orderId);
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("order_id",orderId);
        ShopSalesmanOrder shopSalesmanOrder = shopSalesmanOrderDao.selectOne(queryWrapper);
        if(shopSalesmanOrder!=null){
            shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YTK);
            shopSalesmanOrderDao.updateById(shopSalesmanOrder);
        }else{
            LogUtil.debug("改订单为生成分销订单={}", orderId);
        }
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java
@@ -1,13 +1,13 @@
package com.matrix.system.shopXcx.mqTask;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao;
import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao;
import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanGrade;
@@ -35,7 +35,7 @@
import java.util.List;
/**
 * 微商城订单同步到erp系统
 * 分销订单创建
 */
@Component
public class SalesOrderTask implements DeliverCallback {
@@ -109,78 +109,83 @@
    void handleExtensionOrder(ShopOrder order) {
        //判读客户是否存在上级,存在则产生上级的收益
        BizUser bizUser = bizUserService.findByOpenId(order.getUserId());
        if(StringUtils.isNotBlank(bizUser.getParentOpenId())){
        if(StringUtils.isNotBlank(bizUser.getParentOpenId())){//存在上级
            LogUtil.debug("处理分销订单userOpid={}",bizUser.getOpenId());
            //存在上级
            ShopSalesmanOrder salesmanOrder=new ShopSalesmanOrder();
            salesmanOrder.setCompanyId(order.getCompanyId());
            salesmanOrder.setCreateBy(MatrixConstance.SYSTEM_USER);
            salesmanOrder.setUpdateBy(MatrixConstance.SYSTEM_USER);
            salesmanOrder.setCreateTime(new Date());
            salesmanOrder.setUpdateTime(new Date());
            salesmanOrder.setOrderId(Long.parseLong(order.getId()+""));
            salesmanOrder.setUserId(order.getUserId());
            salesmanOrder.setSalesUserId(bizUser.getParentOpenId());
            salesmanOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_SALES);
            salesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_DJS);
            Double salesAmount=0D;
            Double invitationAmount=0D;
            Double orderTotal=0D;
            Double zk=1D;
            //判断是否重复生成
            QueryWrapper queryWrapper=new QueryWrapper();
            queryWrapper.eq("order_id",order.getId());
            Integer orderCount = shopSalesmanOrderDao.selectCount(queryWrapper);
            if(orderCount==0){
                ShopSalesmanOrder salesmanOrder=new ShopSalesmanOrder();
                salesmanOrder.setCompanyId(order.getCompanyId());
                salesmanOrder.setCreateBy(MatrixConstance.SYSTEM_USER);
                salesmanOrder.setUpdateBy(MatrixConstance.SYSTEM_USER);
                salesmanOrder.setCreateTime(new Date());
                salesmanOrder.setUpdateTime(new Date());
                salesmanOrder.setOrderId(Long.parseLong(order.getId()+""));
                salesmanOrder.setUserId(order.getUserId());
                salesmanOrder.setSalesUserId(bizUser.getParentOpenId());
                salesmanOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_SALES);
                salesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_DJS);
                Double salesAmount=0D;
                Double invitationAmount=0D;
                Double orderTotal=0D;
                Double zk=1D;
            BizUser salesMan=bizUserService.findByOpenId(bizUser.getParentOpenId());
            BizUser invitationMan=null;
            ShopSalesmanOrder invitationOrder=null;
            boolean hasInvitationMan=StringUtils.isNotBlank(salesMan.getParentOpenId());
                BizUser salesMan=bizUserService.findByOpenId(bizUser.getParentOpenId());
                BizUser invitationMan=null;
                ShopSalesmanOrder invitationOrder=null;
                boolean hasInvitationMan=StringUtils.isNotBlank(salesMan.getParentOpenId());
            //判断推广员是否还存在上级,存在则计算邀请收益
            if(hasInvitationMan){
                invitationMan=bizUserService.findByOpenId(salesMan.getParentOpenId());
                 invitationOrder=new ShopSalesmanOrder();
                BeanUtils.copyProperties(salesmanOrder,invitationOrder);
                invitationOrder.setSalesUserId(invitationMan.getOpenId());
                invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION);
            }
            //收益计算
            for (ShopOrderDetails item:order.getDetails() ){
                if(StringUtils.isNotBlank(item.getShopProduct().getAttrValues())
                && item.getShopProduct().getAttrValues().contains("分销商城")){
                    if(item.getShopSku().getSealesPrice()==null
                    ||item.getShopSku().getSealesPrice().doubleValue()==0){
                        //按分销等级计算
                        ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(salesMan.getSalesmanGrade());
                        salesAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSealesCommission()/100);
                        if(hasInvitationMan){
                            ShopSalesmanGrade invitationManGrade = shopSalesmanGradeDao.selectById(invitationMan.getSalesmanGrade());
                            invitationAmount+=item.getTotalPrice().doubleValue()*(invitationManGrade.getInvitationCommission()/100);
                        }
                    }else{
                        //按产品设置的推广金额计算
                        salesAmount+=item.getShopSku().getSealesPrice().doubleValue()*item.getCount();
                        if(hasInvitationMan){
                            invitationAmount+=item.getShopSku().getInvitationPrice().doubleValue()*item.getCount();
                        }
                    }
                    orderTotal+=item.getTotalPrice().doubleValue();
                }
            }
            if(salesAmount>0){
                //整体的优惠金额折算成折扣,* 佣金
                zk=order.getOrderMoney().doubleValue()/orderTotal;
                salesAmount=salesAmount*zk;
                salesmanOrder.setAmount(salesAmount);
                shopSalesmanOrderDao.insert(salesmanOrder);
                //判断推广员是否还存在上级,存在则计算邀请收益
                if(hasInvitationMan){
                    invitationAmount=invitationAmount*zk;
                    invitationOrder.setAmount(invitationAmount);
                    shopSalesmanOrderDao.insert(invitationOrder);
                    invitationMan=bizUserService.findByOpenId(salesMan.getParentOpenId());
                    invitationOrder=new ShopSalesmanOrder();
                    BeanUtils.copyProperties(salesmanOrder,invitationOrder);
                    invitationOrder.setSalesUserId(invitationMan.getOpenId());
                    invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION);
                }
                //收益计算
                for (ShopOrderDetails item:order.getDetails() ){
                    if(StringUtils.isNotBlank(item.getShopProduct().getAttrValues())
                            && item.getShopProduct().getAttrValues().contains("分销商城")){
                        if(item.getShopSku().getSealesPrice()==null
                                ||item.getShopSku().getSealesPrice().doubleValue()==0){
                            //按分销等级计算
                            ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(salesMan.getSalesmanGrade());
                            salesAmount+=item.getTotalPrice().doubleValue()*(shopSalesmanGrade.getSealesCommission()/100);
                            if(hasInvitationMan){
                                ShopSalesmanGrade invitationManGrade = shopSalesmanGradeDao.selectById(invitationMan.getSalesmanGrade());
                                invitationAmount+=item.getTotalPrice().doubleValue()*(invitationManGrade.getInvitationCommission()/100);
                            }
                        }else{
                            //按产品设置的推广金额计算
                            salesAmount+=item.getShopSku().getSealesPrice().doubleValue()*item.getCount();
                            if(hasInvitationMan){
                                invitationAmount+=item.getShopSku().getInvitationPrice().doubleValue()*item.getCount();
                            }
                        }
                        orderTotal+=item.getTotalPrice().doubleValue();
                    }
                }
                if(salesAmount>0){
                    //整体的优惠金额折算成折扣,* 佣金
                    zk=order.getOrderMoney().doubleValue()/orderTotal;
                    salesAmount=salesAmount*zk;
                    salesmanOrder.setAmount(salesAmount);
                    shopSalesmanOrderDao.insert(salesmanOrder);
                    if(hasInvitationMan){
                        invitationAmount=invitationAmount*zk;
                        invitationOrder.setAmount(invitationAmount);
                        shopSalesmanOrderDao.insert(invitationOrder);
                    }
                }
            }else{
                LogUtil.debug("重复订单id={}",order.getId());
            }
        }else{
            LogUtil.debug("不存在父级userOpid={}",bizUser.getOpenId());
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanApplyCondition.java
New file
@@ -0,0 +1,35 @@
package com.matrix.system.shopXcx.vo;
import com.matrix.system.shopXcx.bean.ShopProduct;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "SalesmanApplyCondition", description = " 销售员申请条件")
public class SalesmanApplyCondition {
    @ApiModelProperty(value = "是否满足申请条件")
    private Boolean isAbleApply;
    @ApiModelProperty(value = "申请条件")
    private String condition;
    @ApiModelProperty(value = "条件验证结果")
    private String msg;
    @ApiModelProperty(value = "产品信息")
    private List<ShopProduct> productList;
    @ApiModelProperty(value = "最底消费金额")
    private Double minAmount ;
}
zq-erp/src/main/resources/config/db/increment/推广员.sql
@@ -180,3 +180,23 @@
PRIMARY KEY(id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分销订单';
biz_user原来的userId改成了自增长的bigint
ALTER TABLE `shop_sku`
    ADD COLUMN `score_price` decimal(10, 2) NULL COMMENT '积分兑换价格' AFTER `invitation_price`;
ALTER TABLE `shop_product`
    ADD COLUMN `score_category_id` bigint(20) NULL COMMENT '积分商城分类ID' AFTER `company_id`,
ADD COLUMN `able_sales` int(2) NULL COMMENT '是否为分销产品' AFTER `score_category_id`,
ADD COLUMN `mall_type` int(2) NULL COMMENT '上架卖场' AFTER `able_sales`;
update shop_product set mall_type=1;
update shop_product set able_sales=2;
ALTER TABLE `shop_shopping_cart`
    ADD COLUMN `cart_type` int(2) NOT NULL COMMENT '购物车类型 1微商城  2积分商城' AFTER `company_id`;
update shop_shopping_cart set cart_type=1;
zq-erp/src/main/resources/config/system.properties
@@ -100,9 +100,9 @@
#是否启用异常上报
is_open_exception_report=false
showExcptionUrl=http://erp.hive.jyymatrix.cc/showException
showExcptionUrl=http://test.hive.jyymatrix.cc/showException
#异常信息查询接口
showExcptionUrl=http://erp.hive.jyymatrix.cc/showException
showExcptionUrl=http://test.hive.jyymatrix.cc/showException
zq-erp/src/main/resources/config/test/system.properties
@@ -93,9 +93,9 @@
#是否启用异常上报
is_open_exception_report=true
showExcptionUrl=http://erp.hive.jyymatrix.cc/showException
showExcptionUrl=http://test.hive.jyymatrix.cc/showException
#异常信息查询接口
showExcptionUrl=http://erp.hive.jyymatrix.cc/showException
showExcptionUrl=http://test.hive.jyymatrix.cc/showException
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopRevenueFlowDao.xml
@@ -33,7 +33,7 @@
    </resultMap>
    <select id="selectRevenuFlowList" resultType="com.matrix.system.shopXcx.vo.SalesOrderVo">
    <select id="selectRevenuFlowList" resultType="com.matrix.system.fenxiao.entity.ShopRevenueFlow">
        select * from shop_revenue_flow
        where user_id=#{record.userId}
          and DATE_FORMAT(create_time,'%Y-%m')=#{record.queryTime}
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
@@ -66,8 +66,11 @@
        b.nick_name nickname,
        (SELECT s.nick_name FROM biz_user s
        WHERE s.open_id = a.parent_user_id ) parentUser,
        c.nick_name parentUserNow,
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales != 1 ) lowerLevelNum,
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales = 1 ) invitedNum,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
        WHERE user_id = a.user_id AND order_status = 2 AND sales_user_id = a.user_id ) totalRevenue,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
@@ -80,6 +83,7 @@
        shop_salesman_apply a
        LEFT JOIN biz_user b ON a.user_id = b.open_id
        LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id
        LEFT JOIN biz_user c ON c.open_id = b.parent_open_id
        <where>
             a.company_id=#{record.companyId}
            <if test="record.shenheState != null and record.shenheState != ''">
@@ -180,8 +184,8 @@
    ) AS djsRevenue,
    ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} and revenue_type =1 ) AS salesorderCount,
    ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} and revenue_type =2 ) AS invitationOrderCount,
    ( SELECT count( * ) FROM shop_salesman_order c WHERE  c.sales_user_id = #{openId} and revenue_type =1 ) AS salesorderCount,
    ( SELECT count( * ) FROM shop_salesman_order c WHERE  c.sales_user_id = #{openId} and revenue_type =2 ) AS invitationOrderCount,
    (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=1) as invitationCount,
    (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=2) as customerCount
    from biz_user a where
@@ -203,9 +207,9 @@
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales = 1 ) invitedNum,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
        WHERE user_id = a.user_id AND order_status = 2 AND sales_user_id = a.user_id ) totalRevenue,
        WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
        WHERE user_id = a.user_id AND order_status = 1 AND sales_user_id = a.user_id ) balance,
        WHERE order_status = 1 AND sales_user_id = a.user_id ) balance,
        a.create_time createTime,
        a.apply_status applyStatus,
        a.apply_way applyWay
@@ -218,39 +222,35 @@
    <select id="findCustomDetail" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo">
        SELECT
        a.user_id userId,
        b.open_id userId,
        b.avatar_url avatarUrl,
        b.nick_name nickname,
        b.binding_parent_time createTime,
        a.apply_way applyWay,
        (select COUNT(*) from shop_salesman_order c where c.order_status = 1 and c.sales_user_id = a.user_id) doneNum
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON b.parent_open_id = a.user_id
        (select COUNT(*) from shop_salesman_order c where c.order_status = 1 and c.sales_user_id = b.open_id) doneNum
        FROM biz_user b
        <where>
            a.company_id = #{record.companyId}
            b.company_id = #{record.companyId}
            AND b.is_sales != 1
            and b.parent_open_id = #{record.userId}
            and a.apply_status = 2
            <if test="record.userName != null and record.userName != ''">
                and b.nick_name like concat('%',#{record.userName},'%')
            </if>
        </where>
        <if test="record.sort !=null">
            order by
            a.${record.sort} ${record.order}
            b.${record.sort} ${record.order}
        </if>
    </select>
    <select id="findCustomLow" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo">
        SELECT
        a.user_id userId,
        b.open_id userId,
        b.avatar_url avatarUrl,
        b.nick_name nickname,
        b.binding_parent_time createTime,
        a.create_time createTime,
        a.apply_way applyWay
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON b.parent_open_id = a.user_id
        LEFT JOIN biz_user b ON b.open_id = a.user_id
        <where>
            a.company_id = #{record.companyId}
            AND b.is_sales = 1
@@ -277,10 +277,12 @@
        b.avatar_url avatarUrl,
        c.order_no orderNo,
        c.order_money orderMoney,
        (select s.store_name  from shop_store s where s.store_id = c.store_id) storeName
        c.order_status orderState,
        f.shop_name storeName
        from shop_salesman_order a
        left join biz_user b on b.open_id=a.user_id
        left join shop_order c on a.order_id=c.id
        LEFT JOIN sys_shop_info f on f.id = c.store_id
        <where>
            a.sales_user_id = #{record.userId}
            <if test="record.orderType != null and record.orderType != ''">
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml
@@ -21,4 +21,5 @@
    </select>
</mapper>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml
@@ -42,6 +42,10 @@
        <result property="couponId" column="couponId"></result>
        <result property="serviceTime" column="service_time"></result>
        <result property="companyId" column="company_id"/>
        <result property="mallType" column="mall_type"/>
        <result property="ableSales" column="able_sales"/>
        <result property="scoreCategoryId" column="score_category_id"/>
        <association property="shopCoupon" select="com.matrix.system.shopXcx.dao.ShopCouponDao.selectById"
                     column="{id=couponId}"></association>
    </resultMap>
@@ -80,6 +84,9 @@
        <result property="couponId" column="couponId"></result>
        <result property="serviceTime" column="service_time"></result>
        <result property="companyId" column="company_id"/>
        <result property="mallType" column="mall_type"/>
        <result property="ableSales" column="able_sales"/>
        <result property="scoreCategoryId" column="score_category_id"/>
    </resultMap>
    <sql id="columns">
@@ -113,7 +120,11 @@
            is_service,
            service_time,
            shop_ids,
            company_id
            company_id,
        mall_type,
        able_sales,
        score_category_id
    </sql>
    <!-- 属性sql -->
@@ -148,7 +159,11 @@
            #{item.isService},
            #{item.serviceTime},
            #{item.shopIds},
            #{item.companyId}
            #{item.companyId},
            #{item.mallType},
            #{item.ableSales},
            #{item.scoreCategoryId}
    </sql>
    <!-- where sql -->
    <sql id="where_sql">
@@ -237,6 +252,15 @@
                and a.company_id = #{record.companyId}
            </if>
            <if test="record.mallType != null and record.mallType !='' ">
                and a.mall_type = #{record.mallType}
            </if>
            <if test="record.ableSales != null and record.ableSales !='' ">
                and a.able_sales = #{record.ableSales}
            </if>
            <if test="record.scoreCategoryId != null and record.scoreCategoryId ">
                and a.score_category_id = #{record.scoreCategoryId}
            </if>
        </if>
@@ -311,6 +335,17 @@
                and b.attr_full_path like concat('%/',#{record.attrs},'/%')
            </if>
            <if test="record.mallType != null and record.mallType !='' ">
                and a.mall_type = #{record.mallType}
            </if>
            <if test="record.ableSales != null and record.ableSales !='' ">
                and a.able_sales = #{record.ableSales}
            </if>
            <if test="record.scoreCategoryId != null and record.scoreCategoryId ">
                and a.score_category_id = #{record.scoreCategoryId}
            </if>
        </if>
@@ -418,6 +453,16 @@
            <if test="_parameter.containsKey('companyId')">
                company_id = #{companyId},
            </if>
            <if test="_parameter.containsKey('scoreCategoryId')">
                score_category_id = #{scoreCategoryId},
            </if>
            <if test="_parameter.containsKey('ableSales')">
                able_sales = #{ableSales},
            </if>
            <if test="_parameter.containsKey('mallType')">
                mall_type = #{mallType},
            </if>
        </set>
        WHERE id=#{id}
@@ -500,6 +545,15 @@
                shop_ids = #{record.shopIds},
            </if>
            <if test="record.mallType != null and record.mallType !='' ">
                mall_type = #{record.mallType},
            </if>
            <if test="record.ableSales != null and record.ableSales !='' ">
                able_sales = #{record.ableSales},
            </if>
            <if test="record.scoreCategoryId != null and record.scoreCategoryId ">
               score_category_id = #{record.scoreCategoryId},
            </if>
        </set>
        WHERE id=#{record.id}
@@ -588,6 +642,9 @@
        a.marked_price,
        b.attr_full_path,
        a.couponId,
        a.mall_type,
        a.able_sales,
        a.score_category_id,
        (SELECT ROUND(SUM(ss.stock),2) from shop_sku  ss where ss.p_id = a.id) as stockNum,
        GROUP_CONCAT(DISTINCT(s.atrid) order by a.id SEPARATOR ',') atrid
        from shop_product a left join shop_product_attr_ref b on a.id = b.p_id
@@ -628,6 +685,9 @@
        a.marked_price,
        a.service_time,
        a.couponId,
        a.mall_type,
        a.able_sales,
        a.score_category_id,
        (SELECT ROUND(SUM(ss.stock),2) from shop_sku  ss where ss.p_id = a.id) as stockNum
        from shop_product a
        where  a.id in (${productIds}) and shop_ids=#{shopId}
@@ -665,6 +725,9 @@
        a.marked_price,
        b.attr_full_path,
        a.couponId,
        a.mall_type,
        a.able_sales,
        a.score_category_id,
        a.service_time,
        (SELECT ROUND(SUM(ss.stock),2) from shop_sku ss where ss.p_id = a.id) as stockNum,
        GROUP_CONCAT(DISTINCT(s.atrid) order by a.id SEPARATOR ',') atrid
@@ -730,6 +793,9 @@
        b.attr_full_path,
        a.service_time,
        a.couponId,
        a.mall_type,
        a.able_sales,
        a.score_category_id,
        (SELECT ROUND(SUM(s.stock),2) from shop_sku s where s.p_id = a.id) as stockNum,
        (SELECT COUNT(p.com_id) from shop_product_comment p where p.product_id=a.id and p.del_flag=2 and p.com_audit_status=1 and p.com_score=5) as comment
        from shop_product a
@@ -771,6 +837,18 @@
            <if test="(record.shopIds!=null and record.shopIds!='') or  (record.shopIds!='' and record.shopIds==0)  ">
                and find_in_set(#{record.shopIds}, a.shop_ids)
            </if>
            <if test="record.mallType != null and record.mallType !='' ">
                and a.mall_type = #{record.mallType}
            </if>
            <if test="record.ableSales != null and record.ableSales !='' ">
                and a.able_sales = #{record.ableSales}
            </if>
            <if test="record.scoreCategoryId != null and record.scoreCategoryId ">
                and a.score_category_id = #{record.scoreCategoryId}
            </if>
        </where>
        GROUP BY a.id
        <if test="record.queryType != null and record.queryType == 1">
@@ -828,6 +906,9 @@
            is_special_price,
            marked_price,
            couponId,
            a.mall_type,
            a.able_sales,
            a.score_category_id,
            (SELECT SUM(s.stock) from shop_sku  s where s.p_id = a.id) as stockNum,
            (SELECT ROUND(SUM(s.stock),2) from shop_sku  s where s.p_id = a.id) as stockNum,
            shop_ids
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
@@ -27,6 +27,7 @@
            <result property="isSelected" column="isSelected" />
            <result property="shopId" column="shop_id" />
        <result property="companyId" column="company_id" />
        <result property="cartType" column="cart_type" />
    </resultMap>
    
    
@@ -44,6 +45,8 @@
        <result property="isSelected" column="isSelected" />
        <result property="shopId" column="shop_id" />
        <result property="companyId" column="company_id" />
        <result property="cartType" column="cart_type" />
    </resultMap>
    
    <!-- 字段sql -->
@@ -59,7 +62,9 @@
            cart_number,
            isSelected,
            shop_id,
            company_id
            company_id,
        cart_type
    </sql>
    
    <!-- 属性sql -->
@@ -75,7 +80,9 @@
            #{item.cartNumber},
            #{item.isSelected},
            #{item.shopId},
        #{item.companyId}
        #{item.companyId},
        #{item.cartType}
    </sql>
    
    <!-- where sql -->
@@ -121,6 +128,10 @@
             <if test="record.companyId != null and record.companyId !='' ">
                 and c.company_id = #{record.companyId}
             </if>
             <if test="record.cartType != null and record.cartType !='' ">
                 and c.cart_type = #{record.cartType}
             </if>
        </if>
@@ -212,7 +223,7 @@
    <update id="updateAllSelected" >
        update shop_shopping_cart set isSelected  = #{isSelected}  where  shop_id=#{shopId} and cart_user_id=#{openId}
        update shop_shopping_cart set isSelected  = #{isSelected}  where  shop_id=#{shopId} and cart_user_id=#{openId} and cart_type=#{cartType}
    </update>
@@ -334,6 +345,7 @@
            and p.STATUS = 1
            and p.del_flag = 2
            and c.cart_user_id = #{cartUserId}
            and c.cart_type = #{cartType}
        order by c.create_time desc
    </select>
@@ -351,7 +363,7 @@
    <select id="selectUserCartCount" resultType="java.lang.Integer" >
        select sum(cart_number) from shop_shopping_cart  c
LEFT JOIN shop_product p on p.id = c.cart_product_id
where c.shop_Id=#{shopId} and  p.del_flag = 2 and cart_user_id=#{openId};
where c.shop_Id=#{shopId} and  p.del_flag = 2 and cart_user_id=#{openId} and cart_type=#{cartType};
    </select>
    <!-- 根据id 锁表查询-->
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml
@@ -24,6 +24,7 @@
        <result property="shopId" column="shop_id"/>
        <result property="sealesPrice" column="seales_price"/>
        <result property="invitationPrice" column="invitation_price"/>
        <result property="scorePrice" column="score_price"/>
@@ -50,6 +51,7 @@
        <result property="shopId" column="shop_id"/>
        <result property="sealesPrice" column="seales_price"/>
        <result property="invitationPrice" column="invitation_price"/>
        <result property="scorePrice" column="score_price"/>
    </resultMap>
    <!-- 字段sql -->
@@ -72,7 +74,9 @@
            stock_code,
            shop_id,
seales_price,
invitation_price
invitation_price,
        score_price
    </sql>
    <!-- 属性sql -->
@@ -95,7 +99,9 @@
            #{item.stockCode},
            #{item.shopId},
            #{item.sealesPrice},
            #{item.invitationPrice}
            #{item.invitationPrice},
            #{item.scorePrice}
    </sql>
@@ -136,6 +142,13 @@
            <if test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                and shop_id = #{record.shopId}
            </if>
            <if test="(record.scorePrice!=null and record.scorePrice!='') or  (record.scorePrice!='' and record.scorePrice==0)  ">
                and score_price = #{record.scorePrice}
            </if>
        </if>
    </sql>
@@ -202,6 +215,12 @@
            <if test="_parameter.containsKey('sealesPrice')">
                seales_price = #{sealesPrice},
            </if>
            <if test="_parameter.containsKey('scorePrice')">
                score_price = #{scorePrice},
            </if>
        </set>
        WHERE id=#{id}
    </update>
@@ -252,6 +271,10 @@
                invitation_price = #{record.invitationPrice},
            </if>
            <if test="record.scorePrice != null ">
                score_price = #{record.scorePrice},
            </if>
        </set>
        WHERE id=#{record.id}
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html
@@ -41,7 +41,7 @@
        </el-col>
    </el-row>
    <el-row class="table-style"  >
    <el-row class="table-style"  style="margin-left: 50px;">
        <el-table id="proj" :data="table.rows"  :height="height" stripe @sort-change="sortChange">
            <el-table-column
                    label="会员">
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html
@@ -23,39 +23,48 @@
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script>
    <style>
        .panel-body{
            overflow: hidden;
        }
        .paginationStyle{
            background: #ffffff;
            padding: 10px 10px;
            margin: 0px 0px 10px 0px;
            text-align: right;
        }
        .box-card {
            width: 240px;
            border-radius: 5px;
            color: #ffffff;
            padding: 2px 0px;
            margin-right: 20px;
            cursor: pointer;
            float: left;
            text-align: center;
        }
        .el-card__body {
            padding: 0px;
        }
    </style>
</head>
<body>
<div class="ibox-content" id="app" v-cloak>
    <el-row style="padding: 10px;">
        <el-row :gutter="100">
            <el-col class="line" :span="8" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
<div class="panel-body" id="app" v-cloak>
        <el-row>
                <el-card class="box-card" style="background-color: #0f9aef;">
                    <div style="padding:10px;font-size: 20px;">¥{{basicdetail.balance}}</div>
                    <div>待计算金额</div>
                    <div style="padding: 5px;font-size: 30px;">¥{{basicdetail.balance}}</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="8" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                <el-card class="box-card" style="background: #67C23A;">
                    <div style="padding:10px;font-size: 20px;">{{basicdetail.waitNum}}人</div>
                    <div>待结算人数</div>
                    <div style="padding: 5px;font-size: 30px;">{{basicdetail.waitNum}}人</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="8" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                <el-card class="box-card" style="background: rgb(121, 187, 255);">
                    <div style="padding:10px;font-size: 20px;">{{basicdetail.waitOrderNum}}笔</div>
                    <div>待结算订单</div>
                    <div style="padding: 5px;font-size: 30px;">{{basicdetail.waitOrderNum}}笔</div>
                </el-card >
            </el-col>
        </el-row>
    </el-row>
    <el-row>
        <el-tabs v-model="activeName" >
            <el-tab-pane label="分销订单" name="first">
@@ -155,7 +164,8 @@
                        </el-table-column>
                        <el-table-column
                                prop="orderNo"
                                label="订单编号">
                                label="订单编号"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                prop="actualBalance"
@@ -177,15 +187,18 @@
                        </el-table-column>
                        <el-table-column
                                prop="address"
                                label="下单门店">
                                label="下单门店"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                prop="custom"
                                label="客户">
                                label="客户"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                prop="parentSale"
                                label="推广员">
                                label="推广员"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                label="收益类型">
@@ -208,15 +221,19 @@
                        </el-table-column>
                        <el-table-column
                                prop="settleNo"
                                label="结算编号" width="150">
                                label="结算编号"
                                show-overflow-tooltip
                                width="150">
                        </el-table-column>
                        <el-table-column
                                prop="settleTime"
                                label="结算时间">
                                label="结算时间"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                prop="settler"
                                label="结算人">
                                label="结算人"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column label="操作">
                        </el-table-column>
@@ -262,7 +279,8 @@
                    <el-table :data="orderLevelList.rows"  :height="height" stripe:true  @sort-change="sortChange">
                        <el-table-column
                                prop="orderNo"
                                label="结算编号">
                                label="结算编号"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                prop="actualBalance"
@@ -278,11 +296,13 @@
                        </el-table-column>
                        <el-table-column
                                prop="setTime"
                                label="结算时间">
                                label="结算时间"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                prop="setMan"
                                label="结算人">
                                label="结算人"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                label="结算方式">
@@ -293,7 +313,8 @@
                        </el-table-column>
                        <el-table-column
                                prop="remark"
                                label="备注">
                                label="备注"
                                show-overflow-tooltip>
                        </el-table-column>
                    </el-table>
                </el-row>
@@ -332,7 +353,7 @@
        el: '#app',
        data: {
            activeName: 'first',
            height:'calc(100vh - 240px)',
            height:'calc(100vh - 340px)',
            //--基本数据
            basicdetail:{},
            //--时间选择
@@ -374,7 +395,7 @@
                jsje: '',
                jsdds: '',
                jsrs: '',
                jsfs: 1,
                jsfs: 2,
                bz: ''
            },
            formLabelWidth: '120px',
@@ -468,6 +489,7 @@
                    callback: function (data) {
                        _this.orderLevelList.rows = data.rows;
                        _this.orderLevelList.total = data.total;
                        _this.loadFenxiaoOrderBasic();
                    }
                });
            },
@@ -518,6 +540,7 @@
                    callback: function (data) {
                        _this.fxyList.rows = data.rows;
                        _this.fxyList.total = data.total;
                        _this.loadFenxiaoOrderBasic();
                    }
                });
            },
@@ -586,7 +609,8 @@
                    let order = _this.multipleSelection[i];
                    //待审核的计算到弹出框
                    let orderState = order.orderState;
                    if(orderState == 4 || orderState == 5){
                    let settleType = order.settleType;
                    if((orderState == 4 || orderState == 5) && settleType == 1){
                        let orderId = order.id;
                        name.push(order.customUserId);
                        orderNum = orderNum + 1;
@@ -624,7 +648,7 @@
            setOrderDone() {
                if(this.orderNumsDones > 0){
                    this.$message({
                        message: '订单状态【待评价】和【已评价】才允许结算',
                        message: '【待评价】和【已评价】状态下的【待结算】订单,才允许结算',
                        type: 'warning'
                    });
                }else if(this.orderNums > 0){
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-setting.html
@@ -19,7 +19,7 @@
<div class="ibox-content" id="app" v-cloak>
    <el-form label-width="120px" >
        <el-row>
            <p class="el-big-title">分享设置</p>
            <p class="el-big-title">分销设置</p>
        </el-row>
        <el-row style="margin-top: 20px;">
            <el-col>
@@ -100,7 +100,7 @@
            </el-col>
        </el-row>
        <el-row v-show="isShow" style="margin-top: 20px;">
        <el-row style="margin-top: 20px;">
            <el-col>
                <template v-for="paramSettingFour in shfs">
                    <el-form-item>
@@ -118,12 +118,12 @@
        <el-drawer
                title="业绩设置"
                title="分销产品"
                :visible.sync="drawer"
                :direction="direction"
                size="90%"
        >
            <el-row >
            <el-row style="margin-left: 50px;">
                <el-col :span="24">
                    <el-row class="vertical  ">
                        <el-input class="searchInput" @input="searchGoods()" v-model="queryKey"
@@ -149,28 +149,32 @@
                                    width="50">
                            </el-table-column>
                            <el-table-column
                                    prop="code"
                                    label="产品编号"
                                    width="100">
                                    prop="id"
                                    label="ID">
                            </el-table-column>
                            <el-table-column
                                    prop="name"
                                    prop="title"
                                    label="产品名称">
                            </el-table-column>
                            <el-table-column
                                    prop="sealPice"
                                    label="售价">
                                    prop="price"
                                    label="价格">
                            </el-table-column>
                            <el-table-column
                                    prop="goodType"
                                    label="类型">
                                    prop="score"
                                    label="积分">
                            </el-table-column>
                            <el-table-column
                                    prop="cateName"
                                    label="分类">
                                    prop="attrValues"
                                    label="产品属性">
                            </el-table-column>
                            <el-table-column
                                    label="是否上架">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.status == 1">是</span>
                                    <span v-if="scope.row.status == 2">否</span>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    width="150"
@@ -195,37 +199,36 @@
                                :stripe="true"
                                :border="true"
                                :height="tableHeight"
                                :data="order.items"
                                :data="order"
                                style="width: 100%">
                            <el-table-column
                                    type="index"
                                    width="50">
                            </el-table-column>
                            <el-table-column
                                    prop="shoppingGoods.code"
                                    label="产品编号"
                                    width="100">
                                    prop="id"
                                    width="280"
                                    label="产品ID">
                            </el-table-column>
                            <el-table-column
                                    prop="shoppingGoods.name"
                                    prop="title"
                                    width="280"
                                    label="产品名称">
                            </el-table-column>
                            <el-table-column
                                    prop="shoppingGoods.goodType"
                                    prop="attrValues"
                                    width="80"
                                    label="产品类型">
                                    label="产品属性">
                            </el-table-column>
                            <el-table-column
                                    prop="shoppingGoods.sealPice"
                                    prop="price"
                                    label="单价">
                            </el-table-column>
                            <el-table-column
                                    prop="address"
                                    label="操作">
                                <template slot-scope="scope">
                                    <el-button type="primary" v-if="order.statu!='欠款'"
                                    <el-button type="primary"
                                               size="mini"
                                               @click="removeItem(scope.$index, scope.row)">删除
                                    </el-button>
@@ -265,10 +268,7 @@
            //业绩设置框
            drawer: false,
            direction: 'rtl',
            order: {
                items: [
                ],
            },
            order: [],
            tableHeight: 500,
            /*****搜索表格数据*********/
            //搜索关键词
@@ -325,8 +325,7 @@
                        }
                        _this.shfs = data.mapInfo.shfs;
                        _this.sqtj = data.mapInfo.sqtj;
                        //_this.order.items = data.mapInfo.order;
                        //console.log(_this.order.items);
                        _this.order = data.mapInfo.order;
                    }
                });
            },
@@ -342,19 +341,19 @@
                //判断是否被选中
                let selected = false;
                this.order.items.forEach(item => {
                    if (item.shoppingGoods.id == goods.id) {
                for(let i = 0; i < this.order.length; i++){
                    if (this.order[i].id === goods.id) {
                        selected = true;
                        return;
                    }
                });
                }
                if (!selected) {
                    //未选中产品加入列表
                    let item = {};
                    item.shoppingGoods = goods;
                    item.ShopProduct = goods;
                    item.goodsId = goods.id;
                    item.count = 1;
                    this.order.items.push(item);
                    this.order.push(item.ShopProduct);
                }
            },
@@ -372,38 +371,33 @@
            submitOrder(submitType) {
                let _this = this;
                let submitDate ="";
                for (let i = 0; i < _this.order.items.length; i++) {
                    let goods = _this.order.items[i];
                    let goodsId = goods.goodsId;
                for (let i = 0; i < _this.order.length; i++) {
                    let ShopProduct = _this.order[i];
                    let goodsId = ShopProduct.id;
                    submitDate = submitDate +goodsId+",";
                }
                _this.cpid = submitDate;
                _this.drawer = false
                _this.drawer = false;
            },
            /**
             * 批量选择产品
             */
            chouseGoods() {
                let _this = this;
                // this.multipleSelection.forEach(item => {
                //     _this.pushToSelectGoods(item, BUY_TYPE_NOT_FREE);
                // });
                this.closeXm();
            },
            /**
             * 行点击事件
             */
            handleClickTableRow(row, event, column) {
                this.$refs.dataTable.toggleRowSelection(row);
                this.pushToSelectGoods(row);
            },
            /**
             * 删除组合产品
             */
            removeItem(index, row) {
                this.order.items.splice(index, 1);
                this.order.splice(index, 1);
            },
            /**
             * 搜索项目绑定的产品信息
             */
@@ -417,7 +411,7 @@
                        contentType: 'application/x-www-form-urlencoded',
                        //TODO 优化下拉加载
                        data: {name: _this.queryKey, limit: 10000},
                        url: basePath + "/admin/shoppinggoods/showList",
                        url: basePath + "/fenXiao/ruleSetting/selectProduct",
                        callback: function (data) {
                            _this.searchTableData = data.rows;
                            _this.loading = false;
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html
@@ -31,43 +31,57 @@
        }
        .el-aside {
            color: #333;
            line-height: 50px;
            line-height: 15px;
        }
        .el-main {
            color: #333;
            line-height: 50px;
            line-height: 15px;
        }
        .box-card {
            width: 160px;
            border-radius: 5px;
            color: #ffffff;
            padding: 5px 5px;
            margin-right: 20px;
            cursor: pointer;
            float: right;
        }
        .el-card__body {
            padding: 0px;
        }
    </style>
</head>
<body>
<div class="ibox-content" id="app" v-cloak>
    <el-row>
        <p class="el-big-title">个人详情</p>
    </el-row>
    <el-container>
        <el-aside width="200px" style="display:flex;align-items: center;">
            <el-avatar :size="100" :src="basicdetail.avatarUrl" style="display:flex;align-items: center;margin-left: 50px"></el-avatar>
        <el-aside width="60px" style="display:flex;align-items: center;">
            <el-avatar :size="50" :src="basicdetail.avatarUrl" style="display:flex;align-items: center;margin-left: 10px"></el-avatar>
        </el-aside>
        <el-main>
            <el-row style="display:flex;align-items: center;">
                <el-col :span="3" style="display:flex;align-items: center;">
            <el-row style="display:flex;align-items: center;padding: 10px;">
                <el-col :span="8" style="display:flex;align-items: center;">
                    <span style="font-size: 20px;">{{basicdetail.nickname}} </span>
                </el-col>
                <el-col :span="3">
                <el-col :span="6">
                    <el-select v-model="basicdetail.grade" @focus="getDatalist()" @change="changeSaleManGrade(basicdetail.grade)" placeholder="请选择" filterable allow-create>
                        <el-option v-for="item in salemanGradeList " :key="item.id" :label="item.name" :value="item.id"></el-option>
                    </el-select>
                </el-col>
                <el-col :span="18">
                <el-col :span="10">
                </el-col>
            </el-row>
            <el-row style="display:flex;">
            <el-row style="display:flex;padding: 5px;">
                <el-col>
                    <span>
                        手机号码:{{basicdetail.phone}}   |
                        加入时间:{{basicdetail.createTime}}   |
                        加入时间:{{basicdetail.createTime}}
                    </span>
                </el-col>
            </el-row>
            <el-row style="display:flex;padding: 5px;">
                <el-col>
                    <span>
                        邀请人:{{basicdetail.parentUser}}   |
                        来源:
                            <span v-if="basicdetail.applyWay == 1">自主申请</span>
@@ -82,38 +96,33 @@
                </el-col>
            </el-row>
        </el-main>
        <el-main>
            <el-row>
                <el-row style="display:flex;align-items: center;text-align: center;">
                    <el-card class="box-card" style="background-color: #0f9aef;">
                        <div style="padding:10px;font-size: 20px;">{{basicdetail.lowerLevelNum}}人</div>
                        <div>绑定客户</div>
                    </el-card >
                    <el-card class="box-card" style="background: #67C23A;">
                        <div style="padding:10px;font-size: 20px;">{{basicdetail.invitedNum}}人</div>
                        <div>邀请下级</div>
                    </el-card >
                    <el-card class="box-card" style="background: rgb(121, 187, 255);">
                        <div style="padding:10px;font-size: 20px;">{{basicdetail.totalRevenue}}元</div>
                        <div>累计收益</div>
                    </el-card >
                    <el-card class="box-card" style="background: rgb(93 191 45);">
                        <div style="padding:10px;font-size: 20px;">{{basicdetail.balance}}元</div>
                        <div>待结算</div>
                    </el-card >
                </el-row>
            </el-row>
        </el-main>
    </el-container>
    <el-row style="padding: 30px;">
        <el-row :gutter="100">
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>绑定客户</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.lowerLevelNum}}人</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>邀请下级</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.invitedNum}}人</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>累计收益</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.totalRevenue}}元</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>待结算</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.balance}}元</div>
                </el-card >
            </el-col>
        </el-row>
    </el-row>
    <el-row>
        <el-tabs v-model="activeName" >
            <el-tab-pane label="分销员管理" name="first">
            <el-tab-pane label="绑定客户" name="first">
                <el-row style="display:flex;align-items: center;text-align: right;">
                    <el-col>
                        <el-form ref="form" :model="form" inline >
@@ -132,24 +141,17 @@
                                type="selection">
                        </el-table-column>
                        <el-table-column
                                label="客户">
                                label="客户"
                                show-overflow-tooltip>
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                {{scope.row.nickName}}
                                {{scope.row.nickname}}
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="createTime"
                                label="绑定时间">
                        </el-table-column>
                        <el-table-column
                                label="绑定方式">
                            <template slot-scope="scope">
                                <span v-if="scope.row.applyWay == 1">自主申请</span>
                                <span v-if="scope.row.applyWay == 2">自动添加</span>
                                <span v-if="scope.row.applyWay == 3">上级邀请</span>
                                <span v-if="scope.row.applyWay == 4">手动添加</span>
                            </template>
                                label="绑定时间"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                label="客户状态">
@@ -161,7 +163,7 @@
                        <el-table-column label="操作" width="240">
                            <template slot-scope="scope">
                                <el-row style="display:flex;">
                                    <el-button type="primary" size="mini" @click="openExaminesaleMan(scope.row)">解绑</el-button>
                                    <el-button type="primary" size="mini" @click="openExamineSaleMan(scope.row)">解绑</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
@@ -202,7 +204,7 @@
                                label="客户">
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                {{scope.row.nickName}}
                                {{scope.row.nickname}}
                            </template>
                        </el-table-column>
                        <el-table-column
@@ -221,7 +223,7 @@
                        <el-table-column label="操作" width="240">
                            <template slot-scope="scope">
                                <el-row style="display:flex;">
                                    <el-button type="primary" size="mini" @click="openExaminesaleMan(scope.row)">解绑</el-button>
                                    <el-button type="primary" size="mini" @click="openExamineSaleMan(scope.row)">解绑</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
@@ -267,18 +269,35 @@
                    <el-table id="proj" :data="orderLevelList.rows"  :height="height" stripe:true  @sort-change="sortChange">
                        <el-table-column
                                prop="orderNo"
                                label="订单编号">
                                label="订单编号"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                prop="orderMoney"
                                label="实付金额">
                        </el-table-column>
                        <el-table-column
                                prop="storeName"
                                label="下单门店">
                                label="订单状态">
                            <template slot-scope="scope">
                                <span v-if="scope.row.orderState == 1">待付款</span>
                                <span v-if="scope.row.orderState == 2">待配送</span>
                                <span v-if="scope.row.orderState == 3">待收货</span>
                                <span v-if="scope.row.orderState == 4">待评价</span>
                                <span v-if="scope.row.orderState == 5">已评价</span>
                                <span v-if="scope.row.orderState == 6">申请退款</span>
                                <span v-if="scope.row.orderState == 7">退款成功</span>
                                <span v-if="scope.row.orderState == 8">退款拒绝</span>
                                <span v-if="scope.row.orderState == 9">已取消</span>
                            </template>
                        </el-table-column>
                        <el-table-column
                                label="客户">
                                prop="storeName"
                                label="下单门店"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                label="客户"
                                show-overflow-tooltip>
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                {{scope.row.nickName}}
@@ -286,7 +305,8 @@
                        </el-table-column>
                        <el-table-column
                                prop="createTime"
                                label="时间">
                                label="时间"
                                show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column
                                label="收益类型">
@@ -390,7 +410,7 @@
                pageSize:10,
                currentPage:1,
            },
            height:'calc(100vh - 240px)',
            height:'calc(100vh - 400px)',
        },
        created: function () {
@@ -402,6 +422,7 @@
            //加载分类
            loadInfo() {
                let _this = this;
                _this.loadParamSettingBasic();
                _this.loadParamSetting();
                _this.loadParamSettinglow();
                _this.loadParamSettingOrder();
@@ -424,6 +445,22 @@
                    }
                });
            },
            //加载基本数据信息
            loadParamSettingBasic() {
                let _this = this;
                let data={
                    userId:userId,
                    applyId:applyId,
                };
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/loadParamSettingBasic',
                    callback: function (data) {
                        _this.basicdetail = data.mapInfo.basicdetail;
                    }
                });
            },
            //绑定客户
            loadParamSetting() {
                let _this = this;
@@ -433,11 +470,11 @@
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanDetail',
                    url: basePath + '/fenXiao/fenXiaoUser/loadParamSetting',
                    callback: function (data) {
                        _this.basicdetail = data.mapInfo.basicdetail;
                        _this.fxyList.rows = data.mapInfo.customDetailRecords;
                        _this.fxyList.total = data.mapInfo.customDetailTotal;
                        _this.loadParamSettingBasic();
                    }
                });
            },
@@ -478,11 +515,11 @@
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanDetail',
                    url: basePath + '/fenXiao/fenXiaoUser/loadParamSettinglow',
                    callback: function (data) {
                        _this.basicdetail = data.mapInfo.basicdetail;
                        _this.lowLevelList.rows = data.mapInfo.customLowRecords;
                        _this.lowLevelList.total = data.mapInfo.customLowTotal;
                        _this.loadParamSettingBasic();
                    }
                });
            },
@@ -524,10 +561,11 @@
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanDetail',
                    url: basePath + '/fenXiao/fenXiaoUser/loadParamSettingOrder',
                    callback: function (data) {
                        _this.orderLevelList.rows = data.mapInfo.orderRecords;
                        _this.orderLevelList.total = data.mapInfo.orderTotal;
                        _this.loadParamSettingBasic();
                    }
                });
            },
@@ -617,7 +655,12 @@
                    url: basePath + '/fenXiao/fenXiaoUser/unbundlingSaleMan',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        this.loadInfo();
                        if(_this.activeName == "first"){
                            _this.loadParamSetting();
                        }
                        if(_this.activeName == "second"){
                            _this.loadParamSettinglow();
                        }
                    }
                });
            },
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
@@ -23,6 +23,9 @@
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script>
    <style>
        .panel-body{
            overflow: hidden;
        }
        .paginationStyle{
            background: #ffffff;
            padding: 10px 10px;
@@ -56,7 +59,7 @@
</head>
<body>
<div class="ibox-content" id="app" v-cloak>
<div class="panel-body" id="app" v-cloak>
        <el-row>
            <el-tabs v-model="activeName" >
                <el-tab-pane label="分销员管理" name="first">
@@ -99,19 +102,25 @@
                                        type="selection">
                                </el-table-column>
                                <el-table-column
                                        label="分销员" width="120">
                                        label="分销员"
                                        show-overflow-tooltip
                                        width="150">
                                    <template slot-scope="scope">
                                        <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                        {{scope.row.nickname}}
                                    </template>
                                </el-table-column>
                                <el-table-column
                                        prop="parentUser"
                                        label="邀请人">
                                        prop="parentUserNow"
                                        label="当前上级">
                                </el-table-column>
                                <el-table-column
                                        prop="lowerLevelNum"
                                        label="下级客户数">
                                        label="推广客户">
                                </el-table-column>
                                <el-table-column
                                        prop="invitedNum"
                                        label="邀请下级">
                                </el-table-column>
                                <el-table-column
                                        prop="totalRevenue"
@@ -128,6 +137,7 @@
                                <el-table-column
                                        prop="createTime"
                                        label="加入时间"
                                        show-overflow-tooltip
                                        :formatter="formatDate">
                                </el-table-column>
                                <el-table-column
@@ -138,6 +148,10 @@
                                        <span v-if="scope.row.applyStatus == 3">未通过</span>
                                        <span v-if="scope.row.applyStatus == 4">系统删除</span>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                        prop="parentUser"
                                        label="注册邀请人">
                                </el-table-column>
                                <el-table-column
                                        label="来源">
@@ -154,7 +168,7 @@
                                            <el-button type="primary" v-if="scope.row.applyStatus == 1" size="mini" @click="openExamineSaleManApply(scope.row)">审核</el-button>
                                            <el-button type="primary" v-if="scope.row.applyStatus == 2" size="mini" @click="openUpdateSaleManGrade(scope.row)">修改等级</el-button>
                                            <el-button type="primary" size="mini" @click="openUpdateSaleManGrade(scope.row)">详情</el-button>
                                            <el-button type="primary" v-if="scope.row.applyStatus == 2" size="mini" @click="delSaleManGradeApply(scope.row)">删除</el-button>
                                            <el-button type="danger" v-if="scope.row.applyStatus == 2" size="mini" @click="delSaleManGradeApply(scope.row)">删除</el-button>
                                        </el-row>
                                    </template>
                                </el-table-column>
@@ -207,9 +221,9 @@
                            <el-table-column label="操作" width="240">
                                <template slot-scope="scope">
                                    <el-row style="display:flex;">
                                        <el-button type="primary" v-if="scope.row.isDefault == 1" size="mini" @click="addFyfa()">新增</el-button>
                                        <el-button type="primary" v-if="scope.row.isDefault == 1" size="mini" @click="addFyfaReady()">新增</el-button>
                                        <el-button type="primary" size="mini" @click="updateFyfa(scope.row)">保存</el-button>
                                        <el-button type="primary" v-if="scope.row.isDefault == 2" size="mini" @click="delFyfa(scope.row)">删除</el-button>
                                        <el-button type="danger" v-if="scope.row.isDefault == 2" size="mini" @click="delFyfa(scope.row)">删除</el-button>
                                    </el-row>
                                </template>
                            </el-table-column>
@@ -438,18 +452,23 @@
                this.loadFyfaSetting();
            },
            //新增
            addFyfa(){
            addFyfaReady(){
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data:[],
                    url: basePath + '/fenXiao/fenXiaoUser/addFyfa',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        _this.loadFyfaSetting();
                    }
                });
                let fyfaReady = {};
                _this.fyfaList.rows.push(fyfaReady);
            },
            // addFyfa(){
            //     let _this = this;
            //     AjaxProxy.requst({
            //         app: _this,
            //         data:[],
            //         url: basePath + '/fenXiao/fenXiaoUser/addFyfa',
            //         callback: function (data) {
            //             _this.$message.success(data.info);
            //             _this.loadFyfaSetting();
            //         }
            //     });
            // },
            updateFyfa(row){
                let _this = this;
                let id = row.id;
@@ -485,7 +504,7 @@
                }).then(() => {
                    //通过
                    _this.delFyfaApply(row);
                    _this.loadFyfaSetting();
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
@@ -509,6 +528,7 @@
                    url: basePath + '/fenXiao/fenXiaoUser/delFyfaApply',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        _this.loadFyfaSetting();
                    }
                });
            },
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
@@ -108,7 +108,8 @@
                        </el-col>
                        <el-col :span="14" style="text-align: right;">
                            <label>¥ {{order.total}}</label>
                            <label>¥ {{(order.zkTotal - order.total).toFixed(2)}}</label>
                            <!-- 退款订单不能显示为负数 -->
                            <label>¥ {{(order.zkTotal - order.total>0?order.zkTotal - order.total:0).toFixed(2)}}</label>
                            <label>¥ {{order.zkTotal}}</label>
                            <label>¥ {{order.arrears}}</label>
                            <label>¥ {{order.repay}}</label>
@@ -256,11 +257,15 @@
                                        label="收款">
                                </el-table-column>
                                <el-table-column
                                        prop="t3"
                                        prop="payMethod"
                                        label="支付方式">
                                </el-table-column>
                                <el-table-column
                                        prop="achieveType"
                                        label="业绩类型">
                                </el-table-column>
                                <el-table-column
                                        prop="t1"
                                        prop="goodsCash"
                                        label="原业绩">
                                </el-table-column>
                                <el-table-column
@@ -544,7 +549,16 @@
        created : function() {
            let _this = this;
            this.orderParam = /*[[${orderParam}]]*/
                this.queryOrderDetailData(this.orderParam);
            var orderId = /*[[${orderId}]]*/
            var orderNo = /*[[${orderNo}]]*/
            var param = {};
            if(orderId) {
                param.id = orderId;
            } else {
                param.orderNo = orderNo;
            }
            this.queryOrderDetailData(param);
            // 业绩类型
            AjaxProxy.requst({
                app: _this,
@@ -570,7 +584,7 @@
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data: {id: param, orderNo:param},
                    data: param,
                    contentType: 'application/x-www-form-urlencoded',
                    url: basePath + '/admin/order/findOrderDetailByIdOrNo',
                    callback: function (data) {
@@ -664,6 +678,10 @@
                }
                _this.data.items = dataItems;
                _this.data.zkTotal =  _this.refundMoney;
                _this.data.total =  _this.total;
                AjaxProxy.requst({
                    app: _this,
                    data: _this.data,
@@ -717,6 +735,7 @@
                let _this = this;
                let items = this.orderItems;
                _this.refundMoney = 0;
                _this.total = 0;
                for(var i = 0; i < items.length; i++) {
                    let item = items[i]
@@ -732,6 +751,8 @@
                        }
                        _this.refundMoney += parseFloat(item.refundPrice * item.refundCount);
                        //记录一下未优惠之前的价格
                        _this.total += parseFloat(item.price * item.refundCount);
                    }
                }
@@ -742,7 +763,7 @@
                _this.dialogSettleVisible = true;
            },
            calOrderTotalFormatter(row, column) {
                return row.count * row.price;
                return row.count * row.zkPrice;
            },
            getVipMoneyCards() {
                let _this = this;
@@ -915,14 +936,14 @@
                        if(jsqMap[key]>achieve.zkTotal) {
                            this.$message.error("【"+achieve.goodsName + "】业绩分配金额大于支付金额");
                            isOk = false;
                            return;
                            break;
                        }
                    }else{
                        this.$message.error("【"+achieve.goodsName + "】业绩分配金额请填写数字");
                        isOk=false;
                        return;
                        break;
                    }
                };
                }
                console.log("isOk",isOk);
                return isOk;
            },
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html
@@ -11,219 +11,273 @@
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
        th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
<link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" th:src="@{/js/function/public.js}"></script>
</head>
<body class="gray-bg">
<style>
    .table-style {
        margin: 20px 0;
        padding: 20px 10px;
        border: 1px solid #DCDFE6;
        background-color: white;
    }
    .search-form {
        background-color: white;
        padding-top: 10px;
        padding-left: 20px;
        padding-bottom: 10px;
    }
</style>
<body>
<div id="app" style="">
    <el-row class="search-form">
        <el-form ref="form" :model="form" inline>
            <el-form-item label="选择年月">
                <el-select v-model="form.year" style="width:120px;" placeholder="请选择">
                    <el-option v-for="item in years"
                               :key="item"
                               :label="item"
                               :value="item"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.month" style="width:120px;" placeholder="请选择">
                    <el-option v-for="item in months"
                               :key="item"
                               :label="item"
                               :value="item"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.day" style="width:120px;" placeholder="请选择">
                    <el-option v-for="item in days"
                               :key="item"
                               :label="item"
                               :value="item"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="日期范围">
                <el-date-picker v-model="form.timeRange"
                                type="datetimerange"
                                range-separator="至"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
    <div class="ibox-content">
        <!-- 搜索框部分start -->
        <form class="form-inline" id="serchform">
        <div class="row mb-10">
                <div class="col-sm-8">
                    <button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button>
                    <button  onclick="myGrid.resetForm()" type="button"   class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button>
                    <button  matrix:btn="ygyjbb-exportExcel"  onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>
                </div>
            </div>
            <div class="form-group mr-20">
                <label >选择年月</label> <select
                    class="form-control" name="year" id="select_year">
                    <option value="">年份</option>
                    <option value="2010">2010</option>
                    <option value="2011">2011</option>
                    <option value="2012">2012</option>
                    <option value="2013">2013</option>
                    <option value="2014">2014</option>
                    <option value="2015">2015</option>
                    <option value="2016">2016</option>
                    <option value="2017">2017</option>
                    <option value="2018">2018</option>
                    <option value="2019">2019</option>
                    <option value="2020">2020</option>
                    <option value="2021">2021</option>
                </select> <select class="form-control" name="month" id="select_month">
                    <option value="01">1</option>
                    <option value="02">2</option>
                    <option value="03">3</option>
                    <option value="04">4</option>
                    <option value="05">5</option>
                    <option value="06">6</option>
                    <option value="07">7</option>
                    <option value="08">8</option>
                    <option value="09">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                </select>
                <select class="form-control" name="day" id="select_day">
                 <option value="">日</option>
                <th:block th:each="i:${#numbers.sequence(1, 31)}"   >
                    <option th:value="${i }" th:text="${i }"></option>
                </th:block>
                </select>
            </div>
            <div class="form-group mr-20">
                <label>日期范围</label>
                <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">-
                <input name="endTime"  type="text" class="form-control datetimepicker" id="endTime">
            </div>
            <el-form-item label="会员">
                <el-input v-model="form.vipQueryKey"></el-input>
            </el-form-item>
            <div class="form-group mr-20">
                <label>会员</label>
                <input autocomplete="off" placeholder="姓名/编号/电话"  name="vipQueryKey" type="text" class="form-control"  >
            </div>
            <el-form-item label="业绩归属人">
                <el-select v-model="form.beaultId" placeholder="请选择">
                    <el-option v-for="item in achieveUsers"
                               :key="item.suId"
                               :label="item.suName"
                               :value="item.suId"></el-option>
                </el-select>
            </el-form-item>
            <div class="form-group mr-20">
                <label>美疗师</label>
                <select class="form-control autoFull select2"
                        th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}"
                        data-value="suId"
                        data-filed="suName"
                        name="beaultId"
                        id="beaultId">
                    <option value="">--请选择美容师--</option>
                </select>
            </div>
            <el-form-item label="门店">
                <el-select v-model="form.shopId" placeholder="请选择所属门店">
                    <el-option v-for="item in shopList"
                            :key="item.id"
                            :label="item.shopName"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <div class="form-group mr-20">
                <label>门店</label>
                <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId"
                        th:data-url="@{/admin/shopInfo/findAllWithPermi}">
                    <option value=''>--请选择部所属门店--</option>
                </select>
            </div>
        </form>
            <el-button type="primary" @click="search" >搜索</el-button>
            <el-button @click="resetForm('form')">重置</el-button>
            <el-button type="warning" @click="exportExcel">导出</el-button>
        </el-form>
        <table id="mgrid">
            <thead>
                <tr>
                    <th data-formatter="MGrid.indexfn" data-align="center"
                        data-width="30px" data-footer-formatter="footCountTitle">序号</th>
                    <th data-field="datatime">时间</th>
                    <th data-field="orderNo" data-formatter="buildOpenDetail" >订单编号</th>
                    <th data-field="orderType">订单类型</th>
                    <th data-field="vipName">会员姓名</th>
                    <th data-field="proName">产品</th>
                    <th data-field="cateName">产品分类</th>
                    <th data-field="zkTotal" data-footer-formatter="countColumn">订单金额</th>
                    <th data-field="goodsCash" data-footer-formatter="countColumn">订单业绩</th>
                    <th data-field="payMethod">收款方式</th>
                    <th data-field="achieveType">业绩类型</th>
                    <th data-field="guwen">顾问</th>
                    <th data-field="meiliao">美疗师</th>
                    <th data-field="hisConsume" data-footer-formatter="countColumn">本金消耗
                        <i data-toggle="tooltip" data-placement="top" title="消耗金额:客户做服务时划扣的本金" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="freeConsume" data-footer-formatter="countColumn">赠送消耗
                        <i data-toggle="tooltip" data-placement="top" title="赠送消耗:客户做服务时划扣的赠送金额" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="projPercentage" data-footer-formatter="countColumn">服务提成
                        <i data-toggle="tooltip" data-placement="top" title="服务提成:为美疗师手动设置的项目服务提成" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="numberOfPeople" data-footer-formatter="countColumn">人头</th>
                    <th data-field="projNum" data-footer-formatter="countColumn">项目个数</th>
                    <th data-field="projTime" data-footer-formatter="countColumn">项目时间</th>
                    <th data-field="shopName">门店</th>
                </tr>
            </thead>
        </table>
    </div>
    <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
    <script type="text/javascript" th:src="@{/js/function/public.js}"></script>
    <script type="text/javascript">
        var myGrid;
        var initParam = {
                format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss"
                minView: "hour",     //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour"
    </el-row>
    <el-row class="table-style">
        <el-table :data="tableData" style="width: 100%">
            <el-table-column type="index" width="30"></el-table-column>
            <el-table-column prop="datatime" width="150" label="时间"></el-table-column>
            <el-table-column prop="orderNo" width="180" label="订单编号">
                <template slot-scope="scope">
                    <el-link @click="jumpOrder(scope.row.orderType, scope.row.orderNo)" type="primary">{{scope.row.orderNo}}</el-link>
                </template>
            </el-table-column>
            <el-table-column prop="orderType" label="订单类型"></el-table-column>
            <el-table-column prop="vipName" label="会员姓名"></el-table-column>
            <el-table-column prop="proName" label="产品" width="200"></el-table-column>
            <el-table-column prop="cateName" label="产品分类"></el-table-column>
            <el-table-column prop="zkTotal" label="订单金额"></el-table-column>
<!--            <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>-->
            <el-table-column prop="meiliao" label="员工"></el-table-column>
            <el-table-column v-for="(item, index) in customColumns" width="120" :key="index" :label="item.value">
                <template slot-scope="scope">
                    <span v-if="item.value == scope.row.achieveType">{{scope.row.goodsCash}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="hisConsume" label="本金消耗"></el-table-column>
            <el-table-column prop="freeConsume" label="赠送消耗"></el-table-column>
            <el-table-column prop="projPercentage" label="服务提成"></el-table-column>
            <el-table-column prop="numberOfPeople" label="人头"></el-table-column>
            <el-table-column prop="projNum" label="项目个数"></el-table-column>
            <el-table-column prop="projTime" label="服务时间"></el-table-column>
            <el-table-column prop="guwen" label="操作人"></el-table-column>
            <el-table-column prop="shopName" label="门店"></el-table-column>
        </el-table>
        <el-row style="margin-top: 10px;">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="page.currentPage"
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="page.size"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="page.total">
            </el-pagination>
        </el-row>
    </el-row>
</div>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript" th:inline="javascript">
    var vue = new Vue({
        el : "#app",
        data : {
            tableData : [],
            customColumns : [],
            shopList : [],
            achieveUsers : [],
            years : [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021],
            months : ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
            days : [],
            form : {
                year : '',
                month : '',
                day : '',
                timeRange : '',
                vipQueryKey : '',
                beaultId : '',
                shopId : ''
            },
            page : {
                currentPage : 1,
                size : 10,
                total : 0
            }
         MTools.ininDatetimepicker(initParam);
        //限制结束时间不小于开始时间
         MTools.limitStartEndTime({});
        var date = new Date();
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var year_options = "";
        for (var i = 9; i > 0; i--) {
            year_options += "<option value='" + (year - i) + "'>" + (year - i)
                    + "</option>";
        }
        year_options += "<option value='"+year+"' selected='selected'>" + year
                + "</option>";
        $("#select_year").html(year_options);
        $("#select_month").find("option").each(function(row) {
            var option_month = $(this).val();
            if (month == option_month) {
                $(this).attr("selected", true);
            }
        });
        },
        created : function() {
            this.initDays();
            this.queryCustomColumns();
            this.queryShops();
            this.queryAchieveUsers();
        },
        methods : {
            queryTableData () {
                let _this = this;
                var form = _this.form;
                var page = _this.page;
                var params = _this.form;
                params.limit = page.size;
                params.offset = (page.currentPage - 1) * page.size;
        function buildOpenDetail(value, row, index){
            var html = [];
            if(row.orderType=='服务单'){
                html[0] = '<a  onClick="fnPublci.showServiceOrder(1 , \'' + value +'\')"   class="text-primary " >'+value+'</a>'
            }else{
                html[0] = '<a  onClick="fnPublci.showOrder(1 , \'' + value +'\')"   class="text-primary " >'+value+'</a>'
            }
            return html.join("");
        }
        $(function() {
            MTools.autoFullSelect();
            myGrid = MGrid.initGrid({
                url : basePath+"/admin/achieve/findDailyInfoNew",
                showExport : true,
                showFooter : true,
                height:'auto',
                width:'auto',
                exportDataType : "basic", //basic', 'all', 'selected'.
                exportTypes : [ 'excel', 'xlsx' ], //导出类型
                exportOptions : {
                    ignoreColumn : [ 0 ],
                    fileName : "每日单据统计" + MTools.getTime(), //文件名称设置
                    worksheetName : 'Sheet1', //表格工作区名称
                    tableName : '每日单据统计',
                    excelstyles : [ 'background-color', 'color', 'font-size',
                            'font-weight' ],
                if (form.timeRange) {
                    params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):'';
                    params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):'';
                }
            });
            $('[data-toggle="tooltip"]').tooltip()
        });
        function footCountTitle(data) {
            return "<b>合计</b>";
        };
        function countColumn(data) {
            console.log(data)
             field = this.field;
                var resultsumQuantity = parseFloat((data.reduce(function(sum, row) {
                    console.log(sum,row[field]);
                    return sum + (+row[field]);
                }, 0)).toFixed(2));//保留有效数字
                return "<b>"+resultsumQuantity+"</b>";
        };
        function exportExcel(){
            var param=MForm.toUrlParam("#serchform");
            window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param;
                $.AjaxProxy({
                    p:params
                }).invoke(basePath + "/admin/achieve/findDailyInfoNew", function (loj) {
                    _this.tableData = loj.getValue("rows");
                    _this.page.total = loj.getResult().total;
                });
            },
            queryCustomColumns() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX',
                    callback: function (data) {
                        _this.customColumns = data.rows;
                        _this.queryTableData();
                    }
                });
            },
            queryShops() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    url: basePath + '/admin/shopInfo/findAllWithPermi',
                    callback: function (data) {
                        _this.shopList = data.rows;
                    }
                });
            },
            queryAchieveUsers() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    url: basePath + '/admin/getShopStaffByRoleName?roleName=美疗师',
                    callback: function (data) {
                        _this.achieveUsers = data.rows;
                    }
                });
            },
            resetForm(formName) {
                // this.$refs[formName].resetFields();
                this.form = {
                    timeRange : '',
                    vipQueryKey : '',
                    beaultId : '',
                    shopId : ''
                }
            },
            search() {
                this.queryTableData();
            },
            handleSizeChange(val) {
                this.page.size = val;
                this.queryTableData();
            },
            handleCurrentChange(val) {
                this.page.currentPage = val;
                this.queryTableData();
            },
            initDays() {
                let _this = this;
                for (var i = 1; i <= 31 ; i++) {
                    _this.days.push(i);
                }
            },
            getRequestParam() {
                var form = this.form;
                var params = form;
                if (form.timeRange) {
                    params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):'';
                    params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):'';
                }
                return params;
            },
            exportExcel() {
                window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+MTools.jsonToUrlParam(this.getRequestParam());
            },
            jumpOrder(type, value) {
                if(type=='服务单') {
                    fnPublci.showServiceOrder(1, value);
                } else {
                    fnPublci.showOrder(1, value);
                }
            }
        }
    </script>
    });
</script>
</body>
</html>
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
@@ -549,7 +549,16 @@
        created : function() {
            let _this = this;
            this.orderParam = /*[[${orderParam}]]*/
                this.queryOrderDetailData(this.orderParam);
            var orderId = /*[[${orderId}]]*/
            var orderNo = /*[[${orderNo}]]*/
            var param = {};
            if(orderId) {
                param.id = orderId;
            } else {
                param.orderNo = orderNo;
            }
            this.queryOrderDetailData(param);
            // 业绩类型
            AjaxProxy.requst({
                app: _this,
@@ -575,7 +584,7 @@
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data: {id: param, orderNo:param},
                    data: param,
                    contentType: 'application/x-www-form-urlencoded',
                    url: basePath + '/admin/order/findOrderDetailByIdOrNo',
                    callback: function (data) {
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new-bak.html
New file
@@ -0,0 +1,229 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
    content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
        th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script>
</head>
<body class="gray-bg">
    <div class="ibox-content">
        <!-- 搜索框部分start -->
        <form class="form-inline" id="serchform">
        <div class="row mb-10">
                <div class="col-sm-8">
                    <button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button>
                    <button  onclick="myGrid.resetForm()" type="button"   class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button>
                    <button  matrix:btn="ygyjbb-exportExcel"  onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>
                </div>
            </div>
            <div class="form-group mr-20">
                <label >选择年月</label> <select
                    class="form-control" name="year" id="select_year">
                    <option value="">年份</option>
                    <option value="2010">2010</option>
                    <option value="2011">2011</option>
                    <option value="2012">2012</option>
                    <option value="2013">2013</option>
                    <option value="2014">2014</option>
                    <option value="2015">2015</option>
                    <option value="2016">2016</option>
                    <option value="2017">2017</option>
                    <option value="2018">2018</option>
                    <option value="2019">2019</option>
                    <option value="2020">2020</option>
                    <option value="2021">2021</option>
                </select> <select class="form-control" name="month" id="select_month">
                    <option value="01">1</option>
                    <option value="02">2</option>
                    <option value="03">3</option>
                    <option value="04">4</option>
                    <option value="05">5</option>
                    <option value="06">6</option>
                    <option value="07">7</option>
                    <option value="08">8</option>
                    <option value="09">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                </select>
                <select class="form-control" name="day" id="select_day">
                 <option value="">日</option>
                <th:block th:each="i:${#numbers.sequence(1, 31)}"   >
                    <option th:value="${i }" th:text="${i }"></option>
                </th:block>
                </select>
            </div>
            <div class="form-group mr-20">
                <label>日期范围</label>
                <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">-
                <input name="endTime"  type="text" class="form-control datetimepicker" id="endTime">
            </div>
            <div class="form-group mr-20">
                <label>会员</label>
                <input autocomplete="off" placeholder="姓名/编号/电话"  name="vipQueryKey" type="text" class="form-control"  >
            </div>
            <div class="form-group mr-20">
                <label>业绩归属人</label>
                <select class="form-control autoFull select2"
                        th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}"
                        data-value="suId"
                        data-filed="suName"
                        name="beaultId"
                        id="beaultId">
                    <option value="">--请选择--</option>
                </select>
            </div>
            <div class="form-group mr-20">
                <label>门店</label>
                <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId"
                        th:data-url="@{/admin/shopInfo/findAllWithPermi}">
                    <option value=''>--请选择部所属门店--</option>
                </select>
            </div>
        </form>
        <table id="mgrid">
            <thead>
                <tr>
                    <th data-formatter="MGrid.indexfn" data-align="center"
                        data-width="30px" data-footer-formatter="footCountTitle">序号</th>
                    <th data-field="datatime">时间</th>
                    <th data-field="orderNo" data-formatter="buildOpenDetail" >订单编号</th>
                    <th data-field="orderType">订单类型</th>
                    <th data-field="vipName">会员姓名</th>
                    <th data-field="proName">产品</th>
                    <th data-field="cateName">产品分类</th>
                    <th data-field="zkTotal" data-footer-formatter="countColumn">订单金额</th>
                    <th data-field="goodsCash" data-footer-formatter="countColumn">订单业绩</th>
                    <th data-field="payMethod">收款方式</th>
                    <th data-field="achieveType">业绩类型</th>
                    <th data-field="meiliao">员工</th>
                    <th data-field="hisConsume" data-footer-formatter="countColumn">本金消耗
                        <i data-toggle="tooltip" data-placement="top" title="消耗金额:客户做服务时划扣的本金" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="freeConsume" data-footer-formatter="countColumn">赠送消耗
                        <i data-toggle="tooltip" data-placement="top" title="赠送消耗:客户做服务时划扣的赠送金额" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="projPercentage" data-footer-formatter="countColumn">服务提成
                        <i data-toggle="tooltip" data-placement="top" title="服务提成:为美疗师手动设置的项目服务提成" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="numberOfPeople" data-footer-formatter="countColumn">人头</th>
                    <th data-field="projNum" data-footer-formatter="countColumn">项目个数</th>
                    <th data-field="projTime" data-footer-formatter="countColumn">项目时间</th>
                    <th data-field="guwen">操作人</th>
                    <th data-field="shopName">门店</th>
                </tr>
            </thead>
        </table>
    </div>
    <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
    <script type="text/javascript" th:src="@{/js/function/public.js}"></script>
    <script type="text/javascript">
        var myGrid;
        var initParam = {
                format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss"
                minView: "hour",     //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour"
            }
         MTools.ininDatetimepicker(initParam);
        //限制结束时间不小于开始时间
         MTools.limitStartEndTime({});
        var date = new Date();
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var year_options = "";
        for (var i = 9; i > 0; i--) {
            year_options += "<option value='" + (year - i) + "'>" + (year - i)
                    + "</option>";
        }
        year_options += "<option value='"+year+"' selected='selected'>" + year
                + "</option>";
        $("#select_year").html(year_options);
        $("#select_month").find("option").each(function(row) {
            var option_month = $(this).val();
            if (month == option_month) {
                $(this).attr("selected", true);
            }
        });
        function buildOpenDetail(value, row, index){
            var html = [];
            if(row.orderType=='服务单'){
                html[0] = '<a  onClick="fnPublci.showServiceOrder(1 , \'' + value +'\')"   class="text-primary " >'+value+'</a>'
            }else{
                html[0] = '<a  onClick="fnPublci.showOrder(1 , \'' + value +'\')"   class="text-primary " >'+value+'</a>'
            }
            return html.join("");
        }
        $(function() {
            MTools.autoFullSelect();
            myGrid = MGrid.initGrid({
                url : basePath+"/admin/achieve/findDailyInfoNew",
                showExport : true,
                showFooter : true,
                height:'auto',
                width:'auto',
                exportDataType : "basic", //basic', 'all', 'selected'.
                exportTypes : [ 'excel', 'xlsx' ], //导出类型
                exportOptions : {
                    ignoreColumn : [ 0 ],
                    fileName : "每日单据统计" + MTools.getTime(), //文件名称设置
                    worksheetName : 'Sheet1', //表格工作区名称
                    tableName : '每日单据统计',
                    excelstyles : [ 'background-color', 'color', 'font-size',
                            'font-weight' ],
                }
            });
            $('[data-toggle="tooltip"]').tooltip()
        });
        function footCountTitle(data) {
            return "<b>合计</b>";
        };
        function countColumn(data) {
            console.log(data)
             field = this.field;
                var resultsumQuantity = parseFloat((data.reduce(function(sum, row) {
                    console.log(sum,row[field]);
                    return sum + (+row[field]);
                }, 0)).toFixed(2));//保留有效数字
                return "<b>"+resultsumQuantity+"</b>";
        };
        function exportExcel(){
            var param=MForm.toUrlParam("#serchform");
            window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param;
        }
    </script>
</body>
</html>
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html
@@ -11,219 +11,273 @@
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
        th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
<link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" th:src="@{/js/function/public.js}"></script>
</head>
<body class="gray-bg">
<style>
    .table-style {
        margin: 20px 0;
        padding: 20px 10px;
        border: 1px solid #DCDFE6;
        background-color: white;
    }
    .search-form {
        background-color: white;
        padding-top: 10px;
        padding-left: 20px;
        padding-bottom: 10px;
    }
</style>
<body>
<div id="app" style="">
    <el-row class="search-form">
        <el-form ref="form" :model="form" inline>
            <el-form-item label="选择年月">
                <el-select v-model="form.year" style="width:120px;" placeholder="请选择">
                    <el-option v-for="item in years"
                               :key="item"
                               :label="item"
                               :value="item"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.month" style="width:120px;" placeholder="请选择">
                    <el-option v-for="item in months"
                               :key="item"
                               :label="item"
                               :value="item"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.day" style="width:120px;" placeholder="请选择">
                    <el-option v-for="item in days"
                               :key="item"
                               :label="item"
                               :value="item"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="日期范围">
                <el-date-picker v-model="form.timeRange"
                                type="datetimerange"
                                range-separator="至"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
    <div class="ibox-content">
        <!-- 搜索框部分start -->
        <form class="form-inline" id="serchform">
        <div class="row mb-10">
                <div class="col-sm-8">
                    <button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button>
                    <button  onclick="myGrid.resetForm()" type="button"   class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button>
                    <button  matrix:btn="ygyjbb-exportExcel"  onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>
                </div>
            </div>
            <div class="form-group mr-20">
                <label >选择年月</label> <select
                    class="form-control" name="year" id="select_year">
                    <option value="">年份</option>
                    <option value="2010">2010</option>
                    <option value="2011">2011</option>
                    <option value="2012">2012</option>
                    <option value="2013">2013</option>
                    <option value="2014">2014</option>
                    <option value="2015">2015</option>
                    <option value="2016">2016</option>
                    <option value="2017">2017</option>
                    <option value="2018">2018</option>
                    <option value="2019">2019</option>
                    <option value="2020">2020</option>
                    <option value="2021">2021</option>
                </select> <select class="form-control" name="month" id="select_month">
                    <option value="01">1</option>
                    <option value="02">2</option>
                    <option value="03">3</option>
                    <option value="04">4</option>
                    <option value="05">5</option>
                    <option value="06">6</option>
                    <option value="07">7</option>
                    <option value="08">8</option>
                    <option value="09">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                </select>
                <select class="form-control" name="day" id="select_day">
                 <option value="">日</option>
                <th:block th:each="i:${#numbers.sequence(1, 31)}"   >
                    <option th:value="${i }" th:text="${i }"></option>
                </th:block>
                </select>
            </div>
            <div class="form-group mr-20">
                <label>日期范围</label>
                <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">-
                <input name="endTime"  type="text" class="form-control datetimepicker" id="endTime">
            </div>
            <el-form-item label="会员">
                <el-input v-model="form.vipQueryKey"></el-input>
            </el-form-item>
            <div class="form-group mr-20">
                <label>会员</label>
                <input autocomplete="off" placeholder="姓名/编号/电话"  name="vipQueryKey" type="text" class="form-control"  >
            </div>
            <el-form-item label="业绩归属人">
                <el-select v-model="form.beaultId" placeholder="请选择">
                    <el-option v-for="item in achieveUsers"
                               :key="item.suId"
                               :label="item.suName"
                               :value="item.suId"></el-option>
                </el-select>
            </el-form-item>
            <div class="form-group mr-20">
                <label>业绩归属人</label>
                <select class="form-control autoFull select2"
                        th:data-url="@{/admin/getShopStaffByRoleName?roleName=美疗师}"
                        data-value="suId"
                        data-filed="suName"
                        name="beaultId"
                        id="beaultId">
                    <option value="">--请选择--</option>
                </select>
            </div>
            <el-form-item label="门店">
                <el-select v-model="form.shopId" placeholder="请选择所属门店">
                    <el-option v-for="item in shopList"
                            :key="item.id"
                            :label="item.shopName"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <div class="form-group mr-20">
                <label>门店</label>
                <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId"
                        th:data-url="@{/admin/shopInfo/findAllWithPermi}">
                    <option value=''>--请选择部所属门店--</option>
                </select>
            </div>
        </form>
            <el-button type="primary" @click="search" >搜索</el-button>
            <el-button @click="resetForm('form')">重置</el-button>
            <el-button type="warning" @click="exportExcel">导出</el-button>
        </el-form>
        <table id="mgrid">
            <thead>
                <tr>
                    <th data-formatter="MGrid.indexfn" data-align="center"
                        data-width="30px" data-footer-formatter="footCountTitle">序号</th>
                    <th data-field="datatime">时间</th>
                    <th data-field="orderNo" data-formatter="buildOpenDetail" >订单编号</th>
                    <th data-field="orderType">订单类型</th>
                    <th data-field="vipName">会员姓名</th>
                    <th data-field="proName">产品</th>
                    <th data-field="cateName">产品分类</th>
                    <th data-field="zkTotal" data-footer-formatter="countColumn">订单金额</th>
                    <th data-field="goodsCash" data-footer-formatter="countColumn">订单业绩</th>
                    <th data-field="payMethod">收款方式</th>
                    <th data-field="achieveType">业绩类型</th>
                    <th data-field="meiliao">员工</th>
                    <th data-field="hisConsume" data-footer-formatter="countColumn">本金消耗
                        <i data-toggle="tooltip" data-placement="top" title="消耗金额:客户做服务时划扣的本金" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="freeConsume" data-footer-formatter="countColumn">赠送消耗
                        <i data-toggle="tooltip" data-placement="top" title="赠送消耗:客户做服务时划扣的赠送金额" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="projPercentage" data-footer-formatter="countColumn">服务提成
                        <i data-toggle="tooltip" data-placement="top" title="服务提成:为美疗师手动设置的项目服务提成" class="fa fa-question-circle"></i>
                    </th>
                    <th data-field="numberOfPeople" data-footer-formatter="countColumn">人头</th>
                    <th data-field="projNum" data-footer-formatter="countColumn">项目个数</th>
                    <th data-field="projTime" data-footer-formatter="countColumn">项目时间</th>
                    <th data-field="guwen">操作人</th>
                    <th data-field="shopName">门店</th>
                </tr>
            </thead>
        </table>
    </div>
    <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
    <script type="text/javascript" th:src="@{/js/function/public.js}"></script>
    <script type="text/javascript">
        var myGrid;
        var initParam = {
                format : "yyyy-mm-dd hh:ii", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss"
                minView: "hour",     //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour"
    </el-row>
    <el-row class="table-style">
        <el-table :data="tableData" style="width: 100%">
            <el-table-column type="index" width="30"></el-table-column>
            <el-table-column prop="datatime" width="150" label="时间"></el-table-column>
            <el-table-column prop="orderNo" width="180" label="订单编号">
                <template slot-scope="scope">
                    <el-link @click="jumpOrder(scope.row.orderType, scope.row.orderNo)" type="primary">{{scope.row.orderNo}}</el-link>
                </template>
            </el-table-column>
            <el-table-column prop="orderType" label="订单类型"></el-table-column>
            <el-table-column prop="vipName" label="会员姓名"></el-table-column>
            <el-table-column prop="proName" label="产品" width="200"></el-table-column>
            <el-table-column prop="cateName" label="产品分类"></el-table-column>
            <el-table-column prop="zkTotal" label="订单金额"></el-table-column>
<!--            <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>-->
            <el-table-column prop="meiliao" label="员工"></el-table-column>
            <el-table-column v-for="(item, index) in customColumns" width="120" :key="index" :label="item.value">
                <template slot-scope="scope">
                    <span v-if="item.value == scope.row.achieveType">{{scope.row.goodsCash}}</span>
                </template>
            </el-table-column>
            <el-table-column prop="hisConsume" label="本金消耗"></el-table-column>
            <el-table-column prop="freeConsume" label="赠送消耗"></el-table-column>
            <el-table-column prop="projPercentage" label="服务提成"></el-table-column>
            <el-table-column prop="numberOfPeople" label="人头"></el-table-column>
            <el-table-column prop="projNum" label="项目个数"></el-table-column>
            <el-table-column prop="projTime" label="服务时间"></el-table-column>
            <el-table-column prop="guwen" label="操作人"></el-table-column>
            <el-table-column prop="shopName" label="门店"></el-table-column>
        </el-table>
        <el-row style="margin-top: 10px;">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="page.currentPage"
                    :page-sizes="[10, 20, 30, 50]"
                    :page-size="page.size"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="page.total">
            </el-pagination>
        </el-row>
    </el-row>
</div>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript" th:inline="javascript">
    var vue = new Vue({
        el : "#app",
        data : {
            tableData : [],
            customColumns : [],
            shopList : [],
            achieveUsers : [],
            years : [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021],
            months : ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
            days : [],
            form : {
                year : '',
                month : '',
                day : '',
                timeRange : '',
                vipQueryKey : '',
                beaultId : '',
                shopId : ''
            },
            page : {
                currentPage : 1,
                size : 10,
                total : 0
            }
         MTools.ininDatetimepicker(initParam);
        //限制结束时间不小于开始时间
         MTools.limitStartEndTime({});
        var date = new Date();
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var year_options = "";
        for (var i = 9; i > 0; i--) {
            year_options += "<option value='" + (year - i) + "'>" + (year - i)
                    + "</option>";
        }
        year_options += "<option value='"+year+"' selected='selected'>" + year
                + "</option>";
        $("#select_year").html(year_options);
        $("#select_month").find("option").each(function(row) {
            var option_month = $(this).val();
            if (month == option_month) {
                $(this).attr("selected", true);
            }
        });
        },
        created : function() {
            this.initDays();
            this.queryCustomColumns();
            this.queryShops();
            this.queryAchieveUsers();
        },
        methods : {
            queryTableData () {
                let _this = this;
                var form = _this.form;
                var page = _this.page;
                var params = _this.form;
                params.limit = page.size;
                params.offset = (page.currentPage - 1) * page.size;
        function buildOpenDetail(value, row, index){
            var html = [];
            if(row.orderType=='服务单'){
                html[0] = '<a  onClick="fnPublci.showServiceOrder(1 , \'' + value +'\')"   class="text-primary " >'+value+'</a>'
            }else{
                html[0] = '<a  onClick="fnPublci.showOrder(1 , \'' + value +'\')"   class="text-primary " >'+value+'</a>'
            }
            return html.join("");
        }
        $(function() {
            MTools.autoFullSelect();
            myGrid = MGrid.initGrid({
                url : basePath+"/admin/achieve/findDailyInfoNew",
                showExport : true,
                showFooter : true,
                height:'auto',
                width:'auto',
                exportDataType : "basic", //basic', 'all', 'selected'.
                exportTypes : [ 'excel', 'xlsx' ], //导出类型
                exportOptions : {
                    ignoreColumn : [ 0 ],
                    fileName : "每日单据统计" + MTools.getTime(), //文件名称设置
                    worksheetName : 'Sheet1', //表格工作区名称
                    tableName : '每日单据统计',
                    excelstyles : [ 'background-color', 'color', 'font-size',
                            'font-weight' ],
                if (form.timeRange) {
                    params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):'';
                    params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):'';
                }
            });
            $('[data-toggle="tooltip"]').tooltip()
        });
        function footCountTitle(data) {
            return "<b>合计</b>";
        };
        function countColumn(data) {
            console.log(data)
             field = this.field;
                var resultsumQuantity = parseFloat((data.reduce(function(sum, row) {
                    console.log(sum,row[field]);
                    return sum + (+row[field]);
                }, 0)).toFixed(2));//保留有效数字
                return "<b>"+resultsumQuantity+"</b>";
        };
        function exportExcel(){
            var param=MForm.toUrlParam("#serchform");
            window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param;
                $.AjaxProxy({
                    p:params
                }).invoke(basePath + "/admin/achieve/findDailyInfoNew", function (loj) {
                    _this.tableData = loj.getValue("rows");
                    _this.page.total = loj.getResult().total;
                });
            },
            queryCustomColumns() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    url: basePath + '/admin/customerDictionary/getListByParentCode/YJLX',
                    callback: function (data) {
                        _this.customColumns = data.rows;
                        _this.queryTableData();
                    }
                });
            },
            queryShops() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    url: basePath + '/admin/shopInfo/findAllWithPermi',
                    callback: function (data) {
                        _this.shopList = data.rows;
                    }
                });
            },
            queryAchieveUsers() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    url: basePath + '/admin/getShopStaffByRoleName?roleName=美疗师',
                    callback: function (data) {
                        _this.achieveUsers = data.rows;
                    }
                });
            },
            resetForm(formName) {
                // this.$refs[formName].resetFields();
                this.form = {
                    timeRange : '',
                    vipQueryKey : '',
                    beaultId : '',
                    shopId : ''
                }
            },
            search() {
                this.queryTableData();
            },
            handleSizeChange(val) {
                this.page.size = val;
                this.queryTableData();
            },
            handleCurrentChange(val) {
                this.page.currentPage = val;
                this.queryTableData();
            },
            initDays() {
                let _this = this;
                for (var i = 1; i <= 31 ; i++) {
                    _this.days.push(i);
                }
            },
            getRequestParam() {
                var form = this.form;
                var params = form;
                if (form.timeRange) {
                    params.beginTime = form.timeRange?moment(form.timeRange[0]).format("YYYY-MM-DD HH:mm"):'';
                    params.endTime = form.timeRange?moment(form.timeRange[1]).format("YYYY-MM-DD HH:mm"):'';
                }
                return params;
            },
            exportExcel() {
                window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+MTools.jsonToUrlParam(this.getRequestParam());
            },
            jumpOrder(type, value) {
                if(type=='服务单') {
                    fnPublci.showServiceOrder(1, value);
                } else {
                    fnPublci.showOrder(1, value);
                }
            }
        }
    </script>
    });
</script>
</body>
</html>
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html
@@ -42,7 +42,7 @@
                        <div class="panel-heading">基本信息</div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">分类ID
                                <label class="col-sm-2 control-label">产品分类
                                    <span class="text-danger">*</span>
                                </label>
                                <div class="col-sm-4">
@@ -69,6 +69,40 @@
                                           maxLength="1000" dataType="*"
                                           th:value="${obj.briefIntroduction}" nullmsg="产品简介不能为空">
                                </div>
                                <label class="col-sm-2 control-label">是否可分销
                                    <span class="text-danger">*</span>
                                </label>
                                <div class="col-sm-4">
                                    <select th:field="${obj.ableSales}" class="form-control select2 " size="1"
                                            name="ableSales"
                                            id="ableSales" style="width: 100%">
                                        <option value="1" th:selected="${obj.ableSales == '1'}">可分销</option>
                                        <option value="2" th:selected="${obj.ableSales == '2'}">不可分销</option>
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">上架卖场
                                    <span class="text-danger">*</span>
                                </label>
                                <div class="col-sm-4">
                                    <select th:field="${obj.mallType}" class="form-control select2 " size="1"
                                            name="mallType"
                                            id="mallType" style="width: 100%">
                                        <option value="1" th:selected="${obj.mallType == '1'}">微商城</option>
                                        <option value="2" th:selected="${obj.mallType == '2'}">积分商城</option>
                                        </option>
                                    </select>
                                </div>
                                <label class="col-sm-2 control-label">积分商城分类
                                    <span class="text-danger">*</span>
                                </label>
                                <div class="col-sm-4">
                                    <select class="form-control select2 " size="1" name="scoreCategoryId"
                                            id="scoreCategoryId" style="width: 100%">
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
@@ -87,14 +121,7 @@
                                           dataType="n" nullmsg="展示销量不能为空"
                                           th:value="${obj.dsVolume}" errormsg="请填写数字">
                                </div>
                                <!--<label class="col-sm-2 control-label">运费
                                    <span class="text-danger">*</span>
                                </label>
                                <div class="col-sm-4">
                                    <input autocomplete="off"   type="text" class="form-control" name="carriage"
                                           maxLength="250" datatype="*"
                                           th:value="${obj.carriage}" nullmsg="运费不能为空">
                                </div>-->
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">限购数量
@@ -226,11 +253,12 @@
                                    <th>规格图片地址<span class="text-danger">*</span></th>
                                    <th>库存<span class="text-danger">*</span></th>
                                    <th>价格<span class="text-danger">*</span></th>
                                    <th>积分</th>
                                    <th>消费可得积分</th>
                                    <th>关联ERP产品</th>
                                    <th>排序</th>
                                    <th>推广提成</th>
                                    <th>邀请提成</th>
                                    <th>兑换所需积分</th>
                                    <th>操作</th>
                                </tr>
                            </table>
@@ -395,6 +423,9 @@
    });
    $(function () {
        initSeclect("#parentId",[[${obj.categoryId}]]);
        initScoreSeclect("#scoreCategoryId",[[${obj.scoreCategoryId}]]);
        initAttrSeclect("#attrIds");
        $("#mobileDetails").html(obj.mobileDetails);
        $("#pcDetails").html(obj.pcDetails);
@@ -538,6 +569,10 @@
            if (invitationPrice == null || typeof invitationPrice == 'undefined') {
                invitationPrice = "";
            }
   var scorePrice = shopSkus[c].scorePrice;
            if (scorePrice == null || typeof scorePrice == 'undefined') {
                scorePrice = "";
            }
            var html=
@@ -554,6 +589,7 @@
                +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+sort+'" name=""></td>'
                +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+sealesPrice+'" name=""></td>'
                +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+invitationPrice+'" name=""></td>'
                +'<td><input autocomplete="off"   type="text" class="form-control"  value="'+scorePrice+'" name=""></td>'
                +'<td><i class="fa fa-trash form-control-static"    onclick="delThis(\''+trId+'\')"></i></td>'
                +'</tr>';
            $("#skutable").find("tbody").append(html);
@@ -668,6 +704,22 @@
                    });
            });
    }
    //初始化分积分商城分类ID
    function initScoreSeclect(seler, def) {
        $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=jfsccpfl&status=1",
            function (loj) {
                $(seler).createSelectTree(
                    loj.attr("result").rows,
                    {
                        id: "attrId",
                        parent: "parentId",
                        value: "attrName",
                        append: false,
                        defaultValue: def,
                        defaultHtml: ''
                    });
            });
    }
    //添加图片节点
    function addImgTr() {
@@ -724,68 +776,72 @@
            if (i != 0) {
                var tds = $(this).find("td");
                var length = tds.length - 1;
                var id = tds.eq(length - 10).find("input").val();
                var id = tds.eq(length - 11).find("input").val();
                if(id == null){
                    id ="";
                }
                sku.id = id;
                //规格名称
                var name = tds.eq(length - 9).find("input").val();
                var name = tds.eq(length - 10).find("input").val();
                if(name == null){
                    name = "";
                }
                sku.name = name;
                //图片地址
                var path = tds.eq(length - 8).find("img").attr("src");
                var path = tds.eq(length - 9).find("img").attr("src");
                if(path == null){
                    path = "";
                }
                sku.imgPath = path;
                //库存
                var stock = tds.eq(length - 7).find("input").val();
                var stock = tds.eq(length - 8).find("input").val();
                if(stock == ""){
                    stock = 0;
                }
                sku.stock = stock;
                //价格
                var price = tds.eq(length -6).find("input").val();
                var price = tds.eq(length -7).find("input").val();
                if(price == ""){
                    price =0;
                }
                sku.price = price;
                //积分
                var score = tds.eq(length - 5).find("input").val();
                var score = tds.eq(length - 6).find("input").val();
                if(score == ""){
                    score = 0;
                }
                sku.score = score;
                //品种编码
                var stockCode = tds.eq(length - 4).find("input").val();
                var stockCode = tds.eq(length - 5).find("input").val();
                if(stockCode == null || typeof stockCode == 'undefined'){
                    stockCode = '';
                }
                sku.stockCode = stockCode;
                //排序
                var sort = tds.eq(length - 3).find("input").val();
                var sort = tds.eq(length - 4).find("input").val();
                if(sort == ""){
                    sort = 0;
                }
                sku.sort = sort;
                //推广提成
                var sealesPrice = tds.eq(length - 2).find("input").val();
                var sealesPrice = tds.eq(length - 3).find("input").val();
                sku.sealesPrice = sealesPrice;
                //邀请提成
                var invitationPrice = tds.eq(length - 1).find("input").val();
                var invitationPrice = tds.eq(length - 2).find("input").val();
                sku.invitationPrice = invitationPrice;
                //兑换所需积分
                var scorePrice = tds.eq(length - 1).find("input").val();
                sku.scorePrice = scorePrice;
                skus.push(sku);
            }
@@ -793,6 +849,7 @@
        return skus;
    }
    /*验证sku表格中的参数*/
    function getSkusValues() {
@@ -803,7 +860,7 @@
            if (i != 0) {
                var tds = $(this).find("td");
                var length = tds.length - 1;
                var name = tds.eq(length - 9).find("input").val();
                var name = tds.eq(length - 10).find("input").val();
                if(name == ""){
                    layer.msg("请填写规格名称",{
                        icon : 2,
@@ -821,7 +878,7 @@
                    return false;
                }
                var stock = tds.eq(length -7).find("input").val();
                var stock = tds.eq(length -8).find("input").val();
                if(stock == ""){
                    layer.msg("请填写库存",{
                        icon : 2,
@@ -830,7 +887,7 @@
                    flag = true;
                    return false;
                }
                var price = tds.eq(length - 6).find("input").val();
                var price = tds.eq(length - 7 ).find("input").val();
                if(price == ""){
                    layer.msg("请填写价格",{
                        icon : 2,
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html
@@ -35,10 +35,18 @@
                <input autocomplete="off" id="search-text" name="title" placeholder="输入查询关键词"
                       type="text" class="form-control">
            </div>
            <div class="form-group">
                <label class="control-label">上架卖场</label>
                <select style="width:100px;" class="form-control select2" size="1"
                        name="mallType" >
                    <option value="">请选择</option>
                    <option value="1">微商城</option>
                    <option value="2">积分商城</option>
                </select>
            </div>
            <div class="form-group">
                <label class="control-label">是否上架</label>
                <select style="width:200px;" class="form-control select2" size="1"
                <select style="width:100px;" class="form-control select2" size="1"
                        name="status"
                        id="status">
                    <option value="">请选择</option>
@@ -47,10 +55,10 @@
                </select>
            </div>
            <div class="form-group">
                <label class="control-label">是否为服务</label>
                <select style="width:200px;" class="form-control select2" size="1"
                        name="isService"
                        id="isService">
                <label class="control-label">是否可分销</label>
                <select style="width:100px;" class="form-control select2" size="1"
                        name="ableSales"
                        id="ableSales">
                    <option value="">请选择</option>
                    <option value="1">是</option>
                    <option value="2">否</option>
@@ -114,12 +122,12 @@
                <tr>
                    <th data-checkbox="true"></th>
                    <th data-formatter="MGrid.indexfn" data-align="center">序号</th>
                    <th data-field="id" data-align="center">产品ID</th>
                    <th data-field="mallType" data-align="center" data-formatter="mallType">上架卖场</th>
                    <th data-field="title" data-align="center">产品名称</th>
                    <th data-field="imgMobile" data-align="center" data-formatter="MGrid.getImage">产品图片</th>
                    <th data-field="attrValues" data-align="center" data-formatter="formatAttr">产品属性</th>
                    <th data-field="price" data-align="center">价格</th>
                    <th data-field="score" data-align="center">积分</th>
                    <th data-field="scorePrice" data-align="center">兑换所需积分</th>
                    <th data-field="status" data-align="center" data-formatter="isStatus">是否上架</th>
                    <th data-field="rsVolume" data-align="center">真实销量</th>
@@ -275,7 +283,7 @@
    //初始化属性下拉选
    function initAttrsSeclect(seler, def) {
        console.log(1);
        $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=cpfl",
        $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=productColumn",
            function (loj) {
                $(seler).createSelectTree(
                    loj.attr("result").rows,
@@ -290,6 +298,16 @@
            });
    }
    function mallType(value, row, index) {
        var html = "";
        if (value ==1) {
          html="微商城"
        }else{
            html="积分商城"
        }
        return html;
    }
    /**
     * 格式化属性
     */
zq-erp/src/main/resources/templates/views/common/showprojException.html
New file
@@ -0,0 +1,51 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <LINK rel="Bookmark" href="../images/favicon.ico">
    <!-- 本框架基本脚本和样式 -->
    <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="ibox-content" id="app">
    <table class="table table-striped table-bordered" style="width: 800px;">
        <tr>
            <td>ID</td>
            <td th:text="${obj.id}" ></td>
            <td  >姓名</td>
            <td th:text="${obj.owner}" ></td>
        </tr>
        <tr>
            <td  >异常类型</td>
            <td th:text="${obj.simpleMsg}" ></td>
            <td  >发生时间</td>
            <td th:text="${#dates.format(obj.createTime, 'yyyy-MM-dd HH:mm:sss')}" >
        </tr>
        <tr>
            <td  >访问地址</td>
            <td th:text="${obj.cause}" ></td>
            <td  >mdc</td>
            <td th:text="${obj.mdc}" ></td>
        </tr>
    </table>
    <pre  th:text="${obj.errorMsg}" ></pre>
</div>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script>
<script type="text/javascript">
</script>
</body>
</html>