Commit dc9da1c1 authored by zhangyingbin's avatar zhangyingbin

修改企业列表展示接口,修改总览页面地图企业信息卡上的企业有效期,修改充装企业详情展示变更

parent 0e1305a5
......@@ -11,7 +11,9 @@
tz_cylinder_unit U
LEFT JOIN tz_cylinder_info AS t ON u.credit_code = t.credit_code
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code and t.app_id = u.app_id
LEFT JOIN tz_base_unit_licence AS l ON l.unit_code = u.credit_code
LEFT JOIN (SELECT * FROM `tz_base_unit_licence`
GROUP BY unit_code
ORDER BY expiry_date DESC) AS l ON l.unit_code = u.credit_code
WHERE
t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code )
AND u.sequence_nbr = #{sequenceNbr}
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
......@@ -8,6 +9,11 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.module.tzs.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzBaseEnterpriseInfoServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -86,6 +92,11 @@ public class CylinderInfoController extends BaseController {
private Map<Integer, String> regionMap;
private Map<String,String> licenceDateMap;
@Autowired
BaseUnitLicenceServiceImpl baseUnitLicenceService;
@Autowired
private SourceFileServiceImpl sourceFileService;
......@@ -95,6 +106,9 @@ public class CylinderInfoController extends BaseController {
@Autowired
CylinderTagsServiceImpl cylinderTagsServiceImpl;
@Autowired
TzBaseEnterpriseInfoServiceImpl baseEnterpriseInfoService;
/**
* 新增气瓶基本信息
*
......@@ -672,6 +686,19 @@ public class CylinderInfoController extends BaseController {
}
/**
* 获取气瓶充装单位许可信息详情
*
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCylinderUnitLic/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "获取气瓶充装单位详情", notes = "获取气瓶充装单位详情")
public ResponseModel<TzBaseEnterpriseInfoDto> getCylinderUnitLic(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(cylinderUnitServiceImpl.getCylinderUnitLic(sequenceNbr));
}
/**
* 获取气瓶充装单位详情
*
* @param sequenceNbr
......@@ -790,6 +817,19 @@ public class CylinderInfoController extends BaseController {
});
}
if(ValidationUtil.isEmpty(this.licenceDateMap)){
licenceDateMap = new HashMap<>();
LambdaQueryWrapper<BaseUnitLicence> wrapper = new LambdaQueryWrapper<>();
wrapper.select(BaseUnitLicence::getUnitCode,BaseUnitLicence::getExpiryDate)
.groupBy(BaseUnitLicence::getUnitCode)
.orderByDesc(BaseUnitLicence::getExpiryDate);
List<BaseUnitLicence> baseUnitLicenceList = baseUnitLicenceService.list(wrapper);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(BaseUnitLicence baseUnitLicence:baseUnitLicenceList){
licenceDateMap.put(baseUnitLicence.getUnitCode(),sdf.format(baseUnitLicence.getExpiryDate()));
}
}
return page.convert(item -> {
try {
CylinderUnitDto target = new CylinderUnitDto();
......@@ -802,6 +842,7 @@ public class CylinderInfoController extends BaseController {
regionCode += this.regionMap.get(Integer.parseInt(regionCodes[i]));
}
target.setRegionCode(regionCode);
target.setFillingPermitDate(licenceDateMap.get(target.getCreditCode()));
// if (1 == item.getUnitType()) {
// target.setUnitTypeStr("液化石油气瓶充装单位");
// } else if (2 == item.getUnitType()) {
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.BaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.BaseUnitLicenceServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzBaseEnterpriseInfoServiceImpl;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.RegUnitIcDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitIc;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.CylinderUnitMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.ICylinderUnitService;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderUnitDto;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -17,6 +33,16 @@ import java.util.List;
*/
@Service
public class CylinderUnitServiceImpl extends BaseService<CylinderUnitDto, CylinderUnit,CylinderUnitMapper> implements ICylinderUnitService {
@Autowired
TzBaseEnterpriseInfoServiceImpl baseEnterpriseInfoService;
@Autowired
RegUnitIcServiceImpl regUnitIcService;
@Autowired
BaseUnitLicenceServiceImpl baseUnitLicenceService;
/**
* 分页查询
*/
......@@ -66,4 +92,49 @@ public class CylinderUnitServiceImpl extends BaseService<CylinderUnitDto, Cylind
{
return baseMapper.getWarnNumByAppId(appId);
}
/**
* 获取气瓶充装单位许可信息详情
*
* @param sequenceNbr
* @return
*/
public TzBaseEnterpriseInfoDto getCylinderUnitLic(Long sequenceNbr){
CylinderUnit cylinderUnit = this.getById(sequenceNbr);
if(ValidationUtil.isEmpty(cylinderUnit)){
return null;
}
String creditCode = cylinderUnit.getCreditCode();
//根据creditCode获取TzBaseEnterpriseInfo表信息
LambdaQueryWrapper<TzBaseEnterpriseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseEnterpriseInfo::getUseCode,cylinderUnit.getCreditCode())
.eq(TzBaseEnterpriseInfo::getIsDelete,false);
TzBaseEnterpriseInfo baseEnterpriseInfo = baseEnterpriseInfoService.getOne(wrapper);
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = new TzBaseEnterpriseInfoDto();
if (ValidationUtil.isEmpty(baseEnterpriseInfo)){
return null;
}
BeanUtils.copyProperties(baseEnterpriseInfo, tzBaseEnterpriseInfoDto);
// 许可信息
List<BaseUnitLicence> unitLicences = baseUnitLicenceService.list(new LambdaQueryWrapper<BaseUnitLicence>()
.eq(BaseUnitLicence::getUnitCode, creditCode));
List<BaseUnitLicenceDto> unitLicenceDtos = new ArrayList<BaseUnitLicenceDto>();
for (BaseUnitLicence baseUnitLicence : unitLicences) {
BaseUnitLicenceDto baseUnitLicenceDto = new BaseUnitLicenceDto();
BeanUtils.copyProperties(baseUnitLicence, baseUnitLicenceDto);
unitLicenceDtos.add(baseUnitLicenceDto);
}
tzBaseEnterpriseInfoDto.setUnitLicences(unitLicenceDtos);
// 工商信息
RegUnitIc regUnitIc = regUnitIcService.getOne(
new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, creditCode));
RegUnitIcDto regUnitIcDto = new RegUnitIcDto();
if (regUnitIc != null) {
BeanUtils.copyProperties(regUnitIc, regUnitIcDto);
}
tzBaseEnterpriseInfoDto.setRegUnitIcDto(regUnitIcDto);
return tzBaseEnterpriseInfoDto;
}
}
\ 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