库区LOC配置

main
暴炳林 2025-03-05 10:37:39 +08:00
parent f943b8ad32
commit 80c789f6d5
9 changed files with 200 additions and 4 deletions

14
sql
View File

@ -56,3 +56,17 @@ alter table location add BeInventorys bit;
#2023-06-14
alter table SHIXIAO add pandian numeric(18);
alter table SHIXIAO add zhengli numeric(18);
#2023-03-5 添加 库区LOC配置
CREATE TABLE [dbo].[ZONE_PLANT] (
[ID] numeric(19) IDENTITY(1,1) NOT NULL,
[ZONE_ID] int NULL,
[PLANE_LOCATION_ID] int NULL,
CONSTRAINT [PK__zone_pla__3213E83FEFD8CD6E] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
ON [PRIMARY]
GO
ALTER TABLE [dbo].[ZONE_PLANT] SET (LOCK_ESCALATION = TABLE)

View File

@ -0,0 +1,24 @@
package com.dev.swms.server.model.delivery;
import com.dev.energy.server.model.Entity;
import com.dev.swms.server.model.base.WarehouseArea;
public class ZonePlant extends Entity {
/** 货架 */
private WarehouseArea area;
/** 缓存地 */
private PlantLocation pLocation;
public WarehouseArea getArea() {
return area;
}
public void setArea(WarehouseArea area) {
this.area = area;
}
public PlantLocation getpLocation() {
return pLocation;
}
public void setpLocation(PlantLocation pLocation) {
this.pLocation = pLocation;
}
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.dev.swms.server.model.delivery.ZonePlant" table="ZONE_PLANT">
<id name="id" column="ID" type="long">
<generator class="native">
<param name="sequence">wms_ZonePlant</param>
<param name="parameters">START WITH 1000</param>
</generator>
</id>
<many-to-one name="area"
class="com.dev.swms.server.model.base.WarehouseArea">
<column name="ZONE_ID" />
</many-to-one>
<many-to-one name="pLocation"
class="com.dev.swms.server.model.delivery.PlantLocation">
<column name="PLANE_LOCATION_ID" />
</many-to-one>
</class>
</hibernate-mapping>

View File

@ -40,8 +40,13 @@ public interface WarehouseAreaManager extends BaseManager {
//生效
@Transactional
void ShengXiaoAll(List<Long> warehouseAreaIds);
//保存LOC
@Transactional
void storeZonePlant(Long waId,List<Long> plIds);
//移除LOC
@Transactional
void deleteZonePlant(List<Long> zpIds);
/**
* license
* @param warehouse

View File

@ -27,6 +27,8 @@ import com.dev.swms.server.model.base.UserGroupWarehouse;
import com.dev.swms.server.model.base.Warehouse;
import com.dev.swms.server.model.base.WarehouseArea;
import com.dev.swms.server.model.base.WarehouseAreaStatus;
import com.dev.swms.server.model.delivery.PlantLocation;
import com.dev.swms.server.model.delivery.ZonePlant;
import com.dev.swms.server.model.inventory.Inventory;
import com.dev.swms.server.model.inventory.Task;
import com.dev.swms.server.model.shipping.SeedWall;
@ -184,7 +186,33 @@ public class DefaultWarehouseAreaManager extends DefaultBaseManager implements
}
}*/
@Override
public void storeZonePlant(Long waId, List<Long> plIds) {
// TODO 自动生成的方法存根
WarehouseArea area=this.load(WarehouseArea.class,waId);
for (Long id : plIds) {
PlantLocation plantLocation=this.load(PlantLocation.class, id);
String sql=" from ZonePlant zp where zp.area.id="+waId+" and zp.pLocation.id="+id;
List<ZonePlant> zonePlantList=commonDao.findByQuery(sql);
if (zonePlantList.size()>0) {
}else {
ZonePlant zonePlant=new ZonePlant();
zonePlant.setArea(area);
zonePlant.setpLocation(plantLocation);
commonDao.store(zonePlant);
}
}
}
@Override
public void deleteZonePlant(List<Long> zpIds) {
// TODO 自动生成的方法存根
for (Long id : zpIds) {
ZonePlant zonePlant=this.load(ZonePlant.class, id);
commonDao.delete(zonePlant);
}
}
}

View File

@ -1191,6 +1191,11 @@
<value>com/dev/swms/server/model/delivery/plantInfo.hbm.xml</value>
</constructor-arg>
</bean>
<bean id="zonePlantHibernateMappingResource" class="com.dev.energy.server.dao.hibernate.HibernateMappingResource">
<constructor-arg>
<value>com/dev/swms/server/model/delivery/zonePlant.hbm.xml</value>
</constructor-arg>
</bean>
<bean id="plantLocationHibernateMappingResource" class="com.dev.energy.server.dao.hibernate.HibernateMappingResource">
<constructor-arg>
<value>com/dev/swms/server/model/delivery/plantLocation.hbm.xml</value>

View File

@ -44,7 +44,7 @@
where 1=1
/~warehouseArea.name: and wa.name like upper({warehouseArea.name})~/
/~SESSION_WAREHOUSE: AND wa.warehouse = #{SESSION_WAREHOUSE}~/
/~wa.disabled: and wa.disabled = {wa.disabled}~/
/~wa.disabled: and wa.disabled = {wa.disabled}~/
/~warehouseArea.carrierType.id: and wa.carrierType.id like {warehouseArea.carrierType.id}~/
order by wa.name asc,wa.id asc
]]></datasource>
@ -119,6 +119,9 @@ order by wa.name asc,wa.id asc
editEnabled="false" />
</forwards>
</commit>
<popup id="modifyset" title="配置LOC" enableType="multi"
invisible="false" containId="true" pageId="modifyWarehouseAreaPage">
</popup>
</buttons>
</maintainPage>
</pages>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<pages>
<modifyDetailPage id="modifyWarehouseAreaPage" title="库区LOC配置"
entityClass="com.dev.swms.server.model.base.WarehouseArea" onClose="refreshParent"
width="600" height="740">
<modify>
<inputUIs>
<hidden id="wa.id" reserve="false" />
</inputUIs>
</modify>
<detail autoQuery="false">
<datasource><![CDATA[ SELECT
zp.id,
zp.pLocation.plantInfo.code,
zp.pLocation.code
FROM ZonePlant zp
WHERE 1=1
/~wa.id: AND zp.area.id = {wa.id} ~/
]]></datasource>
<columns>
<column id="zp.id" title="zp.id" visible="false" />
<column id="zp.zone.plantInfo.code" title="工厂" visible="true" horizonAlign="center" />
<column id="zp.zone.code" title="LOC" visible="true" horizonAlign="center" />
</columns>
<buttons>
<!-- <popup id="newDetail1" title="添加" enableType="none"
invisible="false" containId="false" pageId="modifyZonePlantPage">
</popup> -->
<popup id="newDetail1" title="添加" enableType="none"
invisible="false" containId="false" pageId="modifyZonePlantPage">
</popup>
<commit id="deleteDetail" title="移除" enableType="none"
invisible="false" >
<mappings>
<mapping id="ids" className="list" />
</mappings>
<actions>
<action managerName="warehouseAreaManager" methodName="deleteZonePlant"
parameter="ids" />
</actions>
<forwards>
<forward name="refreshWindow" newEnabled="true"
editEnabled="true" />
</forwards>
</commit>
</buttons>
</detail>
</modifyDetailPage>
</pages>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<pages>
<modifyDetailPage id="modifyZonePlantPage" title="添加LOC"
entityClass="com.dev.swms.server.model.base.WarehouseArea" onClose="refreshParent"
width="400" height="540">
<modify>
<inputUIs>
<hidden id="wa.id" reserve="false" />
</inputUIs>
</modify>
<detail autoQuery="false">
<datasource><![CDATA[ SELECT
pl.id,
pl.plantInfo.code,
pl.code
FROM PlantLocation pl
WHERE 1=1
]]></datasource>
<columns>
<column id="pl.id" title="pl.id" visible="false" />
<column id="pl.plantInfo.code" title="工厂" visible="true" horizonAlign="center" />
<column id="pl.code" title="LOC" visible="true" horizonAlign="center" />
</columns>
<buttons>
<commit id="save" title="save" enableType="none" invisible="false">
<mappings>
<mapping id="ids" className="list" />
<mapping id="wa.id" className="long" />
</mappings>
<actions>
<action managerName="warehouseAreaManager" methodName="storeZonePlant"
parameter="wa.id,ids" />
</actions>
<forwards>
<forward name="refreshParent" newEnabled="true"
editEnabled="true" />
<forward name="resetWindow" newEnabled="true" editEnabled="false" />
</forwards>
</commit>
</buttons>
</detail>
</modifyDetailPage>
</pages>