Compare commits
No commits in common. "79c8688642aaef2a746649e6d10ae06e7993aacf" and "93a36cd43379abba7ad02593061221fe2b6536a9" have entirely different histories.
79c8688642
...
93a36cd433
|
|
@ -1,140 +0,0 @@
|
||||||
package com.zcloud.primeport.command;
|
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
|
||||||
import com.zcloud.primeport.domain.gateway.DaHuaGateway;
|
|
||||||
import com.zcloud.primeport.domain.gateway.PersonApplyGateway;
|
|
||||||
import com.zcloud.primeport.domain.model.DaHuaPersonSyncCmd;
|
|
||||||
import com.zcloud.primeport.domain.model.PersonApplyE;
|
|
||||||
import com.zcloud.primeport.domain.model.XgfApplyPersonE;
|
|
||||||
import com.zcloud.primeport.dto.PersonApplyUpdateCmd;
|
|
||||||
import jodd.util.Base64;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 相关方人员同步大华平台。
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class DaHuaPersonSyncExe {
|
|
||||||
|
|
||||||
private static final int RELATED_PARTY = 3;
|
|
||||||
|
|
||||||
private final DaHuaGateway daHuaGateway;
|
|
||||||
private final PersonApplyGateway personApplyGateway;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 相关方人员审核通过后,按证件号判断新增或更新大华人员。
|
|
||||||
*/
|
|
||||||
public void syncApprovedPersons(Long applyId) {
|
|
||||||
XgfApplyPersonE apply = personApplyGateway.getXgfApplyPersonById(applyId);
|
|
||||||
if (apply == null || !Integer.valueOf(RELATED_PARTY).equals(apply.getPersonBelongType())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<PersonApplyE> persons = personApplyGateway.personListByxgfApplyPersonId(applyId);
|
|
||||||
if (persons == null || persons.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (PersonApplyE person : persons) {
|
|
||||||
String paperNumber = decodeUserCard(person.getUserCard());
|
|
||||||
Long dahuaPersonId = daHuaGateway.findPersonIdByPaperNumber(paperNumber);
|
|
||||||
DaHuaPersonSyncCmd syncCmd = buildSyncCmd(dahuaPersonId, person.getEmployeePersonUserName(),
|
|
||||||
paperNumber, person.getUserPhone(), person.getUserFaceUrl(),
|
|
||||||
apply.getVisitStartTime(), apply.getVisitEndTime());
|
|
||||||
Map<String, Object> result;
|
|
||||||
if (dahuaPersonId == null) {
|
|
||||||
syncCmd.setId(daHuaGateway.generatePersonId());
|
|
||||||
result = daHuaGateway.syncPerson(syncCmd);
|
|
||||||
} else {
|
|
||||||
result = daHuaGateway.updatePerson(syncCmd);
|
|
||||||
}
|
|
||||||
checkResult(result, "同步大华人员失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 相关方人员信息修改后,同步更新大华人员。
|
|
||||||
*/
|
|
||||||
public void syncUpdatedPerson(PersonApplyE original, PersonApplyUpdateCmd updated) {
|
|
||||||
if (original == null || !Integer.valueOf(RELATED_PARTY).equals(updated.getPersonBelongType())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String originalPaperNumber = decodeUserCard(original.getUserCard());
|
|
||||||
Long dahuaPersonId = daHuaGateway.findPersonIdByPaperNumber(originalPaperNumber);
|
|
||||||
if (dahuaPersonId == null) {
|
|
||||||
throw new BizException("未找到对应的大华人员");
|
|
||||||
}
|
|
||||||
String updatedPaperNumber = decodeUserCard(updated.getUserCard());
|
|
||||||
DaHuaPersonSyncCmd syncCmd = buildSyncCmd(dahuaPersonId, updated.getEmployeePersonUserName(),
|
|
||||||
updatedPaperNumber, updated.getUserPhone(), updated.getUserFaceUrl(),
|
|
||||||
updated.getVisitStartTime(), updated.getVisitEndTime());
|
|
||||||
checkResult(daHuaGateway.updatePerson(syncCmd), "修改大华人员失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除相关方人员时,同步删除对应的大华人员。
|
|
||||||
*/
|
|
||||||
public void syncDeletedPersons(List<PersonApplyE> persons) {
|
|
||||||
if (persons == null || persons.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<Long> dahuaPersonIds = new ArrayList<>();
|
|
||||||
for (PersonApplyE person : persons) {
|
|
||||||
XgfApplyPersonE apply = personApplyGateway.getXgfApplyPersonById(person.getXgfApplyPersonId());
|
|
||||||
if (apply == null || !Integer.valueOf(RELATED_PARTY).equals(apply.getPersonBelongType())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Long dahuaPersonId = daHuaGateway.findPersonIdByPaperNumber(decodeUserCard(person.getUserCard()));
|
|
||||||
if (dahuaPersonId != null) {
|
|
||||||
dahuaPersonIds.add(dahuaPersonId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!dahuaPersonIds.isEmpty()) {
|
|
||||||
checkResult(daHuaGateway.deletePerson(dahuaPersonIds, null), "删除大华人员失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private DaHuaPersonSyncCmd buildSyncCmd(Long id, String name, String paperNumber, String phone,
|
|
||||||
String faceUrl, String startTime, String endTime) {
|
|
||||||
DaHuaPersonSyncCmd cmd = new DaHuaPersonSyncCmd();
|
|
||||||
cmd.setService("evo-thirdParty");
|
|
||||||
cmd.setId(id);
|
|
||||||
cmd.setName(name);
|
|
||||||
cmd.setCode("hbqa" + paperNumber);
|
|
||||||
cmd.setPaperType(111);
|
|
||||||
cmd.setPaperNumber(paperNumber);
|
|
||||||
cmd.setDepartmentId(1L);
|
|
||||||
cmd.setDepartmentType(2);
|
|
||||||
cmd.setType(3);
|
|
||||||
cmd.setPhone(phone);
|
|
||||||
cmd.setValidStartTime(startTime + " 00:00:00");
|
|
||||||
cmd.setValidEndTime(endTime + " 23:59:59");
|
|
||||||
|
|
||||||
DaHuaPersonSyncCmd.PersonBiosignature face = new DaHuaPersonSyncCmd.PersonBiosignature();
|
|
||||||
face.setType(3);
|
|
||||||
face.setIndex(1);
|
|
||||||
face.setPath(faceUrl);
|
|
||||||
cmd.setPersonBiosignatures(Collections.singletonList(face));
|
|
||||||
return cmd;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String decodeUserCard(String userCard) {
|
|
||||||
try {
|
|
||||||
return Base64.decodeToString(userCard);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new BizException("用户身份证解析错误");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkResult(Map<String, Object> result, String message) {
|
|
||||||
if (result == null || !Boolean.TRUE.equals(result.get("passed"))) {
|
|
||||||
Object errorMessage = result == null ? null : result.get("errMsg");
|
|
||||||
throw new BizException(message + (errorMessage == null ? "" : ": " + errorMessage));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
package com.zcloud.primeport.command;
|
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
|
||||||
import com.zcloud.primeport.domain.enums.VehicleBelongTypeEnum;
|
|
||||||
import com.zcloud.primeport.domain.gateway.DaHuaGateway;
|
|
||||||
import com.zcloud.primeport.domain.gateway.VehicleApplyGateway;
|
|
||||||
import com.zcloud.primeport.domain.model.DaHuaCarAddCmd;
|
|
||||||
import com.zcloud.primeport.domain.model.VehicleApplyE;
|
|
||||||
import com.zcloud.primeport.plan.mjDevice.dto.CarEnum;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 相关方车辆同步大华平台。
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class DaHuaVehicleSyncExe {
|
|
||||||
|
|
||||||
private final DaHuaGateway daHuaGateway;
|
|
||||||
private final VehicleApplyGateway vehicleApplyGateway;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 相关方车辆审核通过后,同步新增大华车辆。
|
|
||||||
*/
|
|
||||||
public void syncApprovedVehicle(Long vehicleApplyId) {
|
|
||||||
VehicleApplyE vehicle = vehicleApplyGateway.getById(vehicleApplyId);
|
|
||||||
if (!isRelatedPartyVehicle(vehicle)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
syncAddedVehicle(vehicle);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除相关方车辆时,同步删除对应的大华车辆。
|
|
||||||
*/
|
|
||||||
public void syncDeletedVehicles(List<VehicleApplyE> vehicles) {
|
|
||||||
if (vehicles == null || vehicles.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<String> carNumList = new ArrayList<>();
|
|
||||||
for (VehicleApplyE vehicle : vehicles) {
|
|
||||||
if (isRelatedPartyVehicle(vehicle)) {
|
|
||||||
carNumList.add(vehicle.getLicenceNo());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!carNumList.isEmpty()) {
|
|
||||||
checkResult(daHuaGateway.deleteCar(carNumList), "删除大华车辆失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void syncAddedVehicle(VehicleApplyE vehicle) {
|
|
||||||
checkResult(daHuaGateway.addCar(buildCarCmd(vehicle)), "新增大华车辆失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
private DaHuaCarAddCmd buildCarCmd(VehicleApplyE vehicle) {
|
|
||||||
DaHuaCarAddCmd cmd = new DaHuaCarAddCmd();
|
|
||||||
cmd.setCarNum(vehicle.getLicenceNo());
|
|
||||||
cmd.setCarNumColor(CarEnum.getMenuKeyByPath(vehicle.getLicenceType()));
|
|
||||||
// 大华车辆类型与本地字典不一致,该字段可选,不能直接透传本地 vehicleType。
|
|
||||||
cmd.setDepartmentId(1L);
|
|
||||||
cmd.setDepartmentName(vehicle.getVehicleDepartmentName());
|
|
||||||
cmd.setService("evo-thirdParty");
|
|
||||||
return cmd;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isRelatedPartyVehicle(VehicleApplyE vehicle) {
|
|
||||||
return vehicle != null
|
|
||||||
&& VehicleBelongTypeEnum.XGF_VEHICLES.getCode().equals(vehicle.getVehicleBelongType());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkResult(Map<String, Object> result, String message) {
|
|
||||||
if (result == null || !Boolean.TRUE.equals(result.get("passed"))) {
|
|
||||||
Object errorMessage = result == null ? null : result.get("errMsg");
|
|
||||||
throw new BizException(message + (errorMessage == null ? "" : ": " + errorMessage));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -2,15 +2,10 @@ package com.zcloud.primeport.command;
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.zcloud.primeport.domain.gateway.PersonApplyGateway;
|
import com.zcloud.primeport.domain.gateway.PersonApplyGateway;
|
||||||
import com.zcloud.primeport.domain.model.PersonApplyE;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
|
|
@ -22,38 +17,23 @@ import java.util.List;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PersonApplyRemoveExe {
|
public class PersonApplyRemoveExe {
|
||||||
private final PersonApplyGateway personApplyGateway;
|
private final PersonApplyGateway personApplyGateway;
|
||||||
private final DaHuaPersonSyncExe daHuaPersonSyncExe;
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long id) {
|
public boolean execute(Long id) {
|
||||||
PersonApplyE person = findPerson(id);
|
|
||||||
boolean res = personApplyGateway.deletedPersonApplyById(id);
|
boolean res = personApplyGateway.deletedPersonApplyById(id);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
daHuaPersonSyncExe.syncDeletedPersons(person == null ? Collections.emptyList() : Collections.singletonList(person));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long[] ids) {
|
public boolean execute(Long[] ids) {
|
||||||
List<PersonApplyE> persons = new ArrayList<>();
|
|
||||||
for (Long id : ids) {
|
|
||||||
PersonApplyE person = findPerson(id);
|
|
||||||
if (person != null) {
|
|
||||||
persons.add(person);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean res = personApplyGateway.deletedPersonApplyByIds(ids);
|
boolean res = personApplyGateway.deletedPersonApplyByIds(ids);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
daHuaPersonSyncExe.syncDeletedPersons(persons);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PersonApplyE findPerson(Long id) {
|
|
||||||
return personApplyGateway.getPersonById(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,18 +37,15 @@ public class PersonApplyUpdateExe {
|
||||||
private final XgfApplyPersonGateway xgfApplyPersonGateway;
|
private final XgfApplyPersonGateway xgfApplyPersonGateway;
|
||||||
private final MessageNoticeExe messageNoticeExe;
|
private final MessageNoticeExe messageNoticeExe;
|
||||||
private final MessageTemplateConfig messageTemplateConfig;
|
private final MessageTemplateConfig messageTemplateConfig;
|
||||||
private final DaHuaPersonSyncExe daHuaPersonSyncExe;
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void execute(PersonApplyUpdateCmd personApplyUpdateCmd) {
|
public void execute(PersonApplyUpdateCmd personApplyUpdateCmd) {
|
||||||
PersonApplyE original = personApplyGateway.getPersonById(personApplyUpdateCmd.getId());
|
|
||||||
PersonApplyE personApplyE = new PersonApplyE();
|
PersonApplyE personApplyE = new PersonApplyE();
|
||||||
BeanUtils.copyProperties(personApplyUpdateCmd, personApplyE);
|
BeanUtils.copyProperties(personApplyUpdateCmd, personApplyE);
|
||||||
boolean res = personApplyGateway.update(personApplyE);
|
boolean res = personApplyGateway.update(personApplyE);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("修改失败");
|
throw new BizException("修改失败");
|
||||||
}
|
}
|
||||||
daHuaPersonSyncExe.syncUpdatedPerson(original, personApplyUpdateCmd);
|
|
||||||
}
|
}
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
||||||
|
|
@ -59,9 +56,6 @@ public class PersonApplyUpdateExe {
|
||||||
.reasonsRefusal(cmd.getReasonsRefusal()).build();
|
.reasonsRefusal(cmd.getReasonsRefusal()).build();
|
||||||
build.setId(cmd.getId());
|
build.setId(cmd.getId());
|
||||||
personApplyGateway.xgfPersonAudit(build);
|
personApplyGateway.xgfPersonAudit(build);
|
||||||
if (cmd.getAuditFlag().equals(2)) {
|
|
||||||
daHuaPersonSyncExe.syncApprovedPersons(build.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 完成待办
|
// 完成待办
|
||||||
messageNoticeExe.sendMessageCompleteEvent(build.getId());
|
messageNoticeExe.sendMessageCompleteEvent(build.getId());
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,10 @@ package com.zcloud.primeport.command;
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.zcloud.primeport.domain.gateway.VehicleApplyGateway;
|
import com.zcloud.primeport.domain.gateway.VehicleApplyGateway;
|
||||||
import com.zcloud.primeport.domain.gateway.VehicleAuditGateway;
|
import com.zcloud.primeport.domain.gateway.VehicleAuditGateway;
|
||||||
import com.zcloud.primeport.domain.model.VehicleApplyE;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
|
|
@ -24,35 +19,23 @@ import java.util.List;
|
||||||
public class VehicleApplyRemoveExe {
|
public class VehicleApplyRemoveExe {
|
||||||
private final VehicleApplyGateway vehicleApplyGateway;
|
private final VehicleApplyGateway vehicleApplyGateway;
|
||||||
private final VehicleAuditGateway vehicleAuditGateway;
|
private final VehicleAuditGateway vehicleAuditGateway;
|
||||||
private final DaHuaVehicleSyncExe daHuaVehicleSyncExe;
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long id) {
|
public boolean execute(Long id) {
|
||||||
VehicleApplyE vehicle = vehicleApplyGateway.getById(id);
|
|
||||||
boolean res = vehicleApplyGateway.deletedVehicleApplyById(id);
|
boolean res = vehicleApplyGateway.deletedVehicleApplyById(id);
|
||||||
vehicleAuditGateway.deletedVehicleAuditByApplyId(id);
|
vehicleAuditGateway.deletedVehicleAuditByApplyId(id);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
daHuaVehicleSyncExe.syncDeletedVehicles(vehicle == null
|
|
||||||
? Collections.emptyList() : Collections.singletonList(vehicle));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long[] ids) {
|
public boolean execute(Long[] ids) {
|
||||||
List<VehicleApplyE> vehicles = new ArrayList<>();
|
|
||||||
for (Long id : ids) {
|
|
||||||
VehicleApplyE vehicle = vehicleApplyGateway.getById(id);
|
|
||||||
if (vehicle != null) {
|
|
||||||
vehicles.add(vehicle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean res = vehicleApplyGateway.deletedVehicleApplyByIds(ids);
|
boolean res = vehicleApplyGateway.deletedVehicleApplyByIds(ids);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
daHuaVehicleSyncExe.syncDeletedVehicles(vehicles);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ public class VehicleAuditUpdateExe {
|
||||||
private final CarDockUtil carDockUtil;
|
private final CarDockUtil carDockUtil;
|
||||||
private final MessageNoticeExe messageNoticeExe;
|
private final MessageNoticeExe messageNoticeExe;
|
||||||
private final MessageTemplateConfig messageTemplateConfig;
|
private final MessageTemplateConfig messageTemplateConfig;
|
||||||
private final DaHuaVehicleSyncExe daHuaVehicleSyncExe;
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void execute(VehicleAuditUpdateCmd vehicleAuditUpdateCmd) {
|
public void execute(VehicleAuditUpdateCmd vehicleAuditUpdateCmd) {
|
||||||
|
|
@ -77,7 +76,6 @@ public class VehicleAuditUpdateExe {
|
||||||
} else {
|
} else {
|
||||||
carDockUtil.executeInternalVehicle(vehicleApplyE1);
|
carDockUtil.executeInternalVehicle(vehicleApplyE1);
|
||||||
}
|
}
|
||||||
daHuaVehicleSyncExe.syncApprovedVehicle(cmd.getVehicleApplyId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 完成待办
|
// 完成待办
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ public interface DaHuaGateway {
|
||||||
|
|
||||||
Long generatePersonId();
|
Long generatePersonId();
|
||||||
|
|
||||||
Long findPersonIdByPaperNumber(String paperNumber);
|
|
||||||
|
|
||||||
Map<String, Object> syncPerson(DaHuaPersonSyncCmd cmd);
|
Map<String, Object> syncPerson(DaHuaPersonSyncCmd cmd);
|
||||||
|
|
||||||
Map<String, Object> updatePerson(DaHuaPersonSyncCmd cmd);
|
Map<String, Object> updatePerson(DaHuaPersonSyncCmd cmd);
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,6 @@ public interface PersonApplyGateway {
|
||||||
|
|
||||||
List<PersonApplyE> personListByxgfApplyPersonId(Long id);
|
List<PersonApplyE> personListByxgfApplyPersonId(Long id);
|
||||||
|
|
||||||
PersonApplyE getPersonById(Long id);
|
|
||||||
|
|
||||||
XgfApplyPersonE getXgfApplyPersonById(Long id);
|
XgfApplyPersonE getXgfApplyPersonById(Long id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,6 @@ public class DaHuaPersonSyncCmd {
|
||||||
|
|
||||||
private Long departmentId;
|
private Long departmentId;
|
||||||
|
|
||||||
private Integer departmentType;
|
|
||||||
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
private Integer personType;
|
private Integer personType;
|
||||||
|
|
||||||
private Integer availableTimes;
|
private Integer availableTimes;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ public class DaHuaPersonApi {
|
||||||
private static final String PERSON_ADD_URL = "/evo-apigw/evo-brm/1.2.0/person/subsystem/add";
|
private static final String PERSON_ADD_URL = "/evo-apigw/evo-brm/1.2.0/person/subsystem/add";
|
||||||
private static final String PERSON_UPDATE_URL = "/evo-apigw/evo-brm/1.2.0/person/subsystem/update";
|
private static final String PERSON_UPDATE_URL = "/evo-apigw/evo-brm/1.2.0/person/subsystem/update";
|
||||||
private static final String PERSON_GENERATE_ID_URL = "/evo-apigw/evo-brm/1.0.0/person/generate-id";
|
private static final String PERSON_GENERATE_ID_URL = "/evo-apigw/evo-brm/1.0.0/person/generate-id";
|
||||||
private static final String PERSON_GET_BY_PAPER_NUMBER_URL = "/evo-apigw/evo-brm/1.2.0/person/subsystem/get-by-paper-number";
|
|
||||||
private static final String PERSON_DELETE_URL = "/evo-apigw/evo-brm/1.0.0/person/delete";
|
private static final String PERSON_DELETE_URL = "/evo-apigw/evo-brm/1.0.0/person/delete";
|
||||||
private static final String CAR_ADD_URL = "/evo-apigw/evo-brm/1.0.0/car/add";
|
private static final String CAR_ADD_URL = "/evo-apigw/evo-brm/1.0.0/car/add";
|
||||||
private static final String CAR_UPDATE_URL = "/evo-apigw/evo-brm/1.0.0/car/update";
|
private static final String CAR_UPDATE_URL = "/evo-apigw/evo-brm/1.0.0/car/update";
|
||||||
|
|
@ -61,18 +60,6 @@ public class DaHuaPersonApi {
|
||||||
return daHuaApiClient.getForm(PERSON_GENERATE_ID_URL, null, headers);
|
return daHuaApiClient.getForm(PERSON_GENERATE_ID_URL, null, headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeneralResponse getPersonByPaperNumber(String paperNumber) throws ClientException {
|
|
||||||
if (daHuaApiClient == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
String token = daHuaApiClient.getToken();
|
|
||||||
Map<String, String> headers = new HashMap<>();
|
|
||||||
headers.put("Authorization", "bearer " + token);
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
|
||||||
params.put("paperNumber", paperNumber);
|
|
||||||
return daHuaApiClient.getForm(PERSON_GET_BY_PAPER_NUMBER_URL, params, headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
public GeneralResponse deletePerson(Map<String, Object> body) throws ClientException {
|
public GeneralResponse deletePerson(Map<String, Object> body) throws ClientException {
|
||||||
if (daHuaApiClient == null) {
|
if (daHuaApiClient == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -74,29 +74,6 @@ public class DaHuaGatewayImpl implements DaHuaGateway {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Long findPersonIdByPaperNumber(String paperNumber) {
|
|
||||||
if (daHuaPersonApi == null || !daHuaPersonApi.isConfigured()) {
|
|
||||||
throw new RuntimeException("大华服务未配置");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
GeneralResponse response = daHuaPersonApi.getPersonByPaperNumber(paperNumber);
|
|
||||||
if (response == null || !"0".equals(response.getCode())) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
JSONObject responseJson = JSONUtil.parseObj(JSONUtil.toJsonStr(response));
|
|
||||||
String result = responseJson.getStr("result");
|
|
||||||
if (result == null || result.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
JSONObject resultJson = JSONUtil.parseObj(result);
|
|
||||||
JSONObject data = resultJson.getJSONObject("data");
|
|
||||||
return data == null || data.isEmpty() ? null : data.getLong("id");
|
|
||||||
} catch (ClientException e) {
|
|
||||||
throw new RuntimeException("查询大华人员失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> syncPerson(DaHuaPersonSyncCmd cmd) {
|
public Map<String, Object> syncPerson(DaHuaPersonSyncCmd cmd) {
|
||||||
if (daHuaPersonApi == null || !daHuaPersonApi.isConfigured()) {
|
if (daHuaPersonApi == null || !daHuaPersonApi.isConfigured()) {
|
||||||
|
|
|
||||||
|
|
@ -207,17 +207,6 @@ public class PersonApplyGatewayImpl implements PersonApplyGateway {
|
||||||
return xgfApplyPersonES;
|
return xgfApplyPersonES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public PersonApplyE getPersonById(Long id) {
|
|
||||||
PersonApplyDO personApplyDO = personApplyRepository.getById(id);
|
|
||||||
if (personApplyDO == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
PersonApplyE personApplyE = new PersonApplyE();
|
|
||||||
BeanUtils.copyProperties(personApplyDO, personApplyE);
|
|
||||||
return personApplyE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XgfApplyPersonE getXgfApplyPersonById (Long id) {
|
public XgfApplyPersonE getXgfApplyPersonById (Long id) {
|
||||||
XgfApplyPersonDO byId = xgfApplyPersonRepository.getById(id);
|
XgfApplyPersonDO byId = xgfApplyPersonRepository.getById(id);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue