图片单独上传相关接口

pet-图片单独上传接口-2024.8.28-徐绎丰
water_xu 2024-08-28 19:01:22 +08:00
parent 4c6aa7d8ff
commit 6bc2d02cae
7 changed files with 865 additions and 10 deletions

View File

@ -797,6 +797,76 @@ public class AppGFBlindBoardController extends BaseController {
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptStatus")
@ResponseBody
@Transactional
public Object suEditAcceptStatus(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFblindboardService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
PageData log = new PageData();
log.put("BLINDBOARDLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("BLINDBOARD_ID", pd.get("BLINDBOARD_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
switch (status) {
case "6"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("BLINDBOARD_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"),pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES);
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFblindboardService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
this.switchMessages(pd.get("APPLY_STATUS").toString(),pd2);
break;
case "-6"://验收人打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFblindboardService.edit(pd2);
// 发短信
this.switchMessages(pd.get("APPLY_STATUS").toString(),pd2);
break;
default:
break;
}
GFblindBoardLogService.save(log);
map.put("result", errInfo);
return map;
}
private void saveAcceptImg(MultipartFile[] files,String signertime, String BLINDBOARD_ID, String CORPINFO_ID, String ACCEPT_USER_ID, String ACCEPT_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
@ -1172,6 +1242,39 @@ public class AppGFBlindBoardController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptconfess")
@ResponseBody
@Transactional
public Object suEditAcceptconfess(
MultipartRequest request
) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFblindboardService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("BLINDBOARD_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
map.put("result", errInfo);
return map;
}
private void saveImg(MultipartFile[] files,String signertime, String BLINDBOARD_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {

View File

@ -256,6 +256,36 @@ public class AppGFBreakGroundController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptconfess")
@ResponseBody
@Transactional
public Object suEditAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFbreakGroundService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("BREAKGROUND_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
map.put("result", errInfo);
return map;
}
private void saveImg(MultipartFile[] files,String signertime, String BREAKGROUND_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
@ -487,6 +517,80 @@ public class AppGFBreakGroundController extends BaseController {
log.put("ACTION", "验收通过");
// 发短信
this.switchMessages(pd.get("APPLY_STATUS").toString(),pd2);
break;
case "-6"://审批打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFbreakGroundService.edit(pd2);
// 发短信
this.switchMessages(pd.get("APPLY_STATUS").toString(),pd2);
break;
default:
break;
}
GFbreakGroundLogService.save(log);
this.sendNotice(pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptStatus")
@ResponseBody
@Transactional
public Object suEditAcceptStatus(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFbreakGroundService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
PageData log = new PageData();
log.put("BREAKGROUNDLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("BREAKGROUND_ID", pd.get("BREAKGROUND_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
String HAZARD_IDENTIFICATION = (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") +
(StringUtils.isNotBlank(pd.getString("HAZARD_IDENTIFICATION")) ? (pd.getString("HAZARD_IDENTIFICATION") + ";_;") : ";_;");
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
pd2.put("HAZARD_IDENTIFICATION", "");
switch (status) {
case "6"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("BREAKGROUND_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"),pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES);
pd2.put("HAZARD_IDENTIFICATION", HAZARD_IDENTIFICATION);
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFbreakGroundService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
this.switchMessages(pd.get("APPLY_STATUS").toString(),pd2);
break;

View File

@ -735,6 +735,37 @@ public class AppGFConfinedSpaceController extends BaseController {
map.put("result", errInfo);
return map;
}
/**()
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptconfess")
@ResponseBody
@Transactional
public Object suEditAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFconfinedspaceService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("CONFINEDSPACE_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
map.put("result", errInfo);
return map;
}
private void saveImg(MultipartFile[] files,String signertime, String CONFINEDSPACE_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
@ -868,6 +899,115 @@ public class AppGFConfinedSpaceController extends BaseController {
map.put("result", errInfo);
return map;
}
@RequestMapping(value="/singleUpload/editAcceptStatus")
@ResponseBody
@Transactional
public Object suEditAcceptStatus(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFconfinedspaceService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
PageData log = new PageData();
log.put("CONFINEDSPACELOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("CONFINEDSPACE_ID", pd.get("CONFINEDSPACE_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
if ("2".equals(status) || "3".equals(status) || "4".equals(status) || "5".equals(status)) {
pd2.put("OTHER_PROTECTIVE_MEASURES", (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"));
} else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status) || "-6".equals(status)) {
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
}
switch (status) {
case "6"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("CONFINEDSPACE_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"),pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFconfinedspaceService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid
mes.put("templateCode", "YX_Y06");// 短信模板编码
mes.put("SMSCode", "SMS_227250920");// 短信模板编码
mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "type");// 存入短信模板中的参数名称
params2.put("value", "有限空间作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
break;
case "-6"://验收人打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFconfinedspaceService.edit(pd2);
// 发短信
PageData mes4 = new PageData();
mes4.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid
mes4.put("templateCode", "YX_N06");// 短信模板编码
mes4.put("SMSCode", "SMS_223580715");// 短信模板编码
mes4.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList4 = new ArrayList<PageData>();
// 第1个参数
PageData params13 = new PageData();
params13.put("name", "params1");// 存入短信模板中的参数名称
params13.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList4.add(params13);
// 第2个参数
PageData params14 = new PageData();
params14.put("name", "params2");// 存入短信模板中的参数名称
params14.put("value", "有限空间作业");// 存入上面参数名称所传递的值
paramsList4.add(params14);
// 第3个参数
PageData params15 = new PageData();
params15.put("name", "params3");// 存入短信模板中的参数名称
params15.put("value", "验收人");// 存入上面参数名称所传递的值
paramsList4.add(params15);
sendMessageUtil.sendMessages(mes4, paramsList4);
break;
default:
break;
}
GFconfinedspaceLogService.save(log);
this.sendNotice(pd);
map.put("result", errInfo);
return map;
}
private void saveAcceptImg(MultipartFile[] files,String signertime, String CONFINEDSPACE_ID, String CORPINFO_ID, String ACCEPT_USER_ID, String ACCEPT_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {

View File

@ -613,6 +613,35 @@ public class AppGFCutRoadController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptconfess")
@ResponseBody
@Transactional
public Object suEditAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFcutRoadService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("CUTROAD_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
map.put("result", errInfo);
return map;
}
private void saveImg(MultipartFile[] files,String signertime, String CUTROAD_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
@ -714,6 +743,80 @@ public class AppGFCutRoadController extends BaseController {
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptStatus")
@ResponseBody
@Transactional
public Object suEditAcceptStatus(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFcutRoadService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
PageData log = new PageData();
log.put("CUTROADLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("CUTROAD_ID", pd.get("CUTROAD_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
// String HAZARD_IDENTIFICATION = (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") +
// (StringUtils.isNotBlank(pd.getString("HAZARD_IDENTIFICATION")) ? (pd.getString("HAZARD_IDENTIFICATION") + ";_;") : ";_;");
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
// pd2.put("HAZARD_IDENTIFICATION", "");
switch (status) {
case "6"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("BREAKGROUND_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"),pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES);
// pd2.put("HAZARD_IDENTIFICATION", HAZARD_IDENTIFICATION);
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFcutRoadService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
this.switchMessages(pd.get("APPLY_STATUS").toString(),pd2);
break;
case "-6"://审批打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFcutRoadService.edit(pd2);
// 发短信
this.switchMessages(pd.get("APPLY_STATUS").toString(),pd2);
break;
default:
break;
}
GFcutRoadLogService.save(log);
map.put("result", errInfo);
return map;
}
private void saveAcceptImg(MultipartFile[] files,String signertime, String BREAKGROUND_ID, String CORPINFO_ID, String ACCEPT_USER_ID, String ACCEPT_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {

View File

@ -554,6 +554,35 @@ public class AppGFElectricityController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptconfess")
@ResponseBody
@Transactional
public Object suEditAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFelectricityService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("ELECTRICITY_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
map.put("result", errInfo);
return map;
}
private void saveImg(MultipartFile[] files,String signertime, String ELECTRICITY_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
@ -693,6 +722,119 @@ public class AppGFElectricityController extends BaseController {
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptStatus")
@ResponseBody
@Transactional
public Object suEditAcceptStatus(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFelectricityService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
PageData log = new PageData();
log.put("ELECTRICITYLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
if ("2".equals(status) || "3".equals(status) || "4".equals(status)) {
String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
pd.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES);
pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES);
} else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status)) {
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
}
switch (status) {
case "5"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("ELECTRICITY_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"),pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFelectricityService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid
mes.put("templateCode", "YD_Y05");// 短信模板编码
mes.put("SMSCode", "SMS_227250920");// 短信模板编码
mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "type");// 存入短信模板中的参数名称
params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
break;
case "-5"://验收打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFelectricityService.edit(pd2);
PageData mes3 = new PageData();
mes3.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid
mes3.put("templateCode", "YD_N05");// 短信模板编码
mes3.put("SMSCode", "SMS_223580715");// 短信模板编码
mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList3 = new ArrayList<PageData>();
// 第1个参数
PageData paramsc1 = new PageData();
paramsc1.put("name", "params1");// 存入短信模板中的参数名称
paramsc1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList3.add(paramsc1);
// 第2个参数
PageData paramsc2 = new PageData();
paramsc2.put("name", "params2");// 存入短信模板中的参数名称
paramsc2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值
paramsList3.add(paramsc2);
// 第3个参数
PageData paramsc3 = new PageData();
paramsc3.put("name", "params3");// 存入短信模板中的参数名称
paramsc3.put("value", "验收");// 存入上面参数名称所传递的值
paramsList3.add(paramsc3);
sendMessageUtil.sendMessages(mes3, paramsList3);
break;
default:
break;
}
GFelectricityLogService.save(log);
map.put("result", errInfo);
return map;
}
private void saveAcceptImg(MultipartFile[] files,String signertime, String ELECTRICITY_ID, String CORPINFO_ID, String ACCEPT_USER_ID, String ACCEPT_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {

View File

@ -542,10 +542,10 @@ public class AppGFHighWorkController extends BaseController {
* @param
* @throws Exception
*/
@RequestMapping(value="/editAcceptconfess")
@RequestMapping(value="/singleUpload/editAcceptconfess")
@ResponseBody
@Transactional
public Object editAcceptconfess(MultipartRequest request) throws Exception {
public Object suEditAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
@ -556,15 +556,14 @@ public class AppGFHighWorkController extends BaseController {
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME[] = pd.getString("SIGNTIME").split(",");
String SIGNTIME = pd.getString("SIGNTIME");
for (int i = 0; i < SIGNTIME.length; i++) {
signertime = SIGNTIME[i];
fileList.add(request.getFile("file"+i));
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("HIGHWORK_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
}
map.put("result", errInfo);
return map;
}
@ -681,6 +680,126 @@ public class AppGFHighWorkController extends BaseController {
GFhighworkService.edit(pd2);
// 发短信
PageData mes3 = new PageData();
mes3.put("RECEIVER_ID", pd2.get("CREATOR"));// 收信人userid
mes3.put("templateCode", "GK_N06");// 短信模板编码
mes3.put("SMSCode", "SMS_223580715");// 短信模板编码
mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList3 = new ArrayList<PageData>();
// 第1个参数
PageData params10 = new PageData();
params10.put("name", "params1");// 存入短信模板中的参数名称
params10.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList3.add(params10);
// 第2个参数
PageData params11 = new PageData();
params11.put("name", "params2");// 存入短信模板中的参数名称
params11.put("value", "高空作业");// 存入上面参数名称所传递的值
paramsList3.add(params11);
// 第3个参数
PageData params12 = new PageData();
params12.put("name", "params3");// 存入短信模板中的参数名称
params12.put("value", "验收人");// 存入上面参数名称所传递的值
paramsList3.add(params12);
sendMessageUtil.sendMessages(mes3, paramsList3);
break;
default:
break;
}
GFhighWorkLogService.save(log);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptStatus")
@ResponseBody
@Transactional
public Object suEditAcceptStatus(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFhighworkService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
// pd2.put("OTHER_PROTECTIVE_MEASURES", pd.get("OTHER_PROTECTIVE_MEASURES")); //修改人
// pd2.put("HAZARD_IDENTIFICATION", pd.get("HAZARD_IDENTIFICATION")); //修改人
PageData log = new PageData();
log.put("HIGHWORKLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("HIGHWORK_ID", pd.get("HIGHWORK_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
String OTHER_PROTECTIVE_MEASURES = pd2.getString("OTHER_PROTECTIVE_MEASURES");
if ("2".equals(status) || "3".equals(status) || "4".equals(status) || "5".equals(status)) {
OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
// pd2.put("OTHER_PROTECTIVE_MEASURES", (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
// (StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;"));
// pd2.put("HAZARD_IDENTIFICATION", (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") +
// (StringUtils.isNotBlank(pd.getString("HAZARD_IDENTIFICATION")) ? (pd.getString("HAZARD_IDENTIFICATION") + ";_;") : ";_;"));
} else if ("-2".equals(status) || "-3".equals(status) || "-4".equals(status) || "-5".equals(status) || "-6".equals(status)) {
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
// pd2.put("HAZARD_IDENTIFICATION", "");
}
switch (status) {
case "6"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("HIGHWORK_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"),pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES);
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFhighworkService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd2.get("CREATOR"));// 收信人userid
mes.put("templateCode", "GK_Y06");// 短信模板编码
mes.put("SMSCode", "SMS_227250920");// 短信模板编码
mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "type");// 存入短信模板中的参数名称
params2.put("value", "高空作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
break;
case "-6"://验收人打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFhighworkService.edit(pd2);
// 发短信
PageData mes3 = new PageData();
mes3.put("RECEIVER_ID", pd2.get("CREATOR"));// 收信人userid

View File

@ -519,6 +519,35 @@ public class AppGFHoistingController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptconfess")
@ResponseBody
@Transactional
public Object suEditAcceptconfess(MultipartRequest request) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFhoistingService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveImg(fileList.toArray(fileArr),signertime,pd.getString("HOISTING_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_CONFESS_USER_ID"),pd.getString("ACCEPT_CONFESS_DEPARTMENT_ID"));
fileList.clear();
map.put("result", errInfo);
return map;
}
private void saveImg(MultipartFile[] files,String signertime, String HOISTING_ID, String CORPINFO_ID, String ACCEPT_CONFESS_USER_ID, String ACCEPT_CONFESS_DEPARTMENT_ID) throws Exception{
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
@ -622,6 +651,121 @@ public class AppGFHoistingController extends BaseController {
break;
case "-6"://审批打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
GFhoistingService.edit(pd2);
// 发短信
PageData mes3 = new PageData();
mes3.put("RECEIVER_ID", pd2.get("CREATOR"));// 收信人userid
mes3.put("templateCode", "DZ_N06");// 短信模板编码
mes3.put("SMSCode", "SMS_223580715");// 短信模板编码
mes3.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList3 = new ArrayList<PageData>();
// 第1个参数
PageData params10 = new PageData();
params10.put("name", "params1");// 存入短信模板中的参数名称
params10.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList3.add(params10);
// 第2个参数
PageData params11 = new PageData();
params11.put("name", "params2");// 存入短信模板中的参数名称
params11.put("value", "吊装作业");// 存入上面参数名称所传递的值
paramsList3.add(params11);
// 第3个参数
PageData params12 = new PageData();
params12.put("name", "params3");// 存入短信模板中的参数名称
params12.put("value", "验收");// 存入上面参数名称所传递的值
paramsList3.add(params12);
sendMessageUtil.sendMessages(mes3, paramsList3);
break;
default:
break;
}
GFhighWorkLogService.save(log);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/singleUpload/editAcceptStatus")
@ResponseBody
@Transactional
public Object suEditAcceptStatus(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData pd2 = new PageData();
pd2 = GFhoistingService.findById(pd);
pd2.put("OPERATOR", pd.get("OPERATOR")); //修改人
pd2.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
// pd2.put("OTHER_PROTECTIVE_MEASURES", pd.get("OTHER_PROTECTIVE_MEASURES")); //修改人
// pd2.put("HAZARD_IDENTIFICATION", pd.get("HAZARD_IDENTIFICATION")); //修改人
PageData log = new PageData();
log.put("HOISTINGLOG_ID", this.get32UUID());
// log.put("ACTION", "审核打回");
log.put("HOISTING_ID", pd.get("HOISTING_ID"));
log.put("CREATOR",pd.get("ACTION_USER"));
log.put("CREATTIME", DateUtil.date2Str(new Date()));
String status = pd.get("STATUS").toString();
String OTHER_PROTECTIVE_MEASURES = (StringUtils.isNotBlank(pd2.getString("OTHER_PROTECTIVE_MEASURES")) ? pd2.getString("OTHER_PROTECTIVE_MEASURES") : "") +
(StringUtils.isNotBlank(pd.getString("OTHER_PROTECTIVE_MEASURES")) ? (pd.getString("OTHER_PROTECTIVE_MEASURES") + ";_;") : ";_;");
// String HAZARD_IDENTIFICATION = (StringUtils.isNotBlank(pd2.getString("HAZARD_IDENTIFICATION")) ? pd2.getString("HAZARD_IDENTIFICATION") : "") +
// (StringUtils.isNotBlank(pd.getString("HAZARD_IDENTIFICATION")) ? (pd.getString("HAZARD_IDENTIFICATION") + ";_;") : ";_;");
//打回清空数据
pd2.put("OTHER_PROTECTIVE_MEASURES", "");
// pd2.put("HAZARD_IDENTIFICATION", "");
switch (status) {
case "6"://验收人
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String signertime = "";
String SIGNTIME = pd.getString("SIGNTIME");
signertime = SIGNTIME;
fileList.add(request.getFile("file"));
MultipartFile[] fileArr = new MultipartFile[fileList.size()];
saveAcceptImg(fileList.toArray(fileArr),signertime,pd.getString("HOISTING_ID"),pd.getString("CORPINFO_ID"),pd.getString("ACCEPT_USER_ID"),pd.getString("ACCEPT_DEPARTMENT_ID"));
fileList.clear();
pd2.put("ACCEPT_CONTENT", pd.get("CONTENT"));
pd2.put("OTHER_PROTECTIVE_MEASURES", OTHER_PROTECTIVE_MEASURES);
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
GFhoistingService.edit(pd2);
log.put("ACTION", "验收通过");
// 发短信
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd2.get("CREATOR"));// 收信人userid
mes.put("templateCode", "DZ_Y06");// 短信模板编码
mes.put("SMSCode", "SMS_227250920");// 短信模板编码
mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "type");// 存入短信模板中的参数名称
params2.put("value", "吊装作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
break;
case "-6"://审批打回
log.put("ACTION", "验收人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));