ERP:完善同步物料信息接口、同步供应商信息接口、同步销售订单信息接口、同步采购订单信息接口、同步项目信息接口
master
xins 1 year ago
parent 550fb33713
commit bbc5be0c4c

@ -5,9 +5,8 @@ import com.hw.common.core.constant.ServiceNameConstants;
import com.hw.common.core.domain.R; import com.hw.common.core.domain.R;
import com.hw.jindie.api.factory.RemoteJindieFallbackFactory; import com.hw.jindie.api.factory.RemoteJindieFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
/** /**
* @ClassName : RemoteJindieService * @ClassName : RemoteJindieService
@ -19,10 +18,23 @@ import org.springframework.web.bind.annotation.RequestParam;
public interface RemoteJindieService { public interface RemoteJindieService {
/** 同步供应商*/ /** 同步供应商*/
@GetMapping("/jindie/ErpSupplierInfo") @PostMapping("/jindie/syncSupplierInfoFromErp")
R<Integer> ErpSupplierInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); R<Integer> syncSupplierInfoFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** 同步物料*/ /** 同步物料*/
@GetMapping("/jindie/syncMaterialInfo") @PostMapping("/jindie/syncMaterialInfoFromErp")
R<Integer> ErpMesMaterialInfo(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); R<Integer> syncMaterialInfoFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** 同步项目信息*/
@PostMapping("/jindie/syncProjectInfoFromErp")
R<Integer> syncProjectInfoFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** 同步销售订单*/
@PostMapping("/jindie/syncSaleOrderFromErp")
R<Integer> syncSaleOrderFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/** 同步采购订单*/
@PostMapping("/jindie/syncPurchaseOrderFromErp")
R<Integer> syncPurchaseOrderFromErp(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
} }

@ -14,13 +14,28 @@ public class RemoteJindieFallbackFactory implements FallbackFactory<RemoteJindie
public RemoteJindieService create(Throwable throwable) { public RemoteJindieService create(Throwable throwable) {
return new RemoteJindieService() { return new RemoteJindieService() {
@Override @Override
public R<Integer> ErpSupplierInfo(String source) { public R<Integer> syncSupplierInfoFromErp(String source) {
return null; return R.fail("同步供应商信息失败:" + throwable.getMessage());
} }
@Override @Override
public R<Integer> ErpMesMaterialInfo(String source) { public R<Integer> syncMaterialInfoFromErp(String source) {
return null; return R.fail("同步物料信息失败:" + throwable.getMessage());
}
@Override
public R<Integer> syncProjectInfoFromErp(String source) {
return R.fail("同步项目信息失败:" + throwable.getMessage());
}
@Override
public R<Integer> syncSaleOrderFromErp(String source) {
return R.fail("同步销售订单信息失败:" + throwable.getMessage());
}
@Override
public R<Integer> syncPurchaseOrderFromErp(String source) {
return R.fail("同步采购订单信息失败:" + throwable.getMessage());
} }
}; };
} }

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.log.annotation.Log; import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType; import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.jindie.service.IKingdeeErpSyncService; import com.hw.jindie.service.IKingdeeErpSyncService;
import com.hw.jindie.service.impl.KingdeeErpService; import com.hw.jindie.service.impl.KingdeeErpService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -27,10 +28,12 @@ public class KingdeeErpSyncController {
private KingdeeErpService kingdeeErpService; private KingdeeErpService kingdeeErpService;
/** /**
* erp * erpMES
* */ * */
@GetMapping("/ErpSupplierInfo") @PostMapping("/syncSupplierInfoFromErp")
public AjaxResult ErpSupplierInfo(){ @Log(title = "ERP供应商信息", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncSupplierInfoFromErp(){
try { try {
return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0)); return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0));
} catch (Exception e){ } catch (Exception e){
@ -40,12 +43,13 @@ public class KingdeeErpSyncController {
} }
/** /**
* * ERPMES
*/ */
// @RequiresPermissions("wms:mobile:addrawinstock") // @RequiresPermissions("wms:mobile:addrawinstock")
@Log(title = "物料信息", businessType = BusinessType.INSERT) @Log(title = "ERP物料信息", businessType = BusinessType.INSERT)
@GetMapping(("/syncMaterialInfo")) @PostMapping(("/syncMaterialInfoFromErp"))
public AjaxResult syncMaterialInfo() { @InnerAuth
public AjaxResult syncMaterialInfoFromErp() {
try { try {
return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0)); return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0));
} catch (Exception e) { } catch (Exception e) {
@ -55,6 +59,61 @@ public class KingdeeErpSyncController {
} }
/**
* ERPMES
* */
@PostMapping("/syncProjectInfoFromErp")
@Log(title = "ERP项目信息", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncProjectInfoFromErp(){
try {
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0));
}
catch (Exception e) {
return AjaxResult.error();
}
}
/**
* ERPERP
* */
@PostMapping("/syncSaleOrderFromErp")
@Log(title = "ERP销售订单", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncSaleOrderFromErp(){
try {
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0));
}
catch (Exception e) {
e.printStackTrace();
return AjaxResult.error();
}
}
/**
* ERPMES
* */
@PostMapping("/syncPurchaseOrderFromErp")
@Log(title = "ERP采购订单", businessType = BusinessType.INSERT)
@InnerAuth
public AjaxResult syncPurchaseOrderFromErp(){
try {
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0));
}
catch (Exception e) {
return AjaxResult.error();
}
}
/** /**
* ->-> * ->->
* *
@ -193,41 +252,6 @@ public class KingdeeErpSyncController {
} }
} }
/**
* ERP
* */
@GetMapping("/ERPProject")
public AjaxResult getERPProject(){
try {
return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0));
}
catch (Exception e) {
return AjaxResult.error();
}
}
/**
* ERP
* */
@GetMapping("/ERPMesSaleOrder")
public AjaxResult getERPMesSaleOrder(){
try {
return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0));
}
catch (Exception e) {
return AjaxResult.error();
}
}
/**
* ERP
* */
@GetMapping("/ERPPurchase")
public AjaxResult getERPPurchase(){
try {
return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0));
}
catch (Exception e) {
return AjaxResult.error();
}
}
} }

@ -42,6 +42,8 @@ public class MesBaseSupplierInfo extends BaseEntity
@Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditDate; private Date auditDate;
private Date erpModifyDate;
public void setSupplierId(Long supplierId) public void setSupplierId(Long supplierId)
{ {
this.supplierId = supplierId; this.supplierId = supplierId;
@ -97,6 +99,14 @@ public class MesBaseSupplierInfo extends BaseEntity
return auditDate; return auditDate;
} }
public Date getErpModifyDate() {
return erpModifyDate;
}
public void setErpModifyDate(Date erpModifyDate) {
this.erpModifyDate = erpModifyDate;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -131,7 +131,7 @@ public class MesPurchaseOrder extends BaseEntity {
@Excel(name = "是否标识1-是0-否") @Excel(name = "是否标识1-是0-否")
private String isFlag; private String isFlag;
//采购单位id //采购单位id
private String unitId; private Long unitId;
//库存单位 //库存单位
private Long stockUnitId; private Long stockUnitId;
//计价单位 //计价单位
@ -148,11 +148,11 @@ public class MesPurchaseOrder extends BaseEntity {
private Long supplierId; private Long supplierId;
public String getUnitId() { public Long getUnitId() {
return unitId; return unitId;
} }
public void setUnitId(String unitId) { public void setUnitId(Long unitId) {
this.unitId = unitId; this.unitId = unitId;
} }

@ -173,6 +173,8 @@ public class MesSaleOrder extends BaseEntity {
//库存组织 //库存组织
private Long stockOrgId; private Long stockOrgId;
private String tondBase;
public Long getStockId() { public Long getStockId() {
return stockId; return stockId;
@ -406,6 +408,14 @@ public class MesSaleOrder extends BaseEntity {
return isFlag; return isFlag;
} }
public String getTondBase() {
return tondBase;
}
public void setTondBase(String tondBase) {
this.tondBase = tondBase;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -77,7 +77,7 @@ public interface MesBaseMaterialInfoMapper
* ERP * ERP
* @return String * @return String
*/ */
public String getMaxErpModifyDate(); public String selectMaxErpModifyDate();
/** /**
* *
@ -95,10 +95,5 @@ public interface MesBaseMaterialInfoMapper
*/ */
public int batchMesBaseMaterialInfo(List<MesBaseMaterialInfo> mesBaseMaterialInfos); public int batchMesBaseMaterialInfo(List<MesBaseMaterialInfo> mesBaseMaterialInfos);
/**
*
* */
public MesBaseMaterialInfo selectMesBaseMaterialInfoByCode(String materialCode);
} }

@ -59,4 +59,30 @@ public interface MesBaseSupplierInfoMapper
* @return * @return
*/ */
public int deleteMesBaseSupplierInfoBySupplierIds(Long[] supplierIds); public int deleteMesBaseSupplierInfoBySupplierIds(Long[] supplierIds);
/**
* ERP
* @return String
*/
public String selectMaxErpModifyDate();
/**
*
*
* @param erpId ERP
* @return
*/
public MesBaseSupplierInfo selectMesBaseSupplierInfoByErpId(Long erpId);
/**
*
*
* @param mesBaseSupplierInfos
* @return
*/
public int batchMesBaseSupplierInfo(List<MesBaseSupplierInfo> mesBaseSupplierInfos);
} }

@ -1,5 +1,6 @@
package com.hw.jindie.mapper; package com.hw.jindie.mapper;
import com.hw.jindie.domain.MesBaseSupplierInfo;
import com.hw.jindie.domain.MesProjectInfo; import com.hw.jindie.domain.MesProjectInfo;
import java.util.List; import java.util.List;
@ -64,4 +65,21 @@ public interface MesProjectInfoMapper
* erpid * erpid
* */ * */
public MesProjectInfo selectMesProjectInfoByErpId(Long erpId); public MesProjectInfo selectMesProjectInfoByErpId(Long erpId);
/**
* ERP
* @return String
*/
public String selectMaxErpModifyDate();
/**
*
*
* @param mesProjectInfos
* @return
*/
public int batchMesBaseProjectInfo(List<MesProjectInfo> mesProjectInfos);
} }

@ -1,6 +1,7 @@
package com.hw.jindie.mapper; package com.hw.jindie.mapper;
import com.hw.jindie.domain.MesPurchaseOrder; import com.hw.jindie.domain.MesPurchaseOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -10,8 +11,7 @@ import java.util.List;
* @author Yinq * @author Yinq
* @date 2024-02-19 * @date 2024-02-19
*/ */
public interface MesPurchaseOrderMapper public interface MesPurchaseOrderMapper {
{
/** /**
* *
* *
@ -59,8 +59,31 @@ public interface MesPurchaseOrderMapper
* @return * @return
*/ */
public int deleteMesPurchaseOrderByPurchaseOrderIds(Long[] purchaseOrderIds); public int deleteMesPurchaseOrderByPurchaseOrderIds(Long[] purchaseOrderIds);
/** /**
* erpid * ERP
* */ *
public MesPurchaseOrder selectMesPurchaseOrderByErpId(Long erpId); * @return String
*/
public String selectMaxErpModifyDate();
/**
*
*
* @param erpId ERP
* @param fentryId ERP
* @return
*/
public MesPurchaseOrder selectMesPurchaseOrderByUI(@Param("erpId") Long erpId,
@Param("fentryId") Long fentryId);
/**
*
*
* @param mesPurchaseOrders
* @return
*/
public int batchMesBasePurchaseOrder(List<MesPurchaseOrder> mesPurchaseOrders);
} }

@ -1,6 +1,7 @@
package com.hw.jindie.mapper; package com.hw.jindie.mapper;
import com.hw.jindie.domain.MesSaleOrder; import com.hw.jindie.domain.MesSaleOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -10,8 +11,7 @@ import java.util.List;
* @author Yinq * @author Yinq
* @date 2024-02-19 * @date 2024-02-19
*/ */
public interface MesSaleOrderMapper public interface MesSaleOrderMapper {
{
/** /**
* *
* *
@ -60,8 +60,29 @@ public interface MesSaleOrderMapper
*/ */
public int deleteMesSaleOrderBySaleOrderIds(Long[] saleOrderIds); public int deleteMesSaleOrderBySaleOrderIds(Long[] saleOrderIds);
/** /**
* erpid * ERP
* */ *
public MesSaleOrder selectMesSaleOrderByErpId(Long erpId); * @return String
*/
public String selectMaxErpModifyDate();
/**
*
*
* @param erpId ERP
* @param fentryId ERP
* @return
*/
public MesSaleOrder selectMesSaleOrderByUI(@Param("erpId") Long erpId,
@Param("fentryId") Long fentryId);
/**
*
*
* @param mesSaleOrders
* @return
*/
public int batchMesBaseSaleOrder(List<MesSaleOrder> mesSaleOrders);
} }

@ -243,7 +243,6 @@
<select id="selectMaxErpModifyDate" resultType="String"> <select id="selectMaxErpModifyDate" resultType="String">
<include refid="selectMesBaseMaterialInfoVo"/>
SELECT max(erp_modify_date) FROM mes_base_material_info order by erp_id SELECT max(erp_modify_date) FROM mes_base_material_info order by erp_id
</select> </select>
@ -253,15 +252,10 @@
</select> </select>
<insert id="batchMesBaseMaterialInfo"> <insert id="batchMesBaseMaterialInfo">
INSERT INTO mes_base_material_info (erp_id, material_code, old_material_code, material_name, material_categories, material_subclass, material_type_id, batch_flag, material_unit_id, material_unit, material_matkl, material_spec, net_weight, gross_weight, factory_id, create_org_id, use_org_id, prodline_id, active_flag, deleted_flag, remark, purchase_price_unit_id, create_by, create_time, approve_date, erp_modify_date) VALUES INSERT INTO mes_base_material_info (erp_id, material_code, old_material_code, material_name, material_categories, material_subclass, material_type_id, batch_flag, material_unit_id, material_unit, material_matkl, material_spec, net_weight, gross_weight, factory_id, create_org_id, use_org_id, prodline_id, active_flag, deleted_flag, remark, purchase_price_unit_id, create_by, create_time, approve_date, erp_modify_date,update_time) VALUES
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( #{item.erpId}, #{item.materialCode}, #{item.oldMaterialCode}, #{item.materialName}, #{item.materialCategories}, #{item.materialSubclass}, #{item.materialTypeId}, #{item.batchFlag}, #{item.materialUnifId}, #{item.materialUnit}, #{item.materialMatkl}, #{item.materialSpec}, #{item.netWeight}, #{item.grossWeight}, #{item.factoryId}, #{item.createOrgId}, #{item.useOrgId}, #{item.prodlineId}, #{item.activeFlag}, #{item.deletedFlag}, #{item.remark}, #{item.purchasePriceUnitId}, #{item.createBy}, #{item.createTime}, #{item.approveDate}, #{item.erpModifyDate}) ( #{item.erpId}, #{item.materialCode}, #{item.oldMaterialCode}, #{item.materialName}, #{item.materialCategories}, #{item.materialSubclass}, #{item.materialTypeId}, #{item.batchFlag}, #{item.materialUnitId}, #{item.materialUnit}, #{item.materialMatkl}, #{item.materialSpec}, #{item.netWeight}, #{item.grossWeight}, #{item.factoryId}, #{item.createOrgId}, #{item.useOrgId}, #{item.prodlineId}, #{item.activeFlag}, #{item.deletedFlag}, #{item.remark}, #{item.purchasePriceUnitId}, #{item.createBy}, #{item.createTime}, #{item.approveDate}, #{item.erpModifyDate}, #{item.updateTime})
</foreach> </foreach>
</insert> </insert>
<select id="selectMesBaseMaterialInfoByCode" parameterType="String" resultMap="MesBaseMaterialInfoResult">
<include refid="selectMesBaseMaterialInfoVo"/>
where material_code = #{materialCode}
</select>
</mapper> </mapper>

@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="auditDate" column="audit_date" /> <result property="auditDate" column="audit_date" />
<result property="erpModifyDate" column="erp_modify_date" />
</resultMap> </resultMap>
<sql id="selectMesBaseSupplierInfoVo"> <sql id="selectMesBaseSupplierInfoVo">
select supplier_id, supplier_code, supplier_name, erp_id, supplier_status, remark, create_by, create_time, update_by, update_time, audit_date from mes_base_supplier_info select supplier_id, supplier_code, supplier_name, erp_id, supplier_status, remark, create_by, create_time, update_by, update_time, audit_date,erp_modify_date from mes_base_supplier_info
</sql> </sql>
<select id="selectMesBaseSupplierInfoList" parameterType="MesBaseSupplierInfo" resultMap="MesBaseSupplierInfoResult"> <select id="selectMesBaseSupplierInfoList" parameterType="MesBaseSupplierInfo" resultMap="MesBaseSupplierInfoResult">
@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="auditDate != null">audit_date,</if> <if test="auditDate != null">audit_date,</if>
<if test="erpModifyDate != null">erp_modify_date,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplierCode != null">#{supplierCode},</if> <if test="supplierCode != null">#{supplierCode},</if>
@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="auditDate != null">#{auditDate},</if> <if test="auditDate != null">#{auditDate},</if>
<if test="erpModifyDate != null">#{erpModifyDate},</if>
</trim> </trim>
</insert> </insert>
@ -79,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="auditDate != null">audit_date = #{auditDate},</if> <if test="auditDate != null">audit_date = #{auditDate},</if>
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
</trim> </trim>
where supplier_id = #{supplierId} where supplier_id = #{supplierId}
</update> </update>
@ -93,4 +97,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{supplierId} #{supplierId}
</foreach> </foreach>
</delete> </delete>
<select id="selectMaxErpModifyDate" resultType="String">
SELECT max(erp_modify_date) FROM mes_base_supplier_info order by erp_id
</select>
<select id="selectMesBaseSupplierInfoByErpId" parameterType="Long"
resultMap="MesBaseSupplierInfoResult">
select supplier_id from mes_base_supplier_info where erp_id = #{erpId} limit 1
</select>
<insert id="batchMesBaseSupplierInfo">
INSERT INTO mes_base_supplier_info (supplier_code, supplier_name, erp_id, supplier_status, remark, create_by, create_time, update_by, update_time, audit_date, erp_modify_date) VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.supplierCode}, #{item.supplierName},#{item.erpId}, #{item.supplierStatus}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.auditDate}, #{item.erpModifyDate})
</foreach>
</insert>
</mapper> </mapper>

@ -131,6 +131,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMesProjectInfoByErpId" parameterType="Long" resultMap="MesProjectInfoResult"> <select id="selectMesProjectInfoByErpId" parameterType="Long" resultMap="MesProjectInfoResult">
<include refid="selectMesProjectInfoVo"/> <include refid="selectMesProjectInfoVo"/>
where erp_id = #{erpId} where erp_id = #{erpId} limit 1
</select> </select>
<select id="selectMaxErpModifyDate" resultType="String">
SELECT max(erp_modify_date) FROM mes_project_info order by erp_id
</select>
<insert id="batchMesBaseProjectInfo">
INSERT INTO mes_project_info (erp_id, project_no, project_name, document_status, forbid_status, audit_date, erp_modify_date, order_status, complete_date, create_time,update_time) VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.erpId}, #{item.projectNo}, #{item.projectName},#{item.documentStatus}, #{item.forbidStatus}, #{item.auditDate}, #{item.erpModifyDate}, #{item.orderStatus}, #{item.completeDate}, #{item.createTime}, #{item.updateTime})
</foreach>
</insert>
</mapper> </mapper>

@ -198,8 +198,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{purchaseOrderId} #{purchaseOrderId}
</foreach> </foreach>
</delete> </delete>
<select id="selectMesPurchaseOrderByErpId" parameterType="Long" resultMap="MesPurchaseOrderResult">
<include refid="selectMesPurchaseOrderVo"/> <select id="selectMaxErpModifyDate" resultType="String">
where erp_id = #{erpId} SELECT max(erp_modify_date) FROM mes_purchase_order order by erp_id,fentry_id
</select> </select>
<select id="selectMesPurchaseOrderByUI" resultMap="MesPurchaseOrderResult">
<include refid="selectMesPurchaseOrderVo"/>
where erp_id = #{erpId} and fentry_id = #{fentryId} limit 1
</select>
<insert id="batchMesBasePurchaseOrder">
INSERT INTO mes_purchase_order (erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, order_status, unit_id, stock_unit_id, price_unit_id, aux_prop_id, src_bill_no, purchase_org_id, tond_base, supplier_id, create_time,update_time) VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.erpId}, #{item.fentryId}, #{item.poNo},#{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.orderAmount}, #{item.completeAmount}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.orderStatus}, #{item.unitId}, #{item.stockUnitId}, #{item.priceUnitId}, #{item.auxPropId}, #{item.srcBillNo}, #{item.purchaseOrgId}, #{item.tondBase}, #{item.supplierId}, #{item.createTime},#{item.updateTime})
</foreach>
</insert>
</mapper> </mapper>

@ -39,6 +39,7 @@
<result property="ownerId" column="owner_id"/> <result property="ownerId" column="owner_id"/>
<result property="price" column="price"/> <result property="price" column="price"/>
<result property="stockOrgId" column="stock_org_id"/> <result property="stockOrgId" column="stock_org_id"/>
<result property="tondBae" column="tond_base"/>
</resultMap> </resultMap>
<sql id="selectMesSaleOrderVo"> <sql id="selectMesSaleOrderVo">
@ -253,4 +254,24 @@
<include refid="selectMesSaleOrderVo"/> <include refid="selectMesSaleOrderVo"/>
where erp_id = #{erpId} where erp_id = #{erpId}
</select> </select>
<select id="selectMaxErpModifyDate" resultType="String">
SELECT max(erp_modify_date) FROM mes_sale_order order by erp_id,fentry_id
</select>
<select id="selectMesSaleOrderByUI" resultMap="MesSaleOrderResult">
<include refid="selectMesSaleOrderVo"/>
where erp_id = #{erpId} and fentry_id = #{fentryId} limit 1
</select>
<insert id="batchMesBaseSaleOrder">
INSERT INTO mes_sale_order (erp_id, fentry_id, saleorder_code, saleorder_linenumber, document_statsu, material_id, material_code, material_name, matkl, order_amount, complete_amount, release_qty, approve_date, erp_modify_date, plan_delivery_date, stock_id, owner_id, aux_prop_id, sale_dept_id, price, stock_org_id, tond_base, create_time,update_time) VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.erpId}, #{item.fentryId}, #{item.saleorderCode}, #{item.saleorderLinenumber}, #{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.matkl}, #{item.orderAmount}, #{item.completeAmount}, #{item.releaseQty}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.stockId}, #{item.ownerId}, #{item.auxPropId}, #{item.saleDeptId}, #{item.price}, #{item.stockOrgId}, #{item.tondBase}, #{item.createTime}, #{item.updateTime})
</foreach>
</insert>
</mapper> </mapper>

@ -67,15 +67,28 @@ public class RyTask
System.out.println("++创建保养工单++getDmsMaintInstance"); System.out.println("++创建保养工单++getDmsMaintInstance");
remoteDmsService.getDmsBillsMaintInstance(SecurityConstants.INNER,planMaintCode); remoteDmsService.getDmsBillsMaintInstance(SecurityConstants.INNER,planMaintCode);
} }
public void ERPSynMesSupplierInfo(String beginTime, String endTime){ public void syncSupplierInfoFromErp(){
System.out.println("++同步ERP中物料供应商++ErpSupplierInfo"); System.out.println("++同步ERP中物料供应商++ErpSupplierInfo");
remoteJindieService.ErpSupplierInfo(SecurityConstants.INNER); remoteJindieService.syncSupplierInfoFromErp(SecurityConstants.INNER);
} }
public void ERPSynMesMaterialInfo(String beginTime, String endTime){ public void syncMaterialInfoFromErp(){
//todo 查询createtime>上次执行时间和updatetime>上次执行时间的,要区分是第一次查询还是后续查询
System.out.println("++同步ERP中物料信息++ErpMesMaterialInfo"); System.out.println("++同步ERP中物料信息++ErpMesMaterialInfo");
remoteJindieService.ErpMesMaterialInfo(SecurityConstants.INNER); remoteJindieService.syncMaterialInfoFromErp(SecurityConstants.INNER);
}
public void syncProjectInfoFromErp(){
System.out.println("++同步ERP中项目信息++ErpProjectInfo");
remoteJindieService.syncProjectInfoFromErp(SecurityConstants.INNER);
}
public void syncSaleOrderFromErp(){
System.out.println("++同步ERP中销售订单信息++ErpSaleOrder");
remoteJindieService.syncSaleOrderFromErp(SecurityConstants.INNER);
}
public void syncPurchaseOrderFromErp(){
System.out.println("++同步ERP中采购订单信息++ErpPurchaseOrder");
remoteJindieService.syncPurchaseOrderFromErp(SecurityConstants.INNER);
} }
} }

Loading…
Cancel
Save