当前位置: 首页 > news >正文

做一公司网站网站建设后的团队总结

做一公司网站,网站建设后的团队总结,建一个产品介绍网站,网站支付的功能如何做前言 在我看来多写几个if-else没啥大不了的#xff0c;但是就是看起来没啥逼格#xff0c;领导嫌弃。我根据开发的经历写几个不同的替代方法 一、枚举法替代 我先前写了一篇文章#xff0c;可以去看看。 通过枚举替换if-else语句的解决方案_枚举代替if else c语言-CSDN博…前言  在我看来多写几个if-else没啥大不了的但是就是看起来没啥逼格领导嫌弃。我根据开发的经历写几个不同的替代方法 一、枚举法替代  我先前写了一篇文章可以去看看。 通过枚举替换if-else语句的解决方案_枚举代替if else c语言-CSDN博客 二、定义接口实现类 通过定义初始方法通过添加多个实现类来选择 接口 public interface ISoapServer {/*** 服务编码* return*/String getCode();/*** 服务* param xml* return*/String server(String xml);} 实现类 其中一个实现类其他的类似 import cn.hutool.core.convert.Convert; import cn.hutool.core.lang.UUID; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import us.codecraft.webmagic.selector.Html;import java.util.List;/*** author HuangZheng* create 2023-05-05 9:49* description 居民信息提交服务*/ Service public class Soap06IstPr1 implements ISoapServer {Autowiredprivate WebClientServer webClientServer;Overridepublic String getCode() {return IST-PR1;}Overridepublic String server(String xml) {try {if (StrUtil.isBlank(xml)) {throw new BaseException(参数不能为空!);}// 要插入的业务表Patient patient new Patient();String pid IdUtil.fastSimpleUUID();patient.setPid(pid);// 第一步 解析参数Html requestXml Html.create(xml);// 获取身份证号// 1、从开头寻找ListString idNoList requestXml.xpath(//personInfo/identifier/value/value).all();// 2、从assignedPerson节点寻找ListString tempIdNoList requestXml.xpath(//assignedPerson/identifier/value/value).all();idNoList.addAll(tempIdNoList);for (String s : idNoList) {if (IdcardUtil.isValidCard(s)) {patient.setIdNo(s);patient.setIdTypeCode(01);patient.setIdTypeName(身份证);// 只要能取到一个就行break;}}// 姓名final String name requestXml.xpath(//personInfo/assignedPerson/name/value).get();patient.setName(name);// 性别final String sexCode requestXml.xpath(//personInfo/assignedPerson/gender/value).get();patient.setSexCode(sexCode);ExceptionUtil.soapExcpition(1,name);ExceptionUtil.soapExcpition(2,sexCode);final String sexName XmlReadUtil.getRangeByKey(GB/T 2261.1-2003, sexCode).getValue();patient.setSexName(sexName);// 手机号码String telNo requestXml.xpath(//personInfo/telecom/value/value).get();patient.setTelNo(telNo);// 获取地址addressString presentAddress requestXml.xpath(//personInfo/address/text/value).get();String presentAddrProvi requestXml.xpath(//personInfo/address/state/value).get();String presentAddrCity requestXml.xpath(//personInfo/address/city/value).get();String presentAddrCounty requestXml.xpath(//personInfo/address/district/value).get();String presentAddrTown requestXml.xpath(//personInfo/address/town/value).get();String presentAddrVillage requestXml.xpath(//personInfo/address/street/value).get();String presentAddrHouNo requestXml.xpath(//personInfo/address/houseNumber/value).get();// 存值patient.setPresentAddress(TextUtil.getStr(presentAddress, -));patient.setPresentAddrProvi(TextUtil.getStr(presentAddrProvi, -));patient.setPresentAddrCity(TextUtil.getStr(presentAddrCity, -));patient.setPresentAddrCounty(TextUtil.getStr(presentAddrCounty, -));patient.setPresentAddrTown(TextUtil.getStr(presentAddrTown, -));patient.setPresentAddrVillage(TextUtil.getStr(presentAddrVillage, -));patient.setPresentAddrHouNo(TextUtil.getStr(presentAddrHouNo, -));// 出生日期final String birthday requestXml.xpath(//personInfo/assignedPerson/birthTime/value).get();patient.setBirthday(Convert.toDate(birthday));// 婚姻状况final String marCode requestXml.xpath(//personInfo/assignedPerson/maritalStatusCode/value).get();patient.setMarCode(marCode);final String marName XmlReadUtil.getRangeByKey(GB/T 2261.2-2003, marCode).getValue();patient.setMarName(marName);// ORG_ID 通过最后的机构名称查询String orgName requestXml.xpath(//personInfo/assignedOrganization/name/value).get();OrgMapper orgMapper SpringUtils.getBean(OrgMapper.class);Org org orgMapper.selectOne(new LambdaQueryWrapperOrg().eq(Org::getManagerorgname, orgName));if (org ! null) {patient.setOrgId(org.getOrgid());}else{patient.setOrgId(1);}// 批次String batchId UUID.randomUUID(false).toString(true);patient.setBatchId(batchId);PatientMapper patientMapper SpringUtils.getBean(PatientMapper.class);patientMapper.insert(patient);//保存通知ListString ids webClientServer.saveNoice(new String[][]{{rhin:personRecordRevise,name居民信息发生变更},{rhin:personIdentifierRevise,name居民信息索引变更},{rhin:personIdentifierMerge,name居民信息合并}});//检查是否有主题订阅如有发送通知webClientServer.checkAndNoice(ids);return PersonRecordFeedResponse\n masterIdentifer TextUtil.format(system value\{}\/ \n, ) TextUtil.format(value value\{}\/ \n, pid) /masterIdentifer\n /PersonRecordFeedResponse;} catch (Exception e) {// 对象转换为xmlreturn TextUtil.format( returnData\n \tfunCode{}/funCode\n \terrorCode{}/errorCode\n \tdetail{}/detail\n /returnData \n, getCode(), 500, e.getCause() ! null ? e.getCause() : e.getMessage());}} }使用方法 public String HIPMessageServer(String action, String message) {String result ;log.info(\n 交互服务入参信息: \n action:{} \n message:{},action,message);String[] beanNamesForType applicationContext.getBeanNamesForType(ISoapServer.class);for (String beanName : beanNamesForType) {ISoapServer soapServer applicationContext.getBean(beanName, ISoapServer.class);if (soapServer.getCode().equals(action)) {result soapServer.server(message);log.info(\n 交互服务出参信息: \n message:{},result);return result;}}return result;} 三、Map函数式接口 Service   public class GrantTypeSerive {  public String redPaper(String resourceId){  //红包的发放方式  return 每周末9点发放;  }  public String shopping(String resourceId){  //购物券的发放方式  return 每周三9点发放;  }  public String QQVip(String resourceId){  //qq会员的发放方式  return 每周一0点开始秒杀;  }   }  Service   public class QueryGrantTypeService {  Autowired  private GrantTypeSerive grantTypeSerive;  private MapString, FunctionString,String grantTypeMapnew HashMap();  /**  *  初始化业务分派逻辑,代替了if-else部分  *  key: 优惠券类型  *  value: lambda表达式,最终会获得该优惠券的发放方式  */  PostConstruct  public void dispatcherInit(){  grantTypeMap.put(红包,resourceId-grantTypeSerive.redPaper(resourceId));  grantTypeMap.put(购物券,resourceId-grantTypeSerive.shopping(resourceId));  grantTypeMap.put(qq会员,resourceId-grantTypeSerive.QQVip(resourceId));  }  public String getResult(String resourceType){  //Controller根据 优惠券类型resourceType、编码resourceId 去查询 发放方式grantType  FunctionString,String resultgetGrantTypeMap.get(resourceType);  if(result!null){  //传入resourceId 执行这段表达式获得String型的grantType  return result.apply(resourceId);  }  return 查询不到该优惠券的发放方式;  }   }
http://www.w-s-a.com/news/626188/

相关文章:

  • 关于我们网站模板小莉帮忙郑州阳光男科医院
  • 上海门户网站怎么登录永州网站制作
  • 微信网站模版下载做销售的去哪个网站应聘
  • 好看的个人博客主页长安网站优化公司
  • 企业网站关站大型综合新闻门户网站织梦模板
  • 网站优化排名易下拉效率查企业网站
  • 网站建设湛江关于汽车的网站
  • 南宁模板建站多少钱企业黄页名单
  • 企业网站的建设一般要素有网站定制公司地址
  • 婚纱摄影网站设计案例四川省城乡建设厅官方网站
  • 怎么做海淘网站wordpress首页表单
  • 大连网站优化技术长沙高端网站建设服务
  • 郎创网站建设做的网站 v2ex
  • 广东网站建设教程江西城乡住房建设网站
  • 做ppt卖给网站wordpress insert
  • 文化传媒公司网站模板wordpress转typecho
  • 网站建设设计视频郑州 服装网站建设
  • 网站建设什么公司好织梦cms默认密码
  • 大型网站 空间网上商城官网入口
  • 成都全美网站建设江苏专业网站建设
  • 足球网站模板有帮忙做阿里巴巴网站的吗
  • 建设厅报名网站京东网站的建设与发展前景
  • 金寨县住房和城乡建设部网站网页作业怎么做一个网站
  • 做ppt模板网站有哪些内容wap是什么意思卡老师
  • 网站建设一定要域名吗网站后台关键词设置
  • 标书制作公司网站坪山网站建设哪家便宜
  • 防止做网站的人修改数值门户网站架构
  • 电子项目外包网站考二建需要什么学历和专业
  • 做网站推广引流效果好吗电商推广技巧
  • 亦庄网站建设价格广州网站推广服务