|
|
|
@ -11,15 +11,18 @@ import com.thing.common.core.exception.SysException; |
|
|
|
import com.thing.common.core.utils.excel.ExcelUtils; |
|
|
|
import com.thing.common.core.web.response.PageData; |
|
|
|
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|
|
|
import com.thing.extend.entity.TransportExtendCalculationEntity; |
|
|
|
import com.thing.extend.mapper.TransportExtendMapper; |
|
|
|
import com.thing.extend.mapper.TransportExtendMsgMapper; |
|
|
|
import com.thing.extend.dto.TransportExtendMsgDTO; |
|
|
|
import com.thing.extend.entity.TransportExtendEntity; |
|
|
|
import com.thing.extend.entity.TransportExtendMsgEntity; |
|
|
|
import com.thing.extend.excel.TransportExtendMsgExcel; |
|
|
|
import com.thing.extend.service.TransportExtendCalculationService; |
|
|
|
import com.thing.extend.service.TransportExtendMsgService; |
|
|
|
import com.thing.extension.ExtensionType; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -44,16 +47,25 @@ public class TransportExtendMsgServiceImpl extends BaseServiceImpl<TransportExte |
|
|
|
|
|
|
|
private final TransportExtendMapper transportExtendDao; |
|
|
|
|
|
|
|
private final TransportExtendCalculationService transportExtendCalculationService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public QueryWrapper getWrapper(Map<String, Object> params) { |
|
|
|
|
|
|
|
paramsToLike(params, "configuration"); |
|
|
|
String configId = (String) params.get("configId"); |
|
|
|
params.put("configId", StringUtils.isNotBlank(configId) ? Long.parseLong(configId) : -1L); |
|
|
|
|
|
|
|
return new QueryWrapper(); |
|
|
|
} |
|
|
|
|
|
|
|
private void getParams(Map<String, Object> params) { |
|
|
|
//转换成like |
|
|
|
paramsToLike(params, "configuration"); |
|
|
|
String configuration = (String) params.get("configuration"); |
|
|
|
String configId = (String) params.get("configId"); |
|
|
|
params.put("configId", StringUtils.isNotBlank(configId) ? Long.parseLong(configId) : -1L); |
|
|
|
QueryWrapper.create().like(TransportExtendMsgEntity::getInputMsg, configuration,StringUtils.isNotBlank(configuration)) |
|
|
|
.eq(TransportExtendMsgEntity::getConfigId, StringUtils.isNotBlank(configId) ? Long.parseLong(configId) : -1L) |
|
|
|
; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -64,14 +76,19 @@ public class TransportExtendMsgServiceImpl extends BaseServiceImpl<TransportExte |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageData<TransportExtendMsgDTO> pageList(Map<String, Object> params) { |
|
|
|
getParams(params); |
|
|
|
|
|
|
|
Page<TransportExtendMsgEntity> page = mapper.paginate( |
|
|
|
getPage(params), |
|
|
|
buildOrderWrapper(params, "create_date", false) |
|
|
|
); |
|
|
|
return getPageData(page, TransportExtendMsgDTO.class); |
|
|
|
|
|
|
|
QueryWrapper queryWrapper = buildOrderWrapper(params, "create_date", false); |
|
|
|
Integer page = MapUtils.getInteger(params, Constant.PAGE, 1); |
|
|
|
Integer limit = MapUtils.getInteger(params, Constant.LIMIT, 10); |
|
|
|
Page<TransportExtendMsgDTO> pageList = mapper.paginateAs(new Page<>(page,limit),queryWrapper, TransportExtendMsgDTO.class); |
|
|
|
List<TransportExtendMsgDTO> records = pageList.getRecords(); |
|
|
|
if(CollectionUtil.isNotEmpty(records)){ |
|
|
|
for (TransportExtendMsgDTO record : pageList.getRecords()) { |
|
|
|
Long extendCalculationId = record.getExtendCalculationId(); |
|
|
|
TransportExtendCalculationEntity entity = transportExtendCalculationService.getById(extendCalculationId); |
|
|
|
record.setConfiguration(entity.getAddr()); |
|
|
|
} |
|
|
|
} |
|
|
|
return new PageData<>(records, pageList.getTotalRow()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|