Merge branch 'yuecheng-project' of http://192.168.2.237:3000/root/kangarooDataCenterV3 into yuecheng-project
This commit is contained in:
commit
bf947dd50d
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.plugin.a8bill.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
|
||||
/**
|
||||
* 组织档案(mdm_org: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:04
|
||||
*/
|
||||
public interface IPayBillDao extends IBaseDao<PayBillEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.plugin.a8bill.dao.impl;
|
||||
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.plugin.a8bill.dao.IPayBillDao;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
|
||||
/**
|
||||
* 组织档案(MdmOrg)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:04
|
||||
*/
|
||||
public class PayBillDaoImpl extends MybatisGenericDao<PayBillEntity, String> implements IPayBillDao {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.hzya.frame.plugin.a8bill.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 付款单
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:04
|
||||
*/
|
||||
public class PayBillEntity extends BaseEntity {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?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.hzya.frame.plugin.a8bill.dao.impl.PayBillDaoImpl">
|
||||
|
||||
<resultMap id="get-PayBillEntity-result" type="com.hzya.frame.plugin.a8bill.entity.PayBillEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "PayBillEntity_Base_Column_List">
|
||||
id
|
||||
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.hzya.frame.plugin.a8bill.plugin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
|
||||
import com.hzya.frame.seeyon.paybill.service.IPayBillService;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.impl.MasterDataOrgsServiceImpl;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 组织档案(PayBill)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:05
|
||||
*/
|
||||
public class PayBillPluginInitializer extends PluginBaseEntity{
|
||||
Logger logger = LoggerFactory.getLogger(PayBillPluginInitializer.class);
|
||||
@Autowired
|
||||
private IPayBillService payBillService;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "PayBillPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "PayBillPlugin插件";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "PayBillPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
logger.info("======开始执行付款单据信息同步========");
|
||||
return payBillService.sendEngineerPayBillToBip(requestJson);
|
||||
}catch (Exception e){
|
||||
logger.info("======执行付款单据同步失败:{}========",e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.plugin.a8bill.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
|
||||
/**
|
||||
* 付款单
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:05
|
||||
*/
|
||||
public interface IPayBillService extends IBaseService<PayBillEntity, String>{
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.hzya.frame.plugin.a8bill.service.impl;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
|
||||
import com.hzya.frame.plugin.a8bill.service.IPayBillService;
|
||||
import com.hzya.frame.plugin.masterData.org.service.IMdmOrgService;
|
||||
|
||||
/**
|
||||
* private IMdmOrgDao mdmOrgDao;
|
||||
*
|
||||
* @Autowired
|
||||
* public void setMdmOrgDao(IMdmOrgDao dao) {
|
||||
* this.mdmOrgDao = dao;
|
||||
* this.dao = dao;
|
||||
* }
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-07 18:30:05
|
||||
*/
|
||||
public class PayBillServiceImpl extends BaseService<PayBillEntity, String> implements IPayBillService {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.bank.dao;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 客户银行(mdm_customer_bank: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:55:55
|
||||
*/
|
||||
public interface IMdmCustomerBankDao extends IBaseDao<MdmCustomerBankEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.bank.dao.impl;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
|
||||
import com.hzya.frame.plugin.masterData.customer.bank.dao.IMdmCustomerBankDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 客户银行(MdmCustomerBank)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:55:55
|
||||
*/
|
||||
public class MdmCustomerBankDaoImpl extends MybatisGenericDao<MdmCustomerBankEntity, String> implements IMdmCustomerBankDao{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.bank.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 客户银行(MdmCustomerBank)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:55:55
|
||||
*/
|
||||
public class MdmCustomerBankEntity extends BaseEntity {
|
||||
|
||||
/** formmain_id */
|
||||
private String formmainId;
|
||||
/** 数据状态 Y正常 N删除 F修改 */
|
||||
private String dataStatus;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
/** 银行 */
|
||||
private String bank;
|
||||
/** 开户银行 */
|
||||
private String pkBankdoc;
|
||||
/** 账号 */
|
||||
private String accnum;
|
||||
/** 联行号 */
|
||||
private String combinenum;
|
||||
|
||||
|
||||
public String getFormmainId() {
|
||||
return formmainId;
|
||||
}
|
||||
|
||||
public void setFormmainId(String formmainId) {
|
||||
this.formmainId = formmainId;
|
||||
}
|
||||
|
||||
public String getDataStatus() {
|
||||
return dataStatus;
|
||||
}
|
||||
|
||||
public void setDataStatus(String dataStatus) {
|
||||
this.dataStatus = dataStatus;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getBank() {
|
||||
return bank;
|
||||
}
|
||||
|
||||
public void setBank(String bank) {
|
||||
this.bank = bank;
|
||||
}
|
||||
|
||||
public String getPkBankdoc() {
|
||||
return pkBankdoc;
|
||||
}
|
||||
|
||||
public void setPkBankdoc(String pkBankdoc) {
|
||||
this.pkBankdoc = pkBankdoc;
|
||||
}
|
||||
|
||||
public String getAccnum() {
|
||||
return accnum;
|
||||
}
|
||||
|
||||
public void setAccnum(String accnum) {
|
||||
this.accnum = accnum;
|
||||
}
|
||||
|
||||
public String getCombinenum() {
|
||||
return combinenum;
|
||||
}
|
||||
|
||||
public void setCombinenum(String combinenum) {
|
||||
this.combinenum = combinenum;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
<?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.hzya.frame.plugin.masterData.customer.bank.dao.impl.MdmCustomerBankDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmCustomerBankEntity-result" type="com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="formmainId" column="formmain_id" jdbcType="VARCHAR"/>
|
||||
<result property="dataStatus" column="data_status" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
<result property="bank" column="bank" jdbcType="VARCHAR"/>
|
||||
<result property="pkBankdoc" column="pk_bankdoc" jdbcType="VARCHAR"/>
|
||||
<result property="accnum" column="accnum" jdbcType="VARCHAR"/>
|
||||
<result property="combinenum" column="combinenum" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "MdmCustomerBankEntity_Base_Column_List">
|
||||
id
|
||||
,formmain_id
|
||||
,data_status
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
,company_id
|
||||
,bank
|
||||
,pk_bankdoc
|
||||
,accnum
|
||||
,combinenum
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmCustomerBankEntity-result" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity">
|
||||
select
|
||||
<include refid="MdmCustomerBankEntity_Base_Column_List" />
|
||||
from mdm_customer_bank
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id = #{formmainId} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<if test="bank != null and bank != ''"> and bank = #{bank} </if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> and pk_bankdoc = #{pkBankdoc} </if>
|
||||
<if test="accnum != null and accnum != ''"> and accnum = #{accnum} </if>
|
||||
<if test="combinenum != null and combinenum != ''"> and combinenum = #{combinenum} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity">
|
||||
select count(1) from mdm_customer_bank
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id = #{formmainId} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<if test="bank != null and bank != ''"> and bank = #{bank} </if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> and pk_bankdoc = #{pkBankdoc} </if>
|
||||
<if test="accnum != null and accnum != ''"> and accnum = #{accnum} </if>
|
||||
<if test="combinenum != null and combinenum != ''"> and combinenum = #{combinenum} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-MdmCustomerBankEntity-result" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity">
|
||||
select
|
||||
<include refid="MdmCustomerBankEntity_Base_Column_List" />
|
||||
from mdm_customer_bank
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id like concat('%',#{formmainId},'%') </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status like concat('%',#{dataStatus},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
||||
<if test="bank != null and bank != ''"> and bank like concat('%',#{bank},'%') </if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> and pk_bankdoc like concat('%',#{pkBankdoc},'%') </if>
|
||||
<if test="accnum != null and accnum != ''"> and accnum like concat('%',#{accnum},'%') </if>
|
||||
<if test="combinenum != null and combinenum != ''"> and combinenum like concat('%',#{combinenum},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="MdmCustomerBankentity_list_or" resultMap="get-MdmCustomerBankEntity-result" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity">
|
||||
select
|
||||
<include refid="MdmCustomerBankEntity_Base_Column_List" />
|
||||
from mdm_customer_bank
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> or formmain_id = #{formmainId} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> or data_status = #{dataStatus} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
||||
<if test="bank != null and bank != ''"> or bank = #{bank} </if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> or pk_bankdoc = #{pkBankdoc} </if>
|
||||
<if test="accnum != null and accnum != ''"> or accnum = #{accnum} </if>
|
||||
<if test="combinenum != null and combinenum != ''"> or combinenum = #{combinenum} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_customer_bank(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="formmainId != null and formmainId != ''"> formmain_id , </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> data_status , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="bank != null and bank != ''"> bank , </if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> pk_bankdoc , </if>
|
||||
<if test="accnum != null and accnum != ''"> accnum , </if>
|
||||
<if test="combinenum != null and combinenum != ''"> combinenum , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="formmainId != null and formmainId != ''"> #{formmainId} ,</if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> #{dataStatus} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="bank != null and bank != ''"> #{bank} ,</if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> #{pkBankdoc} ,</if>
|
||||
<if test="accnum != null and accnum != ''"> #{accnum} ,</if>
|
||||
<if test="combinenum != null and combinenum != ''"> #{combinenum} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_customer_bank a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_customer_bank(formmain_id, data_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bank, pk_bankdoc, accnum, combinenum, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.formmainId},#{entity.dataStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.bank},#{entity.pkBankdoc},#{entity.accnum},#{entity.combinenum}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_customer_bank(formmain_id, data_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bank, pk_bankdoc, accnum, combinenum)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.formmainId},#{entity.dataStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.bank},#{entity.pkBankdoc},#{entity.accnum},#{entity.combinenum})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
formmain_id = values(formmain_id),
|
||||
data_status = values(data_status),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id),
|
||||
bank = values(bank),
|
||||
pk_bankdoc = values(pk_bankdoc),
|
||||
accnum = values(accnum),
|
||||
combinenum = values(combinenum)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity" >
|
||||
update mdm_customer_bank set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="formmainId != null and formmainId != ''"> formmain_id = #{formmainId},</if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> data_status = #{dataStatus},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||
<if test="bank != null and bank != ''"> bank = #{bank},</if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> pk_bankdoc = #{pkBankdoc},</if>
|
||||
<if test="accnum != null and accnum != ''"> accnum = #{accnum},</if>
|
||||
<if test="combinenum != null and combinenum != ''"> combinenum = #{combinenum},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity" >
|
||||
update mdm_customer_bank set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity" >
|
||||
update mdm_customer_bank set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id = #{formmainId} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<if test="bank != null and bank != ''"> and bank = #{bank} </if>
|
||||
<if test="pkBankdoc != null and pkBankdoc != ''"> and pk_bankdoc = #{pkBankdoc} </if>
|
||||
<if test="accnum != null and accnum != ''"> and accnum = #{accnum} </if>
|
||||
<if test="combinenum != null and combinenum != ''"> and combinenum = #{combinenum} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_customer_bank where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.bank.plugin;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* 客户银行(MdmCustomerBank)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:55:55
|
||||
*/
|
||||
public class MdmCustomerBankPluginInitializer extends PluginBaseEntity{
|
||||
Logger logger = LoggerFactory.getLogger(MdmCustomerBankPluginInitializer.class);
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "MdmCustomerBankPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "MdmCustomerBankPlugin插件";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "MdmCustomerBankPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
logger.info("执行业务代码逻辑");
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.bank.service;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
/**
|
||||
* 客户银行(MdmCustomerBank)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:55:55
|
||||
*/
|
||||
public interface IMdmCustomerBankService extends IBaseService<MdmCustomerBankEntity, String>{
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.bank.service.impl;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
|
||||
import com.hzya.frame.plugin.masterData.customer.bank.dao.IMdmCustomerBankDao;
|
||||
import com.hzya.frame.plugin.masterData.customer.bank.service.IMdmCustomerBankService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
/**
|
||||
* 客户银行(MdmCustomerBank)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:55:55
|
||||
*/
|
||||
public class MdmCustomerBankServiceImpl extends BaseService<MdmCustomerBankEntity, String> implements IMdmCustomerBankService {
|
||||
|
||||
private IMdmCustomerBankDao mdmCustomerBankDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmCustomerBankDao(IMdmCustomerBankDao dao) {
|
||||
this.mdmCustomerBankDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.dao;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 客户档案(mdm_customer: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public interface IMdmCustomerDao extends IBaseDao<MdmCustomerEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.dao.impl;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
|
||||
import com.hzya.frame.plugin.masterData.customer.dao.IMdmCustomerDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 客户档案(MdmCustomer)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public class MdmCustomerDaoImpl extends MybatisGenericDao<MdmCustomerEntity, String> implements IMdmCustomerDao{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 客户档案(MdmCustomer)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public class MdmCustomerEntity extends BaseEntity {
|
||||
|
||||
/** 单据规则 */
|
||||
private String documentRule;
|
||||
/** 单据规则流水号 */
|
||||
private Long documentRuleNum;
|
||||
/** 数据状态 Y正常 N删除 F修改 */
|
||||
private String dataStatus;
|
||||
/** 新增数据状态 0待下发 1已下发 */
|
||||
private String addStatus;
|
||||
/** 修改数据状态 0待下发 1已下发 */
|
||||
private String updateStatus;
|
||||
/** 删除数据状态 0待下发 1已下发 */
|
||||
private String deleteStatus;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
/** 客户编码 */
|
||||
private String code;
|
||||
/** 客户类型 */
|
||||
private String custprop;
|
||||
/** 客户状态 */
|
||||
private String custstate;
|
||||
/** 启用状态 */
|
||||
private String enablestate;
|
||||
/** 客户名称 */
|
||||
private String name;
|
||||
/** 国家/地区 */
|
||||
private String pkCountry;
|
||||
/** 客户基本分类 */
|
||||
private String pkCustclass;
|
||||
/** 所属集团 */
|
||||
private String pkGroup;
|
||||
/** 所属组织 */
|
||||
private String pkOrg;
|
||||
/** 纳税人登记号 */
|
||||
private String taxpayerid;
|
||||
|
||||
|
||||
public String getDocumentRule() {
|
||||
return documentRule;
|
||||
}
|
||||
|
||||
public void setDocumentRule(String documentRule) {
|
||||
this.documentRule = documentRule;
|
||||
}
|
||||
|
||||
public Long getDocumentRuleNum() {
|
||||
return documentRuleNum;
|
||||
}
|
||||
|
||||
public void setDocumentRuleNum(Long documentRuleNum) {
|
||||
this.documentRuleNum = documentRuleNum;
|
||||
}
|
||||
|
||||
public String getDataStatus() {
|
||||
return dataStatus;
|
||||
}
|
||||
|
||||
public void setDataStatus(String dataStatus) {
|
||||
this.dataStatus = dataStatus;
|
||||
}
|
||||
|
||||
public String getAddStatus() {
|
||||
return addStatus;
|
||||
}
|
||||
|
||||
public void setAddStatus(String addStatus) {
|
||||
this.addStatus = addStatus;
|
||||
}
|
||||
|
||||
public String getUpdateStatus() {
|
||||
return updateStatus;
|
||||
}
|
||||
|
||||
public void setUpdateStatus(String updateStatus) {
|
||||
this.updateStatus = updateStatus;
|
||||
}
|
||||
|
||||
public String getDeleteStatus() {
|
||||
return deleteStatus;
|
||||
}
|
||||
|
||||
public void setDeleteStatus(String deleteStatus) {
|
||||
this.deleteStatus = deleteStatus;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCustprop() {
|
||||
return custprop;
|
||||
}
|
||||
|
||||
public void setCustprop(String custprop) {
|
||||
this.custprop = custprop;
|
||||
}
|
||||
|
||||
public String getCuststate() {
|
||||
return custstate;
|
||||
}
|
||||
|
||||
public void setCuststate(String custstate) {
|
||||
this.custstate = custstate;
|
||||
}
|
||||
|
||||
public String getEnablestate() {
|
||||
return enablestate;
|
||||
}
|
||||
|
||||
public void setEnablestate(String enablestate) {
|
||||
this.enablestate = enablestate;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPkCountry() {
|
||||
return pkCountry;
|
||||
}
|
||||
|
||||
public void setPkCountry(String pkCountry) {
|
||||
this.pkCountry = pkCountry;
|
||||
}
|
||||
|
||||
public String getPkCustclass() {
|
||||
return pkCustclass;
|
||||
}
|
||||
|
||||
public void setPkCustclass(String pkCustclass) {
|
||||
this.pkCustclass = pkCustclass;
|
||||
}
|
||||
|
||||
public String getPkGroup() {
|
||||
return pkGroup;
|
||||
}
|
||||
|
||||
public void setPkGroup(String pkGroup) {
|
||||
this.pkGroup = pkGroup;
|
||||
}
|
||||
|
||||
public String getPkOrg() {
|
||||
return pkOrg;
|
||||
}
|
||||
|
||||
public void setPkOrg(String pkOrg) {
|
||||
this.pkOrg = pkOrg;
|
||||
}
|
||||
|
||||
public String getTaxpayerid() {
|
||||
return taxpayerid;
|
||||
}
|
||||
|
||||
public void setTaxpayerid(String taxpayerid) {
|
||||
this.taxpayerid = taxpayerid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,377 @@
|
|||
<?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.hzya.frame.plugin.masterData.customer.dao.impl.MdmCustomerDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmCustomerEntity-result" type="com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="documentRule" column="document_rule" jdbcType="VARCHAR"/>
|
||||
<result property="documentRuleNum" column="document_rule_num" jdbcType="INTEGER"/>
|
||||
<result property="dataStatus" column="data_status" jdbcType="VARCHAR"/>
|
||||
<result property="addStatus" column="add_status" jdbcType="VARCHAR"/>
|
||||
<result property="updateStatus" column="update_status" jdbcType="VARCHAR"/>
|
||||
<result property="deleteStatus" column="delete_status" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||
<result property="custprop" column="custprop" jdbcType="VARCHAR"/>
|
||||
<result property="custstate" column="custstate" jdbcType="VARCHAR"/>
|
||||
<result property="enablestate" column="enablestate" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="pkCountry" column="pk_country" jdbcType="VARCHAR"/>
|
||||
<result property="pkCustclass" column="pk_custclass" jdbcType="VARCHAR"/>
|
||||
<result property="pkGroup" column="pk_group" jdbcType="VARCHAR"/>
|
||||
<result property="pkOrg" column="pk_org" jdbcType="VARCHAR"/>
|
||||
<result property="taxpayerid" column="taxpayerid" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "MdmCustomerEntity_Base_Column_List">
|
||||
id
|
||||
,document_rule
|
||||
,document_rule_num
|
||||
,data_status
|
||||
,add_status
|
||||
,update_status
|
||||
,delete_status
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
,company_id
|
||||
,code
|
||||
,custprop
|
||||
,custstate
|
||||
,enablestate
|
||||
,name
|
||||
,pk_country
|
||||
,pk_custclass
|
||||
,pk_group
|
||||
,pk_org
|
||||
,taxpayerid
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmCustomerEntity-result" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity">
|
||||
select
|
||||
<include refid="MdmCustomerEntity_Base_Column_List" />
|
||||
from mdm_customer
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="documentRule != null and documentRule != ''"> and document_rule = #{documentRule} </if>
|
||||
<if test="documentRuleNum != null"> and document_rule_num = #{documentRuleNum} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
|
||||
<if test="addStatus != null and addStatus != ''"> and add_status = #{addStatus} </if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> and update_status = #{updateStatus} </if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status = #{deleteStatus} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<if test="code != null and code != ''"> and code = #{code} </if>
|
||||
<if test="custprop != null and custprop != ''"> and custprop = #{custprop} </if>
|
||||
<if test="custstate != null and custstate != ''"> and custstate = #{custstate} </if>
|
||||
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> and pk_country = #{pkCountry} </if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass = #{pkCustclass} </if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> and pk_group = #{pkGroup} </if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> and pk_org = #{pkOrg} </if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid = #{taxpayerid} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity">
|
||||
select count(1) from mdm_customer
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="documentRule != null and documentRule != ''"> and document_rule = #{documentRule} </if>
|
||||
<if test="documentRuleNum != null"> and document_rule_num = #{documentRuleNum} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
|
||||
<if test="addStatus != null and addStatus != ''"> and add_status = #{addStatus} </if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> and update_status = #{updateStatus} </if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status = #{deleteStatus} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<if test="code != null and code != ''"> and code = #{code} </if>
|
||||
<if test="custprop != null and custprop != ''"> and custprop = #{custprop} </if>
|
||||
<if test="custstate != null and custstate != ''"> and custstate = #{custstate} </if>
|
||||
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> and pk_country = #{pkCountry} </if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass = #{pkCustclass} </if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> and pk_group = #{pkGroup} </if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> and pk_org = #{pkOrg} </if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid = #{taxpayerid} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-MdmCustomerEntity-result" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity">
|
||||
select
|
||||
<include refid="MdmCustomerEntity_Base_Column_List" />
|
||||
from mdm_customer
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="documentRule != null and documentRule != ''"> and document_rule like concat('%',#{documentRule},'%') </if>
|
||||
<if test="documentRuleNum != null"> and document_rule_num like concat('%',#{documentRuleNum},'%') </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status like concat('%',#{dataStatus},'%') </if>
|
||||
<if test="addStatus != null and addStatus != ''"> and add_status like concat('%',#{addStatus},'%') </if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> and update_status like concat('%',#{updateStatus},'%') </if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status like concat('%',#{deleteStatus},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
||||
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
|
||||
<if test="custprop != null and custprop != ''"> and custprop like concat('%',#{custprop},'%') </if>
|
||||
<if test="custstate != null and custstate != ''"> and custstate like concat('%',#{custstate},'%') </if>
|
||||
<if test="enablestate != null and enablestate != ''"> and enablestate like concat('%',#{enablestate},'%') </if>
|
||||
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> and pk_country like concat('%',#{pkCountry},'%') </if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass like concat('%',#{pkCustclass},'%') </if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> and pk_group like concat('%',#{pkGroup},'%') </if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> and pk_org like concat('%',#{pkOrg},'%') </if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid like concat('%',#{taxpayerid},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="MdmCustomerentity_list_or" resultMap="get-MdmCustomerEntity-result" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity">
|
||||
select
|
||||
<include refid="MdmCustomerEntity_Base_Column_List" />
|
||||
from mdm_customer
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="documentRule != null and documentRule != ''"> or document_rule = #{documentRule} </if>
|
||||
<if test="documentRuleNum != null"> or document_rule_num = #{documentRuleNum} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> or data_status = #{dataStatus} </if>
|
||||
<if test="addStatus != null and addStatus != ''"> or add_status = #{addStatus} </if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> or update_status = #{updateStatus} </if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> or delete_status = #{deleteStatus} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
||||
<if test="code != null and code != ''"> or code = #{code} </if>
|
||||
<if test="custprop != null and custprop != ''"> or custprop = #{custprop} </if>
|
||||
<if test="custstate != null and custstate != ''"> or custstate = #{custstate} </if>
|
||||
<if test="enablestate != null and enablestate != ''"> or enablestate = #{enablestate} </if>
|
||||
<if test="name != null and name != ''"> or name = #{name} </if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> or pk_country = #{pkCountry} </if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> or pk_custclass = #{pkCustclass} </if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> or pk_group = #{pkGroup} </if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> or pk_org = #{pkOrg} </if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> or taxpayerid = #{taxpayerid} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_customer(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="documentRule != null and documentRule != ''"> document_rule , </if>
|
||||
<if test="documentRuleNum != null"> document_rule_num , </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> data_status , </if>
|
||||
<if test="addStatus != null and addStatus != ''"> add_status , </if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> update_status , </if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> delete_status , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="code != null and code != ''"> code , </if>
|
||||
<if test="custprop != null and custprop != ''"> custprop , </if>
|
||||
<if test="custstate != null and custstate != ''"> custstate , </if>
|
||||
<if test="enablestate != null and enablestate != ''"> enablestate , </if>
|
||||
<if test="name != null and name != ''"> name , </if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> pk_country , </if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> pk_custclass , </if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> pk_group , </if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> pk_org , </if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> taxpayerid , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="documentRule != null and documentRule != ''"> #{documentRule} ,</if>
|
||||
<if test="documentRuleNum != null"> #{documentRuleNum} ,</if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> #{dataStatus} ,</if>
|
||||
<if test="addStatus != null and addStatus != ''"> #{addStatus} ,</if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> #{updateStatus} ,</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> #{deleteStatus} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="code != null and code != ''"> #{code} ,</if>
|
||||
<if test="custprop != null and custprop != ''"> #{custprop} ,</if>
|
||||
<if test="custstate != null and custstate != ''"> #{custstate} ,</if>
|
||||
<if test="enablestate != null and enablestate != ''"> #{enablestate} ,</if>
|
||||
<if test="name != null and name != ''"> #{name} ,</if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> #{pkCountry} ,</if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> #{pkCustclass} ,</if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> #{pkGroup} ,</if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> #{pkOrg} ,</if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> #{taxpayerid} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_customer a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_customer(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, code, custprop, custstate, enablestate, name, pk_country, pk_custclass, pk_group, pk_org, taxpayerid, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.code},#{entity.custprop},#{entity.custstate},#{entity.enablestate},#{entity.name},#{entity.pkCountry},#{entity.pkCustclass},#{entity.pkGroup},#{entity.pkOrg},#{entity.taxpayerid}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_customer(document_rule, document_rule_num, data_status, add_status, update_status, delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, code, custprop, custstate, enablestate, name, pk_country, pk_custclass, pk_group, pk_org, taxpayerid)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.code},#{entity.custprop},#{entity.custstate},#{entity.enablestate},#{entity.name},#{entity.pkCountry},#{entity.pkCustclass},#{entity.pkGroup},#{entity.pkOrg},#{entity.taxpayerid})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
document_rule = values(document_rule),
|
||||
document_rule_num = values(document_rule_num),
|
||||
data_status = values(data_status),
|
||||
add_status = values(add_status),
|
||||
update_status = values(update_status),
|
||||
delete_status = values(delete_status),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id),
|
||||
code = values(code),
|
||||
custprop = values(custprop),
|
||||
custstate = values(custstate),
|
||||
enablestate = values(enablestate),
|
||||
name = values(name),
|
||||
pk_country = values(pk_country),
|
||||
pk_custclass = values(pk_custclass),
|
||||
pk_group = values(pk_group),
|
||||
pk_org = values(pk_org),
|
||||
taxpayerid = values(taxpayerid)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity" >
|
||||
update mdm_customer set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="documentRule != null and documentRule != ''"> document_rule = #{documentRule},</if>
|
||||
<if test="documentRuleNum != null"> document_rule_num = #{documentRuleNum},</if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> data_status = #{dataStatus},</if>
|
||||
<if test="addStatus != null and addStatus != ''"> add_status = #{addStatus},</if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> update_status = #{updateStatus},</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> delete_status = #{deleteStatus},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||
<if test="code != null and code != ''"> code = #{code},</if>
|
||||
<if test="custprop != null and custprop != ''"> custprop = #{custprop},</if>
|
||||
<if test="custstate != null and custstate != ''"> custstate = #{custstate},</if>
|
||||
<if test="enablestate != null and enablestate != ''"> enablestate = #{enablestate},</if>
|
||||
<if test="name != null and name != ''"> name = #{name},</if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> pk_country = #{pkCountry},</if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> pk_custclass = #{pkCustclass},</if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> pk_group = #{pkGroup},</if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> pk_org = #{pkOrg},</if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> taxpayerid = #{taxpayerid},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity" >
|
||||
update mdm_customer set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity" >
|
||||
update mdm_customer set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="documentRule != null and documentRule != ''"> and document_rule = #{documentRule} </if>
|
||||
<if test="documentRuleNum != null"> and document_rule_num = #{documentRuleNum} </if>
|
||||
<if test="dataStatus != null and dataStatus != ''"> and data_status = #{dataStatus} </if>
|
||||
<if test="addStatus != null and addStatus != ''"> and add_status = #{addStatus} </if>
|
||||
<if test="updateStatus != null and updateStatus != ''"> and update_status = #{updateStatus} </if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''"> and delete_status = #{deleteStatus} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<if test="code != null and code != ''"> and code = #{code} </if>
|
||||
<if test="custprop != null and custprop != ''"> and custprop = #{custprop} </if>
|
||||
<if test="custstate != null and custstate != ''"> and custstate = #{custstate} </if>
|
||||
<if test="enablestate != null and enablestate != ''"> and enablestate = #{enablestate} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="pkCountry != null and pkCountry != ''"> and pk_country = #{pkCountry} </if>
|
||||
<if test="pkCustclass != null and pkCustclass != ''"> and pk_custclass = #{pkCustclass} </if>
|
||||
<if test="pkGroup != null and pkGroup != ''"> and pk_group = #{pkGroup} </if>
|
||||
<if test="pkOrg != null and pkOrg != ''"> and pk_org = #{pkOrg} </if>
|
||||
<if test="taxpayerid != null and taxpayerid != ''"> and taxpayerid = #{taxpayerid} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_customer where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.plugin;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataCustoMermanageService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 客户档案(MdmCustomer)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public class MdmCustomerPluginInitializer extends PluginBaseEntity{
|
||||
Logger logger = LoggerFactory.getLogger(MdmCustomerPluginInitializer.class);
|
||||
@Autowired
|
||||
private IMasterDataCustoMermanageService masterDataCustoMermanageService;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "MdmCustomerPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "MdmCustomerPlugin插件";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "MdmCustomerPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
logger.info("======开始执行客户信息同步========");
|
||||
return masterDataCustoMermanageService.queryCustoMermanageArchives(requestJson);
|
||||
}catch (Exception e){
|
||||
logger.info("======执行客户同步失败:{}========",e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.service;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
/**
|
||||
* 客户档案(MdmCustomer)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public interface IMdmCustomerService extends IBaseService<MdmCustomerEntity, String>{
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.hzya.frame.plugin.masterData.customer.service.impl;
|
||||
|
||||
import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
|
||||
import com.hzya.frame.plugin.masterData.customer.dao.IMdmCustomerDao;
|
||||
import com.hzya.frame.plugin.masterData.customer.service.IMdmCustomerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
/**
|
||||
* 客户档案(MdmCustomer)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-21 13:52:35
|
||||
*/
|
||||
public class MdmCustomerServiceImpl extends BaseService<MdmCustomerEntity, String> implements IMdmCustomerService {
|
||||
|
||||
private IMdmCustomerDao mdmCustomerDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmCustomerDao(IMdmCustomerDao dao) {
|
||||
this.mdmCustomerDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -1,9 +1,12 @@
|
|||
package com.hzya.frame.plugin.masterData.user.plugin;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataMemberService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 用户档案(MdmUser)表服务接口
|
||||
*
|
||||
|
@ -12,6 +15,8 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class MdmUserPluginInitializer extends PluginBaseEntity{
|
||||
Logger logger = LoggerFactory.getLogger(MdmUserPluginInitializer.class);
|
||||
@Autowired
|
||||
private IMasterDataMemberService masterDataMemberService;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
|
@ -44,7 +49,13 @@ public class MdmUserPluginInitializer extends PluginBaseEntity{
|
|||
}
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
logger.info("执行业务代码逻辑");
|
||||
try {
|
||||
logger.info("======开始执行用户信息同步========");
|
||||
return masterDataMemberService.queryMemberArchives(requestJson);
|
||||
}catch (Exception e){
|
||||
logger.info("======执行用户同步失败:{}========",e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.hzya.frame.plugin.mdmDistribute.plugin;
|
|||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||
|
@ -17,6 +19,7 @@ import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDe
|
|||
import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao;
|
||||
import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity;
|
||||
import com.hzya.frame.mdm.service.IMdmServiceCache;
|
||||
import com.hzya.frame.sys.sysenum.SysEnum;
|
||||
import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao;
|
||||
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
|
||||
import com.hzya.frame.sysnew.application.dao.ISysApplicationDao;
|
||||
|
@ -81,7 +84,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
@Resource
|
||||
private IMdmModuleSendLogDao mdmModuleSendLogDao;
|
||||
|
||||
@Value("${ax.url}")
|
||||
@Value("${zt.url}")
|
||||
private String url ;
|
||||
|
||||
//多线程请求加锁 HttpRequest 构造方法是静态的
|
||||
|
@ -135,7 +138,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
String distributeId = jsonObject.getString("distributeId");//发送表id
|
||||
String type = jsonObject.getString("type");//发送类型,1、新增2、修改3、删除
|
||||
if(mdmCode == null || documentRule == null || distributeId == null || type == null
|
||||
|| "".equals(mdmCode) || "".equals(documentRule) || "".equals(distributeId) || "".equals(type)){
|
||||
|| "".equals(mdmCode) || "".equals(documentRule) || "".equals(distributeId) || "".equals(type)){
|
||||
taskDetailEntity.setResult("系统保存参数错误");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("系统保存参数错误");
|
||||
|
@ -183,7 +186,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ;
|
||||
mdmModuleDistributeDetailEntity.setDistributeId(distributeId);
|
||||
mdmModuleDistributeDetailEntity.setSts("Y");
|
||||
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
|
||||
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
|
||||
|
||||
// 启用停用 0、停用
|
||||
//if("1".equals(mdmModuleDistributeEntity.getEnabledType())){
|
||||
|
@ -273,11 +276,13 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
|
||||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){
|
||||
Map<String,Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
if(object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){
|
||||
Map<String,Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -302,11 +307,14 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){
|
||||
for (int i3 = 0; i3 < detail.size(); i3++) {
|
||||
Map<String,Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){
|
||||
Map<String,Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -340,10 +348,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
JSONObject groovyStr = new JSONObject();
|
||||
groovyStr.put("jsonStr",groovy);
|
||||
try {
|
||||
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||
header = jsonResultEntity.getHeaders();
|
||||
querys = jsonResultEntity.getQuerys();
|
||||
bodys = jsonResultEntity.getBodys();
|
||||
Object str = groovyIntegrationService.groovyScriptExecution(groovyStr);
|
||||
JSONObject jsonResultEntity = JSONObject.parseObject(str.toString());
|
||||
header = (Map<String, String>) jsonResultEntity.get("header");
|
||||
querys = jsonResultEntity.getString("querys");
|
||||
bodys = jsonResultEntity.getString("bodys");
|
||||
}catch (Exception e){
|
||||
taskDetailEntity.setResult("分发脚本转换错误");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
|
@ -358,6 +367,33 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
if(header != null){
|
||||
headers.putAll(header);
|
||||
}
|
||||
if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) {
|
||||
//找到登陆接口
|
||||
SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort());
|
||||
if (null == loginApi) {
|
||||
taskDetailEntity.setResult("发送错误,认证接口不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("发送错误,认证接口不存在");
|
||||
}
|
||||
String rzquerys = getQuery(loginApi,null,null);
|
||||
Map<String, String> headersa = new HashMap<>();
|
||||
headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||
headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||
headersa.put("appId", sysApplicationEntity.getAppId().toString());
|
||||
headersa.put("apiCode", loginApi.getApiCode().toString());
|
||||
Map<String, String> rzheaders = getHeaders(loginApi,headersa,null);
|
||||
String rzbodys = getBodys(loginApi,null,null);
|
||||
JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys);
|
||||
if (!rzjsonResultEntity.isFlag()) {
|
||||
taskDetailEntity.setResult("发送错误,认证接口错误");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("发送错误:"+rzjsonResultEntity.getMsg());
|
||||
}
|
||||
JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString());
|
||||
querys = getQuery(apiEntity,querys,attritube);
|
||||
headers = getHeaders(apiEntity,headers,attritube);
|
||||
bodys = getBodys(apiEntity,bodys,attritube);
|
||||
}
|
||||
//组装数据发送
|
||||
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
|
@ -386,9 +422,9 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
queryMdmModuleDistributeEntity.setEnabledType("1");
|
||||
queryMdmModuleDistributeEntity.setEnabledState("1");
|
||||
List<MdmModuleDistributeEntity> mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(queryMdmModuleDistributeEntity);
|
||||
if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){
|
||||
continue;
|
||||
}
|
||||
if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){
|
||||
continue;
|
||||
}
|
||||
//查询主数据db
|
||||
MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity();
|
||||
queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId());
|
||||
|
@ -423,7 +459,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
logger.info("执行成功");
|
||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||
} catch (Exception e) {
|
||||
logger.error("执行失败{}",e.getMessage());
|
||||
logger.error("执行失败{}",e.getMessage());
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||
}
|
||||
|
@ -534,10 +570,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
JSONObject groovyStr = new JSONObject();
|
||||
groovyStr.put("jsonStr",groovy);
|
||||
try {
|
||||
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||
header = jsonResultEntity.getHeaders();
|
||||
querys = jsonResultEntity.getQuerys();
|
||||
bodys = jsonResultEntity.getBodys();
|
||||
Object str = groovyIntegrationService.groovyScriptExecution(groovyStr);
|
||||
JSONObject jsonResultEntity = JSONObject.parseObject(str.toString());
|
||||
header = (Map<String, String>) jsonResultEntity.get("header");
|
||||
querys = jsonResultEntity.getString("querys");
|
||||
bodys = jsonResultEntity.getString("bodys");
|
||||
}catch (Exception e){
|
||||
saveMdmModuleSendLogEntity("2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3");
|
||||
continue;
|
||||
|
@ -551,6 +588,31 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
if(header != null){
|
||||
headers.putAll(header);
|
||||
}
|
||||
if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) {
|
||||
//找到登陆接口
|
||||
SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort());
|
||||
if (null == loginApi) {
|
||||
saveMdmModuleSendLogEntity("2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||
continue;
|
||||
}
|
||||
String rzquerys = getQuery(loginApi,null,null);
|
||||
Map<String, String> headersa = new HashMap<>();
|
||||
headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||
headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||
headersa.put("appId", sysApplicationEntity.getAppId().toString());
|
||||
headersa.put("apiCode", loginApi.getApiCode().toString());
|
||||
Map<String, String> rzheaders = getHeaders(loginApi,headersa,null);
|
||||
String rzbodys = getBodys(loginApi,null,null);
|
||||
JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys);
|
||||
if (!rzjsonResultEntity.isFlag()) {
|
||||
saveMdmModuleSendLogEntity("2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||
continue;
|
||||
}
|
||||
JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString());
|
||||
querys = getQuery(apiEntity,querys,attritube);
|
||||
headers = getHeaders(apiEntity,headers,attritube);
|
||||
bodys = getBodys(apiEntity,bodys,attritube);
|
||||
}
|
||||
//组装数据发送
|
||||
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
|
@ -591,7 +653,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("tableName",mainDb);
|
||||
map1.put("dataStatus", "F");
|
||||
//map1.put("dataStatus", "F");
|
||||
map1.put("updateStatus", "0");
|
||||
map1.put("size", 1000);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
|
@ -608,7 +670,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
//查询这一千条数据是否符合规则
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("tableName", mainDb);
|
||||
map.put("dataStatus", "F");
|
||||
//map.put("dataStatus", "F");
|
||||
map.put("updateStatus", "0");
|
||||
map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities);
|
||||
map.put("ids", objects);
|
||||
|
@ -674,10 +736,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
JSONObject groovyStr = new JSONObject();
|
||||
groovyStr.put("jsonStr",groovy);
|
||||
try {
|
||||
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||
header = jsonResultEntity.getHeaders();
|
||||
querys = jsonResultEntity.getQuerys();
|
||||
bodys = jsonResultEntity.getBodys();
|
||||
Object str = groovyIntegrationService.groovyScriptExecution(groovyStr);
|
||||
JSONObject jsonResultEntity = JSONObject.parseObject(str.toString());
|
||||
header = (Map<String, String>) jsonResultEntity.get("header");
|
||||
querys = jsonResultEntity.getString("querys");
|
||||
bodys = jsonResultEntity.getString("bodys");
|
||||
}catch (Exception e){
|
||||
saveMdmModuleSendLogEntity("2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2");
|
||||
continue;
|
||||
|
@ -691,6 +754,31 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
if(header != null){
|
||||
headers.putAll(header);
|
||||
}
|
||||
if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) {
|
||||
//找到登陆接口
|
||||
SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort());
|
||||
if (null == loginApi) {
|
||||
saveMdmModuleSendLogEntity("2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||
continue;
|
||||
}
|
||||
String rzquerys = getQuery(loginApi,null,null);
|
||||
Map<String, String> headersa = new HashMap<>();
|
||||
headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||
headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||
headersa.put("appId", sysApplicationEntity.getAppId().toString());
|
||||
headersa.put("apiCode", loginApi.getApiCode().toString());
|
||||
Map<String, String> rzheaders = getHeaders(loginApi,headersa,null);
|
||||
String rzbodys = getBodys(loginApi,null,null);
|
||||
JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys);
|
||||
if (!rzjsonResultEntity.isFlag()) {
|
||||
saveMdmModuleSendLogEntity("2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||
continue;
|
||||
}
|
||||
JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString());
|
||||
querys = getQuery(apiEntity,querys,attritube);
|
||||
headers = getHeaders(apiEntity,headers,attritube);
|
||||
bodys = getBodys(apiEntity,bodys,attritube);
|
||||
}
|
||||
//组装数据发送
|
||||
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
|
@ -709,7 +797,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
for (int i = 0; i < objects.size(); i++) {
|
||||
Map<String, Object> updateMap = new HashMap<>();
|
||||
updateMap.put("tableName",mainDb);
|
||||
updateMap.put("dataStatus", "F");
|
||||
//updateMap.put("dataStatus", "F");
|
||||
updateMap.put("updateStatus", "1");
|
||||
updateMap.put("id", objects.get(i).getString("id"));
|
||||
mdmModuleDao.updateMdmSTs(updateMap);
|
||||
|
@ -738,7 +826,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("tableName",mainDb);
|
||||
map1.put("dataStatus", "Y");
|
||||
//map1.put("dataStatus", "Y");
|
||||
map1.put("addStatus", "0");
|
||||
map1.put("size", 1000);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
|
@ -755,7 +843,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
//查询这一千条数据是否符合规则
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("tableName", mainDb);
|
||||
map.put("dataStatus", "Y");
|
||||
//map.put("dataStatus", "Y");
|
||||
map.put("addStatus", "0");
|
||||
map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities);
|
||||
map.put("ids", objects);
|
||||
|
@ -830,10 +918,11 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
JSONObject groovyStr = new JSONObject();
|
||||
groovyStr.put("jsonStr",groovy);
|
||||
try {
|
||||
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||
header = jsonResultEntity.getHeaders();
|
||||
querys = jsonResultEntity.getQuerys();
|
||||
bodys = jsonResultEntity.getBodys();
|
||||
Object str = groovyIntegrationService.groovyScriptExecution(groovyStr);
|
||||
JSONObject jsonResultEntity = JSONObject.parseObject(str.toString());
|
||||
header = (Map<String, String>) jsonResultEntity.get("header");
|
||||
querys = jsonResultEntity.getString("querys");
|
||||
bodys = jsonResultEntity.getString("bodys");
|
||||
}catch (Exception e){
|
||||
saveMdmModuleSendLogEntity("2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||
continue;
|
||||
|
@ -847,6 +936,32 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
if(header != null){
|
||||
headers.putAll(header);
|
||||
}
|
||||
if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) {
|
||||
//找到登陆接口
|
||||
SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort());
|
||||
if (null == loginApi) {
|
||||
saveMdmModuleSendLogEntity("2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||
continue;
|
||||
}
|
||||
String rzquerys = getQuery(loginApi,null,null);
|
||||
Map<String, String> headersa = new HashMap<>();
|
||||
headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||
headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||
headersa.put("appId", sysApplicationEntity.getAppId().toString());
|
||||
headersa.put("apiCode", loginApi.getApiCode().toString());
|
||||
Map<String, String> rzheaders = getHeaders(loginApi,headersa,null);
|
||||
String rzbodys = getBodys(loginApi,null,null);
|
||||
JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys);
|
||||
if (!rzjsonResultEntity.isFlag()) {
|
||||
saveMdmModuleSendLogEntity("2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||
continue;
|
||||
}
|
||||
JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString());
|
||||
querys = getQuery(apiEntity,querys,attritube);
|
||||
headers = getHeaders(apiEntity,headers,attritube);
|
||||
bodys = getBodys(apiEntity,bodys,attritube);
|
||||
}
|
||||
|
||||
//组装数据发送
|
||||
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
|
@ -859,18 +974,13 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//所有下发发送完成,修改数据状态
|
||||
for (int i = 0; i < objects.size(); i++) {
|
||||
Map<String, Object> updateMap = new HashMap<>();
|
||||
updateMap.put("tableName",mainDb);
|
||||
updateMap.put("dataStatus", "Y");
|
||||
//updateMap.put("dataStatus", "Y");
|
||||
updateMap.put("addStatus", "1");
|
||||
updateMap.put("id", objects.get(i).getString("id"));
|
||||
mdmModuleDao.updateMdmSTs(updateMap);
|
||||
|
@ -880,7 +990,6 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
private void saveMdmModuleSendLogEntity(String dataType,String remark,String dbname,String formmain_id, String target_app, String target_api, String source_data, String option_type) {
|
||||
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();
|
||||
mdmModuleSendLogEntity.setTableName(dbname+"_send_log");
|
||||
mdmModuleSendLogEntity.setCreate();
|
||||
mdmModuleSendLogEntity.setId(UUIDUtils.getUUID());
|
||||
mdmModuleSendLogEntity.setSts("Y");
|
||||
mdmModuleSendLogEntity.setCreate_user_id("1");
|
||||
|
@ -916,11 +1025,13 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){
|
||||
for (int i3 = 0; i3 < detail.size(); i3++) {
|
||||
Map<String,Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){
|
||||
Map<String,Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -959,7 +1070,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
StringBuilder body = new StringBuilder();
|
||||
boolean flag = true;
|
||||
try {
|
||||
try {
|
||||
if (bodys != null && !"".equals(bodys)) {
|
||||
ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8"));
|
||||
entity.setContentType("application/json");
|
||||
|
@ -1007,4 +1118,159 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Map<String, String> getHeaders(SysApplicationApiEntity loginApi,Map<String, String> map,JSONObject loginData) {
|
||||
if(loginData == null){
|
||||
loginData = new JSONObject();
|
||||
}
|
||||
if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) {
|
||||
if (JSONUtil.isTypeJSONArray(loginApi.getHeaderIn())) {
|
||||
JSONArray headerArray = JSON.parseArray(loginApi.getHeaderIn());
|
||||
for (int i = 0; i < headerArray.size(); i++) {
|
||||
JSONObject querys = headerArray.getJSONObject(i);
|
||||
//query 只有基本类型,不用循环判断下级
|
||||
//判断参数是否有值
|
||||
//获取对象下面的层级数据
|
||||
if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型
|
||||
String query = querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
if (query != null && !"".equals(query)) {
|
||||
JSONArray example = JSONArray.parseArray(query);
|
||||
String logValue = getObjectValue(loginData, example);
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue);
|
||||
}
|
||||
} else {
|
||||
if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue()));
|
||||
}
|
||||
} else {//没有值直接拼接
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if(sendDatastr != null){
|
||||
String[] parts = sendDatastr.split("&");
|
||||
if(parts != null && parts.length > 0){
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
String[] part = parts[i].split("=");
|
||||
if(part != null && part.length >=2 ){
|
||||
for (int a = 0; a < part.length; a++) {
|
||||
map.put(part[0],part[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(loginData == null){
|
||||
loginData = new JSONObject();
|
||||
}
|
||||
if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) {
|
||||
if (JSONUtil.isTypeJSONArray(loginApi.getQueryIn())) {
|
||||
JSONArray headerArray = JSON.parseArray(loginApi.getQueryIn());
|
||||
for (int i = 0; i < headerArray.size(); i++) {
|
||||
JSONObject querys = headerArray.getJSONObject(i);
|
||||
//query 只有基本类型,不用循环判断下级
|
||||
//判断参数是否有值
|
||||
//获取对象下面的层级数据
|
||||
if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型
|
||||
String query = querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
if (query != null && !"".equals(query)) {
|
||||
JSONArray example = JSONArray.parseArray(query);
|
||||
String logValue = getObjectValue(loginData, example);
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue);
|
||||
}
|
||||
} else {
|
||||
//不是认证类型直接取值
|
||||
if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue()));
|
||||
}
|
||||
} else {//没有值直接拼接
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
StringBuffer returnStr = new StringBuffer();
|
||||
if(map != null && map.size() > 0){
|
||||
for (String key : map.keySet()) {
|
||||
if("".equals(returnStr)){
|
||||
returnStr.append(key).append("=").append(map.get(key));
|
||||
}else {
|
||||
returnStr.append("&").append(key).append("=").append(map.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnStr.toString();
|
||||
}
|
||||
/**
|
||||
* @param loginData
|
||||
* @param example
|
||||
* @return java.lang.String
|
||||
* @Author lvleigang
|
||||
* @Description 根据jsonArray 获取jsonobject中的值
|
||||
* @Date 11:47 上午 2023/8/31
|
||||
**/
|
||||
private String getObjectValue(JSONObject loginData, JSONArray example) {
|
||||
String values = "";
|
||||
if (example != null && example.size() > 0) {
|
||||
for (int i = 0; i < example.size(); i++) {
|
||||
if (loginData.getString(example.getString(i)) != null && !"".equals(loginData.getString(example.getString(i)))) {
|
||||
if (i == (example.size() - 1)) {
|
||||
values = loginData.getString(example.getString(i));
|
||||
} else {
|
||||
loginData = JSONObject.parseObject(loginData.getString(example.getString(i)));
|
||||
}
|
||||
} else {
|
||||
return values;
|
||||
}
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) {
|
||||
JSONObject sendData = new JSONObject();
|
||||
if(sendDatastr != null ){
|
||||
sendData = JSONObject.parseObject(sendDatastr);
|
||||
}
|
||||
if(loginData == null){
|
||||
loginData = new JSONObject();
|
||||
}
|
||||
if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) {
|
||||
if (JSONUtil.isTypeJSONArray(loginApi.getBodyIn())) {
|
||||
JSONArray headerArray = JSON.parseArray(loginApi.getBodyIn());
|
||||
for (int i = 0; i < headerArray.size(); i++) {
|
||||
//获取到第一个数据
|
||||
JSONObject querys = headerArray.getJSONObject(i);
|
||||
if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型
|
||||
String query = querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
if (query != null && !"".equals(query)) {
|
||||
JSONArray example = JSONArray.parseArray(query);
|
||||
String logValue = getObjectValue(loginData, example);
|
||||
sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),logValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sendData.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,5 +19,5 @@ spring:
|
|||
savefile:
|
||||
# 文件保存路径
|
||||
path: E:\yongansystem\file
|
||||
ax:
|
||||
zt:
|
||||
url: http://127.0.0.1:9081/kangarooDataCenterV3/entranceController/externalCallInterface
|
|
@ -23,5 +23,5 @@ spring:
|
|||
savefile:
|
||||
# 文件保存路径
|
||||
path: D:\yongansystem\kangarooDataCenter\v3\logs
|
||||
ax:
|
||||
zt:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
|
@ -17,19 +17,33 @@ spring:
|
|||
filters: stat,log4j2
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
||||
username: hzyazt
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
# username: root
|
||||
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
||||
# username: hzyazt
|
||||
# password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
# driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
|
||||
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
path: /Users/apple/Desktop/log/local
|
||||
ax:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
zt:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
cbs8:
|
||||
appId: 1P4AGrpz
|
||||
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
||||
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
|
||||
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
|
||||
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
|
||||
# 这个私钥到时候上传到cbs,和下面到是同一对
|
||||
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
|
||||
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
|
||||
cbs_public_key: 0469146F06BF3B01236E84632441E826
|
||||
#电子回单下载临时存放位置
|
||||
elec_path: /Users/xiangerlin/Downloads/
|
||||
OA:
|
||||
data_source_code: yc_oa
|
|
@ -19,5 +19,5 @@ spring:
|
|||
savefile:
|
||||
# 文件保存路径
|
||||
path: /Users/apple/Desktop/log/local
|
||||
ax:
|
||||
zt:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
|
@ -26,9 +26,9 @@
|
|||
#ax:
|
||||
# url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
logging:
|
||||
#日志级别 指定目录级别
|
||||
#日志级别 指定目录级别warn
|
||||
level:
|
||||
root: warn
|
||||
root: info
|
||||
encodings: UTF-8
|
||||
file:
|
||||
# 日志保存路径
|
||||
|
|
|
@ -19,5 +19,5 @@ spring:
|
|||
savefile:
|
||||
# 文件保存路径
|
||||
path: E:\yongansystem\log
|
||||
ax:
|
||||
zt:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
|
@ -90,7 +90,7 @@ mybatis-plus:
|
|||
global-config:
|
||||
db-config:
|
||||
id-type: auto # 主键策略
|
||||
ax:
|
||||
zt:
|
||||
url:
|
||||
# 积木报表工具
|
||||
#JimuReport[minidao配置]
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>MdmCustomerBankPlugin</id>
|
||||
<name>MdmCustomerBankPlugin插件</name>
|
||||
<category>90000001</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmCustomerBankDao" class="com.hzya.frame.plugin.masterData.customer.bank.dao.impl.MdmCustomerBankDaoImpl" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmCustomerBankInitializer" class="com.hzya.frame.plugin.masterData.customer.bank.plugin.MdmCustomerBankPluginInitializer" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmCustomerBankService" class="com.hzya.frame.plugin.masterData.customer.bank.service.impl.MdmCustomerBankServiceImpl" />
|
||||
</beans>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>MdmCustomerPlugin</id>
|
||||
<name>MdmCustomerPlugin插件</name>
|
||||
<category>90000001</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmCustomerDao" class="com.hzya.frame.plugin.masterData.customer.dao.impl.MdmCustomerDaoImpl" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmCustomerInitializer" class="com.hzya.frame.plugin.masterData.customer.plugin.MdmCustomerPluginInitializer" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmCustomerService" class="com.hzya.frame.plugin.masterData.customer.service.impl.MdmCustomerServiceImpl" />
|
||||
</beans>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>PayBillPlugin</id>
|
||||
<name>OA付款单插件</name>
|
||||
<category>202406210001</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="PayBillPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.PayBillPluginInitializer" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="PayBillPluginService" class="com.hzya.frame.plugin.a8bill.service.impl.PayBillServiceImpl" />
|
||||
</beans>
|
|
@ -1,5 +1,10 @@
|
|||
package com.hzya.frame.bip.v3.v2207.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* com.hzya.frame.bip.v3.v2207.util
|
||||
*
|
||||
|
@ -8,5 +13,53 @@ package com.hzya.frame.bip.v3.v2207.util;
|
|||
*/
|
||||
|
||||
public class BipUtil {
|
||||
/**
|
||||
*
|
||||
* @content 发送单据到BIP系统
|
||||
* @author laborer
|
||||
* @date 2024/6/21 0021 10:51
|
||||
*
|
||||
*/
|
||||
|
||||
public static String sendU9cTOBipEsb(String parm, String apiCode,String token){
|
||||
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
|
||||
System.out.println("推送参数"+parm);
|
||||
String result = HttpRequest.post(baseUrl)
|
||||
.header("appId", "800023")//头信息,多个头信息多次调用此方法即可
|
||||
.header("access_token", token)//头信息,多个头信息多次调用此方法即可
|
||||
.header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可
|
||||
.header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可
|
||||
.header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可
|
||||
.body(parm)//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
System.out.println("返回参数"+result);
|
||||
if(StrUtil.isNotEmpty(result)){
|
||||
return analytic(result);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String getBipToken(String userCode, String apiCode){
|
||||
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
|
||||
String result = HttpRequest.post(baseUrl)
|
||||
.header("appId", "800023")//头信息,多个头信息多次调用此方法即可
|
||||
.header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可
|
||||
.header("usercode", userCode)//头信息,多个头信息多次调用此方法即可
|
||||
.header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可
|
||||
.header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可
|
||||
.body("")//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
System.out.println("返回参数"+result);
|
||||
if(StrUtil.isNotEmpty(result)){
|
||||
JSONObject obj = JSON.parseObject( analytic(result));
|
||||
JSONObject data = obj.getJSONObject("data");
|
||||
return data.getString("access_token");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String analytic(String parm){
|
||||
JSONObject main = JSON.parseObject(parm);
|
||||
return main.getString("attribute");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -559,7 +559,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
|||
documentRule.setShowType("1");
|
||||
documentRule.setQueryType("1");
|
||||
documentRule.setListType("1");
|
||||
documentRule.setViewType("1");
|
||||
documentRule.setViewType("2");
|
||||
documentRule.setFiledLength("50");
|
||||
documentRule.setCreate();
|
||||
documentRule.setDataType("1");
|
||||
|
@ -2585,13 +2585,13 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
|||
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
|
||||
List<MdmModuleDbFiledsEntity> mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
|
||||
List<MdmModuleDbFiledsEntity> list = new ArrayList<>();
|
||||
if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){
|
||||
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||
if(entity.getDbId().equals(mdmModuleDbEntities.get(i).getDbId()) && "1".equals(mdmModuleDbEntities.get(i).getViewType())){
|
||||
list.add(mdmModuleDbEntities.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){
|
||||
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||
if(entity.getDbId().equals(mdmModuleDbEntities.get(i).getDbId()) && "1".equals(mdmModuleDbEntities.get(i).getViewType())){
|
||||
list.add(mdmModuleDbEntities.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.hzya.frame.mdm.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.Method;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -49,7 +52,9 @@ import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
|
|||
import com.hzya.frame.mdm.service.IMdmService;
|
||||
|
||||
import com.hzya.frame.mdm.service.IMdmServiceCache;
|
||||
import com.hzya.frame.sys.appApi.entity.AppApi;
|
||||
import com.hzya.frame.sys.entity.FormmainDeleteDto;
|
||||
import com.hzya.frame.sys.sysenum.SysEnum;
|
||||
import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao;
|
||||
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
|
||||
import com.hzya.frame.sysnew.application.dao.ISysApplicationDao;
|
||||
|
@ -150,7 +155,7 @@ public class MdmServiceImpl implements IMdmService {
|
|||
private IMdmModuleViewDetailDao mdmModuleViewDetailDao;
|
||||
//多线程请求加锁 HttpRequest 构造方法是静态的
|
||||
private final Object lock = new Object();
|
||||
@Value("${ax.url}")
|
||||
@Value("${zt.url}")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
|
@ -1329,21 +1334,24 @@ public class MdmServiceImpl implements IMdmService {
|
|||
//String tablename = null;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {
|
||||
//查询数据
|
||||
Map<String, Object> queryData = new HashMap<>();
|
||||
queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名
|
||||
if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) {
|
||||
queryData.put("detailFlag", false);//是否明细
|
||||
queryData.put("id", entity.getId());//字段
|
||||
HashMap<String, Object> datas = mdmModuleDbDao.getServiceDataById(queryData);
|
||||
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
||||
//tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute";
|
||||
} else {
|
||||
queryData.put("detailFlag", true);//是否明细
|
||||
queryData.put("id", entity.getId());//字段
|
||||
List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByFormmainId(queryData);
|
||||
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
||||
if("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())){
|
||||
//查询数据
|
||||
Map<String, Object> queryData = new HashMap<>();
|
||||
queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名
|
||||
if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) {
|
||||
queryData.put("detailFlag", false);//是否明细
|
||||
queryData.put("id", entity.getId());//字段
|
||||
HashMap<String, Object> datas = mdmModuleDbDao.getServiceDataById(queryData);
|
||||
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
||||
//tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute";
|
||||
} else {
|
||||
queryData.put("detailFlag", true);//是否明细
|
||||
queryData.put("id", entity.getId());//字段
|
||||
List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByFormmainId(queryData);
|
||||
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//if (tablename != null && !"".equals(tablename)) {
|
||||
// Map<String, Object> queryData = new HashMap<>();
|
||||
|
@ -1691,11 +1699,13 @@ public class MdmServiceImpl implements IMdmService {
|
|||
if (mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0) {
|
||||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if (mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())) {
|
||||
Map<String, Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id", object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail);
|
||||
if(object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){
|
||||
Map<String, Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id", object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1720,11 +1730,13 @@ public class MdmServiceImpl implements IMdmService {
|
|||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if (mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())) {
|
||||
for (int i3 = 0; i3 < detail.size(); i3++) {
|
||||
Map<String, Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id", detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail);
|
||||
if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){
|
||||
Map<String, Object> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName", mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id", detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(), objectDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1736,6 +1748,7 @@ public class MdmServiceImpl implements IMdmService {
|
|||
object.put(mdmModuleDbEntities.get(i).getDbName(), detail);
|
||||
}
|
||||
}
|
||||
|
||||
//执行脚本
|
||||
JSONObject groovy = new JSONObject();
|
||||
JSONObject parameterJson = new JSONObject();
|
||||
|
@ -1758,12 +1771,11 @@ public class MdmServiceImpl implements IMdmService {
|
|||
JSONObject groovyStr = new JSONObject();
|
||||
groovyStr.put("jsonStr", groovy);
|
||||
try {
|
||||
//SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||
SysExtensionApiEntity jsonResultEntity = new SysExtensionApiEntity();
|
||||
jsonResultEntity.setBodys("{\"ufinterface\":{\"billtype\":\"supplier\",\"sender\":\"OA\",\"replace\":\"Y\",\"isexchange\":\"Y\",\"account\":\"01\",\"groupcode\":\"00\"},\"bill\":{\"billhead\":{\"pk_country\":\"CN\",\"pk_group\":\"00\",\"enablestate\":\"2\",\"code\":\"01004\",\"supprop\":\"0\",\"pk_format\":\"ZH-CN\",\"pk_supplierclass\":\"S01\",\"custstate\":\"1\",\"name\":\"\",\"pk_timezone\":\"P0800\",\"taxpayerid\":\"087981489021135119\",\"pk_org\":\"003\"}}}");
|
||||
header = jsonResultEntity.getHeaders();
|
||||
querys = jsonResultEntity.getQuerys();
|
||||
bodys = jsonResultEntity.getBodys();
|
||||
Object str = groovyIntegrationService.groovyScriptExecution(groovyStr);
|
||||
JSONObject jsonResultEntity = JSONObject.parseObject(str.toString());
|
||||
header = (Map<String, String>) jsonResultEntity.get("header");
|
||||
querys = jsonResultEntity.getString("querys");
|
||||
bodys = jsonResultEntity.getString("bodys");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("分发脚本转换错误");
|
||||
}
|
||||
|
@ -1776,37 +1788,354 @@ public class MdmServiceImpl implements IMdmService {
|
|||
if (header != null) {
|
||||
headers.putAll(header);
|
||||
}
|
||||
if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) {
|
||||
//找到登陆接口
|
||||
SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort());
|
||||
if (null == loginApi) {
|
||||
saveMdmModuleSendLogEntity("2","转发失败,认证接口不存在",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type);
|
||||
return BaseResult.getFailureMessageEntity("发送错误,认证接口不存在");
|
||||
|
||||
}
|
||||
String rzquerys = getQuery(loginApi,null,null);
|
||||
Map<String, String> headersa = new HashMap<>();
|
||||
headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||
headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||
headersa.put("appId", sysApplicationEntity.getAppId().toString());
|
||||
headersa.put("apiCode", loginApi.getApiCode().toString());
|
||||
Map<String, String> rzheaders = getHeaders(loginApi,headersa,null);
|
||||
String rzbodys = getBodys(loginApi,null,null);
|
||||
JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys);
|
||||
if (!rzjsonResultEntity.isFlag()) {
|
||||
saveMdmModuleSendLogEntity("2","转发失败,认证接口调用失败",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type);
|
||||
return BaseResult.getFailureMessageEntity("发送错误:"+rzjsonResultEntity.getMsg());
|
||||
}
|
||||
JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString());
|
||||
//JSONObject attritube = attritube1.getJSONObject("attribute");
|
||||
querys = getQuery(apiEntity,querys,attritube);
|
||||
headers = getHeaders(apiEntity,headers,attritube);
|
||||
bodys = getBodys(apiEntity,bodys,attritube);
|
||||
}
|
||||
//组装数据发送
|
||||
JsonResultEntity jsonResultEntity = sendData(apiEntity, headers, bodys, querys);
|
||||
JsonResultEntity jsonResultEntity = sendData(apiEntity, headers,bodys,querys);
|
||||
if (jsonResultEntity.isFlag()) {
|
||||
saveMdmModuleSendLogEntity("1","发送成功",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type);
|
||||
return BaseResult.getFailureMessageEntity("发送成功");
|
||||
return BaseResult.getSuccessMessageEntity("发送成功");
|
||||
} else {
|
||||
saveMdmModuleSendLogEntity("2","转发失败",dbname,object.getString("id"), sysApplicationEntity.getName(), apiEntity.getApiName(), object.toJSONString(), type);
|
||||
return BaseResult.getFailureMessageEntity("发送错误:"+jsonResultEntity.getMsg());
|
||||
}
|
||||
}
|
||||
private Map<String, String> getHeaders(SysApplicationApiEntity loginApi,Map<String, String> map,JSONObject loginData) {
|
||||
if(loginData == null){
|
||||
loginData = new JSONObject();
|
||||
}
|
||||
if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) {
|
||||
if (JSONUtil.isTypeJSONArray(loginApi.getHeaderIn())) {
|
||||
JSONArray headerArray = JSON.parseArray(loginApi.getHeaderIn());
|
||||
for (int i = 0; i < headerArray.size(); i++) {
|
||||
JSONObject querys = headerArray.getJSONObject(i);
|
||||
//query 只有基本类型,不用循环判断下级
|
||||
//判断参数是否有值
|
||||
//获取对象下面的层级数据
|
||||
if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型
|
||||
String query = querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
if (query != null && !"".equals(query)) {
|
||||
JSONArray example = JSONArray.parseArray(query);
|
||||
String logValue = getObjectValue(loginData, example);
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue);
|
||||
}
|
||||
} else {
|
||||
if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue()));
|
||||
}
|
||||
} else {//没有值直接拼接
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
private void saveMdmModuleSendLogEntity(String dataType,String remark,String dbname,String formmain_id, String target_app, String target_api, String source_data, String option_type) {
|
||||
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();
|
||||
mdmModuleSendLogEntity.setTableName(dbname+"_send_log");
|
||||
mdmModuleSendLogEntity.setCreate();
|
||||
mdmModuleSendLogEntity.setId(UUIDUtils.getUUID());
|
||||
mdmModuleSendLogEntity.setSts("Y");
|
||||
mdmModuleSendLogEntity.setCreate_user_id("1");
|
||||
mdmModuleSendLogEntity.setModify_user_id("1");
|
||||
mdmModuleSendLogEntity.setCreate_time(new Date());
|
||||
mdmModuleSendLogEntity.setModify_time(new Date());
|
||||
mdmModuleSendLogEntity.setOrg_id("0");
|
||||
mdmModuleSendLogEntity.setCompanyId("0");
|
||||
mdmModuleSendLogEntity.setFormmainId(formmain_id);
|
||||
mdmModuleSendLogEntity.setTargetApp(target_app);
|
||||
mdmModuleSendLogEntity.setTargetApi(target_api);
|
||||
mdmModuleSendLogEntity.setSourceData(source_data);
|
||||
mdmModuleSendLogEntity.setOptionType(option_type);
|
||||
mdmModuleSendLogEntity.setDataType(dataType);
|
||||
mdmModuleSendLogEntity.setRemark(remark);
|
||||
mdmModuleSendLogDao.save(mdmModuleSendLogEntity);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if(sendDatastr != null){
|
||||
String[] parts = sendDatastr.split("&");
|
||||
if(parts != null && parts.length > 0){
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
String[] part = parts[i].split("=");
|
||||
if(part != null && part.length >=2 ){
|
||||
for (int a = 0; a < part.length; a++) {
|
||||
map.put(part[0],part[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(loginData == null){
|
||||
loginData = new JSONObject();
|
||||
}
|
||||
if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) {
|
||||
if (JSONUtil.isTypeJSONArray(loginApi.getQueryIn())) {
|
||||
JSONArray headerArray = JSON.parseArray(loginApi.getQueryIn());
|
||||
for (int i = 0; i < headerArray.size(); i++) {
|
||||
JSONObject querys = headerArray.getJSONObject(i);
|
||||
//query 只有基本类型,不用循环判断下级
|
||||
//判断参数是否有值
|
||||
//获取对象下面的层级数据
|
||||
if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型
|
||||
String query = querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
if (query != null && !"".equals(query)) {
|
||||
JSONArray example = JSONArray.parseArray(query);
|
||||
String logValue = getObjectValue(loginData, example);
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue);
|
||||
}
|
||||
} else {
|
||||
//不是认证类型直接取值
|
||||
if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue()));
|
||||
}
|
||||
} else {//没有值直接拼接
|
||||
if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){
|
||||
map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
StringBuffer returnStr = new StringBuffer();
|
||||
if(map != null && map.size() > 0){
|
||||
for (String key : map.keySet()) {
|
||||
if("".equals(returnStr)){
|
||||
returnStr.append(key).append("=").append(map.get(key));
|
||||
}else {
|
||||
returnStr.append("&").append(key).append("=").append(map.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnStr.toString();
|
||||
}
|
||||
/**
|
||||
* @param loginData
|
||||
* @param example
|
||||
* @return java.lang.String
|
||||
* @Author lvleigang
|
||||
* @Description 根据jsonArray 获取jsonobject中的值
|
||||
* @Date 11:47 上午 2023/8/31
|
||||
**/
|
||||
private String getObjectValue(JSONObject loginData, JSONArray example) {
|
||||
String values = "";
|
||||
if (example != null && example.size() > 0) {
|
||||
for (int i = 0; i < example.size(); i++) {
|
||||
if (loginData.getString(example.getString(i)) != null && !"".equals(loginData.getString(example.getString(i)))) {
|
||||
if (i == (example.size() - 1)) {
|
||||
values = loginData.getString(example.getString(i));
|
||||
} else {
|
||||
loginData = JSONObject.parseObject(loginData.getString(example.getString(i)));
|
||||
}
|
||||
} else {
|
||||
return values;
|
||||
}
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) {
|
||||
JSONObject sendData = new JSONObject();
|
||||
if(sendDatastr != null ){
|
||||
sendData = JSONObject.parseObject(sendDatastr);
|
||||
}
|
||||
if(loginData == null){
|
||||
loginData = new JSONObject();
|
||||
}
|
||||
if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) {
|
||||
if (JSONUtil.isTypeJSONArray(loginApi.getBodyIn())) {
|
||||
JSONArray headerArray = JSON.parseArray(loginApi.getBodyIn());
|
||||
for (int i = 0; i < headerArray.size(); i++) {
|
||||
//获取到第一个数据
|
||||
JSONObject querys = headerArray.getJSONObject(i);
|
||||
if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型
|
||||
String query = querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
if (query != null && !"".equals(query)) {
|
||||
JSONArray example = JSONArray.parseArray(query);
|
||||
String logValue = getObjectValue(loginData, example);
|
||||
sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),logValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sendData.toString();
|
||||
}
|
||||
/**
|
||||
* @param querys 设置的字段属性
|
||||
* @param sendData 发送数据
|
||||
* @param loginData 认证信息
|
||||
* @return java.lang.Object
|
||||
* @Author lvleigang
|
||||
* @Description 设置值
|
||||
* @Date 4:14 下午 2023/8/31
|
||||
**/
|
||||
private Object getUpdata(JSONObject querys, JSONObject sendData, JSONObject loginData) {
|
||||
if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 可以直接设置值
|
||||
String query = querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
if (query != null && !"".equals(query)) {
|
||||
JSONArray example = JSONArray.parseArray(query);
|
||||
String logValue = getObjectValue(loginData, example);
|
||||
return logValue;
|
||||
}
|
||||
} else if (SysEnum.FUNDAMENTAL.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//基本类型
|
||||
if (sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())) != null
|
||||
&& !"".equals(sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())))) {//先判断入参是否有值
|
||||
return sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue()));
|
||||
} else if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加
|
||||
return querys.getString(SysEnum.EXAMPLE.getValue());
|
||||
} else {//没有值直接拼接
|
||||
return "";
|
||||
}
|
||||
} else if (SysEnum.COMPLEX.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//复杂类型
|
||||
if (sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())) != null
|
||||
&& !"".equals(sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())))) {//先判断入参是否有值
|
||||
//获取子级
|
||||
String childers = querys.getString(SysEnum.CHILDREN.getValue());
|
||||
if (childers != null && !"".equals(childers)) {
|
||||
JSONArray childersObj = JSONArray.parseArray(childers);
|
||||
if (childersObj != null && childersObj.size() > 0) {
|
||||
JSONObject obj = new JSONObject();
|
||||
for (int i = 0; i < childersObj.size(); i++) {
|
||||
JSONObject a = childersObj.getJSONObject(i);
|
||||
obj.put(a.getString(SysEnum.PARAMETERNAME.getValue()), getUpdata(a, sendData.getJSONObject(querys.getString(SysEnum.PARAMETERNAME.getValue())), loginData));
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
} else {
|
||||
JSONObject obj = new JSONObject();
|
||||
return obj;
|
||||
}
|
||||
} else {//入参没有值用实例值,如果没有不添加
|
||||
//获取子级
|
||||
String childers = querys.getString(SysEnum.CHILDREN.getValue());
|
||||
if (childers != null && !"".equals(childers)) {
|
||||
JSONArray childersObj = JSONArray.parseArray(childers);
|
||||
if (childersObj != null && childersObj.size() > 0) {
|
||||
JSONObject obj = new JSONObject();
|
||||
for (int i = 0; i < childersObj.size(); i++) {
|
||||
JSONObject a = childersObj.getJSONObject(i);
|
||||
obj.put(a.getString(SysEnum.PARAMETERNAME.getValue()), getUpdata(a, new JSONObject(), loginData));
|
||||
}
|
||||
return obj;
|
||||
} else { //没有值直接拼接
|
||||
JSONObject obj = new JSONObject();
|
||||
return obj;
|
||||
}
|
||||
} else { //没有值直接拼接
|
||||
JSONObject obj = new JSONObject();
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
} else if (SysEnum.FUNDAMENTALLIST.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//基本列表
|
||||
if (sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())) != null
|
||||
&& !"".equals(sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())))) {//先判断入参是否有值
|
||||
JSONArray jsonArray = JSONArray.parseArray(sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())));
|
||||
return jsonArray;
|
||||
} else if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加
|
||||
if ("String".equals(querys.getString(SysEnum.CONCRETETYPE.getValue()))) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(querys.getString(SysEnum.EXAMPLE.getValue()));
|
||||
return jsonArray;
|
||||
} else if ("Int".equals(querys.getString(SysEnum.CONCRETETYPE.getValue()))) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(querys.getIntValue(SysEnum.EXAMPLE.getValue()));
|
||||
return jsonArray;
|
||||
} else if ("Long".equals(querys.getString(SysEnum.CONCRETETYPE.getValue()))) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(querys.getLongValue(SysEnum.EXAMPLE.getValue()));
|
||||
return jsonArray;
|
||||
} else if ("Float".equals(querys.getString(SysEnum.CONCRETETYPE.getValue()))) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(querys.getFloatValue(SysEnum.EXAMPLE.getValue()));
|
||||
return jsonArray;
|
||||
} else if ("Double".equals(querys.getString(SysEnum.CONCRETETYPE.getValue()))) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(querys.getDoubleValue(SysEnum.EXAMPLE.getValue()));
|
||||
return jsonArray;
|
||||
} else if ("Boolean".equals(querys.getString(SysEnum.CONCRETETYPE.getValue()))) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(querys.getBooleanValue(SysEnum.EXAMPLE.getValue()));
|
||||
return jsonArray;
|
||||
} else {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(querys.getString(SysEnum.EXAMPLE.getValue()));
|
||||
return jsonArray;
|
||||
}
|
||||
} else {//没有值直接拼接
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
return jsonArray;
|
||||
}
|
||||
} else if (SysEnum.COMPLEXLIST.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//复杂列表
|
||||
if (sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())) != null
|
||||
&& !"".equals(sendData.getString(querys.getString(SysEnum.PARAMETERNAME.getValue())))) {//先判断入参是否有值
|
||||
//获取入参的数据
|
||||
//循环入参
|
||||
//循环api配置的参数
|
||||
//设置api的参数
|
||||
//返回数据
|
||||
JSONArray sendArray = sendData.getJSONArray(querys.getString(SysEnum.PARAMETERNAME.getValue()));
|
||||
if(sendArray == null || sendArray.size() == 0){
|
||||
return new JSONArray();
|
||||
}
|
||||
String childers = querys.getString(SysEnum.CHILDREN.getValue());
|
||||
if(childers == null || "".equals(childers)){
|
||||
return new JSONArray();
|
||||
}
|
||||
JSONArray childersObj = JSONArray.parseArray(childers);
|
||||
if(childersObj == null || childersObj.size() == 0){
|
||||
return new JSONArray();
|
||||
}
|
||||
JSONArray obj = new JSONArray();
|
||||
for (int i = 0; i < sendArray.size(); i++) {
|
||||
JSONObject sl = new JSONObject();
|
||||
for (int a = 0; a < childersObj.size(); a++) {
|
||||
JSONObject b = childersObj.getJSONObject(a);
|
||||
//入参没有只能取实例,实例只会有一个
|
||||
sl.put(b.getString(SysEnum.PARAMETERNAME.getValue()), getUpdata(b, sendArray.getJSONObject(i), loginData));
|
||||
}
|
||||
obj.add(sl);
|
||||
}
|
||||
return obj;
|
||||
} else {//入参没有值用实例值,如果没有不添加
|
||||
String childers = querys.getString(SysEnum.CHILDREN.getValue());
|
||||
if (childers != null && !"".equals(childers)) {
|
||||
JSONArray childersObj = JSONArray.parseArray(childers);
|
||||
if (childersObj != null && childersObj.size() > 0) {
|
||||
JSONArray obj = new JSONArray();
|
||||
JSONObject sl = new JSONObject();
|
||||
for (int i = 0; i < childersObj.size(); i++) {
|
||||
JSONObject a = childersObj.getJSONObject(i);
|
||||
//入参没有只能取实例,实例只会有一个
|
||||
sl.put(a.getString(SysEnum.PARAMETERNAME.getValue()), getUpdata(a, new JSONObject(), loginData));
|
||||
}
|
||||
obj.add(sl);
|
||||
return obj;
|
||||
}
|
||||
} else {
|
||||
JSONArray obj = new JSONArray();
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map<String, String> headers, String bodys, String querys) {
|
||||
|
@ -1880,6 +2209,29 @@ public class MdmServiceImpl implements IMdmService {
|
|||
}
|
||||
}
|
||||
|
||||
private void saveMdmModuleSendLogEntity(String dataType,String remark,String dbname,String formmain_id, String target_app, String target_api, String source_data, String option_type) {
|
||||
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();
|
||||
mdmModuleSendLogEntity.setTableName(dbname+"_send_log");
|
||||
mdmModuleSendLogEntity.setCreate();
|
||||
mdmModuleSendLogEntity.setId(UUIDUtils.getUUID());
|
||||
mdmModuleSendLogEntity.setSts("Y");
|
||||
mdmModuleSendLogEntity.setCreate_user_id("1");
|
||||
mdmModuleSendLogEntity.setModify_user_id("1");
|
||||
mdmModuleSendLogEntity.setCreate_time(new Date());
|
||||
mdmModuleSendLogEntity.setModify_time(new Date());
|
||||
mdmModuleSendLogEntity.setOrg_id("0");
|
||||
mdmModuleSendLogEntity.setCompanyId("0");
|
||||
mdmModuleSendLogEntity.setFormmainId(formmain_id);
|
||||
mdmModuleSendLogEntity.setTargetApp(target_app);
|
||||
mdmModuleSendLogEntity.setTargetApi(target_api);
|
||||
mdmModuleSendLogEntity.setSourceData(source_data);
|
||||
mdmModuleSendLogEntity.setOptionType(option_type);
|
||||
mdmModuleSendLogEntity.setDataType(dataType);
|
||||
mdmModuleSendLogEntity.setRemark(remark);
|
||||
mdmModuleSendLogDao.save(mdmModuleSendLogEntity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mdmCode
|
||||
* @param saveData
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.hzya.frame.seeyon.paybill.dao;
|
||||
|
||||
import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity;
|
||||
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 👻👻👻👻👻👻👻👻👻👻 gjh
|
||||
* @version 1.0
|
||||
* @content
|
||||
* @date 2023-08-30 10:27
|
||||
*/
|
||||
public interface IPayBillDao {
|
||||
/**
|
||||
*
|
||||
* @content 获取OA工程付款单数据
|
||||
* @author laborer
|
||||
* @date 2024/6/20 0020 11:30
|
||||
*
|
||||
*/
|
||||
List<PayBillEntity> getOaEngineerPay(PayBillEntity entity);
|
||||
/**
|
||||
*
|
||||
* @content 修改推送状态
|
||||
* @author laborer
|
||||
* @date 2024/6/21 0021 11:15
|
||||
*
|
||||
*/
|
||||
|
||||
int updateState(PayBillEntity pay);
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.hzya.frame.seeyon.paybill.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity;
|
||||
import com.hzya.frame.seeyon.paybill.dao.IPayBillDao;
|
||||
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 👻👻👻👻👻👻👻👻👻👻 gjh
|
||||
* @version 1.0
|
||||
* @content
|
||||
* @date 2023-08-30 10:27
|
||||
*/
|
||||
@Repository(value = "PayBillDaoImpl")
|
||||
public class PayBillDaoImpl extends MybatisGenericDao implements IPayBillDao {
|
||||
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public List<PayBillEntity> getOaEngineerPay(PayBillEntity entity) {
|
||||
return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base",entity);
|
||||
}
|
||||
@DS("#pay.dataSourceCode")
|
||||
@Override
|
||||
public int updateState(PayBillEntity pay) {
|
||||
return super.update("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_update",pay);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package com.hzya.frame.seeyon.paybill.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 付款結算單
|
||||
* @author laborer
|
||||
* @date 2024/6/20 0020 11:07
|
||||
*
|
||||
*/
|
||||
|
||||
public class PayBillEntity extends BaseEntity {
|
||||
private String billDate;//付款日期
|
||||
private String primalMoney;//付款金额信息
|
||||
private String pkOppaccount;//付款银行信息
|
||||
private String pkSupplier;//供应商信息
|
||||
private String tableName;//表名称
|
||||
private String fieldName;//字段名称
|
||||
private String state;//推送状态
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
public String getBillDate() {
|
||||
return billDate;
|
||||
}
|
||||
|
||||
public void setBillDate(String billDate) {
|
||||
this.billDate = billDate;
|
||||
}
|
||||
|
||||
public String getPrimalMoney() {
|
||||
return primalMoney;
|
||||
}
|
||||
|
||||
public void setPrimalMoney(String primalMoney) {
|
||||
this.primalMoney = primalMoney;
|
||||
}
|
||||
|
||||
public String getPkOppaccount() {
|
||||
return pkOppaccount;
|
||||
}
|
||||
|
||||
public void setPkOppaccount(String pkOppaccount) {
|
||||
this.pkOppaccount = pkOppaccount;
|
||||
}
|
||||
|
||||
public String getPkSupplier() {
|
||||
return pkSupplier;
|
||||
}
|
||||
|
||||
public void setPkSupplier(String pkSupplier) {
|
||||
this.pkSupplier = pkSupplier;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
<?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.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl">
|
||||
<resultMap id="get-PayBillEntity-result" type="com.hzya.frame.seeyon.paybill.entity.PayBillEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="billDate" column="bill_date" jdbcType="VARCHAR"/>
|
||||
<result property="primalMoney" column="primal_money" jdbcType="VARCHAR"/>
|
||||
<result property="pkOppaccount" column="pk_oppaccount" jdbcType="VARCHAR"/>
|
||||
<result property="pkSupplier" column="pk_supplier" jdbcType="VARCHAR"/>
|
||||
<result property="tableName" column="table_name" jdbcType="VARCHAR"/>
|
||||
<result property="fieldName" column="field_name" jdbcType="VARCHAR"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<!--工程项目查询-->
|
||||
<select id="PayBillEntity_list_base" resultMap="get-PayBillEntity-result" parameterType="com.hzya.frame.seeyon.paybill.entity.PayBillEntity">
|
||||
SELECT
|
||||
body.id as id,
|
||||
field0070 AS bill_date,
|
||||
field0057 AS primal_money,
|
||||
field0019 AS pk_oppaccount,
|
||||
field0082 AS pk_supplier,
|
||||
'formson_0222' as table_name,
|
||||
'field0084' as field_name
|
||||
FROM formmain_0093 main
|
||||
LEFT JOIN formson_0222 body ON main.id = body.formmain_id
|
||||
WHERE field0070 IS NOT null and field0084 is null
|
||||
union all
|
||||
SELECT
|
||||
body.id as id,
|
||||
field0073 AS bill_date,
|
||||
field0031 AS primal_money,
|
||||
field0042 AS pk_oppaccount,
|
||||
field0077 AS pk_supplier,
|
||||
'formson_0210' as table_name,
|
||||
'field0078' as field_name
|
||||
FROM formmain_0209 main
|
||||
LEFT JOIN formson_0210 body ON main.id = body.formmain_id
|
||||
WHERE field0073 IS NOT null and field0078 is null
|
||||
union all
|
||||
SELECT
|
||||
body.id as id,
|
||||
field0053 AS bill_date,
|
||||
field0041 AS primal_money,
|
||||
field0024 AS pk_oppaccount,
|
||||
field0057 AS pk_supplier,
|
||||
'formson_0223' as table_name,
|
||||
'field0058' as field_name
|
||||
FROM formmain_0094 main
|
||||
LEFT JOIN formson_0223 body ON main.id = body.formmain_id
|
||||
WHERE field0053 IS NOT NULL and field0058 is null
|
||||
</select>
|
||||
|
||||
<!--通过主键修改方法-->
|
||||
<update id="PayBillEntity_update" parameterType = "java.util.Map" >
|
||||
update ${tableName} set ${fieldName} = #{state} where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.seeyon.paybill.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
|
||||
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @content huoqu
|
||||
* @author laborer获取OA付款单数据并推送BIP生成付款结算单
|
||||
* @date 2024/6/20 0020 11:19
|
||||
*
|
||||
*/
|
||||
|
||||
public interface IPayBillService extends IBaseService<PaymentEntity,String> {
|
||||
/**
|
||||
*
|
||||
* @content 工程付款单数据同步BIP
|
||||
* @author laborer
|
||||
* @date 2024/6/20 0020 11:24
|
||||
*
|
||||
*/
|
||||
JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson);
|
||||
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package com.hzya.frame.seeyon.paybill.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.bip.v3.v2207.util.BipUtil;
|
||||
import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
|
||||
import com.hzya.frame.seeyon.paybill.dao.IPayBillDao;
|
||||
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
|
||||
import com.hzya.frame.seeyon.paybill.service.IPayBillService;
|
||||
import com.hzya.frame.seeyon.service.impl.SeeYonInterFaceImpl;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 付款单同步BIP
|
||||
* @author laborer
|
||||
* @date 2024/6/20 0020 15:20
|
||||
*
|
||||
*/
|
||||
|
||||
@Service("PayBillServiceImpl")
|
||||
public class PayBillServiceImpl extends BaseService<PaymentEntity,String> implements IPayBillService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(PayBillServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private IPayBillDao payBillDao;
|
||||
/**
|
||||
*
|
||||
* @content 工程付款单数据同步BIP
|
||||
* @author laborer
|
||||
* @date 2024/6/20 0020 11:24
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson) {
|
||||
PayBillEntity entity = new PayBillEntity();
|
||||
requestJson.put("db_code","OA");
|
||||
entity.setDataSourceCode(requestJson.getString("db_code"));
|
||||
List<PayBillEntity>payBillEntityList = payBillDao.getOaEngineerPay(entity);
|
||||
if(CollectionUtils.isNotEmpty(payBillEntityList)){
|
||||
for(PayBillEntity pay : payBillEntityList){
|
||||
String token = BipUtil.getBipToken("yonyou","8000230000");
|
||||
JSONObject main = bindingAdd(pay);
|
||||
logger.info("工程付款单调用中台生成BIP付款结算单推送报文{}",main.toString());
|
||||
String result = BipUtil.sendU9cTOBipEsb(main.toString(),"8000230014",token);
|
||||
logger.info("工程付款单调用中台生成BIP付款结算单返回结果{}",result);
|
||||
JSONObject resultObj = JSON.parseObject(result);
|
||||
boolean flag = resultObj.getBoolean("success");
|
||||
if(flag){
|
||||
pay.setState("Y");
|
||||
}else{
|
||||
pay.setState("N");
|
||||
}
|
||||
pay.setDataSourceCode(requestJson.getString("db_code"));
|
||||
payBillDao.updateState(pay);
|
||||
// todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JSONObject bindingAdd(PayBillEntity pay) {
|
||||
JSONObject head = new JSONObject();
|
||||
head.put("pk_org","");//所属组织
|
||||
head.put("pk_group","");//集团
|
||||
head.put("bill_type","F5");//单据类型 默认F5
|
||||
head.put("trade_type","D5");//付款结算类型 默认D5
|
||||
head.put("source_flag","2");//付款结算类型 默认2
|
||||
head.put("bill_date",pay.getBillDate());//单据日期
|
||||
head.put("primal_money",pay.getPrimalMoney());//付款原币金额
|
||||
head.put("pk_currtype","CNY");//币种
|
||||
head.put("billmaker","");//制单人
|
||||
//处理明细数据,按照明细付款 多个明细生成多个付款结算单
|
||||
JSONArray detailsArr = new JSONArray();
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("pk_org","");//所属组织
|
||||
body.put("pk_group","");//集团
|
||||
body.put("bill_type","F5");//单据类型 默认F5
|
||||
body.put("trade_type","D5");//付款结算类型 默认D5
|
||||
body.put("pk_currtype","CNY");//币种
|
||||
body.put("bill_date",pay.getBillDate());//单据日期
|
||||
body.put("pay_primal",pay.getPrimalMoney());//付款原币金额
|
||||
body.put("creationtime",pay.getBillDate());//创建时间
|
||||
body.put("direction","-1");//方向 :1=收;-1=付;
|
||||
body.put("objecttype","");//交易对象
|
||||
detailsArr.add(body);
|
||||
JSONObject main = new JSONObject();
|
||||
main.put("head",head);//表头
|
||||
main.put("body",detailsArr);//明细数据
|
||||
return main;
|
||||
}
|
||||
}
|
|
@ -2,10 +2,15 @@ package com.hzya.frame.sysnew.application.api.entity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.sysenum.SysEnum;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 应用api(SysApplicationApi)实体类
|
||||
|
@ -14,64 +19,64 @@ import com.hzya.frame.web.entity.BaseEntity;
|
|||
* @since 2023-09-22 16:23:27
|
||||
*/
|
||||
public class SysApplicationApiEntity extends BaseEntity {
|
||||
|
||||
/** 接口编码 */
|
||||
private Long apiCode;
|
||||
/** Api接口地址(固定系统内部外放接口地址) */
|
||||
private String apiPath;
|
||||
/** 1启用2停用 */
|
||||
private String apiStatus;
|
||||
/** api应用 */
|
||||
private String appId;
|
||||
/** api应用名称 */
|
||||
private String appName;
|
||||
/** api应用地址 **/
|
||||
private String appUrl;
|
||||
/** 目录 */
|
||||
private String catalogueId;
|
||||
/** 目录名称 */
|
||||
private String catalogueName;
|
||||
/** api名称 */
|
||||
private String apiName;
|
||||
/** api描述 */
|
||||
private String apiRemark;
|
||||
/** 是否需要登录 1、是 2、否 */
|
||||
private String needLogin;
|
||||
/** 认证接口 */
|
||||
private String authenticationPort;
|
||||
/** 传参方式 1、query 2、data */
|
||||
private String parameterPassingMode;
|
||||
/** 目标地址 */
|
||||
private String destinationAddress;
|
||||
/** 请求编码 1、UTF-8 */
|
||||
private String requestCoding;
|
||||
/** 请求方法 1、POST 2、GET */
|
||||
private String requestMethod;
|
||||
/** 超时时间 6000 ms */
|
||||
private String timeoutPeriod;
|
||||
/** 限流 6000 ms */
|
||||
private String currentLimiting;
|
||||
/** Header入参 JSON */
|
||||
private String headerIn;
|
||||
/** Query入参 JSON */
|
||||
private String queryIn;
|
||||
/** Body 入参类型 1、Application/json */
|
||||
private String bodyInType;
|
||||
/** Body 入参 JSON */
|
||||
private String bodyIn;
|
||||
/** Body 出参 JSON */
|
||||
private String bodyOut;
|
||||
/** bean名称 */
|
||||
private String beanName;
|
||||
/** 方法名称 */
|
||||
private String funName;
|
||||
/** 是否扩展api 1、启用 2、停用*/
|
||||
private String extensionApi;
|
||||
|
||||
/** 返回成功字段 */
|
||||
private String returnSuccessField;
|
||||
/** 返回成功值*/
|
||||
private String returnSuccessValue;
|
||||
/** 接口编码 */
|
||||
private Long apiCode;
|
||||
/** Api接口地址(固定系统内部外放接口地址) */
|
||||
private String apiPath;
|
||||
/** 1启用2停用 */
|
||||
private String apiStatus;
|
||||
/** api应用 */
|
||||
private String appId;
|
||||
/** api应用名称 */
|
||||
private String appName;
|
||||
/** api应用地址 **/
|
||||
private String appUrl;
|
||||
/** 目录 */
|
||||
private String catalogueId;
|
||||
/** 目录名称 */
|
||||
private String catalogueName;
|
||||
/** api名称 */
|
||||
private String apiName;
|
||||
/** api描述 */
|
||||
private String apiRemark;
|
||||
/** 是否需要登录 1、是 2、否 */
|
||||
private String needLogin;
|
||||
/** 认证接口 */
|
||||
private String authenticationPort;
|
||||
/** 传参方式 1、query 2、data */
|
||||
private String parameterPassingMode;
|
||||
/** 目标地址 */
|
||||
private String destinationAddress;
|
||||
/** 请求编码 1、UTF-8 */
|
||||
private String requestCoding;
|
||||
/** 请求方法 1、POST 2、GET */
|
||||
private String requestMethod;
|
||||
/** 超时时间 6000 ms */
|
||||
private String timeoutPeriod;
|
||||
/** 限流 6000 ms */
|
||||
private String currentLimiting;
|
||||
/** Header入参 JSON */
|
||||
private String headerIn;
|
||||
/** Query入参 JSON */
|
||||
private String queryIn;
|
||||
/** Body 入参类型 1、Application/json */
|
||||
private String bodyInType;
|
||||
/** Body 入参 JSON */
|
||||
private String bodyIn;
|
||||
/** Body 出参 JSON */
|
||||
private String bodyOut;
|
||||
/** bean名称 */
|
||||
private String beanName;
|
||||
/** 方法名称 */
|
||||
private String funName;
|
||||
/** 是否扩展api 1、启用 2、停用*/
|
||||
private String extensionApi;
|
||||
|
||||
/** 返回成功字段 */
|
||||
private String returnSuccessField;
|
||||
/** 返回成功值*/
|
||||
private String returnSuccessValue;
|
||||
/** 返回描述字段*/
|
||||
private String returnMsg;
|
||||
|
||||
|
@ -307,37 +312,9 @@ public class SysApplicationApiEntity extends BaseEntity {
|
|||
this.appUrl = appUrl;
|
||||
}
|
||||
|
||||
public List<JSONObject> getHeaderInValue() {
|
||||
List<JSONObject> jsonObjects = new ArrayList<>();
|
||||
if(headerIn != null && !"".equals(headerIn)){
|
||||
JSONArray headers = JSONArray.parseArray(headerIn);
|
||||
if(headers != null && headers.size() > 0){
|
||||
for (int i = 0; i < headers.size(); i++) {
|
||||
JSONObject object = new JSONObject();
|
||||
object.put(headers.getJSONObject(i).getString("parameterName"),headers.getJSONObject(i).getString("example"));
|
||||
jsonObjects.add(object);
|
||||
}
|
||||
}
|
||||
}
|
||||
return jsonObjects;
|
||||
}
|
||||
|
||||
public String getQueryInValue() {
|
||||
StringBuffer jsonObjects = new StringBuffer();
|
||||
if(queryIn != null && !"".equals(queryIn)){
|
||||
JSONArray querys = JSONArray.parseArray(queryIn);
|
||||
if(querys != null && querys.size() > 0){
|
||||
for (int i = 0; i < querys.size(); i++) {
|
||||
if(i != 0){
|
||||
jsonObjects.append("&");
|
||||
}
|
||||
jsonObjects.append(querys.getJSONObject(i).getString("parameterName"));
|
||||
jsonObjects.append("=");
|
||||
jsonObjects.append(querys.getJSONObject(i).getString("example"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return jsonObjects.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1770,6 +1770,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
sysExtensionApiEntity = (SysExtensionApiEntity) m.invoke(object, sysExtensionApiEntity);
|
||||
logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
logger.error("invokeException{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("内部方法执行错误,请联系管理员");
|
||||
|
@ -2051,11 +2052,11 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
* @Date 11:36 上午 2023/10/20
|
||||
**/
|
||||
private SysMessageManageLogEntity saveLog(SysApplicationEntity sendApp, SysApplicationEntity receiveApp, SysApplicationApiEntity receiveApi,
|
||||
String oldbodys,String bodys,
|
||||
Map<String, String> oldheaderMap,Map<String, String> headerMap,
|
||||
Map<String, String> headers,
|
||||
String oldquerys, String querys,
|
||||
String body, boolean flag,String msg) {
|
||||
String oldbodys,String bodys,
|
||||
Map<String, String> oldheaderMap,Map<String, String> headerMap,
|
||||
Map<String, String> headers,
|
||||
String oldquerys, String querys,
|
||||
String body, boolean flag,String msg) {
|
||||
SysMessageManageLogEntity sysMessageManageLogEntity = new SysMessageManageLogEntity();
|
||||
//messageManageId 消息主表主键
|
||||
//theme 消息主题
|
||||
|
@ -2378,10 +2379,10 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
mdmModuleDistributeEntity.setAddScript(entity.getId());
|
||||
mdmModuleDistributeEntity.setUpdateScript(entity.getId());
|
||||
mdmModuleDistributeEntity.setDeleteScript(entity.getId());
|
||||
Integer a = mdmModuleDistributeDao.queryCountUse(mdmModuleDistributeEntity);
|
||||
if(a > 0){
|
||||
return BaseResult.getFailureMessageEntity("脚本已经被使用,请先取消关联");
|
||||
}
|
||||
Integer a = mdmModuleDistributeDao.queryCountUse(mdmModuleDistributeEntity);
|
||||
if(a > 0){
|
||||
return BaseResult.getFailureMessageEntity("脚本已经被使用,请先取消关联");
|
||||
}
|
||||
entity.setUpdate();
|
||||
sysApplicationScriptDao.logicRemoveMultiCondition(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除脚本成功");
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.sysnew.comparison.masterData.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
public interface IMasterDataCustoMermanageService extends IBaseService<ComparisonEntity, String> {
|
||||
/**
|
||||
*
|
||||
* @content 查询客户档案同步中台主数据中心
|
||||
* @author laborer
|
||||
* @date 2024/6/20 0020 9:54
|
||||
*
|
||||
*/
|
||||
|
||||
JsonResultEntity queryCustoMermanageArchives(JSONObject jsonObject);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.sysnew.comparison.masterData.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
public interface IMasterDataMemberService extends IBaseService<ComparisonEntity, String> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 查询项目档案
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/6/6 16:10
|
||||
* **/
|
||||
JsonResultEntity queryMemberArchives(JSONObject jsonObject);
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
package com.hzya.frame.sysnew.comparison.masterData.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.dateutil.DateUtil;
|
||||
import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl;
|
||||
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataCustoMermanageService;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService;
|
||||
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service("MasterDataCustoMermanageServiceImpl")
|
||||
public class MasterDataCustoMermanageServiceImpl extends BaseService<ComparisonEntity, String> implements IMasterDataCustoMermanageService {
|
||||
|
||||
@Autowired
|
||||
private MasterDataDaoImpl masterDataDaoImpl;
|
||||
@Autowired
|
||||
private ComparisonServiceImpl comparisonServiceimpl;
|
||||
@Autowired
|
||||
private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl;
|
||||
|
||||
private String ts = "";
|
||||
|
||||
//同步客户档案到主数据
|
||||
public JsonResultEntity queryCustoMermanageArchives(JSONObject json){
|
||||
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||
//查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码
|
||||
List<MdmModuleSourceEntity> list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码");
|
||||
return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
|
||||
}
|
||||
for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
|
||||
//通过不同的应用类型用于拼接sql
|
||||
String appTyp = mdmModuleSourceEntity.getAppType();
|
||||
String dbCode = mdmModuleSourceEntity.getDbCode();
|
||||
switch (appTyp) {
|
||||
case "1":
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){
|
||||
String code = jsonObject.getString("code");
|
||||
sb.append(" and a.code = '"+code+"'");
|
||||
}else{
|
||||
ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
sb.append(" and a.update_time >= '"+ts+"'");
|
||||
}
|
||||
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 WHERE 1=1 AND id = '1706533959075383844' " );
|
||||
|
||||
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
||||
try {
|
||||
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
||||
logger.info("查询出来的值为:{}",hashMaps);
|
||||
if (null != hashMaps && hashMaps.size() > 0) {
|
||||
ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10004");
|
||||
} else {
|
||||
logger.info("U8C主数据档案客商档案没有需要同步中台的数据");
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("查询主数据档案客商档案错误:{}", e.getMessage());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("客商档案同步成功");
|
||||
}
|
||||
|
||||
|
||||
//查询档案参数组装
|
||||
public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List<HashMap<String, Object>> hashMaps,String mdmCode){
|
||||
for (HashMap<String, Object> hashMap : hashMaps) {
|
||||
JSONObject jsonObjectUser = new JSONObject();
|
||||
JSONObject jsonStr = new JSONObject();
|
||||
jsonObjectUser.put("id", hashMap.get("id"));
|
||||
jsonObjectUser.put("mdmCode", mdmCode);
|
||||
jsonStr.put("jsonStr", jsonObjectUser);
|
||||
//查询明细信息
|
||||
Long formmainId = (Long) hashMap.get("id");
|
||||
StringBuffer stringBufferDetails = new StringBuffer();
|
||||
stringBufferDetails.append("SELECT field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " );
|
||||
List<HashMap<String, Object>> hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity);
|
||||
//先查询编码和名称查询是否存在
|
||||
JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr);
|
||||
Object attribute = jsonResultEntity.getAttribute();
|
||||
logger.info("得到的attribute值为:{}", attribute);
|
||||
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
|
||||
JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list");
|
||||
//如果jsonArrayList为null,说明没有值,在表中不存在
|
||||
if (jsonArrayList == null || jsonArrayList.size() == 0) {
|
||||
//将查询出来得数据调用通用接口新增,保存到表中
|
||||
JSONObject main = new JSONObject();
|
||||
for(String key:hashMap.keySet()) {
|
||||
main.put(key, hashMap.get(key));
|
||||
}
|
||||
jsonObjectUser.put("main", main);
|
||||
jsonObjectUser.put("details", hashMapsDetails);
|
||||
jsonObjectUser.put("appName","数智中台");
|
||||
jsonObjectUser.put("appCode","800004");
|
||||
jsonObjectUser.put("optionName", "数智中台");
|
||||
jsonStr.put("jsonStr", jsonObjectUser);
|
||||
try {
|
||||
comparisonServiceimpl.saveEntity(jsonStr);
|
||||
} catch (Exception e) {
|
||||
logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage());
|
||||
}
|
||||
} else {
|
||||
for (Object o : jsonArrayList) {
|
||||
JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o));
|
||||
String id = jsonObjectUpdate.getString("id");
|
||||
JSONObject main = new JSONObject();
|
||||
for(String key:hashMap.keySet()) {
|
||||
main.put(key, hashMap.get(key));
|
||||
main.put("id",id);
|
||||
}
|
||||
jsonObjectUser.put("main", main);
|
||||
jsonObjectUser.put("appName","数智中台");
|
||||
jsonObjectUser.put("appCode","800004");
|
||||
jsonObjectUser.put("optionName", "数智中台");
|
||||
jsonStr.put("jsonStr", jsonObjectUser);
|
||||
try {
|
||||
comparisonServiceimpl.updateEntity(jsonStr);
|
||||
} catch (Exception e) {
|
||||
logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,144 @@
|
|||
package com.hzya.frame.sysnew.comparison.masterData.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.dateutil.DateUtil;
|
||||
import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl;
|
||||
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataMemberService;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService;
|
||||
import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service("MasterDataMemberServiceImpl")
|
||||
public class MasterDataMemberServiceImpl extends BaseService<ComparisonEntity, String> implements IMasterDataMemberService {
|
||||
|
||||
@Autowired
|
||||
private MasterDataDaoImpl masterDataDaoImpl;
|
||||
@Autowired
|
||||
private ComparisonServiceImpl comparisonServiceimpl;
|
||||
@Autowired
|
||||
private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl;
|
||||
|
||||
private String ts = "";
|
||||
|
||||
//同步用户信息到主数据
|
||||
public JsonResultEntity queryMemberArchives(JSONObject json){
|
||||
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||
//查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码
|
||||
List<MdmModuleSourceEntity> list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码");
|
||||
return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
|
||||
}
|
||||
|
||||
for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
|
||||
//通过不同的应用类型用于拼接sql
|
||||
String appTyp = mdmModuleSourceEntity.getAppType();
|
||||
String dbCode = mdmModuleSourceEntity.getDbCode();
|
||||
switch (appTyp) {
|
||||
case "1":
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){
|
||||
String code = jsonObject.getString("code");
|
||||
sb.append(" and a.code = '"+code+"'");
|
||||
}else{
|
||||
ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
sb.append(" and a.update_time >= '"+ts+"'");
|
||||
}
|
||||
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select a.id as id, a.name as user_name, e.LOGIN_NAME as user_code FROM org_member a left join org_principal e on a.id = e.MEMBER_ID" +
|
||||
" WHERE 1=1 " + sb.toString());
|
||||
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
||||
try {
|
||||
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
||||
logger.info("查询出来的值为:{}",hashMaps);
|
||||
if (null != hashMaps && hashMaps.size() > 0) {
|
||||
ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10003");
|
||||
} else {
|
||||
logger.info("U8C主数据用户档案没有需要同步中台的数据");
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("查询主数据档案用户档案错误:{}", e.getMessage());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("用户档案同步成功");
|
||||
}
|
||||
|
||||
|
||||
//查询档案参数组装
|
||||
public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List<HashMap<String, Object>> hashMaps,String mdmCode){
|
||||
for (HashMap<String, Object> hashMap : hashMaps) {
|
||||
JSONObject jsonObjectUser = new JSONObject();
|
||||
JSONObject jsonStr = new JSONObject();
|
||||
jsonObjectUser.put("id", hashMap.get("id"));
|
||||
jsonObjectUser.put("mdmCode", mdmCode);
|
||||
jsonStr.put("jsonStr", jsonObjectUser);
|
||||
//先查询编码和名称查询是否存在
|
||||
JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr);
|
||||
Object attribute = jsonResultEntity.getAttribute();
|
||||
logger.info("得到的attribute值为:{}", attribute);
|
||||
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
|
||||
JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list");
|
||||
//如果jsonArrayList为null,说明没有值,在表中不存在
|
||||
if (jsonArrayList == null || jsonArrayList.size() == 0) {
|
||||
//将查询出来得数据调用通用接口新增,保存到表中
|
||||
JSONObject main = new JSONObject();
|
||||
for(String key:hashMap.keySet()) {
|
||||
main.put(key, hashMap.get(key));
|
||||
}
|
||||
jsonObjectUser.put("main", main);
|
||||
jsonObjectUser.put("appName","数智中台");
|
||||
jsonObjectUser.put("appCode","800004");
|
||||
jsonObjectUser.put("optionName", "数智中台");
|
||||
jsonStr.put("jsonStr", jsonObjectUser);
|
||||
try {
|
||||
comparisonServiceimpl.saveEntity(jsonStr);
|
||||
} catch (Exception e) {
|
||||
logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage());
|
||||
}
|
||||
} else {
|
||||
for (Object o : jsonArrayList) {
|
||||
JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o));
|
||||
String id = jsonObjectUpdate.getString("id");
|
||||
JSONObject main = new JSONObject();
|
||||
for(String key:hashMap.keySet()) {
|
||||
main.put(key, hashMap.get(key));
|
||||
main.put("id",id);
|
||||
}
|
||||
jsonObjectUser.put("main", main);
|
||||
jsonObjectUser.put("appName","数智中台");
|
||||
jsonObjectUser.put("appCode","800004");
|
||||
jsonObjectUser.put("optionName", "数智中台");
|
||||
jsonStr.put("jsonStr", jsonObjectUser);
|
||||
try {
|
||||
comparisonServiceimpl.updateEntity(jsonStr);
|
||||
} catch (Exception e) {
|
||||
logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -61,6 +61,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
return BaseResult.getFailureMessageEntity("主数据编码为空");
|
||||
}
|
||||
ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class);
|
||||
ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity();
|
||||
List<ComparisonEntity> comparisonEntities=new ArrayList<>();
|
||||
try {
|
||||
//根据主数据编码查询表名称,字段名称等信息 10001
|
||||
|
@ -85,12 +86,32 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
map.remove("appCode");
|
||||
}
|
||||
}
|
||||
if (entity.getDbType().equals("2")) {
|
||||
comparisonDetailsEntity.setDbName(entity.getDbName());
|
||||
}
|
||||
}
|
||||
}
|
||||
comparisonEntity.setMap(map);
|
||||
try {
|
||||
List<JSONObject> list=new ArrayList<>();
|
||||
//查询主表数据
|
||||
List<Map<String,Object>> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity);
|
||||
PageInfo pageInfo = new PageInfo(comparisonEntitiePages);
|
||||
if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){
|
||||
for (Map<String, Object> comparisonEntitiePage : comparisonEntitiePages) {
|
||||
JSONObject jsonObjects=new JSONObject();
|
||||
jsonObjects.put(comparisonEntity.getDbName(),comparisonEntitiePage);
|
||||
comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("id")));
|
||||
//查询明细表数据
|
||||
List<Map<String, Object>> maps = comparisonDetailsDao.queryComparisonDetailsPage(comparisonDetailsEntity);
|
||||
if(CollectionUtils.isNotEmpty(maps)){
|
||||
jsonObjects.put(comparisonDetailsEntity.getDbName(),maps);
|
||||
}else {
|
||||
jsonObjects.put(comparisonDetailsEntity.getDbName(),new JSONArray());
|
||||
}
|
||||
list.add(jsonObjects);
|
||||
}
|
||||
}
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return BaseResult.getSuccessMessageEntity("查询成功", pageInfo);
|
||||
} catch (Exception e) {
|
||||
logger.info("查询通用数据错误:{}", e.getMessage());
|
||||
|
@ -137,13 +158,13 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||
Map<String, Object> mapDetails = new HashMap<>();//将子表数据存到map中
|
||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||
map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity);
|
||||
mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray);
|
||||
String uuid=null;
|
||||
if(jsonObjectMain.getString("id")==null){
|
||||
map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity);
|
||||
mapDetails = spliceDetailMap(comparisonEntities, mapDetails, comparisonDetailsEntity, jsonArray);
|
||||
String uuid = null;
|
||||
if (jsonObjectMain.getString("id") == null) {
|
||||
uuid = UUIDUtils.getUUID();
|
||||
map.put("id", uuid);
|
||||
}else{
|
||||
} else {
|
||||
uuid = jsonObjectMain.getString("id");
|
||||
map.put("id", jsonObjectMain.getString("id"));
|
||||
}
|
||||
|
@ -153,47 +174,48 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
map.put("create_time", new Date());
|
||||
map.put("modify_time", new Date());
|
||||
map.put("sts", "Y");
|
||||
map.put("data_status","Y");//新增状态
|
||||
map.put("add_status","0");//新增状态
|
||||
map.put("update_status","1");//修改状态
|
||||
map.put("delete_status","1");//删除状态
|
||||
map.put("data_status", "Y");//新增状态
|
||||
map.put("add_status", "0");//新增状态
|
||||
map.put("update_status", "1");//修改状态
|
||||
map.put("delete_status", "1");//删除状态
|
||||
ComparisonEntity comparisonEntityRule = comparisonEntities.get(0);
|
||||
//查询单据规则
|
||||
//查询单据规则 只查询主表得,明细表不用
|
||||
try {
|
||||
comparisonEntityRule= comparisonDao.queryComparisonById(comparisonEntityRule);
|
||||
String documentRule =comparisonEntityRule.getDocumentRule();; //"KH-2024-05-30-1";
|
||||
logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}",documentRule);
|
||||
if(documentRule !=null){
|
||||
ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule);
|
||||
String documentRule = comparisonEntityRules.getDocumentRule();
|
||||
; //"KH-2024-05-30-1";
|
||||
logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule);
|
||||
if (documentRule != null) {
|
||||
//获取规则前缀 CK
|
||||
String rulePrefix=documentRule.substring(0,documentRule.indexOf("-"));
|
||||
String rulePrefix = documentRule.substring(0, documentRule.indexOf("-"));
|
||||
//获取规则中间日期 yyyy-MM-dd
|
||||
String ruleDate = documentRule.substring(documentRule.indexOf("-") + 1, documentRule.lastIndexOf("-"));
|
||||
String ruleMiddle = getRuleDate(ruleDate);
|
||||
//获取规则后缀
|
||||
String ruleSuffixLength= documentRule.substring(documentRule.lastIndexOf("-")+1);
|
||||
String ruleSuffixLength = documentRule.substring(documentRule.lastIndexOf("-") + 1);
|
||||
int ruleSuffix = ruleSuffixLength.length();
|
||||
//生成单据规则
|
||||
comparisonEntity.setRulePrefix(rulePrefix);
|
||||
comparisonEntity.setRuleMiddle(ruleMiddle);
|
||||
comparisonEntity.setRuleSuffix(ruleSuffix);
|
||||
comparisonEntityRule.setRulePrefix(rulePrefix);
|
||||
comparisonEntityRule.setRuleMiddle(ruleMiddle);
|
||||
comparisonEntityRule.setRuleSuffix(ruleSuffix);
|
||||
try {
|
||||
//新生成单据规则保存到数据库
|
||||
comparisonEntityRule = comparisonDao.queryComparisonRule(comparisonEntity);
|
||||
map.put("document_rule", comparisonEntityRule.getDocumentRule());//单据规则
|
||||
map.put("document_rule_num", comparisonEntityRule.getDocumentRuleNum());//单据规则流水号
|
||||
comparisonEntity.setMap(map);
|
||||
ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule);
|
||||
map.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则
|
||||
map.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号
|
||||
comparisonEntityRule.setMap(map);
|
||||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("保存失败");
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("通用数据保存接口中查询单据规则错误:{}",e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.info("通用数据保存接口中查询单据规则错误:{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("保存失败");
|
||||
}
|
||||
try {
|
||||
//保存主表数据
|
||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntity);
|
||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule);
|
||||
//保存子表数据
|
||||
if (mapDetails != null && mapDetails.size() > 0) {
|
||||
String uuidDetail = UUIDUtils.getUUID();
|
||||
|
@ -211,10 +233,10 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
//comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne);
|
||||
map.put("details",mapDetails);
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||
//controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||
}
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
||||
return BaseResult.getSuccessMessageEntity("保存成功", map);
|
||||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候错误:{}", e.getMessage());
|
||||
|
@ -296,7 +318,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
comparisonDetailsEntity.setMapDetails(mapDetails);
|
||||
comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity);
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||
// controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||
}
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||
|
@ -368,7 +390,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id"));
|
||||
comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity);
|
||||
controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||
// controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||
}
|
||||
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||
return BaseResult.getSuccessMessageEntity("删除成功",integer);
|
||||
|
|
|
@ -22,5 +22,5 @@ public interface IGroovyIntegrationService {
|
|||
* @param jsonObject 请求参数对象
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
SysExtensionApiEntity groovyScriptExecution(JSONObject jsonObject);
|
||||
Object groovyScriptExecution(JSONObject jsonObject);
|
||||
}
|
||||
|
|
|
@ -25,39 +25,84 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
|
|||
|
||||
|
||||
@Override
|
||||
public SysExtensionApiEntity groovyScriptExecution(JSONObject jsonObject) {
|
||||
public Object groovyScriptExecution(JSONObject jsonObject) {
|
||||
Object object = GroovyUtil.execute(jsonObject);
|
||||
return new SysExtensionApiEntity();
|
||||
return object;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
java.lang.String str = "{\"project_org\":\"\",\"modify_time\":\"2024-06-17 16:52:34\",\"project_duty_dept\":null,\"project_name\":\"凯伍德组织档案\",\"document_rule_num\":1,\"add_status\":\"0\",\"delete_status\":\"1\",\"project_dutier\":\"\",\"id\":\"fb12734c8267488b96833633e68a7abc\",\"data_status\":\"F\",\"modify_user_id\":\"c796fd9ba4c9f5ff3cc2fa41a040e443\",\"sorts\":1,\"project_memo\":\"\",\"document_rule\":\"XM-2024-06-17-00001\",\"create_user_id\":\"c796fd9ba4c9f5ff3cc2fa41a040e443\",\"create_time\":\"2024-06-17 16:42:18\",\"company_id\":null,\"project_sh_name\":\"\",\"project_code\":\"01004\",\"project_currtype\":\"\",\"update_status\":\"0\",\"sts\":\"Y\",\"org_id\":\"0\",\"project_parentpro\":\"\",\"project_bill_type\":\"\"}";
|
||||
|
||||
java.lang.String str = "{\"data\":{\"pk_group\":\"00\",\"enablestate\":\"2\",\"code\":\"20240621001\",\"modify_time\":1718935555000,\"document_rule_num\":2,\"mdm_customer_bank\":[],\"add_status\":\"0\",\"custprop\":\"0\",\"delete_status\":\"1\",\"custstate\":\"1\",\"id\":\"d3d20ea680dc4bffaa7e5bf84764d62a\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":24,\"document_rule\":\"KH-2024-06-21-00002\",\"create_user_id\":\"1\",\"create_time\":1718935555000,\"company_id\":\"Y\",\"pk_country\":\"CN\",\"update_status\":\"1\",\"sts\":\"Y\",\"pk_custclass\":\"K01\",\"org_id\":\"Y\",\"name\":\"测试下发客户\",\"taxpayerid\":\"087982419238904359\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"500\\\",\\\"index\\\":0,\\\"concreteType\\\":\\\"String\\\",\\\"description\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNR\\\",\\\"id\\\":\\\"421b73f0-5562-4bfe-b770-c8aca8878bfd\\\",\\\"parameterName\\\":\\\"pubKey\\\",\\\"required\\\":true,\\\"example\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNREgMNeOEOwlvM2iqqEfshDadRHziDSB2PbRnoMqSv1nGr3XBlZuseNj5HmxDEkLhOdfyw0yjzoz3wK7XhFpeN4Iyf7NT7hps5jAQMEpnul9Qwmj5qUr/eK5SaO9H8n7sh9BvCdrX9oRUh+U2/ceA3O+y/MUHk5DRvSadc8FhpqbOaNBbAzPnyYAwpVUPvaJ90jcGN1ZG99HR1GEzC+Cn9s6vgt7dYL6ysMs36bSP47xraDSxpfr0CLwa6JV/9KjLIeqL1ZaMtK0CJ1zJGCBA6O6kgxeE9Ul7q2lSS6mPAEJ78izaTYsrjhLpKT+eTtFBOLFbiCrbLp8tVE5kwIDAQAB\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":1,\\\"concreteType\\\":\\\"String\\\",\\\"description\\\":\\\"OA\\\",\\\"id\\\":\\\"5659424d-261d-43ed-9fff-657bd15c7a64\\\",\\\"parameterName\\\":\\\"client_id\\\",\\\"required\\\":true,\\\"example\\\":\\\"OA\\\"},{\\\"parameterType\\\":\\\"authport\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"d2c4477e-a0bb-4daa-97b4-3cf0b8445001\\\",\\\"parameterName\\\":\\\"access_token\\\",\\\"required\\\":true,\\\"example\\\":[\\\"attribute\\\",\\\"data\\\",\\\"access_token\\\"]}]\",\"body\":\"[{\\\"index\\\":0,\\\"id\\\":\\\"5ac44a3b-c0d5-4ae9-aec6-af6c4c8f59cc\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}";
|
||||
java.lang.String str1 = "com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();\n" +
|
||||
" com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject();\n" +
|
||||
"\n" +
|
||||
" com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);\n" +
|
||||
" com.alibaba.fastjson.JSONObject data = reqData.getJSONObject(\"data\");\n" +
|
||||
" com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();\n" +
|
||||
" ufinterfaceObject.put(\"billtype\", \"customer\");\n" +
|
||||
" ufinterfaceObject.put(\"isexchange\", \"Y\");\n" +
|
||||
" ufinterfaceObject.put(\"replace\", \"Y\");\n" +
|
||||
" ufinterfaceObject.put(\"sender\", \"OA\");\n" +
|
||||
" ufinterfaceObject.put(\"account\", \"01\");\n" +
|
||||
" ufinterfaceObject.put(\"groupcode\", \"00\");\n" +
|
||||
" com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();\n" +
|
||||
" com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();\n" +
|
||||
" billheadObject.put(\"code\", data.get(\"code\"));\n" +
|
||||
" billheadObject.put(\"custprop\", data.get(\"custprop\"));\n" +
|
||||
" billheadObject.put(\"custstate\", data.get(\"custstate\"));\n" +
|
||||
" billheadObject.put(\"pk_custclass\", data.get(\"pk_custclass\"));\n" +
|
||||
" billheadObject.put(\"pk_country\", data.get(\"pk_country\"));\n" +
|
||||
" billheadObject.put(\"pk_timezone\", \"P0800\");\n" +
|
||||
" billheadObject.put(\"pk_format\", \"ZH-CN\");\n" +
|
||||
" billheadObject.put(\"enablestate\", data.get(\"enablestate\"));\n" +
|
||||
" billheadObject.put(\"name\", data.get(\"name\"));\n" +
|
||||
" billheadObject.put(\"pk_group\", data.get(\"pk_group\"));\n" +
|
||||
" billheadObject.put(\"pk_org\", data.get(\"pk_org\"));\n" +
|
||||
" billheadObject.put(\"taxpayerid\", data.get(\"taxpayerid\"));\n" +
|
||||
" billObject.put(\"billhead\", billheadObject);\n" +
|
||||
" ufinterfaceObject.put(\"bill\", billObject);\n" +
|
||||
" bodys.put(\"ufinterface\", ufinterfaceObject);\n" +
|
||||
" returnObject.put(\"bodys\",bodys.toJSONString());\n" +
|
||||
" return returnObject.toJSONString();".trim();
|
||||
String newString =str1.replaceAll("\\s+", "");
|
||||
A88772 s = new A88772();
|
||||
s .execute(str);
|
||||
s.execute(str);
|
||||
}
|
||||
|
||||
static class A88772 {
|
||||
String execute(String jsonStr) {
|
||||
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
|
||||
String execute(String jsonStr) {
|
||||
com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();
|
||||
com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject();
|
||||
|
||||
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
|
||||
com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data");
|
||||
com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();
|
||||
ufinterfaceObject.put("billtype", "supplier"); ufinterfaceObject.put("isexchange", "Y");
|
||||
ufinterfaceObject.put("replace", "Y"); ufinterfaceObject.put("sender", "OA");
|
||||
ufinterfaceObject.put("account", "01"); ufinterfaceObject.put("groupcode", "00");
|
||||
ufinterfaceObject.put("billtype", "customer");
|
||||
ufinterfaceObject.put("isexchange", "Y");
|
||||
ufinterfaceObject.put("replace", "Y");
|
||||
ufinterfaceObject.put("sender", "OA");
|
||||
ufinterfaceObject.put("account", "01");
|
||||
ufinterfaceObject.put("groupcode", "00");
|
||||
com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();
|
||||
com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();
|
||||
billheadObject.put("code", reqData.get("project_code")); billheadObject.put("supprop", "0");
|
||||
billheadObject.put("custstate", "1"); billheadObject.put("pk_supplierclass", "S01");
|
||||
billheadObject.put("pk_country", "CN"); billheadObject.put("pk_timezone", "P0800");
|
||||
billheadObject.put("pk_format", "ZH-CN"); billheadObject.put("enablestate", "2");
|
||||
billheadObject.put("name", reqData.get("project_sh_name")); billheadObject.put("pk_group", "00");
|
||||
billheadObject.put("pk_org", "003"); billheadObject.put("taxpayerid", "087981489021135119");
|
||||
returnObject.put("ufinterface",ufinterfaceObject); billObject.put("billhead", billheadObject); returnObject.put("bill",billObject);
|
||||
System.out.println( returnObject.toJSONString());
|
||||
billheadObject.put("code", data.get("code"));
|
||||
billheadObject.put("custprop", data.get("custprop"));
|
||||
billheadObject.put("custstate", data.get("custstate"));
|
||||
billheadObject.put("pk_custclass", data.get("pk_custclass"));
|
||||
billheadObject.put("pk_country", data.get("pk_country"));
|
||||
billheadObject.put("pk_timezone", "P0800");
|
||||
billheadObject.put("pk_format", "ZH-CN");
|
||||
billheadObject.put("enablestate", data.get("enablestate"));
|
||||
billheadObject.put("name", data.get("name"));
|
||||
billheadObject.put("pk_group", data.get("pk_group"));
|
||||
billheadObject.put("pk_org", data.get("pk_org"));
|
||||
billheadObject.put("taxpayerid", data.get("taxpayerid"));
|
||||
billObject.put("billhead", billheadObject);
|
||||
ufinterfaceObject.put("bill", billObject);
|
||||
bodys.put("ufinterface", ufinterfaceObject);
|
||||
returnObject.put("bodys",bodys.toJSONString());
|
||||
return returnObject.toJSONString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class AxServiceImpl extends BaseService<ArchivesEntity, String> implement
|
|||
this.axDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
@Value("${ax.url}")
|
||||
@Value("${zt.url}")
|
||||
private String voucherUrl;
|
||||
private final String publicKey = "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj";
|
||||
private final String secretKey = "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=";
|
||||
|
|
Loading…
Reference in New Issue