Commit 5424cf2c authored by KeYong's avatar KeYong

修改站端bug

parent ced8f220
......@@ -417,4 +417,7 @@ public interface EquipFeignClient {
@RequestMapping(value = "equipSpecific/getListByEquipmentCodeEQ/{code}", method = RequestMethod.GET)
ResponseModel<List<Map<String, Object>>> getListByEquipmentCodeEQ(@PathVariable("code") String code);
@RequestMapping(value = "/scrap/delete/person", method = RequestMethod.POST)
ResponseModel<Object> delUsr(@RequestBody String id) throws InnerInvokException;
}
package com.yeejoin.amos.boot.module.common.api.feign;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* 装备服务feign
*
* @author Dell
*/
@FeignClient(name = "${idx.feign.name:AMOS-IDX}", path = "idx", configuration = {MultipartSupportConfig.class})
public interface IdxFeignClient {
@RequestMapping(value = "/defect/delete/person", method = RequestMethod.POST)
ResponseModel<Object> delUsr(@RequestBody String id) throws InnerInvokException;
}
......@@ -25,6 +25,8 @@ import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.api.enums.UserRolesEnum;
import com.yeejoin.amos.boot.module.common.api.enums.UserUnitTypeEnum;
import com.yeejoin.amos.boot.module.common.api.feign.AmosTrainingFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.IdxFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersJacketMapper;
......@@ -172,6 +174,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Autowired
RedisUtils redisUtils;
@Autowired
EquipFeignClient equipFeignClient;
@Autowired
IdxFeignClient idxFeignClient;
public static List<OrgMenuDto> buildTreeParallel(List<OrgUsr> list) {
List<OrgMenuDto> menuList = list.stream()
......@@ -3302,6 +3310,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public void afterCommit() {
// 事物提交后业务逻辑
dataSyncService.OrgUsrSyncDtoDelDataSync(id);
// 由于处理消息地方没人知道,此处手动调用更新business、idx库用户数据
equipFeignClient.delUsr(String.valueOf(id));
idxFeignClient.delUsr(String.valueOf(id));
}
});
......
......@@ -229,4 +229,16 @@ public class ScrapController extends AbstractBaseController {
}
return CommonResponseUtil.success();
}
@RequestMapping(value = "/delete/person", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "机场人员删除接口", notes = "机场人员删除接口", produces = "application/json;charset=UTF-8")
public ResponseModel delPerson(@RequestBody String id) {
try {
iScrapService.delPerson(Long.valueOf(id));
} catch (Exception e) {
return CommonResponseUtil.failure("人员删除失败!");
}
return CommonResponseUtil.success();
}
}
......@@ -30,4 +30,6 @@ public interface IScrapService extends IService<Scrap> {
void scrapOnCar(Long id);
void scrapOnPerson(Long id);
void delPerson(Long id);
}
......@@ -12,12 +12,14 @@ import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.mapper.CarMapper;
import com.yeejoin.equipmanage.mapper.EquipmentOnCarMapper;
import com.yeejoin.equipmanage.mapper.OrgUsrMapper;
import com.yeejoin.equipmanage.mapper.ScrapMapper;
import com.yeejoin.equipmanage.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.*;
......@@ -56,6 +58,9 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements
@Autowired
private EquipmentOnCarMapper equipmentOnCarMapper;
@Autowired
private OrgUsrMapper orgUsrMapper;
@Override
public Scrap create(List<ScrapDetail> list, String type, AgencyUserModel agencyUserModel) {
this.scrapCheck(type, list);
......@@ -310,4 +315,13 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements
stockDetailService.updateById(stockDetail);
}
@Override
public void delPerson(Long id) {
OrgUsr usr = orgUsrMapper.selectById(id);
if (!ObjectUtils.isEmpty(usr)) {
usr.setIsDelete(true);
orgUsrMapper.updateById(usr);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment