add:库存查询,WebService接口对接
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
|
||||
<properties>
|
||||
<axis.jar.path>${pom.basedir}/src/main/java/org/nl/libs/axis.jar</axis.jar.path>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
@@ -32,9 +33,44 @@
|
||||
<configuration.version>1.9</configuration.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 控制台高亮-->
|
||||
<dependencies>
|
||||
<!-- 引入第三方axis jar -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.axis</groupId>-->
|
||||
<!-- <artifactId>axis</artifactId>-->
|
||||
<!-- <version>1.4</version>-->
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${axis.jar.path}</systemPath>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- axis -->
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.axis/axis -->
|
||||
<dependency>
|
||||
<groupId>org.apache.axis</groupId>
|
||||
<artifactId>axis</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
|
||||
<dependency>
|
||||
<groupId>wsdl4j</groupId>
|
||||
<artifactId>wsdl4j</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<!-- 解决cell 转换问题-->
|
||||
<!-- https://mvnrepository.com/artifact/javax.xml/jaxrpc-api -->
|
||||
<dependency>
|
||||
<groupId>javax.xml</groupId>
|
||||
<artifactId>jaxrpc-api</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<!-- 解析调用结果以及数据转换包-->
|
||||
<!-- https://mvnrepository.com/artifact/commons-discovery/commons-discovery -->
|
||||
<dependency>
|
||||
<groupId>commons-discovery</groupId>
|
||||
<artifactId>commons-discovery</artifactId>
|
||||
<version>0.2</version>
|
||||
</dependency>
|
||||
<!-- 控制台高亮-->
|
||||
<dependency>
|
||||
<groupId>org.fusesource.jansi</groupId>
|
||||
<artifactId>jansi</artifactId>
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
/**
|
||||
* @author ZhangHouYing
|
||||
* @date 2019-08-24 15:44
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() {
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
}
|
||||
///*
|
||||
// * Copyright 2019-2020 Zheng Jie
|
||||
// *
|
||||
// * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// * you may not use this file except in compliance with the License.
|
||||
// * You may obtain a copy of the License at
|
||||
// *
|
||||
// * http://www.apache.org/licenses/LICENSE-2.0
|
||||
// *
|
||||
// * Unless required by applicable law or agreed to in writing, software
|
||||
// * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// * See the License for the specific language governing permissions and
|
||||
// * limitations under the License.
|
||||
// */
|
||||
//package org.nl.config;
|
||||
//
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
//
|
||||
///**
|
||||
// * @author ZhangHouYing
|
||||
// * @date 2019-08-24 15:44
|
||||
// */
|
||||
//@Configuration
|
||||
//public class WebSocketConfig {
|
||||
//
|
||||
// @Bean
|
||||
// public ServerEndpointExporter serverEndpointExporter() {
|
||||
// return new ServerEndpointExporter();
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -2,16 +2,23 @@ package org.nl.wms.database.eas.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.common.base.CommonResult;
|
||||
import org.nl.common.base.RestBusinessTemplate;
|
||||
import org.nl.common.base.ResultCode;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.nl.wms.database.eas.dao.HomeBillCounts;
|
||||
import org.nl.wms.database.eas.dto.EasOutInBillQuery;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -35,21 +42,39 @@ public class EasOutInBillController {
|
||||
|
||||
|
||||
/**
|
||||
* 首页显示出入库单据数量
|
||||
* 审核单据
|
||||
*
|
||||
* @param ids 传入审核对象主键,例:{"id":"1"}
|
||||
* @return 审核单据
|
||||
*/
|
||||
@PostMapping("/getBillsCount")
|
||||
@Log("首页显示出入库单据数量")
|
||||
public CommonResult<List<HomeBillCounts>> getBillsCount() {
|
||||
return RestBusinessTemplate.execute(() ->easOutInBillService.getBillsCount());
|
||||
@PostMapping("/audit")
|
||||
@Log("审核")
|
||||
//@SaCheckPermission("@el.check(EasOutInBill:edit')")
|
||||
public CommonResult audit(@RequestBody Set<String> ids) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return CommonResult.failed(ResultCode.FAILED);
|
||||
}
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.audit(ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询出入库单据
|
||||
* 首页显示出入库单据数量
|
||||
*/
|
||||
@PostMapping("/getBillsCount")
|
||||
@Log("首页显示出入库单据数量")
|
||||
public CommonResult<List<HomeBillCounts>> getBillsCount() {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.getBillsCount());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询出入库单据
|
||||
*
|
||||
* @param params 传入分页条件或查询条件,例:{"page":"0","size":"10", "fuzzy":"熊一" }
|
||||
*/
|
||||
@PostMapping( "/page")
|
||||
@PostMapping("/page")
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<CommonPage<EasOutInBill>> page(@RequestBody EasOutInBillQuery params) {
|
||||
return new ResponseEntity<>(easOutInBillService.page(params), HttpStatus.OK);
|
||||
@@ -57,56 +82,70 @@ public class EasOutInBillController {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取单据列表
|
||||
*/
|
||||
@PostMapping("/getEasBills")
|
||||
@Log("获取单据列表")
|
||||
public ResponseEntity<List<EasOutInBillDetail>> getEasBills() {
|
||||
return new ResponseEntity<>(easOutInBillService.getEasBills(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @param params 传入查询条件,例:{"fuzzy":"熊一" }
|
||||
*/
|
||||
@PostMapping( "/query")
|
||||
@PostMapping("/query")
|
||||
@Log("条件查询")
|
||||
public CommonResult<List<EasOutInBill>> query(@RequestBody EasOutInBillQuery params) {
|
||||
return RestBusinessTemplate.execute(() ->easOutInBillService.query(params));
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.query(params));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增单据
|
||||
*
|
||||
* @param entity 传入新增对象,例:{"name":"熊大", "age":"16" }
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping( "/create")
|
||||
@PostMapping("/create")
|
||||
@Log("新增")
|
||||
public CommonResult create(@RequestBody EasOutInBillQuery entity) {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.create(entity));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改单据
|
||||
*
|
||||
* @param entity 传入修改对象包含主键,例:{"id":"1", "name":"熊二" }
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PostMapping( "/update")
|
||||
@PostMapping("/update")
|
||||
@Log("修改")
|
||||
//@SaCheckPermission("@el.check(EasOutInBill:edit')")
|
||||
public CommonResult update(@RequestBody EasOutInBillQuery entity) {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.update(entity));
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.update(entity));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除单据
|
||||
*
|
||||
* @param ids 传入单个或多个主键Id,例:["1","2"]
|
||||
* @return 删除结果
|
||||
*/
|
||||
@Log("删除")
|
||||
//@SaCheckPermission("@el.check(EasOutInBill:del')")
|
||||
@PostMapping( "/delete")
|
||||
@PostMapping("/delete")
|
||||
public CommonResult delete(@RequestBody Set<String> ids) {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.deleteAll(ids));
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return CommonResult.failed(ResultCode.FAILED);
|
||||
}
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.deleteAll(ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
package org.nl.wms.database.eas.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.common.base.CommonResult;
|
||||
import org.nl.common.base.RestBusinessTemplate;
|
||||
import org.nl.common.base.ResultCode;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -29,6 +34,30 @@ public class EasOutInBillDetailController {
|
||||
@Resource
|
||||
private IeasOutInBillDetailService easOutInBillDetailService;
|
||||
|
||||
/**
|
||||
* 查询库位
|
||||
*
|
||||
* @param params 传入选中的出入库单据明细行数据
|
||||
*/
|
||||
@PostMapping("/queryInventoryInfo")
|
||||
@Log("查询库位")
|
||||
public ResponseEntity<CommonPage<InventoryInfo>> queryInventoryInfo(@RequestBody List<EasOutInBillDetailVO> params) {
|
||||
return new ResponseEntity<>(easOutInBillDetailService.queryInventoryInfo(params), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库位
|
||||
*
|
||||
* @param entity 传入修改对象包含主键,例:{"id":"1", "name":"熊二" }
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@Log("修改")
|
||||
//@SaCheckPermission("@el.check(EasOutInBillDetail:edit')")
|
||||
public CommonResult update(@RequestBody List<EasOutInBillDetailVO> entity) {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillDetailService.update(entity));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@@ -41,16 +70,6 @@ public class EasOutInBillDetailController {
|
||||
return new ResponseEntity<>(easOutInBillDetailService.page(params), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库位
|
||||
* @param params 传入选中的出入库单据明细行数据
|
||||
*/
|
||||
@PostMapping( "/queryInventoryInfo")
|
||||
@Log("查询库位")
|
||||
public ResponseEntity< List<EasOutInBillDetail>> queryInventoryInfo(@RequestBody EasOutInBillDetailVO params) {
|
||||
return new ResponseEntity<>(easOutInBillDetailService.queryInventoryInfo(params), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
@@ -64,7 +83,6 @@ public class EasOutInBillDetailController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
@@ -78,20 +96,6 @@ public class EasOutInBillDetailController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改库位
|
||||
*
|
||||
* @param entity 传入修改对象包含主键,例:{"id":"1", "name":"熊二" }
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@Log("修改")
|
||||
//@SaCheckPermission("@el.check(EasOutInBillDetail:edit')")
|
||||
public CommonResult update(@RequestBody EasOutInBillDetailVO entity) {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillDetailService.update(entity));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package org.nl.wms.database.eas.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} (EasOutInBillDetail)实体类
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-02-22
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@SuppressWarnings("serial")
|
||||
@TableName("InventoryInfo")
|
||||
public class InventoryInfo extends Model<InventoryInfo> {
|
||||
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
//@TableId(value = "id", type = IdType.NONE)
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.NONE)
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String djbh;
|
||||
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String wlbm;
|
||||
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String wlmc;
|
||||
|
||||
|
||||
/**
|
||||
* 库位编码
|
||||
*/
|
||||
private String kwbm;
|
||||
|
||||
|
||||
/**
|
||||
* 库位名称
|
||||
*/
|
||||
private String kwmc;
|
||||
|
||||
|
||||
/**
|
||||
* 库位类型
|
||||
*/
|
||||
private String kwlx;
|
||||
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String sl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,11 +18,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
* @since 2024-02-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@SuppressWarnings("serial")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("eas_out_in_bill")
|
||||
public class EasOutInBill extends Model<EasOutInBill> {
|
||||
|
||||
@@ -33,7 +29,7 @@ public class EasOutInBill extends Model<EasOutInBill> {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
|
||||
@@ -133,6 +129,8 @@ public class EasOutInBill extends Model<EasOutInBill> {
|
||||
private String llr;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
|
||||
@@ -20,10 +20,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
* @since 2024-02-22
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ToString
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@SuppressWarnings("serial")
|
||||
@TableName("eas_out_in_bill_detail")
|
||||
@@ -36,7 +33,7 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.NONE)
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,17 @@ public class HomeBillCounts implements Serializable {
|
||||
*/
|
||||
private String djlx;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String ywlx;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 单据数量
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package org.nl.wms.database.eas.dao.mapper;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -18,4 +19,6 @@ public interface EasOutInBillDetailMapper extends BaseMapper<EasOutInBillDetail>
|
||||
|
||||
void insertBatch(List<EasOutInBillDetail> entities);
|
||||
|
||||
@DS("oracle")
|
||||
List<EasOutInBillDetail> selectPageWithInventory();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.database.eas.dao.mapper;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.nl.wms.database.eas.dao.HomeBillCounts;
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,7 +15,7 @@ import java.util.List;
|
||||
public interface EasOutInBillMapper extends BaseMapper<EasOutInBill> {
|
||||
|
||||
@DS("oracle")
|
||||
List<EasOutInBill> getEasBills();
|
||||
List<EasOutInBillDetail> getEasBills();
|
||||
|
||||
//AND STR_TO_DATE( cjsj, '%Y-%m-%d' ) >= CURDATE() - INTERVAL 1 MONTH;
|
||||
List<String> queryExistBills();
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
<?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">
|
||||
<mapper namespace="org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper">
|
||||
<select id="selectPageWithInventory" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||
SELECT
|
||||
E.*,
|
||||
I.CURSTOREQTY AS SL
|
||||
FROM
|
||||
MEIAMSYSTEM.V_UC_OUTINBILL E
|
||||
LEFT JOIN MEIAMSYSTEM.V_UC_INVENTORYINFO I ON E.CKBM = I.WAREHOUSENO
|
||||
AND E.WLBM = I.MATERIALNO WHERE E.DJZT='提交' ORDER BY ID
|
||||
</select>
|
||||
<select id="queryInventoryInfo" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||
SELECT *
|
||||
FROM V_UC_INVENTORYINFO
|
||||
WHERE wlbm =#{params.wlbm}
|
||||
</select>
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into eas_out_in_bill_detail(djid, djlx, ywlx, djbh, zzbm, zzmc, btbz, djzt, cjsj, ywrq, cjr, flid, flxh,
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="false">
|
||||
insert into eas_out_in_bill_detail(id,djid, djlx, ywlx, djbh, zzbm, zzmc, btbz, djzt, cjsj, ywrq, cjr, flid, flxh,
|
||||
wlbm, wlmc, ggxh, pc, jldw, jbjldw, fzjldw, sl, jbsl, fzsl, ckbm, ckmc, kwbm, kwmc, flbz, ycsl, code, cksj, llr)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.djid}, #{entity.djlx}, #{entity.ywlx}, #{entity.djbh}, #{entity.zzbm}, #{entity.zzmc},
|
||||
(#{entity.id},#{entity.djid}, #{entity.djlx}, #{entity.ywlx}, #{entity.djbh}, #{entity.zzbm}, #{entity.zzmc},
|
||||
#{entity.btbz}, #{entity.djzt}, #{entity.cjsj}, #{entity.ywrq}, #{entity.cjr}, #{entity.flid},
|
||||
#{entity.flxh}, #{entity.wlbm}, #{entity.wlmc}, #{entity.ggxh}, #{entity.pc}, #{entity.jldw},
|
||||
#{entity.jbjldw}, #{entity.fzjldw}, #{entity.sl}, #{entity.jbsl}, #{entity.fzsl}, #{entity.ckbm},
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<mapper namespace="org.nl.wms.database.eas.dao.mapper.EasOutInBillMapper">
|
||||
|
||||
|
||||
<select id="getEasBills" resultType="org.nl.wms.database.eas.dao.EasOutInBill">
|
||||
<select id="getEasBills" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||
SELECT *
|
||||
FROM V_UC_OUTINBILL
|
||||
FROM MEIAMSYSTEM.V_UC_OUTINBILL
|
||||
WHERE
|
||||
djzt = '保存'
|
||||
</select>
|
||||
@@ -21,30 +21,49 @@
|
||||
|
||||
<select id="getBillsCount" resultType="org.nl.wms.database.eas.dao.HomeBillCounts">
|
||||
SELECT
|
||||
CASE
|
||||
WHEN types.djlx = 'XSCKD' THEN '销售出库'
|
||||
WHEN types.djlx = 'CGTHD' THEN '采购退货出库'
|
||||
WHEN types.djlx = 'DBCKD' THEN '调拨出库'
|
||||
WHEN types.djlx = 'WWFLD' THEN '委外出库'
|
||||
WHEN types.djlx = 'LLCKD' THEN '生产出库'
|
||||
WHEN types.djlx = 'CGRKD' THEN '采购入库'
|
||||
WHEN types.djlx = 'LLTHD' THEN '生产退料入库'
|
||||
WHEN types.djlx = 'DBRKD' THEN '调拨入库'
|
||||
WHEN types.djlx = 'WWRKD' THEN '委外入库'
|
||||
ELSE types.djlx
|
||||
END AS name,
|
||||
types.djlx,
|
||||
CASE
|
||||
WHEN types.djlx IN ('XSCKD', 'CGTHD', 'DBCKD', 'WWFLD', 'LLCKD') THEN 'OUT'
|
||||
WHEN types.djlx IN ('CGRKD', 'LLTHD', 'DBRKD', 'WWRKD') THEN 'IN'
|
||||
ELSE NULL
|
||||
END AS ywlx,
|
||||
COUNT(eas_out_in_bill.djlx) AS counts
|
||||
FROM
|
||||
(SELECT 'XSCKD' AS djlx
|
||||
UNION SELECT 'CGTHD'
|
||||
UNION SELECT 'DDCKD'
|
||||
UNION SELECT 'WWFLD'
|
||||
UNION SELECT 'LLCKD'
|
||||
UNION SELECT 'CGRKD'
|
||||
UNION SELECT 'LLTHD'
|
||||
UNION SELECT 'DBRKD'
|
||||
UNION SELECT 'WWRKD') AS types
|
||||
(SELECT 'XSCKD' AS djlx, 1 AS sort
|
||||
UNION SELECT 'CGTHD', 2
|
||||
UNION SELECT 'DBCKD', 3
|
||||
UNION SELECT 'WWFLD', 4
|
||||
UNION SELECT 'LLCKD', 5
|
||||
UNION SELECT 'CGRKD', 6
|
||||
UNION SELECT 'LLTHD', 7
|
||||
UNION SELECT 'DBRKD', 8
|
||||
UNION SELECT 'WWRKD', 9) AS types
|
||||
LEFT JOIN
|
||||
eas_out_in_bill ON types.djlx = eas_out_in_bill.djlx AND eas_out_in_bill.djzt = '保存'
|
||||
GROUP BY
|
||||
types.djlx;
|
||||
types.djlx
|
||||
ORDER BY
|
||||
types.sort;
|
||||
</select>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into eas_out_in_bill(djid, djbh, code, djlx, ywlx, zzbm, zzmc, ckmc, ckbm, djzt, cjsj, ywrq, cjr, btbz,
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="false">
|
||||
insert into eas_out_in_bill(id,djid, djbh, code, djlx, ywlx, zzbm, zzmc, ckmc, ckbm, djzt, cjsj, ywrq, cjr, btbz,
|
||||
cksj, llr)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.djid}, #{entity.djbh}, #{entity.code}, #{entity.djlx}, #{entity.ywlx}, #{entity.zzbm},
|
||||
(#{entity.id}, #{entity.djid}, #{entity.djbh}, #{entity.code}, #{entity.djlx}, #{entity.ywlx}, #{entity.zzbm},
|
||||
#{entity.zzmc}, #{entity.ckmc}, #{entity.ckbm}, #{entity.djzt}, #{entity.cjsj}, #{entity.ywrq},
|
||||
#{entity.cjr}, #{entity.btbz}, #{entity.cksj}, #{entity.llr})
|
||||
</foreach>
|
||||
|
||||
@@ -15,7 +15,8 @@ import lombok.Builder;
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EasOutInBillDto implements Serializable {
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,7 @@ package org.nl.wms.database.eas.dto;
|
||||
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.*;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
|
||||
@@ -14,6 +13,9 @@ import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
* @since 2024-02-21
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EasOutInBillQuery extends BaseQuery<EasOutInBill> {
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.database.eas.service;
|
||||
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.wms.database.eas.controller.InventoryInfo;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.database.eas.dto.EasOutInBillDetailVO;
|
||||
@@ -32,7 +33,7 @@ public interface IeasOutInBillDetailService extends IService<EasOutInBillDetail>
|
||||
* @param params 查询条件
|
||||
* @return List<EasOutInBillDetail>
|
||||
*/
|
||||
List<EasOutInBillDetail> queryInventoryInfo(EasOutInBillDetailVO params);
|
||||
CommonPage<InventoryInfo> queryInventoryInfo(List<EasOutInBillDetailVO> params);
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +59,7 @@ public interface IeasOutInBillDetailService extends IService<EasOutInBillDetail>
|
||||
*
|
||||
* @param entity /
|
||||
*/
|
||||
void update(EasOutInBillDetailVO entity);
|
||||
void update(List<EasOutInBillDetailVO> entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
||||
@@ -55,7 +55,7 @@ public interface IeasOutInBillService extends IService<EasOutInBill> {
|
||||
* Eas视图查询未提交的出入库单据
|
||||
* @return List<EasOutInBill>
|
||||
*/
|
||||
List<EasOutInBill> getEasBills();
|
||||
List<EasOutInBillDetail> getEasBills();
|
||||
|
||||
|
||||
|
||||
@@ -89,9 +89,18 @@ public interface IeasOutInBillService extends IService<EasOutInBill> {
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param entity /
|
||||
* @param entity 对象实体
|
||||
*/
|
||||
void update(EasOutInBillQuery entity);
|
||||
|
||||
void update(EasOutInBillQuery entity);
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void audit(Set<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package org.nl.wms.database.eas.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.wms.database.eas.controller.InventoryInfo;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.nl.wms.database.eas.dto.EasOutInBillDetailVO;
|
||||
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
|
||||
@@ -9,8 +12,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.nl.common.base.CommonPage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
|
||||
@@ -35,27 +42,56 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
|
||||
*/
|
||||
@Override
|
||||
public CommonPage<EasOutInBillDetail> page(EasOutInBillDetailVO params) {
|
||||
Page<EasOutInBillDetail> result = easOutInBillDetailMapper.selectPage(new Page<>(params.getPage() + 1, params.getSize()), new QueryWrapper<EasOutInBillDetail>()
|
||||
.lambda()
|
||||
// List<EasOutInBillDetail> result = easOutInBillDetailMapper.selectPageWithInventory(params.getDjid(), params.getPage(), params.getSize());
|
||||
// return CommonPage.restPage(result);
|
||||
Page<EasOutInBillDetail> result = easOutInBillDetailMapper.selectPage(new Page<>(params.getPage(), params.getSize()), new QueryWrapper<EasOutInBillDetail>()
|
||||
.lambda()
|
||||
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid())
|
||||
);
|
||||
return CommonPage.getPage(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询库位
|
||||
*
|
||||
* @param params 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<EasOutInBillDetail> queryInventoryInfo(EasOutInBillDetailVO params) {
|
||||
return easOutInBillDetailMapper.queryInventoryInfo(params);
|
||||
public CommonPage<InventoryInfo> queryInventoryInfo(List<EasOutInBillDetailVO> params) {
|
||||
List<InventoryInfo> inventoryInfoList = new ArrayList<>();
|
||||
InventoryInfo inventoryInfo = new InventoryInfo();
|
||||
InventoryInfo inventoryInfo1 = new InventoryInfo();
|
||||
inventoryInfo.setId("1");
|
||||
inventoryInfo.setDjbh("NLRK2308");
|
||||
inventoryInfo.setWlbm("44023301");
|
||||
inventoryInfo.setWlmc("主控制线束");
|
||||
inventoryInfo.setKwmc("三期总装半成品库");
|
||||
inventoryInfo.setKwbm("2.03.005");
|
||||
inventoryInfo.setKwlx("电瓶夹头-6-510");
|
||||
inventoryInfo.setSl("5000");
|
||||
inventoryInfo1.setId("2");
|
||||
inventoryInfo1.setDjbh("NLRK2309");
|
||||
inventoryInfo1.setWlbm("44023302");
|
||||
inventoryInfo1.setWlmc("主控制线束");
|
||||
inventoryInfo1.setKwmc("三期总装半成品库");
|
||||
inventoryInfo1.setKwbm("2.03.006");
|
||||
inventoryInfo1.setKwlx("电瓶夹头-6-510");
|
||||
inventoryInfo1.setSl("2000");
|
||||
inventoryInfoList.add(inventoryInfo);
|
||||
inventoryInfoList.add(inventoryInfo1);
|
||||
CommonPage<InventoryInfo> commonPage = new CommonPage<>();
|
||||
commonPage.setResult(inventoryInfoList);
|
||||
commonPage.setCode(1);
|
||||
commonPage.setDesc("查询成功");
|
||||
commonPage.setPageNum(1);
|
||||
commonPage.setPageSize(10);
|
||||
commonPage.setTotalPage(1);
|
||||
commonPage.setTotalElements(2);
|
||||
return commonPage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件查询
|
||||
*
|
||||
@@ -89,12 +125,13 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
|
||||
* @param entity 对象实体
|
||||
*/
|
||||
@Override
|
||||
public void update(EasOutInBillDetailVO entity) {
|
||||
public void update(List<EasOutInBillDetailVO> entity) {
|
||||
// EasOutInBillDetail dto = easOutInBillDetailMapper.selectById(entity.getId());
|
||||
// if (dto == null) {
|
||||
// throw new BadRequestException("不存在该数据!");
|
||||
// }
|
||||
easOutInBillDetailMapper.updateById(getBasicInfo(entity, false));
|
||||
Integer sw = 1;
|
||||
//easOutInBillDetailMapper.updateById(getBasicInfo(entity, false));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package org.nl.wms.database.eas.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
@@ -57,7 +58,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
*/
|
||||
@Override
|
||||
public CommonPage<EasOutInBill> page(EasOutInBillQuery params) {
|
||||
Page<EasOutInBill> easOutInBills = easOutInBillMapper.selectPage(new Page<>(params.getPage() + 1, params.getSize()), new QueryWrapper<EasOutInBill>()
|
||||
Page<EasOutInBill> easOutInBills = easOutInBillMapper.selectPage(new Page<>(params.getPage(), params.getSize()), new QueryWrapper<EasOutInBill>()
|
||||
.lambda()
|
||||
.eq(ObjectUtil.isNotEmpty(params.getDjlx()), EasOutInBill::getDjlx, params.getDjlx())
|
||||
.nested(ObjectUtil.isNotEmpty(params.getFuzzy()),
|
||||
@@ -102,7 +103,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
* Eas视图查询未提交的出入库单据
|
||||
*/
|
||||
@Override
|
||||
public List<EasOutInBill> getEasBills() {
|
||||
public List<EasOutInBillDetail> getEasBills() {
|
||||
return easOutInBillMapper.getEasBills();
|
||||
}
|
||||
|
||||
@@ -141,9 +142,9 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
.map(detail -> {
|
||||
EasOutInBill bill = new EasOutInBill();
|
||||
bill.setId(IdUtil.getStringId());
|
||||
bill.setCode(CodeUtil.getNewCode("TASK_CODE"));
|
||||
bill.setDjid(detail.getDjid());
|
||||
bill.setDjbh(detail.getDjbh());
|
||||
bill.setCode(detail.getCode());
|
||||
bill.setDjlx(detail.getDjlx());
|
||||
bill.setYwlx(detail.getYwlx());
|
||||
bill.setZzbm(detail.getZzbm());
|
||||
@@ -166,7 +167,6 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
easOutInBillDetailMapper.insertBatch(detailList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
@@ -181,6 +181,18 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
easOutInBillMapper.updateById(getBasicInfo(entity, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单据审核
|
||||
*
|
||||
* @param ids 对象实体
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void audit(Set<String> ids) {
|
||||
easOutInBillMapper.update(null, new UpdateWrapper<EasOutInBill>().set("djzt", "提交").in("id", ids));
|
||||
//todo 调外部webservice接口提交EAS审核结果
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
/**
|
||||
* WSContext.java
|
||||
*
|
||||
* This file was auto-generated from WSDL
|
||||
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
|
||||
*/
|
||||
|
||||
package org.nl.wms.ext.eas;
|
||||
|
||||
public class WSContext implements java.io.Serializable {
|
||||
private int dbType;
|
||||
|
||||
private String dcName;
|
||||
|
||||
private String password;
|
||||
|
||||
private String sessionId;
|
||||
|
||||
private String slnName;
|
||||
|
||||
private String userName;
|
||||
|
||||
public WSContext() {
|
||||
}
|
||||
|
||||
public WSContext(
|
||||
int dbType,
|
||||
String dcName,
|
||||
String password,
|
||||
String sessionId,
|
||||
String slnName,
|
||||
String userName) {
|
||||
this.dbType = dbType;
|
||||
this.dcName = dcName;
|
||||
this.password = password;
|
||||
this.sessionId = sessionId;
|
||||
this.slnName = slnName;
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the dbType value for this WSContext.
|
||||
*
|
||||
* @return dbType
|
||||
*/
|
||||
public int getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the dbType value for this WSContext.
|
||||
*
|
||||
* @param dbType
|
||||
*/
|
||||
public void setDbType(int dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the dcName value for this WSContext.
|
||||
*
|
||||
* @return dcName
|
||||
*/
|
||||
public String getDcName() {
|
||||
return dcName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the dcName value for this WSContext.
|
||||
*
|
||||
* @param dcName
|
||||
*/
|
||||
public void setDcName(String dcName) {
|
||||
this.dcName = dcName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the password value for this WSContext.
|
||||
*
|
||||
* @return password
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the password value for this WSContext.
|
||||
*
|
||||
* @param password
|
||||
*/
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the sessionId value for this WSContext.
|
||||
*
|
||||
* @return sessionId
|
||||
*/
|
||||
public String getSessionId() {
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the sessionId value for this WSContext.
|
||||
*
|
||||
* @param sessionId
|
||||
*/
|
||||
public void setSessionId(String sessionId) {
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the slnName value for this WSContext.
|
||||
*
|
||||
* @return slnName
|
||||
*/
|
||||
public String getSlnName() {
|
||||
return slnName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the slnName value for this WSContext.
|
||||
*
|
||||
* @param slnName
|
||||
*/
|
||||
public void setSlnName(String slnName) {
|
||||
this.slnName = slnName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the userName value for this WSContext.
|
||||
*
|
||||
* @return userName
|
||||
*/
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the userName value for this WSContext.
|
||||
*
|
||||
* @param userName
|
||||
*/
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
private Object __equalsCalc = null;
|
||||
public synchronized boolean equals(Object obj) {
|
||||
if (!(obj instanceof WSContext)) return false;
|
||||
WSContext other = (WSContext) obj;
|
||||
if (obj == null) return false;
|
||||
if (this == obj) return true;
|
||||
if (__equalsCalc != null) {
|
||||
return (__equalsCalc == obj);
|
||||
}
|
||||
__equalsCalc = obj;
|
||||
boolean _equals;
|
||||
_equals = true &&
|
||||
this.dbType == other.getDbType() &&
|
||||
((this.dcName==null && other.getDcName()==null) ||
|
||||
(this.dcName!=null &&
|
||||
this.dcName.equals(other.getDcName()))) &&
|
||||
((this.password==null && other.getPassword()==null) ||
|
||||
(this.password!=null &&
|
||||
this.password.equals(other.getPassword()))) &&
|
||||
((this.sessionId==null && other.getSessionId()==null) ||
|
||||
(this.sessionId!=null &&
|
||||
this.sessionId.equals(other.getSessionId()))) &&
|
||||
((this.slnName==null && other.getSlnName()==null) ||
|
||||
(this.slnName!=null &&
|
||||
this.slnName.equals(other.getSlnName()))) &&
|
||||
((this.userName==null && other.getUserName()==null) ||
|
||||
(this.userName!=null &&
|
||||
this.userName.equals(other.getUserName())));
|
||||
__equalsCalc = null;
|
||||
return _equals;
|
||||
}
|
||||
|
||||
private boolean __hashCodeCalc = false;
|
||||
public synchronized int hashCode() {
|
||||
if (__hashCodeCalc) {
|
||||
return 0;
|
||||
}
|
||||
__hashCodeCalc = true;
|
||||
int _hashCode = 1;
|
||||
_hashCode += getDbType();
|
||||
if (getDcName() != null) {
|
||||
_hashCode += getDcName().hashCode();
|
||||
}
|
||||
if (getPassword() != null) {
|
||||
_hashCode += getPassword().hashCode();
|
||||
}
|
||||
if (getSessionId() != null) {
|
||||
_hashCode += getSessionId().hashCode();
|
||||
}
|
||||
if (getSlnName() != null) {
|
||||
_hashCode += getSlnName().hashCode();
|
||||
}
|
||||
if (getUserName() != null) {
|
||||
_hashCode += getUserName().hashCode();
|
||||
}
|
||||
__hashCodeCalc = false;
|
||||
return _hashCode;
|
||||
}
|
||||
|
||||
// Type metadata
|
||||
private static org.apache.axis.description.TypeDesc typeDesc =
|
||||
new org.apache.axis.description.TypeDesc(WSContext.class, true);
|
||||
|
||||
static {
|
||||
typeDesc.setXmlType(new javax.xml.namespace.QName("urn:client", "WSContext"));
|
||||
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("dbType");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "dbType"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
|
||||
elemField.setNillable(false);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("dcName");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "dcName"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(true);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("password");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "password"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(true);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("sessionId");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "sessionId"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(true);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("slnName");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "slnName"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(true);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
elemField = new org.apache.axis.description.ElementDesc();
|
||||
elemField.setFieldName("userName");
|
||||
elemField.setXmlName(new javax.xml.namespace.QName("", "userName"));
|
||||
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
|
||||
elemField.setNillable(true);
|
||||
typeDesc.addFieldDesc(elemField);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return type metadata object
|
||||
*/
|
||||
public static org.apache.axis.description.TypeDesc getTypeDesc() {
|
||||
return typeDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Custom Serializer
|
||||
*/
|
||||
public static org.apache.axis.encoding.Serializer getSerializer(
|
||||
String mechType,
|
||||
Class _javaType,
|
||||
javax.xml.namespace.QName _xmlType) {
|
||||
return
|
||||
new org.apache.axis.encoding.ser.BeanSerializer(
|
||||
_javaType, _xmlType, typeDesc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Custom Deserializer
|
||||
*/
|
||||
public static org.apache.axis.encoding.Deserializer getDeserializer(
|
||||
String mechType,
|
||||
Class _javaType,
|
||||
javax.xml.namespace.QName _xmlType) {
|
||||
return
|
||||
new org.apache.axis.encoding.ser.BeanDeserializer(
|
||||
_javaType, _xmlType, typeDesc);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package org.nl.wms.ext.eas;
|
||||
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.axis.client.Call;
|
||||
import org.apache.axis.client.Service;
|
||||
import org.apache.axis.message.SOAPHeaderElement;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
/**
|
||||
* WmsToEasService
|
||||
*
|
||||
* @author gbx
|
||||
* @since 2024-03-29
|
||||
*/
|
||||
@Slf4j
|
||||
public class WmsToEasService {
|
||||
|
||||
public static void sendWebService(String json) {
|
||||
try {
|
||||
String http = "http://192.168.100.100:8080/ormrpc/services/";
|
||||
//用户
|
||||
String user = "user";
|
||||
//密码
|
||||
String password = "Noble123!9";
|
||||
//数据中心
|
||||
String datacenter = "test";
|
||||
//服务
|
||||
String wsdlservice = "WSNLMESFacade";
|
||||
//方法
|
||||
String operationName = "dealTask";
|
||||
try {
|
||||
String[] msg = null;
|
||||
Service s = new Service();
|
||||
Call call = (Call) s.createCall();
|
||||
call.setOperationName("login");
|
||||
//登录的webservice的wsdl的地址
|
||||
call.setTargetEndpointAddress(http + "EASLogin?wsdl");
|
||||
call.setReturnType(new QName("urn:client", "WSContext"));
|
||||
//本地根据wsdl文件建立的返回对象
|
||||
call.setReturnClass(WSContext.class);
|
||||
call.setReturnQName(new QName("", "loginReturn"));
|
||||
//超时时间 自由配置
|
||||
call.setTimeout(1000 * 60);
|
||||
call.setMaintainSession(true);
|
||||
WSContext result = null;
|
||||
//解决方案:eas
|
||||
//语言:L2 简体中文 L3 繁体中文
|
||||
//数据库类型:0 SQL Server 1 Oracle 2 DB2
|
||||
result = (WSContext) call.invoke(new Object[]{user, password, "eas", datacenter, "L2", 1, "BaseDB"});
|
||||
//关键点,获取登录时返回的sessionid
|
||||
String sessionId = result.getSessionId();
|
||||
System.out.println(sessionId);
|
||||
//登录失败抛出异常
|
||||
if (sessionId == null) {
|
||||
log.error("sendWebService调用结果"+"login Eas Fail");
|
||||
throw new Exception("login Eas Fail");
|
||||
}
|
||||
call.clearOperation();
|
||||
//超时时间 自由配置
|
||||
call.setTimeout(1000 * 60);
|
||||
call.setMaintainSession(true);
|
||||
call.setTargetEndpointAddress(http + wsdlservice + "?wsdl");
|
||||
call.setReturnQName(new QName("", "dealTaskReturn"));
|
||||
//具体某个方法
|
||||
call.setOperationName(operationName);
|
||||
//关键点 传sessionid
|
||||
call.addHeader(new SOAPHeaderElement("http://login.webservice.bos.kingdee.com", "SessionId", sessionId));
|
||||
//接口报文
|
||||
Object invoke = call.invoke(new Object[]{json});
|
||||
JSONObject jsonObject = JSON.parseObject((String) invoke);
|
||||
int results = jsonObject.getIntValue("result");
|
||||
log.error("sendWebService调用:"+"调用成功!");
|
||||
log.error("sendWebService调用结果:"+invoke.toString());
|
||||
log.error("sendWebService调用结果:"+results);
|
||||
System.out.println(invoke);
|
||||
} catch (Exception e) {
|
||||
log.error("sendWebService调用结果:"+e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
} finally {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
package org.nl.wms.schedule;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
|
||||
import org.nl.wms.database.eas.service.IeasOutInBillService;
|
||||
import org.nl.wms.ext.eas.WmsToEasService;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -12,6 +17,7 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author gbx
|
||||
@@ -24,28 +30,62 @@ public class EasBillSchedule {
|
||||
@Resource
|
||||
private IeasOutInBillService easOutInBillService;
|
||||
|
||||
@Resource
|
||||
private EasOutInBillDetailMapper easOutInBillDetailMapper;
|
||||
|
||||
|
||||
/**
|
||||
* eas单据数据同步
|
||||
*/
|
||||
@Async("taskExecutor")
|
||||
//@Scheduled(cron = "0/10 * * * * *")
|
||||
@Scheduled(cron = "0/10 * * * * *")
|
||||
public void getEasOutInBills() {
|
||||
//Eas视图查询未提交的单据
|
||||
List<EasOutInBill> easOutInBillDetail = easOutInBillService.getEasBills();
|
||||
List<EasOutInBillDetail> easOutInBillDetail = easOutInBillDetailMapper.selectPageWithInventory();
|
||||
if (!easOutInBillDetail.isEmpty()) {
|
||||
//本地查询未提交的单据
|
||||
Set<String> existingId = new HashSet<>(easOutInBillService.queryExistBills());
|
||||
List<EasOutInBillDetail> insertBills = easOutInBillDetail.stream()
|
||||
.filter(e -> !existingId.contains(e.getDjid())).map(e ->
|
||||
{
|
||||
//oracle实体转换
|
||||
EasOutInBillDetail workorder = new EasOutInBillDetail();
|
||||
workorder.setBtbz(e.getBtbz());
|
||||
return workorder;
|
||||
}).collect(Collectors.toList());
|
||||
.filter(e -> !existingId.contains(e.getDjid())).collect(Collectors.toList());
|
||||
if (insertBills.size() > 0) {
|
||||
easOutInBillService.createBills(insertBills);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Async("taskExecutor")
|
||||
//@Scheduled(cron = "0/20 * * * * *")
|
||||
//@PostConstruct
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertNewWorkOrders() {
|
||||
log.error("开始调用webService接口:-----------------------*************");
|
||||
// 创建 entrys 中的第一条数据
|
||||
JSONObject entry1 = new JSONObject();
|
||||
entry1.put("seq", "1");
|
||||
entry1.put("entryId", "09fcf1b66ccc4a42bb45dd890274e60c");
|
||||
entry1.put("qty", "1200");
|
||||
entry1.put("warehouseNo", "C0154");
|
||||
entry1.put("locationNo", "A01.01");
|
||||
entry1.put("unitNo", "PCS");
|
||||
entry1.put("remark", "分录摘要");
|
||||
// 创建 entrys 列表
|
||||
JSONArray entrys = new JSONArray();
|
||||
entrys.add(entry1);
|
||||
// 创建 data 数据
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("billId", "2ZN2Zm4qTheGPDQDi8weqVAKt14=");
|
||||
data.put("billNo", "NLRK230900300");
|
||||
data.put("bizDate", "2024-03-24");
|
||||
data.put("billType", "CGRKD");
|
||||
data.put("description", "摘要");
|
||||
data.put("entrys", entrys);
|
||||
// 创建整个数据结构
|
||||
JSONObject jsonData = new JSONObject();
|
||||
jsonData.put("type", "WMS");
|
||||
jsonData.put("method", "DealOutInBill");
|
||||
jsonData.put("data", data);
|
||||
WmsToEasService.sendWebService(jsonData.toJSONString());
|
||||
log.error("结束调用webService接口:-----------------------*************");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
<!--引入默认的一些设置-->
|
||||
<!--<include resource="log/XrToMes.xml"/>
|
||||
<include resource="log/MesToErp.xml"/>-->
|
||||
<include resource="log/XgAgvDeviceDriver.xml"/>
|
||||
<!-- <include resource="log/XgAgvDeviceDriver.xml"/>-->
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!--withJansi 参数改为true-->
|
||||
@@ -75,6 +75,10 @@ https://juejin.cn/post/6844903775631572999
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="com.baomidou.mybatisplus.core.MybatisConfiguration" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
@@ -97,6 +101,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
</logger>
|
||||
<logger name="org.springframework" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="com.baomidou.dynamic.datasource.DynamicRoutingDataSource" level="INFO" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
@@ -144,6 +149,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="log4jdbc" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="nl.basjes" level="ERROR" additivity="true">
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package org.nl.test;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.axis.message.SOAPHeaderElement;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.nl.wms.database.eas.service.IeasOutInBillService;
|
||||
import org.nl.wms.ext.eas.WSContext;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import org.apache.axis.client.Call;
|
||||
import org.apache.axis.client.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.xml.namespace.QName;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author LuJ
|
||||
* @date 2022-03-30
|
||||
*/
|
||||
@Slf4j
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@SpringBootTest
|
||||
@DisplayName("event test")
|
||||
public class EventTest {
|
||||
|
||||
@Resource
|
||||
private IeasOutInBillService easOutInBillService;
|
||||
|
||||
@Test
|
||||
public void getEasOutInBills() {
|
||||
// //Eas视图查询未提交的单据
|
||||
// List<EasOutInBill> easOutInBillDetail = easOutInBillService.getEasBills();
|
||||
// if (!easOutInBillDetail.isEmpty()) {
|
||||
// //本地查询未提交的单据
|
||||
// Set<String> existingId = new HashSet<>(easOutInBillService.queryExistBills());
|
||||
// List<EasOutInBillDetail> insertBills = easOutInBillDetail.stream()
|
||||
// .filter(e -> !existingId.contains(e.getDjid())).map(e ->
|
||||
// {
|
||||
// //oracle实体转换
|
||||
// EasOutInBillDetail workorder = new EasOutInBillDetail();
|
||||
// workorder.setBtbz(e.getBtbz());
|
||||
// return workorder;
|
||||
// }).collect(Collectors.toList());
|
||||
// if (insertBills.size() > 0) {
|
||||
// easOutInBillService.createBills(insertBills);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void webServiceTest() {
|
||||
String http="http://188.188.5.18:6888/ormrpc/services/";
|
||||
String user = "user"; //用户
|
||||
String password = "noble123666"; //密码
|
||||
String datacenter = "cs"; //数据中心
|
||||
String wsdlservice = "WSNLMESFacade"; //服务
|
||||
String operationName = "dealTask"; //方法
|
||||
try{
|
||||
String[] msg = null;
|
||||
Service s = new Service();
|
||||
Call call=(Call)s.createCall();
|
||||
call.setOperationName("login");
|
||||
call.setTargetEndpointAddress(http + "EASLogin?wsdl"); //登录的webservice的wsdl的地址
|
||||
call.setReturnType(new QName("urn:client","WSContext"));
|
||||
call.setReturnClass(WSContext.class);//本地根据wsdl文件建立的返回对象
|
||||
call.setReturnQName(new QName("","loginReturn"));
|
||||
call.setTimeout(1000*60); //超时时间 自由配置
|
||||
call.setMaintainSession(true);
|
||||
WSContext result = null;
|
||||
//解决方案:eas
|
||||
//语言:L2 简体中文 L3 繁体中文
|
||||
//数据库类型:0 SQL Server 1 Oracle 2 DB2
|
||||
result = (WSContext)call.invoke(new Object[]{user,password,"eas", datacenter,"L2",1,"BaseDB"});
|
||||
String sessionId = result.getSessionId(); //关键点,获取登录时返回的sessionid
|
||||
System.out.println(sessionId);
|
||||
if(sessionId == null){ //登录失败抛出异常
|
||||
throw new Exception("login Eas Fail");
|
||||
}
|
||||
call.clearOperation();
|
||||
call.setTimeout(1000*60); //超时时间 自由配置
|
||||
call.setMaintainSession(true);
|
||||
call.setTargetEndpointAddress(http+wsdlservice+"?wsdl");
|
||||
call.setReturnQName(new QName("","dealTaskReturn"));
|
||||
call.setOperationName(operationName); //具体某个方法
|
||||
call.addHeader(new SOAPHeaderElement("http://login.webservice.bos.kingdee.com","SessionId",sessionId));//关键点 传sessionid
|
||||
String json = ""; //接口报文
|
||||
Object invoke = call.invoke(new Object[]{json});
|
||||
System.out.println(invoke);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user