This commit is contained in:
2022-11-09 10:53:35 +08:00
15 changed files with 213 additions and 321 deletions

View File

@@ -1,51 +0,0 @@
package org.nl.modules.security.satoken;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.mnt.websocket.MsgType;
import org.nl.modules.mnt.websocket.SocketMsg;
import org.nl.modules.mnt.websocket.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
/**
* @author: lyd
* @description:
* @Date: 2022/10/8
*/
@Slf4j
@Component
public class TokenKeyExpirationListener extends KeyExpirationEventMessageListener {
@Autowired
private StringRedisTemplate redisTemplate;
public TokenKeyExpirationListener(RedisMessageListenerContainer listenerContainer) {
super(listenerContainer);
}
@Override
public void onMessage(Message message, byte[] pattern) {
// 监听过期的key
String expireKey = new String(message.getBody(), StandardCharsets.UTF_8);
//获取key原本的value 获取不到 是null
String expireKeyValue = redisTemplate.opsForValue().get("my-satoken");
//我是根据tokenvalues作为主键ID的
String[] split = expireKey.split(":");
String s = split[split.length - 1];
try {
WebSocketServer.sendInfo(new SocketMsg("token会话过期", MsgType.INFO), "exp-token");
} catch (IOException e) {
log.error(e.getMessage(), e);
}
log.info("expireKey---"+expireKey);
log.info("expireKeyValue---"+expireKeyValue);
}
}

View File

@@ -25,8 +25,8 @@ public class CheckController {
private final CheckService checkService;
@GetMapping
@Log("查询手工移库")
@ApiOperation("查询手工移库")
@Log("查询盘点")
@ApiOperation("查询盘点")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(checkService.pageQuery(whereJson,page), HttpStatus.OK);
}
@@ -39,8 +39,8 @@ public class CheckController {
}
@GetMapping("/getOutBillDtl2")
@Log("查询移库单")
@ApiOperation("查询移库单")
@Log("查询盘点单明细2")
@ApiOperation("查询盘点单明细2")
public ResponseEntity<Object> getOutBillDtl2(@RequestParam Map whereJson){
return new ResponseEntity<>(checkService.getOutBillDtl2(whereJson), HttpStatus.OK);
}
@@ -60,28 +60,28 @@ public class CheckController {
}
@PutMapping
@Log("修改移库")
@ApiOperation("修改移库")
public ResponseEntity<Object> update(@RequestBody Map whereJson){
@Log("修改盘点")
@ApiOperation("修改盘点")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson){
checkService.update(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping()
@Log("新增移库")
@ApiOperation("新增移库")
public ResponseEntity<Object> insertDtl(@RequestBody Map whereJson){
@Log("新增盘点")
@ApiOperation("新增盘点")
public ResponseEntity<Object> insertDtl(@RequestBody JSONObject whereJson){
checkService.insertDtl(whereJson);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@GetMapping("/getStructIvt")
@Log("查询可分配库存")
@ApiOperation("查询可分配库存")
@Log("查询可盘点库存")
@ApiOperation("查询可盘点库存")
public ResponseEntity<Object> getStructIvt(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(checkService.getStructIvt(whereJson,page), HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("移库单强制确认")
@ApiOperation("移库单强制确认")
@Log("盘点确定")
@ApiOperation("盘点确定")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
checkService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);

View File

@@ -27,7 +27,7 @@ public interface CheckService {
* 新增出库单
* @param whereJson /
*/
void insertDtl (Map whereJson);
void insertDtl (JSONObject whereJson);
/**
* 查询出库单明细
* @param whereJson /
@@ -46,7 +46,7 @@ public interface CheckService {
* 修改出库单
* @param whereJson /
*/
void update(Map whereJson);
void update(JSONObject whereJson);
/**
* 查询可分配库存
* @param whereJson /

View File

@@ -97,36 +97,57 @@ public class CheckServiceImpl implements CheckService {
@Override
@Transactional(rollbackFor = Exception.class)
public void insertDtl(Map map) {
//主表
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_CheckMst");
public void insertDtl(JSONObject jsonObject) {
ArrayList<HashMap> rows = (ArrayList<HashMap>) map.get("tableData");
map.remove("tableData");
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_CheckMst"); // 盘点单主表
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_CheckDtl"); // 盘点单明细表
JSONArray dtlArr = jsonObject.getJSONArray("tableData");
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
String check_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String check_code = CodeUtil.getNewCode("PD_CODE");
map.put("check_id", check_id);
map.put("check_code", check_code);
map.put("buss_type", "");
map.put("create_mode", "01");
map.put("input_optid", currentUserId + "");
map.put("input_optname", nickName);
map.put("input_time", now);
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_time", now);
map.put("is_delete", "0");
map.put("is_upload", "0");
Long deptId = SecurityUtils.getDeptId();
map.put("sysdeptid", deptId);
map.put("syscompanyid", deptId);
JSONObject jo_mst = JSONObject.parseObject(JSON.toJSONString(map));
//调用明细处理方法
this.insertDtlByRows(jo_mst, rows);
wo_mst.insert(map);
// 插入主表
JSONObject jsonMst = new JSONObject();
jsonMst.put("check_id", IdUtil.getSnowflake(1,1).nextId());
jsonMst.put("check_code", CodeUtil.getNewCode("PD_CODE"));
jsonMst.put("buss_type", jsonObject.getString("check_type"));
jsonMst.put("check_type", jsonObject.getString("check_type"));
jsonMst.put("stor_id", jsonObject.getLongValue("stor_id"));
jsonMst.put("stor_name", jsonObject.getString("stor_name"));
jsonMst.put("dtl_num", dtlArr.size());
jsonMst.put("create_mode", "01");
jsonMst.put("is_nok", "0");
jsonMst.put("input_optid", currentUserId);
jsonMst.put("input_optname", nickName);
jsonMst.put("input_time", DateUtil.now());
jsonMst.put("remark", jsonObject.getString("remark"));
jsonMst.put("status", "1");
jsonMst.put("sysdeptid", deptId);
jsonMst.put("syscompanyid", deptId);
mstTab.insert(jsonMst);
// 插入明细
for (int i = 0; i < dtlArr.size(); i++) {
JSONObject json = dtlArr.getJSONObject(i);
JSONObject jsonDtl = new JSONObject();
jsonDtl.put("checkdtl_id", IdUtil.getSnowflake(1,1).nextId());
jsonDtl.put("check_id", jsonMst.getLongValue("check_id"));
jsonDtl.put("check_code", jsonMst.getString("check_code"));
jsonDtl.put("seq_no", i+1);
jsonDtl.put("sect_id", json.getLongValue("sect_id"));
jsonDtl.put("sect_name", json.getString("sect_name"));
jsonDtl.put("struct_id", json.getLongValue("struct_id"));
jsonDtl.put("struct_name", json.getString("struct_name"));
jsonDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
jsonDtl.put("material_id", json.getLongValue("material_id"));
jsonDtl.put("base_qty", json.getDoubleValue("base_qty"));
jsonDtl.put("qty_unit_id", json.getLongValue("measure_unit_id"));
jsonDtl.put("qty_unit_name", json.getString("qty_unit_name"));
jsonDtl.put("status", "1");
jsonDtl.put("fac_qty", json.getDoubleValue("fac_qty"));
dtlTab.insert(jsonDtl);
}
}
/**
@@ -152,19 +173,6 @@ public class CheckServiceImpl implements CheckService {
row.put("is_down", "0");
wo_dtl.insert(row);
}
//锁定起点点位、仓位
Iterator<String> it = set.iterator();
JSONObject from_start = new JSONObject();
from_start.put("lock_type", "02");
for (; it.hasNext(); ) {
String struct_id = it.next();
from_start.put("struct_id", struct_id);
from_start.put("inv_type", jo_mst.getString("check_type"));
from_start.put("inv_id", jo_mst.getString("check_id"));
from_start.put("inv_code", jo_mst.getString("check_code"));
storPublicService.updateStructAndPoint(from_start);
}
}
@Override
@@ -199,30 +207,46 @@ public class CheckServiceImpl implements CheckService {
@Override
@Transactional(rollbackFor = Exception.class)
public void update(Map whereJson) {
//主表
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_CheckMst");
public void update(JSONObject jsonObject) {
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_CheckMst"); // 盘点单主表
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_CheckDtl"); // 盘点单明细表
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
String check_id = (String) whereJson.get("check_id");
//查询主表
JSONObject jo_mst = wo_mst.query("check_id='" + check_id + "'").uniqueResult(0);
//调用删除明细,还原库存方法
this.deleteById(check_id + "");
//获取明细
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableData");
//调用明细处理方法
this.insertDtlByRows(jo_mst, rows);
jo_mst.put("remark", whereJson.get("remark"));
jo_mst.put("dtl_num", whereJson.get("dtl_num"));
jo_mst.put("check_type", whereJson.get("check_type"));
jo_mst.put("update_optid", currentUserId + "");
jo_mst.put("update_optname", nickName);
jo_mst.put("update_time", now);
//更新主表
wo_mst.update(jo_mst);
JSONArray dtlArr = jsonObject.getJSONArray("tableData");
// 插入主表
JSONObject jsonMst = mstTab.query("check_id = '" + jsonObject.getString("check_id") + "'").uniqueResult(0);
jsonMst.put("buss_type", jsonObject.getString("check_type"));
jsonMst.put("check_type", jsonObject.getString("check_type"));
jsonMst.put("stor_id", jsonObject.getLongValue("stor_id"));
jsonMst.put("stor_name", jsonObject.getString("stor_name"));
jsonMst.put("dtl_num", dtlArr.size());
jsonMst.put("create_mode", "01");
jsonMst.put("remark", jsonObject.getString("remark"));
jsonMst.put("status", "1");
mstTab.update(jsonMst);
// 插入明细
dtlTab.delete("check_id = '"+jsonObject.getString("check_id")+"'");
for (int i = 0; i < dtlArr.size(); i++) {
JSONObject json = dtlArr.getJSONObject(i);
JSONObject jsonDtl = new JSONObject();
jsonDtl.put("checkdtl_id", IdUtil.getSnowflake(1,1).nextId());
jsonDtl.put("check_id", jsonMst.getLongValue("check_id"));
jsonDtl.put("check_code", jsonMst.getString("check_code"));
jsonDtl.put("seq_no", i+1);
jsonDtl.put("sect_id", json.getLongValue("sect_id"));
jsonDtl.put("sect_name", json.getString("sect_name"));
jsonDtl.put("struct_id", json.getLongValue("struct_id"));
jsonDtl.put("struct_name", json.getString("struct_name"));
jsonDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
jsonDtl.put("material_id", json.getLongValue("material_id"));
jsonDtl.put("base_qty", json.getDoubleValue("base_qty"));
jsonDtl.put("qty_unit_id", json.getLongValue("measure_unit_id"));
jsonDtl.put("qty_unit_name", json.getString("qty_unit_name"));
jsonDtl.put("status", "1");
jsonDtl.put("fac_qty", json.getDoubleValue("fac_qty"));
dtlTab.insert(jsonDtl);
}
}
@Override
@@ -236,7 +260,7 @@ public class CheckServiceImpl implements CheckService {
}
JSONObject jo = WQL.getWO("QST_IVT_CHECK")
.addParam("flag", "3")
.addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "struct.struct_id,struct.storagevehicle_code");
.addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "struct.struct_code");
return jo;
}
@@ -254,55 +278,51 @@ public class CheckServiceImpl implements CheckService {
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject jo_mst = wo_mst.query("status in ('10','30') and check_id='" + form.getString("check_id") + "'").uniqueResult(0);
JSONObject jo_mst = wo_mst.query("status in ('1','3') and check_id='" + form.getString("check_id") + "'").uniqueResult(0);
if (jo_mst == null) {
throw new BadRequestException("盘点单状态异常!");
}
wo_dtl.delete("status in ('01','04') and check_id='" + form.getString("check_id") + "'");
wo_dtl.delete("status in ('1','2') and check_id='" + form.getString("check_id") + "'");
//定义需要需要更新的的点位集合
HashSet<String> set = new HashSet<>();
for (int i = 0; i < rows.size(); i++) {
JSONObject jo = rows.getJSONObject(i);
String status = jo.getString("status");
double base_qty = jo.getDoubleValue("base_qty");
jo.put("seq_no", "" + (i + 1));
set.add(jo.getString("struct_id"));
//已盘点过的明细不再处理
if ("05,06,07,99".contains(status)) {
if ("3,4,5,99".contains(status)) {
wo_dtl.update(jo);
continue;
}
jo.put("status", "05");
jo.put("status", "3");
jo.put("check_optid", currentUserId);
jo.put("check_optname", nickName);
jo.put("check_time", now);
double fac_qty = jo.getDoubleValue("fac_qty");
//判断盈亏
if (fac_qty > base_qty) {
jo.put("check_result", "2");
jo.put("check_result", "3");
} else if (fac_qty < base_qty) {
jo.put("check_result", "1");
jo.put("check_result", "2");
} else {
jo.put("status", "99");
jo.put("check_result", "0");
}
if (StrUtil.isEmpty(jo.getString("checkdtl_id"))) {
String checkdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
jo.put("checkdtl_id", checkdtl_id);
jo.put("check_result", "1");
}
wo_dtl.insert(jo);
}
jo_mst.put("dtl_num", rows.size());
jo_mst.put("status", "30");
jo_mst.put("status", "3");
jo_mst.put("is_nok", "0");
JSONArray ja_nok = wo_dtl.query("check_result <>'0' and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
JSONArray ja_nok = wo_dtl.query("check_result <>'1' and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
if (ja_nok.size() != 0) {
jo_mst.put("is_nok", "1");
}
JSONArray ja = wo_dtl.query("status in ('99','07') and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
JSONArray ja = wo_dtl.query("status in ('99') and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
//说明全部确认
if (ja.size() == jo_mst.getInteger("dtl_num")) {
HashMap<String, String> mapdtl = new HashMap<>();
mapdtl.put("status", "99");
wo_dtl.update(mapdtl, "check_id='" + form.getString("check_id") + "'");
@@ -310,15 +330,6 @@ public class CheckServiceImpl implements CheckService {
jo_mst.put("confirm_optid", currentUserId);
jo_mst.put("confirm_optname", nickName);
jo_mst.put("confirm_time", now);
//锁定起点点位、仓位
Iterator<String> it = set.iterator();
JSONObject from_start = new JSONObject();
from_start.put("lock_type", "00");
for (; it.hasNext(); ) {
String struct_id = it.next();
from_start.put("struct_id", struct_id);
storPublicService.updateStructAndPoint(from_start);
}
}
wo_mst.update(jo_mst);
}
@@ -387,48 +398,48 @@ public class CheckServiceImpl implements CheckService {
JSONObject form = whereJson.getJSONObject("row");
JSONArray rows = whereJson.getJSONArray("rows");
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject jo_mst = wo_mst.query("status in ('10','30') and check_id='" + form.getString("check_id") + "'").uniqueResult(0);
JSONObject jo_mst = wo_mst.query("status in ('1','3') and check_id='" + form.getString("check_id") + "'").uniqueResult(0);
if (jo_mst == null) {
throw new BadRequestException("盘点单状态异常!");
}
wo_dtl.delete("status in ('01','04') and check_id='" + form.getString("check_id") + "'");
wo_dtl.delete("status in ('1','2') and check_id='" + form.getString("check_id") + "'");
for (int i = 0; i < rows.size(); i++) {
JSONObject jo = rows.getJSONObject(i);
String status = jo.getString("status");
double base_qty = jo.getDoubleValue("base_qty");
jo.put("seq_no", "" + (i + 1));
//已盘点过的明细不再处理
if ("05,06,07,99".contains(status)) {
if ("3,4,5,99".contains(status)) {
wo_dtl.update(jo);
continue;
}
jo.put("status", "04");
jo.put("status", "2");
jo.put("check_optid", currentUserId);
jo.put("check_optname", nickName);
jo.put("check_time", now);
double fac_qty = jo.getDoubleValue("fac_qty");
//判断盈亏
if (fac_qty > base_qty) {
jo.put("check_result", "2");
jo.put("check_result", "3");
} else if (fac_qty < base_qty) {
jo.put("check_result", "1");
jo.put("check_result", "2");
} else {
jo.put("check_result", "0");
}
if (StrUtil.isEmpty(jo.getString("checkdtl_id"))) {
String checkdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
jo.put("checkdtl_id", checkdtl_id);
jo.put("check_result", "1");
}
wo_dtl.insert(jo);
}
jo_mst.put("dtl_num", rows.size());
jo_mst.put("status", "30");
jo_mst.put("status", "3");
jo_mst.put("is_nok", "0");
JSONArray ja_nok = wo_dtl.query("check_result <>'0' and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
JSONArray ja_nok = wo_dtl.query("check_result <>'1' and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
if (ja_nok.size() != 0) {
jo_mst.put("is_nok", "1");
}

View File

@@ -69,35 +69,40 @@
FROM
ST_IVT_CheckMst checkmst
WHERE
1 = 1
AND checkmst.is_delete = '0'
checkmst.is_delete = '0'
OPTION 输入.check_code <> ""
checkmst.check_code like 输入.check_code
ENDOPTION
OPTION 输入.buss_type <> ""
checkmst.buss_type like 输入.buss_type
checkmst.buss_type = 输入.buss_type
ENDOPTION
OPTION 输入.check_type <> ""
checkmst.check_type = 输入.check_type
ENDOPTION
OPTION 输入.stor_id <> ""
checkmst.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.deptIds <> ""
checkmst.sysdeptid in 输入.deptIds
ENDOPTION
OPTION 输入.create_mode <> ""
checkmst.create_mode = 输入.create_mode
ENDOPTION
OPTION 输入.status <> ""
checkmst.status = 输入.status
ENDOPTION
OPTION 输入.begin_time <> ""
checkmst.input_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
checkmst.input_time <= 输入.end_time
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF
@@ -135,61 +140,47 @@
IF 输入.flag = "3"
PAGEQUERY
SELECT
bucketcopy.material_id,
bucketcopy.base_qty,
bucketcopy.storage_qty,
'42' AS qty_unit_id,
'桶' AS qty_unit_name,
mb.material_code,
mb.material_name,
struct.struct_id,
struct.struct_code,
struct.struct_name,
struct.sect_id,
struct.sect_code,
struct.sect_name,
struct.storagevehicle_id,
struct.storagevehicle_code
struct.sect_id,
struct.sect_code,
struct.sect_name,
struct.struct_id,
struct.struct_code,
struct.struct_name,
struct.storagevehicle_code,
mb.material_id,
mb.material_name,
mb.material_code,
'1' AS base_qty,
'0' AS fac_qty,
'箱' AS qty_unit_name,
'1585604690706567168' AS measure_unit_id
FROM
st_ivt_structattr struct
INNER JOIN (
SELECT
bucket.storagevehicle_code,
bucket.material_id,
sum(bucket.storage_qty) AS storage_qty,
COUNT(bucket.bucketunique) AS base_qty
FROM
MD_PB_BucketRecord bucket
WHERE
1 = 1
AND bucket.storage_qty > 0
GROUP BY
bucket.storagevehicle_code,
bucket.material_id
) bucketcopy ON bucketcopy.storagevehicle_code = struct.storagevehicle_code
LEFT JOIN md_me_materialbase mb ON mb.material_id = bucketcopy.material_id
st_ivt_structivt ivt
LEFT JOIN st_ivt_structattr struct ON ivt.struct_id = struct.struct_id
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
WHERE
1 = 1
AND struct.lock_type = '00'
AND struct.storagevehicle_id > 0
OPTION 输入.material_id <> ""
bucketcopy.material_id = 输入.material_id
ENDOPTION
AND struct.lock_type = '1'
AND IFNULL(struct.storagevehicle_code,'') <> ''
OPTION 输入.remark <> ""
(mb.material_code like 输入.remark or mb.material_name like 输入.remark)
ENDOPTION
OPTION 输入.ids <> ""
struct.storagevehicle_code in (输入.ids)
ENDOPTION
OPTION 输入.struct_code <> ""
struct.struct_code like 输入.struct_code
ENDOPTION
OPTION 输入.stor_id <> ""
struct.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.sect_id <> ""
struct.sect_id = 输入.sect_id
ENDOPTION
group by ivt.struct_id
ENDSELECT
ENDPAGEQUERY
ENDIF
@@ -347,7 +338,7 @@
CheckDtl.qty_unit_name,
CheckDtl.STATUS,
CheckDtl.is_down,
( CASE WHEN CheckDtl.fac_qty IS NULL OR CheckDtl.fac_qty = '' THEN CheckDtl.base_qty ELSE CheckDtl.fac_qty END ) AS fac_qty,
CheckDtl.fac_qty,
CheckDtl.check_result,
CheckDtl.check_optid,
CheckDtl.check_optname,

View File

@@ -12,7 +12,7 @@ https://juejin.cn/post/6844903775631572999
<contextName>nlAdmin</contextName>
<property name="log.charset" value="utf-8"/>
<property name="log.pattern"
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)"/>
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)"/>
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<springProperty scope="context" name="lokiUrl" source="loki.url"/>
<springProperty scope="context" name="systemName" source="loki.systemName"/>

View File

@@ -40,7 +40,7 @@ module.exports = {
/**
* @description token key
*/
TokenKey: 'EL-ADMIN-TOEKN',
TokenKey: 'NL-LMS-TOEKN',
/**
* @description 请求超时时间毫秒默认2分钟
*/

View File

@@ -117,11 +117,11 @@
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
<el-table-column prop="sect_name" label="盘点库区" align="center" />
<el-table-column prop="struct_name" label="盘点货位" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="箱号" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
<el-table-column prop="material_name" label="物料名称" align="center" min-width="120" show-overflow-tooltip />
<el-table-column prop="base_qty" label="" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="fac_qty" label="盘点" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="base_qty" label="" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="fac_qty" label="盘点数" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
<template scope="scope">
@@ -144,7 +144,7 @@ const defaultForm = {
stor_id: '',
stor_code: '',
stor_name: '',
status: '10',
status: '1',
dtl_num: '0',
check_type: '',
remark: '',
@@ -190,7 +190,7 @@ export default {
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
this.storlist = res.content
})
},
@@ -238,6 +238,7 @@ export default {
this.dtlShow = true
},
tableChanged(rows) {
debugger
const tablemap = new Map()
rows.forEach((item) => {
if (this.form.tableData.length !== 0) {
@@ -249,12 +250,12 @@ export default {
}
if (!this.flagnow) {
item.edit = false
item.status = '01'
item.status = '1'
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
}
} else {
item.edit = false
item.status = '01'
item.status = '1'
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
}
})

View File

@@ -59,12 +59,11 @@
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" width="110px" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="110px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="号" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="110px" />
<el-table-column show-overflow-tooltip prop="base_qty" label="数" :formatter="crud.formatNum0" />
<el-table-column show-overflow-tooltip prop="base_qty" label="数" :formatter="crud.formatNum0" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="计量单位" />
<el-table-column show-overflow-tooltip prop="storage_qty" :formatter="crud.formatNum3" label="重量" width="110px" />
</el-table>
<!--分页组件-->
<pagination />
@@ -133,7 +132,7 @@ export default {
},
methods: {
open() {
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
crudSectattr.getSect({ is_productstore: '1' }).then(res => {
this.sects = res.content
})
this.crud.toQuery()

View File

@@ -60,7 +60,7 @@
</el-select>
</el-form-item>
<el-form-item label="明细数" prop="dtl_num">
<el-input v-model="form.dtl_num" style="width: 200px" :disabled="true" />
<el-input v-model="tableData.length" style="width: 200px" :disabled="true" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" :disabled="true" style="width: 480px;" clearable :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" maxlength="100" show-word-limit />
@@ -72,7 +72,7 @@
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
@@ -82,7 +82,7 @@
@click="addrow"
>
新增一行
</el-button>
</el-button>-->
</span>
</div>
@@ -100,7 +100,7 @@
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="sect_name" label="盘点库区" align="center" />
<el-table-column prop="struct_name" label="盘点货位" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="号" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center">
<template scope="scope">
<el-input v-show="isShow(scope.$index, scope.row,1)" v-model="scope.row.material_code" disabled class="input-with-select">
@@ -109,9 +109,9 @@
<span v-show="isShow(scope.$index, scope.row,3)">{{ scope.row.material_code }}</span>
</template>
</el-table-column>
<el-table-column prop="material_name" label="物料名称" align="center" />
<el-table-column prop="base_qty" label="数" :formatter="crud.formatNum0" align="center" />
<el-table-column show-overflow-tooltip prop="fac_qty" label="盘点数" width="160" align="center">
<el-table-column prop="material_name" show-overflow-tooltip label="物料名称" align="center" />
<el-table-column prop="base_qty" label="数" :formatter="crud.formatNum0" align="center" />
<el-table-column show-overflow-tooltip prop="fac_qty" label="盘点数" width="160" align="center">
<template scope="scope">
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :precision="0" :min="0" />
<span v-show="isShow(scope.$index, scope.row,4)">{{ scope.row.fac_qty }}</span>
@@ -175,7 +175,7 @@ export default {
stor_id: '',
stor_code: '',
stor_name: '',
status: '10',
status: '1',
dtl_num: '0',
check_type: '',
remark: '',
@@ -196,7 +196,7 @@ export default {
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
this.storlist = res.content
})
check.getOutBillDtl2({ 'check_id': this.form.check_id }).then(res => {
@@ -204,9 +204,9 @@ export default {
// 将明细变成不可编辑
for (let i = 0; i < this.tableData.length; i++) {
const row = this.tableData[i]
row.edit = false
if (row.status > '04') {
row.edit = true
this.$set(row, 'edit', false)
if (row.status > '3') {
this.$set(row, 'edit', true)
}
this.tableData.splice(i, 1, row)
}
@@ -230,25 +230,18 @@ export default {
}
},
isCanDel(index, row, type) {
const num = parseFloat(row.base_qty)
if (type === 1) {
if (row.status > '04' || num > 0) {
return true
} else {
if (row.status === '1') {
return false
}
} else {
if (row.status > '04') {
return true
} else {
return false
return true
}
}
},
isShow(index, row, type) {
const num = parseFloat(row.base_qty)
if (type === 1) {
if (row.status > '04') {
if (row.status > '3') {
return false
} else {
if (num > 0) {
@@ -262,7 +255,7 @@ export default {
}
}
} else if (type === 2) {
if (row.status > '04') {
if (row.status > '2') {
return false
} else {
if (row.edit) {
@@ -272,7 +265,7 @@ export default {
}
}
} else if (type === 3) {
if (row.status > '04') {
if (row.status > '3') {
return true
} else {
if (num > 0) {
@@ -286,7 +279,7 @@ export default {
}
}
} else if (type === 4) {
if (row.status > '04') {
if (row.status > '2') {
return true
} else {
if (row.edit) {

View File

@@ -119,7 +119,7 @@
>
盘点
</el-button>
<el-button
<!-- <el-button
slot="right"
class="filter-item"
type="warning"
@@ -140,7 +140,7 @@
@click="downdtl"
>
导出Excel
</el-button>
</el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
@@ -149,7 +149,6 @@
:data="crud.data"
size="mini"
style="width: 100%;"
:highlight-current-row="true"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@@ -178,12 +177,12 @@
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="100" prop="status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" width="100" />
<el-table-column show-overflow-tooltip prop="check_type" :formatter="bill_typeFormat" width="100" label="业务类型" />
<el-table-column show-overflow-tooltip prop="is_nok" :formatter="is_nokFormat" width="100" label="盘点状态" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column label="明细数" align="center" prop="dtl_num" width="100" />
<el-table-column show-overflow-tooltip prop="input_time" width="135" label="创建日期" />
<el-table-column prop="stor_name" label="仓库" width="120" />
<el-table-column show-overflow-tooltip prop="check_type" :formatter="bill_typeFormat" width="120" label="业务类型" />
<el-table-column show-overflow-tooltip prop="is_nok" :formatter="is_nokFormat" width="120" label="盘点状态" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="120" />
<el-table-column label="明细数" align="center" prop="dtl_num" width="120" />
<el-table-column show-overflow-tooltip prop="input_time" width="150" label="创建日期" />
</el-table>
<!--分页组件-->
<pagination />
@@ -246,13 +245,13 @@ export default {
}
},
created() {
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
this.storlist = res.content
})
},
methods: {
canUd(row) {
return row.status !== '10'
return row.status !== '1'
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.buss_type = ''
@@ -265,7 +264,7 @@ export default {
this.buttonChange(row)
} else if (val.length === 1) {
this.buttonChange(row)
}else{
} else {
this.handleCurrentChange(null)
}
},
@@ -277,12 +276,12 @@ export default {
if (current !== null) {
this.currentRow = current
this.downdtl_flag = false
if (current.status === '10' || current.status === '30') {
if (current.status === '1' || current.status === '3') {
this.check_flag = false
} else {
this.check_flag = true
}
if (current.status === '30' && current.is_nok === '1') {
if (current.status === '3' && current.is_nok === '1') {
this.confirm_flag = false
} else {
this.confirm_flag = true