|
@@ -1,15 +1,14 @@
|
|
package com.caimei.www.service.impl;
|
|
package com.caimei.www.service.impl;
|
|
|
|
|
|
import com.caimei.www.mapper.InstrumentDao;
|
|
import com.caimei.www.mapper.InstrumentDao;
|
|
-import com.caimei.www.mapper.ProductDao;
|
|
|
|
|
|
+import com.caimei.www.mapper.SinglePageDao;
|
|
import com.caimei.www.pojo.JsonModel;
|
|
import com.caimei.www.pojo.JsonModel;
|
|
import com.caimei.www.pojo.content.ImageLink;
|
|
import com.caimei.www.pojo.content.ImageLink;
|
|
-import com.caimei.www.pojo.content.InstrumentDetail;
|
|
|
|
|
|
+import com.caimei.www.pojo.content.PageContent;
|
|
import com.caimei.www.pojo.content.PageFloor;
|
|
import com.caimei.www.pojo.content.PageFloor;
|
|
import com.caimei.www.pojo.content.Parameter;
|
|
import com.caimei.www.pojo.content.Parameter;
|
|
import com.caimei.www.service.InstrumentService;
|
|
import com.caimei.www.service.InstrumentService;
|
|
import com.caimei.www.utils.ImageUtil;
|
|
import com.caimei.www.utils.ImageUtil;
|
|
-import com.caimei.www.utils.PriceUtil;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -27,6 +26,9 @@ import java.util.List;
|
|
public class InstrumentServiceImpl implements InstrumentService {
|
|
public class InstrumentServiceImpl implements InstrumentService {
|
|
@Resource
|
|
@Resource
|
|
private InstrumentDao instrumentDao;
|
|
private InstrumentDao instrumentDao;
|
|
|
|
+ @Resource
|
|
|
|
+ SinglePageDao singlePageDao;
|
|
|
|
+
|
|
@Value("${caimei.wwwDomain}")
|
|
@Value("${caimei.wwwDomain}")
|
|
private String domain;
|
|
private String domain;
|
|
|
|
|
|
@@ -37,8 +39,8 @@ public class InstrumentServiceImpl implements InstrumentService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public InstrumentDetail getInstrumentById(Integer instrumentId) {
|
|
|
|
- InstrumentDetail instrument = instrumentDao.getInstrumentById(instrumentId);
|
|
|
|
|
|
+ public PageContent getInstrumentById(Integer instrumentId) {
|
|
|
|
+ PageContent instrument = instrumentDao.getInstrumentById(instrumentId);
|
|
List<Parameter> contents = instrumentDao.getParametersByInstrumentId(instrumentId);
|
|
List<Parameter> contents = instrumentDao.getParametersByInstrumentId(instrumentId);
|
|
instrument.setPageContents(contents);
|
|
instrument.setPageContents(contents);
|
|
return instrument;
|
|
return instrument;
|
|
@@ -52,11 +54,11 @@ public class InstrumentServiceImpl implements InstrumentService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public JsonModel<List<PageFloor>> getInstrumentRecommendById(Integer instrumentId) {
|
|
public JsonModel<List<PageFloor>> getInstrumentRecommendById(Integer instrumentId) {
|
|
- List<PageFloor> floorList = instrumentDao.getInstrumentRecommendById(instrumentId);
|
|
|
|
|
|
+ List<PageFloor> floorList = singlePageDao.getFloorByPageId(instrumentId);
|
|
if (floorList.size() > 0) {
|
|
if (floorList.size() > 0) {
|
|
List<PageFloor> tempList = new ArrayList<>();
|
|
List<PageFloor> tempList = new ArrayList<>();
|
|
floorList.forEach(floor -> {
|
|
floorList.forEach(floor -> {
|
|
- List<ImageLink> imageLinks = instrumentDao.getFloorDataById(floor.getId());
|
|
|
|
|
|
+ List<ImageLink> imageLinks = singlePageDao.getDataByFloorId(floor.getId());
|
|
if (imageLinks.size() > 0) {
|
|
if (imageLinks.size() > 0) {
|
|
imageLinks.forEach(img -> {
|
|
imageLinks.forEach(img -> {
|
|
img.setImage(ImageUtil.getImageURL("actType", img.getImage(), 0, domain));
|
|
img.setImage(ImageUtil.getImageURL("actType", img.getImage(), 0, domain));
|