forked from I3-YF/i3plus-mes-pcn-yfai
电测试
parent
c45b5724f6
commit
1ebb40569f
@ -1,59 +1,59 @@
|
|||||||
///**
|
/**
|
||||||
// * Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
// * or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
// * distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
// * regarding copyright ownership. The ASF licenses this file
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
// * to you under the Apache ImppLicense, Version 2.0 (the
|
* to you under the Apache ImppLicense, Version 2.0 (the
|
||||||
// * "ImppLicense"); you may not use this file except in compliance
|
* "ImppLicense"); you may not use this file except in compliance
|
||||||
// * with the ImppLicense. You may obtain a copy of the ImppLicense at
|
* with the ImppLicense. You may obtain a copy of the ImppLicense at
|
||||||
// *
|
*
|
||||||
// * http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
// *
|
*
|
||||||
// * Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
// * software distributed under the ImppLicense is distributed on an
|
* software distributed under the ImppLicense is distributed on an
|
||||||
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
// * KIND, either express or implied. See the ImppLicense for the
|
* KIND, either express or implied. See the ImppLicense for the
|
||||||
// * specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
// * under the ImppLicense.
|
* under the ImppLicense.
|
||||||
// */
|
*/
|
||||||
//package cn.estsh.i3plus.ext.mes.pcn.apiservice.config;
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.config;
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.webservice.DcsForEquipmentServer;
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.webservice.DcsForEquipmentServer;
|
||||||
//import org.apache.cxf.Bus;
|
import org.apache.cxf.Bus;
|
||||||
//import org.apache.cxf.jaxws.EndpointImpl;
|
import org.apache.cxf.jaxws.EndpointImpl;
|
||||||
//import org.apache.cxf.transport.servlet.CXFServlet;
|
import org.apache.cxf.transport.servlet.CXFServlet;
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
//import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||||
//import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
//import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
//
|
|
||||||
//import javax.xml.ws.Endpoint;
|
import javax.xml.ws.Endpoint;
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * @Description : WebService Server 服务配置
|
* @Description : WebService Server 服务配置
|
||||||
// * WSDL URL: /block/softswitch/server/web-service?wsdl
|
* WSDL URL: /block/softswitch/server/web-service?wsdl
|
||||||
// * @Reference :
|
* @Reference :
|
||||||
// * @Author : wei.peng
|
* @Author : wei.peng
|
||||||
// * @CreateDate : 2019/9/10 下午3:13
|
* @CreateDate : 2019/9/10 下午3:13
|
||||||
// * @Modify:
|
* @Modify:
|
||||||
// **/
|
**/
|
||||||
//@Configuration
|
@Configuration
|
||||||
//public class WebServiceConfig {
|
public class WebServiceConfig {
|
||||||
//
|
|
||||||
// @Autowired
|
@Autowired
|
||||||
// private Bus bus;
|
private Bus bus;
|
||||||
//
|
|
||||||
// @Bean("cxfServletRegistration")
|
@Bean("cxfServletRegistration")
|
||||||
// public ServletRegistrationBean dispatcherServlet() {
|
public ServletRegistrationBean dispatcherServlet() {
|
||||||
// return new ServletRegistrationBean(new CXFServlet(), "/*");
|
return new ServletRegistrationBean(new CXFServlet(), "/i3plus-pcn/*");
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Bean
|
@Bean
|
||||||
// public Endpoint endpoint() {
|
public Endpoint endpoint() {
|
||||||
// EndpointImpl endpoint = new EndpointImpl(bus, new DcsForEquipmentServer());
|
EndpointImpl endpoint = new EndpointImpl(bus, new DcsForEquipmentServer());
|
||||||
// endpoint.publish("/DCSForEquipmentService");
|
endpoint.publish("/DCSForEquipmentService");
|
||||||
// return endpoint;
|
return endpoint;
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
@ -0,0 +1,98 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.MesEarlyWarningServiceImpl;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEarlyWarningKanBan;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.MesEarlyWarningKanBanModel;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/earlyWarningKanBan")
|
||||||
|
public class MesEarlyWarningKanBanController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesEarlyWarningServiceImpl mesEarlyWarningService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的线末大屏配置
|
||||||
|
* @param organizeCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/list/{organizeCode}")
|
||||||
|
public ResultBean getEarlyWarningList(@PathVariable String organizeCode){
|
||||||
|
List<MesEarlyWarningKanBan> list;
|
||||||
|
try {
|
||||||
|
list = mesEarlyWarningService.getEarlyWarningList(organizeCode);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResultBean.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return ResultBean.success("查询成功").setResultList(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存配置
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/save")
|
||||||
|
public ResultBean saveEarlyWarningList(@RequestBody MesEarlyWarningKanBanModel model){
|
||||||
|
try {
|
||||||
|
mesEarlyWarningService.saveEarlyWarning(model);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResultBean.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return ResultBean.success("查询成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新配置
|
||||||
|
* @param earlyWarning
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/update")
|
||||||
|
public ResultBean updateEarlyWarning(@RequestBody MesEarlyWarningKanBan earlyWarning){
|
||||||
|
try {
|
||||||
|
mesEarlyWarningService.updateEarlyWarning(earlyWarning);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResultBean.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return ResultBean.success("更新成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 软删配置
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/delete/{id}/{organizeCode}/{userName}")
|
||||||
|
public ResultBean deleteEarlyWarning(@PathVariable Long id, @PathVariable String organizeCode,@PathVariable String userName){
|
||||||
|
try {
|
||||||
|
mesEarlyWarningService.deleteEarlyWarning(id,organizeCode,userName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResultBean.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return ResultBean.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取看板配置
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/get/{id}/{organizeCode}")
|
||||||
|
public ResultBean getKanbanData(@PathVariable Long id,@PathVariable String organizeCode){
|
||||||
|
try {
|
||||||
|
mesEarlyWarningService.getKanbanData(id,organizeCode);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResultBean.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return ResultBean.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(path = "/getData/{id}/{organizeCode}")
|
||||||
|
public ResultBean getData(@PathVariable Long id,@PathVariable String organizeCode){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEarlyWarningService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
||||||
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEarlyWarningKanBan;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.MesEarlyWarningKanBanModel;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesEarlyWarningKanBanRepository;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesEarlyWarningKanBanRepository earlyWarningKanBanRao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MesEarlyWarningKanBan> getEarlyWarningList(String organizeCode) {
|
||||||
|
|
||||||
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
||||||
|
return earlyWarningKanBanRao.findByHqlWhere(ddlPackBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveEarlyWarning(MesEarlyWarningKanBanModel model) {
|
||||||
|
MesEarlyWarningKanBan kanBan = new MesEarlyWarningKanBan();
|
||||||
|
try {
|
||||||
|
BeanUtils.copyProperties(kanBan,model);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
MesPcnException.throwMesBusiException("类型转换出错!"+e.getMessage());
|
||||||
|
}
|
||||||
|
ConvertBean.saveOrUpdate(kanBan,model.getCreateUser());
|
||||||
|
earlyWarningKanBanRao.insert(kanBan);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEarlyWarning(MesEarlyWarningKanBan earlyWarning) {
|
||||||
|
ConvertBean.saveOrUpdate(earlyWarning,earlyWarning.getCreateUser());
|
||||||
|
earlyWarningKanBanRao.insert(earlyWarning);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteEarlyWarning(Long id, String organizeCode,String userName) {
|
||||||
|
earlyWarningKanBanRao.deleteWeaklyByProperties(new String[]{"id","organizeCode"},new Object[]{id,organizeCode},userName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MesEarlyWarningKanBan getKanbanData(Long id,String organizeCode) {
|
||||||
|
List<MesEarlyWarningKanBan> list = earlyWarningKanBanRao.findByProperty(new String[]{"id", "organizeCode"}, new Object[]{id, organizeCode});
|
||||||
|
if (!list.isEmpty()){
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
return new MesEarlyWarningKanBan();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getData(Long id, String organizeCode) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue