49 lines
1.6 KiB
Java
49 lines
1.6 KiB
Java
|
|
package com.zhgd.sjmq.service;
|
|||
|
|
|
|||
|
|
import com.chinacreator.c2.uop.sync.message.org.OrgCreateMessage;
|
|||
|
|
import com.gexin.fastjson.JSON;
|
|||
|
|
import com.zhgd.xmgl.modules.basicdata.entity.Company;
|
|||
|
|
import com.zhgd.xmgl.modules.basicdata.mapper.CompanyMapper;
|
|||
|
|
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
|
|||
|
|
import lombok.extern.slf4j.Slf4j;
|
|||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
|
import org.springframework.stereotype.Service;
|
|||
|
|
|
|||
|
|
import java.util.Map;
|
|||
|
|
|
|||
|
|
@Service
|
|||
|
|
@Slf4j
|
|||
|
|
public class SjMqService {
|
|||
|
|
@Autowired
|
|||
|
|
private CompanyMapper companyMapper;
|
|||
|
|
@Autowired
|
|||
|
|
private SystemUserMapper systemUserMapper;
|
|||
|
|
|
|||
|
|
private Company convertToCompany(OrgCreateMessage orgCreateMessage) {
|
|||
|
|
log.info("sj的mq接收:{}", JSON.toJSONString(orgCreateMessage));
|
|||
|
|
Map<String, Object> organization = orgCreateMessage.getOrganization();
|
|||
|
|
Company company = new Company();
|
|||
|
|
//company.setCompanyId();
|
|||
|
|
//company.setCompanySn();
|
|||
|
|
//company.setCompanyName();
|
|||
|
|
//company.setCreateTime();
|
|||
|
|
//company.setCompanyTel();
|
|||
|
|
//company.setCompanyType();
|
|||
|
|
//company.setParentId();
|
|||
|
|
//company.setHeadquartersSn();
|
|||
|
|
//company.setLongitude();
|
|||
|
|
//company.setLatitude();
|
|||
|
|
//company.setPropagateFile();
|
|||
|
|
//company.setFullSn();
|
|||
|
|
//company.setRangeAddr();
|
|||
|
|
//company.setParentSn();
|
|||
|
|
//company.setEditType();
|
|||
|
|
return company;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void onOrgCreated(OrgCreateMessage orgCreateMessage) {
|
|||
|
|
Company company = convertToCompany(orgCreateMessage);
|
|||
|
|
companyMapper.insert(company);
|
|||
|
|
}
|
|||
|
|
}
|