1.增加品规配置读取

2.盘点确认增加品规和个数修改
bozhou-古井贡酒
LAPTOP-S9HJSOEB\昊天 2 years ago
parent b853c28264
commit 13c5d48ce1

@ -43,6 +43,7 @@ public class ConfigProperties {
private VisualSense visualSense;
private Integer orderTest = 0;
private String productDoc;
@Data
public static class VisualSense{

@ -147,6 +147,13 @@ public class StockController {
validatorUtil.validate(stockCheck);
return Result.success(stockService.checkCorrect(stockCheck));
}
@ApiOperation(value = "获取品规列表")
@RequestMapping(value = "/getCategoryList", method = RequestMethod.POST)
public Result<List<String>> getCategoryList() {
List<String> list = stockService.getCategoryList();
return Result.success(list);
}
@ApiOperation(value = "人工复核")
@RequestMapping(value = "/checkByMan", method = RequestMethod.POST)

@ -27,4 +27,7 @@ public class StockCheck {
@ApiModelProperty("列")
private Integer column;
private String category;
private Integer count;
}

@ -847,14 +847,14 @@ public class PlcService {
String code = dataInfo.getCmdName();
log.info("盘点指令:{}", ksecInfo);
{
AlgorithmPojo algorithmPojo = check(plcCmdInfo, ksecInfo.getType(), dataInfo);
ksecInfo.getData().setAckStatus(1);
dataInfo.setResult(algorithmPojo.getResult());
dataInfo.setGoodsTypeResult(algorithmPojo.getGoodsTypeResult());
dataInfo.setGoodsNumberResult(algorithmPojo.getGoodsNumberResult());
log.info("盘点完成");
} if (configProperties.getOrderTest() == 1) {
if (configProperties.getOrderTest() == 1) {
checkTest(plcCmdInfo);

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhehekeji.core.util.Assert;
import com.zhehekeji.web.config.ConfigProperties;
import com.zhehekeji.web.entity.Stock;
import com.zhehekeji.web.entity.CheckLog;
import com.zhehekeji.web.entity.StockLog;
@ -16,6 +17,7 @@ import com.zhehekeji.web.mapper.StockMapper;
import com.zhehekeji.web.mapper.StreetMapper;
import com.zhehekeji.web.pojo.category.PageSearch;
import com.zhehekeji.web.pojo.stock.*;
import com.zhehekeji.web.util.FileUtil;
import com.zhehekeji.web.util.ToolUtil;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
@ -37,6 +39,8 @@ public class StockService {
@Resource
private StockMapper stockMapper;
@Resource
ConfigProperties configProperties;
@Resource
private StreetService streetService;
@Resource
private CheckLogMapper logMapper;
@ -380,7 +384,10 @@ public class StockService {
log.info("check stock correct, street_id:{},direction:{},side:{},row:{},column:{}", stockCheck.getStreetId(),stockCheck.getDirection(),stockCheck.getSide(), stockCheck.getRow(), stockCheck.getColumn());
stock.setStatus(StockStatus.MANUAL.getStatus());
stock.setCount(stockCheck.getCount());
stock.setCategory(stockCheck.getCategory());
stockMapper.updateById(stock);
stock = stockMapper.selectById(stock.getId());
checkLog(stock);
return stock;
}
@ -389,7 +396,9 @@ public class StockService {
private CheckLogMapper checkLogMapper;
private void checkLog(Stock stock){
CheckLog checkLog = new CheckLog();
CheckLog checkLog = checkLogMapper.selectOne(new QueryWrapper<CheckLog>()
.eq("check_num",stock.getCheckNum())
.last("limit 1"));
checkLog.setRow(stock.getRow());
checkLog.setColumn(stock.getColumn());
checkLog.setCheckNum(stock.getCheckNum());
@ -398,7 +407,7 @@ public class StockService {
checkLog.setStatus(stock.getStatus());
checkLog.setCode(stock.getCode());
checkLog.setCreateTime(LocalDateTime.now());
checkLogMapper.insert(checkLog);
checkLogMapper.updateById(checkLog);
}
/**
@ -455,24 +464,13 @@ public class StockService {
stockMapper.truncate();
}
// public void init(String shelveId, Integer row, Integer column){
// Map<String,Object> map = new HashMap<>();
// map.put("shelve_id",shelveId);
// stockMapper.deleteByMap(map);
// for(int i = 1;i<=row;i++){
// List<Stock> stocks = new ArrayList<>(column);
// for(int j = 1;j<=column;j++){
// Stock stock = new Stock();
// stock.setShelveId(shelveId);
// stock.setRow(i);
// stock.setColumn(j);
// stock.setStatus(0);
// stocks.add(stock);
// }
// stockMapper.batchInsert(stocks);
// }
// }
public List<String> getCategoryList() {
List<String> list = new ArrayList<>();
if(configProperties.getProductDoc() != null){
list = FileUtil.readLinesToList(configProperties.getProductDoc());
}
return list;
}
}

@ -0,0 +1,27 @@
package com.zhehekeji.web.util;
import lombok.extern.slf4j.Slf4j;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@Slf4j
public class FileUtil {
public static List<String> readLinesToList(String path) {
List<String> lines = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new FileReader(path))) {
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
}
}catch (IOException e){
log.info("读取数据失败");
}
return lines;
}
}

@ -107,3 +107,5 @@ asyncExecutorThread:
#订单测试
orderTest: 1
#品规文档
productDoc: "C:/Users/昊天/Desktop/新建 文本文档 (3).txt"

@ -7,7 +7,7 @@
from `order` t
<where>
<if test="req.orderNum != null and req.orderNum != ''">
and t.order_num = #{req.orderNum}
and t.order_num like concat('%',#{req.orderNum},'%')
</if>
<if test="req.startTimestamp != null and req.endTimestamp != null">
and t.start_time >= #{req.startTimestamp} and t.start_time &lt;= #{req.endTimestamp}

Loading…
Cancel
Save