|
@@ -481,7 +481,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<Map<String, Object>> getWarehouseBusinessList(TWarehouseBills tWarehousebills) {
|
|
|
- return tWarehouseBillsMapper.selectWarehouseBusinessList(tWarehousebills);
|
|
|
+ List<Map<String, Object>> list = tWarehouseBillsMapper.selectWarehouseBusinessList(tWarehousebills);
|
|
|
+ list.forEach(map -> {
|
|
|
+ map.put("fBilltype", "其他账务");
|
|
|
+ map.put("shipsName", tVesselMapper.selectTVesselById(((Integer) map.get("fVslid")).longValue()).getfName());
|
|
|
+ map.put("voyage", tVoyageMapper.selectTVoyageById(((Integer) map.get("fVoyid")).longValue()).getfNo());
|
|
|
+ });
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2025,7 +2031,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
@Transactional
|
|
|
public AjaxResult saveOtherFees(String tWarehouseBills, String feesCr, String feesDr, String type) {
|
|
|
TWarehouseBills warehouseBills = JSONArray.parseObject(tWarehouseBills, TWarehouseBills.class);
|
|
|
- warehouseBills.setfBilltype("QTZW");
|
|
|
+ String billsType = "QTZW";
|
|
|
+ warehouseBills.setfBilltype(billsType);
|
|
|
// 判断提单号是否存在
|
|
|
if (StringUtils.isNull(warehouseBills.getfId()) && tWarehouseBillsMapper.selectContainMblno(warehouseBills) > 0) {
|
|
|
return AjaxResult.error("该参看编号已存在");
|
|
@@ -2041,6 +2048,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNull(warehouseBills.getfId())) {
|
|
|
+ warehouseBills.setfBillno(billnoSerialServiceImpl.getBillNo(billsType, warehouseBills.getfBsdate()));
|
|
|
warehouseBills.setCreateTime(new Date());
|
|
|
warehouseBills.setCreateBy(SecurityUtils.getUsername());
|
|
|
warehouseBills.setfDeptid(SecurityUtils.getLoginUser().getUser().getDeptId());
|
|
@@ -8023,7 +8031,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Map<String, String> stockStatistics() {
|
|
|
+ public Map<String, String> stockStatistics(String mode) {
|
|
|
String external = null;
|
|
|
String customerName;
|
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
@@ -8040,26 +8048,26 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
// 客户名称
|
|
|
data.put("customerName", customerName);
|
|
|
// 全部库存
|
|
|
- data.put("stockTotal", stockStatistics(null, null, external));
|
|
|
+ data.put("stockTotal", stockStatistics(null, null, external, mode));
|
|
|
|
|
|
// 今天
|
|
|
- data.put("inStockTotalToday", inAndOutStockStatistics("SJRK", DateUtils.today(), DateUtils.today(), external));
|
|
|
- data.put("outStockTotalToday", inAndOutStockStatistics("SJCK", DateUtils.today(), DateUtils.today(), external));
|
|
|
+ data.put("inStockTotalToday", inAndOutStockStatistics("SJRK", DateUtils.today(), DateUtils.today(), external, mode));
|
|
|
+ data.put("outStockTotalToday", inAndOutStockStatistics("SJCK", DateUtils.today(), DateUtils.today(), external, mode));
|
|
|
// 昨天
|
|
|
- data.put("inStockTotalYesterday", inAndOutStockStatistics("SJRK", DateUtils.yesterday(), DateUtils.yesterday(), external));
|
|
|
- data.put("outStockTotalYesterday", inAndOutStockStatistics("SJCK", DateUtils.yesterday(), DateUtils.yesterday(), external));
|
|
|
+ data.put("inStockTotalYesterday", inAndOutStockStatistics("SJRK", DateUtils.yesterday(), DateUtils.yesterday(), external, mode));
|
|
|
+ data.put("outStockTotalYesterday", inAndOutStockStatistics("SJCK", DateUtils.yesterday(), DateUtils.yesterday(), external, mode));
|
|
|
// 本周
|
|
|
- data.put("inStockTotalWeek", inAndOutStockStatistics("SJRK", DateUtils.beginOfWeek(), DateUtils.endOfWeek(), external));
|
|
|
- data.put("outStockTotalWeek", inAndOutStockStatistics("SJCK", DateUtils.beginOfWeek(), DateUtils.endOfWeek(), external));
|
|
|
+ data.put("inStockTotalWeek", inAndOutStockStatistics("SJRK", DateUtils.beginOfWeek(), DateUtils.endOfWeek(), external, mode));
|
|
|
+ data.put("outStockTotalWeek", inAndOutStockStatistics("SJCK", DateUtils.beginOfWeek(), DateUtils.endOfWeek(), external, mode));
|
|
|
// 上周
|
|
|
- data.put("inStockTotalLastWeek", inAndOutStockStatistics("SJRK", DateUtils.beginOfLastWeek(), DateUtils.endOfLastWeek(), external));
|
|
|
- data.put("outStockTotalLastWeek", inAndOutStockStatistics("SJCK", DateUtils.beginOfLastWeek(), DateUtils.endOfLastWeek(), external));
|
|
|
+ data.put("inStockTotalLastWeek", inAndOutStockStatistics("SJRK", DateUtils.beginOfLastWeek(), DateUtils.endOfLastWeek(), external, mode));
|
|
|
+ data.put("outStockTotalLastWeek", inAndOutStockStatistics("SJCK", DateUtils.beginOfLastWeek(), DateUtils.endOfLastWeek(), external, mode));
|
|
|
// 本月
|
|
|
- data.put("inStockTotalMonth", inAndOutStockStatistics("SJRK", DateUtils.beginOfMonth(), DateUtils.endOfMonth(), external));
|
|
|
- data.put("outStockTotalMonth", inAndOutStockStatistics("SJCK", DateUtils.beginOfMonth(), DateUtils.endOfMonth(), external));
|
|
|
+ data.put("inStockTotalMonth", inAndOutStockStatistics("SJRK", DateUtils.beginOfMonth(), DateUtils.endOfMonth(), external, mode));
|
|
|
+ data.put("outStockTotalMonth", inAndOutStockStatistics("SJCK", DateUtils.beginOfMonth(), DateUtils.endOfMonth(), external, mode));
|
|
|
// 上个月
|
|
|
- data.put("inStockTotalLastMonth", inAndOutStockStatistics("SJRK", DateUtils.beginOfLastMonth(), DateUtils.endOfLastMonth(), external));
|
|
|
- data.put("outStockTotalLastMonth", inAndOutStockStatistics("SJCK", DateUtils.beginOfLastMonth(), DateUtils.endOfLastMonth(), external));
|
|
|
+ data.put("inStockTotalLastMonth", inAndOutStockStatistics("SJRK", DateUtils.beginOfLastMonth(), DateUtils.endOfLastMonth(), external, mode));
|
|
|
+ data.put("outStockTotalLastMonth", inAndOutStockStatistics("SJCK", DateUtils.beginOfLastMonth(), DateUtils.endOfLastMonth(), external, mode));
|
|
|
return data;
|
|
|
}
|
|
|
|
|
@@ -8069,7 +8077,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Map<String, String> cycleStockStatistics() {
|
|
|
+ public Map<String, String> cycleStockStatistics(String mode) {
|
|
|
String external = null;
|
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
if ("外部用户".equals(user.getDept().getDeptName())) {
|
|
@@ -8080,37 +8088,48 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
// 库龄
|
|
|
data.put("stockDays", String.valueOf(tWhgenlegMapper.stockDays(external, null, null).get("stockDays")));
|
|
|
// 7天
|
|
|
- data.put("stockTotalA", stockStatistics(DateUtils.offsetDate(-6), null, external));
|
|
|
+ data.put("stockTotalA", stockStatistics(DateUtils.offsetDate(-6), null, external, mode));
|
|
|
// 15天
|
|
|
- data.put("stockTotalB", stockStatistics(DateUtils.offsetDate(-14), DateUtils.offsetDate(-6), external));
|
|
|
+ data.put("stockTotalB", stockStatistics(DateUtils.offsetDate(-14), DateUtils.offsetDate(-6), external, mode));
|
|
|
// 30天
|
|
|
- data.put("stockTotalC", stockStatistics(DateUtils.offsetDate(-29), DateUtils.offsetDate(-14), external));
|
|
|
+ data.put("stockTotalC", stockStatistics(DateUtils.offsetDate(-29), DateUtils.offsetDate(-14), external, mode));
|
|
|
// 60天
|
|
|
- data.put("stockTotalD", stockStatistics(DateUtils.offsetDate(-59), DateUtils.offsetDate(-29), external));
|
|
|
+ data.put("stockTotalD", stockStatistics(DateUtils.offsetDate(-59), DateUtils.offsetDate(-29), external, mode));
|
|
|
// 90天
|
|
|
- data.put("stockTotalE", stockStatistics(DateUtils.offsetDate(-89), DateUtils.offsetDate(-59), external));
|
|
|
+ data.put("stockTotalE", stockStatistics(DateUtils.offsetDate(-89), DateUtils.offsetDate(-59), external, mode));
|
|
|
// 180天
|
|
|
- data.put("stockTotalF", stockStatistics(DateUtils.offsetDate(-179), DateUtils.offsetDate(-89), external));
|
|
|
+ data.put("stockTotalF", stockStatistics(DateUtils.offsetDate(-179), DateUtils.offsetDate(-89), external, mode));
|
|
|
// 180天+
|
|
|
- data.put("stockTotalG", stockStatistics(null, DateUtils.offsetDate(-179), external));
|
|
|
+ data.put("stockTotalG", stockStatistics(null, DateUtils.offsetDate(-179), external, mode));
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
- private String inAndOutStockStatistics(String billType, String beginDate, String endDate, String external) {
|
|
|
+ private String inAndOutStockStatistics(String billType, String beginDate, String endDate, String external, String mode) {
|
|
|
beginDate += " 00:00:00";
|
|
|
endDate += " 23:59:59";
|
|
|
- Map<String, Object> statistics = tWarehousebillsitemsMapper.inAndOutStockStatistics(billType, beginDate, endDate, external, null, null, null);
|
|
|
+ Map<String, Object> statistics;
|
|
|
+ if ("4".equals(mode)) {
|
|
|
+ statistics = tWarehousebillsitemsMapper.inAndOutStockTeuStatistics(billType, beginDate, endDate, external, null, null);
|
|
|
+ return String.valueOf(((Double) statistics.get("total")).longValue());
|
|
|
+ }
|
|
|
+ statistics = tWarehousebillsitemsMapper.inAndOutStockStatistics(billType, beginDate, endDate, external, null, null, mode);
|
|
|
return String.valueOf(statistics.get("total"));
|
|
|
}
|
|
|
|
|
|
- private String stockStatistics(String beginDate, String endDate, String external) {
|
|
|
+ private String stockStatistics(String beginDate, String endDate, String external, String mode) {
|
|
|
if (StringUtils.isNotEmpty(beginDate)) {
|
|
|
beginDate += " 00:00:00";
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(endDate)) {
|
|
|
endDate += " 00:00:00";
|
|
|
}
|
|
|
- Map<String, Object> statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null, null, null);
|
|
|
+
|
|
|
+ Map<String, Object> statistics;
|
|
|
+ if ("4".equals(mode)) {
|
|
|
+ statistics = tWhgenlegMapper.stockTeuStatistics(beginDate, endDate, external, null, null);
|
|
|
+ return String.valueOf(((Double) statistics.get("quantity")).longValue());
|
|
|
+ }
|
|
|
+ statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null, null, mode);
|
|
|
return String.valueOf(statistics.get("quantity"));
|
|
|
}
|
|
|
|