| | |
| | | package com.fzzy.async.whhpjl.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.entity.ApiInfoData; |
| | | import com.fzzy.api.entity.ApiLog; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.view.repository.ApiInfoDataRep; |
| | | import com.fzzy.api.view.repository.ApiLogRep; |
| | | import com.fzzy.async.whhpjl.entity.Fz40WhjlDefaultDept; |
| | | import com.fzzy.async.whhpjl.entity.Fz40WhjlDefaultUser; |
| | | import com.fzzy.async.whhpjl.repository.Fz40ToWhjlSync1103Rep; |
| | | import com.fzzy.whjl.WhjlConstant; |
| | | import com.fzzy.whjl.dto.WhjlApi1103; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | private Fz40ToWhjlSync1103Rep fz40ToWhjlSync1103Rep; |
| | | @Autowired |
| | | private ApiLogRep apiLogRep; |
| | | @Autowired |
| | | private ApiInfoDataRep apiInfoDataRep; |
| | | |
| | | /** |
| | | * 军工人员信息 |
| | |
| | | log.info("-------------没有获取到单位信息------------------"); |
| | | return; |
| | | } |
| | | List<ApiInfoData> apiInfoDataList; |
| | | WhjlApi1103 apiData; |
| | | for (Fz40WhjlDefaultUser sysData : list) { |
| | | apiData = new WhjlApi1103(); |
| | |
| | | if (!sysData.isEnabled()) { |
| | | apiData.setSfyx("否"); |
| | | } |
| | | |
| | | apiData.setBizId(sysData.getUsername()); |
| | | apiData.setUpdateTime(new Date()); |
| | | |
| | | //TODO 持久化保存待实现 |
| | | //持久化保存,单独存入非国标接口表 |
| | | ApiInfoData infoData = new ApiInfoData(); |
| | | infoData.setId(sysData.getUsername()); |
| | | infoData.setKqdm(kqdm); |
| | | infoData.setInteType(WhjlConstant.API_CATEGORY_11); |
| | | infoData.setInteId(WhjlConstant.API_CODE_1103); |
| | | infoData.setUpdateTime(new Date()); |
| | | infoData.setDataId(sysData.getUsername()); |
| | | infoData.setRemarks("备注信息"); |
| | | |
| | | //设置操作标志 |
| | | apiInfoDataList = apiInfoDataRep.getDataByDataId(infoData.getDataId()); |
| | | if (null == apiInfoDataList || apiInfoDataList.isEmpty()) { |
| | | apiData.setCzbz(Constant.CZBZ_I); |
| | | infoData.setCzbz(Constant.CZBZ_I); |
| | | } else { |
| | | apiData.setCzbz(apiInfoDataList.get(0).getCzbz()); |
| | | infoData.setCzbz(apiInfoDataList.get(0).getCzbz()); |
| | | } |
| | | |
| | | infoData.setData(JSON.toJSONString(apiData)); |
| | | apiInfoDataRep.save(infoData); |
| | | |
| | | |
| | | log.info("1103---军工人员-同步数据:{}", apiData.toString()); |