Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev
This commit is contained in:
commit
2651fecbe9
|
@ -19,8 +19,11 @@ spring:
|
|||
savefile:
|
||||
# 文件保存路径
|
||||
path: /home/webservice/zt/file
|
||||
pluginpath: D:/local/plugin/
|
||||
tomcatpath: E:\apache-tomcat-9.0.27\webapps\kangarooDataCenterV3\WEB-INF\classes\
|
||||
# path: D:\webservice\file
|
||||
# pluginpath: D:\webservice\plugin
|
||||
pluginpath: /home/webservice/zt/plugin
|
||||
# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\
|
||||
tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/
|
||||
cbs8:
|
||||
appId: 1P4AGrpz
|
||||
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
|||
import com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* (gl_pzml: table)表数据库访问层
|
||||
|
@ -83,6 +84,16 @@ public interface ISenderGlPzmlDao extends IBaseDao<SenderGlPzmlEntity, String> {
|
|||
* **/
|
||||
Integer deleteGlPzmlHealthBureau(SenderGlPzmlEntity senderGlPzmlEntity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 查询凭证 商学院
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/8/14 16:25
|
||||
* **/
|
||||
List<SenderGlPzmlEntity> queryGlPzmlSxy(SenderGlPzmlEntity senderGlPzmlEntity);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity;
|
|||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* (GlPzml)表数据库访问层
|
||||
|
@ -60,5 +61,11 @@ public class SenderGlPzmlDaoImpl extends MybatisGenericDao<SenderGlPzmlEntity, S
|
|||
public Integer deleteGlPzmlHealthBureau(SenderGlPzmlEntity senderGlPzmlEntity) {
|
||||
return super.delete("SenderGlPzmlEntity_delete_pzml",senderGlPzmlEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#senderGlPzmlEntity.dataSourceCode")
|
||||
public List<SenderGlPzmlEntity> queryGlPzmlSxy(SenderGlPzmlEntity senderGlPzmlEntity) {
|
||||
return (List<SenderGlPzmlEntity>) super.selectList("queryGlPzmlSxy",senderGlPzmlEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,16 @@ public class SenderGlPzmlEntity extends BaseEntity {
|
|||
private String stamp;
|
||||
private String yspzje;
|
||||
|
||||
private String bmdm;
|
||||
|
||||
public String getBmdm() {
|
||||
return bmdm;
|
||||
}
|
||||
|
||||
public void setBmdm(String bmdm) {
|
||||
this.bmdm = bmdm;
|
||||
}
|
||||
|
||||
public String getPzsbm() {
|
||||
return pzsbm;
|
||||
}
|
||||
|
|
|
@ -259,6 +259,31 @@
|
|||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 商学院所需要的凭证数据-->
|
||||
<select id="queryGlPzmlSxy" resultMap="get-SenderGlPzmlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
|
||||
select
|
||||
pzml.idpzh as idpzh,
|
||||
pzml.kjqj as kjqj,
|
||||
pzml.srrq as srrq,
|
||||
pzml.srID as srID,
|
||||
pznr.bmdm as bmdm,
|
||||
pzml.pzzy as pzzy,
|
||||
sum(pznr.je) as pzje,
|
||||
pzml.gsdm,pzml.zth,pzml.kjqj,pzml.pzh
|
||||
from GL_Pzml pzml
|
||||
left join gl_pznr pznr on pznr.idpzh=pzml.idpzh and pzml.kjqj=pznr.kjqj
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="idpzh !=null and idpzh!='' "> and pzml.idpzh = #{idpzh} </if>
|
||||
and pzml.kjqj =#{kjqj} and pznr.kjqj =#{kjqj} and pznr.zbid!=0
|
||||
</trim>
|
||||
group by pzml.idpzh,
|
||||
pzml.kjqj,
|
||||
pzml.srrq,
|
||||
pzml.pzzy,
|
||||
pzml.gsdm,pzml.zth,pzml.kjqj,pzml.pzh,pzml.srID,pznr.bmdm
|
||||
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity" keyProperty="" useGeneratedKeys="true">
|
||||
insert into gl_pzml(
|
||||
|
|
|
@ -95,11 +95,11 @@ public interface ISenderGlPzmlService extends IBaseService<SenderGlPzmlEntity, S
|
|||
|
||||
/**
|
||||
*
|
||||
* @content 保存凭证 商学院 确定指标被哪些凭证使用
|
||||
* @content 查询凭证 商学院 确定指标被哪些凭证使用
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2024/8/13 17:00
|
||||
* **/
|
||||
Object saveGlPzmlSxy(JSONObject jsonObject);
|
||||
Object queryGlPzmlSxy(JSONObject jsonObject);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,10 @@ 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.grpU8.nxproof.gbizbsyrec.dao.IGbiZbsyrecDao;
|
||||
import com.hzya.frame.grpU8.nxproof.gbizbsyrec.entity.GbiZbsyrecEntity;
|
||||
import com.hzya.frame.grpU8.nxproof.gbizbxmb.dao.IGbiZbxmbDao;
|
||||
import com.hzya.frame.grpU8.nxproof.gbizbxmb.entity.GbiZbxmbEntity;
|
||||
import com.hzya.frame.grpU8.nxproof.glPzml.dao.ISenderGlPzmlDao;
|
||||
import com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity;
|
||||
import com.hzya.frame.grpU8.nxproof.glPzml.service.ISenderGlPzmlService;
|
||||
|
@ -22,10 +26,13 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
|||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static org.aspectj.runtime.internal.Conversions.doubleValue;
|
||||
|
||||
/**
|
||||
* (GlPzml)表服务实现类
|
||||
|
@ -41,6 +48,9 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
|
|||
|
||||
private ISenderGlPzmlDao senderGlPzmlDao;
|
||||
|
||||
@Autowired
|
||||
private IGbiZbxmbDao gbiZbxmbDao;
|
||||
|
||||
@Autowired
|
||||
public void setSenderGlPzmlDao(ISenderGlPzmlDao dao) {
|
||||
this.senderGlPzmlDao = dao;
|
||||
|
@ -668,7 +678,8 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
|
|||
|
||||
//保存凭证 商学院,指标被哪些凭证使用
|
||||
@Override
|
||||
public Object saveGlPzmlSxy(JSONObject jsonObject){
|
||||
public Object queryGlPzmlSxy(JSONObject json){
|
||||
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||
SenderGlPzmlEntity glPzmlEntity = jsonObject.toJavaObject(SenderGlPzmlEntity.class);
|
||||
if(StrUtil.isEmpty(glPzmlEntity.getKjqj())){
|
||||
glPzmlEntity.setKjqj(DateUtil.format(new Date(),"yyyyMM"));
|
||||
|
@ -679,29 +690,71 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
|
|||
return BaseResult.getFailureMessageEntity("token为空,请先获取token");
|
||||
}
|
||||
//查询凭证数据
|
||||
List<SenderGlPzmlEntity> pzmlEntities = senderGlPzmlDao.query(glPzmlEntity);
|
||||
if(CollectionUtils.isEmpty(pzmlEntities)){
|
||||
List<SenderGlPzmlEntity> list = senderGlPzmlDao.queryGlPzmlSxy(glPzmlEntity);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return BaseResult.getSuccessMessageEntity("没有需要同步得凭证",null);
|
||||
}
|
||||
for (SenderGlPzmlEntity pzmlEntity : pzmlEntities) {
|
||||
try {
|
||||
String result=null;
|
||||
for (SenderGlPzmlEntity pzmlEntity : list) {
|
||||
String pzNum = pzmlEntity.getGsdm() + "_" + pzmlEntity.getZth() + "_" + pzmlEntity.getKjqj() + "_" + pzmlEntity.getPzh();
|
||||
//转换日期,如将20240514转为2024-05-14
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = inputFormat.parse(pzmlEntity.getSrrq());
|
||||
String outputDateString = outputFormat.format(date);
|
||||
//将金额四舍五入
|
||||
BigDecimal bigDecimalValue = new BigDecimal(pzmlEntity.getPzje());
|
||||
BigDecimal roundedValue = bigDecimalValue.setScale(2,
|
||||
RoundingMode.HALF_UP);
|
||||
JSONObject jsonObjectParams=new JSONObject();
|
||||
jsonObjectParams.put("code",pzmlEntity.getIdpzh());//pzid
|
||||
jsonObjectParams.put("budgetYear",pzmlEntity.getKjqj().substring(0,4));//预算年度
|
||||
jsonObjectParams.put("applyDate",DateUtil.format(new Date(),"yyyy-MM-dd"));//日期
|
||||
jsonObjectParams.put("userCode","");//用户编码
|
||||
jsonObjectParams.put("depCode","");//部门编码
|
||||
jsonObjectParams.put("applyDate",outputDateString);//日期
|
||||
jsonObjectParams.put("userCode",pzmlEntity.getSrid());//用户编码
|
||||
jsonObjectParams.put("depCode","A518");//部门编码
|
||||
jsonObjectParams.put("description",pzmlEntity.getPzzy());//说明
|
||||
jsonObjectParams.put("amount",pzmlEntity.getPzje());//金额
|
||||
jsonObjectParams.put("amount",roundedValue.doubleValue());//金额
|
||||
jsonObjectParams.put("pzNum",pzNum);//凭证号 例如:公司代码+账套号+会计期间+凭证号:001_001_202408_付款_1
|
||||
//根据idpzh查询指标id和指标金额
|
||||
GbiZbxmbEntity gbiZbxmbEntity=new GbiZbxmbEntity();
|
||||
gbiZbxmbEntity.setDjId(pzmlEntity.getIdpzh());
|
||||
gbiZbxmbEntity.setKjnd(pzmlEntity.getKjqj().substring(0,4));
|
||||
gbiZbxmbEntity.setDataSourceCode(glPzmlEntity.getDataSourceCode());
|
||||
List<GbiZbxmbEntity> gbiZbsyrecEntities = gbiZbxmbDao.queryZbxmbByIdpzh(gbiZbxmbEntity);
|
||||
logger.info("=======根据凭证idpzh:{}查询的指标金额和指标id数据有{}条",pzmlEntity.getIdpzh(),gbiZbsyrecEntities.size());
|
||||
if(CollectionUtils.isEmpty(gbiZbsyrecEntities)){
|
||||
jsonObjectParams.put("reimburseItems",new ArrayList<>());
|
||||
}else{
|
||||
JSONArray jsonArray=new JSONArray();
|
||||
for (GbiZbxmbEntity zbxmbEntity : gbiZbsyrecEntities) {
|
||||
BigDecimal bigDecimalValueZbxmb = new BigDecimal(zbxmbEntity.getJe());
|
||||
BigDecimal roundedValueZbxmb = bigDecimalValueZbxmb.setScale(2, RoundingMode.HALF_UP);
|
||||
JSONObject jsonObjectZbxm=new JSONObject();
|
||||
jsonObjectZbxm.put("thirdProjectCode",zbxmbEntity.getZbid());
|
||||
jsonObjectZbxm.put("amount",roundedValueZbxmb);
|
||||
jsonObjectZbxm.put("financialCode",zbxmbEntity.getJjkmdm());
|
||||
jsonArray.add(jsonObjectZbxm);
|
||||
}
|
||||
jsonObjectParams.put("reimburseItems",jsonArray);
|
||||
}
|
||||
JSONArray jsonArray=new JSONArray();
|
||||
jsonArray.add(jsonObjectParams);
|
||||
JSONObject jsonObjectData=new JSONObject();
|
||||
jsonObjectData.put("data",jsonArray);
|
||||
|
||||
|
||||
String params = jsonObjectData.toJSONString();
|
||||
logger.info("调用商学院凭证保存接口请求参数:{}",params);
|
||||
result = HttpRequest.post(URLTest + "/nky/service/zsApi/saveZJSYPZReimburse?accessToken="+token).header("Content-Type", "application/json;charset=UTF-8").timeout(30000).body(params).execute().body();
|
||||
logger.info("调用商学院凭证保存接口返回参数:{}",result);
|
||||
}
|
||||
JSONObject jsonObjectResult=new JSONObject();
|
||||
jsonObjectResult.put("status","200");
|
||||
jsonObjectResult.put("pzml",result);
|
||||
return jsonObjectResult;
|
||||
}catch (Exception e){
|
||||
logger.info("根据凭证idpzh:{}查询指标失败:{}",glPzmlEntity.getIdpzh(),e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("根据凭证查询指标失败");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
@ -713,7 +766,7 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
|
|||
String params = jsonObject.toJSONString();
|
||||
logger.info("=========获取凭证token请求参数:{}========",params);
|
||||
String urlToken="nky/service/session/getAccessToken";
|
||||
String result = HttpRequest.post(URLTest + urlToken).header("Content-Type", "soap/xml").timeout(30000).body(params).execute().body();
|
||||
String result = HttpRequest.post(URLTest + urlToken).header("Content-Type", "application/json;charset=UTF-8").timeout(30000).body(params).execute().body();
|
||||
logger.info("=========获取凭证token返回结果:{}========",result);
|
||||
JSONObject jsonObjectResult=JSONObject.parseObject(result);
|
||||
String value=jsonObjectResult.getString("value");
|
||||
|
@ -724,7 +777,6 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
|
|||
return accessToken;
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
|||
sysMenuConfigEntities.get(i).setParentMenuId("ea22757e99c144fb9ef381dd322e233c");
|
||||
} else {
|
||||
//2、单据
|
||||
sysMenuConfigEntities.get(i).setParentMenuId("58714ddb7ec94f5da91df74efada042f");
|
||||
sysMenuConfigEntities.get(i).setParentMenuId("67f82a6e7f664c5a89b7fc7b8fc817b0");
|
||||
}
|
||||
sysMenuConfigEntities.get(i).setMenuName(entity.getMdmName());
|
||||
sysMenuConfigEntities.get(i).setMenuEnglishName("integrationOptionAdmin" + entity.getMdmCode());
|
||||
|
@ -1713,7 +1713,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
|||
module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c");
|
||||
} else {
|
||||
//2、单据
|
||||
module.setParentMenuId("58714ddb7ec94f5da91df74efada042f");
|
||||
module.setParentMenuId("67f82a6e7f664c5a89b7fc7b8fc817b0");
|
||||
}
|
||||
module.setMenuName(mdmModuleEntity.getMdmName());
|
||||
module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode());
|
||||
|
@ -1785,7 +1785,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
|||
module.setParentMenuId("ea22757e99c144fb9ef381dd322e233c");
|
||||
} else {
|
||||
//2、单据
|
||||
module.setParentMenuId("58714ddb7ec94f5da91df74efada042f");
|
||||
module.setParentMenuId("67f82a6e7f664c5a89b7fc7b8fc817b0");
|
||||
}
|
||||
module.setMenuName(mdmModuleEntity.getMdmName());
|
||||
module.setMenuEnglishName("integrationOptionAdmin" + mdmModuleEntity.getMdmCode());
|
||||
|
|
|
@ -90,7 +90,7 @@ public class FileDownloadServiceImpl extends BaseService< FileDownloadEntity,Lo
|
|||
}
|
||||
/** 拼接文件路径*/
|
||||
String filePath = "";
|
||||
if(fileDownloadEntity.getFileType().equals("2")){
|
||||
if(fileDownloadEntity.getFileType() != null && fileDownloadEntity.getFileType().equals("2")){
|
||||
filePath = PLUGINPATH + fileDownloadEntity.getFilepath().replace("/",File.separator).replace("\\",File.separator);
|
||||
}else{
|
||||
filePath = DSK + fileDownloadEntity.getFilepath().replace("/",File.separator).replace("\\",File.separator);
|
||||
|
|
|
@ -213,26 +213,26 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
|
||||
//根据data_id判断数据是否已经保存在相关表中,避免重复保存
|
||||
List<String> fields = getFields(comparisonEntity);
|
||||
Map<String,Object> mapDataId=new HashMap<>();
|
||||
mapDataId.put("data_id",jsonObjectMain.getString("data_id"));
|
||||
ComparisonEntity comparisonDataId=new ComparisonEntity();
|
||||
Map<String, Object> mapDataId = new HashMap<>();
|
||||
mapDataId.put("data_id", jsonObjectMain.getString("data_id"));
|
||||
ComparisonEntity comparisonDataId = new ComparisonEntity();
|
||||
comparisonDataId.setMap(mapDataId);
|
||||
comparisonDataId.setDbName(comparisonEntity.getDbName());
|
||||
comparisonDataId.setFields(fields);
|
||||
List<Map<String, Object>> listDataId = comparisonDao.queryComparisonPage(comparisonDataId);
|
||||
if(CollectionUtils.isNotEmpty(listDataId)){
|
||||
return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据");
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(listDataId)) {
|
||||
//return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据");
|
||||
return updateEntity(json);
|
||||
} else {
|
||||
//判断输入的主表字段是否是必填项
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//如果必填字段不为空
|
||||
if(entity.getRuleValue()!=null && entity.getDbType().equals("1")){
|
||||
if (entity.getRuleValue() != null && entity.getDbType().equals("1")) {
|
||||
//如果值为空,说明没有传这个字段或者这个字段的值为空
|
||||
if(jsonObjectMain.getString(entity.getEnName()) ==null || jsonObjectMain.getString(entity.getEnName()).equals("")){
|
||||
if (jsonObjectMain.getString(entity.getEnName()) == null || jsonObjectMain.getString(entity.getEnName()).equals("")) {
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2");
|
||||
return BaseResult.getFailureMessageEntity(entity.getDbName()+"表的"+entity.getEnName()+"字段不能为空");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2");
|
||||
return BaseResult.getFailureMessageEntity(entity.getDbName() + "表的" + entity.getEnName() + "字段不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候生成单据规则错误:{}", e.getMessage());
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2");
|
||||
|
||||
return BaseResult.getFailureMessageEntity("保存失败");
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
} catch (Exception e) {
|
||||
logger.info("通用数据保存接口中查询单据规则错误:{}", e.getMessage());
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2");
|
||||
|
||||
return BaseResult.getFailureMessageEntity("保存失败");
|
||||
}
|
||||
|
@ -298,12 +298,12 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
for (Object object : jsonArrayDetails) {
|
||||
JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object);
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
if(entity.getRuleValue()!=null && entity.getDbType().equals("2")){
|
||||
if (entity.getRuleValue() != null && entity.getDbType().equals("2")) {
|
||||
//如果值为空,说明没有传这个字段或者这个字段的值为空
|
||||
if(jsonObjectDetails.getString(entity.getEnName())==null || jsonObjectDetails.getString(entity.getEnName()).equals("")){
|
||||
if (jsonObjectDetails.getString(entity.getEnName()) == null || jsonObjectDetails.getString(entity.getEnName()).equals("")) {
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2");
|
||||
return BaseResult.getFailureMessageEntity(entity.getDbName()+"表的"+entity.getEnName()+"字段不能为空");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2");
|
||||
return BaseResult.getFailureMessageEntity(entity.getDbName() + "表的" + entity.getEnName() + "字段不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -313,11 +313,11 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
|
||||
//保存主表数据
|
||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule);
|
||||
jsonObjectList.put(comparisonEntityOne.getDbName(),map);
|
||||
jsonObjectList.put(comparisonEntityOne.getDbName(), map);
|
||||
//保存子表数据
|
||||
if (arrayList != null && arrayList.size() > 0) {
|
||||
mapDetails = spliceDetailMap(comparisonEntities, mapDetails, arrayList);
|
||||
if(mapDetails.size()>0 && mapDetails!=null ){
|
||||
if (mapDetails.size() > 0 && mapDetails != null) {
|
||||
for (List<Map<String, Object>> mapDetail : mapDetails) {
|
||||
for (Map<String, Object> stringObjectMap : mapDetail) {
|
||||
stringObjectMap.put("id", UUIDLong.longUUID());
|
||||
|
@ -346,21 +346,22 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
jsonObjectList.remove(null);
|
||||
list.add(jsonObjectList);
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","1");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "1");
|
||||
JSONObject json1 = new JSONObject();
|
||||
json1.put("status","200");
|
||||
json1.put("list",list);
|
||||
json1.put("status", "200");
|
||||
json1.put("list", list);
|
||||
return json1;
|
||||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候错误:{}", e.getMessage());
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),tableName+"_option_log","2");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid, jsonObject.getString("appName"), jsonObject.getString("appCode"), jsonObject.toJSONString(), "接口新增", jsonObject.getString("optionName"), tableName + "_option_log", "2");
|
||||
|
||||
return BaseResult.getFailureMessageEntity("保存失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数");
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("保存失败","请检查传递参数");
|
||||
}
|
||||
|
||||
//更新通用数据数据
|
||||
|
@ -499,7 +500,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
return BaseResult.getFailureMessageEntity("更新失败");
|
||||
}
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数");
|
||||
return BaseResult.getFailureMessageEntity("更新失败","请检查传递参数");
|
||||
}
|
||||
|
||||
private List<String> getFields(ComparisonEntity comparisonEntity) {
|
||||
|
@ -611,7 +612,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
return BaseResult.getFailureMessageEntity("删除失败");
|
||||
}
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数");
|
||||
return BaseResult.getFailureMessageEntity("删除失败","请检查传递参数");
|
||||
}
|
||||
|
||||
//根据应用key和应用密钥获取应用编码和应用名称
|
||||
|
|
Loading…
Reference in New Issue