Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2b39cf8531
@ -124,27 +124,6 @@
|
||||
<artifactId>jtds</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
<!--WebService-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web-services</artifactId>
|
||||
</dependency>
|
||||
<!--JAXB(用于处理XML和SOAP消息)-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-oxm</artifactId>
|
||||
</dependency>
|
||||
<!--CXF webservices-->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.jws</groupId>
|
||||
<artifactId>jakarta.jws-api</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -47,7 +47,7 @@ spring:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: online
|
||||
active: dev
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
|
@ -66,6 +66,12 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<!--CXF webservices-->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
|
||||
<version>3.4.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,36 @@
|
||||
package com.ktg.mes.md.config;
|
||||
|
||||
import com.ktg.mes.md.service.IMasterDataSyncService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.cxf.Bus;
|
||||
import org.apache.cxf.bus.spring.SpringBus;
|
||||
import org.apache.cxf.jaxws.EndpointImpl;
|
||||
import org.apache.cxf.transport.servlet.CXFServlet;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class WebServiceConfig {
|
||||
private final IMasterDataSyncService masterDataSyncService;
|
||||
|
||||
@Bean(name = Bus.DEFAULT_BUS_ID)
|
||||
public SpringBus springBus() {
|
||||
return new SpringBus();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ServletRegistrationBean<CXFServlet> cxfServlet() {
|
||||
return new ServletRegistrationBean<>(new CXFServlet(), "/WebServices/open/*");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Endpoint endpoint() {
|
||||
EndpointImpl endpoint = new EndpointImpl(springBus(), masterDataSyncService);
|
||||
endpoint.publish("/MasterDataSyncService");
|
||||
return endpoint;
|
||||
}
|
||||
}
|
@ -2,29 +2,40 @@ package com.ktg.mes.md.service;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebParam;
|
||||
import javax.jws.WebResult;
|
||||
import javax.jws.WebService;
|
||||
import javax.swing.*;
|
||||
|
||||
@WebService(name = "masterDataSyncService", targetNamespace = "http://server.spring.zhang.pers/")
|
||||
@WebService(name = IMasterDataSyncService.SERVICE_NAME, targetNamespace = IMasterDataSyncService.TARGET_NAMESPACE)
|
||||
public interface IMasterDataSyncService {
|
||||
String SERVICE_NAME = "MasterDataSyncService";
|
||||
|
||||
String TARGET_NAMESPACE = "http://server.spring.zhang.pers/";
|
||||
|
||||
/**
|
||||
* 同步物料数据
|
||||
*
|
||||
* @param materialListStr 物料列表
|
||||
*/
|
||||
@WebMethod(operationName = "syncMaterial")
|
||||
String syncMaterial(@WebParam(name = "materialList") Spring materialListStr);
|
||||
@WebResult
|
||||
String syncMaterial(@WebParam(name = "materialListStr") String materialListStr);
|
||||
|
||||
/**
|
||||
* 同步物料分类数据
|
||||
*
|
||||
* @param materialCategoryListStr 物料分类列表
|
||||
*/
|
||||
@WebMethod(operationName = "syncMaterialCategory")
|
||||
String syncMaterialCategory(@WebParam(name = "materialCategoryList") Spring materialCategoryListStr);
|
||||
@WebResult
|
||||
String syncMaterialCategory(@WebParam(name = "materialCategoryList") String materialCategoryListStr);
|
||||
|
||||
/**
|
||||
* 同步计量单位数据
|
||||
*
|
||||
* @param unitListStr 计量单位列表
|
||||
*/
|
||||
@WebMethod(operationName = "syncUnit")
|
||||
String syncUnit(@WebParam(name = "unitList") Spring unitListStr);
|
||||
@WebResult
|
||||
String syncUnit(@WebParam(name = "unitList") String unitListStr);
|
||||
}
|
||||
|
@ -9,29 +9,40 @@ import com.ktg.mes.md.service.IMdUnitMeasureService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.codehaus.jackson.JsonNode;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.jws.WebService;
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@WebService(name = IMasterDataSyncService.SERVICE_NAME, targetNamespace = IMasterDataSyncService.TARGET_NAMESPACE, endpointInterface = "com.ktg.mes.md.service.IMasterDataSyncService")
|
||||
public class MasterDataSyncServiceImpl implements IMasterDataSyncService {
|
||||
private final ItemTypeServiceImpl itemTypeService;
|
||||
private final IMdItemService mdItemService;
|
||||
private final IMdUnitMeasureService mdUnitMeasureService;
|
||||
|
||||
// 无参构造函数(供 CXF 使用)
|
||||
public MasterDataSyncServiceImpl() {
|
||||
this.itemTypeService = null;
|
||||
this.mdItemService = null;
|
||||
this.mdUnitMeasureService = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步物料数据
|
||||
*
|
||||
* @param materialListStr 物料列表
|
||||
*/
|
||||
@Override
|
||||
public String syncMaterial(Spring materialListStr) {
|
||||
public String syncMaterial(String materialListStr) {
|
||||
// 使用 ObjectMapper 来处理 JSON
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
try {
|
||||
// 解析传入的 JSON 字符串
|
||||
String jsonList = objectMapper.readTree(materialListStr.toString()).get("LIST").asText();
|
||||
String jsonList = objectMapper.readTree(materialListStr).get("LIST").asText();
|
||||
JsonNode jsonNode = objectMapper.readTree(jsonList);
|
||||
|
||||
for (JsonNode node : jsonNode) {
|
||||
@ -77,16 +88,17 @@ public class MasterDataSyncServiceImpl implements IMasterDataSyncService {
|
||||
|
||||
/**
|
||||
* 同步物料分类数据
|
||||
*
|
||||
* @param materialCategoryListStr 物料分类列表
|
||||
*/
|
||||
@Override
|
||||
public String syncMaterialCategory(Spring materialCategoryListStr) {
|
||||
public String syncMaterialCategory(String materialCategoryListStr) {
|
||||
// 使用 ObjectMapper 来处理 JSON
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
try {
|
||||
// 解析传入的 JSON 字符串
|
||||
String jsonList = objectMapper.readTree(materialCategoryListStr.toString()).get("LIST").asText();
|
||||
String jsonList = objectMapper.readTree(materialCategoryListStr).get("LIST").asText();
|
||||
JsonNode jsonNode = objectMapper.readTree(jsonList);
|
||||
|
||||
for (JsonNode node : jsonNode) {
|
||||
@ -144,16 +156,17 @@ public class MasterDataSyncServiceImpl implements IMasterDataSyncService {
|
||||
|
||||
/**
|
||||
* 同步计量单位数据
|
||||
*
|
||||
* @param unitListStr 计量单位列表
|
||||
*/
|
||||
@Override
|
||||
public String syncUnit(Spring unitListStr) {
|
||||
public String syncUnit(String unitListStr) {
|
||||
// 使用 ObjectMapper 来处理 JSON
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
try {
|
||||
// 解析传入的 JSON 字符串
|
||||
String jsonList = objectMapper.readTree(unitListStr.toString()).get("LIST").asText();
|
||||
String jsonList = objectMapper.readTree(unitListStr).get("LIST").asText();
|
||||
JsonNode jsonNode = objectMapper.readTree(jsonList);
|
||||
|
||||
for (JsonNode node : jsonNode) {
|
||||
|
@ -97,7 +97,7 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
|
||||
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString());
|
||||
|
||||
// 获取库位信息
|
||||
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaId(wmsOutTask.getWmStorageAreaId());
|
||||
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaCode(nowWmsOutPlanDetailEntity.getAreaCode());
|
||||
|
||||
// 设定出库信息数据
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
@ -117,7 +117,7 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
|
||||
hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称
|
||||
/* 来自计划明细 */
|
||||
hashMap.put("detailBatchNum", wmsOutPlanDetail.getDetailBatchNum()); // 明细批次
|
||||
hashMap.put("wmStorageAreaId", wmsOutPlanDetail.getWmStorageAreaId()); // 库位ID
|
||||
hashMap.put("wmStorageAreaId", wmStorageArea.getAreaId()); // 库位ID
|
||||
hashMap.put("wmStorageAreaCode", wmStorageArea.getAreaCode()); // 库位编码
|
||||
hashMap.put("wmStorageAreaName", wmStorageArea.getAreaName()); // 库位名称
|
||||
hashMap.put("cellX", wmStorageArea.getPositionX().toString());
|
||||
|
@ -165,7 +165,7 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService {
|
||||
// 获取库位列表
|
||||
WmStorageArea wmStorageAreaQuery = new WmStorageArea();
|
||||
wmStorageAreaQuery.setLocationId(wmStorageLocationByCode.getLocationId());
|
||||
if (isBig) wmStorageAreaQuery.setAttr3(1L);
|
||||
wmStorageAreaQuery.setAttr3(isBig ? 1L : 0L);
|
||||
List<WmStorageArea> wmStorageAreaList = this.wmStorageAreaMapper.selectWmStorageAreaList(wmStorageAreaQuery).stream()
|
||||
// 过滤掉全部存在物品的库位
|
||||
.filter(it -> !selectNotEmptyAreaCodeList.contains(it.getAreaCode()))
|
||||
|
@ -1,190 +1,373 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ktg.mes.wm.mapper.WmStorageAreaMapper">
|
||||
|
||||
<resultMap type="WmStorageArea" id="WmStorageAreaResult">
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="locationId" column="location_id" />
|
||||
<result property="area" column="area" />
|
||||
<result property="maxLoa" column="max_loa" />
|
||||
<result property="positionX" column="position_x" />
|
||||
<result property="positionY" column="position_y" />
|
||||
<result property="positionZ" column="position_z" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="frozenFlag" column="frozen_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="areaId" column="area_id"/>
|
||||
<result property="areaCode" column="area_code"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<result property="locationId" column="location_id"/>
|
||||
<result property="area" column="area"/>
|
||||
<result property="maxLoa" column="max_loa"/>
|
||||
<result property="positionX" column="position_x"/>
|
||||
<result property="positionY" column="position_y"/>
|
||||
<result property="positionZ" column="position_z"/>
|
||||
<result property="enableFlag" column="enable_flag"/>
|
||||
<result property="frozenFlag" column="frozen_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="attr1" column="attr1"/>
|
||||
<result property="attr2" column="attr2"/>
|
||||
<result property="attr3" column="attr3"/>
|
||||
<result property="attr4" column="attr4"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="AreaVo" id="WmStorageAreaVoResult">
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="locationName" column="location_name" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="locationId" column="location_id" />
|
||||
<result property="area" column="area" />
|
||||
<result property="maxLoa" column="max_loa" />
|
||||
<result property="positionX" column="position_x" />
|
||||
<result property="positionY" column="position_y" />
|
||||
<result property="positionZ" column="position_z" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="frozenFlag" column="frozen_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="areaId" column="area_id"/>
|
||||
<result property="areaCode" column="area_code"/>
|
||||
<result property="locationName" column="location_name"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<result property="locationId" column="location_id"/>
|
||||
<result property="area" column="area"/>
|
||||
<result property="maxLoa" column="max_loa"/>
|
||||
<result property="positionX" column="position_x"/>
|
||||
<result property="positionY" column="position_y"/>
|
||||
<result property="positionZ" column="position_z"/>
|
||||
<result property="enableFlag" column="enable_flag"/>
|
||||
<result property="frozenFlag" column="frozen_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="attr1" column="attr1"/>
|
||||
<result property="attr2" column="attr2"/>
|
||||
<result property="attr3" column="attr3"/>
|
||||
<result property="attr4" column="attr4"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmStorageAreaVo">
|
||||
select area_id, area_code, area_name, location_id, area, max_loa, position_x, position_y, position_z, enable_flag, frozen_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_storage_area
|
||||
select area_id,
|
||||
area_code,
|
||||
area_name,
|
||||
location_id,
|
||||
area,
|
||||
max_loa,
|
||||
position_x,
|
||||
position_y,
|
||||
position_z,
|
||||
enable_flag,
|
||||
frozen_flag,
|
||||
remark,
|
||||
attr1,
|
||||
attr2,
|
||||
attr3,
|
||||
attr4,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from wm_storage_area
|
||||
</sql>
|
||||
|
||||
<select id="selectWmStorageAreaList" parameterType="WmStorageArea" resultMap="WmStorageAreaResult">
|
||||
<include refid="selectWmStorageAreaVo"/>
|
||||
<where>
|
||||
<if test="areaCode != null and areaCode != ''"> and area_code like concat('%', #{areaCode}, '%') </if>
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="locationId != null "> and location_id like concat('%', #{locationId}, '%') </if>
|
||||
<if test="area != null "> and like concat('%',#{area}, '%') </if>
|
||||
<if test="maxLoa != null "> and max_loa = #{maxLoa}</if>
|
||||
<if test="positionX != null and positionX !=0 "> and position_x = #{positionX}</if>
|
||||
<if test="positionY != null and positionY !=0"> and position_y = #{positionY}</if>
|
||||
<if test="positionZ != null and positionZ !=0"> and position_z = #{positionZ}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
and IS_DELETE = 0
|
||||
</where>
|
||||
ORDER BY AREA_CODE ASC
|
||||
</select>
|
||||
<select id="selectWmStorageAreaList" parameterType="WmStorageArea" resultMap="WmStorageAreaResult">
|
||||
<include refid="selectWmStorageAreaVo"/>
|
||||
<where>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
and area_code like concat('%', #{areaCode}, '%')
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
and area_name like concat('%', #{areaName}, '%')
|
||||
</if>
|
||||
<if test="locationId != null">
|
||||
and location_id like concat('%', #{locationId}, '%')
|
||||
</if>
|
||||
<if test="area != null">
|
||||
and like concat('%', #{area}, '%')
|
||||
</if>
|
||||
<if test="maxLoa != null">
|
||||
and max_loa = #{maxLoa}
|
||||
</if>
|
||||
<if test="attr3 != null">
|
||||
and attr3 = #{attr3}
|
||||
</if>
|
||||
<if test="positionX != null and positionX != 0">
|
||||
and position_x = #{positionX}
|
||||
</if>
|
||||
<if test="positionY != null and positionY != 0">
|
||||
and position_y = #{positionY}
|
||||
</if>
|
||||
<if test="positionZ != null and positionZ != 0">
|
||||
and position_z = #{positionZ}
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
and enable_flag = #{enableFlag}
|
||||
</if>
|
||||
and IS_DELETE = 0
|
||||
</where>
|
||||
ORDER BY AREA_CODE ASC
|
||||
</select>
|
||||
|
||||
<select id="selectWmStorageAreaListVo" parameterType="AreaVo" resultMap="WmStorageAreaVoResult">
|
||||
select w.*,l.location_name from wm_storage_area w join wm_storage_location l on w.location_id = l.location_id
|
||||
select w.*, l.location_name
|
||||
from wm_storage_area w
|
||||
join wm_storage_location l on w.location_id = l.location_id
|
||||
<where>
|
||||
<if test="areaCode != null and areaCode != ''"> and w.area_code like concat('%', #{areaCode}, '%') </if>
|
||||
<if test="areaName != null and areaName != ''"> and w.area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="locationId != null "> and w.location_id like concat('%', #{locationId}, '%') </if>
|
||||
<if test="area != null "> and like concat('%',#{area}, '%') </if>
|
||||
<if test="maxLoa != null "> and max_loa = #{maxLoa}</if>
|
||||
<if test="positionX != null and positionX !=0 "> and w.position_x = #{positionX}</if>
|
||||
<if test="positionY != null and positionY !=0"> and w.position_y = #{positionY}</if>
|
||||
<if test="positionZ != null and positionZ !=0"> and w.position_z = #{positionZ}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and w.enable_flag = #{enableFlag}</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
and w.area_code like concat('%', #{areaCode}, '%')
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
and w.area_name like concat('%', #{areaName}, '%')
|
||||
</if>
|
||||
<if test="locationId != null">
|
||||
and w.location_id like concat('%', #{locationId}, '%')
|
||||
</if>
|
||||
<if test="area != null">
|
||||
and like concat('%', #{area}, '%')
|
||||
</if>
|
||||
<if test="maxLoa != null">
|
||||
and max_loa = #{maxLoa}
|
||||
</if>
|
||||
<if test="positionX != null and positionX != 0">
|
||||
and w.position_x = #{positionX}
|
||||
</if>
|
||||
<if test="positionY != null and positionY != 0">
|
||||
and w.position_y = #{positionY}
|
||||
</if>
|
||||
<if test="positionZ != null and positionZ != 0">
|
||||
and w.position_z = #{positionZ}
|
||||
</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">
|
||||
and w.enable_flag = #{enableFlag}
|
||||
</if>
|
||||
and w.IS_DELETE = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWmStorageAreaByAreaId" parameterType="Long" resultMap="WmStorageAreaResult">
|
||||
<include refid="selectWmStorageAreaVo"/>
|
||||
where area_id = #{areaId} and IS_DELETE = 0
|
||||
where area_id = #{areaId}
|
||||
and IS_DELETE = 0
|
||||
</select>
|
||||
|
||||
<select id="selectWmStorageAreaByAreaIdVo" parameterType="Long" resultMap="WmStorageAreaVoResult">
|
||||
select w.*,l.location_name from wm_storage_area w join wm_storage_location l on w.location_id = l.location_id
|
||||
where area_id = #{areaId} and w.IS_DELETE = 0
|
||||
select w.*, l.location_name
|
||||
from wm_storage_area w
|
||||
join wm_storage_location l on w.location_id = l.location_id
|
||||
where area_id = #{areaId}
|
||||
and w.IS_DELETE = 0
|
||||
</select>
|
||||
|
||||
<select id="selectWmStorageAreaByAreaCode" parameterType="String" resultMap="WmStorageAreaResult">
|
||||
<include refid="selectWmStorageAreaVo"/>
|
||||
where area_code = #{areaCode} and IS_DELETE = 0
|
||||
where area_code = #{areaCode}
|
||||
and IS_DELETE = 0
|
||||
</select>
|
||||
<select id="getAll" resultType="com.ktg.mes.wm.domain.WmStorageArea" resultMap="WmStorageAreaResult">
|
||||
SELECT * FROM wm_storage_area where IS_DELETE = 0
|
||||
SELECT *
|
||||
FROM wm_storage_area
|
||||
where IS_DELETE = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertWmStorageArea" parameterType="WmStorageArea" useGeneratedKeys="true" keyProperty="areaId">
|
||||
insert into wm_storage_area
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="areaCode != null and areaCode != ''">area_code,</if>
|
||||
<if test="areaName != null and areaName != ''">area_name,</if>
|
||||
<if test="locationId != null">location_id,</if>
|
||||
<if test="area != null">area,</if>
|
||||
<if test="maxLoa != null">max_loa,</if>
|
||||
<if test="positionX != null">position_x,</if>
|
||||
<if test="positionY != null">position_y,</if>
|
||||
<if test="positionZ != null">position_z,</if>
|
||||
<if test="enableFlag != null">enable_flag,</if>
|
||||
<if test="frozenFlag != null">frozen_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
area_code,
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
area_name,
|
||||
</if>
|
||||
<if test="locationId != null">
|
||||
location_id,
|
||||
</if>
|
||||
<if test="area != null">
|
||||
area,
|
||||
</if>
|
||||
<if test="maxLoa != null">
|
||||
max_loa,
|
||||
</if>
|
||||
<if test="positionX != null">
|
||||
position_x,
|
||||
</if>
|
||||
<if test="positionY != null">
|
||||
position_y,
|
||||
</if>
|
||||
<if test="positionZ != null">
|
||||
position_z,
|
||||
</if>
|
||||
<if test="enableFlag != null">
|
||||
enable_flag,
|
||||
</if>
|
||||
<if test="frozenFlag != null">
|
||||
frozen_flag,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="attr1 != null">
|
||||
attr1,
|
||||
</if>
|
||||
<if test="attr2 != null">
|
||||
attr2,
|
||||
</if>
|
||||
<if test="attr3 != null">
|
||||
attr3,
|
||||
</if>
|
||||
<if test="attr4 != null">
|
||||
attr4,
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="areaCode != null and areaCode != ''">#{areaCode},</if>
|
||||
<if test="areaName != null and areaName != ''">#{areaName},</if>
|
||||
<if test="locationId != null">#{locationId},</if>
|
||||
<if test="area != null">#{area},</if>
|
||||
<if test="maxLoa != null">#{maxLoa},</if>
|
||||
<if test="positionX != null">#{positionX},</if>
|
||||
<if test="positionY != null">#{positionY},</if>
|
||||
<if test="positionZ != null">#{positionZ},</if>
|
||||
<if test="enableFlag != null">#{enableFlag},</if>
|
||||
<if test="frozenFlag != null">#{frozenFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
#{areaCode},
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
#{areaName},
|
||||
</if>
|
||||
<if test="locationId != null">
|
||||
#{locationId},
|
||||
</if>
|
||||
<if test="area != null">
|
||||
#{area},
|
||||
</if>
|
||||
<if test="maxLoa != null">
|
||||
#{maxLoa},
|
||||
</if>
|
||||
<if test="positionX != null">
|
||||
#{positionX},
|
||||
</if>
|
||||
<if test="positionY != null">
|
||||
#{positionY},
|
||||
</if>
|
||||
<if test="positionZ != null">
|
||||
#{positionZ},
|
||||
</if>
|
||||
<if test="enableFlag != null">
|
||||
#{enableFlag},
|
||||
</if>
|
||||
<if test="frozenFlag != null">
|
||||
#{frozenFlag},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="attr1 != null">
|
||||
#{attr1},
|
||||
</if>
|
||||
<if test="attr2 != null">
|
||||
#{attr2},
|
||||
</if>
|
||||
<if test="attr3 != null">
|
||||
#{attr3},
|
||||
</if>
|
||||
<if test="attr4 != null">
|
||||
#{attr4},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWmStorageArea" parameterType="WmStorageArea">
|
||||
update wm_storage_area
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
|
||||
<if test="locationId != null">location_id = #{locationId},</if>
|
||||
<if test="area != null">area = #{area},</if>
|
||||
<if test="maxLoa != null">max_loa = #{maxLoa},</if>
|
||||
<if test="positionX != null">position_x = #{positionX},</if>
|
||||
<if test="positionY != null">position_y = #{positionY},</if>
|
||||
<if test="positionZ != null">position_z = #{positionZ},</if>
|
||||
<if test="enableFlag != null">enable_flag = #{enableFlag},</if>
|
||||
<if test="frozenFlag != null">frozen_flag = #{frozenFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
area_code = #{areaCode},
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
area_name = #{areaName},
|
||||
</if>
|
||||
<if test="locationId != null">
|
||||
location_id = #{locationId},
|
||||
</if>
|
||||
<if test="area != null">
|
||||
area = #{area},
|
||||
</if>
|
||||
<if test="maxLoa != null">
|
||||
max_loa = #{maxLoa},
|
||||
</if>
|
||||
<if test="positionX != null">
|
||||
position_x = #{positionX},
|
||||
</if>
|
||||
<if test="positionY != null">
|
||||
position_y = #{positionY},
|
||||
</if>
|
||||
<if test="positionZ != null">
|
||||
position_z = #{positionZ},
|
||||
</if>
|
||||
<if test="enableFlag != null">
|
||||
enable_flag = #{enableFlag},
|
||||
</if>
|
||||
<if test="frozenFlag != null">
|
||||
frozen_flag = #{frozenFlag},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="attr1 != null">
|
||||
attr1 = #{attr1},
|
||||
</if>
|
||||
<if test="attr2 != null">
|
||||
attr2 = #{attr2},
|
||||
</if>
|
||||
<if test="attr3 != null">
|
||||
attr3 = #{attr3},
|
||||
</if>
|
||||
<if test="attr4 != null">
|
||||
attr4 = #{attr4},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where area_id = #{areaId}
|
||||
</update>
|
||||
|
||||
<update id="deleteWmStorageAreaByAreaId" parameterType="Long">
|
||||
update wm_storage_area set IS_DELETE =1
|
||||
update wm_storage_area
|
||||
set IS_DELETE =1
|
||||
where area_id = #{areaId}
|
||||
</update>
|
||||
|
||||
<update id="deleteWmStorageAreaByAreaIds" parameterType="String">
|
||||
update wm_storage_area set IS_DELETE = 1
|
||||
update wm_storage_area
|
||||
set IS_DELETE = 1
|
||||
where area_id in
|
||||
<foreach item="areaId" collection="array" open="(" separator="," close=")">
|
||||
#{areaId}
|
||||
@ -192,13 +375,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<update id="deleteByWarehouseId" parameterType="Long">
|
||||
update wm_storage_area set IS_DELETE =1
|
||||
where location_id in ( select location_id from wm_storage_location where warehouse_id = #{warehouseId})
|
||||
update wm_storage_area
|
||||
set IS_DELETE =1
|
||||
where location_id in (select location_id from wm_storage_location where warehouse_id = #{warehouseId})
|
||||
</update>
|
||||
|
||||
<update id="deleteByLocationId" parameterType="Long">
|
||||
update wm_storage_area set IS_DELETE = 1
|
||||
update wm_storage_area
|
||||
set IS_DELETE = 1
|
||||
where location_id = #{locationId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user