1.增加品规配置读取

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

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

@ -147,6 +147,13 @@ public class StockController {
validatorUtil.validate(stockCheck); validatorUtil.validate(stockCheck);
return Result.success(stockService.checkCorrect(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 = "人工复核") @ApiOperation(value = "人工复核")
@RequestMapping(value = "/checkByMan", method = RequestMethod.POST) @RequestMapping(value = "/checkByMan", method = RequestMethod.POST)

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

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

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

@ -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 orderTest: 1
#品规文档
productDoc: "C:/Users/昊天/Desktop/新建 文本文档 (3).txt"

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

Loading…
Cancel
Save