sap模块代码整合

highway
zhaoxiaolin 1 year ago
parent 60de714016
commit e892e8c2fe

@ -27,8 +27,8 @@ public interface RemoteSapService {
@PostMapping("/bomSync")
public R<Boolean> bomSync();
@PostMapping("/sap/sapProRouteProcess")
public R<Boolean> sapProRouteProcess();
@PostMapping("/sap/sapRouterSync")
public R<Boolean> sapRouterSync();
@PostMapping("/sap/materialPreparation")
public R<List<SapMaterialPreparation>>materialPreparation(@RequestParam("shopOrder") String shopOrder);

@ -30,7 +30,7 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
}
@Override
public R<Boolean> sapProRouteProcess() {
public R<Boolean> sapRouterSync() {
return null;
}

@ -59,7 +59,7 @@ public class RyTask {
*/
public void getRouteTask(){
System.out.println("++同步工艺+开始++getRouteTask+++++");
remoteSapService.sapProRouteProcess();
remoteSapService.sapRouterSync();
}
/**2100

@ -1,125 +0,0 @@
package com.op.sap.domain;
public class SapMaterialPreparation {
//订单号
private String AUFNR;
//预留/相关需求的项目编号
private String RSPOS;
//物料号
private String MATNR;
//物料描述(短文本)
private String MAKTX;
//工厂
private String WERKS;
//库存地点
private String LGORT;
//组件的需求日期
private String BDTER;
//需求量
private String BDMNG;
//欠料数量
private String ZQLSL;
//基本计量单位
private String MEINS;
//标识:反冲
private String RGEKZ;
//直接采购标识
private String DBSKZ;
public String getAUFNR() {
return AUFNR;
}
public void setAUFNR(String AUFNR) {
this.AUFNR = AUFNR;
}
public String getRSPOS() {
return RSPOS;
}
public void setRSPOS(String RSPOS) {
this.RSPOS = RSPOS;
}
public String getMATNR() {
return MATNR;
}
public void setMATNR(String MATNR) {
this.MATNR = MATNR;
}
public String getMAKTX() {
return MAKTX;
}
public void setMAKTX(String MAKTX) {
this.MAKTX = MAKTX;
}
public String getWERKS() {
return WERKS;
}
public void setWERKS(String WERKS) {
this.WERKS = WERKS;
}
public String getLGORT() {
return LGORT;
}
public void setLGORT(String LGORT) {
this.LGORT = LGORT;
}
public String getBDTER() {
return BDTER;
}
public void setBDTER(String BDTER) {
this.BDTER = BDTER;
}
public String getBDMNG() {
return BDMNG;
}
public void setBDMNG(String BDMNG) {
this.BDMNG = BDMNG;
}
public String getZQLSL() {
return ZQLSL;
}
public void setZQLSL(String ZQLSL) {
this.ZQLSL = ZQLSL;
}
public String getMEINS() {
return MEINS;
}
public void setMEINS(String MEINS) {
this.MEINS = MEINS;
}
public String getRGEKZ() {
return RGEKZ;
}
public void setRGEKZ(String RGEKZ) {
this.RGEKZ = RGEKZ;
}
public String getDBSKZ() {
return DBSKZ;
}
public void setDBSKZ(String DBSKZ) {
this.DBSKZ = DBSKZ;
}
}

@ -1,7 +1,5 @@
package com.op.sap.mapper;
import com.op.system.api.domain.sap.SapProRouteProduct;
import org.apache.ibatis.annotations.Mapper;

@ -1,132 +0,0 @@
<?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="com.op.sap.mapper.SapBaseFileMapper">
<resultMap type="SapBaseFile" id="BaseFileResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="fileAddress" column="file_address" />
<result property="sourceId" column="source_id" />
<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="selectBaseFileVo">
select file_id, file_name, file_address, source_id, remark, attr1,
attr2, attr3, attr4, create_by, create_time, update_by,
update_time from base_file
</sql>
<select id="selectBaseFileList" parameterType="SapBaseFile" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
<where>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="fileAddress != null and fileAddress != ''"> and file_address = #{fileAddress}</if>
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null "> and attr3 = #{attr3}</if>
<if test="attr4 != null "> and attr4 = #{attr4}</if>
</where>
</select>
<select id="selectBaseFileByFileId" parameterType="String" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
where file_id = #{fileId}
</select>
<select id="getBaseFileBatch" resultMap="BaseFileResult">
<include refid="selectBaseFileVo"/>
where source_id = #{sourceId}
</select>
<insert id="insertBaseFile" parameterType="SapBaseFile">
insert into base_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileId != null">file_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileAddress != null">file_address,</if>
<if test="sourceId != null">source_id,</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="fileId != null">#{fileId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileAddress != null">#{fileAddress},</if>
<if test="sourceId != null">#{sourceId},</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 id="insertBaseFileBatch">
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time)
VALUES
<foreach collection="baseFiles" index="" item="baseFile" separator=",">
(
#{baseFile.fileId},
#{baseFile.fileName},
#{baseFile.fileAddress},
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime}
)
</foreach>
</insert>
<update id="updateBaseFile" parameterType="SapBaseFile">
update base_file
<trim prefix="SET" suffixOverrides=",">
<if test="fileName != null">file_name = #{fileName},</if>
<if test="fileAddress != null">file_address = #{fileAddress},</if>
<if test="sourceId != null">source_id = #{sourceId},</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 file_id = #{fileId}
</update>
<delete id="deleteBaseFileByFileId" parameterType="String">
delete from base_file where file_id = #{fileId}
</delete>
<delete id="deleteBaseFileByFileIds" parameterType="String">
delete from base_file where file_id in
<foreach item="fileId" collection="array" open="(" separator="," close=")">
#{fileId}
</foreach>
</delete>
<delete id="deleteBaseFileBySourceId">
delete from base_file where source_id = #{sourceId}
</delete>
</mapper>

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.sap.mapper.SapProRouteProductMapper">
<resultMap type="SapProRouteProduct" id="ProRouteProductResult">
<resultMap type="com.op.system.api.domain.sap.SapProRouteProduct" id="ProRouteProductResult">
<result property="recordId" column="record_id" />
<result property="routeId" column="route_id" />
<result property="itemId" column="item_id" />
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select record_id, route_id, item_id, item_code, item_name, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_route_product
</sql>
<select id="selectProRouteProductList" parameterType="SapProRouteProduct" resultMap="ProRouteProductResult">
<select id="selectProRouteProductList" parameterType="com.op.system.api.domain.sap.SapProRouteProduct" resultMap="ProRouteProductResult">
<include refid="selectProRouteProductVo"/>
<where>
<if test="routeId != null and routeId != ''"> and route_id = #{routeId}</if>
@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- where sf.f_type='l' and sf.status = '1' and sf.del_flag = '0'-->
<!-- </select>-->
<!-- 现在逻辑:关联产品-->
<select id="getRouteProdProductListUndo" resultType="com.op.sap.domain.SapProRouteProduct">
<select id="getRouteProdProductListUndo" resultType="com.op.system.api.domain.sap.SapProRouteProduct">
select bp.product_code [key],
bp.product_desc_zh label,
bp.product_desc_zh itemName,
@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- where pl.route_id = #{routeId}-->
<!-- </select>-->
<select id="getRouteProdProductListDo" resultType="com.op.sap.domain.SapProRouteProduct">
<select id="getRouteProdProductListDo" resultType="com.op.system.api.domain.sap.SapProRouteProduct">
select pp.item_code [key],
bp.product_desc_zh label
from pro_route_product pp
@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where pp.route_id = #{routeId}
</select>
<insert id="insertProRouteProduct" parameterType="SapProRouteProduct">
<insert id="insertProRouteProduct" parameterType="com.op.system.api.domain.sap.SapProRouteProduct">
insert into pro_route_product
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if>
@ -112,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateProRouteProduct" parameterType="SapProRouteProduct">
<update id="updateProRouteProduct" parameterType="com.op.system.api.domain.sap.SapProRouteProduct">
update pro_route_product
<trim prefix="SET" suffixOverrides=",">
<if test="routeId != null and routeId != ''">route_id = #{routeId},</if>

@ -4,49 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.sap.mapper.SapSysUserMapper">
<resultMap type="SapSysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<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="remark" column="remark" />
<association property="dept" column="dept_id" javaType="SapSysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
<resultMap id="deptResult" type="SapSysDept">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="deptName" column="dept_name" />
<result property="ancestors" column="ancestors" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="status" column="dept_status" />
</resultMap>
<resultMap id="RoleResult" type="SapSysRole">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
</resultMap>
<select id="getPoolName" parameterType="String" resultType="String">
select url from sys_datasource
where pool_name = #{poolName}

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.sap.mapper.SapBomComponentMapper">
<resultMap type="com.op.sap.domain.SapBomComponent" id="BaseBomComponentResult">
<resultMap type="com.op.system.api.domain.sap.SapBomComponent" id="BaseBomComponentResult">
<result property="id" column="id" />
<result property="bomCode" column="bom_code" />
<result property="site" column="site" />
@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, bom_code, site, product_code, cumc, component, bom_hierarchy, project_no, standard_dosage, loss_rate, loss_amount, cilosses, component_unit, component_pro_flag, msi, sanka, attr1, attr2, attr3, create_by, create_time, update_by, update_time, remark from base_bom_component
</sql>
<select id="selectBaseBomComponentList" parameterType="com.op.sap.domain.SapBomComponent" resultMap="BaseBomComponentResult">
<select id="selectBaseBomComponentList" parameterType="com.op.system.api.domain.sap.SapBomComponent" resultMap="BaseBomComponentResult">
<include refid="selectBaseBomComponentVo"/>
<where>
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<insert id="insertSapBomComponent" parameterType="com.op.sap.domain.SapBomComponent">
<insert id="insertSapBomComponent" parameterType="com.op.system.api.domain.sap.SapBomComponent">
insert into base_bom_component
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
@ -120,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateBaseBomComponent" parameterType="com.op.sap.domain.SapBomComponent">
<update id="updateBaseBomComponent" parameterType="com.op.system.api.domain.sap.SapBomComponent">
update base_bom_component
<trim prefix="SET" suffixOverrides=",">
<if test="bomCode != null and bomCode != ''">bom_code = #{bomCode},</if>

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.sap.mapper.SapBomMapper">
<resultMap type="com.op.sap.domain.SapBom" id="BaseBomResult">
<resultMap type="com.op.system.api.domain.sap.SapBom" id="BaseBomResult">
<result property="factoryCode" column="factory_code" />
<result property="productionVersion" column="production_version" />
<result property="bomCode" column="bom_code" />
@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select factory_code, production_version, bom_code, optional_bom, optional_bom_text, pvvd, pved, bom_calculate_number, bom_calculate_unit, bom_base_number, bom_base_unit, component_unit, component_pro_flag, msi, sanka, attr1, attr2, attr3, create_by, create_time, update_by, update_time, remark, current_version from base_bom
</sql>
<select id="selectBaseBomList" parameterType="com.op.sap.domain.SapBom" resultMap="BaseBomResult">
<select id="selectBaseBomList" parameterType="com.op.system.api.domain.sap.SapBom" resultMap="BaseBomResult">
<include refid="selectBaseBomVo"/>
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where factory_code = #{factoryCode}
</select>
<insert id="insertBaseBom" parameterType="com.op.sap.domain.SapBom">
<insert id="insertBaseBom" parameterType="com.op.system.api.domain.sap.SapBom">
insert into base_bom
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="factoryCode != null">factory_code,</if>
@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateBaseBom" parameterType="com.op.sap.domain.SapBom">
<update id="updateBaseBom" parameterType="com.op.system.api.domain.sap.SapBom">
update base_bom
<trim prefix="SET" suffixOverrides=",">
<if test="productionVersion != null">production_version = #{productionVersion},</if>

@ -138,7 +138,7 @@ public class ProRouteController extends BaseController {
@Log(title = "手动执行同步SAP工艺路线", businessType = BusinessType.INSERT)
@PostMapping("/sapProRouteProcess")
public AjaxResult sapProRouteProcess() {
R r = remoteSapService.sapProRouteProcess();
R r = remoteSapService.sapRouterSync();
if((Boolean) r.getData()){
return AjaxResult.success();
}

Loading…
Cancel
Save