Commit 4610f2da authored by wuqinghua's avatar wuqinghua

2022-3-16 吴卿华

parent 67ed2cf8
...@@ -12,6 +12,7 @@ import com.zehong.system.service.ITDetectorInfoService; ...@@ -12,6 +12,7 @@ import com.zehong.system.service.ITDetectorInfoService;
import com.zehong.system.service.ITDetectorUserService; import com.zehong.system.service.ITDetectorUserService;
import com.zehong.system.service.ITEmployedPeopleInfoService; import com.zehong.system.service.ITEmployedPeopleInfoService;
import com.zehong.web.codeconfig.CodeConFig; import com.zehong.web.codeconfig.CodeConFig;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -90,11 +91,12 @@ public class TDeviceInfoController extends BaseController ...@@ -90,11 +91,12 @@ public class TDeviceInfoController extends BaseController
{ {
//生成四位随机码 //生成四位随机码
String code = CodeConFig.RandomCode(); String code = CodeConFig.RandomCode();
listaw.gettDeviceInfo().setDeviceCode(code); String intFlag = String.valueOf((int)(Math.random() * 1000000));
listaw.gettDeviceInfo().setDeviceCode(intFlag);
//添加设备信息表数据 并且返回新增id //添加设备信息表数据 并且返回新增id
tDeviceInfoService.insertTDeviceInfo(listaw.gettDeviceInfo()); tDeviceInfoService.insertTDeviceInfo(listaw.gettDeviceInfo());
if (listaw.gettDeviceInfoS()!=null){ if (CollectionUtils.isNotEmpty(listaw.gettDeviceInfoS())){
//将关联设备信息与设备进行绑定 //将关联设备信息与设备进行绑定
tDeviceInfoService.updatetRelationDeviceDetailInfo(listaw.gettDeviceInfoS(),listaw.gettDeviceInfo().getDeviceId(),listaw.gettDeviceInfo().getRelationDeviceType()); tDeviceInfoService.updatetRelationDeviceDetailInfo(listaw.gettDeviceInfoS(),listaw.gettDeviceInfo().getDeviceId(),listaw.gettDeviceInfo().getRelationDeviceType());
} }
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import com.zehong.system.domain.TTSiteStationInfoList; import com.zehong.system.domain.TTSiteStationInfoList;
import com.zehong.system.service.ITDeviceInfoService; import com.zehong.system.service.ITDeviceInfoService;
import com.zehong.system.service.ITEmployedPeopleInfoService; import com.zehong.system.service.ITEmployedPeopleInfoService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -88,7 +89,7 @@ public class TSiteStationInfoController extends BaseController { ...@@ -88,7 +89,7 @@ public class TSiteStationInfoController extends BaseController {
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tSiteStationInfos.gettDeviceInfo().getBeyondEnterpriseId()); String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tSiteStationInfos.gettDeviceInfo().getBeyondEnterpriseId());
tSiteStationInfos.gettDeviceInfo().setBeyondEnterpriseName(EnterpriseName); tSiteStationInfos.gettDeviceInfo().setBeyondEnterpriseName(EnterpriseName);
tSiteStationInfoService.insertTSiteStationInfo(tSiteStationInfos.gettDeviceInfo()); tSiteStationInfoService.insertTSiteStationInfo(tSiteStationInfos.gettDeviceInfo());
if (tSiteStationInfos.gettDeviceInfoS()!=null){ if (CollectionUtils.isNotEmpty(tSiteStationInfos.gettDeviceInfoS())){
//将关联设备信息与设备进行绑定 //将关联设备信息与设备进行绑定
tDeviceInfoService.updatetRelationDeviceDetailInfo(tSiteStationInfos.gettDeviceInfoS(),tSiteStationInfos.gettDeviceInfo().getSiteStationId(),tSiteStationInfos.gettDeviceInfo().getRelationDeviceType()); tDeviceInfoService.updatetRelationDeviceDetailInfo(tSiteStationInfos.gettDeviceInfoS(),tSiteStationInfos.gettDeviceInfo().getSiteStationId(),tSiteStationInfos.gettDeviceInfo().getRelationDeviceType());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment