diff --git a/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/RemoteDevInfoService.java b/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/RemoteDevInfoService.java index b447a9e..3c40264 100644 --- a/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/RemoteDevInfoService.java +++ b/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/RemoteDevInfoService.java @@ -20,7 +20,7 @@ public interface RemoteDevInfoService * @param maId * @return */ - @GetMapping(value = "/dev/{maId}") + @GetMapping(value = "/dev/getInfo/{maId}") public AjaxResult getInfo(@PathVariable("maId") Long maId); /** diff --git a/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/domain/vo/DevInfoVo.java b/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/domain/vo/DevInfoVo.java index 546046b..62b3532 100644 --- a/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/domain/vo/DevInfoVo.java +++ b/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/domain/vo/DevInfoVo.java @@ -38,18 +38,12 @@ public class DevInfoVo extends DevInfo { private String[] pictures; @ApiModelProperty(value = "关键词") private String keyWord; - /* 是否审核通过, ma_up_off:status, 1=通过, 2驳回 */ - @ApiModelProperty(value = "是否审核通过") - private String isAudit; @ApiModelProperty(value = "搜索数量") private Long searchNum; @ApiModelProperty(value = "检验pdf") private String examinationPdf; @ApiModelProperty(value = "保险pdf") private String insurancePdf; - /** 1上架,2下架*/ - @ApiModelProperty(value = "上下架类别") - private String type; /**上下架id*/ @ApiModelProperty(value = "上下架id") private int upId; @@ -79,4 +73,10 @@ public class DevInfoVo extends DevInfo { private String cityStr; @ApiModelProperty(value = "区名称") private String areaStr; + @ApiModelProperty(value = "装备类别Id") + private String companyId; + /* 装备组别 parent */ + @ApiModelProperty(value = "装备组别Id") + private String groupId; + private Long userId; } diff --git a/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/enums/MaStatusEnum.java b/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/enums/MaStatusEnum.java index 330db46..c850433 100644 --- a/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/enums/MaStatusEnum.java +++ b/zlpt-api/zlpt-api-equip/src/main/java/com/bonus/zlpt/equip/api/enums/MaStatusEnum.java @@ -2,8 +2,8 @@ package com.bonus.zlpt.equip.api.enums; public enum MaStatusEnum { - /** 待上架审批 */ - PENDING_APPROVAL(15, "待上架审批"), + /** 待上架 */ + TO_BE_LISTED (15, "待上架"), /** 待租 */ ON_HIRE(16, "待租"), /** 在租 */ @@ -11,7 +11,11 @@ public enum MaStatusEnum { /** 下架 */ DELIST(18,"下架"), /** 自有 */ - SELF_OWNED(43,"自有"); + SELF_OWNED(43,"自有"), + /** 待审批 */ + PENDING_APPROVAL(331,"待审批"), + /** 上架驳回 */ + LISTING_REJECTED(332,"上架驳回"); diff --git a/zlpt-common/zlpt-common-core/src/main/java/com/bonus/zlpt/common/core/web/domain/BaseEntity.java b/zlpt-common/zlpt-common-core/src/main/java/com/bonus/zlpt/common/core/web/domain/BaseEntity.java index 6c31f9c..167f34f 100644 --- a/zlpt-common/zlpt-common-core/src/main/java/com/bonus/zlpt/common/core/web/domain/BaseEntity.java +++ b/zlpt-common/zlpt-common-core/src/main/java/com/bonus/zlpt/common/core/web/domain/BaseEntity.java @@ -25,7 +25,7 @@ public class BaseEntity implements Serializable /** 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; + private String createTime; /** 更新者 */ private String updateBy; @@ -61,12 +61,12 @@ public class BaseEntity implements Serializable this.createBy = createBy; } - public Date getCreateTime() + public String getCreateTime() { return createTime; } - public void setCreateTime(Date createTime) + public void setCreateTime(String createTime) { this.createTime = createTime; } diff --git a/zlpt-modules/zlpt-bigScreen/pom.xml b/zlpt-modules/zlpt-bigScreen/pom.xml index fecdbc0..eefd4f5 100644 --- a/zlpt-modules/zlpt-bigScreen/pom.xml +++ b/zlpt-modules/zlpt-bigScreen/pom.xml @@ -82,6 +82,18 @@ com.bonus.zlpt zlpt-common-security + + com.bonus.zlpt + zlpt-api-equip + 3.6.3 + compile + + + com.bonus.zlpt + zlpt-api-company + 3.6.3 + compile + diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java index e6bd0ba..2fe98b0 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java @@ -1,14 +1,14 @@ package com.bonus.zlpt.bigscreen.service.impl; -import com.bonus.zlpt.bigscreen.domain.vo.CoTypeVo; -import com.bonus.zlpt.bigscreen.domain.vo.ColtdTypeVo; -import com.bonus.zlpt.bigscreen.domain.vo.LatVo; -import com.bonus.zlpt.bigscreen.domain.vo.LonVo; +import com.bonus.zlpt.bigscreen.domain.vo.*; import com.bonus.zlpt.bigscreen.mapper.BmCompanyInfoMapper; import com.bonus.zlpt.bigscreen.service.BmCompanyInfoService; +import com.bonus.zlpt.company.api.enums.CompanyTypeEnum; +import com.bonus.zlpt.equip.api.enums.MaStatusEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -30,7 +30,13 @@ public class BmCompanyInfoServiceImpl implements BmCompanyInfoService { */ @Override public List selectTypeList() { - return bmCompanyInfoMapper.selectTypeList(); + List list = bmCompanyInfoMapper.selectTypeList(); + ArrayList typeVos = new ArrayList<>(); + for (CoTypeVo coTypeVo : list) { + coTypeVo.setCoType(CompanyTypeEnum.getNameByCode(Integer.parseInt(coTypeVo.getCoType()))); + typeVos.add(coTypeVo); + } + return typeVos; } /** @@ -39,7 +45,14 @@ public class BmCompanyInfoServiceImpl implements BmCompanyInfoService { */ @Override public List selectColtdList() { - return bmCompanyInfoMapper.selectColtdList(); + List list = bmCompanyInfoMapper.selectColtdList(); + ArrayList coltdTypeVos = new ArrayList<>(); + for (ColtdTypeVo coltdTypeVo : list) { + coltdTypeVo.setMaStatus(MaStatusEnum.getNameByCode(Integer.parseInt(coltdTypeVo.getMaStatus()))); + coltdTypeVo.setCompanyType(CompanyTypeEnum.getNameByCode(Integer.parseInt(coltdTypeVo.getCompanyType()))); + coltdTypeVos.add(coltdTypeVo); + } + return coltdTypeVos; } /** diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmMachinistInfoServiceImpl.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmMachinistInfoServiceImpl.java index f972c17..394c9a5 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmMachinistInfoServiceImpl.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmMachinistInfoServiceImpl.java @@ -3,9 +3,11 @@ package com.bonus.zlpt.bigscreen.service.impl; import com.bonus.zlpt.bigscreen.domain.vo.CompanyInfoVo; import com.bonus.zlpt.bigscreen.mapper.BmMachinistInfoMapper; import com.bonus.zlpt.bigscreen.service.BmMachinistInfoService; +import com.bonus.zlpt.company.api.enums.CompanyLtdEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -27,7 +29,12 @@ public class BmMachinistInfoServiceImpl implements BmMachinistInfoService { */ @Override public List selectMachinistInfoList() { - return infoMapper.selectMachinistInfoList(); + List list = infoMapper.selectMachinistInfoList(); + ArrayList companyInfoVos = new ArrayList<>(); + for (CompanyInfoVo companyInfoVo : list) { + companyInfoVo.setOwnCo(CompanyLtdEnum.getNameByCode(Integer.parseInt(companyInfoVo.getOwnCo()))); + } + return companyInfoVos; } } diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/MaDevInfoServiceImpl.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/MaDevInfoServiceImpl.java index 6d45694..5a74339 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/MaDevInfoServiceImpl.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/MaDevInfoServiceImpl.java @@ -6,9 +6,12 @@ import com.bonus.zlpt.bigscreen.domain.vo.MaIdVo; import com.bonus.zlpt.bigscreen.domain.vo.TypeVo; import com.bonus.zlpt.bigscreen.mapper.MaDevInfoMapper; import com.bonus.zlpt.bigscreen.service.MaDevInfoService; +import com.bonus.zlpt.company.api.enums.CompanyLtdEnum; +import com.bonus.zlpt.equip.api.enums.MaStatusEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -29,7 +32,13 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { */ @Override public List selectMaDevInfoList() { - return maDevInfoMapper.selectMaDevInfoList(); + List typeVos = maDevInfoMapper.selectMaDevInfoList(); + List coTypeVos = new ArrayList<>(); + for (CoTypeVo typeVo : typeVos) { + typeVo.setCoType(CompanyLtdEnum.getNameByCode(Integer.parseInt(typeVo.getCoType()))); + coTypeVos.add(typeVo); + } + return coTypeVos; } /** @@ -58,7 +67,13 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { */ @Override public List selectTypeList() { - return maDevInfoMapper.selectTypeList(); + List list = maDevInfoMapper.selectTypeList(); + ArrayList typeVos = new ArrayList<>(); + for (TypeVo typeVo : list) { + typeVo.setMaStatus(MaStatusEnum.getNameByCode(Integer.parseInt(typeVo.getMaStatus()))); + typeVos.add(typeVo); + } + return typeVos; } /** @@ -68,7 +83,13 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { */ @Override public List selectMaTypeList() { - return maDevInfoMapper.selectMaTypeList(); + List list = maDevInfoMapper.selectMaTypeList(); + ArrayList typeVos = new ArrayList<>(); + for (TypeVo typeVo : list) { + typeVo.setMaStatus(MaStatusEnum.getNameByCode(Integer.parseInt(typeVo.getMaStatus()))); + typeVos.add(typeVo); + } + return typeVos; } /** @@ -87,7 +108,9 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { */ @Override public MaIdVo selectListById(String maId) { - return maDevInfoMapper.selectListById(maId); + MaIdVo maIdVo = maDevInfoMapper.selectListById(maId); + maIdVo.setMaStatus(MaStatusEnum.getNameByCode(Integer.parseInt(maIdVo.getMaStatus()))); + return maIdVo; } } diff --git a/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml b/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml index e102a7d..d781919 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml +++ b/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml @@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" JOIN bm_company_info c ON m.own_co = c.company_id JOIN gps_real_info g ON m.gps_code = g.gps_code WHERE - m.ma_status IN ('在租', '自有', '待租') and m.is_active = '1' + m.ma_status IN ('16', '17', '43') and m.is_active = '1' GROUP BY c.company_ltd, m.ma_status, g.lon, g.lat,maId diff --git a/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/MaDevInfoMapper.xml b/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/MaDevInfoMapper.xml index 2e61017..f8a0133 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/MaDevInfoMapper.xml +++ b/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/MaDevInfoMapper.xml @@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT bc.company_ltd AS coType, COUNT(*) AS Count FROM ma_dev_info md JOIN bm_company_info bc ON md.own_co = bc.company_id - WHERE md.ma_status = '自有' and md.is_active = '1' + WHERE md.ma_status = '43' and md.is_active = '1' GROUP BY bc.company_ltd @@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT mti.type_name as ownCo, COUNT(*) as count FROM ma_type_info mti INNER JOIN ma_dev_info mdi ON mti.type_id = mdi.type_id - WHERE mdi.ma_status = '在租' and mdi.is_active = '1' + WHERE mdi.ma_status = '17' and mdi.is_active = '1' GROUP BY mti.type_name ORDER BY count DESC @@ -32,14 +32,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/impl/BmCompanyInfoServiceImpl.java b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/impl/BmCompanyInfoServiceImpl.java index 986526c..4bb4eb0 100644 --- a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/impl/BmCompanyInfoServiceImpl.java +++ b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/impl/BmCompanyInfoServiceImpl.java @@ -38,10 +38,10 @@ public class BmCompanyInfoServiceImpl implements BmCompanyInfoService { @Resource private BmCompanyInfoDao bmCompanyInfoMapper; - @Autowired + @Resource private BmCoBankMapper bmCoBankMapper; - @Autowired + @Resource private RemoteUserService remoteUserService; diff --git a/zlpt-modules/zlpt-company/src/main/resources/mapper/BmCompanyInfoMapper.xml b/zlpt-modules/zlpt-company/src/main/resources/mapper/BmCompanyInfoMapper.xml index 5403439..5022945 100644 --- a/zlpt-modules/zlpt-company/src/main/resources/mapper/BmCompanyInfoMapper.xml +++ b/zlpt-modules/zlpt-company/src/main/resources/mapper/BmCompanyInfoMapper.xml @@ -248,7 +248,7 @@ #{idNationUrl,jdbcType=VARCHAR}, - #{auth_email,jdbcType=VARCHAR}, + #{authEmail,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java index 90cde97..2d29453 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java @@ -47,6 +47,15 @@ public class DevInfoController extends BaseController return getDataTable(list); } + @ApiOperation(value = "收藏装备列表") + @PostMapping("/userCollectList") + public TableDataInfo userCollectList(@RequestBody DevInfoVo devInfo) + { + startPage(devInfo.getPageNum(), devInfo.getPageSize()); + List list = devInfoService.selectUserCollectList(devInfo); + return getDataTable(list); + } + // @RequiresPermissions("equip:info:list") @ApiOperation(value = "装备推荐列表") @GetMapping("/hotList") @@ -143,4 +152,18 @@ public class DevInfoController extends BaseController Map sumType =devInfoService.sumType(); return success(sumType); } + + + /** + * 查询商品列表 + */ + //@RequiresPermissions("equip:info:list") + @ApiOperation(value = "查询商品列表") + @PostMapping("/devList") + public TableDataInfo devList(@RequestBody DevInfoVo devInfo) + { + startPage(devInfo.getPageNum(), devInfo.getPageSize()); + List list = devInfoService.selectDevInfoLists(devInfo); + return getDataTable(list); + } } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/mapper/DevInfoMapper.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/mapper/DevInfoMapper.java index b071596..469c96c 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/mapper/DevInfoMapper.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/mapper/DevInfoMapper.java @@ -3,6 +3,7 @@ package com.bonus.zlpt.equip.mapper; import java.util.List; import com.bonus.zlpt.common.core.domain.system.SysFile; import com.bonus.zlpt.equip.api.domain.DevInfo; +import com.bonus.zlpt.equip.api.domain.UserCollect; import com.bonus.zlpt.equip.api.domain.dto.InforMationDto; import com.bonus.zlpt.equip.api.domain.vo.DevInfoVo; import com.bonus.zlpt.system.api.domain.BaseAddress; @@ -24,6 +25,8 @@ public interface DevInfoMapper */ public DevInfoVo selectDevInfoByMaId(Long maId); + public int updateHotSearchByMaId(Long maId); + /** * 查询设备图片集 * @@ -42,6 +45,9 @@ public interface DevInfoMapper */ public List selectDevInfoList(DevInfo devInfo); +// public List selectDevInfoList4Collect(DevInfo devInfo); + public List selectUserCollectByUserId(Long userId); + public List selectDevInfoHotList(DevInfo devInfo); /** @@ -90,4 +96,7 @@ public interface DevInfoMapper public List getBaseAddress(); public String getBaseAddressById(Integer id); + + List selectDevInfoLists(DevInfoVo devInfo); } + diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java index f014050..4d36b98 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java @@ -31,6 +31,8 @@ public interface IDevInfoService */ public List selectDevInfoList(DevInfoVo devInfo); + List selectUserCollectList(DevInfoVo devInfo); + public List selectDevInfoHotList(DevInfoVo devInfo); /** @@ -74,4 +76,6 @@ public interface IDevInfoService public Map sumType(); + + List selectDevInfoLists(DevInfoVo devInfo); } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java index d6b79c5..172133b 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java @@ -2,8 +2,11 @@ package com.bonus.zlpt.equip.service.impl; import java.util.*; import java.util.stream.Collectors; + +import com.bonus.zlpt.common.security.utils.SecurityUtils; import com.bonus.zlpt.equip.api.domain.DevInfo; import com.bonus.zlpt.equip.api.domain.SysFileInfo; +import com.bonus.zlpt.equip.api.domain.UserCollect; import com.bonus.zlpt.equip.api.domain.dto.InforMationDto; import com.bonus.zlpt.equip.api.domain.vo.DevInfoVo; import com.bonus.zlpt.common.core.domain.system.SysFile; @@ -11,6 +14,7 @@ import com.bonus.zlpt.common.core.utils.DateUtils; import com.bonus.zlpt.equip.api.enums.MaStatusEnum; import com.bonus.zlpt.system.api.domain.BaseAddress; import com.bonus.zlpt.system.api.domain.SysDic; +import com.bonus.zlpt.system.api.model.LoginUser; import org.springframework.beans.BeanUtils; import com.bonus.zlpt.equip.mapper.SysFileInfoMapper; import org.springframework.stereotype.Service; @@ -51,6 +55,8 @@ public class DevInfoServiceImpl implements IDevInfoService public DevInfoVo selectDevInfoByMaId(Long maId) { DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(maId); + //更新搜索量 + devInfoMapper.updateHotSearchByMaId(maId); try { List files = devInfoMapper.getFilesByMaId(maId); if (!CollectionUtils.isEmpty(files) && files.get(0) != null) { @@ -112,6 +118,47 @@ public class DevInfoServiceImpl implements IDevInfoService return list; } + /** + * 查询设备收藏列表 + * + * @param devInfo 设备信息 + * @return 设备信息 + */ + @Override + public List selectUserCollectList(DevInfoVo devInfo) + { + List result = new ArrayList<>(); + //simple way + result = devInfoMapper.selectDevInfoList(devInfo); + LoginUser user = SecurityUtils.getLoginUser(); + if (Objects.nonNull(user)) { + List userCollectList = devInfoMapper.selectUserCollectByUserId(user.getUserid()); + result = filterUserCollect(result, userCollectList); + } + //complex sql, it works +// LoginUser user = SecurityUtils.getLoginUser(); +// if (Objects.nonNull(user)) { +// devInfo.setUserId(user.getUserid()); +// result = devInfoMapper.selectDevInfoList4Collect(devInfo); +// } + fillInMaStatusStr(result); + fillInCityStr(result); + return result; + } + + private List filterUserCollect(List list, List userCollectList) { + List result = new ArrayList<>(); + for (DevInfoVo devInfoVo : list) { + for (UserCollect userCollect : userCollectList) { + if (devInfoVo.getMaId().longValue() == userCollect.getMaId().longValue()) { + result.add(devInfoVo); + } + } + } + return result; + } + + @Override public List selectDevInfoHotList(DevInfoVo devInfo) { @@ -158,15 +205,24 @@ public class DevInfoServiceImpl implements IDevInfoService @Override public int insertDevInfo(DevInfo devInfo) { - devInfo.setCreateTime(DateUtils.getNowDate()); + devInfo.setCreateTime(DateUtils.getDate()); + //获取用户信息 + Long userId = SecurityUtils.getUserId(); + //保存用户信息 + devInfo.setCreator(userId); + devInfo.setCode(String.valueOf(UUID.randomUUID())); + devInfoMapper.insertDevInfo(devInfo); + //把文件保存到附件中 List fileInfoList = devInfo.getFileList(); if (fileInfoList.size()>0){ for (SysFileInfo sysFileInfo: fileInfoList) { + sysFileInfo.setModelId(Math.toIntExact(devInfo.getMaId())); + sysFileInfo.setCreator(String.valueOf(userId)); sysFileInfoMapper.insertFileInfo(sysFileInfo); } } - return devInfoMapper.insertDevInfo(devInfo); + return 1; } /** @@ -242,4 +298,16 @@ public class DevInfoServiceImpl implements IDevInfoService } return sumTypeMap; } + + @Override + public List selectDevInfoLists(DevInfoVo devInfo) { + + List list = devInfoMapper.selectDevInfoLists(devInfo); + //获取设备的附件 + for (DevInfoVo devInfoVo: list) { + List fileInfoList = sysFileInfoMapper.selectByMaId(devInfoVo.getMaId()); + devInfoVo.setFileList(fileInfoList); + } + return list; + } } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoRecordServiceImpl.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoRecordServiceImpl.java index c562220..d0b511f 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoRecordServiceImpl.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoRecordServiceImpl.java @@ -56,7 +56,7 @@ public class TypeInfoRecordServiceImpl implements ITypeInfoRecordService @Override public int insertTypeInfoRecord(TypeInfoRecord typeInfoRecord) { - typeInfoRecord.setCreateTime(DateUtils.getNowDate()); + typeInfoRecord.setCreateTime(DateUtils.getDate()); return typeInfoRecordMapper.insertTypeInfoRecord(typeInfoRecord); } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java index 5e436ec..32f74bf 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java @@ -65,7 +65,7 @@ public class TypeInfoServiceImpl implements ITypeInfoService @Override public int insertTypeInfo(TypeInfo typeInfo) { - typeInfo.setCreateTime(DateUtils.getNowDate()); + typeInfo.setCreateTime(DateUtils.getDate()); return typeInfoMapper.insertTypeInfo(typeInfo); } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java index 0343a65..6c2d09e 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java @@ -5,11 +5,14 @@ import java.util.stream.Collectors; import com.bonus.zlpt.common.security.utils.SecurityUtils; +import com.bonus.zlpt.equip.api.domain.DevInfo; import com.bonus.zlpt.equip.api.domain.SysFileInfo; import com.bonus.zlpt.equip.api.domain.TypeInfo; import com.bonus.zlpt.equip.api.domain.UpOff; import com.bonus.zlpt.equip.api.domain.dto.UpOffDto; import com.bonus.zlpt.common.core.enums.FileDictEnum; +import com.bonus.zlpt.equip.api.enums.MaStatusEnum; +import com.bonus.zlpt.equip.mapper.DevInfoMapper; import com.bonus.zlpt.equip.api.enums.leaseScopeEnums; import com.bonus.zlpt.equip.mapper.SysFileInfoMapper; import com.bonus.zlpt.equip.mapper.TypeInfoMapper; @@ -40,6 +43,9 @@ public class UpOffServiceImpl implements IUpOffService @Resource private SysFileInfoMapper sysFileInfoMapper; + @Resource + private DevInfoMapper devInfoMapper; + /** * 查询设备上下架管理 @@ -86,7 +92,13 @@ public class UpOffServiceImpl implements IUpOffService for (int i = 0; i < upOffList.size(); i++) { UpOff UpOff = upOffList.get(i); UpOff.setApplyUser(name); + //新增一条上架数据 upOffMapper.insertUpOff(UpOff); + DevInfo devInfo = new DevInfo(); + devInfo.setMaId(UpOff.getMaId()); + devInfo.setMaStatus(String.valueOf(MaStatusEnum.PENDING_APPROVAL.getCode())); + //修改此时商品的状态 + devInfoMapper.updateDevInfo(devInfo); } return 1; } diff --git a/zlpt-modules/zlpt-equip/src/main/resources/mapper/DevInfoMapper.xml b/zlpt-modules/zlpt-equip/src/main/resources/mapper/DevInfoMapper.xml index a47baf2..d0c373a 100644 --- a/zlpt-modules/zlpt-equip/src/main/resources/mapper/DevInfoMapper.xml +++ b/zlpt-modules/zlpt-equip/src/main/resources/mapper/DevInfoMapper.xml @@ -48,18 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + insert into ma_dev_info - ma_id, - code, - type_id, - ma_status, - lease_scope, - location, - provinceId, - cityId, - areaId, - brand, - model_name, - production_date, - working_hours, - serial_number, - month_lease_price, - day_lease_price, - pic_url, - js_month_price, - js_day_price, - description, - gps_code, - own_co, - create_time, - creator, - update_time, - update_by, - specification, - deposit, - is_operator, - is_active, - update_time, - update_by, + ma_id, + code, + type_id, + ma_status, + lease_scope, + location, + province_id, + city_id, + area_id, + brand, + model_name, + production_date, + working_hours, + serial_number, + month_lease_price, + day_lease_price, + pic_url, + js_month_price, + js_day_price, + description, + gps_code, + own_co, + create_time, + creator, + update_time, + update_by, + specification, + deposit, + is_operator, + is_active, + update_time, + update_by, - #{maId}, - #{code}, - #{typeId}, - #{maStatus}, - #{leaseScope}, - #{location}, - #{provinceId}, - #{cityId}, - #{areaId}, - #{brand}, - #{modelName}, - #{productionDate}, - #{workingHours}, - #{serialNumber}, - #{monthLeasePrice}, - #{dayLeasePrice}, - #{picUrl}, - #{jsMonthPrice}, - #{jsDayPrice}, - #{description}, - #{gpsCode}, - #{ownCo}, - #{createTime}, - #{creator}, - #{update_time}, - #{update_by}, - #{specification}, - #{deposit}, - #{isOperator}, - #{isActive}, - #{updateTime}, - #{updateBy}, + #{maId}, + #{code}, + #{typeId}, + #{maStatus}, + #{leaseScope}, + #{location}, + #{provinceId}, + #{cityId}, + #{areaId}, + #{brand}, + #{modelName}, + #{productionDate}, + #{workingHours}, + #{serialNumber}, + #{monthLeasePrice}, + #{dayLeasePrice}, + #{picUrl}, + #{jsMonthPrice}, + #{jsDayPrice}, + #{description}, + #{gpsCode}, + #{ownCo}, + #{createTime}, + #{creator}, + #{update_time}, + #{update_by}, + #{specification}, + #{deposit}, + #{isOperator}, + #{isActive}, + #{updateTime}, + #{updateBy}, @@ -346,6 +403,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + update ma_hot_search + set search_num = search_num + 1 + where ma_id = #{maId} + + select name from base_address where status = 1 and id = #{id} + \ No newline at end of file diff --git a/zlpt-modules/zlpt-order/src/main/java/com/bonus/zlpt/order/service/impl/OrderInfoServiceImpl.java b/zlpt-modules/zlpt-order/src/main/java/com/bonus/zlpt/order/service/impl/OrderInfoServiceImpl.java index b73482a..bcc7c5c 100644 --- a/zlpt-modules/zlpt-order/src/main/java/com/bonus/zlpt/order/service/impl/OrderInfoServiceImpl.java +++ b/zlpt-modules/zlpt-order/src/main/java/com/bonus/zlpt/order/service/impl/OrderInfoServiceImpl.java @@ -14,6 +14,8 @@ import com.bonus.zlpt.order.mapper.OrderInfoMapper; import com.bonus.zlpt.common.core.domain.order.OrderInfo; import com.bonus.zlpt.order.service.IOrderInfoService; +import javax.annotation.Resource; + /** * 订单信息Service业务层处理 * @@ -24,9 +26,9 @@ import com.bonus.zlpt.order.service.IOrderInfoService; public class OrderInfoServiceImpl implements IOrderInfoService { private final Integer ORDER_ATTACHMENT_DIC_ID = 21; - @Autowired + @Resource private OrderInfoMapper orderInfoMapper; - @Autowired + @Resource OrderDetailsMapper orderDetailsMapper; /** @@ -62,8 +64,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService @Override public int insertOrderInfo(OrderInfoVo orderInfo) { - LoginUser user = SecurityUtils.getLoginUser(); - orderInfo.setOrderUser(user.getUserid()); + orderInfo.setOrderUser(SecurityUtils.getUserId()); orderInfoMapper.insertOrderInfo(orderInfo); Long orderId = orderInfoMapper.selectLastInsertId(); orderInfo.setOrderId(orderId);