没用的经验,一定要忘记它

392 阅读2分钟

2019/08/22 统计文件:10068 代码行数:1229438 注释行数:195459 空白行数:157984

1.pom文件报错,反复maven clean maven compiler
新工具搜下教程,再尝试html直接用Chrome测,防止项目配置问题影响效率
测试时,各种报错默认生成就好了 不懂为何被拦截,直接全局搜索/app/ shiro

2.tomcat server.xml设置了8080端口,访问项目为什么用的80端口
阿里云解析域名,nginx反向代理80端口,直接用域名访问项目`

3.swagger2默认不展开/展开 http://localhost:8080/swagger-ui.html?docExpansion=list docExpansion:none(不展开) list(展开operations) full(全部展开)

41.搜索看下StringUtils.isNotBlank(type) Mybatis
Interceptor z.SqlInterceptor DynamicSource

thymeleaf 超级弱 √ 查缺补漏 输入框th:value="{openId}"  其他th:text th:href th:src
    拼接url 
        th:href="@{/a/b(id={id})}" th:href="@{'/a/b/'+${id}}"

Java截取list
	List<Water> waters = water.subList(0, water.size() >= 12 ? 11 : water.size());

js array remove方法不存在
    // 下标为5删除1位,返回删除项
    var types = type1.concat(type2).splice(5, 1);	
获取表格第一行第二个单元格的数据
    $('.table tr:first td:nth-child(2)').text()
查看table任意单元格的值
    $('table').find('tr').eq(i).find('td').eq(j).text();
获取table总行数
    $('table tr').size();
获取table总列数
    $('table td').size();
ajax get传值
      $.ajax({
        type: 'get',
        url: ctx + 'api/order/jsapi',
        data: {
            openId: $('.table tr:first td:nth-child(3)').text(),
            accountId: $('.table tr:first td:nth-child(2)').text(),
            payment: $('.money').val()
        }
日期格式
    yyyy/MM

http://localhost/wx/[object%20Object] 400 ctx值有问题

http状态码
static 404 不需清理Chrome缓存,mvn clean就好了

400 数据类型对不上,id、name、tel与account对不上 url错误

5.Kafka
下载选择Binary downloads
zkServer
.\bin\windows\kafka-server-start.bat .\config\server.properties
在Windows安装运行Kafka

6.ES

// API基本格式 http://:/<索引>/类型>/<文档id>
UpdateResponse response = this.esClient.prepareUpdate(INDEX_NAME, INDEX_TYPE, esId)
        .setDoc(objectMapper.writeValueAsBytes(indexTemplate), XContentType.JSON).get();

// deleteAndCreate()
DeleteByQueryRequestBuilder builder = DeleteByQueryAction.INSTANCE
        .newRequestBuilder(esClient)
        .filter(QueryBuilders.termQuery(HouseIndexKey.HOUSE_ID, indexTemplate.getHouseId()))
        .source(INDEX_NAME);
BulkByScrollResponse response = builder.get();
long deleted = response.getDeleted();
if (deleted != totalHit) {
cd /opt/cf/logs
cat sys-error.log | grep -e "1[3-4]"
Ctrl+C 退出命令行

cd /opt/app
nohup java -jar manager.jar &
ps aux|grep manager.jar

blog.csdn.net/u012190514/…

8.mysql

tel like concat(#{tel}, '%')

<div class="form-group">
  <label class="control-label">手机号:</label>
  <div class="control-inline">
    <input type="text" name="tel" class="form-control"/>
  </div>
</div>

0726.[HY000][1366] Incorrect string value: '\xE8\x8B\xA5\xE4\xBE\x9D...' for column 'dept_name' at row 1
建表SQL engine=innodb替换成engine=innodb DEFAULT CHARSET = utf8 

n.示例代码

 // 获取表中的数据
    function data() {
        var search = {};
        $.each(form.serializeArray(), function (i, field) {
            search[field.name] = field.value;
        });
        var payTypes = $('.payType:checked');
        var length = payTypes.length;
        for (var i = 0; i < length; i++) {
            search['payType[' + i + ']'] = payTypes[i].value;
        }
        return search;
    }
  
 // 批量删除  
    <delete id="deleteDrugByIds" parameterType="String">
        delete from drug where drug_id in 
        <foreach item="drugId" collection="array" open="(" separator="," close=")">
            #{drugId}
        </foreach>
    </delete>
    
// lambda表达式
    List<SysDictData> payBarType = dictDataService.selectDictDataByType("pay_bar_type");
        List<SysDictData> payOtherType = dictDataService.selectDictDataByType("pay_other_type")
                .stream().filter(field -> !("余额转存").equals(field.getDictLabel())).collect(Collectors.toList());
        List<SysDictData> payType = Stream.of(payBarType, payOtherType).flatMap(Collection::stream).distinct().collect(Collectors.toList());
        
// 垃圾代码 TODO
    var type1 = [[${@dict.getType('pay_bar_type')}]];
    var type2 = [[${@dict.getType('pay_other_type')}]];
    var arr = type1.concat(type2);
    var types = [];
    for (var i = 0; i < arr.length; i++) {
        if(i !== 5){
            types.push(arr[i]);
        }
    }
    
// thymeleaf遍历
    <th th:id="'type_' + ${dictStat.index}" th:each="dict : ${@dict.getType('pay_other_type')}" th:if="${dict.dictValue} neq '4'"
          th:attr="type=${dict.dictValue}" th:title="${dict.dictLabel}">
        <div class="th-inner " th:text="${dict.dictLabel}"></div>
        <div class="fht-cell"></div>
      </th>
      
// 原来     
     for (var j = 0; j < length; j++) {
        var typeObj = $('#type_' + j);
        var type = typeObj.attr('type');
        var typeName = typeObj.attr('title');
        obj[j] = {};
        obj[j].name = typeName;
        if (data[i]['result'][type] === undefined) {
            html.push("<td>0</td>");
            obj[j].value = 0;
        } else {
            html.push('<td>' + temp + '</td>');
            obj[j].value = data[i]['result'][type];
        }
        sum = math.parser().eval(sum + "+" + obj[j].value).d[0];
    }
// 我
    for (var j = 0; j < length; j++) {
                var typeObj = $('#type_' + j);
                var type = typeObj.attr('type');
                var typeName = typeObj.attr('title');
                obj[j] = {};
                obj[j].name = typeName;
                var temp = data[i]['result'][types[j].dictValue];
                if (temp === undefined) {
                    html.push('<td>0</td>');
                } else {
                    html.push('<td>' + temp + '</td>');
                    obj[j].value = temp;
                    sum = math.parser().eval(sum + '+' + temp).d[0];
                }
            }  
          
// 缴费方式
    var types = [[${@dict.getType('pay_bar_type' && 'pay_other_type')}]]
    var types = [[${@dict.getType('pay_bar_type')}]] && [[${@dict.getType('pay_other_type')}]]
     
    var type1 = [[${@dict.getType('pay_bar_type')}]];
        var type2 = [[${@dict.getType('pay_other_type')}]];
        var arr = type1.concat(type2);
        var types = [];
        for (var i = 0; i < arr.length; i++) {
            if (i !== 5) {
                types.push(arr[i]);
            }
        }

3.单词
Devtools property defaults active(活跃)

4.bug

1.Failure to find com.fasterxml.jackson:jackson-bom:pom:1.9.13 in https://repo.spring.io/milestone was cached in the local repository, resolution will not be reattempted until the update interval of spring-milestones has elapsed or updates are forced
    博客:https://blog.csdn.net/weixin_43232196/article/details/82760093
    处理方式:改成存在的版本、手动将jar包下载本地maven仓库
    
2.Mapper.xml if 需要>或/>结尾
    处理方式:selectDrugList if写错了,改正就好了

3.### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group by account.id) tmp_count' at line 18; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group by account.id) tmp_count' at line 18]
4.今天解决了迷之bug,jar包项目thymeleaf报500。去掉斜杆就好了[捂脸]
https://heiyogl.github.io/2018/04/01/SpringBoot-%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E6%A8%A1%E6%9D%BF%E5%BC%95%E5%85%A5%E9%94%99%E8%AF%AF/

TODO 源码屡业务,表字段全部注释好,生成数据库文档 各种数据类型的非空判断 鼠标回到上次位置 idea光标移到上一位置 guava

工具破解 Charles www.zzzmode.com/mytools/cha…

重写hashCode Override ry->new project

结果:sys-user.log->登录信息 logback.xml 阿里云短信可以在本地测

大都会 西江月 浣溪沙 找电商开源项目 一家三口在三个国家