Commit b6685aaf authored by kongfm's avatar kongfm

提交企业变更 及 变更审核逻辑代码

parent 445c198b
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
/**
* 企业信息变更表接口类
*
......@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
*/
public interface IUnitInfoChangeService {
UnitInfoDto findLastChangInfo(Long sourceId);
}
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfoChange;
/**
* 企业信息表接口类
......@@ -21,5 +23,13 @@ public interface IUnitInfoService {
UnitInfoDto getDtoById(Long sequenceNbr);
UnitInfoDto getUnItDtoById(Long sequenceNbr);
UnitInfoDto unitInfoToDto(UnitInfo source);
UnitInfoDto unitChangeInfoToDto(UnitInfoChange source);
UnitInfoDto getDtoByOrgId(Long sequenceNbr);
UnitInfoDto changeUnInfo(UnitInfoDto model);
}
......@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.ElevatorInsure;
import com.yeejoin.amos.boot.module.tzs.api.entity.ElevatorInsureRelation;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.api.mapper.ElevatorMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorInsureRelationService;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorService;
......@@ -209,8 +210,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
temp.setType("image");
temp.setUrl(filePath);
qrCode.add(temp);
Map<String, List<AttachmentDto>> attachmentMap = new HashMap<>();
attachmentMap.put("qrCode",qrCode);
Map<String, List<AttachmentDto>> attachmentMap = sourceFileService.getAttachments(elevatorId);
attachmentMap.put(TzsCommonParam.QR_CODE,qrCode);
sourceFileService.saveAttachments(elevatorId,attachmentMap);
return filePath;
}
......
......@@ -267,6 +267,7 @@ public class BeanDtoVoUtils {
}
target.setFullAddress(item.getProvince() + item.getCity() + item.getDistrict() + item.getStree() + item.getCommunity() + item.getAddress());
target.setAdminLoginPwd(null);
return target;
} catch (Exception e) {
return null;
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoChangeServiceImpl;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
......@@ -81,6 +82,9 @@ public class UnitInfoController extends BaseController {
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Autowired
UnitInfoChangeServiceImpl unitInfoChangeServiceImpl;
/**
* 获取组织机构树
*
......@@ -256,7 +260,7 @@ public class UnitInfoController extends BaseController {
if (ValidationUtil.isEmpty(sequenceNbr) ) {
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(unitInfoServiceImpl.getDtoById(sequenceNbr));
return ResponseHelper.buildResponse(unitInfoServiceImpl.getUnItDtoById(sequenceNbr));
}
......@@ -395,7 +399,14 @@ public class UnitInfoController extends BaseController {
for(CompanyModel c : companys) {
OrgUsr temp = iOrgUsrService.getOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getAmosOrgId,c.getSequenceNbr()));
if(temp != null) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.getDtoByOrgId(temp.getSequenceNbr()));
// 企业信息查看判断是否变更 如果变更信息则返回变更中信息
result = unitInfoServiceImpl.getDtoByOrgId(temp.getSequenceNbr());
if(result.getIsChange() && result.getUnitStatus() == 0) {
result = unitInfoChangeServiceImpl.findLastChangInfo(temp.getSequenceNbr());
}
return ResponseHelper.buildResponse(result);
}
}
return ResponseHelper.buildResponse(result);
......@@ -403,4 +414,38 @@ public class UnitInfoController extends BaseController {
/**
* 变更企业表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/change")
@ApiOperation(httpMethod = "POST", value = "变更企业表", notes = "变更企业表")
public ResponseModel<UnitInfoDto> change(@RequestBody UnitInfoDto model) {
model = unitInfoServiceImpl.changeUnInfo(model);
return ResponseHelper.buildResponse(model);
}
/**
* 查询审批数据
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/approve/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "查询审批数据", notes = "查询审批数据")
public ResponseModel<UnitInfoDto> getApproveInfo(@PathVariable Long sequenceNbr) {
if (ValidationUtil.isEmpty(sequenceNbr) ) {
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(unitInfoServiceImpl.getDtoById(sequenceNbr));
}
}
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoChangeDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfoChange;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitInfoChangeMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoChangeService;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.List;
......@@ -18,6 +23,10 @@ import java.util.List;
*/
@Service
public class UnitInfoChangeServiceImpl extends BaseService<UnitInfoChangeDto, UnitInfoChange, UnitInfoChangeMapper> implements IUnitInfoChangeService {
@Autowired
IUnitInfoService iUnitInfoService;
/**
* 分页查询
*/
......@@ -31,4 +40,22 @@ public class UnitInfoChangeServiceImpl extends BaseService<UnitInfoChangeDto, Un
public List<UnitInfoChangeDto> queryForFlcUnitInfoChangeList() {
return this.queryForList("", false);
}
/**
* 根据源码id 返回最新的变更记录
* @param sourceId
* @return
*/
@Override
public UnitInfoDto findLastChangInfo(Long sourceId) {
UnitInfoChange result;
List<UnitInfoChange> changInfoList = this.list(new LambdaQueryWrapper<UnitInfoChange>().eq(UnitInfoChange::getIsDelete,false).eq(UnitInfoChange::getSourceId,sourceId).orderByDesc(UnitInfoChange::getRecDate));
if(changInfoList != null && changInfoList.size() >0) {
result = changInfoList.get(0);
} else {
throw new BadRequest("未找到变更记录");
}
return iUnitInfoService.unitChangeInfoToDto(result);
}
}
\ No newline at end of file
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