rev:修改安全库存
This commit is contained in:
@@ -7,8 +7,12 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.MaterialsafeivtService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.MaterialsafeivtDto;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.IStIvtMaterialsafeivtService;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dto.SafeIvtQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dto.ShutQuery;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -28,49 +32,20 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class MaterialsafeivtController {
|
||||
|
||||
private final MaterialsafeivtService materialsafeivtService;
|
||||
private final IStIvtMaterialsafeivtService materialsafeivtService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询安全库存")
|
||||
@ApiOperation("查询安全库存")
|
||||
//@PreAuthorize("@el.check('materialsafeivt:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(materialsafeivtService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
public ResponseEntity<Object> query(SafeIvtQuery query, PageQuery page){
|
||||
return new ResponseEntity<>(materialsafeivtService.queryAll(query,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增安全库存")
|
||||
@ApiOperation("新增安全库存")
|
||||
//@PreAuthorize("@el.check('materialsafeivt:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MaterialsafeivtDto dto){
|
||||
materialsafeivtService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改安全库存")
|
||||
@ApiOperation("修改安全库存")
|
||||
//@PreAuthorize("@el.check('materialsafeivt:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MaterialsafeivtDto dto){
|
||||
materialsafeivtService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除安全库存")
|
||||
@ApiOperation("删除安全库存")
|
||||
//@PreAuthorize("@el.check('materialsafeivt:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
materialsafeivtService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/insertSafe")
|
||||
@Log("插入安全库存")
|
||||
@ApiOperation("插入安全库存")
|
||||
//@PreAuthorize("@el.check('structrelamaterial:edit')")
|
||||
public ResponseEntity<Object> insertSafe(@RequestBody Map whereJson){
|
||||
materialsafeivtService.insertSafe(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
@GetMapping
|
||||
@Log("查询拼盘单")
|
||||
@ApiOperation("查询拼盘单")
|
||||
public ResponseEntity<Object> query(ShutQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(shutframeinvBcpService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.material;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dao.StIvtMaterialsafeivt;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dto.SafeIvtQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dto.ShutQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +16,10 @@ import org.nl.wms.storage_manage.basedata.service.material.dao.StIvtMaterialsafe
|
||||
*/
|
||||
public interface IStIvtMaterialsafeivtService extends IService<StIvtMaterialsafeivt> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query,page /
|
||||
* @return JSONObject
|
||||
*/
|
||||
Object pageQuery(SafeIvtQuery query, PageQuery page);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.material.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dao.StIvtMaterialsafeivt;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dto.SafeIvtQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dto.ShutQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -12,5 +19,5 @@ import org.nl.wms.storage_manage.basedata.service.material.dao.StIvtMaterialsafe
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
public interface StIvtMaterialsafeivtMapper extends BaseMapper<StIvtMaterialsafeivt> {
|
||||
|
||||
List<Map> getMstDetail(@Param("query") SafeIvtQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,36 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.basedata.service.material.dao.mapper.StIvtMaterialsafeivtMapper">
|
||||
|
||||
<select id="getMstDetail" resultType="java.util.Map">
|
||||
SELECT
|
||||
( CASE WHEN stor.stor_id IS NULL THEN '' ELSE stor.stor_id END ) AS stor_id,
|
||||
( CASE WHEN stor.stor_code IS NULL THEN 'yclk01' ELSE stor.stor_code END ) stor_code,
|
||||
( CASE WHEN stor.stor_name IS NULL THEN '原料库' ELSE stor.stor_name END ) stor_name,
|
||||
( CASE WHEN safe.safe_ivt_down IS NULL THEN 0 ELSE safe.safe_ivt_down END ) safe_ivt_down,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
mb.base_unit_id,
|
||||
mb.material_id,
|
||||
mb.base_unit_id AS qty_unit_id,
|
||||
safe.set_name,
|
||||
safe.set_time,
|
||||
unit.unit_name AS qty_unit_name
|
||||
FROM
|
||||
md_me_materialbase mb
|
||||
LEFT JOIN st_ivt_materialsafeivt safe ON safe.material_id = mb.material_id
|
||||
LEFT JOIN st_ivt_bsrealstorattr stor ON stor.stor_id = safe.stor_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = mb.base_unit_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="query.material_type_id != null and query.material_type_id != ''">
|
||||
mb.material_type_id = #{query.material_type_id}
|
||||
</if>
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
stor.stor_id = #{stor_id}
|
||||
</if>
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
(mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.material.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dao.StIvtShutframeinvBcp;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class SafeIvtQuery extends BaseQuery<StIvtShutframeinvBcp> {
|
||||
|
||||
|
||||
private String stor_id;
|
||||
|
||||
private String material_type_id;
|
||||
|
||||
private String material_search;
|
||||
|
||||
}
|
||||
@@ -1,11 +1,21 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.material.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.mvel2.ast.Safe;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.IStIvtMaterialsafeivtService;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dao.StIvtMaterialsafeivt;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dao.mapper.StIvtMaterialsafeivtMapper;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dto.SafeIvtQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dto.ShutQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料安全库存设置表 服务实现类
|
||||
@@ -17,4 +27,13 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class StIvtMaterialsafeivtServiceImpl extends ServiceImpl<StIvtMaterialsafeivtMapper, StIvtMaterialsafeivt> implements IStIvtMaterialsafeivtService {
|
||||
|
||||
@Override
|
||||
public Object pageQuery(SafeIvtQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> mst_detail = this.baseMapper.getMstDetail(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,19 +14,19 @@ spring:
|
||||
elasticsearch:
|
||||
rest:
|
||||
#uris: 172.31.185.110:8200,172.31.154.9:8200 #内网
|
||||
# uris: 47.96.133.178:8200 #外网
|
||||
uris: http://192.168.46.225:9200 #外网
|
||||
uris: 47.96.133.178:8200 #外网
|
||||
# uris: http://192.168.46.225:9200 #外网
|
||||
# username: elastic
|
||||
# password: 123456
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_xc}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:Root.123456}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: prod
|
||||
active: dev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
@change="storChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
@@ -82,7 +82,7 @@ import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stors: [],
|
||||
storlist: [],
|
||||
classes: [],
|
||||
class_idStr: null,
|
||||
materOpt_code: '02',
|
||||
@@ -153,8 +153,8 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.stors = res.content
|
||||
crudStorattr.getStor({}).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
const param = {
|
||||
'materOpt_code': this.materOpt_code
|
||||
|
||||
Reference in New Issue
Block a user