| | |
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.transaction.Transactional;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.FloatADMapper;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.exception.FloatADException;
|
| | | import com.yeshi.fanli.exception.homemodule.FloatADException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | |
| | | throw new FloatADException(1, "跳转参数非JSON格式");
|
| | | }
|
| | |
|
| | | FloatADTypeEnum typeEnum = record.getTypeEnum();
|
| | | if (typeEnum == null)
|
| | | throw new FloatADException(1, "类型不能为空");
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(jumpType)) {
|
| | | List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
|
| | | if (listByType !=null && listByType.size() > 0) {
|
| | |
| | | String picture = null;
|
| | | if (file != null) {
|
| | | picture = uploadPicture(file);
|
| | | }
|
| | | |
| | | // 适用类型 : 0通用 1新人
|
| | | Integer type = record.getType();
|
| | | if (type == null) {
|
| | | record.setType(0);
|
| | | }
|
| | |
|
| | | Long id = record.getId();
|
| | |
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | |
|
| | | // 文件路径
|
| | | String filePath="/img/FloatAD/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | String filePath= FilePathEnum.floatAD.getPath() +UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | // 执行上传
|
| | | String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void updateOrder(Long id, Integer moveType) throws FloatADException {
|
| | |
|
| | | if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
|
| | |
|
| | | List<FloatAD> listSwiper = floatADMapper.ListByPrimaryKey(list);
|
| | |
| | | }
|
| | |
|
| | | for (FloatAD floatAD : listQuery) {
|
| | | |
| | | FloatADTypeEnum typeEnum = floatAD.getTypeEnum();
|
| | | if (typeEnum != null) {
|
| | | floatAD.setTypeName(typeEnum.getDesc());
|
| | | }
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
| | | Date startTime = floatAD.getStartTime();
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public FloatAD getEffectiveFloatAD(String position) {
|
| | | FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position);
|
| | | public FloatAD getEffectiveFloatAD(String position, Integer type) {
|
| | | FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position, type);
|
| | | if (floatAD != null) {
|
| | | JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
|
| | |
|
| | |
| | | return floatAD;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<FloatAD> getValidCommonByPosition(String position) {
|
| | | return floatADMapper.getValidFloatAD(position, 1);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<FloatAD> getValidByPosition(String position) {
|
| | | return floatADMapper.getValidFloatAD(position, null);
|
| | | }
|
| | | }
|
| | |
|