@ -20,6 +20,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.core.content.HttpContext ;
import org.nl.modules.wql.util.SpringContextHolder ;
import org.nl.modules.wql.util.WqlUtil ;
import org.nl.system.service.param.ISysParamService ;
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl ;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl ;
import org.nl.wms.pda.mps.eum.RegionTypeEnum ;
@ -47,6 +48,8 @@ public class BakingServiceImpl implements BakingService {
@Autowired
private RedisUtils redisUtils ;
@Autowired
private ISysParamService paramService ;
@Autowired
private CoolPointIvtMapper coolPointIvtMapper ;
@Autowired
private RawfoilWorkOrderMapper rawfoilWorkOrderMapper ;
@ -114,10 +117,12 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException ( "未查询到母卷号:" + container_name + "对应的生箔机台编号!" ) ;
}
if ( StrUtil . equals ( "1" , sb_jo . getString ( "mes_used" ) ) & & ! "1" . equals ( raw_jo . getString ( "is_baking" ) ) ) {
String mes_used = paramService . findByCode ( "mes_used" ) . getValue ( ) ;
if ( StrUtil . equals ( "1" , mes_used ) ) {
if ( ! "1" . equals ( raw_jo . getString ( "is_baking" ) ) ) {
throw new BadRequestException ( "该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!" ) ;
}
}
if ( ObjectUtil . isEmpty ( container_name ) ) {
throw new BadRequestException ( "母卷号不能为空" ) ;
}
@ -134,7 +139,7 @@ public class BakingServiceImpl implements BakingService {
/ *
* 根据点位判断是 冷却区入烘箱还是烘箱对接位入烘箱
* /
JSONObject jsonPointZc = pointTab . query ( "point_code = '" + point_code1 + "' AND point_type = '4 '" ) . uniqueResult ( 0 ) ;
JSONObject jsonPointZc = pointTab . query ( "point_code = '" + point_code1 + "' AND point_type = '5 '" ) . uniqueResult ( 0 ) ;
String point_type = "1" ;
// 冷却点
@ -242,25 +247,29 @@ public class BakingServiceImpl implements BakingService {
//只找入箱点位
map . put ( "point_type" , "4" ) ;
String point_code2 = "" ;
JSONObject point_code2_jo = WQL . getWO ( "PDA_OVENINANDOUT_01" ) . addParamMap ( map ) . process ( ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( point_code2_jo ) ) {
throw new BadRequestException ( "未查询到可用的点位类型为入箱的烘箱对接位! ") ;
if ( ObjectUtil . isNot Empty ( point_code2_jo ) ) {
point_code2 = point_code2_jo . getString ( "point_code ") ;
}
String point_code3 = "" ;
JSONObject jsonHotIvt = getJsonObject ( product_area , point_code2_jo , temperature ) ;
if ( ObjectUtil . isEmpty ( jsonHotIvt ) ) {
throw new BadRequestException ( "烘烤区没有合适温度的空位! ") ;
if ( ObjectUtil . isNot Empty ( jsonHotIvt ) ) {
point_code3 = jsonHotIvt . getString ( "point_code ") ;
}
// 3.创建冷却区 --> 烘烤区任务
JSONObject param = new JSONObject ( ) ;
param . put ( "type" , "1" ) ; // 1- 冷却区入烘箱 2- 暂存位入烘箱
param . put ( "point_code1" , point_code1 ) ;
param . put ( "point_code2" , point_code2_jo . getString ( "point_code" ) ) ;
param . put ( "point_code3" , jsonHotIvt . getString ( " point_code" ) ) ;
param . put ( "point_code2" , point_code2 ) ;
param . put ( "point_code3" , point_code3 ) ;
param . put ( "material_code" , container_name ) ;
param . put ( "product_area" , product_area ) ;
param . put ( "request_param" , NumberUtil . mul ( Double . parseDouble ( hours ) , 60 ) ) ;
param . put ( "temperature" , temperature ) ;
param . put ( "param" , map ) ;
// 创建冷却区 --> 暂存位的任务
InHotTask inHotTask = new InHotTask ( ) ;
@ -316,7 +325,7 @@ public class BakingServiceImpl implements BakingService {
jsonCool . put ( "confirm_time" , DateUtil . now ( ) ) ;
coolTab . insert ( jsonCool ) ;
} else {
throw new BadRequestException ( "请扫描正确的冷却区点位或对接点位!" ) ;
throw new BadRequestException ( "请扫描正确的冷却区点位或烘箱 对接点位!" ) ;
}
} else if ( StrUtil . equals ( option , "2" ) ) {
// 出箱
@ -445,6 +454,283 @@ public class BakingServiceImpl implements BakingService {
return result ;
}
@Override
@Transactional ( rollbackFor = Exception . class )
public JSONObject inHotByPoint ( JSONObject whereJson ) {
WQLObject pointTab = WQLObject . getWQLObject ( "SCH_BASE_Point" ) ; // 点位表
WQLObject taskTab = WQLObject . getWQLObject ( "SCH_BASE_Task" ) ; // 任务表
WQLObject coolIvtTab = WQLObject . getWQLObject ( "ST_IVT_CoolPointIvt" ) ; // 冷却区点位库存表
WQLObject hosIvtTab = WQLObject . getWQLObject ( "ST_IVT_HotPointIvt" ) ; // 烤箱区点位库存表
WQLObject hosReMstTab = WQLObject . getWQLObject ( "ST_IVT_HotRegionIOMst" ) ; // 烤箱区出入主表
WQLObject coolTab = WQLObject . getWQLObject ( "ST_IVT_CoolRegionIO" ) ; // 冷却区出入表
WQLObject rawTab = WQLObject . getWQLObject ( "PDM_BI_RawFoilWorkOrder" ) ; // 生箔工单表
WQLObject materTab = WQLObject . getWQLObject ( "md_me_materialbase" ) ; // 物料表
//获取人员对应的区域
UserAreaServiceImpl userAreaService = new UserAreaServiceImpl ( ) ;
String in_area_id = userAreaService . getInArea ( ) ;
// 入箱
String container_name = whereJson . getString ( "container_name" ) ; // 母卷号
String temperature = whereJson . getString ( "temperature" ) ; // 温度
String hours = whereJson . getString ( "hours" ) ; // 时间
String point_code1 = whereJson . getString ( "point_code" ) ; // 起点
String point_code3 = whereJson . getString ( "next_point_code" ) ; //终点
if ( ObjectUtil . isEmpty ( container_name ) ) {
throw new BadRequestException ( "母卷号不能为空" ) ;
}
if ( ObjectUtil . isEmpty ( temperature ) ) {
throw new BadRequestException ( "温度不能为空" ) ;
}
if ( ObjectUtil . isEmpty ( hours ) ) {
throw new BadRequestException ( "时间不能为空" ) ;
}
if ( ObjectUtil . isEmpty ( point_code1 ) ) {
throw new BadRequestException ( "起点不能为空" ) ;
}
if ( ObjectUtil . isEmpty ( point_code3 ) ) {
throw new BadRequestException ( "终点不能为空" ) ;
}
//查询该点位是否存在未完成的任务
JSONObject task1 = isSingleTask ( point_code1 ) ;
if ( task1 ! = null ) {
throw new BadRequestException ( "当前点位" + point_code1 + "存在正在执行的任务" + task1 . getString ( "task_code" ) ) ;
}
JSONObject task2 = isSingleTask ( point_code3 ) ;
if ( task2 ! = null ) {
throw new BadRequestException ( "当前点位" + point_code3 + "存在正在执行的任务" + task2 . getString ( "task_code" ) ) ;
}
//校验该设备是否启用,且母卷MES是否请求烘烤
//查询该母卷号、设备号对应的生箔工单
JSONObject raw_jo = WQLObject . getWQLObject ( "PDM_BI_RawFoilWorkOrder" ) . query ( "container_name ='" + container_name + "'" ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( raw_jo ) ) {
throw new BadRequestException ( "未查询到对应的生箔工单!" ) ;
}
if ( raw_jo . getString ( "order_type" ) . equals ( "1" ) ) {
throw new BadRequestException ( "当前工单为标箔工单,不允许烘烤!" ) ;
}
String resource_name = raw_jo . getString ( "resource_name" ) ;
JSONObject sb_jo = WQLObject . getWQLObject ( "st_ivt_sbpointivt" ) . query ( "ext_code ='" + resource_name + "'" ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( sb_jo ) ) {
throw new BadRequestException ( "未查询到母卷号:" + container_name + "对应的生箔机台编号!" ) ;
}
String mes_used = paramService . findByCode ( "mes_used" ) . getValue ( ) ;
if ( StrUtil . equals ( "1" , mes_used ) ) {
if ( ! "1" . equals ( raw_jo . getString ( "is_baking" ) ) ) {
throw new BadRequestException ( "该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!" ) ;
}
}
/ *
* 根据点位判断是 冷却区入烘箱还是烘箱对接位入烘箱
* /
JSONObject jsonPointZc = pointTab . query ( "point_code = '" + point_code1 + "' AND point_type = '5'" ) . uniqueResult ( 0 ) ;
String point_type = "1" ;
// 冷却点
JSONObject jsonCoolIvt = coolIvtTab . query ( "full_point_code = '" + point_code1 + "' and is_used = '1' AND point_type = '" + point_type + "'" ) . uniqueResult ( 0 ) ;
// CoolPointIvt coolPointIvt = coolPointIvtMapper.selectOne(new LambdaQueryWrapper<CoolPointIvt>()
// .eq(ObjectUtil.isNotEmpty(point_code1), CoolPointIvt::getPoint_code, point_code1));
if ( ObjectUtil . isNotEmpty ( jsonPointZc ) ) {
if ( ! in_area_id . contains ( jsonPointZc . getString ( "product_area" ) ) ) {
throw new BadRequestException ( "当前登录人员暂无【" + jsonPointZc . getString ( "product_area" ) + "】操作权限" ) ;
}
/ *
* 暂存区入烘箱
* /
JSONObject jsonHotIvt = hosIvtTab . query ( "point_code = '" + point_code3 + "'" ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( jsonHotIvt ) ) {
throw new BadRequestException ( "烘烤区域无此点位!" ) ;
}
if ( ! jsonPointZc . getString ( "point_location" ) . equals ( jsonHotIvt . getString ( "point_location" ) ) ) {
throw new BadRequestException ( "暂存位和烘烤区域点位位置不一致!请选择点位位置一致的烘箱位置或者暂存位" ) ;
}
boolean exists = redisUtils . hHasKey ( point_code3 , "temperature" ) ;
String point_temperature = "" ;
if ( exists ) {
point_temperature = ( String ) redisUtils . hget ( point_code3 , "temperature" ) ;
} else {
throw new BadRequestException ( "获取不到redis中" + point_code3 + "的温度" ) ;
}
if ( ObjectUtil . isEmpty ( point_temperature ) ) {
if ( ! point_temperature . equals ( temperature ) ) {
throw new BadRequestException ( "请先调节指定烘箱的温度到" + temperature + ",再重新操作!" ) ;
}
}
// 2.创建暂存位 --> 烘烤区任务
JSONObject param = new JSONObject ( ) ;
param . put ( "type" , "2" ) ; // 1- 冷却区入烘箱 2- 暂存位入烘箱
param . put ( "point_code1" , point_code1 ) ;
param . put ( "point_code2" , jsonHotIvt . getString ( "point_code" ) ) ;
param . put ( "material_code" , container_name ) ;
param . put ( "product_area" , jsonPointZc . getString ( "product_area" ) ) ;
param . put ( "request_param" , NumberUtil . mul ( Double . parseDouble ( hours ) , 60 ) ) ;
InHotTask inHotTask = new InHotTask ( ) ;
String task_id = inHotTask . createTask ( param ) ;
// 3.插入主表
JSONObject jsonRaw = rawTab . query ( "container_name = '" + container_name + "' and is_delete = '0'" ) . uniqueResult ( 0 ) ;
JSONObject jsonMater = materTab . query ( "material_code = '" + jsonRaw . getString ( "product_name" ) + "'" ) . uniqueResult ( 0 ) ;
JSONObject hotParam = new JSONObject ( ) ;
hotParam . put ( "container_name" , container_name ) ;
hotParam . put ( "workorder_id" , jsonRaw . getString ( "workorder_id" ) ) ;
hotParam . put ( "material_id" , jsonMater . getString ( "material_id" ) ) ;
hotParam . put ( "qty" , jsonRaw . get ( "productin_qty" ) ) ;
hotParam . put ( "io_type" , "0" ) ;
hotParam . put ( "qty_unit_id" , jsonMater . getString ( "base_unit_id" ) ) ;
hotParam . put ( "task_id" , task_id ) ;
hotParam . put ( "start_point_code" , point_code1 ) ;
hotParam . put ( "end_point_code" , jsonHotIvt . getString ( "point_code" ) ) ;
hotParam . put ( "temperature" , temperature ) ;
hotParam . put ( "oven_time" , hours ) ;
this . createHotIoMst ( hotParam ) ;
} else if ( ObjectUtil . isNotEmpty ( jsonCoolIvt ) ) {
/ *
* 冷却区入烘箱
* /
// hint:
// 1.根据烘箱点位此母卷的点位找到对应的暂存区
JSONObject jsonHotIvt = hosIvtTab . query ( "point_code = '" + point_code3 + "'" ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( jsonHotIvt ) ) {
throw new BadRequestException ( "烘烤区域无此点位!" ) ;
}
boolean exists = redisUtils . hHasKey ( point_code3 , "temperature" ) ;
String point_temperature = "" ;
if ( exists ) {
point_temperature = ( String ) redisUtils . hget ( point_code3 , "temperature" ) ;
} else {
throw new BadRequestException ( "获取不到redis中" + point_code3 + "的温度" ) ;
}
if ( ObjectUtil . isEmpty ( point_temperature ) ) {
if ( ! point_temperature . equals ( temperature ) ) {
throw new BadRequestException ( "请先调节指定烘箱的温度到" + temperature + ",再重新操作!" ) ;
}
}
String product_area = jsonHotIvt . getString ( "product_area" ) ; // 生产区域
String point_location = jsonHotIvt . getString ( "point_location" ) ; // 位置
String reging_id = "" ;
if ( ! in_area_id . contains ( product_area ) ) {
throw new BadRequestException ( "当前登录人员暂无【" + product_area + "】操作权限" ) ;
}
switch ( product_area ) {
case "A1" :
reging_id = RegionTypeEnum . A_HKZC . getId ( ) ;
break ;
case "A2" :
reging_id = RegionTypeEnum . B_HKZC . getId ( ) ;
break ;
case "A3" :
reging_id = RegionTypeEnum . C_HKZC . getId ( ) ;
break ;
case "A4" :
reging_id = RegionTypeEnum . D_HKZC . getId ( ) ;
break ;
case "B2" :
reging_id = RegionTypeEnum . B2_HKZC . getId ( ) ;
break ;
default :
break ;
}
JSONObject map = new JSONObject ( ) ;
map . put ( "flag" , "1" ) ;
map . put ( "reging_id" , reging_id ) ;
map . put ( "point_location" , point_location ) ;
//只找入箱点位
map . put ( "point_type" , "4" ) ;
JSONObject point_code2_jo = WQL . getWO ( "PDA_OVENINANDOUT_01" ) . addParamMap ( map ) . process ( ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( point_code2_jo ) ) {
throw new BadRequestException ( "未查询到可用的点位类型为入箱的冷却位对接位!" ) ;
}
// 3.创建冷却区 --> 烘烤区任务
JSONObject param = new JSONObject ( ) ;
param . put ( "type" , "1" ) ; // 1- 冷却区入烘箱 2- 暂存位入烘箱
param . put ( "point_code1" , point_code1 ) ;
param . put ( "point_code2" , point_code2_jo . getString ( "point_code" ) ) ;
param . put ( "point_code3" , point_code3 ) ;
param . put ( "material_code" , container_name ) ;
param . put ( "product_area" , product_area ) ;
param . put ( "request_param" , NumberUtil . mul ( Double . parseDouble ( hours ) , 60 ) ) ;
param . put ( "temperature" , temperature ) ;
param . put ( "param" , map ) ;
// 创建冷却区 --> 暂存位的任务
InHotTask inHotTask = new InHotTask ( ) ;
String task_id = inHotTask . createTask ( param ) ;
// 4.插入烘箱区出入主表
JSONObject jsonRaw = rawTab . query ( "container_name = '" + container_name + "' and is_delete = '0'" ) . uniqueResult ( 0 ) ;
JSONObject jsonMater = materTab . query ( "material_code = '" + jsonRaw . getString ( "product_name" ) + "'" ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isEmpty ( jsonMater ) ) {
throw new BadRequestException ( "物料基础信息中无此物料!" ) ;
}
JSONObject hotParam = new JSONObject ( ) ;
hotParam . put ( "container_name" , container_name ) ;
hotParam . put ( "workorder_id" , jsonRaw . getString ( "workorder_id" ) ) ;
hotParam . put ( "material_id" , jsonMater . getString ( "material_id" ) ) ;
hotParam . put ( "qty" , jsonRaw . get ( "productin_qty" ) ) ;
hotParam . put ( "qty_unit_id" , jsonMater . getString ( "base_unit_id" ) ) ;
hotParam . put ( "task_id" , task_id ) ;
hotParam . put ( "io_type" , "0" ) ;
hotParam . put ( "start_point_code" , point_code1 ) ;
hotParam . put ( "end_point_code" , jsonHotIvt . getString ( "point_code" ) ) ;
hotParam . put ( "temperature" , temperature ) ;
hotParam . put ( "oven_time" , hours ) ;
this . createHotIoMst ( hotParam ) ;
// 生成冷却区出入表
String currentUserId = SecurityUtils . getCurrentUserId ( ) ;
String currentUsername = SecurityUtils . getCurrentUsername ( ) ;
JSONObject jsonCool = new JSONObject ( ) ;
jsonCool . put ( "iostorinv_id" , IdUtil . getSnowflake ( 1 , 1 ) . nextId ( ) ) ;
jsonCool . put ( "bill_code" , CodeUtil . getNewCode ( "COOLREGION_BILL_CODE" ) ) ;
jsonCool . put ( "io_type" , "1" ) ;
jsonCool . put ( "material_id" , jsonMater . getString ( "material_id" ) ) ;
jsonCool . put ( "pcsn" , container_name ) ;
jsonCool . put ( "bill_status" , "50" ) ;
jsonCool . put ( "qty" , jsonRaw . get ( "productin_qty" ) ) ;
jsonCool . put ( "task_id" , task_id ) ;
jsonCool . put ( "qty_unit_id" , jsonMater . getString ( "base_unit_id" ) ) ;
jsonCool . put ( "start_point_code" , point_code1 ) ;
jsonCool . put ( "end_point_code" , jsonHotIvt . getString ( "point_code" ) ) ;
jsonCool . put ( "create_mode" , "03" ) ;
jsonCool . put ( "create_id" , currentUserId ) ;
jsonCool . put ( "create_name" , currentUsername ) ;
jsonCool . put ( "create_time" , DateUtil . now ( ) ) ;
jsonCool . put ( "update_optid" , currentUserId ) ;
jsonCool . put ( "update_optname" , currentUsername ) ;
jsonCool . put ( "update_time" , DateUtil . now ( ) ) ;
jsonCool . put ( "confirm_optid" , currentUserId ) ;
jsonCool . put ( "confirm_optname" , currentUsername ) ;
jsonCool . put ( "confirm_time" , DateUtil . now ( ) ) ;
coolTab . insert ( jsonCool ) ;
} else {
throw new BadRequestException ( "请扫描正确的冷却区点位或烘箱对接点位!" ) ;
}
JSONObject result = new JSONObject ( ) ;
result . put ( "message" , "操作成功!" ) ;
return result ;
}
public JSONObject getJsonObject ( String product_area , JSONObject point_code2_jo , String temperature ) {
if ( ObjectUtil . isEmpty ( point_code2_jo ) ) {
throw new BadRequestException ( "烘箱对接没有可用位置!" ) ;
@ -510,9 +796,12 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException ( "未查询到母卷号:" + container_name + "对应的生箔机台编号!" ) ;
}
if ( StrUtil . equals ( "1" , sb_jo . getString ( "mes_used" ) ) & & ! "1" . equals ( raw_jo . getString ( "is_instor" ) ) ) {
String mes_used = paramService . findByCode ( "mes_used" ) . getValue ( ) ;
if ( StrUtil . equals ( "1" , mes_used ) ) {
if ( ! "1" . equals ( raw_jo . getString ( "is_instor" ) ) ) {
throw new BadRequestException ( "该母卷在MES上未进行决策入半成品库,不允许进行入冷却操作!" ) ;
}
}
// 1.获取此暂存位的生产区域和上下位置
JSONObject jsonPoint = pointTab . query ( "point_code = '" + point_code1 + "' and point_type = '5'" ) . uniqueResult ( 0 ) ;
@ -776,9 +1065,12 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException ( "未查询到母卷号:" + container_name + "对应的生箔机台编号!" ) ;
}
if ( StrUtil . equals ( "1" , sb_jo . getString ( "mes_used" ) ) & & ! "1" . equals ( raw_jo . getString ( "is_baking" ) ) ) {
String mes_used = paramService . findByCode ( "mes_used" ) . getValue ( ) ;
if ( StrUtil . equals ( "1" , mes_used ) ) {
if ( ! "1" . equals ( raw_jo . getString ( "is_baking" ) ) ) {
throw new BadRequestException ( "该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!" ) ;
}
}
if ( ObjectUtil . isEmpty ( container_name ) ) {
throw new BadRequestException ( "母卷号不能为空" ) ;
@ -861,7 +1153,7 @@ public class BakingServiceImpl implements BakingService {
hotParam . put ( "oven_time" , hours ) ;
this . createHotIoMst ( hotParam ) ;
} else {
throw new BadRequestException ( "请扫描点位类型为出箱的烘箱对接位 !" ) ;
throw new BadRequestException ( "请选择点位类型为出箱的烘箱对接位上的母卷 !" ) ;
}
} else if ( StrUtil . equals ( option , "1" ) ) {
// 入冷却
@ -888,9 +1180,12 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException ( "未查询到母卷号:" + container_name + "对应的生箔机台编号!" ) ;
}
if ( StrUtil . equals ( "1" , sb_jo . getString ( "mes_used" ) ) & & ! "1" . equals ( raw_jo . getString ( "is_instor" ) ) ) {
String mes_used = paramService . findByCode ( "mes_used" ) . getValue ( ) ;
if ( StrUtil . equals ( "1" , mes_used ) ) {
if ( ! "1" . equals ( raw_jo . getString ( "is_instor" ) ) ) {
throw new BadRequestException ( "该母卷在MES上未进行决策入半成品库,不允许进行入冷却操作!" ) ;
}
}
// 1.获取此暂存位的生产区域和上下位置
JSONObject jsonPoint = pointTab . query ( "point_code = '" + point_code1 + "' and point_type = '5'" ) . uniqueResult ( 0 ) ;
@ -993,16 +1288,30 @@ public class BakingServiceImpl implements BakingService {
}
JSONObject json = WQL . getWO ( "ST_IVT_HOTPOINTIVT" ) . addParamMap ( map ) . pageQuery ( ctx , "container_name" ) ;
JSONArray rows = json . getJSONArray ( "content" ) ;
JSONArray new_rows = new JSONArray ( ) ;
for ( int i = 0 ; i < rows . size ( ) ; i + + ) {
JSONObject row = rows . getJSONObject ( i ) ;
String temperature = ( String ) redisUtils . hget ( row . getString ( "point_code" ) , "temperature" ) ;
String last_time = ( String ) redisUtils . hget ( row . getString ( "point_code" ) , "last_time" ) ;
row . put ( "temperature" , temperature ) ;
row . put ( "last_time" , last_time ) ;
new_rows . add ( row ) ;
}
json . put ( "content" , new_rows ) ;
return json ;
JSONObject jo = new JSONObject ( ) ;
jo . put ( "data" , rows ) ;
jo . put ( "size" , json . getString ( "totalElements" ) ) ;
jo . put ( "message" , "查询成功!" ) ;
return jo ;
}
public JSONObject isSingleTask ( String point_code ) {
JSONObject task1 = WQLObject . getWQLObject ( "SCH_BASE_Task" ) . query ( "point_code1 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'" ) . uniqueResult ( 0 ) ;
JSONObject task2 = WQLObject . getWQLObject ( "SCH_BASE_Task" ) . query ( "point_code2 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'" ) . uniqueResult ( 0 ) ;
JSONObject task3 = WQLObject . getWQLObject ( "SCH_BASE_Task" ) . query ( "point_code3 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'" ) . uniqueResult ( 0 ) ;
JSONObject task4 = WQLObject . getWQLObject ( "SCH_BASE_Task" ) . query ( "point_code4 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'" ) . uniqueResult ( 0 ) ;
if ( ObjectUtil . isNotEmpty ( task1 ) ) {
return task1 ;
} else if ( ObjectUtil . isNotEmpty ( task2 ) ) {
return task2 ;
} else if ( ObjectUtil . isNotEmpty ( task3 ) ) {
return task3 ;
} else if ( ObjectUtil . isNotEmpty ( task4 ) ) {
return task4 ;
}
return null ;
}
}