opt:优化界面操作

This commit is contained in:
2025-03-17 17:41:42 +08:00
parent 67ffc2b5d8
commit 2d4468d050
7 changed files with 44 additions and 25 deletions

View File

@@ -3,6 +3,7 @@ package org.nl.wms.base_manage.measure.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.TableDataInfo; import org.nl.common.TableDataInfo;
@@ -43,7 +44,7 @@ public class BmMeasureunitController {
@GetMapping("/select") @GetMapping("/select")
@Log("查询单位下拉列表设备") @Log("查询单位下拉列表设备")
public ResponseEntity<Object> selectAll() { public ResponseEntity<Object> selectAll() {
List<BmMeasureUnit> list = measureUnitService.list(); List<BmMeasureUnit> list = measureUnitService.list(new LambdaUpdateWrapper<BmMeasureUnit>().orderByDesc(BmMeasureUnit::getExt_id));
List<Map> result = new ArrayList<>(); List<Map> result = new ArrayList<>();
for (BmMeasureUnit item : list) { for (BmMeasureUnit item : list) {
result.add(MapOf.of("label", item.getUnit_name(), "value", item.getUnit_id())); result.add(MapOf.of("label", item.getUnit_name(), "value", item.getUnit_id()));

View File

@@ -43,8 +43,8 @@ public class InStorageTask extends AbstractTask {
@Override @Override
public JSONObject createTask(JSONObject from) { public JSONObject createTask(JSONObject from) {
String vehicle_code = from.getString("vehicle_code"); String vehicle_code = "Z00004035";
String struct_code = from.getJSONObject("form_data").getString("end_struct_code"); String struct_code = "L01-22-33";
String start_point = from.getString("start_point"); String start_point = from.getString("start_point");
String task_type = from.getString("task_type"); String task_type = from.getString("task_type");
if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(start_point)||StringUtils.isEmpty(struct_code)){ if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(start_point)||StringUtils.isEmpty(struct_code)){

View File

@@ -17,6 +17,7 @@ import org.nl.common.enums.StatusEnum;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService; import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData; import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
import org.nl.wms.pm_manage.form_data.service.dao.mapper.PmFormDataMapper;
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery; import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -43,7 +44,8 @@ public class PmFormDataController {
@Autowired @Autowired
private IPmFormDataService iPmFormDataService; private IPmFormDataService iPmFormDataService;
@Autowired
private PmFormDataMapper pFormDataMapper;
@GetMapping() @GetMapping()
@Log("查询数据") @Log("查询数据")
@@ -65,10 +67,10 @@ public class PmFormDataController {
@DeleteMapping @DeleteMapping
@Transactional @Transactional
@Log("删除单据") @Log("删除单据")
public ResponseEntity<Object> delete(@RequestBody Long[] ids) { public ResponseEntity<Object> delete(@RequestBody String[] ids) {
if (ids.length > 0) { if (ids.length > 0) {
iPmFormDataService.removeByIds(Arrays.asList(ids)); pFormDataMapper.delete(new LambdaUpdateWrapper<PmFormData>().in(PmFormData::getId,ids));
iPmFormDataService.remove(new QueryWrapper<PmFormData>().in("parent_id",ids)); pFormDataMapper.delete(new LambdaUpdateWrapper<PmFormData>().in(PmFormData::getParent_id,ids));
} }
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }

View File

@@ -353,8 +353,10 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
for (PmFormDataDto child : children) { for (PmFormDataDto child : children) {
String childProductArea = child.getForm_data().getString("product_area"); String childProductArea = child.getForm_data().getString("product_area");
child.setProduct_area(childProductArea); child.setProduct_area(childProductArea);
BigDecimal total = child.getPlan_qty().subtract(child.getAssign_qty().add(child.getActual_qty() == null ? BigDecimal.ZERO : child.getActual_qty())); if (child.getPlan_qty() != null&& child.getAssign_qty().compareTo(BigDecimal.ZERO) == 0) {
child.setQty(total.compareTo(BigDecimal.ZERO) > 0 ? total : BigDecimal.ZERO); BigDecimal total = child.getPlan_qty().subtract(child.getAssign_qty().add(child.getActual_qty() == null ? BigDecimal.ZERO : child.getActual_qty()));
child.setQty(total.compareTo(BigDecimal.ZERO) > 0 ? total : BigDecimal.ZERO);
}
} }
} }
dataDto.setChildren(children); dataDto.setChildren(children);
@@ -420,8 +422,10 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
child.setSto_qty(BigDecimal.valueOf(maps.stream().mapToInt(a -> a.getSto_qty().intValue()).sum())); child.setSto_qty(BigDecimal.valueOf(maps.stream().mapToInt(a -> a.getSto_qty().intValue()).sum()));
child.setPcsn(""); child.setPcsn("");
} }
BigDecimal total = child.getPlan_qty().subtract(child.getAssign_qty().add(child.getActual_qty() == null ? BigDecimal.ZERO : child.getActual_qty())); if (child.getPlan_qty() != null&& child.getAssign_qty().compareTo(BigDecimal.ZERO) == 0) {
child.setQty(total.compareTo(BigDecimal.ZERO) > 0 ? total : BigDecimal.ZERO); BigDecimal total = child.getPlan_qty().subtract(child.getAssign_qty().add(child.getActual_qty() == null ? BigDecimal.ZERO : child.getActual_qty()));
child.setQty(total.compareTo(BigDecimal.ZERO) > 0 ? total : BigDecimal.ZERO);
}
} }
pmFormDataDto.setChildren(childs); pmFormDataDto.setChildren(childs);
return pmFormDataDto; return pmFormDataDto;

View File

@@ -1,10 +1,11 @@
package org.nl.wms.stor_manage.io.service.iostor_dtl.impl; package org.nl.wms.stor_manage.io.service.iostor_dtl.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.common.utils.MapOf; import org.nl.common.utils.MapOf;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService; import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater; import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
import org.nl.wms.stor_manage.io.service.iostor_dtl.IStIvtIostorinvdtlService; import org.nl.wms.stor_manage.io.service.iostor_dtl.IStIvtIostorinvdtlService;
@@ -17,7 +18,10 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -52,14 +56,21 @@ public class StIvtIostorinvdtlServiceImpl extends ServiceImpl<StIvtIostorinvdtlM
//查询载具所在仓位 //查询载具所在仓位
for (Map map : byInv) { for (Map map : byInv) {
Object vehicle_code = map.get("vehicle_code"); Object vehicle_code = map.get("vehicle_code");
if (vehicle_code!=null){ Object sourceFormData = map.get("source_form_data");
//获取源单号
if (sourceFormData != null) {
JSONObject formData = JSON.parseObject(map.get("source_form_data").toString());
map.put("qty", formData.getString("qty"));
map.put("billCode", formData.getString("code"));
}
if (vehicle_code != null) {
List<String> vehicles = Arrays.asList(((String) vehicle_code).split(",")); List<String> vehicles = Arrays.asList(((String) vehicle_code).split(","));
List<StructattrVechielDto> vechielDtos = iStIvtStructattrService.collectVechicle(MapOf.of("material_id", map.get("material_id") List<StructattrVechielDto> vechielDtos = iStIvtStructattrService.collectVechicle(MapOf.of("material_id", map.get("material_id")
, "pcsn", map.get("pcsn") , "pcsn", map.get("pcsn")
, "stor_code", map.get("stor_code") , "stor_code", map.get("stor_code")
, "vehicles", vehicles)); , "vehicles", vehicles));
String structs = vechielDtos.stream().map(StructattrVechielDto::getStruct_code).collect(Collectors.joining(",")); String structs = vechielDtos.stream().map(StructattrVechielDto::getStruct_code).collect(Collectors.joining(","));
map.put("struct_code",structs); map.put("struct_code", structs);
} }
} }
return byInv; return byInv;

View File

@@ -222,16 +222,16 @@ public class SyncErpBillsScheduleService {
filterString = "FBillNo like '%" + code + "'"; filterString = "FBillNo like '%" + code + "'";
} else { } else {
filterString = BILL_ORG_MAPPING.get(formType) + " = '750572' "; filterString = BILL_ORG_MAPPING.get(formType) + " = '750572' ";
if ("ka7c19edf9d4b4b39b8cc4a06802163b0".equals(formType)) { }
filterString += "AND FDocumentStatus = 'C' AND F_PMSY_BillStatus = 'A' AND F_PMSY_CreateDate >= '" + timeStart + " 00:00:00' AND F_PMSY_CreateDate <= '" + timeEnd + " 23:59:59' "; if ("ka7c19edf9d4b4b39b8cc4a06802163b0".equals(formType)) {
} else if ("SAL_SaleOrder".equals(formType)) { filterString += "AND FDocumentStatus = 'C' AND F_PMSY_BillStatus = 'A' AND F_PMSY_CreateDate >= '" + timeStart + " 00:00:00' AND F_PMSY_CreateDate <= '" + timeEnd + " 23:59:59' ";
filterString += " AND FDocumentStatus = 'C' AND FCloseStatus ='A' AND FCreateDate >= '" + timeStart + " 00:00:00' and FCreateDate <= '" + timeEnd + " 23:59:59' "; } else if ("SAL_SaleOrder".equals(formType)) {
//调拨出入库,采购退料单,销售退货入库单,其他出库单 filterString += " AND FDocumentStatus = 'C' AND FCloseStatus ='A' AND FCreateDate >= '" + timeStart + " 00:00:00' and FCreateDate <= '" + timeEnd + " 23:59:59' ";
} else if ("STK_TransferDirect".equals(formType) || "STK_MisDelivery".equals(formType) || "PUR_MRB".equals(formType) || "SAL_RETURNSTOCK".equals(formType)) { //调拨出入库,采购退料单,销售退货入库单,其他出库单
filterString += " AND FDocumentStatus ='B' AND FCreateDate >= '" + timeStart + " 00:00:00' and FCreateDate <= '" + timeEnd + " 23:59:59' "; } else if ("STK_TransferDirect".equals(formType) || "STK_MisDelivery".equals(formType) || "PUR_MRB".equals(formType) || "SAL_RETURNSTOCK".equals(formType)) {
} else { filterString += " AND FDocumentStatus ='B' AND FCreateDate >= '" + timeStart + " 00:00:00' and FCreateDate <= '" + timeEnd + " 23:59:59' ";
filterString += " AND FDocumentStatus = 'C' AND FCreateDate >= '" + timeStart + " 00:00:00' and FCreateDate <= '" + timeEnd + " 23:59:59' "; } else {
} filterString += " AND FDocumentStatus = 'C' AND FCreateDate >= '" + timeStart + " 00:00:00' and FCreateDate <= '" + timeEnd + " 23:59:59' ";
} }
return filterString; return filterString;
} }

View File

@@ -250,6 +250,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="vehicle_code" label="载具编码" min-width="120" show-overflow-tooltip /> <el-table-column prop="vehicle_code" label="载具编码" min-width="120" show-overflow-tooltip />
<!-- <el-table-column prop="priority" label="优先级"/>--> <!-- <el-table-column prop="priority" label="优先级"/>-->
<!-- <el-table-column prop="point_location" label="位置" min-width="120" show-overflow-tooltip/>--> <!-- <el-table-column prop="point_location" label="位置" min-width="120" show-overflow-tooltip/>-->
<!-- <el-table-column prop="group_code" label="点位组编码" min-width="120" show-overflow-tooltip/>--> <!-- <el-table-column prop="group_code" label="点位组编码" min-width="120" show-overflow-tooltip/>-->