| | |
| | | package com.java110.core.event.cmd; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | Assert.jsonObjectHaveKey(reqJson, "page", "请求中未包含page信息"); |
| | | Assert.jsonObjectHaveKey(reqJson, "row", "请求中未包含row信息"); |
| | | } |
| | | // |
| | | // @Override |
| | | // |
| | | // public void cmd(CmdEvent event) throws CmdException { |
| | | // //这里处理业务逻辑数据 |
| | | // ICmdDataFlowContext dataFlowContext = event.getCmdDataFlowContext(); |
| | | // //获取请求数据 |
| | | // JSONObject reqJson = dataFlowContext.getReqJson(); |
| | | // |
| | | // logger.debug("API服务 --- 请求参数为:{}", reqJson.toJSONString()); |
| | | // |
| | | // validate(event, dataFlowContext,reqJson); |
| | | // |
| | | // doCmd(event, dataFlowContext, reqJson); |
| | | // |
| | | // //logger.debug("API服务 --- 返回报文信息:{}", dataFlowContext.getResponseEntity()); |
| | | // } |
| | | |
| | | @Override |
| | | public void cmd(CmdEvent event) throws CmdException { |
| | | //这里处理业务逻辑数据 |
| | | ICmdDataFlowContext dataFlowContext = event.getCmdDataFlowContext(); |
| | | //获取请求数据 |
| | | JSONObject reqJson = dataFlowContext.getReqJson(); |
| | | |
| | | logger.debug("API服务 --- 请求参数为:{}", reqJson.toJSONString()); |
| | | |
| | | validate(event, dataFlowContext,reqJson); |
| | | |
| | | doCmd(event, dataFlowContext, reqJson); |
| | | |
| | | //logger.debug("API服务 --- 返回报文信息:{}", dataFlowContext.getResponseEntity()); |
| | | } |
| | | |
| | | /** |
| | | * 数据格式校验方法 |
| | | * @param event 事件对象 |
| | | * @param cmdDataFlowContext 请求报文数据 |
| | | */ |
| | | protected abstract void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson); |
| | | |
| | | |
| | | /** |
| | | * 业务处理类 |
| | | * @param event 事件对象 |
| | | * @param cmdDataFlowContext 数据上文对象 |
| | | * @param reqJson 请求报文 |
| | | */ |
| | | protected abstract void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException; |
| | | |
| | | |
| | | @Override |
| | |
| | | package com.java110.core.event.cmd; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.center.DataFlowListenerOrderComparator; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.core.event.service.api.ServiceDataFlowListener; |
| | | import com.java110.dto.CmdListenerDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.exception.BusinessException; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | |
| | | import com.java110.utils.util.Assert; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.annotation.AnnotationUtils; |
| | | import org.springframework.http.HttpMethod; |
| | | import sun.misc.ProxyGenerator; |
| | | |
| | | import java.lang.annotation.Annotation; |
| | | import java.lang.reflect.Method; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | List<ServiceCmdListener> cmdListeners = new ArrayList<ServiceCmdListener>(); |
| | | for (CmdListenerDto listenerBean : getListeners()) { |
| | | //ServiceCmdListener listener = ApplicationContextFactory.getBean(listenerBean.getBeanName(), ServiceCmdListener.class); |
| | | ServiceCmdListener listener = ApplicationContextFactory.getBean(listenerBean.getBeanName(), ServiceCmdListener.class); |
| | | if(listenerBean.getServiceCode().equals(serviceCode)) { |
| | | if (listenerBean.getServiceCode().equals(serviceCode)) { |
| | | cmdListeners.add(listener); |
| | | } |
| | | } |
| | |
| | | * @param dataFlowContext |
| | | */ |
| | | public static void multicastEvent(String serviceCode, ICmdDataFlowContext dataFlowContext) throws BusinessException { |
| | | multicastEvent(serviceCode, dataFlowContext, null); |
| | | multicastEvent(serviceCode, dataFlowContext, null); |
| | | } |
| | | |
| | | /** |
| | |
| | | @SuppressWarnings({"unchecked", "rawtypes"}) |
| | | protected static void invokeListener(ServiceCmdListener listener, CmdEvent event) { |
| | | try { |
| | | // //这里处理业务逻辑数据 |
| | | ICmdDataFlowContext dataFlowContext = event.getCmdDataFlowContext(); |
| | | //获取请求数据 |
| | | JSONObject reqJson = dataFlowContext.getReqJson(); |
| | | |
| | | Method method = listener.getClass().getDeclaredMethod("doCmd",CmdEvent.class, ICmdDataFlowContext.class, JSONObject.class); |
| | | Java110Transactional java110Transactional = AnnotationUtils.findAnnotation(method, Java110Transactional.class); |
| | | System.out.printf("123123"); |
| | | } catch (NoSuchMethodException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | logger.debug("API服务 --- 请求参数为:{}", reqJson.toJSONString()); |
| | | |
| | | listener.cmd(event); |
| | | listener.validate(event, dataFlowContext, reqJson); |
| | | |
| | | listener.doCmd(event, dataFlowContext, reqJson); |
| | | |
| | | //logger.debug("API服务 --- 返回报文信息:{}", dataFlowContext.getResponseEntity()); |
| | | // listener.cmd(event); |
| | | } catch (CmdException e) { |
| | | LoggerEngine.error("发布侦听失败", e); |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | public static void testPoxy(Class clazz){ |
| | | byte[] bytes = ProxyGenerator.generateProxyClass("$Proxy", new Class[]{clazz}); |
| | | try( |
| | | FileOutputStream fos =new FileOutputStream(new File("D:/$Proxy.class")) |
| | | ){ |
| | | fos.write(bytes); |
| | | fos.flush(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.java110.core.event.cmd; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.app.order.Ordered; |
| | | import com.java110.utils.exception.CmdException; |
| | | |
| | |
| | | * Created by wuxw on 2018/4/17. |
| | | */ |
| | | public interface ServiceCmdListener extends EventListener, Ordered { |
| | | |
| | | |
| | | /** |
| | | * 数据格式校验方法 |
| | | * |
| | | * @param event 事件对象 |
| | | * @param cmdDataFlowContext 请求报文数据 |
| | | */ |
| | | void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson); |
| | | |
| | | |
| | | /** |
| | | * 执行指令 |
| | | * @param event |
| | | * @throws Exception |
| | | * |
| | | * @param event 事件对象 |
| | | * @param cmdDataFlowContext 数据上文对象 |
| | | * @param reqJson 请求报文 |
| | | */ |
| | | void cmd(CmdEvent event) throws CmdException; |
| | | void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException; |
| | | } |
| | |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.intf.@@shareName@@.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.po.@@templateCode@@.@@TemplateCode@@Po; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | private I@@TemplateCode@@V1InnerServiceSMO @@templateCode@@V1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | @@validateTemplateColumns@@ |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | @@TemplateCode@@Po @@templateCode@@Po = BeanConvertUtil.covertBean(reqJson, @@TemplateCode@@Po.class); |
| | | int flag = @@templateCode@@V1InnerServiceSMOImpl.delete@@TemplateCode@@(businessTableHisPo); |
| | | int flag = @@templateCode@@V1InnerServiceSMOImpl.delete@@TemplateCode@@(@@templateCode@@Po); |
| | | |
| | | if (flag < 1) { |
| | | throw new CmdException("删除数据失败"); |
| | |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.intf.@@shareName@@.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.po.@@templateCode@@.@@TemplateCode@@Po; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | private I@@TemplateCode@@V1InnerServiceSMO @@templateCode@@V1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | @@TemplateCode@@Dto @@templateCode@@Dto = BeanConvertUtil.covertBean(reqJson, @@TemplateCode@@Dto.class); |
| | | |
| | |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.intf.@@shareName@@.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.po.@@templateCode@@.@@TemplateCode@@Po; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | private I@@TemplateCode@@V1InnerServiceSMO @@templateCode@@V1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | @@validateTemplateColumns@@ |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | @@TemplateCode@@Po @@templateCode@@Po = BeanConvertUtil.covertBean(reqJson, @@TemplateCode@@Po.class); |
| | | @@templateCode@@Po.set@@TemplateKey@@(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID)); |
| | | int flag = @@templateCode@@V1InnerServiceSMOImpl.save@@TemplateCode@@(businessTableHisPo); |
| | | int flag = @@templateCode@@V1InnerServiceSMOImpl.save@@TemplateCode@@(@@templateCode@@Po); |
| | | |
| | | if (flag < 1) { |
| | | throw new CmdException("保存数据失败"); |
| | |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.intf.@@shareName@@.I@@TemplateCode@@V1InnerServiceSMO; |
| | | import com.java110.po.@@templateCode@@.@@TemplateCode@@Po; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | private I@@TemplateCode@@V1InnerServiceSMO @@templateCode@@V1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | @@validateTemplateColumns@@ |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | @@TemplateCode@@Po @@templateCode@@Po = BeanConvertUtil.covertBean(reqJson, @@TemplateCode@@Po.class); |
| | | int flag = @@templateCode@@V1InnerServiceSMOImpl.update@@TemplateCode@@(businessTableHisPo); |
| | | int flag = @@templateCode@@V1InnerServiceSMOImpl.update@@TemplateCode@@(@@templateCode@@Po); |
| | | |
| | | if (flag < 1) { |
| | | throw new CmdException("更新数据失败"); |
| | |
| | | private DictInnerServiceSMO dictInnerServiceSMO; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | List<DictDto> dictDtos = this.dictInnerServiceSMO.queryDict(BeanConvertUtil.covertBean(reqJson, DictQueryDto.class)); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(dictDtos), HttpStatus.OK); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | |
| | | private IFloorV1InnerServiceSMO floorV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "floorId", "floorId不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | FloorPo floorPo = BeanConvertUtil.covertBean(reqJson, FloorPo.class); |
| | | int flag = floorV1InnerServiceSMOImpl.deleteFloor(floorPo); |
| | |
| | | private IFloorV1InnerServiceSMO floorV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | FloorDto floorDto = BeanConvertUtil.covertBean(reqJson, FloorDto.class); |
| | | |
| | |
| | | private IFloorAttrInnerServiceSMO floorAttrInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "floorNum", "请求报文中未包含floorNum"); |
| | | Assert.hasKeyAndValue(reqJson, "name", "请求报文中未包含name"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId"); |
| | |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | FloorPo floorPo = BeanConvertUtil.covertBean(reqJson, FloorPo.class); |
| | | floorPo.setFloorId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID)); |
| | |
| | | private IFloorV1InnerServiceSMO floorV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "floorId", "floorId不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | FloorPo floorPo = BeanConvertUtil.covertBean(reqJson, FloorPo.class); |
| | | int flag = floorV1InnerServiceSMOImpl.updateFloor(floorPo); |
| | |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.EnableAspectJAutoProxy; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | |
| | | import java.nio.charset.Charset; |
| | |
| | | * @tag |
| | | */ |
| | | @SpringBootApplication(scanBasePackages = {"com.java110.service", "com.java110.dev", |
| | | "com.java110.core", "com.java110.config.properties.code", "com.java110.db"}, |
| | | "com.java110.core", "com.java110.config.properties.code", "com.java110.db", "com.java110.utils.factory"}, |
| | | exclude = {LiquibaseAutoConfiguration.class, |
| | | org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class}) |
| | | @EnableDiscoveryClient |
| | |
| | | |
| | | //刷新缓存 |
| | | flushMainCache(args); |
| | | // |
| | | // //所有的bean,参考:http://412887952-qq-com.iteye.com/blog/2314051 |
| | | // String[] beanNames = context.getBeanDefinitionNames(); |
| | | // //String[] beanNames = ctx.getBeanNamesForAnnotation(RestController.class);//所有添加该注解的bean |
| | | // logger.info("bean总数:{}", context.getBeanDefinitionCount()); |
| | | // int i = 0; |
| | | // for (String str : beanNames) { |
| | | // logger.info("{},beanName:{}", ++i, str); |
| | | // } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | public class SaveMappingCmd extends AbstractServiceCmdListener { |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | } |
| | | } |
| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.dev.IBusinessTableHisV1InnerServiceSMO; |
| | | import com.java110.po.businessTableHis.BusinessTableHisPo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | /** |
| | | * 类表述:删除 |
| | | * 服务编码:businessTableHis.DeleteBusinessTableHis |
| | |
| | | */ |
| | | @Java110Cmd(serviceCode = "businessTableHis.deleteBusinessTableHis") |
| | | public class DeleteBusinessTableHisCmd extends AbstractServiceCmdListener { |
| | | private static Logger logger = LoggerFactory.getLogger(DeleteBusinessTableHisCmd.class); |
| | | private static Logger logger = LoggerFactory.getLogger(DeleteBusinessTableHisCmd.class); |
| | | |
| | | @Autowired |
| | | private IBusinessTableHisV1InnerServiceSMO businessTableHisV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "hisId", "hisId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "hisId", "hisId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "hisId", "hisId不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | BusinessTableHisPo businessTableHisPo = BeanConvertUtil.covertBean(reqJson, BusinessTableHisPo.class); |
| | | BusinessTableHisPo businessTableHisPo = BeanConvertUtil.covertBean(reqJson, BusinessTableHisPo.class); |
| | | int flag = businessTableHisV1InnerServiceSMOImpl.deleteBusinessTableHis(businessTableHisPo); |
| | | |
| | | if (flag < 1) { |
| | |
| | | private IBusinessTableHisV1InnerServiceSMO businessTableHisV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | BusinessTableHisDto businessTableHisDto = BeanConvertUtil.covertBean(reqJson, BusinessTableHisDto.class); |
| | | |
| | |
| | | private IBusinessTableHisV1InnerServiceSMO businessTableHisV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "action", "请求报文中未包含action"); |
| | | Assert.hasKeyAndValue(reqJson, "actionObj", "请求报文中未包含actionObj"); |
| | | Assert.hasKeyAndValue(reqJson, "actionObjHis", "请求报文中未包含actionObjHis"); |
| | |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | BusinessTableHisPo businessTableHisPo = BeanConvertUtil.covertBean(reqJson, BusinessTableHisPo.class); |
| | | businessTableHisPo.setHisId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID)); |
| | |
| | | private IBusinessTableHisV1InnerServiceSMO businessTableHisV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "hisId", "hisId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "hisId", "hisId不能为空"); |
| | | |
| | |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | BusinessTableHisPo businessTableHisPo = BeanConvertUtil.covertBean(reqJson, BusinessTableHisPo.class); |
| | | int flag = businessTableHisV1InnerServiceSMOImpl.updateBusinessTableHis(businessTableHisPo); |
| | |
| | | IDevServiceCacheSMO devServiceCacheSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | devServiceCacheSMOImpl.flush(reqJson.toJavaObject(Map.class)); |
| | | |
| | |
| | | package com.java110.dev.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.DataTransactionFactory; |
| | | import com.java110.db.dao.IQueryServiceDAO; |
| | | import com.java110.dev.dao.IDevServiceDAO; |
| | |
| | | @Override |
| | | public void updateOrderItem(Map orderItem) throws DAOException { |
| | | int saveFlag = sqlSessionTemplate.update("centerServiceDAOImpl.updateOrderItem", orderItem); |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_CODE_INNER_ERROR, "修改订单项失败:" + JSONObject.toJSONString(orderItem)); |
| | | } |
| | | // if (saveFlag < 1) { |
| | | // throw new DAOException(ResponseConstant.RESULT_CODE_INNER_ERROR, "修改订单项失败:" + JSONObject.toJSONString(orderItem)); |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | String paramIn = cmdDataFlowContext.getReqData(); |
| | | Assert.isJsonObject(paramIn, "用户注册请求参数有误,不是有效的json格式 " + paramIn); |
| | | Assert.jsonObjectHaveKey(paramIn, "username", "用户登录,未包含username节点,请检查" + paramIn); |
| | |
| | | } |
| | | |
| | | @Override |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | ResponseEntity responseEntity = null; |
| | | JSONObject paramInJson = JSONObject.parseObject(cmdDataFlowContext.getReqData()); |
| | |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | reqJson.put("userId", "-1"); |
| | | reqJson.put("levelCd", UserLevelConstant.USER_LEVEL_ADMIN); |