master
杜函宇 2 weeks ago
parent 1cd653d5c4
commit 6f480439fd

@ -16,13 +16,13 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.gysl.entity.GyslProjectHandbook;
import com.ruoyi.gysl.entity.*;
import com.ruoyi.gysl.entity.request.HandbookRequest;
import com.ruoyi.gysl.entity.request.ZwIdPageReq;
import com.ruoyi.gysl.entity.response.BasicInformationResponse;
import com.ruoyi.gysl.mapper.BasicInformationMapper;
import com.ruoyi.gysl.mapper.ProjectHandBookMapper;
import com.ruoyi.gysl.service.BasicInformationService;
import com.ruoyi.gysl.service.GyslProjectHandbookService;
import com.ruoyi.gysl.service.*;
import com.ruoyi.system.mapper.SysDictDataMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -47,9 +47,23 @@ public class GyslProjectHandbookServiceImpl extends ServiceImpl<ProjectHandBookM
@Resource
private BasicInformationMapper basicInformationMapper;
/**
*
*/
@Resource
private BuildingInformationService buildingInformationService;
/**
*
*/
@Resource
private QyrzInformationService qyrzInformationService;
@Resource
private BasicInformationService basicInformationService;
/**
*
*/
@Resource
private PlanInformationService planInformationService;
@Resource
private SysDictDataMapper sysDictDataMapper;
@ -68,8 +82,27 @@ public class GyslProjectHandbookServiceImpl extends ServiceImpl<ProjectHandBookM
public void generatePdfs(HttpServletResponse response, Integer id) throws IOException {
// 获取数据
GyslProjectHandbook handbook = getById(id);
List<BasicInformationResponse> basicInfoList = basicInformationMapper.idListToProject(
Arrays.asList(handbook.getXmId().split(",")));
// List<BasicInformationResponse> basicInfoList = basicInformationMapper.idListToProject(
// Arrays.asList(handbook.getXmId().split(",")));
String[] list = handbook.getXmId().split(",");
List<BasicInformationResponse> basicInfoList = new ArrayList<>();
for (String s : list) {
BasicInformationResponse bs = new BasicInformationResponse();
//项目基本信息
BasicInformation byId = basicInformationService.getById(s);
bs.setBasicInformation(byId == null ? new BasicInformation() : byId);
//项目规划信息
PlanInformation one = planInformationService.lambdaQuery().eq(PlanInformation::getXmId, s).one();
bs.setPlanInformation(one == null ? new PlanInformation() : one);
//项目建筑信息
bs.setBuildingInformation(buildingInformationService.lambdaQuery().eq(BuildingInformation::getXmId, s).list());
//企业入驻信息
ZwIdPageReq zwIdPageReq = new ZwIdPageReq();
zwIdPageReq.setXmId(Long.valueOf(s));
QyrzInformation qyrzInformation = qyrzInformationService.selectAll(zwIdPageReq);
bs.setQyrzInformation(qyrzInformation == null ? new QyrzInformation() : qyrzInformation);
basicInfoList.add(bs);
}
List<String> hbpdf = new ArrayList<>();
// 配置中文字体
String fontPath = RuoYiConfig.getProfile() + "/Alibaba-PuHuiTi-Regular.ttf";

@ -391,7 +391,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="idListToProject" resultMap="BasicInformationResponseMap">
SELECT a.*,b.*,
c.*
c.id
FROM gysl_basic_information a
left join gysl_plan_information b on a.id = b.xm_id
left join gysl_building_information c on a.id = c.xm_id
@ -403,7 +403,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
</where>
group by a.id
group by a.id,a.name,a.ztze,a.label,a.xzfl,a.prioritize,a.ssgnq,a.jsms,a.fj,
b.id,b.zjzmj,b.zydmj,b.bzcjzmj,b.zgjzgd,b.jzds,b.zgjzcs,b.fhdj,b.jdctcw,b.fjdctcw,
c.id
order by a.create_time desc
</select>

Loading…
Cancel
Save