You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1166 lines
34 KiB
1166 lines
34 KiB
package com.gaotao.modules.base.controller;
|
|
|
|
import com.gaotao.modules.base.entity.*;
|
|
import com.gaotao.modules.base.service.BaseService;
|
|
import com.gaotao.modules.pda.utils.ResponseData;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.transaction.TransactionSystemException;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
*
|
|
* @ClassName: BaseController
|
|
* @Description: 基础功能controller
|
|
* @author rq
|
|
* @date 2021年9月25日
|
|
*
|
|
*/
|
|
@Controller
|
|
@RequestMapping(value="/base")
|
|
public class BaseController {
|
|
@Autowired
|
|
private BaseService baseService;
|
|
|
|
/**
|
|
* 获取工厂日历
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getCalendarData")
|
|
@ResponseBody
|
|
public Object getCalendarData(@RequestBody CalendarData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<CalendarData> result = baseService.getCalendarData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 查询工作类型
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping("/calendarDatetypeInfo")
|
|
@ResponseBody
|
|
public Object shiftInfoJson(@RequestBody CalendarData calendarData){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<CalendarDatetypeOutData> list = baseService.getCalendarDatetypeData(calendarData.getSite());
|
|
map.put("rows", list);
|
|
map.put("total", list.size());
|
|
} catch (Exception e) {
|
|
map.put("msg", e.getMessage());
|
|
map.put("code", "500");
|
|
}
|
|
return map;
|
|
}
|
|
/**
|
|
* 保存工厂日历
|
|
* @param inData
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/saveCalendar")
|
|
@ResponseBody
|
|
public Object saveCalendar(@RequestBody CalendarData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
// UserOutData userOutData = (UserOutData) session.getAttribute("user");
|
|
try {
|
|
// responseData = baseService.maintainCalendar(inData, userOutData.getSite(), userOutData.getUsername());
|
|
responseData = baseService.maintainCalendar(inData);
|
|
} catch (Exception e) {
|
|
if (e instanceof TransactionSystemException) {
|
|
responseData.setCode("300");
|
|
responseData.setMsg("数据已被修改,请更新数据!");
|
|
}else{
|
|
responseData.setCode("400");
|
|
responseData.setMsg(e.getMessage());
|
|
}
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* 删除工厂日历
|
|
* @param
|
|
* @author rq
|
|
* @return
|
|
*/
|
|
@PostMapping("/delCalendar")
|
|
@ResponseBody
|
|
public Object delCalendar(@RequestBody CalendarData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.delCalendar(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* 获取已经安排的工作日历
|
|
* @param
|
|
* @param
|
|
*/
|
|
@PostMapping(value="/getCalendarExceptionData")
|
|
@ResponseBody
|
|
public Object getCalendarExceptionData(@RequestBody CalendarData inData){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<CalendarExceptionData> result = baseService.getCalendarExceptionData(inData);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 维护班次信息
|
|
* @param inData
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/saveShift")
|
|
@ResponseBody
|
|
public Object saveShift(@RequestBody CalendarDatetypeShiftData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
// UserOutData userOutData = (UserOutData) session.getAttribute("user");
|
|
try {
|
|
responseData = baseService.maintainShift(inData);
|
|
} catch (Exception e) {
|
|
if (e instanceof TransactionSystemException) {
|
|
responseData.setCode("300");
|
|
responseData.setMsg("数据已被修改,请更新数据!");
|
|
}else{
|
|
responseData.setCode("400");
|
|
responseData.setMsg(e.getMessage());
|
|
}
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* 编辑班次信息
|
|
* @param inData
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/updateShift")
|
|
@ResponseBody
|
|
public Object updateShift(@RequestBody CalendarDatetypeShiftData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
// UserOutData userOutData = (UserOutData) session.getAttribute("user");
|
|
try {
|
|
responseData = baseService.updateShift(inData);
|
|
} catch (Exception e) {
|
|
if (e instanceof TransactionSystemException) {
|
|
responseData.setCode("300");
|
|
responseData.setMsg("数据已被修改,请更新数据!");
|
|
}else{
|
|
responseData.setCode("400");
|
|
responseData.setMsg(e.getMessage());
|
|
}
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* 获取班次信息
|
|
* @param
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getShiftData")
|
|
@ResponseBody
|
|
public Object getCDatatypeShiftData(@RequestBody CalendarDatetypeData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<CalendarDatetypeShiftOutData> result = baseService.getShiftData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
/**
|
|
* 维护工作类型
|
|
* @param indata
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping("/saveCalendarDatetypeData")
|
|
@ResponseBody
|
|
public Object saveCalendarDatetypeData(@RequestBody CalendarDatetypeData indata){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveCalendarDatetypeData(indata);
|
|
} catch (Exception e) {
|
|
if ( e instanceof TransactionSystemException) {
|
|
responseData.setCode("300");
|
|
responseData.setMsg("数据已被修改,请更新数据!");
|
|
}else{
|
|
responseData.setCode("400");
|
|
responseData.setMsg(e.getMessage());
|
|
}
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* 删除工厂日历类型
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping("/delCalendarType")
|
|
@ResponseBody
|
|
public Object delCalendarType(@RequestBody CalendarDatetypeData indata){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.delCalendarType(indata);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* 维护日历班次信息
|
|
* @param indata
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping("/batchSaveCDData")
|
|
@ResponseBody
|
|
public Object batchSaveCDData(@RequestBody BatchCDListVO indata){
|
|
ResponseData responseData = new ResponseData();
|
|
// UserOutData userOutData = (UserOutData) session.getAttribute("user");
|
|
try {
|
|
responseData = baseService.batchSaveCDData(indata);
|
|
} catch (Exception e) {
|
|
responseData.setCode("400");
|
|
responseData.setMsg(e.getMessage());
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* 单个维护已安排的日历
|
|
* @param site
|
|
* @param calendarId
|
|
* @param scheduledate
|
|
* @param dataType
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping("/saveCDData")
|
|
@ResponseBody
|
|
public Object saveCDData(String site,String calendarId,String scheduledate,String dataType,String userName){
|
|
ResponseData responseData = new ResponseData();
|
|
// UserOutData userOutData = (UserOutData) session.getAttribute("user");
|
|
try {
|
|
responseData = baseService.saveCDData(site,calendarId,scheduledate,dataType,userName);
|
|
} catch (Exception e) {
|
|
if (e instanceof TransactionSystemException) {
|
|
responseData.setCode("300");
|
|
responseData.setMsg("数据已被修改,请更新数据!");
|
|
}else{
|
|
responseData.setCode("400");
|
|
responseData.setMsg(e.getMessage());
|
|
}
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* @Description 获取下拉框排班
|
|
* @Title getCDatatypeShiftData
|
|
* @param site
|
|
* @author rq
|
|
* @date 2021/3/16 17:32
|
|
* @return
|
|
* @throw
|
|
*/
|
|
|
|
@PostMapping(value="/getAllShiftData")
|
|
@ResponseBody
|
|
public Object getCDatatypeShiftData(String site){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<CalendarDatetypeShiftData> result = baseService.getAllShiftData(site);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* @Title delShift
|
|
* @Description 删除班次
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/delShift")
|
|
@ResponseBody
|
|
public Object delShift(@RequestBody CalendarDatetypeShiftData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.delShift(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title getShiftNo
|
|
* @Description 获取班次编码
|
|
* @author rq
|
|
* @date 2021/4/16 14:55
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping(value="/getShiftNo")
|
|
@ResponseBody
|
|
public Object getShiftNo(String site){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
String result = baseService.getShiftNo();
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
//----------工厂信息--------------------------
|
|
/**
|
|
* 获取工厂日历
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getSiteData")
|
|
@ResponseBody
|
|
public Object getSiteData(@RequestBody SiteData inData){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<SiteData> result = baseService.getSiteData(inData);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 获取会计企业
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getCompanyData")
|
|
@ResponseBody
|
|
public Object getCompanyData(){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<CompanyData> result = baseService.getCompanyData();
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* @Title siteSave
|
|
* @Description 保存工厂
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/siteSave")
|
|
@ResponseBody
|
|
public Object siteSave(@RequestBody SiteData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.siteSave(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
//----------物料分类--------------------------
|
|
/**
|
|
* 获取物料分类
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getPartFamily")
|
|
@ResponseBody
|
|
public Object getPartFamily(@RequestBody PartFamilyData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<PartFamilyData> result = baseService.getPartFamily(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
|
|
/**
|
|
* @Title siteSave
|
|
* @Description 保存物料分类
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/savePartFamily")
|
|
@ResponseBody
|
|
public Object savePartFamily(@RequestBody PartFamilyData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.savePartFamily(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title deletePartFamily
|
|
* @Description 删除物料分类
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/deletePartFamily")
|
|
@ResponseBody
|
|
public Object deletePartFamily(@RequestBody PartFamilyData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deletePartFamily(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
//----------计量单位--------------------------
|
|
/**
|
|
* 获取计量单位
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getUMData")
|
|
@ResponseBody
|
|
public Object getUMData(@RequestBody UmData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<UmData> result = baseService.getUMData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
|
|
/**
|
|
* @Title saveUMData
|
|
* @Description 保存修改计量单位
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/saveUMData")
|
|
@ResponseBody
|
|
public Object saveUMData(@RequestBody UmData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveUMData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title deleteUMData
|
|
* @Description 删除计量单位
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/deleteUMData")
|
|
@ResponseBody
|
|
public Object deleteUMData(@RequestBody UmData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deleteUMData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
//=============查询-物料编码===================
|
|
/**
|
|
* 获取计量单位
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/searchPartNoData")
|
|
@ResponseBody
|
|
public Object searchPartNoData(@RequestBody PartData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<PartData> result = baseService.searchPartNoData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
//----------计量单位--------------------------
|
|
/**
|
|
* 获取停机原因
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getShutDownReasonData")
|
|
@ResponseBody
|
|
public Object getShutDownReasonData(@RequestBody DowntimeReasonData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<DowntimeReasonData> result = baseService.getShutDownReasonData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
|
|
/**
|
|
* @Title saveShutDownReasonData
|
|
* @Description 保存修改停机原因
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/saveShutDownReasonData")
|
|
@ResponseBody
|
|
public Object saveShutDownReasonData(@RequestBody DowntimeReasonData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveShutDownReasonData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title deleteShutDownReasonData
|
|
* @Description 删除停机原因
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/deleteShutDownReasonData")
|
|
@ResponseBody
|
|
public Object deleteShutDownReasonData(@RequestBody DowntimeReasonData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deleteShutDownReasonData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
|
|
//----------物料参照信息--------------------------
|
|
/**
|
|
* 获取物料参照信息
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getReferencePartInfoData")
|
|
@ResponseBody
|
|
public Object getReferencePartInfoData(@RequestBody ReferencePartInfoData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<ReferencePartInfoData> result = baseService.getReferencePartInfoData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
|
|
/**
|
|
* @Title saveReferencePartInfoData
|
|
* @Description 保存修改物料参照信息
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/saveReferencePartInfoData")
|
|
@ResponseBody
|
|
public Object saveReferencePartInfoData(@RequestBody ReferencePartInfoData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveReferencePartInfoData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title deleteReferencePartInfoData
|
|
* @Description 删除物料参照信息
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/deleteReferencePartInfoData")
|
|
@ResponseBody
|
|
public Object deleteReferencePartInfoData(@RequestBody ReferencePartInfoData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deleteReferencePartInfoData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* 获取物料信息
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getPartNoDetail")
|
|
@ResponseBody
|
|
public Object getPartNoDetail(@RequestBody PartData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<PartData> result = baseService.getPartNoDetail(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 获取供应商信息
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getSupplierDetail")
|
|
@ResponseBody
|
|
public Object getSupplierDetail(@RequestBody SupplierData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<SupplierData> result = baseService.getSupplierDetail(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
//----------生产线--------------------------
|
|
/**
|
|
* 获取生产线
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getProductionLineData")
|
|
@ResponseBody
|
|
public Object getProductionLineData(@RequestBody ProductionLineData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<ProductionLineData> result = baseService.getProductionLineData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
|
|
/**
|
|
* @Title saveProductionLineData
|
|
* @Description 保存生产线
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/saveProductionLineData")
|
|
@ResponseBody
|
|
public Object saveProductionLineData(@RequestBody ProductionLineData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveProductionLineData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title deleteProductionLineData
|
|
* @Description 删除生产线
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/deleteProductionLineData")
|
|
@ResponseBody
|
|
public Object deleteProductionLineData(@RequestBody ProductionLineData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deleteProductionLineData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
//----------加工中心--------------------------
|
|
/**
|
|
* 获取加工中心
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getWorkCenterData")
|
|
@ResponseBody
|
|
public Object getWorkCenterData(@RequestBody WorkCenterData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<WorkCenterData> result = baseService.getWorkCenterData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
/**
|
|
* 获取加工中心子数据
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getWorkCenterDataDetail")
|
|
@ResponseBody
|
|
public Object getWorkCenterDataDetail(@RequestBody WorkCenterData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<WorkCenterResourceData> result2 = baseService.getWorkCenterResourceData(indata);
|
|
List<ProductInWorkCenterData> result1 = baseService.getProductInWorkCenterData(indata);
|
|
map.put("success", true);
|
|
map.put("rows2", result2);
|
|
map.put("rows1", result1);
|
|
map.put("total", result2.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 生产线数据
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getProLineNoDetail")
|
|
@ResponseBody
|
|
public Object getProLineNoDetail(@RequestBody ProductionLineData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<ProductionLineData> result = baseService.getProLineNoDetail(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* @Title saveWorkCenterData
|
|
* @Description 保存加工中心
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/saveWorkCenterData")
|
|
@ResponseBody
|
|
public Object saveWorkCenterData(@RequestBody WorkCenterData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveWorkCenterData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title deleteWorkCenterData
|
|
* @Description 保存加工中心
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/deleteWorkCenterData")
|
|
@ResponseBody
|
|
public Object deleteWorkCenterData(@RequestBody WorkCenterData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deleteWorkCenterData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* @Title saveResource
|
|
* @Description 保存机台
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/saveResource")
|
|
@ResponseBody
|
|
public Object saveResource(@RequestBody WorkCenterResourceData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveResource(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* @Description 删除机台
|
|
* @Title deleteResource
|
|
* @param inData
|
|
* @author rq
|
|
* @date 2022/1/12 18:00
|
|
* @return Object
|
|
* @throw
|
|
*/
|
|
@PostMapping("/deleteResource")
|
|
@ResponseBody
|
|
public Object deleteResource(@RequestBody WorkCenterResourceData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deleteResource(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Description 删除机台
|
|
* @Title deleteResource
|
|
* @param inData
|
|
* @author rq
|
|
* @date 2022/1/12 18:00
|
|
* @return Object
|
|
* @throw
|
|
*/
|
|
@PostMapping("/setResourceFlag")
|
|
@ResponseBody
|
|
public Object setResourceFlag(@RequestBody WorkCenterResourceData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.setResourceFlag(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
/**
|
|
* 生产线数据
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/checkCustomerID")
|
|
@ResponseBody
|
|
public Object checkCustomerID(@RequestBody PartData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<PartData> result = baseService.checkCustomerID(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
//=============会计单位信息===================
|
|
/**
|
|
* 获取生产订单类型
|
|
* @param
|
|
* @return
|
|
*/
|
|
@PostMapping(value="/getCompanyInformation")
|
|
@ResponseBody
|
|
public Object getCompanyInformation(@RequestBody CompanyData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<CompanyData> result = baseService.getCompanyInformation(indata);
|
|
map.put("success", true);
|
|
map.put("rows", result);
|
|
map.put("total", result.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
|
|
/**
|
|
* @Title saveShopOrderFamily
|
|
* @Description 保存修改生产订单类型
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/saveCompanyInformation")
|
|
@ResponseBody
|
|
public Object saveCompanyInformation(@RequestBody CompanyData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveCompanyInformation(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Title deleteShopOrderFamily
|
|
* @Description 删除生产订单类型
|
|
* @author rq
|
|
* @date 2021/4/16 11:56
|
|
* @return {@link Object}
|
|
*/
|
|
|
|
@PostMapping("/deleteCompanyInformation")
|
|
@ResponseBody
|
|
public Object deleteCompanyInformation(@RequestBody CompanyData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.deleteCompanyInformation(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
|
|
/**
|
|
* @Method getPartFamilyList
|
|
* @Description: 根据条件 获取 工具信息
|
|
* @author zuowenwen
|
|
* @Version 1.0
|
|
* @param: partFamilyData
|
|
* @return: java.lang.Object
|
|
* @throws
|
|
* @date 2021/12/14 10:00
|
|
*/
|
|
@PostMapping("/getPartFamilyList")
|
|
@ResponseBody
|
|
public Object getPartFamilyList(@RequestBody PartFamilyData partFamilyData){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<PartFamilyData> resultList = baseService.getPartFamilyList(partFamilyData);
|
|
map.put("success", true);
|
|
map.put("rows", resultList);
|
|
map.put("total", resultList.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
//=============维护工艺路线信息===================
|
|
/**
|
|
* @Description 维护工艺路线信息查询
|
|
* @Title searchRoutingWithPartNo
|
|
* @param indata
|
|
* @author rq
|
|
* @date 2022/1/14 13:46
|
|
* @return Object
|
|
* @throw
|
|
*/
|
|
@PostMapping("/searchRoutingWithPartNo")
|
|
@ResponseBody
|
|
public Object searchRoutingWithPartNo(@RequestBody RoutingHeaderData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<RoutingHeaderData> resultList = baseService.searchRoutingWithPartNo(indata);
|
|
map.put("success", true);
|
|
map.put("rows", resultList);
|
|
map.put("total", resultList.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* @Description TODO
|
|
* @Title searchRoutingDetailData
|
|
* @param indata
|
|
* @author rq
|
|
* @date 2022/1/14 17:18
|
|
* @return Object
|
|
* @throw
|
|
*/
|
|
@PostMapping("/searchRoutingDetailData")
|
|
@ResponseBody
|
|
public Object searchRoutingDetailData(@RequestBody RoutingDetailData indata){
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
List<RoutingDetailData> resultList = baseService.searchRoutingDetailData(indata);
|
|
map.put("success", true);
|
|
map.put("rows", resultList);
|
|
map.put("total", resultList.size());
|
|
} catch (Exception e) {
|
|
map.put("success", false);
|
|
map.put("msg", e.getMessage());
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* @Description TODO
|
|
* @Title saveRoutingDetailData
|
|
* @param inData
|
|
* @author rq
|
|
* @date 2022/1/15 15:48
|
|
* @return Object
|
|
* @throw
|
|
*/
|
|
@PostMapping("/saveRoutingDetailData")
|
|
@ResponseBody
|
|
public Object saveRoutingDetailData(@RequestBody RoutingDetailData inData){
|
|
ResponseData responseData = new ResponseData();
|
|
try {
|
|
responseData = baseService.saveRoutingDetailData(inData);
|
|
} catch (Exception e) {
|
|
responseData.setMsg(e.getMessage());
|
|
responseData.setCode("500");
|
|
}
|
|
return responseData;
|
|
}
|
|
}
|