From b00dd93dedca0c151a760fff48191b92ac572545 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 20 一月 2026 18:16:14 +0800
Subject: [PATCH] 优化调整,及数据导入提交1
---
fzzy-igdss-web/src/main/resources/templates/index.html | 7
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml | 28 ++
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutDataPR.java | 185 ++++++++++++++++++
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/ExportService.java | 354 +++++++++++++++++++++++++++++++++++
fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/SysIndexController.java | 3
5 files changed, 572 insertions(+), 5 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/ExportService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/ExportService.java
new file mode 100644
index 0000000..05887ef
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/ExportService.java
@@ -0,0 +1,354 @@
+package com.fzzy.igds.service;
+
+import com.fzzy.igds.constant.FoodVariety;
+import com.fzzy.igds.domain.InoutRecord;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description
+ * @Author CZT
+ * @Date 2026/01/19 18:52
+ */
+@Service
+public class ExportService {
+
+ private static final String XLS = "xls";
+ private static final String XLSX = "xlsx";
+
+ @Resource
+ private FileService fileService;
+
+
+ /**
+ * 璇诲彇Excel鏂囦欢鍐呭
+ *
+ * @param
+ * @return
+ */
+ public List<InoutRecord> readExcel(String fileName) {
+
+ //鑾峰彇鏂囦欢鍚庣紑鍚嶅苟鍒ゆ柇
+ String fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
+
+ //鑾峰彇淇濆瓨璺緞
+ String path = fileService.getFileSavePath("TEMP");
+ path = path + fileName;
+
+ Workbook workbook = null;
+ FileInputStream inputStream = null;
+
+ try {
+ // 鑾峰彇Excel鏂囦欢
+ File excelFile = new File(path);
+ if (!excelFile.exists()) {
+ return null;
+ }
+ // 鑾峰彇Excel宸ヤ綔绨�
+ inputStream = new FileInputStream(excelFile);
+ workbook = getWorkbook(inputStream, fileType);
+
+ // 璇诲彇excel涓殑鏁版嵁
+ return parseExcel(workbook);
+ } catch (Exception e) {
+ return null;
+ } finally {
+ try {
+ if (null != inputStream) {
+ inputStream.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * 瑙f瀽Excel鏁版嵁
+ *
+ * @param workbook
+ * @return
+ */
+ private static List<InoutRecord> parseExcel(Workbook workbook) throws Exception{
+ List<InoutRecord> resultDataList = new ArrayList<>();
+
+ // 瑙f瀽sheet
+ for (int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) {
+ Sheet sheet = workbook.getSheetAt(sheetNum);
+
+ // 鏍¢獙sheet鏄惁鍚堟硶
+ if (sheet == null) {
+ continue;
+ }
+
+ // 鑾峰彇绗竴琛屾暟鎹�,涓嶇敤澶勭悊
+ int firstRowNum = sheet.getFirstRowNum();
+
+ // 瑙f瀽姣忎竴琛岀殑鏁版嵁锛屾瀯閫犳暟鎹璞�
+ int rowStart = firstRowNum + 2;
+ int rowEnd = sheet.getPhysicalNumberOfRows();
+
+ //瀹氫箟鍙橀噺,鐢ㄤ簬鍒ゆ柇鏁版嵁鏄惁瑙f瀽瀹�
+ boolean flag = false;
+
+ for (int rowNum = rowStart; rowNum < rowEnd; rowNum++) {
+ Row row = sheet.getRow(rowNum);
+
+ if (null == row) {
+ //姝よ涓虹┖锛屽垯涔嬪悗涓嶅啀瑙f瀽锛屽垽瀹氫负瑙f瀽瀹屾垚
+ flag = true;
+ break;
+ }
+
+ InoutRecord resultData = convertRowToData(row);
+ resultDataList.add(resultData);
+ }
+ if(flag){
+ break;
+ }
+ }
+ return resultDataList;
+ }
+
+ /**
+ * 鏍规嵁鏂囦欢鍚庣紑鍚嶇被鍨嬭幏鍙栧搴旂殑宸ヤ綔绨垮璞�
+ * @param inputStream 璇诲彇鏂囦欢鐨勮緭鍏ユ祦
+ * @param fileType 鏂囦欢鍚庣紑鍚嶇被鍨嬶紙xls鎴杧lsx锛�
+ * @return 鍖呭惈鏂囦欢鏁版嵁鐨勫伐浣滅翱瀵硅薄
+ * @throws IOException
+ */
+ public static Workbook getWorkbook(InputStream inputStream, String fileType) throws IOException {
+ Workbook workbook = null;
+ if (fileType.equalsIgnoreCase(XLS)) {
+ workbook = new HSSFWorkbook(inputStream);
+ } else if (fileType.equalsIgnoreCase(XLSX)) {
+ workbook = new XSSFWorkbook(inputStream);
+ }
+ return workbook;
+ }
+
+ /**
+ * 鎻愬彇姣忎竴琛屼腑闇�瑕佺殑鏁版嵁锛屾瀯閫犳垚涓轰竴涓粨鏋滄暟鎹璞�
+ *
+ * @param row
+ * @return
+ */
+ private static InoutRecord convertRowToData(Row row) throws Exception {
+ InoutRecord resultData = new InoutRecord();
+
+ Cell cell;
+ int cellNum = 0;
+
+ //绗竴鍒楀簭鍙凤紝涓嶅仛澶勭悊
+ cell = row.getCell(cellNum++);
+
+ //鏃ユ湡
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setCustomerName("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String time = cell.getStringCellValue().trim().replaceAll(" ","");
+ if(StringUtils.isNotEmpty(time)){
+ resultData.setRegisterTime(DateUtils.parseDate(time,"yyyy-MM-dd"));
+ }
+ }
+
+ //绫诲瀷
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setType("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String type = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(type)){
+ resultData.setType(type);
+ }
+ }
+
+ //杞︾墝鍙�
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setPlateNum("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String plateNum = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(plateNum)){
+ resultData.setPlateNum(plateNum);
+ }
+ }
+
+ //鎵胯繍浜�
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setUserName("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String userName = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(userName)){
+ resultData.setUserName(userName);
+ }
+ }
+
+ //寰�鏉ュ崟浣�
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setCustomerName("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String customerName = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(customerName)){
+ resultData.setCustomerName(customerName);
+ }
+ }
+
+ //瑁呭嵏浠撳簱
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setDepotId("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String depotName = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(depotName)){
+ resultData.setDepotId(depotName);
+ }
+ }
+
+ //绮鍝佺
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setFoodVariety("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String foodVariety = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(foodVariety)){
+ resultData.setFoodVariety(FoodVariety.getCode(foodVariety.trim()));
+ }
+ }
+
+ //绮骞翠唤
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setFoodYear("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String year = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(year)){
+ resultData.setFoodYear(year);
+ }
+ }
+
+ //婊¤溅閲嶉噺
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setFullWeight(0.0);
+ }else {
+ cell.setCellType(CellType.STRING);
+ String fullWeight = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(fullWeight)){
+ resultData.setFullWeight(Double.valueOf(fullWeight));
+ }
+ }
+
+ //绌鸿溅閲嶉噺
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setEmptyWeight(0.0);
+ }else {
+ cell.setCellType(CellType.STRING);
+ String emptyWeight = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(emptyWeight)){
+ resultData.setEmptyWeight(Double.valueOf(emptyWeight));
+ }
+ }
+
+ //鎵i噸
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setDeOther(0.0);
+ }else {
+ cell.setCellType(CellType.STRING);
+ String deOther = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(deOther)){
+ resultData.setDeOther(Double.valueOf(deOther));
+ }
+ }
+
+ //缁撶畻閲嶉噺
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setSettleWeight(0.0);
+ resultData.setRecordWeight(0.0);
+ }else {
+ cell.setCellType(CellType.STRING);
+ String recordWeight = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(recordWeight)){
+ resultData.setSettleWeight(Double.valueOf(recordWeight));
+ resultData.setRecordWeight(Double.valueOf(recordWeight));
+ }
+ }
+
+ //鍗曚环
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setPrice(0.0);
+ }else {
+ cell.setCellType(CellType.STRING);
+ String price = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(price)){
+ resultData.setPrice(Double.valueOf(price));
+ }
+ }
+
+ //姘村垎
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setPerWet(0.0);
+ }else {
+ cell.setCellType(CellType.STRING);
+ String perWet = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(perWet)){
+ resultData.setPerWet(Double.valueOf(perWet));
+ }
+ }
+
+ //鏉傝川
+ cell = row.getCell(cellNum++);
+ if(cell == null || cell.getCellType() == CellType.BLANK){
+ resultData.setPerImpurity(0.0);
+ }else {
+ cell.setCellType(CellType.STRING);
+ String perImpurity = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(perImpurity)){
+ resultData.setPerImpurity(Double.valueOf(perImpurity));
+ }
+ }
+
+ //澶囨敞
+ cell = row.getCell(cellNum++);
+ if(null == cell || cell.getCellType() == CellType.BLANK){
+ resultData.setRemarks("");
+ }else {
+ cell.setCellType(CellType.STRING);
+ String remarks = cell.getStringCellValue().trim();
+ if(StringUtils.isNotEmpty(remarks)){
+ resultData.setRemarks(remarks);
+ }
+ }
+
+ return resultData;
+ }
+
+}
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutDataPR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutDataPR.java
index 87f3c24..90d2b62 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutDataPR.java
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutDataPR.java
@@ -8,13 +8,15 @@
import com.fzzy.igds.data.InoutData;
import com.fzzy.igds.data.InoutParam;
import com.fzzy.igds.domain.InoutRecord;
+import com.fzzy.igds.service.ExportService;
import com.fzzy.igds.service.InoutRecordService;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.domain.entity.SysUser;
+import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
-import java.util.Date;
+import java.util.*;
/**
* @Description 鍑哄叆搴撹鍗曢〉闈㈢鐞�
@@ -26,6 +28,8 @@
@Resource
private InoutRecordService inoutRecordService;
+ @Resource
+ private ExportService exportService;
/**
* inoutDataPR#pageInoutData
@@ -37,7 +41,7 @@
public void pageInoutData(Page<InoutRecord> page, InoutParam param) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<InoutRecord> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPageNo(), page.getPageSize());
- if(null == param) {
+ if (null == param) {
param = new InoutParam();
}
inoutRecordService.listPageInout(corePage, param);
@@ -157,4 +161,181 @@
return inoutRecordService.outWeightBill(data);
}
}
+
+ /**
+ * inoutDataPR#analysisExcel
+ *
+ * @param fileName
+ * @return
+ */
+ @Expose
+ public String analysisExcel(String fileName) {
+ return "瀵煎叆鍔熻兘寰呬笂绾匡紒锛�";
+// try {
+// List<InoutRecord> inoutRecords = exportService.readExcel(fileName);
+// if (null == inoutRecords || inoutRecords.isEmpty()) {
+// return "瀵煎叆澶辫触锛屽師鍥�-->鏈幏鍙栧埌excel涓枃妗f暟鎹紒";
+// }
+//
+//
+// for (InoutRecord inoutRecord : inoutRecords) {
+//
+// //TODO 鍒ゆ柇鏁版嵁鏄惁姝e父鏁版嵁锛屾甯稿垯鏂板锛屽紓甯稿垯蹇界暐
+// //璁剧疆鏁版嵁鐘舵�佸強娴佺▼
+// inoutRecord.setRecordStatus(Constant.RECORD_STATUS_ADD);
+// inoutRecord.setProgress(Constant.PROGRESS_RECORD);
+//
+// inoutRecord.setCompleteTime(new Date());
+//
+//
+// inoutRecord.setRegisterTime(DateUtils.addHours(new Date(), -2));
+//
+//
+//
+//
+// inoutRecordService.addInoutRecord(inoutRecord);
+// }
+//
+//
+//
+//
+// return null;
+// } catch (Exception e) {
+// return "瀵煎叆澶辫触锛屽師鍥�-->" + e.getMessage();
+// }
+
+
+// // 璇诲彇鐨凟xcel鏂囦欢鏁版嵁
+// List<NoticeInData> readResult = readExcel(fileName);
+// if (null == readResult) {
+// return new PageResponse<String>(RespCodeEnum.CODE_1111.getCode(),
+// "瀵煎叆澶辫触锛氭病鏈夎В鏋愬埌鏂囦欢涓暟鎹紒");
+// }
+//
+// // 鏌ヨ鍒扮殑鎵�鏈変緵搴斿晢淇℃伅
+// InoutParam param = new InoutParam();
+// param.setTagSupplier(Constant.TR_TRUE + "");
+// List<InoutCustomer> allCustomer = inoutCommonService.listCustomer(param);
+//
+// //鏂板缓浠诲姟瀛樻斁闆嗗悎
+// List<NoticeInData> newCustomerTaskList = new ArrayList<>();
+// Map<String, NoticeInData> newMap = new HashMap<>();
+//
+// //瀛樻斁缂栫爜鍜屽悕绉颁笉涓�鑷寸殑淇℃伅
+// StringBuilder stringBuilder = new StringBuilder();
+//
+// //鐢╰empFlag鍦ㄥ悗闈㈡潵鍒ゆ柇瑙f瀽鍒扮殑瀹㈡埛鏄惁鍦ㄥ鎴疯〃涓瓨鍦�
+// boolean tempFlag;
+//
+// int max = 0;
+// for (NoticeInData noticeInData : readResult) {
+// //鑾峰彇瀹㈡埛浠诲姟鏁版嵁涓殑瀹㈡埛鍚嶇О鍜岀紪鐮�
+// String customerName = noticeInData.getCustomerName();
+// String customerId = noticeInData.getCustomerId();
+// //鍒ゆ柇缂栫爜鏄惁涓虹┖,涓虹┖鍒欑粰鍑烘彁绀�,涓嶈繘琛屾搷浣�
+// if(StringUtils.isEmpty(customerName)){
+// stringBuilder.append("瀹㈡埛鈥�").append(customerName).append("鈥欎俊鎭笉瀹屾暣锛屼笉瀵煎叆姝ゆ潯鏁版嵁锛沑n");
+// continue;
+// }
+//
+// tempFlag = true;
+//
+// for (InoutCustomer customer : allCustomer) {
+// //鑾峰彇渚涘簲鍟嗗悕绉板拰缂栫爜
+// String name = customer.getName();
+// String id = customer.getId();
+// //鍒ゆ柇鍚嶇О鏄惁鐩稿悓
+// if(customerName.equals(name)){
+// //鍚嶇О鐩稿悓锛屽垯瀹㈡埛鍦ㄨ〃涓瓨鍦�
+// tempFlag = false;
+// //鍒ゆ柇缂栫爜鏄惁鐩稿悓
+// if(StringUtils.isEmpty(customerId) || !id.equals(customerId)){
+//
+// noticeInData.setCustomerId(id);
+// }
+// noticeInData.setCompanyId(customer.getCompanyId());
+// //韬唤璇佸彿
+// if(StringUtils.isEmpty(noticeInData.getCardId())){
+// noticeInData.setCardId(customer.getCardId());
+// }
+// //鍦板潃
+// if(StringUtils.isEmpty(noticeInData.getAddress())){
+// noticeInData.setAddress(customer.getAddress());
+// }
+// //鐢佃瘽
+// if(StringUtils.isEmpty(noticeInData.getPhone())){
+// noticeInData.setPhone(customer.getPhone());
+// }
+// //涓�鍗¢�氬彿
+// if(StringUtils.isEmpty(noticeInData.getBankNum())){
+// noticeInData.setBankNum(customer.getBankNum());
+// }
+// }
+// }
+//
+// if(tempFlag){
+// if(max == 0){
+// max = Integer.parseInt(inoutCommonService.getMaxCustomerId(null));
+// }
+// max += 1;
+// noticeInData.setCustomerId(max + "");
+// }
+//
+// newCustomerTaskList.add(noticeInData);
+//
+// newMap.putIfAbsent(noticeInData.getCustomerName(), noticeInData);
+// }
+//
+// //鏇存柊瀹㈡埛淇℃伅琛�
+// if(newMap.size() > 0){
+// for (NoticeInData noticeInData : newMap.values()) {
+// int i = inoutCommonService.updateCustomer(noticeInData);
+// if (i == 0) {
+// //璇存槑娌℃湁鏇存柊鍒板鎴蜂俊鎭紝杩涜鏂板
+// InoutCustomer data = new InoutCustomer();
+// data.setId(noticeInData.getCustomerId());
+// data.setName(noticeInData.getCustomerName());
+// data.setCardId(noticeInData.getCardId());
+// data.setBankNum(noticeInData.getBankNum());
+// data.setAddress(noticeInData.getAddress());
+// data.setPhone(noticeInData.getPhone());
+// data.setTagSupplier(Constant.TR_TRUE + "");
+// customerService.saveOrUpdataData(data);
+// }
+// }
+// }
+//
+// //鍒ゆ柇浠诲姟闆嗗悎鏄惁涓虹┖
+// if (newCustomerTaskList.isEmpty()) {
+// return new PageResponse<String>(RespCodeEnum.CODE_1111.getCode(),
+// "瀵煎叆澶辫触锛乗n" + stringBuilder.toString());
+// } else {
+// //鏇存柊浠诲姟琛�
+// int temp = 1;
+// for (NoticeInData noticeInData : newCustomerTaskList) {
+// //璁剧疆瀹㈡埛閫氱煡鍗曠殑缁勭粐缂栫爜绛変俊鎭�
+// noticeInData.setCompanyId(ContextUtil.getCompanyId());
+// noticeInData.setDeptId(ContextUtil.subDeptId(null));
+// noticeInData.setCreateUser(ContextUtil.getLoginUserCName());
+// if(temp < 10){
+// noticeInData.setId(ContextUtil.getTimeId() + "00" + temp);
+// }else if(temp < 100){
+// noticeInData.setId(ContextUtil.getTimeId() + "0" + temp);
+// }else {
+// noticeInData.setId(ContextUtil.getTimeId() + temp);
+// }
+//
+// //鏇存柊瀹㈡埛浠诲姟淇℃伅,濡傛灉鏇存柊澶辫触,鍒欒繘琛屾彃鍏ユ搷浣�
+// inoutCommonService.updateNoticeIn(noticeInData);
+// temp += 1;
+// }
+// if(StringUtils.isEmpty(stringBuilder.toString())){
+// return new PageResponse<String>(RespCodeEnum.CODE_0000.getCode(), "鏁版嵁鍏ㄩ儴瀵煎叆鎴愬姛锛�");
+// }else {
+// String message = "鏁版嵁閮ㄥ垎瀵煎叆鎴愬姛锛乗n"+ stringBuilder.toString();
+// return new PageResponse<String>(RespCodeEnum.CODE_0000.getCode(), message);
+// }
+//
+// }
+ }
}
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml
index 61a96c6..eab40e7 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml
@@ -610,6 +610,13 @@
<Property name="iconClass">fa fa-print</Property>
<Property name="width">120</Property>
</ToolBarButton>
+ <ToolBarButton>
+ <Property name="caption">瀵煎叆EXCEL</Property>
+ <Property name="exClassName">btn1</Property>
+ <Property name="iconClass">fa fa-file-excel-o</Property>
+ <Property name="action">uploadExcel</Property>
+ <Property name="width">120</Property>
+ </ToolBarButton>
</ToolBar>
<DataGrid id="dataGridMain" layoutConstraint="padding:8">
<ClientEvent name="onDataRowClick">view.get("#dataGridMain").set("selection",arg.data);</ClientEvent>
@@ -1176,5 +1183,26 @@
</Container>
</CustomDropDown>
<YearDropDown id="yearDropDown"/>
+ <UploadAction id="uploadExcel">
+ <ClientEvent name="onFileUploaded">var fileName = arg.returnValue;
+if(fileName){
+ $notify("闄勪欢涓婁紶鎴愬姛锛屽紑濮嬫墽琛岃В鏋愨�︹��");
+ view.get("#ajaxAnalysisExcel").set("parameter",fileName).execute(function(result){
+ if(result){
+ $alert(result);
+ }else{
+ $alert("瀵煎叆骞惰В鏋愭垚鍔燂紒");
+ query();
+ }
+ });
+}</ClientEvent>
+ <Property name="fileResolver">fileUploadManage#uploadExcel</Property>
+ <Property name="maxFileSize">10MB</Property>
+ <Filters/>
+ </UploadAction>
+ <AjaxAction id="ajaxAnalysisExcel">
+ <Property name="service">inoutDataPR#analysisExcel</Property>
+ <Property name="executingMessage">姝e湪鎵ц瑙f瀽鈥︹��</Property>
+ </AjaxAction>
</View>
</ViewConfig>
diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/SysIndexController.java b/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/SysIndexController.java
index e30d7b5..8c5bd1e 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/SysIndexController.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/SysIndexController.java
@@ -95,8 +95,7 @@
//鍒ゆ柇鏄惁鏄剧ず搴撳尯閫夋嫨寮圭獥
String showDeptList = "Y";
- SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId());
- if (Constant.DEPT_TYPE_20.equals(userDept.getType())) {
+ if (Constant.USER_TYPE_30.equals(user.getUserType())) {
showDeptList = "N";
}
mmap.put("showDeptList", showDeptList);
diff --git a/fzzy-igdss-web/src/main/resources/templates/index.html b/fzzy-igdss-web/src/main/resources/templates/index.html
index ba46527..d329d35 100644
--- a/fzzy-igdss-web/src/main/resources/templates/index.html
+++ b/fzzy-igdss-web/src/main/resources/templates/index.html
@@ -107,7 +107,7 @@
<!-- <li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="寮�鍙戞枃妗�"-->
<!-- href="https://fzzygf-company.feishu.cn/wiki/ZgS5wQuyMi2uDKk9xN6cx8jlnuf" target="_blank"><i class="fa fa-question-circle"></i>-->
<!-- 鏂囨。</a></li>-->
- <li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="澶у睆"
+ <li id="screenBtn"><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="澶у睆"
href="/index-gateway" id="index-gateway"><i class="fa fa-laptop"></i> 澶у睆</a></li>
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="閿佸畾灞忓箷"
href="javascript:;" id="lockScreen"><i class="fa fa-lock"></i> 閿佸睆</a></li>
@@ -304,6 +304,11 @@
}
}
+ if(showDeptList === "N"){
+ //搴撳尯鐢ㄦ埛锛岄殣钘忓ぇ灞忔寜閽�
+ $("#screenBtn").css('display', 'none');
+ }
+
/* 鍒濆瀵嗙爜鎻愮ず */
if ([[${isDefaultModifyPwd}]]) {
layer.confirm("鎮ㄧ殑瀵嗙爜杩樻槸鍒濆瀵嗙爜锛岃淇敼瀵嗙爜锛�", {
--
Gitblit v1.9.3