add:刻字缓存物料维护/物料信息
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
package org.nl.wms.masterdata_manage.controller.vehicle;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 袋记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mdPbBagrecord")
|
||||
public class MdPbBagrecordController {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.nl.wms.masterdata_manage.controller.vehicle;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 桶物料变动记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mdPbBucketchangeflow")
|
||||
public class MdPbBucketchangeflowController {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.nl.wms.masterdata_manage.controller.vehicle;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具扩展属性信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mdPbStoragevehicleext")
|
||||
public class MdPbStoragevehicleextController {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
package org.nl.wms.masterdata_manage.controller.vehicle;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
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.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.StoragevehicleinfoService;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.dto.StoragevehicleinfoDto;
|
||||
import org.nl.wms.storage_manage.productmanage.service.check.dto.CheckQueryMst;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -14,8 +27,79 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mdPbStoragevehicleinfo")
|
||||
@RequestMapping("api/storagevehicleinfo")
|
||||
public class MdPbStoragevehicleinfoController {
|
||||
|
||||
@Autowired
|
||||
private StoragevehicleinfoService storagevehicleinfoService;
|
||||
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleinfoService istoragevehicleinfoService;
|
||||
|
||||
@GetMapping("/query")
|
||||
public ResponseEntity<Object> query(CheckQueryMst query, PageQuery page){
|
||||
return null;
|
||||
}
|
||||
|
||||
@GetMapping("/vehicleInfo")
|
||||
public ResponseEntity<Object> vehicleInfo(String vehicle_code){
|
||||
return new ResponseEntity<>(istoragevehicleinfoService.vehileInfo(vehicle_code),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询载具")
|
||||
@ApiOperation("查询载具")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(storagevehicleinfoService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增载具")
|
||||
@ApiOperation("新增载具")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject map){
|
||||
return new ResponseEntity<>(istoragevehicleinfoService.create(map),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改载具")
|
||||
@ApiOperation("修改载具")
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StoragevehicleinfoDto dto){
|
||||
storagevehicleinfoService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除载具")
|
||||
@ApiOperation("删除载具")
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
storagevehicleinfoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改点位启用状态")
|
||||
@ApiOperation("修改点位启用状态")
|
||||
//@PreAuthorize("@el.check('store:edit')")
|
||||
public ResponseEntity<Object> changeActive(@RequestBody JSONObject json) {
|
||||
storagevehicleinfoService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@GetMapping("/getVehicle/{code}")
|
||||
@Log("获取起始载具号")
|
||||
@ApiOperation("获取起始载具号")
|
||||
//@PreAuthorize("@el.check('store:edit')")
|
||||
public ResponseEntity<Object> getVehicle(@PathVariable String code) {
|
||||
JSONObject json = storagevehicleinfoService.getVehicle(code);
|
||||
return new ResponseEntity<>(json,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/updateVehicleMaterial")
|
||||
public ResponseEntity<Object> updateVehicleInfo(@RequestBody JSONObject form){
|
||||
istoragevehicleinfoService.updateVehicleMaterial(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.nl.wms.masterdata_manage.controller.vehicle;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具点位对应表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mdPbStoragevehiclepoint")
|
||||
public class MdPbStoragevehiclepointController {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package org.nl.wms.masterdata_manage.service.vehicle;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具信息表 服务类
|
||||
@@ -13,4 +17,18 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IMdPbStoragevehicleinfoService extends IService<MdPbStoragevehicleinfo> {
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param map /
|
||||
*/
|
||||
JSONArray create(JSONObject map);
|
||||
/**
|
||||
* 获取载具上物料信息
|
||||
* @param vehile_code
|
||||
* @return
|
||||
*/
|
||||
Map vehileInfo(String vehile_code);
|
||||
|
||||
void updateVehicleMaterial(JSONObject vorm);
|
||||
}
|
||||
|
||||
@@ -25,32 +25,32 @@ import lombok.experimental.Accessors;
|
||||
public class MdPbStoragevehicleext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 载具扩展标识
|
||||
*/
|
||||
@TableId
|
||||
private String storagevehicleext_id;
|
||||
|
||||
/**
|
||||
* 载具标识
|
||||
* 载具编码
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
private String storagevehicle_type;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_name;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
@@ -72,6 +72,11 @@ public class MdPbStoragevehicleext implements Serializable {
|
||||
*/
|
||||
private BigDecimal storage_qty;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 工艺指令卡
|
||||
*/
|
||||
@@ -105,7 +110,7 @@ public class MdPbStoragevehicleext implements Serializable {
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date update_time;
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 设备标识
|
||||
|
||||
@@ -68,7 +68,7 @@ public class MdPbStoragevehicleinfo implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date create_time;
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
@@ -83,12 +83,8 @@ public class MdPbStoragevehicleinfo implements Serializable {
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date update_time;
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean is_delete;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.nl.wms.masterdata_manage.service.vehicle.dao.mapper;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具信息表 Mapper 接口
|
||||
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface MdPbStoragevehicleinfoMapper extends BaseMapper<MdPbStoragevehicleinfo> {
|
||||
|
||||
Map vehileInfo(String vehicle_code);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,10 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.masterdata_manage.service.vehicle.dao.mapper.MdPbStoragevehicleinfoMapper">
|
||||
|
||||
<select id="vehileInfo" resultType="java.util.Map">
|
||||
select * from md_pb_storagevehicleinfo
|
||||
left join md_pb_storagevehicleext on md_pb_storagevehicleinfo.storagevehicle_code = md_pb_storagevehicleext.storagevehicle_code
|
||||
where
|
||||
md_pb_storagevehicleinfo.storagevehicle_code = #{vehicle_code} and md_pb_storagevehicleinfo.is_delete = false
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,10 +1,33 @@
|
||||
package org.nl.wms.masterdata_manage.service.vehicle.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.dto.StoragevehicleinfoDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -17,4 +40,93 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class MdPbStoragevehicleinfoServiceImpl extends ServiceImpl<MdPbStoragevehicleinfoMapper, MdPbStoragevehicleinfo> implements IMdPbStoragevehicleinfoService {
|
||||
|
||||
@Autowired
|
||||
private MdPbStoragevehicleextServiceImpl storagevehicleextService;
|
||||
|
||||
@Autowired
|
||||
protected IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
@Override
|
||||
public Map vehileInfo(String vehicle_code) {
|
||||
if(StringUtils.isEmpty(vehicle_code)){
|
||||
return new HashMap();
|
||||
}
|
||||
return this.baseMapper.vehileInfo(vehicle_code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray create(JSONObject map) {
|
||||
MdPbStoragevehicleinfo one = this.getOne(new QueryWrapper<MdPbStoragevehicleinfo>().eq("storagevehicle_code", map.getString("storagevehicle_code")));
|
||||
if (!ObjectUtil.isEmpty(one)) {
|
||||
throw new BadRequestException("此载具已存在");
|
||||
}
|
||||
String code = "";
|
||||
switch (map.getString("storagevehicle_type")) {
|
||||
case "00":
|
||||
code = "VEHICCLE_CODE_XMTPT";
|
||||
break;
|
||||
case "01":
|
||||
code = "VEHICCLE_CODE_CDMTP";
|
||||
break;
|
||||
case "02":
|
||||
code = "VEHICCLE_CODE_TLD";
|
||||
break;
|
||||
case "03":
|
||||
code = "VEHICCLE_CODE_TTP";
|
||||
break;
|
||||
case "04":
|
||||
code = "VEHICCLE_CODE_XMTPC";
|
||||
break;
|
||||
case "05":
|
||||
code = "VEHICCLE_CODE_LX";
|
||||
break;
|
||||
}
|
||||
JSONArray resultCodeArr = new JSONArray();
|
||||
int num = MapUtil.getInt(map, "num");
|
||||
for (int i = 0; i < num; i++) {
|
||||
MdPbStoragevehicleinfo entity = new MdPbStoragevehicleinfo();
|
||||
entity.setStoragevehicle_id(IdUtil.getStringId());
|
||||
entity.setStoragevehicle_code(CodeUtil.getNewCode(code));
|
||||
entity.setStoragevehicle_name(entity.getStoragevehicle_code());
|
||||
entity.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setCreate_time(DateUtil.now());
|
||||
entity.setIs_used(map.getString("is_used").equals("1"));
|
||||
entity.setStoragevehicle_type(map.getString("storagevehicle_type"));
|
||||
this.save(entity);
|
||||
resultCodeArr.add(entity.getStoragevehicle_code());
|
||||
}
|
||||
return resultCodeArr;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateVehicleMaterial(JSONObject vorm) {
|
||||
Assert.notNull(vorm.getString("storagevehicle_code"),"请求参数载具编号不能为空");
|
||||
storagevehicleextService.remove(new QueryWrapper<MdPbStoragevehicleext>()
|
||||
.eq("storagevehicle_code",vorm.getString("storagevehicle_code")));
|
||||
if (StringUtils.isEmpty(vorm.getString("material_code"))){
|
||||
return;
|
||||
}
|
||||
MdMeMaterialbase one = iMdMeMaterialbaseService.getOne(new QueryWrapper<MdMeMaterialbase>()
|
||||
.eq("material_code", vorm.getString("material_code"))
|
||||
.eq("is_delete",false));
|
||||
if (one==null){
|
||||
throw new BadRequestException("当前物料编号不存在:"+vorm.getString("material_code"));
|
||||
}
|
||||
MdPbStoragevehicleext vehicleMaterial = new MdPbStoragevehicleext();
|
||||
vehicleMaterial.setStoragevehicle_id(vorm.getString("storagevehicle_id"));
|
||||
vehicleMaterial.setStoragevehicle_code(vorm.getString("storagevehicle_code"));
|
||||
vehicleMaterial.setStorage_qty(vorm.getBigDecimal("storage_qty"));
|
||||
vehicleMaterial.setWeight(vorm.getBigDecimal("weight"));
|
||||
vehicleMaterial.setMaterial_id(one.getMaterial_id());
|
||||
vehicleMaterial.setMaterial_code(one.getMaterial_code());
|
||||
vehicleMaterial.setMaterial_spec(one.getMaterial_spec());
|
||||
vehicleMaterial.setQty_unit_id(one.getBase_unit_id());
|
||||
vehicleMaterial.setPcsn(vorm.getString("pcsn"));
|
||||
vehicleMaterial.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
vehicleMaterial.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
vehicleMaterial.setUpdate_time(DateUtil.now());
|
||||
storagevehicleextService.save(vehicleMaterial);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
|
||||
package org.nl.wms.masterdata_manage.备份master.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.StoragevehicleinfoService;
|
||||
import org.nl.wms.masterdata_manage.备份master.service.dto.StoragevehicleinfoDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @date 2021-12-09
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "载具管理")
|
||||
@RequestMapping("/api/storagevehicleinfo")
|
||||
@Slf4j
|
||||
public class StoragevehicleinfoController {
|
||||
|
||||
private final StoragevehicleinfoService storagevehicleinfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询载具")
|
||||
@ApiOperation("查询载具")
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(storagevehicleinfoService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增载具")
|
||||
@ApiOperation("新增载具")
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:add')")
|
||||
public ResponseEntity<Object> create(@RequestBody Map map){
|
||||
return new ResponseEntity<>(storagevehicleinfoService.create(map),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改载具")
|
||||
@ApiOperation("修改载具")
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StoragevehicleinfoDto dto){
|
||||
storagevehicleinfoService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除载具")
|
||||
@ApiOperation("删除载具")
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
storagevehicleinfoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改点位启用状态")
|
||||
@ApiOperation("修改点位启用状态")
|
||||
//@PreAuthorize("@el.check('store:edit')")
|
||||
public ResponseEntity<Object> changeActive(@RequestBody JSONObject json) {
|
||||
storagevehicleinfoService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@GetMapping("/getVehicle/{code}")
|
||||
@Log("获取起始载具号")
|
||||
@ApiOperation("获取起始载具号")
|
||||
//@PreAuthorize("@el.check('store:edit')")
|
||||
public ResponseEntity<Object> getVehicle(@PathVariable String code) {
|
||||
JSONObject json = storagevehicleinfoService.getVehicle(code);
|
||||
return new ResponseEntity<>(json,HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -48,9 +48,9 @@ public interface StoragevehicleinfoService {
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param map /
|
||||
*/
|
||||
JSONArray create(Map map);
|
||||
* @param map /
|
||||
*/
|
||||
JSONArray create(JSONObject map);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -84,7 +84,7 @@ public class StoragevehicleinfoServiceImpl implements StoragevehicleinfoService
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONArray create(Map map) {
|
||||
public JSONArray create(JSONObject map) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
|
||||
JSONObject jsonObject = wo.query("storagevehicle_code = '" + map.get("storagevehicle_code") + "' and is_delete = '0'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(jsonObject)) {
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<if test="workprocedure_id != null and workprocedure_id != ''">
|
||||
and device.workprocedure_id = #{workprocedure_id}
|
||||
</if>
|
||||
|
||||
<if test="product_area != null and product_area != ''">
|
||||
and device.product_area = #{product_area}
|
||||
</if>
|
||||
and device.device_code not in (
|
||||
select o.device_code as device_code
|
||||
from PDM_produce_workOrder o
|
||||
|
||||
@@ -189,7 +189,6 @@ public class PdmProduceWorkorder implements Serializable {
|
||||
private BigDecimal nok_qty;
|
||||
private BigDecimal repare_qty;
|
||||
|
||||
|
||||
/**
|
||||
* 下发人
|
||||
*/
|
||||
@@ -222,4 +221,9 @@ public class PdmProduceWorkorder implements Serializable {
|
||||
private String confirm_time;
|
||||
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean is_used_fxx = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
//A1_TW_+device_code 日期2023/5/30
|
||||
//material_spec='24030921S'
|
||||
String name = file.getOriginalFilename();
|
||||
if (name.contains("推弯")){
|
||||
if (name.contains("弯头")){
|
||||
推弯(inputStream);
|
||||
}
|
||||
if (name.contains("综合")){
|
||||
@@ -307,9 +307,13 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
workorder.setShift_type_scode(col.equals("晚班") ? "2" : "1");
|
||||
}
|
||||
if (j == 1) {
|
||||
//物料
|
||||
workorder.setPlanproduceend_date(col.substring(0, col.indexOf(" ")) + " 18:30:00");
|
||||
workorder.setPlanproducestart_date(col.substring(0, col.indexOf(" ")) + " 07:30:00");
|
||||
if (workorder.getShift_type_scode().equals("1")){
|
||||
workorder.setPlanproduceend_date(col.substring(0, col.indexOf(" ")) + " 18:30:00");
|
||||
workorder.setPlanproducestart_date(col.substring(0, col.indexOf(" ")) + " 07:30:00");
|
||||
}else {
|
||||
workorder.setPlanproducestart_date(col.substring(0, col.indexOf(" ")) + " 18:30:00");
|
||||
workorder.setPlanproduceend_date(col.substring(0, col.indexOf(" ")) + " 07:30:00");
|
||||
}
|
||||
}
|
||||
if (j == 2) {
|
||||
//物料
|
||||
@@ -367,7 +371,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (workprocedure==null){
|
||||
errorMap.put("第"+(i+1)+"行:","工序名称:"+workorder.getWorkprocedure_id()+"不存在");
|
||||
}else {
|
||||
workorder.setWorkorder_id(workprocedure.getWorkprocedure_id());
|
||||
workorder.setWorkprocedure_id(workprocedure.getWorkprocedure_id());
|
||||
}
|
||||
List<MdMeMaterialbase> mdMeMaterialbases = materialspecs.get(workorder.getMaterial_id());
|
||||
if (!CollectionUtils.isEmpty(mdMeMaterialbases)){
|
||||
@@ -446,22 +450,22 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
//设备 A1_TW_
|
||||
workorder.setDevice_code(col);
|
||||
}
|
||||
if (j == 8) {
|
||||
if (j == 9) {
|
||||
//单重
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(col) * 1000);
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(col.equals("#N/A")?"0.05":col) * 1000);
|
||||
workorder.setMaterial_weight(bigDecimal.setScale(3, RoundingMode.HALF_UP));
|
||||
}
|
||||
if (j == 9) {
|
||||
if (j == 10) {
|
||||
persons.add(col);
|
||||
workorder.setCurrent_produce_person_id(col);
|
||||
}
|
||||
if (j == 10) {
|
||||
if (j == 11) {
|
||||
workorder.setPlan_qty(new BigDecimal(Long.valueOf(col)));
|
||||
}
|
||||
if (j == 14) {
|
||||
if (j == 15) {
|
||||
workorder.setIs_needmove(col.equals("是") ? true : false);
|
||||
}
|
||||
if (j == 15) {
|
||||
if (j == 16) {
|
||||
workorder.setRemark(col);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,5 +121,11 @@ public class SchBasePointController {
|
||||
basePointService.batchUpdateOne(form);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@GetMapping("/queryVehicle")
|
||||
@Log("查询刻字点位")
|
||||
@ApiOperation("查询点位")
|
||||
public ResponseEntity<Object> queryVehicle(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(basePointService.queryVehicle(whereJson,page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Map;
|
||||
public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
|
||||
Object queryAll(Map whereJson, PageQuery page);
|
||||
Object queryVehicle(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -23,6 +23,8 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||
*/
|
||||
List<Map> queryAll(Map<String,Object> map);
|
||||
|
||||
List<Map> queryVehicle(Map<String,Object> map);
|
||||
|
||||
/**
|
||||
* 点位管理页面查询
|
||||
* @param map
|
||||
|
||||
@@ -147,4 +147,58 @@
|
||||
AND sch_base_point.point_code IN ( ${points} )
|
||||
GROUP BY sch_base_point.point_code
|
||||
</select>
|
||||
<select id="queryVehicle" resultType="java.util.Map">
|
||||
SELECT
|
||||
point.*,
|
||||
d3.label as lock_type_name,
|
||||
region.region_name,
|
||||
ma.material_name,
|
||||
ma.material_code,
|
||||
ma.material_spec
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_code = region.region_code
|
||||
LEFT JOIN sys_dict d3 ON point.lock_type = d3.value and d3.code='d_lock_type'
|
||||
LEFT JOIN md_pb_storagevehicleext vehicle ON vehicle.storagevehicle_code = point.vehicle_code
|
||||
LEFT JOIN md_me_materialbase ma ON ma.material_id = vehicle.material_id
|
||||
WHERE
|
||||
point.is_delete = '0'
|
||||
<if test="region_code != null and region_code != ''">
|
||||
and point.region_code = #{region_code}
|
||||
</if>
|
||||
<if test="point_type != null and point_type != ''">
|
||||
and point.point_type = #{point_type}
|
||||
</if>
|
||||
<if test="lock_type != null and lock_type != ''">
|
||||
and point.lock_type = #{lock_type}
|
||||
</if>
|
||||
<if test="product_area != null and product_area != ''">
|
||||
and point.product_area = #{product_area}
|
||||
</if>
|
||||
<if test="point_status != null and point_status != ''">
|
||||
and point.point_status = #{point_status}
|
||||
</if>
|
||||
<if test="point_status == '00'">
|
||||
and (point.vehicle_code is null or point.vehicle_code = '')
|
||||
</if>
|
||||
<if test="is_used != null and is_used != ''">
|
||||
and point.is_used = #{is_used}
|
||||
</if>
|
||||
<if test="block_num != null and block_num != ''">
|
||||
and point.block_num = #{block_num}
|
||||
</if>
|
||||
<if test="row_num != null and row_num != ''">
|
||||
and point.row_num = #{row_num}
|
||||
</if>
|
||||
<if test="col_num != null and col_num != ''">
|
||||
and point.col_num = #{col_num}
|
||||
</if>
|
||||
<if test="layer_num != null and layer_num != ''">
|
||||
and point.layer_num = #{layer_num}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and ( point.point_code like '%${name}' or point.point_name like '%${name}' )
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -14,6 +14,7 @@ import io.jsonwebtoken.lang.Assert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -84,6 +85,24 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
@Override
|
||||
public Object queryVehicle(Map whereJson, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage()+1, pageQuery.getSize());
|
||||
page.setOrderBy("point_code asc");
|
||||
List<Map> list = schBasePointMapper.queryVehicle(whereJson);
|
||||
list.forEach(a->{
|
||||
a.put("point_status", StatusEnum.POINT_STATUS_EMPTY.getCode());
|
||||
if (a.get("vehicle_code")!=null){
|
||||
a.put("point_status",StatusEnum.POINT_STATUS_EMPTY_VEHICLE.getCode());
|
||||
};
|
||||
if (a.get("material_spec")!=null){
|
||||
a.put("point_status",StatusEnum.POINT_STATUS_FULL.getCode());
|
||||
};
|
||||
});
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object selectPoint(Map query, PageQuery pageQuery) {
|
||||
|
||||
@@ -130,7 +130,7 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
|
||||
.eq("region_code", region_code)
|
||||
.select("point_type_explain"));
|
||||
JSONArray res = new JSONArray();
|
||||
if(ObjectUtil.isEmpty(region.getPoint_type_explain())) { return res; }
|
||||
if(region==null||ObjectUtil.isEmpty(region.getPoint_type_explain())) { return res; }
|
||||
String[] explain = region.getPoint_type_explain().split(",");
|
||||
for(int i = 0; i < explain.length; i++) {
|
||||
String[] types = explain[i].split("-");
|
||||
@@ -148,7 +148,7 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
|
||||
SchBaseRegion region = this.getOne(new QueryWrapper<SchBaseRegion>()
|
||||
.eq("region_code", region_code)
|
||||
.select("point_status_explain"));
|
||||
if(ObjectUtil.isEmpty(region.getPoint_status_explain())) {
|
||||
if(region==null || ObjectUtil.isEmpty(region.getPoint_status_explain())) {
|
||||
return res;
|
||||
}
|
||||
String[] explain = region.getPoint_status_explain().split(",");
|
||||
|
||||
@@ -93,7 +93,6 @@ public class StIvtMoreorlessdtlCpServiceImpl extends ServiceImpl<StIvtMoreorless
|
||||
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getStoragevehicle_code())
|
||||
.eq(MdPbStoragevehicleinfo::getIs_used, true)
|
||||
.eq(MdPbStoragevehicleinfo::getIs_delete, false)
|
||||
);
|
||||
|
||||
if (ObjectUtil.isEmpty(vehicleDao)) throw new BadRequestException("载具不存在!");
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
Reference in New Issue
Block a user