Merge remote-tracking branch 'origin/master'

# Conflicts:
#	productionboard/src/main/resources/static/js/storage/index.js
#	productionboard/target/classes/static/js/aluminumLiner/index.js
#	productionboard/target/classes/static/js/common/echarts.common.js
#	productionboard/target/classes/static/js/storage/index.js
master
夜笙歌 2 years ago
commit b87cb8a6dc

@ -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>

@ -183,57 +183,57 @@ public class FoamBoxController {
return JSONArray.toJSONString(mesMaterialStoreStatisticsList); return JSONArray.toJSONString(mesMaterialStoreStatisticsList);
} }
/** // /**
* // * 根据型号统计产量
* // *
* @author WenJY // * @author WenJY
* @date 2022/4/20 10:15 // * @date 2022/4/20 10:15
* @return java.lang.String // * @return java.lang.String
*/ // */
@GetMapping("/getStatisticalOutputByModel") // @GetMapping("/getStatisticalOutputByModel")
@ResponseBody // @ResponseBody
public String getStatisticalOutputByModel() { // public String getStatisticalOutputByModel() {
String info = // String info =
"{\n" // "{\n"
+ "\t\"datas\":[\n" // + "\t\"datas\":[\n"
+ " {\"ranking\": 1,\"station\":\"SC227\",\"value\": 199999},\n" // + " {\"ranking\": 1,\"station\":\"SC227\",\"value\": 199999},\n"
+ " {\"ranking\": 2,\"station\":\"SC228\",\"value\": 104970},\n" // + " {\"ranking\": 2,\"station\":\"SC228\",\"value\": 104970},\n"
+ " {\"ranking\": 3,\"station\":\"SC229\",\"value\": 29034},\n" // + " {\"ranking\": 3,\"station\":\"SC229\",\"value\": 29034},\n"
+ " {\"ranking\": 4,\"station\":\"SC223\",\"value\": 23489},\n" // + " {\"ranking\": 4,\"station\":\"SC223\",\"value\": 23489},\n"
+ " {\"ranking\": 5,\"station\":\"SC224\",\"value\": 18203}\n" // + " {\"ranking\": 5,\"station\":\"SC224\",\"value\": 18203}\n"
+ " ],\n" // + " ],\n"
+ "\t\"plan\":[290000, 290000, 290000, 290000, 290000, 290000]\n" // + "\t\"plan\":[290000, 290000, 290000, 290000, 290000, 290000]\n"
+ "}"; // + "}";
return info; // return info;
} // }
/** // /**
* // * 库存 统计
* // *
* @author WenJY // * @author WenJY
* @date 2022/4/20 10:16 // * @date 2022/4/20 10:16
* @return java.lang.String // * @return java.lang.String
*/ // */
@GetMapping("/getInventoryStatistics") // @GetMapping("/getInventoryStatistics")
@ResponseBody // @ResponseBody
public String getInventoryStatistics() { // public String getInventoryStatistics() {
String info = // String info =
"{\n" // "{\n"
+ "\t\"datas\":[\n" // + "\t\"datas\":[\n"
+ " {\n" // + " {\n"
+ " \"name\": \"SC528\",\n" // + " \"name\": \"SC528\",\n"
+ " \"value\": 175.17\n" // + " \"value\": 175.17\n"
+ " },\n" // + " },\n"
+ " {\n" // + " {\n"
+ " \"name\": \"SC529\",\n" // + " \"name\": \"SC529\",\n"
+ " \"value\": 148.35\n" // + " \"value\": 148.35\n"
+ " },\n" // + " },\n"
+ " {\n" // + " {\n"
+ " \"name\": \"SC327\",\n" // + " \"name\": \"SC327\",\n"
+ " \"value\": 95.36\n" // + " \"value\": 95.36\n"
+ " }\n" // + " }\n"
+ " ]\n" // + " ]\n"
+ "}"; // + "}";
return info; // return info;
} // }
} }

@ -99,17 +99,18 @@ public class PreassembleController {
@GetMapping("/getMaterialStoreJson") @GetMapping("/getMaterialStoreJson")
@ResponseBody @ResponseBody
public String getMesMaterialStoreStatisticsJson(){ public String getMesMaterialStoreStatisticsJson(){
List<MesMaterialStoreStatistics> mesMaterialStoreStatisticsList = iMesProductionDataService.getMesMaterialStoreStatisticsList("1004"); List<MesMaterialStoreStatistics> mesMaterialStoreStatisticsList =
iMesProductionDataService.getMesMaterialStoreStatisticsList("1004");
return JSONArray.toJSONString(mesMaterialStoreStatisticsList); return JSONArray.toJSONString(mesMaterialStoreStatisticsList);
} }
/** /* *//**
* *
* *
* @author WenJY * @author WenJY
* @date 2022/4/20 10:15 * @date 2022/4/20 10:15
* @return java.lang.String * @return java.lang.String
*/ *//*
@GetMapping("/getStatisticalOutputByModel") @GetMapping("/getStatisticalOutputByModel")
@ResponseBody @ResponseBody
public String getStatisticalOutputByModel() { public String getStatisticalOutputByModel() {
@ -127,13 +128,13 @@ public class PreassembleController {
return info; return info;
} }
/** *//**
* *
* *
* @author WenJY * @author WenJY
* @date 2022/4/20 10:16 * @date 2022/4/20 10:16
* @return java.lang.String * @return java.lang.String
*/ *//*
@GetMapping("/getInventoryStatistics") @GetMapping("/getInventoryStatistics")
@ResponseBody @ResponseBody
public String getInventoryStatistics() { public String getInventoryStatistics() {
@ -155,5 +156,5 @@ public class PreassembleController {
+ " ]\n" + " ]\n"
+ "}"; + "}";
return info; return info;
} }*/
} }

@ -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;
@ -50,7 +51,13 @@ public class StorageController {
@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,45 +66,10 @@ 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);
} }

@ -68,7 +68,6 @@ public interface MesMaterialStoreStatisticsMapper extends BaseMapper<MesMaterial
* @return * @return
*/ */
@Select("select materialName,LINERSTOREAMOUNT as lineStoreAmount,hullStoreAmount from table ( scada_absorb_kctj2(#{in_id}) )") @Select("select materialName,LINERSTOREAMOUNT as lineStoreAmount,hullStoreAmount from table ( scada_absorb_kctj2(#{in_id}) )")
List<MesMaterialStoreStatistics> getAdsorptionTankStoreStatistics4(@Param("in_id") Integer in_id); List<MesMaterialStoreStatistics> getAdsorptionTankStoreStatistics4(@Param("in_id") Integer in_id);
@Select("select * from table ( scada_adsorb_fault(#{in_id}) )") @Select("select * from table ( scada_adsorb_fault(#{in_id}) )")
List<DeviceFault> selectDeviceFaultByType1005(int in_id); List<DeviceFault> selectDeviceFaultByType1005(int in_id);

@ -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);
}
} }

@ -165,7 +165,7 @@ public class MesProductionDataServiceImpl implements IMesProductionDataService {
public List<MesMaterialStoreStatistics> getMesMaterialStoreStatisticsList(String locationNumber) { public List<MesMaterialStoreStatistics> getMesMaterialStoreStatisticsList(String locationNumber) {
List<MesMaterialStoreStatistics> mesMaterialStoreStatistics = new ArrayList<>(); List<MesMaterialStoreStatistics> mesMaterialStoreStatistics = new ArrayList<>();
System.out.println("数据切换标志: "+this.in_id);
switch (locationNumber) { switch (locationNumber) {
case "1001": case "1001":
mesMaterialStoreStatistics = materialStoreStatisticsMapper.getAdsorptionTankStoreStatistics(this.in_id); mesMaterialStoreStatistics = materialStoreStatisticsMapper.getAdsorptionTankStoreStatistics(this.in_id);

@ -364,10 +364,10 @@ const threeDimensionalCylindrical = (res, ids) => {
}, },
axisLabel: { axisLabel: {
show: true, show: true,
rotate:-30,
margin: 25, margin: 25,
align: "center",
textStyle: { textStyle: {
fontSize: 14, fontSize: 10,
color: "#A8A6AB", color: "#A8A6AB",
rich: { rich: {
a: { a: {
@ -1201,16 +1201,6 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
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%",
@ -1236,7 +1226,7 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
color: "#fff", color: "#fff",
fontSize: fontSize, fontSize: fontSize,
}, },
data: ["箱壳库", "内胆库"], data: ["内胆库", "箱壳库"],
}, },
xAxis: [ xAxis: [
{ {
@ -1338,59 +1328,6 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
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: "",
@ -1406,7 +1343,7 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
}, },
{ {
type: "bar", type: "bar",
name: "箱壳库", name: "内胆库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",
@ -1451,54 +1388,6 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
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: "",
@ -1514,7 +1403,7 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
}, },
{ {
type: "bar", type: "bar",
name: "内胆库", name: "箱壳库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",

@ -40,20 +40,55 @@ $(() => {
$.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { $.getJSON(`/storage/getParamJson?ids=${ids}`, function (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[0] == null ? 0 : result[0], result[1] == null ? 0 : result[1], result[2] == null ? 0 : result[2], result[3] == null ? 0 : result[3]);
//当前库存统计
$.getJSON('/tankShell/getMaterialStoreJson', function (result) {
multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"));
});
//库存统计 //库位参数
$("#emptyLocation-left").text(result[4] == null ? 0 : result[4]); $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) {
$("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]);
$("#emptyLocation-right").text(result[5] == null ? 0 : result[6]); console.log(result);
$("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]);
//单日出入库统计
//库位占比 storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount);
$("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]);
$("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]); //库存统计
$("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]); // $("#emptyLocation-left").text(result[4] == null ? 0 : result[4]);
$("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]); // $("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]);
}); // $("#emptyLocation-right").text(result[5] == null ? 0 : result[6]);
// $("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]);
//库存统计
$("#emptyLocation-left").text(result.freeStoreLeftCount);
$("#haveUsedLocation-left").text(result.useStoreLeftCount);
$("#emptyLocation-right").text(result.freeStoreRightCount);
$("#haveUsedLocation-right").text(result.useStoreRightCount);
//库位占比
// $("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]);
// $("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]);
// $("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]);
// $("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]);
//库位占比
$("#emptyLocationNumber").text(result.freeStoreCount);
$("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312));
$("#haveUsedLocationNumber").text(result.useStoreCount);
$("#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) + "%";
}
});
})
setTimeout(fun, 10000) setTimeout(fun, 10000)
} }
fun() fun()
}) })

@ -364,10 +364,10 @@ const threeDimensionalCylindrical = (res, ids) => {
}, },
axisLabel: { axisLabel: {
show: true, show: true,
rotate:-30,
margin: 25, margin: 25,
align: "center",
textStyle: { textStyle: {
fontSize: 14, fontSize: 10,
color: "#A8A6AB", color: "#A8A6AB",
rich: { rich: {
a: { a: {
@ -1201,16 +1201,6 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
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%",
@ -1338,59 +1328,6 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
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: "",
@ -1406,7 +1343,7 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
}, },
{ {
type: "bar", type: "bar",
name: "箱壳库", name: "内胆库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",
@ -1451,54 +1388,6 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
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: "",
@ -1514,7 +1403,7 @@ const multipleThreeDimensionalCylindrical = (res, ids, type = 1) => {
}, },
{ {
type: "bar", type: "bar",
name: "内胆库", name: "箱壳库",
barWidth: "26", barWidth: "26",
barGap: "200%", barGap: "200%",
barCateGoryGap: "10%", barCateGoryGap: "10%",

@ -38,22 +38,43 @@ $(() => {
}); });
//库位参数 //库位参数
$.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { $.getJSON(`/storage/getParamJson?ids=${ids}`, function (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[0] == null ? 0 : result[0], result[1] == null ? 0 : result[1], result[2] == null ? 0 : result[2], result[3] == null ? 0 : result[3]);
//当前库存统计
//库存统计 $.getJSON('/tankShell/getMaterialStoreJson', function (result) {
$("#emptyLocation-left").text(result[4] == null ? 0 : result[4]); multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"));
$("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]); });
$("#emptyLocation-right").text(result[5] == null ? 0 : result[6]);
$("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]); //库位参数
$.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) {
//库位占比
$("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]); console.log(result);
$("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]);
$("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]); //单日出入库统计
$("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]); storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount);
});
setTimeout(fun, 10000) //库存统计
} $("#emptyLocation-left").text(result.freeStoreLeftCount);
fun() $("#haveUsedLocation-left").text(result.useStoreLeftCount);
}) $("#emptyLocation-right").text(result.freeStoreRightCount);
$("#haveUsedLocation-right").text(result.useStoreRightCount);
//库位占比
$("#emptyLocationNumber").text(result.freeStoreCount);
$("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312));
$("#haveUsedLocationNumber").text(result.useStoreCount);
$("#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