rev:清洗上料相关修改
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,6 @@ import java.util.Map;
|
||||
@RequestMapping("api/storagevehicleinfo")
|
||||
public class MdPbStoragevehicleinfoController {
|
||||
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleinfoService storagevehicleinfoService;
|
||||
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleinfoService istoragevehicleinfoService;
|
||||
@@ -50,7 +48,7 @@ public class MdPbStoragevehicleinfoController {
|
||||
@Log("查询载具")
|
||||
//("查询载具")
|
||||
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
|
||||
@@ -65,7 +63,7 @@ public class MdPbStoragevehicleinfoController {
|
||||
//("修改载具")
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto){
|
||||
storagevehicleinfoService.update(dto);
|
||||
istoragevehicleinfoService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@@ -74,7 +72,7 @@ public class MdPbStoragevehicleinfoController {
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
storagevehicleinfoService.deleteAll(ids);
|
||||
istoragevehicleinfoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -83,7 +81,7 @@ public class MdPbStoragevehicleinfoController {
|
||||
//("修改点位启用状态")
|
||||
//@PreAuthorize("@el.check('store:edit')")
|
||||
public ResponseEntity<Object> changeActive(@RequestBody JSONObject json) {
|
||||
storagevehicleinfoService.changeActive(json);
|
||||
istoragevehicleinfoService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@@ -92,7 +90,7 @@ public class MdPbStoragevehicleinfoController {
|
||||
//("获取起始载具号")
|
||||
//@PreAuthorize("@el.check('store:edit')")
|
||||
public ResponseEntity<Object> getVehicle(@PathVariable String code) {
|
||||
JSONObject json = storagevehicleinfoService.getVehicle(code);
|
||||
JSONObject json = istoragevehicleinfoService.getVehicle(code);
|
||||
return new ResponseEntity<>(json,HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,13 @@ public class MdPbStoragevehicleinfo implements Serializable {
|
||||
*/
|
||||
private BigDecimal vehicle_width;
|
||||
|
||||
|
||||
/**
|
||||
* 载具重量(kg)
|
||||
*/
|
||||
private BigDecimal vehicle_weight;
|
||||
|
||||
|
||||
/**
|
||||
* 载具长度
|
||||
*/
|
||||
|
||||
@@ -165,10 +165,6 @@ public class MdPbStoragevehicleinfoServiceImpl extends ServiceImpl<MdPbStorageve
|
||||
|
||||
@Override
|
||||
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);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
@@ -276,6 +276,7 @@ public class PdaWashController {
|
||||
task.put("material_name",materialbase!=null?materialbase.getMaterial_name():"");
|
||||
task.put("material_code",materialbase!=null?materialbase.getMaterial_code():"");
|
||||
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("sep_on",i);
|
||||
i++;
|
||||
|
||||
@@ -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")));
|
||||
}
|
||||
SchBaseTask order = taskService.getById(param.getString("task_id"));
|
||||
MdMeMaterialbase byId = materialbaseService.getById(order.getMaterial_id());
|
||||
JSONObject form = new JSONObject();
|
||||
form.put("bill_type","0001");
|
||||
form.put("point_code",start_point_code);
|
||||
form.put("stor_id", IOSEnum.STOR_CODE.code("半成品仓库"));//半成品仓库
|
||||
form.put("total_qty",param.getString("wegiht"));
|
||||
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("product_code","A1");
|
||||
form.put("auto_send",true);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.ListOf;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowVo;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
|
||||
@@ -79,7 +80,8 @@ public class StIvtStructivtBcpController {
|
||||
List<Map> maps = bcpService.queryAll(query);
|
||||
String s = JSON.toJSONString(maps);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,12 +142,14 @@
|
||||
attr.sect_code,
|
||||
attr.sect_name,
|
||||
attr.stor_name,
|
||||
attr.storagevehicle_code
|
||||
attr.storagevehicle_code,
|
||||
vehicle.vehicle_weight
|
||||
FROM
|
||||
st_ivt_structivt_bcp ivt
|
||||
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 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>
|
||||
1=1
|
||||
<if test="query.material_code!= null and query.material_code != ''">
|
||||
|
||||
@@ -98,5 +98,6 @@ public class StIvtStructivtBcpVo {
|
||||
private String sect_name;
|
||||
private String stor_name;
|
||||
private String storagevehicle_code;
|
||||
private String vehicle_weight;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.ListOf;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dto.StIvtStructivtBcpVo;
|
||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService;
|
||||
@@ -72,7 +73,9 @@ public class StIvtStructivtHrBcpController {
|
||||
List<Map> maps = bcpService.queryAll(query);
|
||||
String s = JSON.toJSONString(maps);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ColumnInfoService {
|
||||
};
|
||||
|
||||
@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)){
|
||||
throw new BindException("导出失败,没有导出数据"+data.size());
|
||||
}
|
||||
@@ -58,6 +58,11 @@ public class ColumnInfoService {
|
||||
}
|
||||
}
|
||||
Map<String,String> map = this.TableColumn(tableName.value());
|
||||
if (!CollectionUtils.isEmpty(passParam)){
|
||||
for (Object s : passParam) {
|
||||
map.remove(s);
|
||||
}
|
||||
}
|
||||
map.putAll(customizMap);
|
||||
if (CollectionUtils.isEmpty(map)){
|
||||
throw new BindException("导出失败,表结构信息失败"+tableName.value());
|
||||
|
||||
Reference in New Issue
Block a user