deeb762c202ed7d2eee2c9e0558e5f2ab466eec1..75ac3d5acdd448f063a3c307b4c733e37b4fc04f
2025-02-08 jiangping
Merge remote-tracking branch 'origin/dev' into dev
75ac3d 对比 | 目录
2025-02-08 jiangping
aaa
3c4d48 对比 | 目录
已添加2个文件
已删除1个文件
已修改18个文件
283 ■■■■ 文件已修改
.idea/compiler.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/.idea/compiler.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/.idea/encodings.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/java/com/doumee/api/business/CateParamSelectController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/java/com/doumee/api/business/GoodsController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/resources/application.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/resources/logback-spring.xml 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/pom.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/CateParamMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/GoodsParamMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/BaseGoods.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/GoodsParam.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/CateParamSelectService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/impl/CateParamSelectServiceImpl.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/resources/application-proV2.yml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/resources/logback-spring.xml 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/resources/mappers/CateParamSelectMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/zhubo/src/main/resources/application.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/compiler.xml
@@ -2,6 +2,7 @@
<project version="4">
  <component name="CompilerConfiguration">
    <annotationProcessing>
      <profile default="true" name="Default" enabled="true" />
      <profile name="Maven default annotation processors profile" enabled="true">
        <sourceOutputDir name="target/generated-sources/annotations" />
        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
server/.idea/compiler.xml
@@ -8,12 +8,21 @@
        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
        <outputRelativeToContentRoot value="true" />
        <module name="pre_select" />
        <module name="company" />
        <module name="zhubo" />
        <module name="platform" />
        <module name="service" />
      </profile>
    </annotationProcessing>
  </component>
  <component name="JavacSettings">
    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
      <module name="company" options="-parameters" />
      <module name="platform" options="-parameters" />
      <module name="pre_select" options="-parameters" />
      <module name="preselect" options="-parameters" />
      <module name="service" options="-parameters" />
      <module name="zhubo" options="-parameters" />
    </option>
  </component>
</project>
server/.idea/encodings.xml
@@ -1,7 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="Encoding">
    <file url="file://$PROJECT_DIR$/company/src/main/java" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/company/src/main/resources" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/platform/src/main/java" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/platform/src/main/resources" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/service/src/main/java" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/service/src/main/resources" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/zhubo/src/main/java" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/zhubo/src/main/resources" charset="UTF-8" />
  </component>
</project>
server/company/src/main/java/com/doumee/api/business/CateParamSelectController.java
@@ -93,7 +93,7 @@
    @ApiOperation("更新企业商品分类选择项")
    @PostMapping("/renewCateParamSelect")
    public ApiResponse renewCateParamSelect() {
        cateParamSelectService.dealCateParamSelect();
        cateParamSelectService.dealCateParamSelectDo();
        return ApiResponse.success("同步操作成功");
    }
server/company/src/main/java/com/doumee/api/business/GoodsController.java
@@ -147,7 +147,7 @@
        return ApiResponse.success(val);
    }
    @ApiOperation("导入图片模板")
    @PostMapping("/importExcel")
    @PostMapping("/importImgExcel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class),
    })
server/company/src/main/resources/application.yml
@@ -5,13 +5,14 @@
  env: development
#  env: production
server:
  port: 10022
#  port: 10022
  port: 10025
spring:
#  application:git
#    name: doumeemes
  profiles:
    active: dev
    active: pro
  # JSON返回配置
  jackson:
@@ -54,7 +55,7 @@
# dao层的日志设置为debug,方便查看sql
logging:
  level:
    doumeemes.dao: debug
    com.doumee.dao: debug
knife4j:
  enable: true
server/company/src/main/resources/logback-spring.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%highlight(%date{yyyy-MM-dd HH:mm:ss}) | %highlight(%-5level) | %highlight(%thread) | %highlight(%logger) | %msg%n</pattern>
        </layout>
    </appender>
    <property name="log.path" value="/mnt/sdc/jars/preselect_saas/jars/v2/log/company"></property>
    <property name="log.fileSize" value="100MB"></property>
    <property name="log.historyDays" value="7"></property>
    <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>ERROR</level>
            <!--匹配就舍去-->
            <onMatch>DENY</onMatch>
            <onMismatch>ACCEPT</onMismatch>
        </filter>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <!--路径-->
            <fileNamePattern>${log.path}/info.%d.%i.log</fileNamePattern>
            <maxFileSize>${log.fileSize}</maxFileSize>
            <maxHistory>${log.historyDays}</maxHistory>
            <totalSizeCap>1GB</totalSizeCap>
        </rollingPolicy>
    </appender>
    <appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>ERROR</level>
        </filter>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
        </encoder>
        <!--滚动策略-->
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <!--路径-->
            <fileNamePattern>${log.path}/error.%d.%i.log</fileNamePattern>
            <maxFileSize>${log.fileSize}</maxFileSize>
            <maxHistory>${log.historyDays}</maxHistory>
            <totalSizeCap>1GB</totalSizeCap>
        </rollingPolicy>
    </appender>
    <!-- å¼‚步写入日志 -->
    <appender name ="ASYNC" class= "ch.qos.logback.classic.AsyncAppender">
        <!-- ä¸ä¸¢å¤±æ—¥å¿—.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
        <discardingThreshold >0</discardingThreshold>
        <!-- æ›´æ”¹é»˜è®¤çš„队列的深度,该值会影响性能.默认值为256 -->
        <queueSize>512</queueSize>
        <!-- æ·»åŠ é™„åŠ çš„appender,最多只能添加一个 -->
        <appender-ref ref ="fileInfoLog"/>
    </appender>
    <root level="info">
        <appender-ref ref="consoleLog"/>
        <appender-ref ref="fileInfoLog"/>
        <appender-ref ref="fileErrorLog"/>
    </root>
</configuration>
server/pom.xml
@@ -30,7 +30,7 @@
    <swagger.bootstrap-ui.version>1.9.6</swagger.bootstrap-ui.version>
    <fastjson.version>1.2.70</fastjson.version>
    <druid.version>1.2.0</druid.version>
    <mybatis.plus.version>3.4.2</mybatis.plus.version>
    <mybatis.plus.version>3.5.7</mybatis.plus.version>
    <apache.shiro.version>1.7.0</apache.shiro.version>
    <oshi.version>5.7.0</oshi.version>
    <jna.version>5.7.0</jna.version>
@@ -63,7 +63,7 @@
    <dependency>
      <groupId>com.github.pagehelper</groupId>
      <artifactId>pagehelper-spring-boot-starter</artifactId>
      <version>1.2.13</version>
      <version>2.1.0</version>
    </dependency>
    <!-- è¿žæŽ¥æ±  -->
    <dependency>
server/service/src/main/java/com/doumee/dao/business/CateParamMapper.java
@@ -2,11 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.CateParam;
import com.github.yulichang.base.MPJBaseMapper;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2023/05/12 13:58
 */
public interface CateParamMapper extends BaseMapper<CateParam> {
public interface CateParamMapper extends MPJBaseMapper<CateParam> {
}
server/service/src/main/java/com/doumee/dao/business/GoodsParamMapper.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.GoodsParam;
import com.github.yulichang.base.MPJBaseMapper;
import java.util.List;
@@ -9,7 +10,7 @@
 * @author æ±Ÿè¹„蹄
 * @date 2023/05/12 13:58
 */
public interface GoodsParamMapper extends BaseMapper<GoodsParam> {
public interface GoodsParamMapper extends MPJBaseMapper<GoodsParam> {
    void insertBatch(List<GoodsParam> goodsParamList);
}
server/service/src/main/java/com/doumee/dao/business/model/BaseGoods.java
@@ -62,7 +62,7 @@
    @ApiModelProperty(value = "排序码", example = "1")
    @ExcelColumn(name="排序码")
    private Integer sortnum;
    private Long sortnum;
    @ApiModelProperty(value = "图标")
    @ExcelColumn(name="图标")
server/service/src/main/java/com/doumee/dao/business/model/GoodsParam.java
@@ -1,5 +1,6 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -74,5 +75,8 @@
    @ApiModelProperty(value = "商品编码(关联goods表)", example = "1")
    @ExcelColumn(name="商品编码(关联goods表)")
    private Integer goodsId;
    @ApiModelProperty(value = "分类编码 ", example = "1")
    @TableField(exist = false)
    private Integer categoryId;
}
server/service/src/main/java/com/doumee/service/CateParamSelectService.java
@@ -98,4 +98,5 @@
    long count(CateParamSelect cateParamSelect);
    void dealCateParamSelect();
    void dealCateParamSelectDo();
}
server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java
@@ -85,7 +85,7 @@
//            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【"+baseGoods.getName()+"】已存在");
//        }
        Integer integer = baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO));
        Long integer = baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO));
        BaseGoods insert = new BaseGoods();
        insert.setCreator(user.getId());
        insert.setCreateDate(new Date());
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -140,7 +140,7 @@
                .eq(SystemUser::getType,Constants.ONE)
                .eq(SystemUser::getDeleted,Boolean.FALSE)
                .eq(SystemUser::getUsername,company.getManagerUserName());
        Integer integer = systemUserMapper.selectCount(query);
        Long integer = systemUserMapper.selectCount(query);
        if (integer > Constants.ZERO){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"账号已存在请重新输入账号");
        }
server/service/src/main/java/com/doumee/service/impl/CateParamSelectServiceImpl.java
@@ -4,14 +4,23 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CateParamMapper;
import com.doumee.dao.business.CateParamSelectMapper;
import com.doumee.dao.business.GoodsParamMapper;
import com.doumee.dao.business.model.CateParam;
import com.doumee.dao.business.model.CateParamSelect;
import com.doumee.dao.business.model.Goods;
import com.doumee.dao.business.model.GoodsParam;
import com.doumee.service.CateParamSelectService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@@ -20,6 +29,8 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -35,6 +46,8 @@
    @Autowired
    private CateParamSelectMapper cateParamSelectMapper;
    @Autowired
    private GoodsParamMapper goodsParamMapper;
    @Override
    public Integer create(CateParamSelect cateParamSelect) {
@@ -154,12 +167,16 @@
    @Override
    @Async
    @Transactional
    public  void dealCateParamSelect() {
        dealCateParamSelectDo();
    }
    @Override
    @Transactional
    public  void dealCateParamSelectDo() {
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        Boolean  isGrouping = (Boolean)redisTemplate.opsForValue().get(loginUserInfo.getCompanyId()+Constants.CATE_PARAM_OPEN);
        if(isGrouping!=null && isGrouping ){
            return;
           throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业参数选项初始化正在执行,请稍后重试!");
        }
        redisTemplate.opsForValue().set(loginUserInfo.getCompanyId()+Constants.CATE_PARAM_OPEN,true);
        try {
@@ -167,6 +184,45 @@
            cateParamSelectMapper.delete(new QueryWrapper<CateParamSelect>().exists(" select 1 from category c where c.id = cate_param_select.category_id and  c.company_id = "+loginUserInfo.getCompanyId()+"   "));
            //新增当前企业可以使用的数据
            cateParamSelectMapper.insertBatch(loginUserInfo.getCompanyId(),loginUserInfo.getId());
            /*List<CateParamSelect> list = new ArrayList<>();
            List<GoodsParam> params = goodsParamMapper.selectJoinList(GoodsParam.class,new MPJLambdaWrapper<GoodsParam>()
                    .select( GoodsParam::getPramaId)
                    .select( "TRIM(REPLACE(t.val,' ','')) as val,CONCAT(TRIM(REPLACE(t.val,' ','')),t.PRAMA_ID,t1.CATEGORY_ID ) as uky")
                    .selectAs(Goods::getCategoryId,CateParamSelect::getCategoryId)
                    .innerJoin(Goods.class,Goods::getId,GoodsParam::getGoodsId)
                    .isNotNull(GoodsParam::getPramaId)
                    .isNotNull(GoodsParam::getVal)
                    .ne(GoodsParam::getVal,"")
                    .eq(Goods::getIsdeleted,Constants.ZERO )
                    .eq(Goods::getStatus,Constants.ZERO )
                    .eq(Goods::getCompanyId,loginUserInfo.getCompanyId())
                    .groupBy("uky")
            );
            if(params.size()>0){
                Date date = new Date();
                for(GoodsParam p : params){
                    if(StringUtils.isBlank(p.getVal()) || StringUtils.equals(p.getVal().trim(),"")){
                        continue;
                    }
                    if(repeatValParam(p,list)){
                        continue;
                    }
                    p.setVal(p.getVal().trim());
                    CateParamSelect cp = new CateParamSelect();
                    cp.setCategoryId(p.getCategoryId());
                    cp.setName(p.getVal());
                    cp.setIsdeleted(Constants.ZERO);
                    cp.setCreateDate(date);
                    cp.setParamId(p.getPramaId());
                    cp.setStatus(Constants.ZERO);
                    cp.setCreator(loginUserInfo.getId());
//                    cateParamSelectMapper.insert(cp);
                    list.add(cp);
                }
            }
            if(list.size()>0){
                cateParamSelectMapper.insert(list);
            }*/
        }catch (Exception e){
            e.printStackTrace();
        }finally {
@@ -174,5 +230,16 @@
        }
    }
    private boolean repeatValParam(GoodsParam p, List<CateParamSelect> list) {
        for(CateParamSelect cp :list){
            if(StringUtils.equals(cp.getName(),p.getVal())
                    && Constants.equalsInteger(cp.getParamId(),p.getPramaId())
                    && Constants.equalsInteger(cp.getCategoryId(),p.getCategoryId())){
                return true;
            }
        }
        return false;
    }
}
server/service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
@@ -1,6 +1,5 @@
package com.doumee.service.system.impl;
import com.baomidou.mybatisplus.extension.api.R;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
server/service/src/main/resources/application-proV2.yml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
# WEB服务器配置
server:
  compression:
    enabled: true
    mime-types: application/json
  tomcat:
    max-swallow-size: -1
  servlet:
    session:
      timeout: PT3H  #表示12小时
spring:
  # æ•°æ®æºé…ç½®
  datasource:
    url: jdbc:mysql://57b57595ddc66.sh.cdb.myqcloud.com:4464/pre_select_saas?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
    username: test
    password: doumee@168
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
  redis:
    #    database: 0
    host: 127.0.0.1
    port: 6379
    password:
    timeout: 5000      # è¿žæŽ¥æ± ä¸­çš„æœ€å°ç©ºé—²è¿žæŽ¥
  jackson:
    time-zone: GMT+8
    date-format: yyyy-MM-dd HH:mm:ss
knife4j:
  enable: true
  basic:
    enable: true
    username: admin
    password: 111111
debug_model: false
captcha_check: true
# Swagger配置
swagger:
  host:
  title: ${project.name}接口文档
  description: ${project.name}接口文档
  enabled: true
  # ç¦ç”¨swagger时的重定向地址
  redirect-uri: /
server/service/src/main/resources/logback-spring.xml
ÎļþÒÑɾ³ý
server/service/src/main/resources/mappers/CateParamSelectMapper.xml
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.doumee.dao.business.CateParamSelectMapper">
    <insert id="insertBatch"  >
        INSERT INTO `cate_param_select`
            (`CREATOR`, `CREATE_DATE`, `EDITOR`, `EDIT_DATE`, `ISDELETED`, `REMARK`, `NAME`, `PARAM_ID`, `CATEGORY_ID`,
             `STATUS`, `SORTNUM`)
            select DISTINCT #{userId} , now(),null , null , 0 , null , a.VAL , a.PRAMA_ID , b.CATEGORY_ID , 0 , null  from goods_param a  inner join goods  b on a.GOODS_ID = b.ID
            select DISTINCT #{userId} , now(),null , null , 0 , null , TRIM(REPLACE(a.val,' ','')), a.PRAMA_ID , b.CATEGORY_ID , 0 , null  from goods_param a  inner join goods  b on a.GOODS_ID = b.ID
                and a.PRAMA_ID is not null AND a.VAL is not null
                and a.ISDELETED = 0
                and a.`STATUS` = 0
server/zhubo/src/main/resources/application.yml
@@ -5,13 +5,14 @@
  env: development
#  env: production
server:
  port: 10024
#  port: 10024
  port: 10026
spring:
#  application:
#    name: doumeemes
  profiles:
    active: dev
    active: pro
  # JSON返回配置
  jackson: