rev:清洗上料相关修改

This commit is contained in:
zhangzhiqiang
2023-08-22 21:33:19 +08:00
parent 4c6484bc2b
commit 53f318fa8e
13 changed files with 108 additions and 27 deletions

View File

@@ -0,0 +1,24 @@
package org.nl.common.utils;
import org.apache.poi.ss.formula.functions.T;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
/*
* @author ZZQ
* @Date 2022/11/29 2:55 下午
*/
public class ListOf implements Serializable {
public static <K> ArrayList of(K... key){
ArrayList list = new ArrayList<>();
for (K k : key) {
list.add(k);
}
return list;
}
}

View File

@@ -30,8 +30,6 @@ import java.util.Map;
@RequestMapping("api/storagevehicleinfo") @RequestMapping("api/storagevehicleinfo")
public class MdPbStoragevehicleinfoController { public class MdPbStoragevehicleinfoController {
@Autowired
private IMdPbStoragevehicleinfoService storagevehicleinfoService;
@Autowired @Autowired
private IMdPbStoragevehicleinfoService istoragevehicleinfoService; private IMdPbStoragevehicleinfoService istoragevehicleinfoService;
@@ -50,7 +48,7 @@ public class MdPbStoragevehicleinfoController {
@Log("查询载具") @Log("查询载具")
//("查询载具") //("查询载具")
public ResponseEntity<Object> query(VehicleQuery whereJson, PageQuery page){ public ResponseEntity<Object> query(VehicleQuery whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(storagevehicleinfoService.queryAll(whereJson,page)),HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(istoragevehicleinfoService.queryAll(whereJson,page)),HttpStatus.OK);
} }
@PostMapping @PostMapping
@@ -65,7 +63,7 @@ public class MdPbStoragevehicleinfoController {
//("修改载具") //("修改载具")
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')") //@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto){ public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto){
storagevehicleinfoService.update(dto); istoragevehicleinfoService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }
@@ -74,7 +72,7 @@ public class MdPbStoragevehicleinfoController {
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:del')") //@PreAuthorize("@el.check('mdPbStoragevehicleinfo:del')")
@DeleteMapping @DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) { public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
storagevehicleinfoService.deleteAll(ids); istoragevehicleinfoService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@@ -83,7 +81,7 @@ public class MdPbStoragevehicleinfoController {
//("修改点位启用状态") //("修改点位启用状态")
//@PreAuthorize("@el.check('store:edit')") //@PreAuthorize("@el.check('store:edit')")
public ResponseEntity<Object> changeActive(@RequestBody JSONObject json) { public ResponseEntity<Object> changeActive(@RequestBody JSONObject json) {
storagevehicleinfoService.changeActive(json); istoragevehicleinfoService.changeActive(json);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }
@@ -92,7 +90,7 @@ public class MdPbStoragevehicleinfoController {
//("获取起始载具号") //("获取起始载具号")
//@PreAuthorize("@el.check('store:edit')") //@PreAuthorize("@el.check('store:edit')")
public ResponseEntity<Object> getVehicle(@PathVariable String code) { public ResponseEntity<Object> getVehicle(@PathVariable String code) {
JSONObject json = storagevehicleinfoService.getVehicle(code); JSONObject json = istoragevehicleinfoService.getVehicle(code);
return new ResponseEntity<>(json,HttpStatus.OK); return new ResponseEntity<>(json,HttpStatus.OK);
} }

View File

@@ -101,6 +101,13 @@ public class MdPbStoragevehicleinfo implements Serializable {
*/ */
private BigDecimal vehicle_width; private BigDecimal vehicle_width;
/**
* 载具重量(kg)
*/
private BigDecimal vehicle_weight;
/** /**
* 载具长度 * 载具长度
*/ */

View File

@@ -165,10 +165,6 @@ public class MdPbStoragevehicleinfoServiceImpl extends ServiceImpl<MdPbStorageve
@Override @Override
public void update(JSONObject dto) { public void update(JSONObject dto) {
Object byCode = this.findByCode(dto.getString("storagevehicle_code"));
if (!ObjectUtil.isEmpty(byCode)) {
throw new BadRequestException("此载具已存在");
}
MdPbStoragevehicleinfo entity = dto.toJavaObject(MdPbStoragevehicleinfo.class); MdPbStoragevehicleinfo entity = dto.toJavaObject(MdPbStoragevehicleinfo.class);
this.updateById(entity); this.updateById(entity);
} }

View File

@@ -276,6 +276,7 @@ public class PdaWashController {
task.put("material_name",materialbase!=null?materialbase.getMaterial_name():""); task.put("material_name",materialbase!=null?materialbase.getMaterial_name():"");
task.put("material_code",materialbase!=null?materialbase.getMaterial_code():""); task.put("material_code",materialbase!=null?materialbase.getMaterial_code():"");
task.put("material_spec",materialbase!=null?materialbase.getMaterial_spec():""); task.put("material_spec",materialbase!=null?materialbase.getMaterial_spec():"");
task.put("net_weight",materialbase!=null?materialbase.getNet_weight():"");
task.put("create_time",task.get("create_time").toString()); task.put("create_time",task.get("create_time").toString());
task.put("sep_on",i); task.put("sep_on",i);
i++; i++;

View File

@@ -83,14 +83,13 @@ public class WashSendMaterialTask extends AbstractAcsTask {
throw new BadRequestException(String.format("设备%s存在未完成任务"+list.stream().map(SchBaseTask::getTask_id).collect(Collectors.toList()).toString(), param.getString("device_code"))); throw new BadRequestException(String.format("设备%s存在未完成任务"+list.stream().map(SchBaseTask::getTask_id).collect(Collectors.toList()).toString(), param.getString("device_code")));
} }
SchBaseTask order = taskService.getById(param.getString("task_id")); SchBaseTask order = taskService.getById(param.getString("task_id"));
MdMeMaterialbase byId = materialbaseService.getById(order.getMaterial_id());
JSONObject form = new JSONObject(); JSONObject form = new JSONObject();
form.put("bill_type","0001"); form.put("bill_type","0001");
form.put("point_code",start_point_code); form.put("point_code",start_point_code);
form.put("stor_id", IOSEnum.STOR_CODE.code("半成品仓库"));//半成品仓库 form.put("stor_id", IOSEnum.STOR_CODE.code("半成品仓库"));//半成品仓库
form.put("total_qty",param.getString("wegiht")); form.put("total_qty",param.getString("wegiht"));
form.put("material_id",order.getMaterial_id()); form.put("material_id",order.getMaterial_id());
form.put("unit_weight",byId.getNet_weight()); form.put("unit_weight",param.getString("net_weight"));
form.put("storagevehicle_code",param.getString("vechile_code")); form.put("storagevehicle_code",param.getString("vechile_code"));
form.put("product_code","A1"); form.put("product_code","A1");
form.put("auto_send",true); form.put("auto_send",true);

View File

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.nl.common.anno.Log; import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.ListOf;
import org.nl.common.utils.MapOf; import org.nl.common.utils.MapOf;
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowVo; import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowVo;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery; import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
@@ -79,7 +80,8 @@ public class StIvtStructivtBcpController {
List<Map> maps = bcpService.queryAll(query); List<Map> maps = bcpService.queryAll(query);
String s = JSON.toJSONString(maps); String s = JSON.toJSONString(maps);
List<StIvtStructivtBcpVo> bcpVos = JSONArray.parseArray(s, StIvtStructivtBcpVo.class); List<StIvtStructivtBcpVo> bcpVos = JSONArray.parseArray(s, StIvtStructivtBcpVo.class);
columnInfoService.exportFile(bcpVos,response, MapOf.of("stor_name","仓库名称","material_name","物料名称","material_spec","物料规格")); columnInfoService.exportFile(bcpVos,response, ListOf.of("is_pick","ivt_level","is_active","qty_unit_id","stor_id","ivt_level","struct_id","material_id","quality_scode"),
MapOf.of("stor_name","仓库名称","material_name","物料名称","material_spec","物料规格","material_code","物料编号","storagevehicle_code","载具编号","vehicle_weight","载具单重(g)"));
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
} }

View File

@@ -142,12 +142,14 @@
attr.sect_code, attr.sect_code,
attr.sect_name, attr.sect_name,
attr.stor_name, attr.stor_name,
attr.storagevehicle_code attr.storagevehicle_code,
vehicle.vehicle_weight
FROM FROM
st_ivt_structivt_bcp ivt st_ivt_structivt_bcp ivt
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
LEFT JOIN md_pb_storagevehicleinfo vehicle ON vehicle.storagevehicle_code = attr.storagevehicle_code
<where> <where>
1=1 1=1
<if test="query.material_code!= null and query.material_code != ''"> <if test="query.material_code!= null and query.material_code != ''">

View File

@@ -98,5 +98,6 @@ public class StIvtStructivtBcpVo {
private String sect_name; private String sect_name;
private String stor_name; private String stor_name;
private String storagevehicle_code; private String storagevehicle_code;
private String vehicle_weight;
} }

View File

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.nl.common.anno.Log; import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.ListOf;
import org.nl.common.utils.MapOf; import org.nl.common.utils.MapOf;
import org.nl.wms.storage_manage.semimanage.service.structIvt.dto.StIvtStructivtBcpVo; import org.nl.wms.storage_manage.semimanage.service.structIvt.dto.StIvtStructivtBcpVo;
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService; import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService;
@@ -72,7 +73,9 @@ public class StIvtStructivtHrBcpController {
List<Map> maps = bcpService.queryAll(query); List<Map> maps = bcpService.queryAll(query);
String s = JSON.toJSONString(maps); String s = JSON.toJSONString(maps);
List<StIvtStructivtBcpVo> bcpVos = JSONArray.parseArray(s, StIvtStructivtBcpVo.class); List<StIvtStructivtBcpVo> bcpVos = JSONArray.parseArray(s, StIvtStructivtBcpVo.class);
columnInfoService.exportFile(bcpVos,response, MapOf.of("stor_name","仓库名称","material_name","物料名称","material_spec","物料规格")); columnInfoService.exportFile(bcpVos,response,
ListOf.of(""),
MapOf.of("stor_name","仓库名称","material_name","物料名称","material_spec","物料规格"));
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
} }

View File

@@ -43,7 +43,7 @@ public class ColumnInfoService {
}; };
@SneakyThrows @SneakyThrows
public <T> void exportFile(List<T> data, HttpServletResponse response, Map<String,String> customizMap) { public <T> void exportFile(List<T> data, HttpServletResponse response,List passParam, Map<String,String> customizMap) {
if (CollectionUtils.isEmpty(data)){ if (CollectionUtils.isEmpty(data)){
throw new BindException("导出失败,没有导出数据"+data.size()); throw new BindException("导出失败,没有导出数据"+data.size());
} }
@@ -58,6 +58,11 @@ public class ColumnInfoService {
} }
} }
Map<String,String> map = this.TableColumn(tableName.value()); Map<String,String> map = this.TableColumn(tableName.value());
if (!CollectionUtils.isEmpty(passParam)){
for (Object s : passParam) {
map.remove(s);
}
}
map.putAll(customizMap); map.putAll(customizMap);
if (CollectionUtils.isEmpty(map)){ if (CollectionUtils.isEmpty(map)){
throw new BindException("导出失败,表结构信息失败"+tableName.value()); throw new BindException("导出失败,表结构信息失败"+tableName.value());

View File

@@ -101,6 +101,29 @@
<el-button type="primary" @click="materiValueSubmit()">确认</el-button> <el-button type="primary" @click="materiValueSubmit()">确认</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
:close-on-click-modal="false"
:visible.sync="pointMVisible"
title="载具信息"
width="540px"
@close="materiValueCancel()"
>
<el-form ref="form" :model="updateForm" :rules="rules" size="mini" label-width="110px">
<el-form-item label="载具编号" prop="material_code">
<template slot-scope="scope">
<el-input v-model="updateForm.storagevehicle_code" clearable>
</el-input>
</template>
</el-form-item>
<el-form-item label="载具重量(kg)" prop="vehicle_weight">
<el-input-number v-model="updateForm.vehicle_weight" clearable style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="materiValueCancel()">取消</el-button>
<el-button type="primary" @click="pointMateriSubmit()">确认</el-button>
</div>
</el-dialog>
<el-dialog <el-dialog
:before-close="crud.cancelCU" :before-close="crud.cancelCU"
@@ -167,6 +190,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="storagevehicle_name" label="载具名称" /> <el-table-column prop="storagevehicle_name" label="载具名称" />
<el-table-column prop="vehicle_weight" label="载具单重(kg)" />
<el-table-column label="是否启用" align="center" prop="is_used"> <el-table-column label="是否启用" align="center" prop="is_used">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@@ -182,15 +206,18 @@
<el-table-column <el-table-column
v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']" v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']"
label="操作" label="操作"
width="100px" width="200px"
align="center" align="center"
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button icon="el-icon-position" type="text" class="filter-item" size="mini" @click="updateweight(scope.row)">修改</el-button>
<udOperation <udOperation
:data="scope.row" :data="scope.row"
:permission="permission" :permission="permission"
:is-visiable-edit="false" :is-visiable-edit="false"
class="filter-item"
/> />
</template> </template>
</el-table-column> </el-table-column>
@@ -274,6 +301,8 @@ export default {
} }
} }
return { return {
updateForm: {},
pointMVisible: false,
materType:'', materType:'',
materialShow: false, materialShow: false,
dialogVisible: false, dialogVisible: false,
@@ -329,17 +358,17 @@ export default {
this.materialForm.material_spec = row.material_spec this.materialForm.material_spec = row.material_spec
}, },
materiValueCancel(){ materiValueCancel(){
this.materialForm = {} this.updateForm = {}
this.dialogVisible = false this.pointMVisible = false
}, },
materiValueSubmit(){ materiValueSubmit(){
console.log(this.materialForm) console.log(this.updateForm)
crudStoragevehicleinfo.updateVehicleMaterial(this.materialForm).then(res => { // crudStoragevehicleinfo.updateVehicleMaterial(this.materialForm).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS) // this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.materiValueCancel() // this.materiValueCancel()
}).catch(() => { // }).catch(() => {
//
}) // })
}, },
hand(value) { hand(value) {
this.crud.toQuery() this.crud.toQuery()
@@ -392,6 +421,19 @@ export default {
this.materialForm = data this.materialForm = data
}) })
}, },
updateweight(row){
this.pointMVisible = true
this.updateForm = row
},
pointMateriSubmit(){
console.log(this.updateForm)
crudStoragevehicleinfo.edit(this.updateForm).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
this.updateForm = {}
this.pointMVisible = false
this.crud.refresh()
},
addAndprint() { addAndprint() {
const data = this.form const data = this.form
if (!this.form.storagevehicle_type) { if (!this.form.storagevehicle_type) {

View File

@@ -93,6 +93,7 @@
<el-table-column show-overflow-tooltip min-width="120" prop="material_name" label="物料名称" /> <el-table-column show-overflow-tooltip min-width="120" prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip min-width="120" prop="material_spec" label="物料规格" /> <el-table-column show-overflow-tooltip min-width="120" prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" /> <el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="vehicle_weight" label="载具单重(g)" />
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可用重量(g)" :formatter="crud.formatNum3" /> <el-table-column show-overflow-tooltip prop="canuse_qty" label="可用重量(g)" :formatter="crud.formatNum3" />
<!-- <el-table-column show-overflow-tooltip prop="unit_name" label="单位" />--> <!-- <el-table-column show-overflow-tooltip prop="unit_name" label="单位" />-->
<el-table-column show-overflow-tooltip prop="instorage_time" label="入库时间" min-width="150" /> <el-table-column show-overflow-tooltip prop="instorage_time" label="入库时间" min-width="150" />