机具库存收藏修改

This commit is contained in:
hayu 2025-12-04 16:29:26 +08:00
parent 1c784481c0
commit 9c92ac8f79
4 changed files with 62 additions and 62 deletions

View File

@ -15,12 +15,12 @@ import java.util.Hashtable;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.bonus.scrap.service.ScrapApplyService; import com.bonus.scrap.service.ScrapApplyService;
import com.lowagie.text.List;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -228,7 +228,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes getMachineStatus() { public AjaxRes getMachineStatus() {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.getMachineStatus(); List<MachineBean> result = service.getMachineStatus();
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -288,7 +288,7 @@ public class MachineController extends BaseController<MachineBean> {
public void exportModelExcel(HttpServletRequest request, HttpServletResponse response, MachineBean o) { public void exportModelExcel(HttpServletRequest request, HttpServletResponse response, MachineBean o) {
try { try {
String filename = "设备入库模板"; String filename = "设备入库模板";
com.lowagie.text.List<String> headers = reportHeader1(); List<String> headers = reportHeader1();
HSSFWorkbook workbook = POIOutputHelper.excel(null, headers, filename); HSSFWorkbook workbook = POIOutputHelper.excel(null, headers, filename);
OutputStream out = null; OutputStream out = null;
response.setContentType("application/vnd.ms-excel;charset=UTF-8"); response.setContentType("application/vnd.ms-excel;charset=UTF-8");
@ -304,7 +304,7 @@ public class MachineController extends BaseController<MachineBean> {
} }
} }
private com.lowagie.text.List<String> reportHeader1() { private List<String> reportHeader1() {
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
list.add("序号"); list.add("序号");
list.add("机具名称"); list.add("机具名称");
@ -339,7 +339,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findPhotoList(MachineBean o) { public AjaxRes findPhotoList(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.findPhotoList(o); List<MachineBean> result = service.findPhotoList(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -355,7 +355,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findOptPhotoList(MachineBean o) { public AjaxRes findOptPhotoList(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.findOptPhotoList(o); List<MachineBean> result = service.findOptPhotoList(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -371,7 +371,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findFileList(MachineBean o) { public AjaxRes findFileList(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.findFileList(o); List<MachineBean> result = service.findFileList(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -387,7 +387,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findMachineType(MachineBean o) { public AjaxRes findMachineType(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> list = service.findMachineType(o); List<MachineBean> list = service.findMachineType(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", list); p.put("list", list);
ar.setSucceed(p); ar.setSucceed(p);
@ -403,7 +403,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findMachineTypeId(MachineBean o) { public AjaxRes findMachineTypeId(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> list = service.findMachineTypeId(o); List<MachineBean> list = service.findMachineTypeId(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", list); p.put("list", list);
ar.setSucceed(p); ar.setSucceed(p);
@ -442,8 +442,8 @@ public class MachineController extends BaseController<MachineBean> {
*/ */
@RequestMapping(value = "machineBinding", method = RequestMethod.POST) @RequestMapping(value = "machineBinding", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public com.lowagie.text.List<MachineBean> repairBinding(MachineBean o, HttpServletRequest request) { public List<MachineBean> repairBinding(MachineBean o, HttpServletRequest request) {
com.lowagie.text.List<MachineBean> list = new ArrayList<>(); List<MachineBean> list = new ArrayList<>();
try { try {
String deviceCode = o.getDeviceCode().toUpperCase(); String deviceCode = o.getDeviceCode().toUpperCase();
o.setDeviceCode(deviceCode); o.setDeviceCode(deviceCode);
@ -454,7 +454,7 @@ public class MachineController extends BaseController<MachineBean> {
QRCodeBean qrBean = new QRCodeBean(); QRCodeBean qrBean = new QRCodeBean();
qrBean.setCode(o.getQrcode()); qrBean.setCode(o.getQrcode());
qrBean.setMaModelId(o.getModelId()); qrBean.setMaModelId(o.getModelId());
com.lowagie.text.List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean); List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean);
qrBean = qrList.get(0); qrBean = qrList.get(0);
o.setType(qrBean.getMaModelId()); o.setType(qrBean.getMaModelId());
if (StringHelper.isEmpty(o.getVerderId())) { if (StringHelper.isEmpty(o.getVerderId())) {
@ -518,8 +518,8 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes find(MachineBean o) { public AjaxRes find(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> list = service.find(o); List<MachineBean> list = service.find(o);
com.lowagie.text.List<MachineBean> list1 = service.findFile(o); List<MachineBean> list1 = service.findFile(o);
MachineBean station = list.get(0); MachineBean station = list.get(0);
if (list1.size() > 0) { if (list1.size() > 0) {
station.setFilePath(list1.get(0).getFilePath()); station.setFilePath(list1.get(0).getFilePath());
@ -549,38 +549,38 @@ public class MachineController extends BaseController<MachineBean> {
MachineBean station5 = new MachineBean(); MachineBean station5 = new MachineBean();
MachineBean station6 = new MachineBean(); MachineBean station6 = new MachineBean();
try { try {
com.lowagie.text.List<MachineBean> listPicking = service.machinePicking(o); List<MachineBean> listPicking = service.machinePicking(o);
if (listPicking != null && !listPicking.isEmpty()) { if (listPicking != null && !listPicking.isEmpty()) {
station1 = listPicking.get(0); station1 = listPicking.get(0);
} }
ar1.setSucceed(station1); ar1.setSucceed(station1);
com.lowagie.text.List<MachineBean> listMaterialReturn = service.machineMaterialReturn(o); List<MachineBean> listMaterialReturn = service.machineMaterialReturn(o);
if (listMaterialReturn != null && !listMaterialReturn.isEmpty()) { if (listMaterialReturn != null && !listMaterialReturn.isEmpty()) {
station2 = listMaterialReturn.get(0); station2 = listMaterialReturn.get(0);
} }
ar2.setSucceed(station2); ar2.setSucceed(station2);
com.lowagie.text.List<MachineBean> listRepair = service.machineRepair(o); List<MachineBean> listRepair = service.machineRepair(o);
if (listRepair != null && !listRepair.isEmpty()) { if (listRepair != null && !listRepair.isEmpty()) {
station3 = listRepair.get(0); station3 = listRepair.get(0);
} }
ar3.setSucceed(station3); ar3.setSucceed(station3);
com.lowagie.text.List<MachineBean> listOverhaul = service.machineOverhaul(o); List<MachineBean> listOverhaul = service.machineOverhaul(o);
if (listOverhaul != null && !listOverhaul.isEmpty()) { if (listOverhaul != null && !listOverhaul.isEmpty()) {
station4 = listOverhaul.get(0); station4 = listOverhaul.get(0);
} }
ar4.setSucceed(station4); ar4.setSucceed(station4);
com.lowagie.text.List<MachineBean> listWarehousing = service.machineWarehousing(o); List<MachineBean> listWarehousing = service.machineWarehousing(o);
if (listWarehousing != null && !listWarehousing.isEmpty()) { if (listWarehousing != null && !listWarehousing.isEmpty()) {
station5 = listWarehousing.get(0); station5 = listWarehousing.get(0);
} }
ar5.setSucceed(station5); ar5.setSucceed(station5);
// 报废信息 // 报废信息
com.lowagie.text.List<MachineBean> listScrap = service.machineScrap(o); List<MachineBean> listScrap = service.machineScrap(o);
if (listScrap != null && !listScrap.isEmpty()) { if (listScrap != null && !listScrap.isEmpty()) {
station6 = listScrap.get(0); station6 = listScrap.get(0);
} }
@ -609,7 +609,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findCode(MachineBean o) { public AjaxRes findCode(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> list = service.findCode(o); List<MachineBean> list = service.findCode(o);
MachineBean station = list.get(0); MachineBean station = list.get(0);
ar.setSucceed(station); ar.setSucceed(station);
} catch (Exception e) { } catch (Exception e) {
@ -655,7 +655,7 @@ public class MachineController extends BaseController<MachineBean> {
try { try {
page.setPageSize(10000); page.setPageSize(10000);
Page<MachineBean> results = service.findByPageThree(o, page); Page<MachineBean> results = service.findByPageThree(o, page);
com.lowagie.text.List<MachineBean> list = results.getResults(); List<MachineBean> list = results.getResults();
if (list != null) { if (list != null) {
for (MachineBean bean : list) { for (MachineBean bean : list) {
String type = bean.getType(); String type = bean.getType();
@ -698,9 +698,9 @@ public class MachineController extends BaseController<MachineBean> {
} }
} }
private void expOutExcel1(HttpServletResponse response, com.lowagie.text.List<MachineBean> list, String filename, String machineName, private void expOutExcel1(HttpServletResponse response, List<MachineBean> list, String filename, String machineName,
String typeName) throws Exception { String typeName) throws Exception {
com.lowagie.text.List<Map<String, Object>> results = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
if (list != null) { if (list != null) {
int size = list.size(); int size = list.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
@ -709,7 +709,7 @@ public class MachineController extends BaseController<MachineBean> {
results.add(maps); results.add(maps);
} }
} }
com.lowagie.text.List<String> headers = historyreportHeader(); List<String> headers = historyreportHeader();
HSSFWorkbook workbook = POIOutputHelper1.excel(results, headers, filename, machineName, typeName); HSSFWorkbook workbook = POIOutputHelper1.excel(results, headers, filename, machineName, typeName);
OutputStream out = null; OutputStream out = null;
@ -740,7 +740,7 @@ public class MachineController extends BaseController<MachineBean> {
return maps; return maps;
} }
private com.lowagie.text.List<String> historyreportHeader() { private List<String> historyreportHeader() {
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
list.add("序号"); list.add("序号");
list.add("操作类型"); list.add("操作类型");
@ -772,7 +772,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findInfoData(MachineBean o) { public AjaxRes findInfoData(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> list = service.findInfoData(o); List<MachineBean> list = service.findInfoData(o);
ar.setSucceed(list); ar.setSucceed(list);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.toString(), e); logger.error(e.toString(), e);
@ -814,7 +814,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findByLikeCodeNew(MachineBean o) { public AjaxRes findByLikeCodeNew(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> list = service.findByLikeCodeNew(o); List<MachineBean> list = service.findByLikeCodeNew(o);
ar.setSucceed(list); ar.setSucceed(list);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.toString(), e); logger.error(e.toString(), e);
@ -828,7 +828,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes getAlOutStorageInfoList(OutStorageBean o) { public AjaxRes getAlOutStorageInfoList(OutStorageBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<OutStorageBean> bean = service.getAlOutStorageInfoList(o); List<OutStorageBean> bean = service.getAlOutStorageInfoList(o);
ar.setSucceed(bean); ar.setSucceed(bean);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.toString(), e); logger.error(e.toString(), e);
@ -844,7 +844,7 @@ public class MachineController extends BaseController<MachineBean> {
String deviceCode = request.getParameter("deviceCode"); String deviceCode = request.getParameter("deviceCode");
o.setDeviceCode(deviceCode); o.setDeviceCode(deviceCode);
try { try {
com.lowagie.text.List<MachineBean> list = service.findByCode(o); List<MachineBean> list = service.findByCode(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (MachineBean bean : list) { for (MachineBean bean : list) {
results += bean.toString() + ";"; results += bean.toString() + ";";
@ -862,7 +862,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findByCode(MachineBean o) { public AjaxRes findByCode(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> list = service.findByCode(o); List<MachineBean> list = service.findByCode(o);
ar.setSucceed(list); ar.setSucceed(list);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.toString(), e); logger.error(e.toString(), e);
@ -876,7 +876,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findType(MachineBean o) { public AjaxRes findType(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.findType(o); List<MachineBean> result = service.findType(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -892,7 +892,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findModel(MachineBean o) { public AjaxRes findModel(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.findModel(o); List<MachineBean> result = service.findModel(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -908,7 +908,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes findSums(MachineBean o) { public AjaxRes findSums(MachineBean o) {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.findSums(o); List<MachineBean> result = service.findSums(o);
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -930,7 +930,7 @@ public class MachineController extends BaseController<MachineBean> {
public AjaxRes getBuyCompany() { public AjaxRes getBuyCompany() {
AjaxRes ar = getAjaxRes(); AjaxRes ar = getAjaxRes();
try { try {
com.lowagie.text.List<MachineBean> result = service.getBuyCompany(); List<MachineBean> result = service.getBuyCompany();
Map<String, Object> p = new HashMap<String, Object>(); Map<String, Object> p = new HashMap<String, Object>();
p.put("list", result); p.put("list", result);
ar.setSucceed(p); ar.setSucceed(p);
@ -951,28 +951,28 @@ public class MachineController extends BaseController<MachineBean> {
String res = ""; String res = "";
try { try {
if (StringHelper.isNotEmpty(o.getOutFactortNum())) { if (StringHelper.isNotEmpty(o.getOutFactortNum())) {
com.lowagie.text.List<MachineBean> list = service.findByOutFactortNum(o); List<MachineBean> list = service.findByOutFactortNum(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
res += "<span style='color: red'>出厂编号</span>已存在,修改失败<br/>"; res += "<span style='color: red'>出厂编号</span>已存在,修改失败<br/>";
flag1 = true; flag1 = true;
} }
} }
if (StringHelper.isNotEmpty(o.getDeviceCode())) { if (StringHelper.isNotEmpty(o.getDeviceCode())) {
com.lowagie.text.List<MachineBean> list = service.findByCode(o); List<MachineBean> list = service.findByCode(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
res += "<span style='color: red'>设备编码</span>已存在,修改失败<br/>"; res += "<span style='color: red'>设备编码</span>已存在,修改失败<br/>";
flag2 = true; flag2 = true;
} }
} }
if (StringHelper.isNotEmpty(o.getAssetNum())) { if (StringHelper.isNotEmpty(o.getAssetNum())) {
com.lowagie.text.List<MachineBean> list = service.findByAssetNum(o); List<MachineBean> list = service.findByAssetNum(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
res += "<span style='color: red'>固资编号</span>已存在,修改失败<br/>"; res += "<span style='color: red'>固资编号</span>已存在,修改失败<br/>";
flag3 = true; flag3 = true;
} }
} }
if (StringHelper.isNotEmpty(o.getRemarks())) { if (StringHelper.isNotEmpty(o.getRemarks())) {
com.lowagie.text.List<MachineBean> list = service.findByRemarkAndId(o); List<MachineBean> list = service.findByRemarkAndId(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
res += "<span style='color: red'>该规格下该备注</span>已存在,修改失败<br/>"; res += "<span style='color: red'>该规格下该备注</span>已存在,修改失败<br/>";
flag4 = true; flag4 = true;
@ -995,7 +995,7 @@ public class MachineController extends BaseController<MachineBean> {
} }
service.update(o); service.update(o);
if (StringHelper.isNotEmpty(o.getBuyPrice())) {// 购置价格购置价格在其他的数据表中所以单独写 if (StringHelper.isNotEmpty(o.getBuyPrice())) {// 购置价格购置价格在其他的数据表中所以单独写
com.lowagie.text.List<MachineBean> list = service.findByType(o); List<MachineBean> list = service.findByType(o);
o.setId(list.get(0).getType()); o.setId(list.get(0).getType());
service.updateType(o); service.updateType(o);
} }
@ -1016,8 +1016,8 @@ public class MachineController extends BaseController<MachineBean> {
try { try {
String gpsRes = ""; String gpsRes = "";
String epcRes = ""; String epcRes = "";
com.lowagie.text.List<MachineBean> gps = service.findGps(o); List<MachineBean> gps = service.findGps(o);
com.lowagie.text.List<MachineBean> dev = service.findDev(o); List<MachineBean> dev = service.findDev(o);
String rfidEpc = o.getRfidEpc(); String rfidEpc = o.getRfidEpc();
if (gps.isEmpty()) { if (gps.isEmpty()) {
o.setRfidEpc(null); o.setRfidEpc(null);
@ -1075,7 +1075,7 @@ public class MachineController extends BaseController<MachineBean> {
@RequestMapping(value = "ToQRCode", method = RequestMethod.POST) @RequestMapping(value = "ToQRCode", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public void ToQRCode(MachineBean o, HttpServletRequest request) throws Exception { public void ToQRCode(MachineBean o, HttpServletRequest request) throws Exception {
com.lowagie.text.List<MachineBean> list = service.find(o); List<MachineBean> list = service.find(o);
String company = list.get(0).getDeviceNum(); String company = list.get(0).getDeviceNum();
String stockNums = findStockNums(o); String stockNums = findStockNums(o);
int num = Integer.parseInt(stockNums) + 1; int num = Integer.parseInt(stockNums) + 1;
@ -1162,13 +1162,13 @@ public class MachineController extends BaseController<MachineBean> {
String inputType = request.getParameter("inputType"); String inputType = request.getParameter("inputType");
String deviceCode = o.getDeviceCode().toUpperCase(); String deviceCode = o.getDeviceCode().toUpperCase();
o.setDeviceCode(deviceCode); o.setDeviceCode(deviceCode);
com.lowagie.text.List<MachineBean> list = service.findByCode(o); List<MachineBean> list = service.findByCode(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
ar.setSucceed("2"); ar.setSucceed("2");
} else { } else {
QRCodeBean qrBean = new QRCodeBean(); QRCodeBean qrBean = new QRCodeBean();
qrBean.setCode(o.getQrcode()); qrBean.setCode(o.getQrcode());
com.lowagie.text.List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean); List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean);
qrBean = qrList.get(0); qrBean = qrList.get(0);
o.setType(qrBean.getMaModelId()); o.setType(qrBean.getMaModelId());
o.setVerderId(qrBean.getVenderId()); o.setVerderId(qrBean.getVenderId());
@ -1206,7 +1206,7 @@ public class MachineController extends BaseController<MachineBean> {
public synchronized AjaxRes bindingNums(MachineTypeBean mt, HttpServletRequest request, String userId) { public synchronized AjaxRes bindingNums(MachineTypeBean mt, HttpServletRequest request, String userId) {
AjaxRes ar = new AjaxRes(); AjaxRes ar = new AjaxRes();
try { try {
com.lowagie.text.List<MachineTypeBean> mtlist = mtservice.find(mt); List<MachineTypeBean> mtlist = mtservice.find(mt);
String libNums = null; String libNums = null;
if (mtlist.size() > 0) { if (mtlist.size() > 0) {
libNums = mtlist.get(0).getNums();// 库存数 libNums = mtlist.get(0).getNums();// 库存数
@ -1238,13 +1238,13 @@ public class MachineController extends BaseController<MachineBean> {
try { try {
String deviceCode = o.getDeviceCode().toUpperCase(); String deviceCode = o.getDeviceCode().toUpperCase();
o.setDeviceCode(deviceCode); o.setDeviceCode(deviceCode);
com.lowagie.text.List<MachineBean> list = service.findByCode(o); List<MachineBean> list = service.findByCode(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
ar.setSucceed("2"); ar.setSucceed("2");
} else { } else {
QRCodeBean qrBean = new QRCodeBean(); QRCodeBean qrBean = new QRCodeBean();
qrBean.setCode(o.getQrcode()); qrBean.setCode(o.getQrcode());
com.lowagie.text.List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean); List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean);
qrBean = qrList.get(0); qrBean = qrList.get(0);
o.setClerk(o.getClerk()); o.setClerk(o.getClerk());
o.settOverhaulPersion(o.gettOverhaulPersion()); o.settOverhaulPersion(o.gettOverhaulPersion());
@ -1277,8 +1277,8 @@ public class MachineController extends BaseController<MachineBean> {
qrBean.setCode(o.getQrcode()); qrBean.setCode(o.getQrcode());
String maModelId = ""; String maModelId = "";
String typeId = ""; String typeId = "";
com.lowagie.text.List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean); List<QRCodeBean> qrList = qrService.findQRCodeInfo(qrBean);
com.lowagie.text.List<MachineBean> maList = service.findByCode(o); List<MachineBean> maList = service.findByCode(o);
if (qrList != null) { if (qrList != null) {
maModelId = qrList.get(0).getMaModelId(); maModelId = qrList.get(0).getMaModelId();
} }
@ -1324,7 +1324,7 @@ public class MachineController extends BaseController<MachineBean> {
String deviceNum = o.getDeviceNum(); String deviceNum = o.getDeviceNum();
MachineBean maBean = service.findByQrcode(o); MachineBean maBean = service.findByQrcode(o);
if (maBean == null) { if (maBean == null) {
com.lowagie.text.List<MachineBean> list = service.findByCode(o); List<MachineBean> list = service.findByCode(o);
if (list.isEmpty()) { if (list.isEmpty()) {
String stockNums = findStockNums(); String stockNums = findStockNums();
int numss = Integer.parseInt(stockNums) + 1; int numss = Integer.parseInt(stockNums) + 1;
@ -1356,7 +1356,7 @@ public class MachineController extends BaseController<MachineBean> {
String res = "解绑成功"; String res = "解绑成功";
try { try {
o.setQrcode(o.getQrcode().toUpperCase()); o.setQrcode(o.getQrcode().toUpperCase());
com.lowagie.text.List<MachineBean> list = service.findByCode(o); List<MachineBean> list = service.findByCode(o);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
MachineBean bean = list.get(0); MachineBean bean = list.get(0);
service.unbinding(o); service.unbinding(o);
@ -1399,7 +1399,7 @@ public class MachineController extends BaseController<MachineBean> {
if (o.getDeviceType()==null || o.getDeviceType().equals("")){ if (o.getDeviceType()==null || o.getDeviceType().equals("")){
o.setDeviceType("1"); o.setDeviceType("1");
} }
com.lowagie.text.List<MachineBean> list = service.export(o); List<MachineBean> list = service.export(o);
if (list != null) { if (list != null) {
for (MachineBean bean : list) { for (MachineBean bean : list) {
String status = bean.getBatchStatus(); String status = bean.getBatchStatus();
@ -1475,9 +1475,9 @@ public class MachineController extends BaseController<MachineBean> {
* (Exception e) { logger.error(e.toString(), e); } } * (Exception e) { logger.error(e.toString(), e); } }
*/ */
private void expOutExcel(HttpServletResponse response, com.lowagie.text.List<MachineBean> list, String filename) throws Exception { private void expOutExcel(HttpServletResponse response, List<MachineBean> list, String filename) throws Exception {
if (list != null) { if (list != null) {
com.lowagie.text.List<Map<String, Object>> results = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
int size = list.size(); int size = list.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
MachineBean bean = list.get(i); MachineBean bean = list.get(i);
@ -1485,7 +1485,7 @@ public class MachineController extends BaseController<MachineBean> {
results.add(maps); results.add(maps);
} }
com.lowagie.text.List<String> headers = reportHeader(); List<String> headers = reportHeader();
HSSFWorkbook workbook = POIOutputHelper.excel(results, headers, filename); HSSFWorkbook workbook = POIOutputHelper.excel(results, headers, filename);
OutputStream out = null; OutputStream out = null;
response.setContentType("application/vnd.ms-excel;charset=UTF-8"); response.setContentType("application/vnd.ms-excel;charset=UTF-8");
@ -1533,7 +1533,7 @@ public class MachineController extends BaseController<MachineBean> {
return maps; return maps;
} }
private com.lowagie.text.List<String> reportHeader() { private List<String> reportHeader() {
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
list.add("序号"); list.add("序号");
list.add("机具名称"); list.add("机具名称");
@ -1616,7 +1616,7 @@ public class MachineController extends BaseController<MachineBean> {
service.insert(o); service.insert(o);
MachineTypeBean mt = new MachineTypeBean(); MachineTypeBean mt = new MachineTypeBean();
mt.setId(o.getModel()); mt.setId(o.getModel());
com.lowagie.text.List<MachineTypeBean> mtlist = mtservice.find(mt); List<MachineTypeBean> mtlist = mtservice.find(mt);
String libNums = null; String libNums = null;
if (mtlist.size() > 0) { if (mtlist.size() > 0) {
libNums = mtlist.get(0).getNums();// 库存数 libNums = mtlist.get(0).getNums();// 库存数
@ -2166,7 +2166,7 @@ public class MachineController extends BaseController<MachineBean> {
} }
public String getCode(MachineBean o) { public String getCode(MachineBean o) {
com.lowagie.text.List<MachineBean> list = new ArrayList<MachineBean>(); List<MachineBean> list = new ArrayList<MachineBean>();
String msg = "1"; String msg = "1";
try { try {
list = service.getCode(o); list = service.getCode(o);

View File

@ -1,6 +1,6 @@
package com.bonus.ma.dao; package com.bonus.ma.dao;
import com.lowagie.text.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.bonus.core.BonusBatis; import com.bonus.core.BonusBatis;

View File

@ -6,7 +6,7 @@ import com.bonus.lease.beans.OutStorageBean;
import com.bonus.ma.beans.MachineBean; import com.bonus.ma.beans.MachineBean;
import com.bonus.sys.BaseService; import com.bonus.sys.BaseService;
import com.bonus.sys.Page; import com.bonus.sys.Page;
import com.lowagie.text.List; import java.util.List;
public interface MachineService extends BaseService<MachineBean> { public interface MachineService extends BaseService<MachineBean> {

View File

@ -4,7 +4,7 @@ import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.lowagie.text.List; import java.util.List;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;