Commit 8b859284 authored by 周健威's avatar 周健威

添加我的定制列表

parent 6f98fac1
......@@ -5,12 +5,15 @@ import com.github.wxiaoqi.security.common.context.BaseContextHandler;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.ReflectionUtils;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;
......@@ -87,5 +90,26 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return ObjectRestResponse.succ(baseBiz.selectList(entity));
}
@ApiOperation("删除")
@RequestMapping(value = "/del",method = RequestMethod.DELETE)
@ResponseBody
public ObjectRestResponse del( Entity entity){
Field field = ReflectionUtils.getAccessibleField(entity, "isDel");
Field field2 = ReflectionUtils.getAccessibleField(entity, "delete");
if(null != field) {
ReflectionUtils.setFieldValue(entity,"isDel",1);
}
if(null != field2) {
ReflectionUtils.setFieldValue(entity,"delete",1);
}
baseBiz.updateSelectiveById(entity);
return ObjectRestResponse.succ();
}
@Data
public static class BaseDetailDTO {
Integer id;
}
}
......@@ -35,7 +35,8 @@ public class GtdataController extends CommonBaseController {
public void queryAreaInfoByAreaId() throws Exception {
String url = request.getRequestURI();
String fileName = url.substring(url.lastIndexOf("/")+1);
String filePath = "/obt/thumbnail/"+ url.substring(url.lastIndexOf("/app/unauth/image/")+18);
String filePath = "https://box.bdimg.com/static/fisp_static/common/img/searchbox/logo_news_276_88_1f9876a.png";
// String filePath = "/obt/thumbnail/"+ url.substring(url.lastIndexOf("/app/unauth/image/")+18);
// String filePath = "/obt/thumbnail/data/VDM2/20200613/VDM2_20200525232637_0015_L1_MSS_CMOS5/VDM2_20200525232637_0015_L1_MSS_CMOS5_98_98.jpg";
// filePath = gtDataRestClient.openUrl(filePath);
downloadVideoById(fileName, filePath, getResponse());
......
......@@ -18,10 +18,13 @@ import lombok.Data;
@Table(name = "custom_form")
public class CustomForm implements Serializable {
private static final long serialVersionUID = 1L;
public static final int STATUS_SUBMIT = 1;
public static final int STATUS_ORDER = 2;
/**
*
*/
/**
*
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("")
......@@ -230,4 +233,11 @@ public class CustomForm implements Serializable {
@Column(name = "user_id")
@ApiModelProperty(value = "用户id")
private Integer userId;
/**
* 状态 1--已提交;2--已转订单
*/
@Column(name = "status")
@ApiModelProperty(value = "状态 1--已提交;2--已转订单")
private Integer status;
}
......@@ -3,19 +3,24 @@ package com.upyuns.platform.rs.website.controller.web;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.AssertUtils;
import com.github.wxiaoqi.security.common.util.ReflectionUtils;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.github.wxiaoqi.security.common.vo.PageParam;
import com.upyuns.platform.rs.datacenter.fegin.DatacenterFeign;
import com.upyuns.platform.rs.website.biz.CustomFormBiz;
import com.upyuns.platform.rs.website.entity.CustomForm;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
@RestController
......@@ -91,5 +96,16 @@ public class CustomFormWebController extends BaseController<CustomFormBiz,Custom
}, " crt_time desc")));
}
@ApiOperation("删除")
@RequestMapping(value = "/delCustom",method = RequestMethod.DELETE)
@ResponseBody
public ObjectRestResponse delCustom( CustomForm entity){
CustomForm db = baseBiz.selectById(entity.getId());
if(CustomForm.STATUS_SUBMIT != db.getStatus()) {
throw new BaseException("该定制不能删除", ResultCode.PARAM_ILLEGAL_CODE);
}
baseBiz.updateSelectiveById(entity);
return ObjectRestResponse.succ();
}
}
\ 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