优化客户对账和供应商对账的导出excel功能
This commit is contained in:
@@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Date;
|
||||
import java.text.DecimalFormat;
|
||||
@@ -547,4 +548,41 @@ public class DepotHeadController {
|
||||
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出存在欠款的单据
|
||||
* @param organId
|
||||
* @param materialParam
|
||||
* @param number
|
||||
* @param type
|
||||
* @param subType
|
||||
* @param beginTime
|
||||
* @param endTime
|
||||
* @param roleType
|
||||
* @param status
|
||||
* @param mpList
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping(value = "/debtExport")
|
||||
@ApiOperation(value = "导出存在欠款的单据")
|
||||
public void debtExport(@RequestParam(value = "organId", required = false) Long organId,
|
||||
@RequestParam(value = "materialParam", required = false) String materialParam,
|
||||
@RequestParam(value = "number", required = false) String number,
|
||||
@RequestParam(value = "type", required = false) String type,
|
||||
@RequestParam(value = "subType", required = false) String subType,
|
||||
@RequestParam(value = "beginTime", required = false) String beginTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime,
|
||||
@RequestParam(value = "roleType", required = false) String roleType,
|
||||
@RequestParam(value = "status", required = false) String status,
|
||||
@RequestParam(value = "mpList", required = false) String mpList,
|
||||
HttpServletRequest request, HttpServletResponse response)throws Exception {
|
||||
try {
|
||||
depotHeadService.debtExport(organId, materialParam, number, type, subType, beginTime, endTime, roleType,
|
||||
status, mpList, request, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public class DepotItemController {
|
||||
item.put("standard", diEx.getMStandard());
|
||||
item.put("model", diEx.getMModel());
|
||||
item.put("color", diEx.getMColor());
|
||||
item.put("materialOther", getOtherInfo(mpArr, diEx));
|
||||
item.put("materialOther", depotItemService.getOtherInfo(mpArr, diEx));
|
||||
BigDecimal stock;
|
||||
Unit unitInfo = materialService.findUnit(diEx.getMaterialId()); //查询计量单位信息
|
||||
String materialUnit = diEx.getMaterialUnit();
|
||||
@@ -302,30 +302,6 @@ public class DepotItemController {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getOtherInfo(String[] mpArr, DepotItemVo4WithInfoEx diEx)throws Exception {
|
||||
String materialOther = "";
|
||||
for (int i = 0; i < mpArr.length; i++) {
|
||||
if (mpArr[i].equals("制造商")) {
|
||||
materialOther = materialOther + ((diEx.getMMfrs() == null || diEx.getMMfrs().equals("")) ? "" : "(" + diEx.getMMfrs() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义1")) {
|
||||
materialOther = materialOther + ((diEx.getMOtherField1() == null || diEx.getMOtherField1().equals("")) ? "" : "(" + diEx.getMOtherField1() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义2")) {
|
||||
materialOther = materialOther + ((diEx.getMOtherField2() == null || diEx.getMOtherField2().equals("")) ? "" : "(" + diEx.getMOtherField2() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义3")) {
|
||||
materialOther = materialOther + ((diEx.getMOtherField3() == null || diEx.getMOtherField3().equals("")) ? "" : "(" + diEx.getMOtherField3() + ")");
|
||||
}
|
||||
}
|
||||
return materialOther;
|
||||
}
|
||||
|
||||
/**
|
||||
* 进销存统计
|
||||
* @param currentPage
|
||||
@@ -374,7 +350,7 @@ public class DepotItemController {
|
||||
item.put("materialModel", diEx.getMModel());
|
||||
item.put("materialStandard", diEx.getMStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, diEx);
|
||||
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
|
||||
item.put("materialOther", materialOther);
|
||||
item.put("materialColor", diEx.getMColor());
|
||||
item.put("unitId", diEx.getUnitId());
|
||||
@@ -537,7 +513,7 @@ public class DepotItemController {
|
||||
item.put("materialModel", diEx.getMModel());
|
||||
item.put("materialStandard", diEx.getMStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, diEx);
|
||||
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
|
||||
item.put("materialOther", materialOther);
|
||||
item.put("materialColor", diEx.getMColor());
|
||||
item.put("materialUnit", diEx.getMaterialUnit());
|
||||
@@ -618,7 +594,7 @@ public class DepotItemController {
|
||||
item.put("materialModel", diEx.getMModel());
|
||||
item.put("materialStandard", diEx.getMStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, diEx);
|
||||
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
|
||||
item.put("materialOther", materialOther);
|
||||
item.put("materialColor", diEx.getMColor());
|
||||
item.put("materialUnit", diEx.getMaterialUnit());
|
||||
@@ -700,7 +676,7 @@ public class DepotItemController {
|
||||
item.put("materialModel", diEx.getMModel());
|
||||
item.put("materialStandard", diEx.getMStandard());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, diEx);
|
||||
String materialOther = depotItemService.getOtherInfo(mpArr, diEx);
|
||||
item.put("materialOther", materialOther);
|
||||
item.put("materialColor", diEx.getMColor());
|
||||
item.put("materialUnit", diEx.getMaterialUnit());
|
||||
@@ -781,7 +757,7 @@ public class DepotItemController {
|
||||
diEx.setMOtherField1(disw.getMOtherField1());
|
||||
diEx.setMOtherField2(disw.getMOtherField2());
|
||||
diEx.setMOtherField3(disw.getMOtherField3());
|
||||
disw.setMaterialOther(getOtherInfo(mpArr, diEx));
|
||||
disw.setMaterialOther(depotItemService.getOtherInfo(mpArr, diEx));
|
||||
disw.setMaterialUnit(getUName(disw.getMaterialUnit(), disw.getUnitName()));
|
||||
if(null!=disw.getLowSafeStock() && disw.getCurrentNumber().compareTo(disw.getLowSafeStock())<0) {
|
||||
disw.setLowCritical(disw.getLowSafeStock().subtract(disw.getCurrentNumber()));
|
||||
|
||||
Reference in New Issue
Block a user