opt:越南富佳看板优化、库存增导出功能
This commit is contained in:
@@ -1,21 +1,29 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.system_manage.service.columnInfo.ColumnInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -35,9 +43,40 @@ public class StructIvtController {
|
||||
@Resource
|
||||
private final IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
|
||||
@Autowired
|
||||
private ColumnInfoService columnInfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询库存")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbStoragevehicleextService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/exportFile")
|
||||
public void exportFile(@RequestBody Map whereJson, PageQuery page, HttpServletResponse response) {
|
||||
page.setPage(0);
|
||||
page.setSize(99999);
|
||||
IPage<JSONObject> pmFormDataDtoIPage = iMdPbStoragevehicleextService.queryAll(whereJson, page);
|
||||
List<JSONObject> pmFormDataDtos = pmFormDataDtoIPage.getRecords();
|
||||
|
||||
List<Map> maps = pmFormDataDtos.stream().map(jsonObject -> {
|
||||
try {
|
||||
return jsonObject.toJavaObject(new TypeReference<Map<String, Object>>() {});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new HashMap();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
try {
|
||||
columnInfoService.exportFile("md_pb_groupplate", maps, response,
|
||||
null, MapOf.of(
|
||||
"material_code","物料编号","material_name","物料名称","sect_name","库区名称"
|
||||
,"stor_name","仓库名称","struct_name","仓位名称","struct_code","仓位编码"
|
||||
)
|
||||
);
|
||||
} catch (IOException e) {
|
||||
log.info("EXCEL 导出异常,异常原因=【{}】",e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
<select id="overview" resultType="com.alibaba.fastjson.JSONObject">
|
||||
select
|
||||
SUM(CASE WHEN is_used =1 THEN 1 ELSE 0 END) AS totalLocations ,
|
||||
SUM(CASE WHEN is_used =1 and sect_code ='FJ01' THEN 1 ELSE 0 END) AS totalLocations ,
|
||||
COUNT(DISTINCT SUBSTRING_INDEX(struct_code, '-', 1)) AS totalShelves ,
|
||||
SUM(CASE WHEN is_used =1 and storagevehicle_code is not null THEN 1 ELSE 0 END) AS currentInventory ,
|
||||
SUM(CASE WHEN is_used =1 and storagevehicle_code is null THEN 1 ELSE 0 END) AS availableLocations ,
|
||||
|
||||
@@ -441,7 +441,9 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
QueryWrapper<Structattr> structattrWrapper = new QueryWrapper<>();
|
||||
structattrWrapper.lambda().eq(Structattr::getStor_code, storCode)
|
||||
.eq(Structattr::getIs_used, Boolean.TRUE)
|
||||
.ne(Structattr::getSect_code,"SSX");
|
||||
.eq(Structattr::getSect_code,"FJ01")
|
||||
.ne(Structattr::getSect_code,"SSX")
|
||||
.ne(Structattr::getSect_code,"FJError");
|
||||
stats.put("locationCount", iStructattrService.count(structattrWrapper));
|
||||
|
||||
// 在库数量
|
||||
@@ -449,6 +451,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStor_code, storCode)
|
||||
.eq(Structattr::getIs_used, Boolean.TRUE)
|
||||
.eq(Structattr::getSect_code,"FJ01")
|
||||
.isNotNull(Structattr::getStoragevehicle_code));
|
||||
stats.put("inventoryCount", inventoryCount);
|
||||
|
||||
@@ -459,6 +462,14 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
.eq(SchBaseTask::getIs_delete, Boolean.FALSE)
|
||||
.eq(SchBaseTask::getTask_status,TaskStatus.FINISHED.getCode()));
|
||||
stats.put("inboundCount", inboundCount);
|
||||
// 剩余数量
|
||||
int remainingCount = iStructattrService.count(
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStor_code, storCode)
|
||||
.eq(Structattr::getIs_used, Boolean.TRUE)
|
||||
.eq(Structattr::getSect_code,"FJ01")
|
||||
.isNull(Structattr::getStoragevehicle_code));
|
||||
stats.put("remainingCount", remainingCount);
|
||||
// 出库数量
|
||||
int outboundCount = iSchBaseTaskService.count(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
|
||||
@@ -481,7 +481,9 @@ public class PdaBigScreenServiceImpl implements PdaBigScreenService {
|
||||
QueryWrapper<Structattr> structattrWrapper = new QueryWrapper<>();
|
||||
structattrWrapper.lambda().eq(Structattr::getStor_code, storCode)
|
||||
.eq(Structattr::getIs_used, Boolean.TRUE)
|
||||
.ne(Structattr::getSect_code,"SSX");
|
||||
.eq(Structattr::getSect_code,"FJ01")
|
||||
.ne(Structattr::getSect_code,"SSX")
|
||||
.ne(Structattr::getSect_code,"FJError");
|
||||
stats.put("locationCount", iStructattrService.count(structattrWrapper));
|
||||
|
||||
// 在库数量
|
||||
@@ -489,6 +491,7 @@ public class PdaBigScreenServiceImpl implements PdaBigScreenService {
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStor_code, storCode)
|
||||
.eq(Structattr::getIs_used, Boolean.TRUE)
|
||||
.eq(Structattr::getSect_code,"FJ01")
|
||||
.isNotNull(Structattr::getStoragevehicle_code));
|
||||
stats.put("inventoryCount", inventoryCount);
|
||||
|
||||
@@ -499,6 +502,14 @@ public class PdaBigScreenServiceImpl implements PdaBigScreenService {
|
||||
.eq(SchBaseTask::getIs_delete, Boolean.FALSE)
|
||||
.eq(SchBaseTask::getTask_status,TaskStatus.FINISHED.getCode()));
|
||||
stats.put("inboundCount", inboundCount);
|
||||
// 剩余数量
|
||||
int remainingCount = iStructattrService.count(
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStor_code, storCode)
|
||||
.eq(Structattr::getIs_used, Boolean.TRUE)
|
||||
.eq(Structattr::getSect_code,"FJ01")
|
||||
.isNull(Structattr::getStoragevehicle_code));
|
||||
stats.put("remainingCount", remainingCount);
|
||||
// 出库数量
|
||||
int outboundCount = iSchBaseTaskService.count(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
|
||||
@@ -60,17 +60,17 @@ public class ColumnInfoServiceImpl implements ColumnInfoService {
|
||||
}
|
||||
List<Map<String, Object>> excel_lst = new ArrayList<>();
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
if(!CollectionUtils.isEmpty(customizMap)) {
|
||||
map.putAll(customizMap);
|
||||
}
|
||||
if (!StringUtils.isEmpty(tableName)) {
|
||||
map = this.TableColumn(tableName);
|
||||
map.putAll(this.TableColumn(tableName));
|
||||
if (!CollectionUtils.isEmpty(passParam)) {
|
||||
for (Object s : passParam) {
|
||||
map.remove(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!CollectionUtils.isEmpty(customizMap)) {
|
||||
map.putAll(customizMap);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
throw new BadRequestException("导出失败,表结构信息失败" + tableName);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,11 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:fujia_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:fujia_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:fujia}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:P@ssw0rd.}
|
||||
password: ${DB_PWD:123456}
|
||||
# password: ${DB_PWD:P@ssw0rd.}
|
||||
# 初始连接数
|
||||
initial-size: 15
|
||||
# 最小连接数
|
||||
|
||||
Reference in New Issue
Block a user