Merge remote-tracking branch 'origin/master'

This commit is contained in:
汤锦科 2024-12-19 10:00:04 +08:00
commit 2b39cf8531
9 changed files with 407 additions and 178 deletions

View File

@ -124,27 +124,6 @@
<artifactId>jtds</artifactId> <artifactId>jtds</artifactId>
<version>1.3.1</version> <version>1.3.1</version>
</dependency> </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> </dependencies>
<build> <build>

View File

@ -47,7 +47,7 @@ spring:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: online active: dev
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:

View File

@ -66,6 +66,12 @@
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
</dependency> </dependency>
<!--CXF webservices-->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.4.4</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -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;
}
}

View File

@ -2,29 +2,40 @@ package com.ktg.mes.md.service;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebParam; import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService; import javax.jws.WebService;
import javax.swing.*; import javax.swing.*;
@WebService(name = "masterDataSyncService", targetNamespace = "http://server.spring.zhang.pers/") @WebService(name = IMasterDataSyncService.SERVICE_NAME, targetNamespace = IMasterDataSyncService.TARGET_NAMESPACE)
public interface IMasterDataSyncService { public interface IMasterDataSyncService {
String SERVICE_NAME = "MasterDataSyncService";
String TARGET_NAMESPACE = "http://server.spring.zhang.pers/";
/** /**
* 同步物料数据 * 同步物料数据
*
* @param materialListStr 物料列表 * @param materialListStr 物料列表
*/ */
@WebMethod(operationName = "syncMaterial") @WebMethod(operationName = "syncMaterial")
String syncMaterial(@WebParam(name = "materialList") Spring materialListStr); @WebResult
String syncMaterial(@WebParam(name = "materialListStr") String materialListStr);
/** /**
* 同步物料分类数据 * 同步物料分类数据
*
* @param materialCategoryListStr 物料分类列表 * @param materialCategoryListStr 物料分类列表
*/ */
@WebMethod(operationName = "syncMaterialCategory") @WebMethod(operationName = "syncMaterialCategory")
String syncMaterialCategory(@WebParam(name = "materialCategoryList") Spring materialCategoryListStr); @WebResult
String syncMaterialCategory(@WebParam(name = "materialCategoryList") String materialCategoryListStr);
/** /**
* 同步计量单位数据 * 同步计量单位数据
*
* @param unitListStr 计量单位列表 * @param unitListStr 计量单位列表
*/ */
@WebMethod(operationName = "syncUnit") @WebMethod(operationName = "syncUnit")
String syncUnit(@WebParam(name = "unitList") Spring unitListStr); @WebResult
String syncUnit(@WebParam(name = "unitList") String unitListStr);
} }

View File

@ -9,29 +9,40 @@ import com.ktg.mes.md.service.IMdUnitMeasureService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.stereotype.Service;
import javax.jws.WebService;
import javax.swing.*; import javax.swing.*;
import java.util.List; import java.util.List;
import java.util.Objects;
@RequiredArgsConstructor @RequiredArgsConstructor
@Service
@WebService(name = IMasterDataSyncService.SERVICE_NAME, targetNamespace = IMasterDataSyncService.TARGET_NAMESPACE, endpointInterface = "com.ktg.mes.md.service.IMasterDataSyncService")
public class MasterDataSyncServiceImpl implements IMasterDataSyncService { public class MasterDataSyncServiceImpl implements IMasterDataSyncService {
private final ItemTypeServiceImpl itemTypeService; private final ItemTypeServiceImpl itemTypeService;
private final IMdItemService mdItemService; private final IMdItemService mdItemService;
private final IMdUnitMeasureService mdUnitMeasureService; private final IMdUnitMeasureService mdUnitMeasureService;
// 无参构造函数 CXF 使用
public MasterDataSyncServiceImpl() {
this.itemTypeService = null;
this.mdItemService = null;
this.mdUnitMeasureService = null;
}
/** /**
* 同步物料数据 * 同步物料数据
*
* @param materialListStr 物料列表 * @param materialListStr 物料列表
*/ */
@Override @Override
public String syncMaterial(Spring materialListStr) { public String syncMaterial(String materialListStr) {
// 使用 ObjectMapper 来处理 JSON // 使用 ObjectMapper 来处理 JSON
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
try { try {
// 解析传入的 JSON 字符串 // 解析传入的 JSON 字符串
String jsonList = objectMapper.readTree(materialListStr.toString()).get("LIST").asText(); String jsonList = objectMapper.readTree(materialListStr).get("LIST").asText();
JsonNode jsonNode = objectMapper.readTree(jsonList); JsonNode jsonNode = objectMapper.readTree(jsonList);
for (JsonNode node : jsonNode) { for (JsonNode node : jsonNode) {
@ -77,16 +88,17 @@ public class MasterDataSyncServiceImpl implements IMasterDataSyncService {
/** /**
* 同步物料分类数据 * 同步物料分类数据
*
* @param materialCategoryListStr 物料分类列表 * @param materialCategoryListStr 物料分类列表
*/ */
@Override @Override
public String syncMaterialCategory(Spring materialCategoryListStr) { public String syncMaterialCategory(String materialCategoryListStr) {
// 使用 ObjectMapper 来处理 JSON // 使用 ObjectMapper 来处理 JSON
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
try { try {
// 解析传入的 JSON 字符串 // 解析传入的 JSON 字符串
String jsonList = objectMapper.readTree(materialCategoryListStr.toString()).get("LIST").asText(); String jsonList = objectMapper.readTree(materialCategoryListStr).get("LIST").asText();
JsonNode jsonNode = objectMapper.readTree(jsonList); JsonNode jsonNode = objectMapper.readTree(jsonList);
for (JsonNode node : jsonNode) { for (JsonNode node : jsonNode) {
@ -144,16 +156,17 @@ public class MasterDataSyncServiceImpl implements IMasterDataSyncService {
/** /**
* 同步计量单位数据 * 同步计量单位数据
*
* @param unitListStr 计量单位列表 * @param unitListStr 计量单位列表
*/ */
@Override @Override
public String syncUnit(Spring unitListStr) { public String syncUnit(String unitListStr) {
// 使用 ObjectMapper 来处理 JSON // 使用 ObjectMapper 来处理 JSON
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
try { try {
// 解析传入的 JSON 字符串 // 解析传入的 JSON 字符串
String jsonList = objectMapper.readTree(unitListStr.toString()).get("LIST").asText(); String jsonList = objectMapper.readTree(unitListStr).get("LIST").asText();
JsonNode jsonNode = objectMapper.readTree(jsonList); JsonNode jsonNode = objectMapper.readTree(jsonList);
for (JsonNode node : jsonNode) { for (JsonNode node : jsonNode) {

View File

@ -97,7 +97,7 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString()); 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<>(); HashMap<String, Object> hashMap = new HashMap<>();
@ -117,7 +117,7 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称 hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称
/* 来自计划明细 */ /* 来自计划明细 */
hashMap.put("detailBatchNum", wmsOutPlanDetail.getDetailBatchNum()); // 明细批次 hashMap.put("detailBatchNum", wmsOutPlanDetail.getDetailBatchNum()); // 明细批次
hashMap.put("wmStorageAreaId", wmsOutPlanDetail.getWmStorageAreaId()); // 库位ID hashMap.put("wmStorageAreaId", wmStorageArea.getAreaId()); // 库位ID
hashMap.put("wmStorageAreaCode", wmStorageArea.getAreaCode()); // 库位编码 hashMap.put("wmStorageAreaCode", wmStorageArea.getAreaCode()); // 库位编码
hashMap.put("wmStorageAreaName", wmStorageArea.getAreaName()); // 库位名称 hashMap.put("wmStorageAreaName", wmStorageArea.getAreaName()); // 库位名称
hashMap.put("cellX", wmStorageArea.getPositionX().toString()); hashMap.put("cellX", wmStorageArea.getPositionX().toString());

View File

@ -165,7 +165,7 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService {
// 获取库位列表 // 获取库位列表
WmStorageArea wmStorageAreaQuery = new WmStorageArea(); WmStorageArea wmStorageAreaQuery = new WmStorageArea();
wmStorageAreaQuery.setLocationId(wmStorageLocationByCode.getLocationId()); wmStorageAreaQuery.setLocationId(wmStorageLocationByCode.getLocationId());
if (isBig) wmStorageAreaQuery.setAttr3(1L); wmStorageAreaQuery.setAttr3(isBig ? 1L : 0L);
List<WmStorageArea> wmStorageAreaList = this.wmStorageAreaMapper.selectWmStorageAreaList(wmStorageAreaQuery).stream() List<WmStorageArea> wmStorageAreaList = this.wmStorageAreaMapper.selectWmStorageAreaList(wmStorageAreaQuery).stream()
// 过滤掉全部存在物品的库位 // 过滤掉全部存在物品的库位
.filter(it -> !selectNotEmptyAreaCodeList.contains(it.getAreaCode())) .filter(it -> !selectNotEmptyAreaCodeList.contains(it.getAreaCode()))

View File

@ -1,190 +1,373 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmStorageAreaMapper"> <mapper namespace="com.ktg.mes.wm.mapper.WmStorageAreaMapper">
<resultMap type="WmStorageArea" id="WmStorageAreaResult"> <resultMap type="WmStorageArea" id="WmStorageAreaResult">
<result property="areaId" column="area_id" /> <result property="areaId" column="area_id"/>
<result property="areaCode" column="area_code" /> <result property="areaCode" column="area_code"/>
<result property="areaName" column="area_name" /> <result property="areaName" column="area_name"/>
<result property="locationId" column="location_id" /> <result property="locationId" column="location_id"/>
<result property="area" column="area" /> <result property="area" column="area"/>
<result property="maxLoa" column="max_loa" /> <result property="maxLoa" column="max_loa"/>
<result property="positionX" column="position_x" /> <result property="positionX" column="position_x"/>
<result property="positionY" column="position_y" /> <result property="positionY" column="position_y"/>
<result property="positionZ" column="position_z" /> <result property="positionZ" column="position_z"/>
<result property="enableFlag" column="enable_flag" /> <result property="enableFlag" column="enable_flag"/>
<result property="frozenFlag" column="frozen_flag" /> <result property="frozenFlag" column="frozen_flag"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="attr1" column="attr1" /> <result property="attr1" column="attr1"/>
<result property="attr2" column="attr2" /> <result property="attr2" column="attr2"/>
<result property="attr3" column="attr3" /> <result property="attr3" column="attr3"/>
<result property="attr4" column="attr4" /> <result property="attr4" column="attr4"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<resultMap type="AreaVo" id="WmStorageAreaVoResult"> <resultMap type="AreaVo" id="WmStorageAreaVoResult">
<result property="areaId" column="area_id" /> <result property="areaId" column="area_id"/>
<result property="areaCode" column="area_code" /> <result property="areaCode" column="area_code"/>
<result property="locationName" column="location_name" /> <result property="locationName" column="location_name"/>
<result property="areaName" column="area_name" /> <result property="areaName" column="area_name"/>
<result property="locationId" column="location_id" /> <result property="locationId" column="location_id"/>
<result property="area" column="area" /> <result property="area" column="area"/>
<result property="maxLoa" column="max_loa" /> <result property="maxLoa" column="max_loa"/>
<result property="positionX" column="position_x" /> <result property="positionX" column="position_x"/>
<result property="positionY" column="position_y" /> <result property="positionY" column="position_y"/>
<result property="positionZ" column="position_z" /> <result property="positionZ" column="position_z"/>
<result property="enableFlag" column="enable_flag" /> <result property="enableFlag" column="enable_flag"/>
<result property="frozenFlag" column="frozen_flag" /> <result property="frozenFlag" column="frozen_flag"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="attr1" column="attr1" /> <result property="attr1" column="attr1"/>
<result property="attr2" column="attr2" /> <result property="attr2" column="attr2"/>
<result property="attr3" column="attr3" /> <result property="attr3" column="attr3"/>
<result property="attr4" column="attr4" /> <result property="attr4" column="attr4"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<sql id="selectWmStorageAreaVo"> <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> </sql>
<select id="selectWmStorageAreaList" parameterType="WmStorageArea" resultMap="WmStorageAreaResult"> <select id="selectWmStorageAreaList" parameterType="WmStorageArea" resultMap="WmStorageAreaResult">
<include refid="selectWmStorageAreaVo"/> <include refid="selectWmStorageAreaVo"/>
<where> <where>
<if test="areaCode != null and areaCode != ''"> and area_code like concat('%', #{areaCode}, '%') </if> <if test="areaCode != null and areaCode != ''">
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if> and area_code like concat('%', #{areaCode}, '%')
<if test="locationId != null "> and location_id like concat('%', #{locationId}, '%') </if> </if>
<if test="area != null "> and like concat('%',#{area}, '%') </if> <if test="areaName != null and areaName != ''">
<if test="maxLoa != null "> and max_loa = #{maxLoa}</if> and area_name like concat('%', #{areaName}, '%')
<if test="positionX != null and positionX !=0 "> and position_x = #{positionX}</if> </if>
<if test="positionY != null and positionY !=0"> and position_y = #{positionY}</if> <if test="locationId != null">
<if test="positionZ != null and positionZ !=0"> and position_z = #{positionZ}</if> and location_id like concat('%', #{locationId}, '%')
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if> </if>
and IS_DELETE = 0 <if test="area != null">
</where> and like concat('%', #{area}, '%')
ORDER BY AREA_CODE ASC </if>
</select> <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 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> <where>
<if test="areaCode != null and areaCode != ''"> and w.area_code like concat('%', #{areaCode}, '%') </if> <if test="areaCode != null and areaCode != ''">
<if test="areaName != null and areaName != ''"> and w.area_name like concat('%', #{areaName}, '%')</if> and w.area_code like concat('%', #{areaCode}, '%')
<if test="locationId != null "> and w.location_id like concat('%', #{locationId}, '%') </if> </if>
<if test="area != null "> and like concat('%',#{area}, '%') </if> <if test="areaName != null and areaName != ''">
<if test="maxLoa != null "> and max_loa = #{maxLoa}</if> and w.area_name like concat('%', #{areaName}, '%')
<if test="positionX != null and positionX !=0 "> and w.position_x = #{positionX}</if> </if>
<if test="positionY != null and positionY !=0"> and w.position_y = #{positionY}</if> <if test="locationId != null">
<if test="positionZ != null and positionZ !=0"> and w.position_z = #{positionZ}</if> and w.location_id like concat('%', #{locationId}, '%')
<if test="enableFlag != null and enableFlag != ''"> and w.enable_flag = #{enableFlag}</if> </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 and w.IS_DELETE = 0
</where> </where>
</select> </select>
<select id="selectWmStorageAreaByAreaId" parameterType="Long" resultMap="WmStorageAreaResult"> <select id="selectWmStorageAreaByAreaId" parameterType="Long" resultMap="WmStorageAreaResult">
<include refid="selectWmStorageAreaVo"/> <include refid="selectWmStorageAreaVo"/>
where area_id = #{areaId} and IS_DELETE = 0 where area_id = #{areaId}
and IS_DELETE = 0
</select> </select>
<select id="selectWmStorageAreaByAreaIdVo" parameterType="Long" resultMap="WmStorageAreaVoResult"> <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 select w.*, l.location_name
where area_id = #{areaId} and w.IS_DELETE = 0 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>
<select id="selectWmStorageAreaByAreaCode" parameterType="String" resultMap="WmStorageAreaResult"> <select id="selectWmStorageAreaByAreaCode" parameterType="String" resultMap="WmStorageAreaResult">
<include refid="selectWmStorageAreaVo"/> <include refid="selectWmStorageAreaVo"/>
where area_code = #{areaCode} and IS_DELETE = 0 where area_code = #{areaCode}
and IS_DELETE = 0
</select> </select>
<select id="getAll" resultType="com.ktg.mes.wm.domain.WmStorageArea" resultMap="WmStorageAreaResult"> <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> </select>
<insert id="insertWmStorageArea" parameterType="WmStorageArea" useGeneratedKeys="true" keyProperty="areaId"> <insert id="insertWmStorageArea" parameterType="WmStorageArea" useGeneratedKeys="true" keyProperty="areaId">
insert into wm_storage_area insert into wm_storage_area
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="areaCode != null and areaCode != ''">area_code,</if> <if test="areaCode != null and areaCode != ''">
<if test="areaName != null and areaName != ''">area_name,</if> area_code,
<if test="locationId != null">location_id,</if> </if>
<if test="area != null">area,</if> <if test="areaName != null and areaName != ''">
<if test="maxLoa != null">max_loa,</if> area_name,
<if test="positionX != null">position_x,</if> </if>
<if test="positionY != null">position_y,</if> <if test="locationId != null">
<if test="positionZ != null">position_z,</if> location_id,
<if test="enableFlag != null">enable_flag,</if> </if>
<if test="frozenFlag != null">frozen_flag,</if> <if test="area != null">
<if test="remark != null">remark,</if> area,
<if test="attr1 != null">attr1,</if> </if>
<if test="attr2 != null">attr2,</if> <if test="maxLoa != null">
<if test="attr3 != null">attr3,</if> max_loa,
<if test="attr4 != null">attr4,</if> </if>
<if test="createBy != null">create_by,</if> <if test="positionX != null">
<if test="createTime != null">create_time,</if> position_x,
<if test="updateBy != null">update_by,</if> </if>
<if test="updateTime != null">update_time,</if> <if test="positionY != null">
</trim> 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=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="areaCode != null and areaCode != ''">#{areaCode},</if> <if test="areaCode != null and areaCode != ''">
<if test="areaName != null and areaName != ''">#{areaName},</if> #{areaCode},
<if test="locationId != null">#{locationId},</if> </if>
<if test="area != null">#{area},</if> <if test="areaName != null and areaName != ''">
<if test="maxLoa != null">#{maxLoa},</if> #{areaName},
<if test="positionX != null">#{positionX},</if> </if>
<if test="positionY != null">#{positionY},</if> <if test="locationId != null">
<if test="positionZ != null">#{positionZ},</if> #{locationId},
<if test="enableFlag != null">#{enableFlag},</if> </if>
<if test="frozenFlag != null">#{frozenFlag},</if> <if test="area != null">
<if test="remark != null">#{remark},</if> #{area},
<if test="attr1 != null">#{attr1},</if> </if>
<if test="attr2 != null">#{attr2},</if> <if test="maxLoa != null">
<if test="attr3 != null">#{attr3},</if> #{maxLoa},
<if test="attr4 != null">#{attr4},</if> </if>
<if test="createBy != null">#{createBy},</if> <if test="positionX != null">
<if test="createTime != null">#{createTime},</if> #{positionX},
<if test="updateBy != null">#{updateBy},</if> </if>
<if test="updateTime != null">#{updateTime},</if> <if test="positionY != null">
</trim> #{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> </insert>
<update id="updateWmStorageArea" parameterType="WmStorageArea"> <update id="updateWmStorageArea" parameterType="WmStorageArea">
update wm_storage_area update wm_storage_area
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if> <if test="areaCode != null and areaCode != ''">
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if> area_code = #{areaCode},
<if test="locationId != null">location_id = #{locationId},</if> </if>
<if test="area != null">area = #{area},</if> <if test="areaName != null and areaName != ''">
<if test="maxLoa != null">max_loa = #{maxLoa},</if> area_name = #{areaName},
<if test="positionX != null">position_x = #{positionX},</if> </if>
<if test="positionY != null">position_y = #{positionY},</if> <if test="locationId != null">
<if test="positionZ != null">position_z = #{positionZ},</if> location_id = #{locationId},
<if test="enableFlag != null">enable_flag = #{enableFlag},</if> </if>
<if test="frozenFlag != null">frozen_flag = #{frozenFlag},</if> <if test="area != null">
<if test="remark != null">remark = #{remark},</if> area = #{area},
<if test="attr1 != null">attr1 = #{attr1},</if> </if>
<if test="attr2 != null">attr2 = #{attr2},</if> <if test="maxLoa != null">
<if test="attr3 != null">attr3 = #{attr3},</if> max_loa = #{maxLoa},
<if test="attr4 != null">attr4 = #{attr4},</if> </if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="positionX != null">
<if test="createTime != null">create_time = #{createTime},</if> position_x = #{positionX},
<if test="updateBy != null">update_by = #{updateBy},</if> </if>
<if test="updateTime != null">update_time = #{updateTime},</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> </trim>
where area_id = #{areaId} where area_id = #{areaId}
</update> </update>
<update id="deleteWmStorageAreaByAreaId" parameterType="Long"> <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} where area_id = #{areaId}
</update> </update>
<update id="deleteWmStorageAreaByAreaIds" parameterType="String"> <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 where area_id in
<foreach item="areaId" collection="array" open="(" separator="," close=")"> <foreach item="areaId" collection="array" open="(" separator="," close=")">
#{areaId} #{areaId}
@ -192,13 +375,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<update id="deleteByWarehouseId" parameterType="Long"> <update id="deleteByWarehouseId" parameterType="Long">
update wm_storage_area set IS_DELETE =1 update wm_storage_area
where location_id in ( select location_id from wm_storage_location where warehouse_id = #{warehouseId}) set IS_DELETE =1
where location_id in (select location_id from wm_storage_location where warehouse_id = #{warehouseId})
</update> </update>
<update id="deleteByLocationId" parameterType="Long"> <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} where location_id = #{locationId}
</update> </update>
</mapper> </mapper>