change - 箱壳看板修改

master
wenjy 2 years ago
parent f74f744465
commit f8dccd2763

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: cn.hutool:hutool-all:5.8.0.M4">
<CLASSES>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/cn/hutool/hutool-all/5.8.0.M4/hutool-all-5.8.0.M4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/cn/hutool/hutool-all/5.8.0.M4/hutool-all-5.8.0.M4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/cn/hutool/hutool-all/5.8.0.M4/hutool-all-5.8.0.M4-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -115,5 +115,6 @@
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" /> <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" /> <orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" />
</component> </component>
</module> </module>

@ -95,6 +95,12 @@
<version>12.1.0.2.0</version> <version>12.1.0.2.0</version>
</dependency> </dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.0.M4</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -115,5 +115,6 @@
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" /> <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" /> <orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" />
</component> </component>
</module> </module>

@ -1,5 +1,6 @@
package com.productionboard.controller; package com.productionboard.controller;
import cn.hutool.http.HttpUtil;
import com.productionboard.service.IBaseLocationService; import com.productionboard.service.IBaseLocationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -47,10 +48,16 @@ public class StorageController {
return prefix; return prefix;
} }
/* @GetMapping("/getProductionPlan") @GetMapping("/getProductionPlan")
@ResponseBody() @ResponseBody()
public String productionPlan(){ public String productionPlan(){
String info =
String urlStr = "http://10.100.71.119:8012/system/NorthWareHouse/getPlanInfo";
String param = "{\"StartTime\":\"2018-10-10 09:42:02\",\"EndTime\":\"2018-10-29 09:42:02\",\"StartIndex\":\"0\",\"PageSize\":\"30\"}";
String response = HttpUtil.post(urlStr,param);
String info =
"{\n" "{\n"
+ " \"header\":[\n" + " \"header\":[\n"
+ " \"计划型号\",\n" + " \"计划型号\",\n"
@ -59,47 +66,12 @@ public class StorageController {
+ " \"差异值\",\n" + " \"差异值\",\n"
+ " \"计划进度\"\n" + " \"计划进度\"\n"
+ " ],\n" + " ],\n"
+ " \"data\":[\n" + " \"data\":\n"
+ " [\n" +response
+ " \"20210\",\n"
+ " \"50\",\n"
+ " \"25\",\n"
+ " \"25\",\n"
+ " \"50%\"\n"
+ " ],\n"
+ " [\n"
+ " \"20210\",\n"
+ " \"50\",\n"
+ " \"25\",\n"
+ " \"25\",\n"
+ " \"50%\"\n"
+ " ],\n"
+ " [\n"
+ " \"20210\",\n"
+ " \"50\",\n"
+ " \"25\",\n"
+ " \"25\",\n"
+ " \"50%\"\n"
+ " ],\n"
+ " [\n"
+ " \"20210\",\n"
+ " \"50\",\n"
+ " \"25\",\n"
+ " \"25\",\n"
+ " \"50%\"\n"
+ " ],\n"
+ " [\n"
+ " \"20210\",\n"
+ " \"50\",\n"
+ " \"25\",\n"
+ " \"25\",\n"
+ " \"50%\"\n"
+ " ]\n"
+ " ]\n"
+ "}"; + "}";
System.out.println(info);
return info; return info;
}*/ }
/** /**
* *

@ -3,6 +3,11 @@ package com.productionboard.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.productionboard.entity.BaseLocationInfo; import com.productionboard.entity.BaseLocationInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
@ -15,4 +20,37 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface BaseLocationInfoMapper extends BaseMapper<BaseLocationInfo> { public interface BaseLocationInfoMapper extends BaseMapper<BaseLocationInfo> {
@Select(
"select t1.objid, t1.location_code, t1.location_name,\n"
+ " NVL(substr(t2.DETIAL_MATERIAL_NAME,instr(t2.DETIAL_MATERIAL_NAME,',',1,1)+1,instr(t2.DETIAL_MATERIAL_NAME,',',1,2)-1-instr(t2.DETIAL_MATERIAL_NAME,',',1,1)),'--') as material_type,\n"
+ " t1.store_code, t1.location_area, t1.location_row, t1.location_line,\n"
+ " t1.location_tier, t1.location_status, t1.efficiency,\n"
+ " t1.delete_flag, t1.record_time\n"
+ " from base_location_info t1\n"
+ " left join IMOS_TE_BOM @SCADA_DBLINK t2 on t1.MATERIAL_TYPE = t2.DETIAL_MATERIAL_CODE\n"
+ "where t1.STORE_CODE = #{STORE_CODE}")
List<BaseLocationInfo> SelectLocationInfo(@Param("STORE_CODE") String STORE_CODE);
@Select(
"select * from BASE_LOCATION_INFO where STORE_CODE = #{STORE_CODE} and LOCATION_STATUS = 1")
List<BaseLocationInfo> SelectInUseLocationInfo(@Param("STORE_CODE") String STORE_CODE);
@Select(
"select *\n"
+ "from (select t1.objid, t1.location_code, t1.location_name,\n"
+ " NVL(substr(t2.DETIAL_MATERIAL_NAME,instr(t2.DETIAL_MATERIAL_NAME,',',1,1)+1,instr(t2.DETIAL_MATERIAL_NAME,',',1,2)-1-instr(t2.DETIAL_MATERIAL_NAME,',',1,1)),'--') as material_type,\n"
+ " t1.store_code, t1.location_area, t1.location_row, t1.location_line,\n"
+ " t1.location_tier, t1.location_status, t1.efficiency,\n"
+ " t1.delete_flag, t1.record_time\n"
+ " from base_location_info t1\n"
+ " left join IMOS_TE_BOM @SCADA_DBLINK t2 on t1.MATERIAL_TYPE = t2.DETIAL_MATERIAL_CODE\n"
+ "where t1.LOCATION_STATUS = 1 and t1.DELETE_FLAG = 1) a\n"
+ "where a.STORE_CODE = #{STORE_CODE} and a.material_type = #{MATERIAL_TYPE} and a.LOCATION_AREA = #{LOCATION_AREA}")
List<BaseLocationInfo> SelectLocationInfoByArea(
@Param("STORE_CODE") String STORE_CODE,
@Param("LOCATION_AREA") String LOCATION_AREA,
@Param("MATERIAL_TYPE") String MATERIAL_TYPE);
@Select("select * from BASE_LOCATION_INFO where STORE_CODE = #{STORE_CODE} and LOCATION_AREA = #{LOCATION_AREA} and LOCATION_STATUS = 1")
List<BaseLocationInfo> SelectInUseLocationInfoByArea(@Param("STORE_CODE") String STORE_CODE,@Param("LOCATION_AREA") String LOCATION_AREA);
} }

@ -1,8 +1,13 @@
package com.productionboard.mapper; package com.productionboard.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.productionboard.entity.MesProduction.PlanInfo;
import com.productionboard.entity.RecordTask; import com.productionboard.entity.RecordTask;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* <p> * <p>
@ -15,4 +20,13 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface RecordTaskMapper extends BaseMapper<RecordTask> { public interface RecordTaskMapper extends BaseMapper<RecordTask> {
@Select(
"select * from RECORD_TASK where to_char(RECORD_TIME, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd') And STORE_CODE = #{STORE_CODE}")
List<RecordTask> getRecordTasks(@Param("STORE_CODE") String STORE_CODE);
@Select("select *\n" +
"from RECORD_TASK\n" +
"where to_char(RECORD_TIME, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')\n" +
" and STORE_CODE = #{STORE_CODE} and LOCATION_AREA = #{LOCATION_AREA} and TASK_TYPE = #{TASK_TYPE}")
List<RecordTask> SelectRecordTaskByTaskType(@Param("STORE_CODE") String STORE_CODE,@Param("LOCATION_AREA") String LOCATION_AREA,@Param("TASK_TYPE") String TASK_TYPE);
} }

@ -1,5 +1,8 @@
package com.productionboard.service.impl; package com.productionboard.service.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -26,123 +29,146 @@ import java.util.stream.Collectors;
@Service @Service
public class BaseLocationServiceImpl implements IBaseLocationService { public class BaseLocationServiceImpl implements IBaseLocationService {
@Autowired @Autowired private BaseLocationInfoMapper lcoationMapper;
private BaseLocationInfoMapper lcoationMapper;
@Autowired private RecordTaskMapper recordTaskMapper;
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
@Override
public String getStoreStatistics(String ids) {
String STORE_CODE = "A";
QueryWrapper<BaseLocationInfo> wrapper = new QueryWrapper<>();
switch (ids) {
case "0":
wrapper.eq("STORE_CODE", "B");
STORE_CODE = "B";
break;
case "1":
wrapper.eq("STORE_CODE", "A");
STORE_CODE = "A";
break;
default:
break;
}
List<BaseLocationInfo> baseLocationInfos = lcoationMapper.SelectLocationInfo(STORE_CODE);
List<String> materialType =
baseLocationInfos.stream()
.map(BaseLocationInfo::getMaterialType)
.distinct()
.collect(Collectors.toList());
Map<String, List<BaseLocationInfo>> collect =
baseLocationInfos.stream()
.collect(Collectors.groupingBy(BaseLocationInfo::getMaterialType));
List<JSONObject> result = new ArrayList<>();
for (String item : materialType) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("materialName",item);
jsonObject.put("lineStoreAmount",lcoationMapper.SelectLocationInfoByArea(STORE_CODE,"1",item).size());
jsonObject.put("hullStoreAmount",lcoationMapper.SelectLocationInfoByArea(STORE_CODE,"2",item).size());
result.add(jsonObject);
}
String s = JSONArray.toJSONString(result);
System.out.println("物料库存统计:" + s);
return s;
}
@Override
public String getParamJson(String ids) {
@Autowired String urlStr = "http://10.100.71.119:8012/system/NorthWareHouse/getStoreInfo";
private RecordTaskMapper recordTaskMapper;
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); switch (ids) {
case "0":
urlStr = "http://10.100.71.119:8012/system/NorthWareHouse/getStoreInfo";
break;
case "1":
urlStr = "http://10.100.71.119:8012/system/SouthWareHouse/getStoreInfo";
break;
default:
break;
}
String param =
"{\"StartTime\":\"2018-10-10 09:42:02\",\"EndTime\":\"2018-10-29 09:42:02\",\"StartIndex\":\"0\",\"PageSize\":\"30\"}";
String response = HttpUtil.post(urlStr, param);
return response;
@Override /*String[] result =new String[12];
public String getStoreStatistics(String ids) { String STORE_CODE = "A";
QueryWrapper<BaseLocationInfo> wrapper = new QueryWrapper<>(); try{
QueryWrapper<BaseLocationInfo> locationWrapper = new QueryWrapper<BaseLocationInfo>();
QueryWrapper<RecordTask> taskWrapper = new QueryWrapper<>();
switch (ids) { switch (ids) {
case"0": case"0":
wrapper.eq("STORE_CODE","B"); locationWrapper.eq("STORE_CODE","B");
STORE_CODE = "B";
break; break;
case"1": case"1":
wrapper.eq("STORE_CODE","A"); locationWrapper.eq("STORE_CODE","A");
STORE_CODE = "A";
break; break;
default: default:
break; break;
} }
List<BaseLocationInfo> baseLocationInfos = lcoationMapper.selectList(wrapper); int inAmount1 = recordTaskMapper.SelectRecordTaskByTaskType("A", "1", "1").size();
Map<String, List<BaseLocationInfo>> collect = baseLocationInfos.stream().collect(Collectors.groupingBy(BaseLocationInfo::getMaterialType)); int outAmount1 = recordTaskMapper.SelectRecordTaskByTaskType("A", "1", "2").size();
List<JSONObject> result = new ArrayList<>(); //2号库入库数量、出库数量:1入库2出库
int inAmount2 = recordTaskMapper.SelectRecordTaskByTaskType("A", "2", "1").size();
for (String item : collect.keySet()) { int outAmount2 = recordTaskMapper.SelectRecordTaskByTaskType("A", "2", "2").size();
JSONObject jsonObject = new JSONObject(); result[0] = inAmount1+"";
jsonObject.put("materialName",item); result[1] = outAmount1+"";
jsonObject.put("lineStoreAmount",collect.get(item).stream().filter(x->x.getLocationArea().equals("1")).collect(Collectors.toList()).size()); result[2] = inAmount2+"";
jsonObject.put("hullStoreAmount",collect.get(item).stream().filter(x->x.getLocationArea().equals("2")).collect(Collectors.toList()).size()); result[3] = outAmount2+"";
result.add(jsonObject);
List<BaseLocationInfo> baseLocationInfos = lcoationMapper.selectList(locationWrapper);
if(baseLocationInfos.size() > 0){
//正在使用
int inUse = lcoationMapper.SelectInUseLocationInfo(STORE_CODE).size();
System.out.println("正在使用:"+inUse);
//未使用
int unUse = baseLocationInfos.size() - inUse;
//1#正在使用
int size1 = baseLocationInfos.stream().filter(x -> x.getLocationArea().equals("1")).collect(Collectors.toList()).size();
int size2 = baseLocationInfos.stream().filter(x -> x.getLocationArea().equals("2")).collect(Collectors.toList()).size();
int inUse1 = lcoationMapper.SelectInUseLocationInfoByArea(STORE_CODE,"1").size();
int inUse2 = lcoationMapper.SelectInUseLocationInfoByArea(STORE_CODE,"2").size();
int unUse1 = size1 - inUse1;
int unUse2 = size2 - inUse2;
result[4] = inUse1+"";
result[5] = unUse1+"";
result[6] = inUse2+"";
result[7] = unUse2+"";
result[8] = unUse+"";
// 创建一个数值格式化对象
NumberFormat numberFormat = NumberFormat.getInstance();
// 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2);
String unUsePercentage = numberFormat.format((float)unUse/(float)baseLocationInfos.size()*100);
System.out.println("diliverNum和queryMailNum的百分比为:" + result + "%");
result[9] = unUsePercentage+"%";
result[10] = inUse+"";
String inUsePercentage = numberFormat.format((float)inUse/(float)baseLocationInfos.size()*100);
result[11] = inUsePercentage+"%";
} }
String s = JSONArray.toJSONString(result); }catch (Exception e){
System.out.println("物料库存统计:"+s); System.out.println("门体库参数统计getParamJson异常"+e.getMessage());
return s; for (int i = 0; i < 12; i++) {
//
result[i] = i+"";
}
} }
@Override return JSONArray.toJSONString(result);*/
public String getParamJson(String ids) { }
String[] result =new String[12];
try{
QueryWrapper<BaseLocationInfo> locationWrapper = new QueryWrapper<BaseLocationInfo>();
QueryWrapper<RecordTask> taskWrapper = new QueryWrapper<>();
switch (ids) {
case"0":
locationWrapper.eq("STORE_CODE","B");
taskWrapper.eq("STORE_CODE","B");
break;
case"1":
locationWrapper.eq("STORE_CODE","A");
taskWrapper.eq("STORE_CODE","A");
break;
default:
break;
}
taskWrapper.like("RECORD_TIME",simpleDateFormat.format(new Date()));
List<RecordTask> recordTasks = recordTaskMapper.selectList(taskWrapper);
if(recordTasks.size()>0){
//1号库入库数量、出库数量:1入库2出库
int inAmount1 = recordTasks.stream().filter(x -> x.getLocationArea().equals("1") && x.getTaskType().equals("1")).collect(Collectors.toList()).size();
int outAmount1 = recordTasks.stream().filter(x -> x.getLocationArea().equals("1") && x.getTaskType().equals("2")).collect(Collectors.toList()).size();
//2号库入库数量、出库数量:1入库2出库
int inAmount2 = recordTasks.stream().filter(x -> x.getLocationArea().equals("2") && x.getTaskType().equals("1")).collect(Collectors.toList()).size();
int outAmount2 = recordTasks.stream().filter(x -> x.getLocationArea().equals("2") && x.getTaskType().equals("2")).collect(Collectors.toList()).size();
result[0] = inAmount1+"";
result[1] = outAmount1+"";
result[2] = inAmount2+"";
result[3] = outAmount2+"";
}
List<BaseLocationInfo> baseLocationInfos = lcoationMapper.selectList(locationWrapper);
if(baseLocationInfos.size() > 0){
//正在使用
int inUse = baseLocationInfos.stream().filter(x -> x.getLocationStatus() == 1L).collect(Collectors.toList()).size();
System.out.println("正在使用:"+inUse);
//未使用
int unUse = baseLocationInfos.size() - inUse;
//1#正在使用
int size1 = baseLocationInfos.stream().filter(x -> x.getLocationArea().equals("1")).collect(Collectors.toList()).size();
int size2 = baseLocationInfos.stream().filter(x -> x.getLocationArea().equals("2")).collect(Collectors.toList()).size();
int inUse1 = baseLocationInfos.stream().filter(x -> x.getLocationArea().equals("1") && x.getLocationStatus().equals("1")).collect(Collectors.toList()).size();
int inUse2 = baseLocationInfos.stream().filter(x -> x.getLocationArea().equals("2") && x.getLocationStatus().equals("1")).collect(Collectors.toList()).size();
int unUse1 = size1 - inUse1;
int unUse2 = size2 - inUse2;
result[4] = inUse1+"";
result[5] = unUse1+"";
result[6] = inUse2+"";
result[7] = unUse2+"";
result[8] = unUse+"";
// 创建一个数值格式化对象
NumberFormat numberFormat = NumberFormat.getInstance();
// 设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2);
String unUsePercentage = numberFormat.format((float)unUse/(float)baseLocationInfos.size()*100);
System.out.println("diliverNum和queryMailNum的百分比为:" + result + "%");
result[9] = unUsePercentage+"%";
result[10] = inUse+"";
String inUsePercentage = numberFormat.format((float)inUse/(float)baseLocationInfos.size()*100);
result[11] = inUsePercentage+"%";
}
}catch (Exception e){
System.out.println("门体库参数统计getParamJson异常"+e.getMessage());
for (int i = 0; i < 12; i++) {
//
result[i] = i+"";
}
}
return JSONArray.toJSONString(result);
}
} }

@ -1191,16 +1191,6 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
let lineWidth = 1; let lineWidth = 1;
let isDataZoom = xValue.length > 3 let isDataZoom = xValue.length > 3
let stepSize = 1 / (xValue.length / 3) * 100 let stepSize = 1 / (xValue.length / 3) * 100
// hullStoreAmount.forEach((val, index) => {
// if (val == 0) {
// hullStoreAmount[index] = 0
// }
// })
// lineStoreAmount.forEach((val, index) => {
// if (val == 0) {
// lineStoreAmount[index] = 0
// }
// })
let option = { let option = {
grid: { grid: {
left: "0%", left: "0%",
@ -1226,7 +1216,7 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
color: "#fff", color: "#fff",
fontSize: fontSize, fontSize: fontSize,
}, },
data: ["箱壳库", "内胆库"], data: ["内胆库", "箱壳库"],
}, },
xAxis: [ xAxis: [
{ {
@ -1328,59 +1318,6 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
color: "#26B2E8", color: "#26B2E8",
data: hullStoreAmount, data: hullStoreAmount,
}, },
// {
// // 左侧下内圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolSize: function (val) {
// if (val == 0) {
// return [0, 0]
// }else{
// return [37, 20]
// }
// },
// symbolOffset: [-39, 20],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#2EA9E5",
// borderType: "solid",
// borderWidth: 20,
// },
// },
//
// data: hullStoreAmount,
// },
// {
// // 左侧下外圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolSize: function (val) {
// if (val == 0) {
// return [0, 0]
// }else{
// return [50, 25]
// }
// },
// symbolOffset: [-39, 25],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#26B2E8",
// borderType: "solid",
// borderWidth: 20,
// },
// },
// data: hullStoreAmount,
// },
{ {
// 左侧下圆片 // 左侧下圆片
name: "", name: "",
@ -1396,7 +1333,7 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
}, },
{ {
type: "bar", type: "bar",
name: "箱壳库", name: "内胆库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",
@ -1441,54 +1378,6 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
color: "#20D3AB", color: "#20D3AB",
data: lineStoreAmount, data: lineStoreAmount,
}, },
// {
// // 右柱下内圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolPosition:'start',
// symbolSize: function (val,data) {
// console.log(val)
// if (!lineStoreAmount[data.dataIndex] > 0) return [0, 0]
// return [37, 20]
// },
// symbolOffset: [39, 20],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#20D3AB",
// borderType: "solid",
// borderWidth: 20,
// },
// },
// data: hullStoreAmount,
// },
// {
// // 右柱下外圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolSize: function (val,data) {
// if (!lineStoreAmount[data.dataIndex] > 0) return [0, 0]
// return [50, 25]
// },
// symbolOffset: [39, 25],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#20D3AB",
// borderType: "solid",
// borderWidth: 20,
// },
// },
// data: hullStoreAmount,
// },
{ {
// 右柱下圆片 // 右柱下圆片
name: "", name: "",
@ -1504,7 +1393,7 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
}, },
{ {
type: "bar", type: "bar",
name: "内胆库", name: "箱壳库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",

@ -27,24 +27,39 @@ $(()=>{
tableAnimation('#productionPlan') tableAnimation('#productionPlan')
//当前库存统计 //当前库存统计
$.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) { $.getJSON('/tankShell/getMaterialStoreJson', function (result) {
multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory")); multipleThreeDimensionalCylindrical(result,document.getElementById("theCurrentInventory"));
}); });
//库位参数 //库位参数
$.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) {
console.log(result);
//单日出入库统计 //单日出入库统计
storageStatistics(result[0] == null ? 0 : result[0],result[1] == null ? 0 : result[1],result[2] == null ? 0 : result[2],result[3] == null ? 0 : result[3]); storageStatistics(result.inStoreLeftCount,result.outStoreLeftCount,result.inStoreRightCount,result.outStoreRightCount);
//库存统计 //库存统计
$("#emptyLocation-left").text(result[4] == null ? 0 : result[4]); $("#emptyLocation-left").text(result.freeStoreLeftCount);
$("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]); $("#haveUsedLocation-left").text(result.useStoreLeftCount);
$("#emptyLocation-right").text(result[5] == null ? 0 : result[6]); $("#emptyLocation-right").text(result.freeStoreRightCount);
$("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]); $("#haveUsedLocation-right").text(result.useStoreRightCount);
//库位占比 //库位占比
$("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]); $("#emptyLocationNumber").text(result.freeStoreCount);
$("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]); $("#emptyLocationRatio").text(GetPercent(result.freeStoreCount,312));
$("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]); $("#haveUsedLocationNumber").text(result.useStoreCount);
$("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]); $("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount,312));
}); });
//百分比
function GetPercent(num, total) {
num = parseFloat(num);
total = parseFloat(total);
if (isNaN(num) || isNaN(total)) {
return "-";
}
return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00)+"%";
}
}) })

@ -33,11 +33,6 @@ body {
} }
.foamingLineRunStatus { .foamingLineRunStatus {
position: absolute;
width: 40%;
height: 27%;
top: 12%;
left: 30%;
} }
.inventoryStatistics { .inventoryStatistics {

@ -41,7 +41,7 @@ $(() => {
let Res = {} let Res = {}
Res.data=res.map(val => { Res.data=res.map(val => {
return [val.spe,val.oq,val.aq,val.cha,val.round,] return [val["spe"],val["oq"],val["aq"],val["cha"],val.round,]
}) })
Res.header = ['型号', '计划数', '完成数', '差异数', '执行进度'] Res.header = ['型号', '计划数', '完成数', '差异数', '执行进度']
dynamicTable({ dynamicTable({
@ -51,7 +51,7 @@ $(() => {
header: Res.header, header: Res.header,
data: Res.data, data: Res.data,
index: false, index: false,
fontColor: '#B4B7BF ', fontColor: '#B4B7BF',
indexBGC: '#86F3FF', indexBGC: '#86F3FF',
headerBGC: 'rgba(8,36,75,0.2)', headerBGC: 'rgba(8,36,75,0.2)',
oddRowBGC: 'rgba(8,36,75,0.2)', oddRowBGC: 'rgba(8,36,75,0.2)',

@ -1191,16 +1191,6 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
let lineWidth = 1; let lineWidth = 1;
let isDataZoom = xValue.length > 3 let isDataZoom = xValue.length > 3
let stepSize = 1 / (xValue.length / 3) * 100 let stepSize = 1 / (xValue.length / 3) * 100
// hullStoreAmount.forEach((val, index) => {
// if (val == 0) {
// hullStoreAmount[index] = 0
// }
// })
// lineStoreAmount.forEach((val, index) => {
// if (val == 0) {
// lineStoreAmount[index] = 0
// }
// })
let option = { let option = {
grid: { grid: {
left: "0%", left: "0%",
@ -1328,59 +1318,6 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
color: "#26B2E8", color: "#26B2E8",
data: hullStoreAmount, data: hullStoreAmount,
}, },
// {
// // 左侧下内圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolSize: function (val) {
// if (val == 0) {
// return [0, 0]
// }else{
// return [37, 20]
// }
// },
// symbolOffset: [-39, 20],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#2EA9E5",
// borderType: "solid",
// borderWidth: 20,
// },
// },
//
// data: hullStoreAmount,
// },
// {
// // 左侧下外圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolSize: function (val) {
// if (val == 0) {
// return [0, 0]
// }else{
// return [50, 25]
// }
// },
// symbolOffset: [-39, 25],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#26B2E8",
// borderType: "solid",
// borderWidth: 20,
// },
// },
// data: hullStoreAmount,
// },
{ {
// 左侧下圆片 // 左侧下圆片
name: "", name: "",
@ -1396,7 +1333,7 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
}, },
{ {
type: "bar", type: "bar",
name: "箱壳库", name: "内胆库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",
@ -1441,54 +1378,6 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
color: "#20D3AB", color: "#20D3AB",
data: lineStoreAmount, data: lineStoreAmount,
}, },
// {
// // 右柱下内圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolPosition:'start',
// symbolSize: function (val,data) {
// console.log(val)
// if (!lineStoreAmount[data.dataIndex] > 0) return [0, 0]
// return [37, 20]
// },
// symbolOffset: [39, 20],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#20D3AB",
// borderType: "solid",
// borderWidth: 20,
// },
// },
// data: hullStoreAmount,
// },
// {
// // 右柱下外圈
// name: "",
// type: "pictorialBar",
// tooltip: {
// show: false,
// },
// symbolSize: function (val,data) {
// if (!lineStoreAmount[data.dataIndex] > 0) return [0, 0]
// return [50, 25]
// },
// symbolOffset: [39, 25],
// z: 10,
// itemStyle: {
// normal: {
// color: "transparent",
// borderColor: "#20D3AB",
// borderType: "solid",
// borderWidth: 20,
// },
// },
// data: hullStoreAmount,
// },
{ {
// 右柱下圆片 // 右柱下圆片
name: "", name: "",
@ -1504,7 +1393,7 @@ const multipleThreeDimensionalCylindrical = (res, ids) => {
}, },
{ {
type: "bar", type: "bar",
name: "内胆库", name: "箱壳库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",

@ -119,16 +119,14 @@ $(() => {
}) })
const deviceStatus = (statusArray) => { const deviceStatus = (statusArray) => {
let info = `<table style="width: 100%;height:100%;"> let info = `
<tr style="width: 100%;"> <img src="../../img/foamBox/${statusArray[0] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:34%;width: 2vw;"/>
<td style="position:absolute;top:-7%;left:8%;height:50%;width:10%;border:0px solid red;text-align:left;"><img src="../../img/foamBox/${statusArray[0] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="width: 2vw;"/></td> <img src="../../img/foamBox/${statusArray[1] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:40%;width: 2vw;"/>
<td style="position:absolute;top:-7%;left:23%;height:50%;width:10%;border:0px solid red;text-align:left;"><img src="../../img/foamBox/${statusArray[1] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="width: 2vw;"/></td> <img src="../../img/foamBox/${statusArray[2] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:45%;width: 2vw;"/>
<td style="position:absolute;top:-7%;left:38%;height:50%;width:10%;border:0px solid red;text-align:left;"><img src="../../img/foamBox/${statusArray[2] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="width: 2vw;"/></td> <img src="../../img/foamBox/${statusArray[3] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:51%;width: 2vw;"/>
<td style="position:absolute;top:-7%;left:52%;height:50%;width:10%;border:0px solid red;text-align:left;"><img src="../../img/foamBox/${statusArray[3] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="width: 2vw;"/></td> <img src="../../img/foamBox/${statusArray[4] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:60%;width: 2vw;"/>
<td style="position:absolute;top:-7%;left:75%;height:50%;width:10%;border:0px solid red;text-align:left;"><img src="../../img/foamBox/${statusArray[4] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="width: 2vw;"/></td> <img src="../../img/foamBox/${statusArray[5] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="position: absolute;transform: translate(-50%,-50%);top:30%;left:68%;width: 2vw;"/>
<td style="position:absolute;top:-7%;left:93%;height:50%;width:10%;border:0px solid red;text-align:left;"><img src="../../img/foamBox/${statusArray[5] == 1 ? "deviceopen.png" : "deviceclose.png"}" style="width: 2vw;"/></td> `;
</tr>
</table>`;
$(".foamingLineRunStatus table tr").append(info); $(".foamingLineRunStatus table tr").append(info);

@ -27,24 +27,39 @@ $(()=>{
tableAnimation('#productionPlan') tableAnimation('#productionPlan')
//当前库存统计 //当前库存统计
$.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) { $.getJSON('/tankShell/getMaterialStoreJson', function (result) {
multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory")); multipleThreeDimensionalCylindrical(result,document.getElementById("theCurrentInventory"));
}); });
//库位参数 //库位参数
$.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) {
console.log(result);
//单日出入库统计 //单日出入库统计
storageStatistics(result[0] == null ? 0 : result[0],result[1] == null ? 0 : result[1],result[2] == null ? 0 : result[2],result[3] == null ? 0 : result[3]); storageStatistics(result.inStoreLeftCount,result.outStoreLeftCount,result.inStoreRightCount,result.outStoreRightCount);
//库存统计 //库存统计
$("#emptyLocation-left").text(result[4] == null ? 0 : result[4]); $("#emptyLocation-left").text(result.freeStoreLeftCount);
$("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]); $("#haveUsedLocation-left").text(result.useStoreLeftCount);
$("#emptyLocation-right").text(result[5] == null ? 0 : result[6]); $("#emptyLocation-right").text(result.freeStoreRightCount);
$("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]); $("#haveUsedLocation-right").text(result.useStoreRightCount);
//库位占比 //库位占比
$("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]); $("#emptyLocationNumber").text(result.freeStoreCount);
$("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]); $("#emptyLocationRatio").text(GetPercent(result.freeStoreCount,312));
$("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]); $("#haveUsedLocationNumber").text(result.useStoreCount);
$("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]); $("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount,312));
}); });
//百分比
function GetPercent(num, total) {
num = parseFloat(num);
total = parseFloat(total);
if (isNaN(num) || isNaN(total)) {
return "-";
}
return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00)+"%";
}
}) })

@ -115,5 +115,6 @@
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" /> <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" /> <orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" />
</component> </component>
</module> </module>
Loading…
Cancel
Save