jyy
2021-06-27 6e783f279e7b1dd1f0fc243d7d8504ede0b25870
修复业绩bug1
24 files modified
895 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsDetailVo.java 154 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java 40 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java 57 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java 7 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java 112 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java 8 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/MoneyCardUseServiceImpl.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java 41 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java 150 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java 37 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/system.properties 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml 3 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html 75 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html 81 ●●●●● patch | view | raw | blame | history
zq-erp/src/test/java/com/matrix/JyyTests.java 54 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/app/vo/ShoppingGoodsDetailVo.java
@@ -3,6 +3,7 @@
import com.matrix.system.hive.bean.ShoppingGoodsCategory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@@ -11,6 +12,7 @@
 * @author wzy
 * @date 2020-12-24
 **/
@Data
@ApiModel(value = "ShoppingGoodsDetailVo", description = "商品详情返回参数类")
public class ShoppingGoodsDetailVo {
@@ -45,7 +47,7 @@
    private Integer maxSaleCnt;
    @ApiModelProperty(value = "每人限购次数")
    private String limitBuyCnt;
    private Integer limitBuyCnt;
    @ApiModelProperty(value = "充值卡使用范围 是-所有产品 否-部分产品")
    private String carIsAll;
@@ -71,155 +73,5 @@
    @ApiModelProperty(value = "卡项产品可消费类型")
    List<ShoppingGoodsCategory> cardCategory;
    public BigDecimal getGiftPrice() {
        return giftPrice;
    }
    public void setGiftPrice(BigDecimal giftPrice) {
        this.giftPrice = giftPrice;
    }
    public String getCarIsAll() {
        return carIsAll;
    }
    public void setCarIsAll(String carIsAll) {
        this.carIsAll = carIsAll;
    }
    public String getGoodsNo() {
        return goodsNo;
    }
    public void setGoodsNo(String goodsNo) {
        this.goodsNo = goodsNo;
    }
    public String getGoodsName() {
        return goodsName;
    }
    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }
    public BigDecimal getSalePrice() {
        return salePrice;
    }
    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }
    public Integer getSaleCnt() {
        return saleCnt;
    }
    public void setSaleCnt(Integer saleCnt) {
        this.saleCnt = saleCnt;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public String getGoodsType() {
        return goodsType;
    }
    public void setGoodsType(String goodsType) {
        this.goodsType = goodsType;
    }
    public Integer getVolume() {
        return volume;
    }
    public void setVolume(Integer volume) {
        this.volume = volume;
    }
    public String getMeasure() {
        return measure;
    }
    public void setMeasure(String measure) {
        this.measure = measure;
    }
    public Integer getMaxSaleCnt() {
        return maxSaleCnt;
    }
    public void setMaxSaleCnt(Integer maxSaleCnt) {
        this.maxSaleCnt = maxSaleCnt;
    }
    public String getLimitBuyCnt() {
        return limitBuyCnt;
    }
    public void setLimitBuyCnt(String limitBuyCnt) {
        this.limitBuyCnt = limitBuyCnt;
    }
    public List<ShoppingGoodsDetailVo> getAssembleProj() {
        return assembleProj;
    }
    public void setAssembleProj(List<ShoppingGoodsDetailVo> assembleProj) {
        this.assembleProj = assembleProj;
    }
    public List<ShoppingGoodsDetailVo> getAssembleTaocanProj() {
        return assembleTaocanProj;
    }
    public void setAssembleTaocanProj(List<ShoppingGoodsDetailVo> assembleTaocanProj) {
        this.assembleTaocanProj = assembleTaocanProj;
    }
    public List<ShoppingGoodsDetailVo> getAssembleTaocanProduct() {
        return assembleTaocanProduct;
    }
    public void setAssembleTaocanProduct(List<ShoppingGoodsDetailVo> assembleTaocanProduct) {
        this.assembleTaocanProduct = assembleTaocanProduct;
    }
    public List<ShoppingGoodsCategory> getCardCategory() {
        return cardCategory;
    }
    public void setCardCategory(List<ShoppingGoodsCategory> cardCategory) {
        this.cardCategory = cardCategory;
    }
    public String getIsCourse() {
        return isCourse;
    }
    public void setIsCourse(String isCourse) {
        this.isCourse = isCourse;
    }
    public Integer getMaxUseCnt() {
        return maxUseCnt;
    }
    public void setMaxUseCnt(Integer maxUseCnt) {
        this.maxUseCnt = maxUseCnt;
    }
}
zq-erp/src/main/java/com/matrix/system/common/authority/DefaultAuthorityManager.java
@@ -79,24 +79,33 @@
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        Map<String, SysFunction> userFunction = WebUtil.getSessionAttribute(USERFUNCTION);
        // 企业管理员不校验按钮权限
        if (AppConstance.USER_TYPE_DEVELOPER.equals(user.getSuUserType())
                || AppConstance.USER_TYPE_SUPER.equals(user.getSuUserType())
                || AppConstance.USER_TYPE_ADMIN.equals(user.getSuUserType())) {
            return true;
        }
        String[] strs = matchStr.split("-");
        if (strs.length != DEFAULT_2) {
            throw new IllegalArgumentException("权限matchStr格式错误,需要fnCode:btnValue");
        }
        SysFunction fn = userFunction.get(strs[0].trim());
        // 功能是否存在
        if (fn == null) {
        if (userFunction == null) {
            return false;
        } else {
            return StringUtils.isContentSet(strs[1].trim(), fn.getRpfBns());
            String[] strs = matchStr.split("-");
            if (strs.length != DEFAULT_2) {
                throw new IllegalArgumentException("权限matchStr格式错误,需要fnCode:btnValue");
            }
            SysFunction fn = userFunction.get(strs[0].trim());
            // 功能是否存在
            if (fn == null) {
                return false;
            } else {
                return StringUtils.isContentSet(strs[1].trim(), fn.getRpfBns());
            }
        }
    }
    /**
@@ -113,8 +122,13 @@
            return true;
        }
        Map<String, SysFunction> userFunction = WebUtil.getSessionAttribute(USERFUNCTION);
        SysFunction fn = userFunction.get(fnCode);
        return fn == null ? false : true;
        if (userFunction == null) {
            return false;
        } else {
            SysFunction fn = userFunction.get(fnCode);
            return fn == null ? false : true;
        }
    }
    /**
@@ -141,7 +155,7 @@
        SysUsers sysUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        String redisKey = USER_POWER_REDISKEY_PC + SecureUtil.md5(sysUser.getSuId()+"");
        String redisKey = USER_POWER_REDISKEY_PC + SecureUtil.md5(sysUser.getSuId() + "");
        String cachedValue = redisClient.getCachedValue(redisKey);
        if (StringUtils.isNotBlank(cachedValue)) {
            //从缓存中获取用户权限
@@ -169,11 +183,11 @@
            // 组装菜单
            assembleMenu(menuFunction, menuFunctionMap);
            Map<String ,Object> powerMap=new HashMap<>();
            Map<String, Object> powerMap = new HashMap<>();
            powerMap.put(USERFUNCTION, userFunction);
            powerMap.put(MENUSFUNCTION, menuFunction);
            powerMap.put(USER_URL_MAPPING, userUrlMapping);
            redisClient.saveValue(redisKey,JSONUtil.parseObj(powerMap,true));
            redisClient.saveValue(redisKey, JSONUtil.parseObj(powerMap, true));
        }
zq-erp/src/main/java/com/matrix/system/hive/action/MoneyCardUseController.java
@@ -9,11 +9,9 @@
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.constance.SystemConstance;
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.MoneyCardUseDao;
import com.matrix.system.hive.dao.MoneyCardUseFlowDao;
import com.matrix.core.tools.DateUtil;
import com.matrix.system.hive.pojo.CzXkVo;
import com.matrix.system.hive.service.*;
import com.matrix.system.shopXcx.mqTask.MQTaskRouting;
@@ -27,7 +25,6 @@
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -282,9 +279,9 @@
    @RequestMapping(value = "/active")
    public @ResponseBody
    AjaxResult active(MoneyCardUse moneyCardUse) {
        MoneyCardUse proj = moneyCardUseDao.selectById(moneyCardUse.getId());
        String status = proj.getStatus();
        Date failTime = proj.getFailTime();
        MoneyCardUse cardUse = moneyCardUseDao.selectById(moneyCardUse.getId());
        String status = cardUse.getStatus();
        Date failTime = cardUse.getFailTime();
        Date today = new Date();
        Date newDate = null;
        newDate = moneyCardUse.getFailTime();
@@ -303,14 +300,27 @@
            //如果是冻结状态则要算出冻结的天数,延长有效期
            case Dictionary.TAOCAN_STATUS_DJ:
                MoneyCardUseFreeze freeze = new MoneyCardUseFreeze();
                freeze = moneyCardUseFreezeService.findByMoneyCardUseId(proj.getId());
                proj.setFailTime(DateUtil.nextNDate(failTime, freeze.getGapDays()));
                freeze = moneyCardUseFreezeService.findByMoneyCardUseId(cardUse.getId());
                cardUse.setFailTime(DateUtil.nextNDate(failTime, freeze.getGapDays()));
                break;
            default:
                return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择无效或者冻结的充值卡");
        }
        proj.setFailTime(moneyCardUse.getFailTime());
        cardUseService.active(proj);
        cardUse.setFailTime(moneyCardUse.getFailTime());
        cardUseService.active(cardUse);
        MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow();
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        moneyCardUseFlow.setCarUseId(cardUse.getId());
        moneyCardUseFlow.setVipId(cardUse.getVipId());
        moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY);
        moneyCardUseFlow.setCreateTime(new Date());
        moneyCardUseFlow.setOperationId(user.getSuId());
        moneyCardUseFlow.setContent("设置为有效");
        moneyCardUseFlowDao.insert(moneyCardUseFlow);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已设置为有效");
    }
@@ -323,9 +333,9 @@
    @RequestMapping(value = "/invalid")
    public @ResponseBody
    AjaxResult invalidTc(MoneyCardUse moneyCardUse) {
        MoneyCardUse proj = cardUseService.findById(moneyCardUse.getId());
        MoneyCardUse cardUse = cardUseService.findById(moneyCardUse.getId());
        //以及转让或者退款的不能在设置为无效
        String status = proj.getStatus();
        String status = cardUse.getStatus();
        switch (status) {
            case Dictionary.TAOCAN_STATUS_TK:
                return new AjaxResult(AjaxResult.STATUS_FAIL, "充值卡已退款");
@@ -334,7 +344,16 @@
            case Dictionary.TAOCAN_STATUS_DJ:
                return new AjaxResult(AjaxResult.STATUS_FAIL, "充值卡已冻结");
        }
        cardUseService.invalid(proj);
        cardUseService.invalid(cardUse);
        MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow();
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        moneyCardUseFlow.setCarUseId(cardUse.getId());
        moneyCardUseFlow.setVipId(cardUse.getVipId());
        moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY);
        moneyCardUseFlow.setCreateTime(new Date());
        moneyCardUseFlow.setOperationId(user.getSuId());
        moneyCardUseFlow.setContent("设置为无效");
        moneyCardUseFlowDao.insert(moneyCardUseFlow);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "已设置为无效");
    }
@@ -365,6 +384,18 @@
    public @ResponseBody
    AjaxResult freeze(MoneyCardUse moneyCardUse) {
        int i = cardUseService.freeze(moneyCardUse);
        cardUseService.invalid(moneyCardUse);
        MoneyCardUse cardUse = cardUseService.findById(moneyCardUse.getId());
        MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow();
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        moneyCardUseFlow.setCarUseId(cardUse.getId());
        moneyCardUseFlow.setVipId(cardUse.getVipId());
        moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CARD_MODIFY);
        moneyCardUseFlow.setCreateTime(new Date());
        moneyCardUseFlow.setOperationId(user.getSuId());
        moneyCardUseFlow.setContent("冻结会员卡");
        moneyCardUseFlowDao.insert(moneyCardUseFlow);
        if (i > 0) {
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, "冻结成功");
        }
zq-erp/src/main/java/com/matrix/system/hive/bean/AchieveNew.java
@@ -192,6 +192,8 @@
    private String vipQueryKey;
    private Long achieveRuleId;
    /**
     * 订单编号
@@ -541,6 +543,13 @@
        this.day = day;
    }
    public Long getAchieveRuleId() {
        return achieveRuleId;
    }
    public void setAchieveRuleId(Long achieveRuleId) {
        this.achieveRuleId = achieveRuleId;
    }
    public String getOrderNo() {
        return orderNo;
zq-erp/src/main/java/com/matrix/system/hive/bean/ShoppingGoods.java
@@ -210,7 +210,7 @@
    /**
     * 单会员是否只买一次
     */
    private String isOnce;
    private Integer isOnce;
    /**
     * 销售平台
@@ -1002,11 +1002,12 @@
        this.saleOffTime = saleOffTime;
    }
    public String getIsOnce() {
    public Integer getIsOnce() {
        return isOnce;
    }
    public void setIsOnce(String isOnce) {
    public void setIsOnce(Integer isOnce) {
        this.isOnce = isOnce;
    }
zq-erp/src/main/java/com/matrix/system/hive/bean/SysProjUseFlow.java
@@ -4,19 +4,18 @@
import com.matrix.core.anotations.Extend;
import com.matrix.core.pojo.EntityDTO;
import com.matrix.core.tools.DateUtil;
import com.matrix.system.common.bean.EntityDTOExt;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**项目余次操作记录
 * @date 2016-07-03 20:53
 */
@Data
public class SysProjUseFlow extends EntityDTO {
    private static final long serialVersionUID = 1L;
@@ -94,107 +93,4 @@
    @Extend
    private String endTime;
    public String getBeginTime() {
        return beginTime;
    }
    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }
    public String getEndTime() {
        return endTime;
    }
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getProjUseId() {
        return projUseId;
    }
    public void setProjUseId(Long projUseId) {
        this.projUseId = projUseId;
    }
    public Integer getSurplusCount() {
        return surplusCount;
    }
    public void setSurplusCount(Integer surplusCount) {
        this.surplusCount = surplusCount;
    }
    public String getIsOver() {
        return isOver;
    }
    public void setIsOver(String isOver) {
        this.isOver = isOver;
    }
    public Date getFailTime() {
        return failTime;
    }
    public void setFailTime(Date failTime) {
        this.failTime = failTime;
    }
    public Double getPrice() {
        return price;
    }
    public void setPrice(Double price) {
        this.price = price;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public Double getBalance() {
        return balance;
    }
    public void setBalance(Double balance) {
        this.balance = balance;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getProjName() {
        return projName;
    }
    public void setProjName(String projName) {
        this.projName = projName;
    }
    public String getOptionType() {
        return optionType;
    }
    public void setOptionType(String optionType) {
        this.optionType = optionType;
    }
}
zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseDao.java
@@ -1,5 +1,6 @@
package com.matrix.system.hive.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.system.hive.bean.MoneyCardUse;
import org.apache.ibatis.annotations.Param;
@@ -15,7 +16,7 @@
 */
public interface MoneyCardUseDao{
public interface MoneyCardUseDao extends BaseMapper<MoneyCardUse> {
    public int insert(MoneyCardUse moneyCardUse);
       
@@ -84,6 +85,7 @@
    public Double  selectVipCardTotalMoney(@Param("vipId") Long vipId);
    List<MoneyCardUse> selectHasValidMoneyCardUse();
    int updateInvalidMoneyCardUse();
    void updateId(@Param("id")Long id, @Param("newId")Long i);
}
zq-erp/src/main/java/com/matrix/system/hive/dao/ShoppingGoodsDao.java
@@ -91,4 +91,6 @@
    int selectShopppingGoodsAipTotal(@Param("record") ShoppingGoodsListDto shoppingGoodsListDto);
    public List<ShoppingGoods> selectByIds(@Param("ids")List<Integer> ids);
    int updateInvalidProduct();
}
zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java
@@ -46,7 +46,7 @@
     */
    public List<SysOrderItem> selectByOrderId(@Param("orderId") Long orderId);
    public Integer selectByGoodsId(@Param("goodsId") Long goodsId);
    public Integer selectByGoodsId(@Param("goodsId") Long goodsId,@Param("vipId") Long vipId);
    public List<SysOrderItem> selectItemByTime(@Param("shopId")Long shopId, @Param("time")Date time);
zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjUseDao.java
@@ -127,7 +127,7 @@
    public int updateTcStatus(@Param("id") Long id, @Param("status") String status);
    List<SysProjUse> selectHasValidProjUse();
    int updateInvalidProjUse();
    List<SysProjUseFlow> selectProjUseFlow(@Param("record") SysProjUseFlow projUseFlow, @Param("pageVo")PaginationVO pageVo);
zq-erp/src/main/java/com/matrix/system/hive/service/imp/MoneyCardUseServiceImpl.java
@@ -1,21 +1,20 @@
package com.matrix.system.hive.service.imp;
import com.matrix.core.constance.MatrixConstance;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.*;
import com.matrix.core.tools.DateUtil;
import com.matrix.system.hive.plugin.util.MoneyUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.MoneyCardUse;
import com.matrix.system.hive.bean.MoneyCardUseFreeze;
import com.matrix.system.hive.bean.SysOrderItem;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.*;
import com.matrix.system.hive.service.MoneyCardUseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
@@ -24,7 +23,7 @@
 * @date 2016-09-17 10:17
 */
@Service("moneyCardUseService")
public class MoneyCardUseServiceImpl implements MoneyCardUseService {
public class MoneyCardUseServiceImpl extends ServiceImpl<MoneyCardUseDao,MoneyCardUse> implements MoneyCardUseService {
    @Autowired
@@ -231,8 +230,7 @@
            }
        }
        moneyCardUseDao.update(proj);
        StringBuilder content = new StringBuilder();
        content.append(proj.getCardName() + "设置有效");
    }
    //设置为失效
zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java
@@ -14,12 +14,14 @@
import com.matrix.system.common.tools.ServiceUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.constance.TableMapping;
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.bean.ShoppingGoods;
import com.matrix.system.hive.bean.ShoppingGoodsAssemble;
import com.matrix.system.hive.bean.ShoppingGoodsCategory;
import com.matrix.system.hive.bean.SysShopInfo;
import com.matrix.system.hive.dao.MoneyCardAssembleDao;
import com.matrix.system.hive.dao.ShoppingGoodsAssembleDao;
import com.matrix.system.hive.dao.ShoppingGoodsDao;
import com.matrix.system.hive.dao.SysShopInfoDao;
import com.matrix.system.hive.plugin.message.StringUtil;
import com.matrix.system.hive.service.ShoppingGoodsService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -27,9 +29,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotNull;
import java.awt.event.WindowStateListener;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -526,7 +526,7 @@
        goodsDetailVo.setGoodsType(shoppingGoods.getGoodType());
        goodsDetailVo.setDesc(shoppingGoods.getDescription());
        goodsDetailVo.setMaxSaleCnt(shoppingGoods.getCarMaxSaleCount());
        goodsDetailVo.setLimitBuyCnt("否".equals(shoppingGoods.getIsOnce()) ? null : shoppingGoods.getIsOnce());
        goodsDetailVo.setLimitBuyCnt(shoppingGoods.getIsOnce());
        goodsDetailVo.setMaxUseCnt(shoppingGoods.getCarUseCount());
        goodsDetailVo.setMeasure(shoppingGoods.getMeasure());
        goodsDetailVo.setVolume(shoppingGoods.getVolume());
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
@@ -498,8 +498,10 @@
            throw new GlobleException("该订单已经收过款,请刷新页面再试!");
        }
        //交易业绩设置是否合理
        //检查交易限制调整
        checkSealLimit(pageOrder);
        //交易业绩设置是否合理
        checkAchieveIsOk(pageOrder);
@@ -535,6 +537,41 @@
        //设置会员积分
        addVipScore(pageOrder);
    }
    /**
     * 检查产品销售次数
     */
    private void checkSealLimit(SysOrder pageOrder) {
         pageOrder.getItems().forEach(item->{
             ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId());
             //最大销售次数检测
             Integer maxNum = shopGoods.getCarMaxSaleCount();
             if (maxNum != null && maxNum != 0) {
                 Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId(),null);
                 if ((buyNum + item.getCount()) > maxNum) {
                     throw new GlobleException(shopGoods.getName() + "已超过最大销售数量");
                 }
                 if ((buyNum + item.getCount()) == maxNum) {
                     if (!shopGoods.getStaus().equals(Dictionary.BUSINESS_STATE_DOWN)) {
                         shopGoods.setStaus(Dictionary.BUSINESS_STATE_DOWN);
                         shoppingGoodsDao.update(shopGoods);
                     }
                 }
             }
             //每人限购次数检测
             Integer onceCount = shopGoods.getIsOnce();
             if(onceCount!=null && onceCount!=0){
                 Integer buyOnceCount = orderItemDao.selectByGoodsId(shopGoods.getId(),pageOrder.getVipId());
                 if ((buyOnceCount + item.getCount()) > onceCount) {
                     throw new GlobleException(shopGoods.getName() + "每人限购"+onceCount+"次");
                 }
             }
         });
    }
@@ -780,7 +817,7 @@
        // 最大发卡数量为0代表不做限制
        if (maxNum != null && maxNum != 0) {
            // 查询该商品已经被购买的次数
            Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId());
            Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId(),null);
            buyNum = (buyNum == null ? 0 : buyNum);
            if ((buyNum + carItem.getCount()) > maxNum) {
                throw new GlobleException(shopGoods.getName() + "已超过最大销售数量");
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjUseServiceImpl.java
@@ -10,7 +10,6 @@
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.*;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.hive.plugin.util.MoneyUtil;
import com.matrix.system.hive.service.SysProjUseService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -230,6 +229,19 @@
        }
        taocan.setStatus(Dictionary.TAOCAN_STATUS_YX);
        sysProjUseDao.updateProjStatus(taocan);
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        SysProjUseFlow useFlow=new SysProjUseFlow();
        useFlow.setProjName(taocan.getProjName());
        useFlow.setProjUseId(taocan.getId());
        useFlow.setOptionType("人工修改");
        useFlow.setRemark("设置为有效状态");
        useFlow.setFailTime(taocan.getFailTime());
        useFlow.setStatus(Dictionary.TAOCAN_STATUS_YX);
        useFlow.setCreateBy(sysUsers.getSuName());
        useFlow.setUpdateBy(sysUsers.getSuName());
        sysProjUseDao.insertFlow(useFlow);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功");
    }
@@ -257,6 +269,19 @@
            } else {
                i = sysProjuseFreezeDao.insert(freeze);
            }
            SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
            SysProjUseFlow useFlow=new SysProjUseFlow();
            useFlow.setProjName(taocan.getProjName());
            useFlow.setProjUseId(taocan.getId());
            useFlow.setOptionType("人工修改");
            useFlow.setStatus(Dictionary.TAOCAN_STATUS_DJ);
            useFlow.setRemark("冻结项目");
            useFlow.setCreateBy(sysUsers.getSuName());
            useFlow.setUpdateBy(sysUsers.getSuName());
            sysProjUseDao.insertFlow(useFlow);
            return i;
        } else {
            throw new GlobleException("未找到套餐");
@@ -302,73 +327,6 @@
        return money;
    }
    public double getTotalMoney(SysProjUse sysProjUse, MoneyCardUse cardUse, Long moneyCardUseId) {
        List<SysProjUse> list = sysProjUseDao.selectByModel(sysProjUse);
        double money = 0;
        if (CollectionUtils.isEmpty(list)) {
            throw new GlobleException("该套餐没有可退款的项目!");
        }
        //判断套餐是否存在欠款
        SysProjUse projuse = list.get(0);
        checkOrderStatu(projuse);
        if (!(projuse.getStatus().equals(Dictionary.TAOCAN_STATUS_YX))) {
            throw new GlobleException("不是有效套餐");
        }
        if (projuse.getSource().contains(Dictionary.TAOCAN_SOURCE_ZR)) {
            throw new GlobleException("转让的套餐不能退款");
        }
        if (projuse.getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)) {
            throw new GlobleException("赠送的套餐不能退款");
        }
        //获取会员卡
        cardUse = moneyCardUseDao.selectVipCard(projuse.getVipId());
        String content;
        //如果是套餐卡
        ShoppingGoodsAssemble shoppingGoodsAssemble = shoppingGoodsAssembleDao.selectById(sysProjUse.getAssembleId());
        ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(shoppingGoodsAssemble.getShoppingGoodsId());
        if (Dictionary.SHOPPING_GOODS_TYPE_TCK.equals(projuse.getType())) {
            money = projuse.getBalance();
            //余次使用流水操作
            content = shoppingGoods.getName() + "退款¥" + projuse.getBalance();
        } else {
            for (SysProjUse itemUser : list) {
                Double emoney = MoneyUtil.mul(Double.parseDouble(itemUser.getSurplusCount() + ""), itemUser.getPrice());
                money = MoneyUtil.add(emoney, money);
            }
            //余次使用流水操作
            content = shoppingGoods.getName() + "退款¥" + money;
        }
        SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        // 1、金额退到该用户的有效会籍卡中
        System.out.println("==========" + cardUse);
        if (moneyCardUseId != null) {
            if (cardUse == null) {
                content += "到现金。";
            } else {
                //SysOrderItem orderItem = orderItemDao.selectById(cardUse.getOrderItemId());
                StringBuilder contentBuild = new StringBuilder();
                contentBuild.append("到" + cardUse.getCardName())
                        .append(",余次:" + cardUse.getLastCountName())
                        .append(",本金余额:" + MoneyUtil.add(cardUse.getRealMoney(), money))
                        .append(",赠送余额:" + cardUse.getGiftMoney())
                        .append(",有效期:" + DateUtil.dateToString(cardUse.getFailTime(), DateUtil.DATE_FORMAT_MM))
                        .append(",是否赠送:" + cardUse.getSourceName());
                content += contentBuild.toString();
                cardUse.setRealMoney(cardUse.getRealMoney() + money);
                ;
                moneyCardUseDao.update(cardUse);
            }
        } else {
            content += "到现金。";
        }
        return money;
    }
    /**
     * 检测是否存在欠款
@@ -400,7 +358,22 @@
                throw new GlobleException("套餐已冻结");
        }
        taocan.setStatus(Dictionary.TAOCAN_STATUS_WX);
        int i = sysProjUseDao.updateTcStatus(sysProjUse.getId(), "无效");
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        SysProjUseFlow useFlow=new SysProjUseFlow();
        useFlow.setProjName(taocan.getProjName());
        useFlow.setProjUseId(taocan.getId());
        useFlow.setOptionType("人工修改");
        useFlow.setStatus(Dictionary.TAOCAN_STATUS_WX);
        useFlow.setRemark("设置为无效状态");
        useFlow.setFailTime(taocan.getFailTime());
        useFlow.setCreateBy(sysUsers.getSuName());
        useFlow.setUpdateBy(sysUsers.getSuName());
        sysProjUseDao.insertFlow(useFlow);
        return i;
    }
@@ -502,6 +475,17 @@
        } else {
            i = sysProjuseFreezeDao.insert(freeze);
        }
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        SysProjUseFlow useFlow=new SysProjUseFlow();
        useFlow.setProjName(sysProjUse.getProjName());
        useFlow.setProjUseId(sysProjUse.getId());
        useFlow.setOptionType("人工修改");
        useFlow.setStatus(Dictionary.TAOCAN_STATUS_DJ);
        useFlow.setRemark("冻结项目");
        useFlow.setCreateBy(sysUsers.getSuName());
        useFlow.setUpdateBy(sysUsers.getSuName());
        sysProjUseDao.insertFlow(useFlow);
        return i;
    }
@@ -527,9 +511,19 @@
                throw new GlobleException("套餐已冻结");
        }
        sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_WX);
        ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(sysProjUse.getProjId());
        String content = shoppingGoods.getName() + "设置为" + sysProjUse.getStatus();
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        SysProjUseFlow useFlow=new SysProjUseFlow();
        useFlow.setProjName(sysProjUse.getProjName());
        useFlow.setProjUseId(sysProjUse.getId());
        useFlow.setOptionType("人工修改");
        useFlow.setStatus(Dictionary.TAOCAN_STATUS_WX);
        useFlow.setRemark("设置为无效状态");
        useFlow.setFailTime(sysProjUse.getFailTime());
        useFlow.setCreateBy(sysUsers.getSuName());
        useFlow.setUpdateBy(sysUsers.getSuName());
        sysProjUseDao.insertFlow(useFlow);
        return sysProjUseDao.update(sysProjUse);
    }
@@ -576,11 +570,19 @@
        }
        proj.setStatus(Dictionary.TAOCAN_STATUS_YX);
        sysProjUseDao.update(proj);
        StringBuilder content = new StringBuilder();
        ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(proj.getProjId());
        content.append(shoppingGoods.getName() + "设置为有效")
                .append(",有效期:" + DateUtil.dateToString(proj.getFailTime(), DateUtil.DATE_FORMAT_MM));
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        SysProjUseFlow useFlow=new SysProjUseFlow();
        useFlow.setProjName(proj.getProjName());
        useFlow.setProjUseId(proj.getId());
        useFlow.setOptionType("人工修改");
        useFlow.setStatus(Dictionary.TAOCAN_STATUS_YX);
        useFlow.setRemark("设置为有效状态");
        useFlow.setFailTime(proj.getFailTime());
        useFlow.setCreateBy(sysUsers.getSuName());
        useFlow.setUpdateBy(sysUsers.getSuName());
        sysProjUseDao.insertFlow(useFlow);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功");
    }
zq-erp/src/main/java/com/matrix/system/job/InvalidTimeJob.java
@@ -1,17 +1,12 @@
package com.matrix.system.job;
import com.matrix.core.tools.LogUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.MoneyCardUse;
import com.matrix.system.hive.bean.SysProjUse;
import com.matrix.system.hive.dao.MoneyCardUseDao;
import com.matrix.system.hive.dao.ShoppingGoodsDao;
import com.matrix.system.hive.dao.SysProjUseDao;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
/**
 * @author wzy19
@@ -25,26 +20,22 @@
    @Autowired
    private MoneyCardUseDao moneyCardUseDao;
    @Autowired
    private ShoppingGoodsDao shoppingGoodsDao;
    @Scheduled(cron = "0 0 0 * * ?")
    public void setProjUseToInvalid() {
        LogUtil.info("#项目,套餐失效任务处理#");
        List<SysProjUse> sysProjUses = sysProjUseDao.selectHasValidProjUse();
        List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectHasValidMoneyCardUse();
        if (CollectionUtils.isNotEmpty(sysProjUses)) {
            sysProjUses.forEach(item -> {
                item.setStatus(Dictionary.MONEYCARD_STATUS_WX);
                sysProjUseDao.update(item);
            });
        }
        if (CollectionUtils.isNotEmpty(moneyCardUses)) {
            moneyCardUses.forEach(item -> {
                item.setStatus(Dictionary.MONEYCARD_STATUS_WX);
                moneyCardUseDao.update(item);
            });
        }
        sysProjUseDao.updateInvalidProjUse();
        moneyCardUseDao.updateInvalidMoneyCardUse();
    }
    @Scheduled(cron = "0 0 0 * * ?")
    public void setProductAutoSoldOut() {
        LogUtil.info("#商品自动下架任务处理#");
        shoppingGoodsDao.updateInvalidProduct();
    }
}
zq-erp/src/main/resources/config/system.properties
@@ -103,6 +103,5 @@
showExcptionUrl=http://test.hive.jyymatrix.cc/showException
#异常信息查询接口
showExcptionUrl=http://test.hive.jyymatrix.cc/showException
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -104,6 +104,9 @@
                    test="(record.shopId!=null and record.shopId!='') or  (record.shopId!='' and record.shopId==0)  ">
                    and a.shop_id = #{record.shopId}
                </if>
                <if test="record.achieveRuleId != null  ">
                    and e.achieve_rule_id = #{record.achieveRuleId}
                </if>
                <if test="record.year != null and record.year !='' ">
                    and YEAR (a.datatime) = #{record.year}
                </if>
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml
@@ -141,6 +141,9 @@
        </set>
        WHERE id=#{id}
    </update>
    <update id="updateId">
        update money_card_use set id=#{newId} where id=#{id}
    </update>
    <!-- 批量删除 -->
@@ -623,8 +626,8 @@
    </select>
    <select id="selectHasValidMoneyCardUse" resultMap="MoneyCardUseSimpleMap">
        select * from money_card_use
    <update id="updateInvalidMoneyCardUse">
        update money_card_use set STATUS='无效'
        where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') and STATUS='有效'
    </select>
    </update>
</mapper>
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
@@ -1255,6 +1255,10 @@
</foreach>
    </update>
    <update id="updateInvalidProduct">
        update shopping_goods set staus = '下架'
        where    date_format(now(), '%Y-%m-%d') > date_format(sale_off_time, '%Y-%m-%d') and staus='上架'
    </update>
    <!-- 根据code查询 -->
zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml
@@ -275,10 +275,13 @@
    </select>
    <!-- 根据商品id查询改商品下单次数总和-->
    <select id="selectByGoodsId" resultType="java.lang.Integer">
        select sum(COUNT) from sys_order_item a
        select IFNULL(sum(COUNT),0) AS total from sys_order_item a
        left join  sys_order b on b.ID=a.ORDER_ID
        where a.GOODS_ID = #{goodsId}
        and b.STATU !='已取消'
        where a.GOODS_ID = #{goodsId}
        <if test="vipId != null">
            and b.vip_id=#{vipId}
        </if>
        and b.STATU ='已付款'
    </select>
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml
@@ -854,10 +854,10 @@
        group by b.id) t
    </select>
    <select id="selectHasValidProjUse" resultMap="SysProjUseMap">
        select * from sys_proj_use
    <update id="updateInvalidProjUse"  >
        update   sys_proj_use set STATUS='无效'
        where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') and STATUS='有效'
    </select>
    </update>
    <resultMap type="SysProjUse" id="TaoCanWithProjMap">
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html
@@ -2,22 +2,22 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
    content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
<link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" th:src="@{/js/function/public.js}"></script>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <LINK rel="Bookmark" href="../images/favicon.ico">
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
    <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
    <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
    <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" th:src="@{/js/function/public.js}"></script>
</head>
<style>
    .table-style {
@@ -38,7 +38,7 @@
    <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-select v-model="form.year" style="width:120px;" placeholder="请选择年份">
                    <el-option v-for="item in years"
                               :key="item"
                               :label="item"
@@ -46,7 +46,7 @@
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.month" style="width:120px;" placeholder="请选择">
                <el-select v-model="form.month" style="width:120px;" placeholder="请选择月份">
                    <el-option v-for="item in months"
                               :key="item"
                               :label="item"
@@ -54,7 +54,7 @@
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.day" style="width:120px;" placeholder="请选择">
                <el-select v-model="form.day" style="width:120px;" placeholder="请选择日">
                    <el-option v-for="item in days"
                               :key="item"
                               :label="item"
@@ -69,7 +69,16 @@
                                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="业绩规则" prop="achieveRuleId">
                <el-select v-model="form.achieveRuleId" filterable placeholder="请选择业绩规则">
                    <el-option
                            v-for="item in achieveRulsList"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="会员">
                <el-input v-model="form.vipQueryKey"></el-input>
            </el-form-item>
@@ -86,9 +95,9 @@
            <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">
                               :key="item.id"
                               :label="item.shopName"
                               :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -116,7 +125,7 @@
            <el-table-column prop="zkTotal" label="订单金额"></el-table-column>
            <el-table-column prop="goodsCash" label="现金"></el-table-column>
            <el-table-column prop="cardCash" label="划扣"></el-table-column>
<!--            <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>-->
            <!--            <el-table-column prop="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">
@@ -156,6 +165,7 @@
        data : {
            tableData : [],
            customColumns : [],
            achieveRulsList : [],
            shopList : [],
            achieveUsers : [],
            years : [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021],
@@ -168,6 +178,7 @@
                timeRange : '',
                vipQueryKey : '',
                beaultId : '',
                achieveRuleId : '',
                shopId : ''
            },
            page : {
@@ -181,6 +192,7 @@
            this.queryCustomColumns();
            this.queryShops();
            this.queryAchieveUsers();
            this.getAchieveRule();
        },
        methods : {
            queryTableData () {
@@ -190,6 +202,7 @@
                let page = _this.page;
                let params = {};
                params.year=form.year;
                params.achieveRuleId=form.achieveRuleId;
                params.month=form.month;
                params.year=form.year;
                params.day=form.day;
@@ -225,6 +238,20 @@
                    }
                });
            },
            /**
             * 获取规则
             */
            getAchieveRule(){
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data: {pageNum:1,pageSize:1000},
                    url: basePath + "/admin/achieveRule/selectList",
                    callback: function (data) {
                        _this.achieveRulsList=data.rows;
                    }
                });
            },
            queryShops() {
                let _this = this;
                AjaxProxy.requst({
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html
@@ -2,22 +2,22 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
    content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
<link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" th:src="@{/js/function/public.js}"></script>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <LINK rel="Bookmark" href="../images/favicon.ico">
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
    <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
    <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
    <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" th:src="@{/js/function/public.js}"></script>
</head>
<style>
    .table-style {
@@ -38,7 +38,7 @@
    <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-select v-model="form.year" style="width:120px;" placeholder="请选择年份">
                    <el-option v-for="item in years"
                               :key="item"
                               :label="item"
@@ -46,7 +46,7 @@
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.month" style="width:120px;" placeholder="请选择">
                <el-select v-model="form.month" style="width:120px;" placeholder="请选择月份">
                    <el-option v-for="item in months"
                               :key="item"
                               :label="item"
@@ -54,7 +54,7 @@
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="form.day" style="width:120px;" placeholder="请选择">
                <el-select v-model="form.day" style="width:120px;" placeholder="请选择日">
                    <el-option v-for="item in days"
                               :key="item"
                               :label="item"
@@ -69,7 +69,16 @@
                                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="业绩规则" prop="achieveRuleId">
                <el-select v-model="form.achieveRuleId" filterable placeholder="请选择业绩规则">
                    <el-option
                            v-for="item in achieveRulsList"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="会员">
                <el-input v-model="form.vipQueryKey"></el-input>
            </el-form-item>
@@ -86,9 +95,9 @@
            <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">
                               :key="item.id"
                               :label="item.shopName"
                               :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -100,9 +109,7 @@
    </el-row>
    <el-row class="table-style">
        <el-table :data="tableData"
                  :height="height"
                  style="width: 100%">
        <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="订单编号">
@@ -118,7 +125,7 @@
            <el-table-column prop="zkTotal" label="订单金额"></el-table-column>
            <el-table-column prop="goodsCash" label="现金"></el-table-column>
            <el-table-column prop="cardCash" label="划扣"></el-table-column>
<!--            <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>-->
            <!--            <el-table-column prop="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">
@@ -158,9 +165,9 @@
        data : {
            tableData : [],
            customColumns : [],
            achieveRulsList : [],
            shopList : [],
            achieveUsers : [],
            height:'calc(100vh - 240px)',
            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 : [],
@@ -171,6 +178,7 @@
                timeRange : '',
                vipQueryKey : '',
                beaultId : '',
                achieveRuleId : '',
                shopId : ''
            },
            page : {
@@ -184,6 +192,7 @@
            this.queryCustomColumns();
            this.queryShops();
            this.queryAchieveUsers();
            this.getAchieveRule();
        },
        methods : {
            queryTableData () {
@@ -193,6 +202,7 @@
                let page = _this.page;
                let params = {};
                params.year=form.year;
                params.achieveRuleId=form.achieveRuleId;
                params.month=form.month;
                params.year=form.year;
                params.day=form.day;
@@ -206,6 +216,7 @@
                    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"):'';
                }
                AjaxProxy.requst({
                    app: _this,
                    data: params,
@@ -227,6 +238,20 @@
                    }
                });
            },
            /**
             * 获取规则
             */
            getAchieveRule(){
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data: {pageNum:1,pageSize:1000},
                    url: basePath + "/admin/achieveRule/selectList",
                    callback: function (data) {
                        _this.achieveRulsList=data.rows;
                    }
                });
            },
            queryShops() {
                let _this = this;
                AjaxProxy.requst({
zq-erp/src/test/java/com/matrix/JyyTests.java
@@ -1,53 +1,30 @@
package com.matrix;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.matrix.component.redis.RedisClient;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.LogUtil;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysFunction;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao;
import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanGrade;
import com.matrix.system.fenxiao.entity.ShopSalesmanOrder;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysOrderDao;
import com.matrix.system.hive.dao.SysOrderItemDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.hive.service.CodeService;
import com.matrix.system.hive.service.ShoppingGoodsService;
import com.matrix.system.hive.service.SysOrderService;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.system.hive.bean.MoneyCardUse;
import com.matrix.system.hive.dao.MoneyCardUseDao;
import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl;
import com.matrix.system.score.dao.ScoreVipDetailDao;
import com.matrix.system.score.service.ScoreVipDetailService;
import com.matrix.system.shopXcx.bean.ShopOrder;
import com.matrix.system.shopXcx.bean.ShopOrderDetails;
import com.matrix.system.shopXcx.bean.ShopProduct;
import com.matrix.system.shopXcx.dao.ShopOrderDao;
import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao;
import com.matrix.system.shopXcx.dao.ShopOrderV2Dao;
import com.matrix.system.shopXcx.dao.ShopSkuDao;
import com.matrix.system.shopXcx.mqTask.OrderDingDingNoticeTask;
import com.rabbitmq.client.Delivery;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 测试类示例
@@ -81,6 +58,23 @@
    @Autowired
    OrderDingDingNoticeTask orderDingDingNoticeTask;
    @Autowired
    MoneyCardUseDao moneyCardUseDao;
    @Test
    public void finxMoneyCardUserId() throws IOException {
        long id=2531;
        final List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectList(new LambdaQueryWrapper<MoneyCardUse>().gt(MoneyCardUse::getId, 2531));
        for (MoneyCardUse moneyCardUs : moneyCardUses) {
            moneyCardUseDao.updateId(moneyCardUs.getId(),++id);
        }
        System.out.println(moneyCardUses.size());
    }
    @Test
    @Rollback
    public void testNoticeTask() throws IOException {