add:PC桶记录
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata_manage.service.IMdPdGroupbucketService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPdGroupbucket;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 组桶记录 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2026-01-13
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/bucked")
|
||||
@Slf4j
|
||||
public class BuckController {
|
||||
|
||||
@Resource
|
||||
private IMdPdGroupbucketService iMdPdGroupbucketService;
|
||||
|
||||
@GetMapping
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPdGroupbucketService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增组盘记录")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdPdGroupbucket dto) {
|
||||
iMdPdGroupbucketService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改组盘记录")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MdPdGroupbucket dto) {
|
||||
iMdPdGroupbucketService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除组盘")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iMdPdGroupbucketService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -93,4 +93,10 @@ public class GroupController {
|
||||
public ResponseEntity<Object> queryMaterList() {
|
||||
return new ResponseEntity<>(iMdPbGroupplateService.queryMaterList(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryRecordNo")
|
||||
@Log("查询系统参数:证书编号")
|
||||
public ResponseEntity<Object> queryRecordNo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(iMdPbGroupplateService.queryRecordNo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPdGroupbucket;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -18,10 +22,41 @@ public interface IMdPdGroupbucketService extends IService<MdPdGroupbucket> {
|
||||
|
||||
/**
|
||||
* 根据桶号获取信息
|
||||
*
|
||||
* @param vehicleCode
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getBucketInfoByBucket(String vehicleCode);
|
||||
|
||||
void upDateWeight(String weight, String vehicleCode);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param whereJson : {查询参数}
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<JSONObject> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增组桶记录
|
||||
*
|
||||
* @param dto 组盘记录实体类
|
||||
*/
|
||||
void create(MdPdGroupbucket dto);
|
||||
|
||||
/**
|
||||
* 修改组桶记录
|
||||
*
|
||||
* @param dto 组盘记录实体类
|
||||
*/
|
||||
void update(MdPdGroupbucket dto);
|
||||
|
||||
/**
|
||||
* 删除组桶记录
|
||||
*
|
||||
* @param ids 标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,13 @@ package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPdGroupbucket;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -19,4 +23,13 @@ public interface MdPdGroupbucketMapper extends BaseMapper<MdPdGroupbucket> {
|
||||
List<JSONObject> getBucketInfoByBucket(String vehicleCode);
|
||||
|
||||
void upDateWeight(String weight, String vehicleCode);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<StIvtMoveinv>
|
||||
*/
|
||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
}
|
||||
|
||||
@@ -22,4 +22,35 @@
|
||||
WHERE
|
||||
g.bucket_code = #{vehicleCode}
|
||||
</select>
|
||||
|
||||
<select id="queryAllByPage" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
late.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.material_model
|
||||
FROM
|
||||
md_pd_groupbucket late
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = late.material_id
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
(mater.material_code LIKE #{param.material_code} or
|
||||
mater.material_name LIKE #{param.material_code} )
|
||||
</if>
|
||||
|
||||
<if test="param.pcsn != null and param.pcsn != ''">
|
||||
AND
|
||||
late.pcsn LIKE #{param.pcsn}
|
||||
</if>
|
||||
|
||||
<if test="param.bucket_code != null and param.bucket_code != ''">
|
||||
AND
|
||||
late.bucket_code LIKE #{param.bucket_code}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY late.create_time Desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPdGroupbucketService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPdGroupbucket;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPdGroupbucketMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -20,6 +33,12 @@ import java.util.List;
|
||||
@Service
|
||||
public class MdPdGroupbucketServiceImpl extends ServiceImpl<MdPdGroupbucketMapper, MdPdGroupbucket> implements IMdPdGroupbucketService {
|
||||
|
||||
/**
|
||||
* 计量单位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getBucketInfoByBucket(String vehicleCode) {
|
||||
return this.baseMapper.getBucketInfoByBucket(vehicleCode);
|
||||
@@ -29,4 +48,36 @@ public class MdPdGroupbucketServiceImpl extends ServiceImpl<MdPdGroupbucketMappe
|
||||
public void upDateWeight(String weight, String vehicleCode) {
|
||||
this.baseMapper.upDateWeight(weight, vehicleCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(MdPdGroupbucket dto) {
|
||||
dto.setBucket_code(CodeUtil.getNewCode("BUCKED_CODE"));
|
||||
dto.setId(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getByCode("KG");
|
||||
dto.setQty_unit_id(unitDao.getMeasure_unit_id());
|
||||
dto.setQty_unit_name(unitDao.getUnit_name());
|
||||
this.save(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(MdPdGroupbucket dto) {
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,18 @@ public class PdaCommonController {
|
||||
public ResponseEntity<Object> callStackPlates(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaCommonService.callStackPlates(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/queryRecordNo")
|
||||
@Log("物料组袋-查询证书编号")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryRecordNo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaCommonService.queryRecordNo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/byBagCodeInfo")
|
||||
@Log("物料组袋-获取袋号")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> byBagCodeInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaCommonService.byBagCodeInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/confirmBagAssembly")
|
||||
@Log("物料组袋-确认组袋")
|
||||
@SaIgnore
|
||||
@@ -80,6 +92,12 @@ public class PdaCommonController {
|
||||
public ResponseEntity<Object> confirmPalletAssembly(@RequestBody @Valid AssemblyPalletParam param) {
|
||||
return new ResponseEntity<>(pdaCommonService.confirmPalletAssembly(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/byBuckCode")
|
||||
@Log("物料组桶-获取桶号")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> byBuckCode(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaCommonService.byBuckCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/confirmBucketAssembly")
|
||||
@Log("物料组桶-组桶")
|
||||
@SaIgnore
|
||||
|
||||
@@ -60,4 +60,11 @@ public class PdaPointAndPointController {
|
||||
return new ResponseEntity<>(pdaPointAndPointBoxService.clearMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/clearVehicle")
|
||||
@Log("点位更新 - 清载具")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> clearVehicle(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaPointAndPointBoxService.clearVehicle(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,4 +60,31 @@ public interface PdaCommonService {
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse callStackPlates(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 物料组袋-查询证书编号
|
||||
* @param whereJson {
|
||||
*
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse queryRecordNo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 物料组袋-获取袋号
|
||||
* @param whereJson {
|
||||
* material_id: 物料标识
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse byBagCodeInfo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 物料组桶-获取桶号
|
||||
* @param whereJson {
|
||||
* bag_code: 袋码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse byBuckCode(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
@@ -158,7 +159,7 @@ public class PdaCommonServiceImpl implements PdaCommonService {
|
||||
.eq(GroupPlate::getBag_code, param.getBagNo())
|
||||
.le(GroupPlate::getStatus, "2"));
|
||||
if (list.size() > 0) {
|
||||
throw new BadRequestException("吨袋[" + param.getBagNo() + "]已经组袋过,请检查!");
|
||||
throw new BadRequestException("袋[" + param.getBagNo() + "]已经组袋过,请检查!");
|
||||
}
|
||||
GroupPlate groupPlate = AssemblyBagParam.buildGroupObj(param);
|
||||
groupplateService.save(groupPlate);
|
||||
@@ -275,4 +276,28 @@ public class PdaCommonServiceImpl implements PdaCommonService {
|
||||
empStackPlatesTask.create(jsonTask);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse queryRecordNo(JSONObject whereJson) {
|
||||
return PdaResponse.requestParamOk(groupplateService.queryRecordNo(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse byBagCodeInfo(JSONObject whereJson) {
|
||||
if (ObjectUtil.isEmpty(whereJson.getString("material_id"))) {
|
||||
throw new BadRequestException("物料标识不能为空!");
|
||||
}
|
||||
String bag_code = groupplateService.createBagCode(whereJson.getString("material_id"));
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("bag_code", bag_code);
|
||||
return PdaResponse.requestParamOk(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse byBuckCode(JSONObject whereJson) {
|
||||
String bucket_code = CodeUtil.getNewCode("BUCKED_CODE");
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("bucket_code", bucket_code);
|
||||
return PdaResponse.requestParamOk(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,9 @@ public class PdaTaskServiceImpl implements PdaTaskService {
|
||||
|
||||
@Override
|
||||
public PdaResponse againSendTask(JSONObject whereJson) {
|
||||
JSONObject obj = whereJson.getJSONObject("obj");
|
||||
// 查询任务
|
||||
SchBaseTask taskDao = schBaseTaskMapper.selectById(whereJson.getString("task_id"));
|
||||
SchBaseTask taskDao = schBaseTaskMapper.selectById(obj.getString("task_id"));
|
||||
// 下发
|
||||
AbstractTask task = taskFactory.getTask(taskDao.getConfig_code());
|
||||
task.sendTaskOne(taskDao.getTask_id());
|
||||
@@ -56,8 +57,9 @@ public class PdaTaskServiceImpl implements PdaTaskService {
|
||||
|
||||
@Override
|
||||
public PdaResponse forceConfirmTask(JSONObject whereJson) {
|
||||
JSONObject obj = whereJson.getJSONObject("obj");
|
||||
// 查询任务
|
||||
SchBaseTask taskDao = schBaseTaskMapper.selectById(whereJson.getString("task_id"));
|
||||
SchBaseTask taskDao = schBaseTaskMapper.selectById(obj.getString("task_id"));
|
||||
// 完成
|
||||
AbstractTask task = taskFactory.getTask(taskDao.getConfig_code());
|
||||
task.forceFinish(taskDao.getTask_code());
|
||||
|
||||
@@ -82,4 +82,29 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String UPDATE_IVT_TYPE_SUB_CANUSE_IVT = "6";
|
||||
|
||||
/**
|
||||
* 分类编码:原料
|
||||
*/
|
||||
public final static String YL001 = "YL001";
|
||||
|
||||
/**
|
||||
* 分类编码:辅料
|
||||
*/
|
||||
public final static String FL001 = "FL001";
|
||||
|
||||
/**
|
||||
* 分类编码:粉碎料
|
||||
*/
|
||||
public final static String FS001 = "FS001";
|
||||
|
||||
/**
|
||||
* 分类编码:批料
|
||||
*/
|
||||
public final static String PL001 = "PL001";
|
||||
|
||||
/**
|
||||
* 分类编码:内包材
|
||||
*/
|
||||
public final static String NBC001 = "NBC001";
|
||||
|
||||
}
|
||||
|
||||
@@ -113,4 +113,20 @@ public interface IMdPbGroupplateService extends IService<GroupPlate> {
|
||||
* @return List<MdMeMaterialbase>
|
||||
*/
|
||||
List<MdMeMaterialbase> queryMaterList();
|
||||
|
||||
/**
|
||||
* 查询系统参数:证书编号
|
||||
* @param whereJson {
|
||||
*
|
||||
* }
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryRecordNo(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取袋码
|
||||
* @param material_id 物料标识
|
||||
* @return String 袋码
|
||||
*/
|
||||
String createBagCode(String material_id);
|
||||
}
|
||||
|
||||
@@ -10,16 +10,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.service.IMdCsSupplierbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata_manage.service.*;
|
||||
import org.nl.wms.basedata_manage.service.dao.*;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
@@ -70,6 +69,12 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
||||
@Autowired
|
||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||
|
||||
/**
|
||||
* 分类服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbClassstandardService iMdPbClassstandardService;
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
@@ -82,8 +87,11 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
||||
// 校验是组盘还是组袋
|
||||
List<GroupPlate> tableData = dto.getTableData();
|
||||
if (ObjectUtil.isEmpty(tableData)) {
|
||||
// 根据物料类型生成代码
|
||||
String bag_code = createBagCode(dto.getMaterial_id());
|
||||
// 组袋
|
||||
dto.setGroup_id(IdUtil.getStringId());
|
||||
dto.setBag_code(bag_code);
|
||||
// 计量单位默认重量KG
|
||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getByCode("KG");
|
||||
dto.setQty_unit_id(unitDao.getMeasure_unit_id());
|
||||
@@ -141,7 +149,7 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> checkVehicle(JSONObject whereJson) {
|
||||
public List<JSONObject> checkVehicle(JSONObject whereJson) {
|
||||
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(whereJson.getString("vehicle_code"));
|
||||
if (ObjectUtil.isEmpty(vehicleDao)) {
|
||||
throw new BadRequestException("此载具不存在【" + whereJson.getString("vehicle_code") + "】");
|
||||
@@ -212,4 +220,47 @@ public class MdPbGroupplateServiceImpl extends ServiceImpl<MdPbGroupplateMapper,
|
||||
.eq(MdMeMaterialbase::getIs_used, IOSConstant.ONE)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryRecordNo(JSONObject whereJson) {
|
||||
Param param = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("RECORD_NO");
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("recordNo", param.getValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createBagCode(String material_id) {
|
||||
String bag_code;
|
||||
// 查询物料
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(material_id);
|
||||
// 查询分类
|
||||
MdPbClassstandard classDao = iMdPbClassstandardService.getById(materDao.getMaterial_type_id());
|
||||
String class_code = classDao.getClass_code();
|
||||
switch (class_code){
|
||||
case IOSConstant.YL001:
|
||||
// 原料
|
||||
bag_code = CodeUtil.getNewCode("CLASS_CODE_YL");
|
||||
break;
|
||||
case IOSConstant.FL001:
|
||||
// 辅料
|
||||
bag_code = CodeUtil.getNewCode("CLASS_CODE_FL");
|
||||
break;
|
||||
case IOSConstant.FS001:
|
||||
// 粉碎料
|
||||
bag_code = CodeUtil.getNewCode("CLASS_CODE_FS");
|
||||
break;
|
||||
case IOSConstant.PL001:
|
||||
// 批料
|
||||
bag_code = CodeUtil.getNewCode("CLASS_CODE_PL");
|
||||
break;
|
||||
case IOSConstant.NBC001:
|
||||
// 内包材
|
||||
bag_code = CodeUtil.getNewCode("CLASS_CODE_NB");
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("请确定当前物料分类是否正确!");
|
||||
}
|
||||
return bag_code;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user