电测试

tags/yfai-pcn-ext-v2.3
臧学普 7 months ago
parent c45b5724f6
commit 1ebb40569f

@ -0,0 +1,48 @@
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
import cn.estsh.i3plus.pojo.mes.bean.MesEarlyWarningKanBan;
import cn.estsh.i3plus.pojo.mes.model.MesEarlyWarningKanBanModel;
import java.util.List;
public interface IMesEarlyWarningService {
/**
* id
* idList 1
*
*
*/
List<MesEarlyWarningKanBan> getEarlyWarningList(String organizeCode);
/**
*
* @param model
*/
void saveEarlyWarning(MesEarlyWarningKanBanModel model);
/**
*
* @param earlyWarning
*/
void updateEarlyWarning(MesEarlyWarningKanBan earlyWarning);
/**
*
*/
void deleteEarlyWarning(Long id, String organizeCode,String userName);
/**
*
* @param id
*/
MesEarlyWarningKanBan getKanbanData(Long id,String organizeCode);
/**
*
* @param id
*/
void getData(Long id,String organizeCode);
}

@ -1,59 +1,59 @@
///**
// * Licensed to the Apache Software Foundation (ASF) under one
// * or more contributor license agreements. See the NOTICE file
// * distributed with this work for additional information
// * regarding copyright ownership. The ASF licenses this file
// * to you under the Apache ImppLicense, Version 2.0 (the
// * "ImppLicense"); you may not use this file except in compliance
// * with the ImppLicense. You may obtain a copy of the ImppLicense at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing,
// * software distributed under the ImppLicense is distributed on an
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// * KIND, either express or implied. See the ImppLicense for the
// * specific language governing permissions and limitations
// * under the ImppLicense.
// */
//package cn.estsh.i3plus.ext.mes.pcn.apiservice.config;
//
//
//
//import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.webservice.DcsForEquipmentServer;
//import org.apache.cxf.Bus;
//import org.apache.cxf.jaxws.EndpointImpl;
//import org.apache.cxf.transport.servlet.CXFServlet;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.web.servlet.ServletRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import javax.xml.ws.Endpoint;
//
///**
// * @Description : WebService Server 服务配置
// * WSDL URL: /block/softswitch/server/web-service?wsdl
// * @Reference :
// * @Author : wei.peng
// * @CreateDate : 2019/9/10 下午3:13
// * @Modify:
// **/
//@Configuration
//public class WebServiceConfig {
//
// @Autowired
// private Bus bus;
//
// @Bean("cxfServletRegistration")
// public ServletRegistrationBean dispatcherServlet() {
// return new ServletRegistrationBean(new CXFServlet(), "/*");
// }
//
// @Bean
// public Endpoint endpoint() {
// EndpointImpl endpoint = new EndpointImpl(bus, new DcsForEquipmentServer());
// endpoint.publish("/DCSForEquipmentService");
// return endpoint;
// }
//}
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache ImppLicense, Version 2.0 (the
* "ImppLicense"); you may not use this file except in compliance
* with the ImppLicense. You may obtain a copy of the ImppLicense at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the ImppLicense is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the ImppLicense for the
* specific language governing permissions and limitations
* under the ImppLicense.
*/
package cn.estsh.i3plus.ext.mes.pcn.apiservice.config;
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.webservice.DcsForEquipmentServer;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;
/**
* @Description : WebService Server
* WSDL URL: /block/softswitch/server/web-service?wsdl
* @Reference :
* @Author : wei.peng
* @CreateDate : 2019/9/10 3:13
* @Modify:
**/
@Configuration
public class WebServiceConfig {
@Autowired
private Bus bus;
@Bean("cxfServletRegistration")
public ServletRegistrationBean dispatcherServlet() {
return new ServletRegistrationBean(new CXFServlet(), "/i3plus-pcn/*");
}
@Bean
public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, new DcsForEquipmentServer());
endpoint.publish("/DCSForEquipmentService");
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…
Cancel
Save