Commit 1242133e authored by lizhichao's avatar lizhichao
parents c3831eff 388081d2
package com.zehong.web.controller.workPermit;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -20,6 +27,10 @@ import com.zehong.system.service.ITSpecialWorkPermitSignService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 【请填写功能名称】Controller
*
......@@ -68,6 +79,37 @@ public class TSpecialWorkPermitSignController extends BaseController
return AjaxResult.success(tSpecialWorkPermitSignService.selectTSpecialWorkPermitSignById(signId));
}
/**
* app添加
*/
//@PreAuthorize("@ss.hasPermi('system:sign:add')")
@Log(title = "批量添加", businessType = BusinessType.INSERT)
@PostMapping(value = "/insertAll")
public AjaxResult addAll(HttpServletRequest req, HttpServletResponse resp) throws Exception
{
StringBuffer sb = new StringBuffer() ;
InputStream is = req.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is,"utf-8"));
String s = "" ;
while((s=br.readLine())!=null){
sb.append(s) ;
}
if(sb.toString().length()<=0){
return toAjax(0);
}
Map<String,Object> map = (Map<String,Object>) JSON.parseObject(sb.toString());
int a = 0;
List<Map<String,Object>> list =(List<Map<String,Object>>) JSON.parse((String) map.get("signList"));
for(Map<String,Object> m : list){
TSpecialWorkPermitSign t = new TSpecialWorkPermitSign();
t.setPermitId(((Integer) m.get("permitId")).longValue());
t.setStaffId(((Integer) m.get("staffId")).longValue());
t.setStaffType((String) m.get("staffType"));
a = tSpecialWorkPermitSignService.insertTSpecialWorkPermitSign(t);
}
return toAjax(1);
}
/**
* 新增【请填写功能名称】
*/
......
......@@ -105,7 +105,7 @@ zehong:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: /home/zehong/uploadPath
profile: D:/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
......
......@@ -55,7 +55,7 @@ swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /dev-api
pathMapping:
# 防止XSS攻击
xss:
......
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