|
@@ -2,14 +2,19 @@ package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.entity.MaterialImageInfo;
|
|
|
import cn.com.ctop.common.module.service.IMaterialImageInfoService;
|
|
|
+import cn.com.ctop.common.module.utils.Check;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
@@ -27,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
|
+import java.sql.Date;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -111,6 +117,45 @@ public class MaterialImageInfoController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @AutoLog(value = "素材-编辑")
|
|
|
+ @ApiOperation(value = "素材-编辑", notes = "素材-编辑")
|
|
|
+ @PutMapping(value = "/batchEdit")
|
|
|
+ public Result<MaterialImageInfo> batchEdit(@RequestBody JSONArray updateArr) {
|
|
|
+ Result<MaterialImageInfo> result = new Result<MaterialImageInfo>();
|
|
|
+ try {
|
|
|
+ if (!Check.isNull(updateArr)) {
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject()
|
|
|
+ .getPrincipal();
|
|
|
+ for (int i = 0; i < updateArr.size(); i++) {
|
|
|
+ JSONObject updateJson = updateArr.getJSONObject(i);
|
|
|
+ if (!Check.isNull(updateJson)) {
|
|
|
+ MaterialImageInfo materialImageInfo = new MaterialImageInfo();
|
|
|
+
|
|
|
+ Long id = updateJson.getLong("id");
|
|
|
+ materialImageInfo.setId(id);
|
|
|
+ Integer status = updateJson.getInteger("status");
|
|
|
+ materialImageInfo.setStatus(status);
|
|
|
+ if (status == 2) {
|
|
|
+ materialImageInfo.setRefuseReason(updateJson.getString("refuseReason"));
|
|
|
+ }
|
|
|
+ materialImageInfo.setAuditorId(user.getId());
|
|
|
+ MaterialImageInfoService.updateById(materialImageInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.success("修改成功!");
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ result.setSuccess(false);
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 通过id删除
|
|
|
*
|