优化商品导出excel的功能
This commit is contained in:
@@ -302,6 +302,9 @@ public class ExceptionConstants {
|
|||||||
//序列号和批号只能有一项
|
//序列号和批号只能有一项
|
||||||
public static final int MATERIAL_ENABLE_MUST_ONE_CODE = 8000008;
|
public static final int MATERIAL_ENABLE_MUST_ONE_CODE = 8000008;
|
||||||
public static final String MATERIAL_ENABLE_MUST_ONE_MSG = "抱歉,商品条码:%s的序列号和批号不能同时填1";
|
public static final String MATERIAL_ENABLE_MUST_ONE_MSG = "抱歉,商品条码:%s的序列号和批号不能同时填1";
|
||||||
|
//抱歉,文件扩展名必须为xls
|
||||||
|
public static final int MATERIAL_EXTENSION_ERROR_CODE = 8000009;
|
||||||
|
public static final String MATERIAL_EXTENSION_ERROR_MSG = "抱歉,文件扩展名必须为xls";
|
||||||
/**
|
/**
|
||||||
* 单据信息
|
* 单据信息
|
||||||
* type = 85
|
* type = 85
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
package com.jsh.erp.controller;
|
package com.jsh.erp.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jsh.erp.constants.BusinessConstants;
|
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||||
import com.jsh.erp.constants.ExceptionConstants;
|
import com.jsh.erp.datasource.entities.Unit;
|
||||||
import com.jsh.erp.datasource.entities.*;
|
|
||||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
|
||||||
import com.jsh.erp.service.depot.DepotService;
|
import com.jsh.erp.service.depot.DepotService;
|
||||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||||
import com.jsh.erp.service.material.MaterialService;
|
import com.jsh.erp.service.material.MaterialService;
|
||||||
@@ -15,8 +12,6 @@ import com.jsh.erp.service.unit.UnitService;
|
|||||||
import com.jsh.erp.utils.*;
|
import com.jsh.erp.utils.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import jxl.Sheet;
|
|
||||||
import jxl.Workbook;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -27,7 +22,10 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||||
|
|
||||||
@@ -154,22 +152,7 @@ public class MaterialController {
|
|||||||
List<MaterialVo4Unit> list = materialService.findByIdWithBarCode(meId);
|
List<MaterialVo4Unit> list = materialService.findByIdWithBarCode(meId);
|
||||||
if(list!=null && list.size()>0) {
|
if(list!=null && list.size()>0) {
|
||||||
mu = list.get(0);
|
mu = list.get(0);
|
||||||
String expand = ""; //扩展信息
|
mu.setMaterialOther(materialService.getMaterialOtherByParam(mpArr, mu));
|
||||||
for (int i = 0; i < mpArr.length; i++) {
|
|
||||||
if (mpArr[i].equals("制造商")) {
|
|
||||||
expand = expand + ((mu.getMfrs() == null || mu.getMfrs().equals("")) ? "" : "(" + mu.getMfrs() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义1")) {
|
|
||||||
expand = expand + ((mu.getOtherField1() == null || mu.getOtherField1().equals("")) ? "" : "(" + mu.getOtherField1() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义2")) {
|
|
||||||
expand = expand + ((mu.getOtherField2() == null || mu.getOtherField2().equals("")) ? "" : "(" + mu.getOtherField2() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义3")) {
|
|
||||||
expand = expand + ((mu.getOtherField3() == null || mu.getOtherField3().equals("")) ? "" : "(" + mu.getOtherField3() + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mu.setMaterialOther(expand);
|
|
||||||
}
|
}
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = mu;
|
res.data = mu;
|
||||||
@@ -250,22 +233,7 @@ public class MaterialController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.put("stock", stock);
|
item.put("stock", stock);
|
||||||
String expand = ""; //扩展信息
|
item.put("expand", materialService.getMaterialOtherByParam(mpArr, material));
|
||||||
for (int i = 0; i < mpArr.length; i++) {
|
|
||||||
if (mpArr[i].equals("制造商")) {
|
|
||||||
expand = expand + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义1")) {
|
|
||||||
expand = expand + ((material.getOtherField1() == null || material.getOtherField1().equals("")) ? "" : "(" + material.getOtherField1() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义2")) {
|
|
||||||
expand = expand + ((material.getOtherField2() == null || material.getOtherField2().equals("")) ? "" : "(" + material.getOtherField2() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义3")) {
|
|
||||||
expand = expand + ((material.getOtherField3() == null || material.getOtherField3().equals("")) ? "" : "(" + material.getOtherField3() + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
item.put("expand", expand);
|
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,24 +276,7 @@ public class MaterialController {
|
|||||||
String MaterialName = "";
|
String MaterialName = "";
|
||||||
MaterialName = MaterialName + material.getmBarCode() + "_" + material.getName()
|
MaterialName = MaterialName + material.getmBarCode() + "_" + material.getName()
|
||||||
+ ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")");
|
+ ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")");
|
||||||
String expand = ""; //扩展信息
|
String expand = materialService.getMaterialOtherByParam(mpArr, material); //扩展信息
|
||||||
for (int i = 0; i < mpArr.length; i++) {
|
|
||||||
if (mpArr[i].equals("颜色")) {
|
|
||||||
expand = expand + ((material.getColor() == null || material.getColor().equals("")) ? "" : "(" + material.getColor() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("制造商")) {
|
|
||||||
expand = expand + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义1")) {
|
|
||||||
expand = expand + ((material.getOtherField1() == null || material.getOtherField1().equals("")) ? "" : "(" + material.getOtherField1() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义2")) {
|
|
||||||
expand = expand + ((material.getOtherField2() == null || material.getOtherField2().equals("")) ? "" : "(" + material.getOtherField2() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义3")) {
|
|
||||||
expand = expand + ((material.getOtherField3() == null || material.getOtherField3().equals("")) ? "" : "(" + material.getOtherField3() + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MaterialName = MaterialName + expand + ((material.getUnit() == null || material.getUnit().equals("")) ? "" : "(" + material.getUnit() + ")") + ratio;
|
MaterialName = MaterialName + expand + ((material.getUnit() == null || material.getUnit().equals("")) ? "" : "(" + material.getUnit() + ")") + ratio;
|
||||||
item.put("MaterialName", MaterialName);
|
item.put("MaterialName", MaterialName);
|
||||||
item.put("name", material.getName());
|
item.put("name", material.getName());
|
||||||
@@ -360,24 +311,36 @@ public class MaterialController {
|
|||||||
@RequestParam("mpList") String mpList,
|
@RequestParam("mpList") String mpList,
|
||||||
HttpServletRequest request, HttpServletResponse response) {
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
try {
|
try {
|
||||||
|
String[] mpArr = new String[]{};
|
||||||
|
if(StringUtil.isNotEmpty(mpList)){
|
||||||
|
mpArr= mpList.split(",");
|
||||||
|
}
|
||||||
List<MaterialVo4Unit> dataList = materialService.findByAll(StringUtil.toNull(barCode), StringUtil.toNull(name),
|
List<MaterialVo4Unit> dataList = materialService.findByAll(StringUtil.toNull(barCode), StringUtil.toNull(name),
|
||||||
StringUtil.toNull(standard), StringUtil.toNull(model), StringUtil.toNull(categoryId));
|
StringUtil.toNull(standard), StringUtil.toNull(model), StringUtil.toNull(categoryId));
|
||||||
String[] names = {"名称", "类型", "型号", "单位", "零售价", "最低售价", "采购价", "销售价", "备注", "状态"};
|
String[] names = {"条码", "名称", "规格", "型号", "颜色", "类别", "扩展信息", "单位", "基础重量", "保质期", "采购价", "销售价", "零售价", "最低售价", "备注", "状态", "序列号", "批号"};
|
||||||
String title = "商品信息";
|
String title = "商品信息";
|
||||||
List<String[]> objects = new ArrayList<String[]>();
|
List<String[]> objects = new ArrayList<>();
|
||||||
if (null != dataList) {
|
if (null != dataList) {
|
||||||
for (MaterialVo4Unit m : dataList) {
|
for (MaterialVo4Unit m : dataList) {
|
||||||
String[] objs = new String[10];
|
String[] objs = new String[100];
|
||||||
objs[0] = m.getName();
|
objs[0] = m.getmBarCode();
|
||||||
objs[1] = m.getCategoryName();
|
objs[1] = m.getName();
|
||||||
objs[2] = m.getModel();
|
objs[2] = m.getStandard();
|
||||||
objs[3] = m.getCommodityUnit();
|
objs[3] = m.getModel();
|
||||||
objs[4] = m.getCommodityDecimal() == null? "" : m.getCommodityDecimal().toString();
|
objs[4] = m.getColor();
|
||||||
objs[5] = m.getLowDecimal() == null? "" : m.getLowDecimal().toString();
|
objs[5] = m.getCategoryName();
|
||||||
objs[6] = m.getPurchaseDecimal() == null? "" : m.getPurchaseDecimal().toString();
|
objs[6] = materialService.getMaterialOtherByParam(mpArr, m);
|
||||||
objs[7] = m.getWholesaleDecimal() == null? "" : m.getWholesaleDecimal().toString();
|
objs[7] = m.getCommodityUnit();
|
||||||
objs[8] = m.getRemark();
|
objs[8] = m.getWeight() == null? "" : m.getWeight().toString();
|
||||||
objs[9] = m.getEnabled() ? "启用" : "禁用";
|
objs[9] = m.getExpiryNum() == null? "" : m.getExpiryNum().toString();
|
||||||
|
objs[10] = m.getPurchaseDecimal() == null? "" : m.getPurchaseDecimal().toString();
|
||||||
|
objs[11] = m.getWholesaleDecimal() == null? "" : m.getWholesaleDecimal().toString();
|
||||||
|
objs[12] = m.getCommodityDecimal() == null? "" : m.getCommodityDecimal().toString();
|
||||||
|
objs[13] = m.getLowDecimal() == null? "" : m.getLowDecimal().toString();
|
||||||
|
objs[14] = m.getRemark();
|
||||||
|
objs[15] = m.getEnabled() ? "启用" : "禁用";
|
||||||
|
objs[16] = "1".equals(m.getEnableSerialNumber()) ? "有" : "无";
|
||||||
|
objs[17] = "1".equals(m.getEnableBatchNumber()) ? "有" : "无";
|
||||||
objects.add(objs);
|
objects.add(objs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,16 +363,8 @@ public class MaterialController {
|
|||||||
public BaseResponseInfo importExcel(MultipartFile file,
|
public BaseResponseInfo importExcel(MultipartFile file,
|
||||||
HttpServletRequest request, HttpServletResponse response) throws Exception{
|
HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
String message = "成功";
|
|
||||||
try {
|
try {
|
||||||
Sheet src = null;
|
res = materialService.importExcel(file, request);
|
||||||
//文件合法性校验
|
|
||||||
try {
|
|
||||||
Workbook workbook = Workbook.getWorkbook(file.getInputStream());
|
|
||||||
src = workbook.getSheet(0);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
res = materialService.importExcel(src, request);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -512,22 +467,7 @@ public class MaterialController {
|
|||||||
List<MaterialVo4Unit> list = materialService.getMaterialByBarCode(barCode);
|
List<MaterialVo4Unit> list = materialService.getMaterialByBarCode(barCode);
|
||||||
if(list!=null && list.size()>0) {
|
if(list!=null && list.size()>0) {
|
||||||
for(MaterialVo4Unit mvo: list) {
|
for(MaterialVo4Unit mvo: list) {
|
||||||
String expand = ""; //扩展信息
|
mvo.setMaterialOther(materialService.getMaterialOtherByParam(mpArr, mvo));
|
||||||
for (int i = 0; i < mpArr.length; i++) {
|
|
||||||
if (mpArr[i].equals("制造商")) {
|
|
||||||
expand = expand + ((mvo.getMfrs() == null || mvo.getMfrs().equals("")) ? "" : "(" + mvo.getMfrs() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义1")) {
|
|
||||||
expand = expand + ((mvo.getOtherField1() == null || mvo.getOtherField1().equals("")) ? "" : "(" + mvo.getOtherField1() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义2")) {
|
|
||||||
expand = expand + ((mvo.getOtherField2() == null || mvo.getOtherField2().equals("")) ? "" : "(" + mvo.getOtherField2() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义3")) {
|
|
||||||
expand = expand + ((mvo.getOtherField3() == null || mvo.getOtherField3().equals("")) ? "" : "(" + mvo.getOtherField3() + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mvo.setMaterialOther(expand);
|
|
||||||
if ("LSCK".equals(prefixNo) || "LSTH".equals(prefixNo)) {
|
if ("LSCK".equals(prefixNo) || "LSTH".equals(prefixNo)) {
|
||||||
//零售价
|
//零售价
|
||||||
mvo.setBillPrice(mvo.getCommodityDecimal());
|
mvo.setBillPrice(mvo.getCommodityDecimal());
|
||||||
|
|||||||
@@ -3,18 +3,17 @@ package com.jsh.erp.service.material;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
import com.jsh.erp.constants.BusinessConstants;
|
import com.jsh.erp.constants.BusinessConstants;
|
||||||
import com.jsh.erp.constants.ExceptionConstants;
|
import com.jsh.erp.constants.ExceptionConstants;
|
||||||
import com.jsh.erp.datasource.entities.*;
|
import com.jsh.erp.datasource.entities.*;
|
||||||
import com.jsh.erp.datasource.mappers.*;
|
import com.jsh.erp.datasource.mappers.*;
|
||||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||||
import com.jsh.erp.exception.JshException;
|
import com.jsh.erp.exception.JshException;
|
||||||
import com.jsh.erp.service.materialExtend.MaterialExtendService;
|
|
||||||
import com.jsh.erp.service.depot.DepotService;
|
import com.jsh.erp.service.depot.DepotService;
|
||||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||||
import com.jsh.erp.service.log.LogService;
|
import com.jsh.erp.service.log.LogService;
|
||||||
import com.jsh.erp.service.materialCategory.MaterialCategoryService;
|
import com.jsh.erp.service.materialCategory.MaterialCategoryService;
|
||||||
|
import com.jsh.erp.service.materialExtend.MaterialExtendService;
|
||||||
import com.jsh.erp.service.redis.RedisService;
|
import com.jsh.erp.service.redis.RedisService;
|
||||||
import com.jsh.erp.service.unit.UnitService;
|
import com.jsh.erp.service.unit.UnitService;
|
||||||
import com.jsh.erp.service.user.UserService;
|
import com.jsh.erp.service.user.UserService;
|
||||||
@@ -22,12 +21,14 @@ import com.jsh.erp.utils.BaseResponseInfo;
|
|||||||
import com.jsh.erp.utils.ExcelUtils;
|
import com.jsh.erp.utils.ExcelUtils;
|
||||||
import com.jsh.erp.utils.StringUtil;
|
import com.jsh.erp.utils.StringUtil;
|
||||||
import jxl.Sheet;
|
import jxl.Sheet;
|
||||||
|
import jxl.Workbook;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -125,23 +126,7 @@ public class MaterialService {
|
|||||||
enableSerialNumber, enableBatchNumber, remark, idList, mpList, offset, rows);
|
enableSerialNumber, enableBatchNumber, remark, idList, mpList, offset, rows);
|
||||||
if (null != list) {
|
if (null != list) {
|
||||||
for (MaterialVo4Unit m : list) {
|
for (MaterialVo4Unit m : list) {
|
||||||
//扩展信息
|
m.setMaterialOther(getMaterialOtherByParam(mpArr, m));
|
||||||
String materialOther = "";
|
|
||||||
for (int i = 0; i < mpArr.length; i++) {
|
|
||||||
if (mpArr[i].equals("制造商")) {
|
|
||||||
materialOther = materialOther + ((m.getMfrs() == null || m.getMfrs().equals("")) ? "" : "(" + m.getMfrs() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义1")) {
|
|
||||||
materialOther = materialOther + ((m.getOtherField1() == null || m.getOtherField1().equals("")) ? "" : "(" + m.getOtherField1() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义2")) {
|
|
||||||
materialOther = materialOther + ((m.getOtherField2() == null || m.getOtherField2().equals("")) ? "" : "(" + m.getOtherField2() + ")");
|
|
||||||
}
|
|
||||||
if (mpArr[i].equals("自定义3")) {
|
|
||||||
materialOther = materialOther + ((m.getOtherField3() == null || m.getOtherField3().equals("")) ? "" : "(" + m.getOtherField3() + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.setMaterialOther(materialOther);
|
|
||||||
m.setStock(depotItemService.getStockByParam(null,m.getId(),null,null));
|
m.setStock(depotItemService.getStockByParam(null,m.getId(),null,null));
|
||||||
resList.add(m);
|
resList.add(m);
|
||||||
}
|
}
|
||||||
@@ -468,9 +453,20 @@ public class MaterialService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public BaseResponseInfo importExcel(Sheet src, HttpServletRequest request) throws Exception {
|
public BaseResponseInfo importExcel(MultipartFile file, HttpServletRequest request) throws Exception {
|
||||||
BaseResponseInfo info = new BaseResponseInfo();
|
BaseResponseInfo info = new BaseResponseInfo();
|
||||||
try {
|
try {
|
||||||
|
//文件扩展名只能为xls
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
if(StringUtil.isNotEmpty(fileName)) {
|
||||||
|
String fileExt = fileName.substring(fileName.indexOf(".")+1);
|
||||||
|
if(!"xls".equals(fileExt)) {
|
||||||
|
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_EXTENSION_ERROR_CODE,
|
||||||
|
ExceptionConstants.MATERIAL_EXTENSION_ERROR_MSG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Workbook workbook = Workbook.getWorkbook(file.getInputStream());
|
||||||
|
Sheet src = workbook.getSheet(0);
|
||||||
List<Depot> depotList= depotService.getDepot();
|
List<Depot> depotList= depotService.getDepot();
|
||||||
int depotCount = depotList.size();
|
int depotCount = depotList.size();
|
||||||
List<MaterialWithInitStock> mList = new ArrayList<>();
|
List<MaterialWithInitStock> mList = new ArrayList<>();
|
||||||
@@ -946,6 +942,31 @@ public class MaterialService {
|
|||||||
return materialMapperEx.getTotalStockAndPrice(depotList, idList, materialParam);
|
return materialMapperEx.getTotalStockAndPrice(depotList, idList, materialParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造扩展信息
|
||||||
|
* @param mpArr
|
||||||
|
* @param m
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m) {
|
||||||
|
String materialOther = "";
|
||||||
|
for (int i = 0; i < mpArr.length; i++) {
|
||||||
|
if (mpArr[i].equals("制造商")) {
|
||||||
|
materialOther = materialOther + ((m.getMfrs() == null || m.getMfrs().equals("")) ? "" : "(" + m.getMfrs() + ")");
|
||||||
|
}
|
||||||
|
if (mpArr[i].equals("自定义1")) {
|
||||||
|
materialOther = materialOther + ((m.getOtherField1() == null || m.getOtherField1().equals("")) ? "" : "(" + m.getOtherField1() + ")");
|
||||||
|
}
|
||||||
|
if (mpArr[i].equals("自定义2")) {
|
||||||
|
materialOther = materialOther + ((m.getOtherField2() == null || m.getOtherField2().equals("")) ? "" : "(" + m.getOtherField2() + ")");
|
||||||
|
}
|
||||||
|
if (mpArr[i].equals("自定义3")) {
|
||||||
|
materialOther = materialOther + ((m.getOtherField3() == null || m.getOtherField3().equals("")) ? "" : "(" + m.getOtherField3() + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return materialOther;
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
public int batchSetMaterialCurrentStock(String ids) throws Exception {
|
public int batchSetMaterialCurrentStock(String ids) throws Exception {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ public class SupplierService {
|
|||||||
} else {
|
} else {
|
||||||
//会员
|
//会员
|
||||||
String[] names = {"名称", "联系人", "手机号码", "联系电话", "电子邮箱", "预付款", "备注", "状态"};
|
String[] names = {"名称", "联系人", "手机号码", "联系电话", "电子邮箱", "预付款", "备注", "状态"};
|
||||||
String title = "信息报表";
|
String title = "信息内容";
|
||||||
List<String[]> objects = new ArrayList<String[]>();
|
List<String[]> objects = new ArrayList<String[]>();
|
||||||
if (null != dataList) {
|
if (null != dataList) {
|
||||||
for (Supplier s : dataList) {
|
for (Supplier s : dataList) {
|
||||||
@@ -561,7 +561,7 @@ public class SupplierService {
|
|||||||
}
|
}
|
||||||
String[] names = {"名称", "联系人", "手机号码", "联系电话", "电子邮箱", "传真", beginNeedStr,
|
String[] names = {"名称", "联系人", "手机号码", "联系电话", "电子邮箱", "传真", beginNeedStr,
|
||||||
allNeedStr, "纳税人识别号", "税率(%)", "开户行", "账号", "地址", "备注", "状态"};
|
allNeedStr, "纳税人识别号", "税率(%)", "开户行", "账号", "地址", "备注", "状态"};
|
||||||
String title = "信息报表";
|
String title = "信息内容";
|
||||||
List<String[]> objects = new ArrayList<String[]>();
|
List<String[]> objects = new ArrayList<String[]>();
|
||||||
if (null != dataList) {
|
if (null != dataList) {
|
||||||
for (Supplier s : dataList) {
|
for (Supplier s : dataList) {
|
||||||
|
|||||||
Reference in New Issue
Block a user