广脉:1、新增动态查询u8c数据
This commit is contained in:
parent
500bf1e322
commit
10c49cb967
|
@ -4,12 +4,12 @@ import cn.hutool.core.lang.Assert;
|
|||
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdAccsubjDao;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdBdinfoDao;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdOrgBookVODao;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.AccsubjTreeNode;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdAccsubjEntity;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.AeConfBdBdinfoEntity;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.OrgBookVO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IU8CQueryVODAO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.*;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.utils.AccsubjTreeBuilder;
|
||||
import com.hzya.frame.voucher.constant.ProfilesActiveConstant;
|
||||
import com.hzya.frame.web.action.DefaultController;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
@ -17,7 +17,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-06-04 15:04
|
||||
|
@ -32,6 +34,8 @@ public class BdController extends DefaultController {
|
|||
private IAeConfBdBdinfoDao aeConfBdBdinfoDao;
|
||||
@Autowired
|
||||
private IAeConfBdAccsubjDao aeConfBdAccsubjDao;
|
||||
@Autowired
|
||||
private IU8CQueryVODAO u8CQueryVODAO;
|
||||
|
||||
/**
|
||||
* 查询所有公司账簿信息
|
||||
|
@ -67,7 +71,7 @@ public class BdController extends DefaultController {
|
|||
@RequestMapping(value = "/queryAccSubjByOrgBookId", method = RequestMethod.POST)
|
||||
public JsonResultEntity queryAccSubjByOrgBookId(@RequestBody AeConfBdAccsubjEntity entity) {
|
||||
try {
|
||||
Assert.notNull(entity.getPkGlorgbook(),"查询科目表时,账簿id不允许为空");
|
||||
Assert.notNull(entity.getPkGlorgbook(), "查询科目表时,账簿id不允许为空");
|
||||
List<AeConfBdAccsubjEntity> all = aeConfBdAccsubjDao.query(entity);
|
||||
List<AccsubjTreeNode> tree = AccsubjTreeBuilder.buildTree(all);
|
||||
return getSuccessMessageEntity("请求成功", tree);
|
||||
|
@ -77,4 +81,25 @@ public class BdController extends DefaultController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询基础数据数据表
|
||||
*/
|
||||
@RequestMapping(value = "/queryDataByMap", method = RequestMethod.POST)
|
||||
public JsonResultEntity queryDataByMap(@RequestBody HashMap<String, String> map) {
|
||||
try {
|
||||
if(map.get("tablename")==null||"".equals(map.get("tablename"))){
|
||||
return getSuccessMessageEntity("请求成功", null);
|
||||
}
|
||||
//查询u8c数据库
|
||||
U8CQueryVO u8CQueryVO = new U8CQueryVO();
|
||||
u8CQueryVO.setDataSourceCode(ProfilesActiveConstant.LETS_PROD_DATE_SOURCE);
|
||||
u8CQueryVO.setTablename(map.get("tablename"));
|
||||
List<Map<String, Object>> objectList = u8CQueryVODAO.queryU8CBD(u8CQueryVO);
|
||||
|
||||
return getSuccessMessageEntity("请求成功", objectList);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return getFailureMessageEntity("请求失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.voucher.ae.comf.bd.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.OrgBookVO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.U8CQueryVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-06-06 10:03
|
||||
*/
|
||||
public interface IU8CQueryVODAO extends IBaseDao<U8CQueryVO, String> {
|
||||
List<Map<String, Object>> queryU8CBD(U8CQueryVO u8CQueryVO);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.hzya.frame.voucher.ae.comf.bd.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IAeConfBdOrgBookVODao;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.dao.IU8CQueryVODAO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.OrgBookVO;
|
||||
import com.hzya.frame.voucher.ae.comf.bd.entity.U8CQueryVO;
|
||||
import com.hzya.frame.voucher.constant.ProfilesActiveConstant;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-06-06 10:05
|
||||
*/
|
||||
@Repository
|
||||
public class U8CQueryVODAOImpl extends MybatisGenericDao<U8CQueryVO, String> implements IU8CQueryVODAO {
|
||||
@Override
|
||||
@DS(ProfilesActiveConstant.LETS_PROD_DATE_SOURCE)
|
||||
public List<Map<String, Object>> queryU8CBD(U8CQueryVO u8CQueryVO) {
|
||||
|
||||
List<Map<String, Object>> maps = (List<Map<String, Object>>) selectList("com.hzya.frame.voucher.ae.comf.bd.dao.impl.U8CQueryVODAOImpl.queryU8CBD", u8CQueryVO);
|
||||
return maps;
|
||||
}
|
||||
}
|
|
@ -15,69 +15,69 @@ import lombok.Data;
|
|||
@Data
|
||||
public class AeConfBdBdinfoEntity extends BaseEntity {
|
||||
|
||||
@JsonIgnore
|
||||
|
||||
private String accessclass;
|
||||
@JsonIgnore
|
||||
|
||||
private String basedoctablename;
|
||||
@JsonIgnore
|
||||
|
||||
private String basedoctablepkname;
|
||||
@JsonIgnore
|
||||
|
||||
private String bdcode;
|
||||
@JsonIgnore
|
||||
|
||||
private String bdname;
|
||||
@JsonIgnore
|
||||
|
||||
private Long bdtype;
|
||||
@JsonIgnore
|
||||
|
||||
private String budgetconst;
|
||||
@JsonIgnore
|
||||
|
||||
private String classcheme;
|
||||
@JsonIgnore
|
||||
|
||||
private String codefieldname;
|
||||
@JsonIgnore
|
||||
|
||||
private String coderulegetter;
|
||||
@JsonIgnore
|
||||
|
||||
private String corpfieldname;
|
||||
@JsonIgnore
|
||||
|
||||
private Long dr;
|
||||
@JsonIgnore
|
||||
|
||||
private String fatherfieldname;
|
||||
@JsonIgnore
|
||||
|
||||
private String funccode;
|
||||
@JsonIgnore
|
||||
|
||||
private String isdef;
|
||||
@JsonIgnore
|
||||
|
||||
private String isincludegroupdata;
|
||||
@JsonIgnore
|
||||
|
||||
private String isparaLevscheme;
|
||||
@JsonIgnore
|
||||
|
||||
private String isselfref;
|
||||
@JsonIgnore
|
||||
|
||||
private String namefieldname;
|
||||
@JsonIgnore
|
||||
|
||||
private String orgbookfieldname;
|
||||
@JsonIgnore
|
||||
|
||||
private String orgtypecode;
|
||||
@JsonIgnore
|
||||
|
||||
private String pkBdinfo;
|
||||
@JsonIgnore
|
||||
|
||||
private String pkCorp;
|
||||
@JsonIgnore
|
||||
|
||||
private String pkDefdef;
|
||||
@JsonIgnore
|
||||
|
||||
private String refnodename;
|
||||
@JsonIgnore
|
||||
|
||||
private String refsystem;
|
||||
@JsonIgnore
|
||||
|
||||
private String reserved1;
|
||||
@JsonIgnore
|
||||
|
||||
private String reserved2;
|
||||
@JsonIgnore
|
||||
|
||||
private String selfrefclass;
|
||||
@JsonIgnore
|
||||
|
||||
private String tablename;
|
||||
@JsonIgnore
|
||||
|
||||
private String tablepkname;
|
||||
@JsonIgnore
|
||||
|
||||
private Date ts;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.hzya.frame.voucher.ae.comf.bd.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-06-06 09:59
|
||||
*/
|
||||
@Data
|
||||
public class U8CQueryVO extends BaseEntity {
|
||||
private String tablename;
|
||||
private String prop1;
|
||||
private String prop2;
|
||||
private String prop3;
|
||||
private String prop4;
|
||||
private String prop5;
|
||||
private String prop6;
|
||||
private String prop7;
|
||||
private String prop8;
|
||||
private String prop9;
|
||||
private String prop10;
|
||||
|
||||
private String propValue1;
|
||||
private String propValue2;
|
||||
private String propValue3;
|
||||
private String propValue4;
|
||||
private String propValue5;
|
||||
private String propValue6;
|
||||
private String propValue7;
|
||||
private String propValue8;
|
||||
private String propValue9;
|
||||
private String propValue10;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?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.voucher.ae.comf.bd.dao.impl.U8CQueryVODAOImpl">
|
||||
|
||||
<resultMap id="get-U8CQueryVO-result" type="com.hzya.frame.voucher.ae.comf.bd.entity.U8CQueryVO">
|
||||
<result property="tablename" column="tablename" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="queryU8CBD" parameterType="com.hzya.frame.voucher.ae.comf.bd.entity.U8CQueryVO" resultType="map">
|
||||
select
|
||||
*
|
||||
from
|
||||
${tablename}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="prop1 !=null and prop1 !=''">and #{prop1}=#{propValue1}</if>
|
||||
<if test="prop2 !=null and prop2 !=''">and #{prop2}=#{propValue2}</if>
|
||||
<if test="prop3 !=null and prop3 !=''">and #{prop3}=#{propValue3}</if>
|
||||
<if test="prop4 !=null and prop4 !=''">and #{prop4}=#{propValue4}</if>
|
||||
<if test="prop5 !=null and prop5 !=''">and #{prop5}=#{propValue5}</if>
|
||||
<if test="prop6 !=null and prop6 !=''">and #{prop6}=#{propValue6}</if>
|
||||
<if test="prop7 !=null and prop7 !=''">and #{prop7}=#{propValue7}</if>
|
||||
<if test="prop8 !=null and prop8 !=''">and #{prop8}=#{propValue8}</if>
|
||||
<if test="prop9 !=null and prop9 !=''">and #{prop9}=#{propValue9}</if>
|
||||
<if test="prop10 !=null and prop10 !=''">and #{prop10}=#{propValue10}</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -27,15 +27,15 @@ public class AeConfInfluenceFactorEntity extends BaseEntity {
|
|||
*/
|
||||
private String factorName;
|
||||
/**
|
||||
* 映射档案id
|
||||
* 映射档案id bd_bdinfo的pkBdinfo
|
||||
*/
|
||||
private String mappingFileId;
|
||||
/**
|
||||
* 映射档案code
|
||||
* 映射档案code bd_bdinfo的tablename
|
||||
*/
|
||||
private String mappingFileCode;
|
||||
/**
|
||||
* 映射档案名称
|
||||
* 映射档案名称 bd_bdinfo的bdname
|
||||
*/
|
||||
private String mappingFileName;
|
||||
/**
|
||||
|
|
|
@ -70,6 +70,8 @@ public class AeConfInfluenceFactorServiceImpl extends BaseService<AeConfInfluenc
|
|||
public AeConfInfluenceFactorEntity save(AeConfInfluenceFactorEntity entity) throws Exception {
|
||||
Assert.notNull(entity.getAeConfModuleId(), "保存影响因素设置时,业务模块id不能为空");
|
||||
Assert.notNull(entity.getFactorName(), "保存影响因素设置时,影响因素名称不能为空");
|
||||
//关联档案
|
||||
|
||||
|
||||
updateModuleName(entity);
|
||||
return super.save(entity);
|
||||
|
|
|
@ -453,10 +453,10 @@
|
|||
<if test="def9 != null and def9 != ''">#{def9} ,</if>
|
||||
<if test="def10 != null and def10 != ''">#{def10} ,</if>
|
||||
<if test="create_time != null">#{create_time} ,</if>
|
||||
<if test="create_time != null">now() ,</if>
|
||||
<if test="create_time == null">now() ,</if>
|
||||
<if test="createUser != null and createUser != ''">#{createUser} ,</if>
|
||||
<if test="modify_time != null">#{modify_time} ,</if>
|
||||
<if test="modify_time != null">now() ,</if>
|
||||
<if test="modify_time == null">now() ,</if>
|
||||
<if test="modifyUser != null and modifyUser != ''">#{modifyUser} ,</if>
|
||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
<if test="sourceNames != null and sourceNames != ''">and sourceNames = #{sourceNames}</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
|
||||
<if test="corpType != null and corpType != ''">and corp_type = #{corpType}</if>
|
||||
<if test="desdocid != null and desdocid != ''">and desdocid = #{desdocid}</if>
|
||||
<if test="desdocId != null and desdocId != ''">and desdocid = #{desdocId}</if>
|
||||
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">and pk_setcorp1 = #{pkSetcorp1}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
|
||||
|
@ -130,7 +130,7 @@
|
|||
<if test="sourceNames != null and sourceNames != ''">and sourceNames = #{sourceNames}</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
|
||||
<if test="corpType != null and corpType != ''">and corp_type = #{corpType}</if>
|
||||
<if test="desdocid != null and desdocid != ''">and desdocid = #{desdocid}</if>
|
||||
<if test="desdocId != null and desdocId != ''">and desdocid = #{desdocId}</if>
|
||||
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">and pk_setcorp1 = #{pkSetcorp1}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
|
||||
|
@ -173,7 +173,7 @@
|
|||
</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">and pk_corp like concat('%',#{pkCorp},'%')</if>
|
||||
<if test="corpType != null and corpType != ''">and corp_type like concat('%',#{corpType},'%')</if>
|
||||
<if test="desdocid != null and desdocid != ''">and desdocid like concat('%',#{desdocid},'%')</if>
|
||||
<if test="desdocId != null and desdocId != ''">and desdocid like concat('%',#{desdocId},'%')</if>
|
||||
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">and pk_setcorp1 like concat('%',#{pkSetcorp1},'%')</if>
|
||||
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
|
||||
<if test="def1 != null and def1 != ''">and def1 like concat('%',#{def1},'%')</if>
|
||||
|
@ -210,7 +210,7 @@
|
|||
<if test="accountBookName != null and accountBookName != ''">or account_book_name = #{accountBookName}</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">or pk_corp = #{pkCorp}</if>
|
||||
<if test="corpType != null and corpType != ''">or corp_type = #{corpType}</if>
|
||||
<if test="desdocid != null and desdocid != ''">or desdocid = #{desdocid}</if>
|
||||
<if test="desdocId != null and desdocId != ''">or desdocid = #{desdocId}</if>
|
||||
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">or pk_setcorp1 = #{pkSetcorp1}</if>
|
||||
<if test="remark != null and remark != ''">or remark = #{remark}</if>
|
||||
<if test="def1 != null and def1 != ''">or def1 = #{def1}</if>
|
||||
|
@ -249,7 +249,7 @@
|
|||
<if test="sourceNames != null and sourceNames != ''">sourceNames ,</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">pk_corp ,</if>
|
||||
<if test="corpType != null and corpType != ''">corp_type ,</if>
|
||||
<if test="desdocid != null and desdocid != ''">desdocid ,</if>
|
||||
<if test="desdocId != null and desdocId != ''">desdocid ,</if>
|
||||
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">pk_setcorp1 ,</if>
|
||||
<if test="remark != null and remark != ''">remark ,</if>
|
||||
<if test="def1 != null and def1 != ''">def1 ,</if>
|
||||
|
@ -285,7 +285,7 @@
|
|||
<if test="sourceNames != null and sourceNames != ''">#{sourceNames} ,</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">#{pkCorp} ,</if>
|
||||
<if test="corpType != null and corpType != ''">#{corpType} ,</if>
|
||||
<if test="desdocid != null and desdocid != ''">#{desdocid} ,</if>
|
||||
<if test="desdocId != null and desdocId != ''">#{desdocId} ,</if>
|
||||
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">#{pkSetcorp1} ,</if>
|
||||
<if test="remark != null and remark != ''">#{remark} ,</if>
|
||||
<if test="def1 != null and def1 != ''">#{def1} ,</if>
|
||||
|
|
|
@ -16,5 +16,5 @@ public interface IAeConfSubjectContrastService extends IBaseService<AeConfSubjec
|
|||
|
||||
AeConfSubjectContrastEntity queryById(AeConfSubjectContrastEntity entity);
|
||||
|
||||
AeConfSubjectContrastEntity saveEntity(AeConfSubjectContrastEntity entity);
|
||||
AeConfSubjectContrastEntity saveEntity(AeConfSubjectContrastEntity entity) throws NoSuchFieldException, IllegalAccessException;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -72,7 +73,8 @@ public class AeConfSubjectContrastServiceImpl extends BaseService<AeConfSubjectC
|
|||
* 新增科目对照表。现保存主表,再将来源档案分割为子表进行存储
|
||||
*/
|
||||
@Override
|
||||
public AeConfSubjectContrastEntity saveEntity(AeConfSubjectContrastEntity entity) {
|
||||
public AeConfSubjectContrastEntity saveEntity(AeConfSubjectContrastEntity entity) throws NoSuchFieldException, IllegalAccessException {
|
||||
//校验主表
|
||||
Assert.notNull(entity.getPkCorp(), "科目对照表新增时,公司id不能为空!");
|
||||
Assert.notNull(entity.getCode(), "科目对照表新增时,code不能为空!");
|
||||
Assert.notNull(entity.getName(), "科目对照表新增时,name不能为空!");
|
||||
|
@ -92,6 +94,22 @@ public class AeConfSubjectContrastServiceImpl extends BaseService<AeConfSubjectC
|
|||
Assert.state(false, "科目对照表新增时,来源档案VOS最多为9个!");
|
||||
}
|
||||
|
||||
//主表显示列数
|
||||
// String[] split = entity.getSourceIds().split(",");
|
||||
|
||||
// //校验子表
|
||||
// for (int i = 1; i <= split.length; i++) {
|
||||
// String fieldName = "factortable" + i;
|
||||
// Field field = AeConfSubjectContrastBEntity.class.getDeclaredField(fieldName);
|
||||
// field.setAccessible(true);
|
||||
// String value = (String) field.get(entity);
|
||||
//
|
||||
// if (value == null || value.trim().isEmpty()) {
|
||||
// Assert.state(false, "");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
//保存主表
|
||||
AeConfSubjectContrastEntity saveH = aeConfSubjectContrastDao.save(entity);
|
||||
String Hid = saveH.getId();
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.voucher.constant;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-06-06 09:38
|
||||
*/
|
||||
public class ProfilesActiveConstant {
|
||||
public static final String LETS_PROD_DATE_SOURCE = "lets-prod";
|
||||
|
||||
public static final String LETS_PROFILES_ACTIVE = "prod";
|
||||
}
|
|
@ -80,7 +80,7 @@ public class AESUtil {
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String data = "201103";
|
||||
String data = "U8C241231";
|
||||
String encrypt1 = encrypt(data);
|
||||
System.out.println(encrypt1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue