调整电子回单和支付结果回写
This commit is contained in:
parent
f2938a2dc4
commit
b378f3f9ba
|
@ -4,4 +4,34 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
import com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity;
|
import com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity;
|
||||||
|
|
||||||
public interface ICtpAttachmentDao extends IBaseDao<CtpAttachmentEntity,String> {
|
public interface ICtpAttachmentDao extends IBaseDao<CtpAttachmentEntity,String> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 根据附件id查询附件信息
|
||||||
|
* @Param
|
||||||
|
* @Return
|
||||||
|
* @Author hecan
|
||||||
|
* @Date 2025-01-15 14:08
|
||||||
|
* **/
|
||||||
|
CtpAttachmentEntity queryCtpAttachmentEntity(CtpAttachmentEntity entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 新增
|
||||||
|
* @Param
|
||||||
|
* @Return
|
||||||
|
* @Author hecan
|
||||||
|
* @Date 2025-01-15 14:46
|
||||||
|
* **/
|
||||||
|
CtpAttachmentEntity saveCtpAttachmentEntity(CtpAttachmentEntity entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 更新
|
||||||
|
* @Param
|
||||||
|
* @Return
|
||||||
|
* @Author hecan
|
||||||
|
* @Date 2025-01-15 14:47
|
||||||
|
* **/
|
||||||
|
Integer updateCtpAttachmentEntity(CtpAttachmentEntity entity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hzya.frame.sysnew.comparison.serviceData.dao.impl;
|
package com.hzya.frame.sysnew.comparison.serviceData.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
import com.hzya.frame.sysnew.comparison.serviceData.dao.ICtpAttachmentDao;
|
import com.hzya.frame.sysnew.comparison.serviceData.dao.ICtpAttachmentDao;
|
||||||
import com.hzya.frame.sysnew.comparison.serviceData.dao.IServiceDataDao;
|
import com.hzya.frame.sysnew.comparison.serviceData.dao.IServiceDataDao;
|
||||||
|
@ -8,4 +9,21 @@ import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository(value = "CtpAttachmentDaoImpl")
|
@Repository(value = "CtpAttachmentDaoImpl")
|
||||||
public class CtpAttachmentDaoImpl extends MybatisGenericDao<CtpAttachmentEntity,String> implements ICtpAttachmentDao {
|
public class CtpAttachmentDaoImpl extends MybatisGenericDao<CtpAttachmentEntity,String> implements ICtpAttachmentDao {
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public CtpAttachmentEntity queryCtpAttachmentEntity(CtpAttachmentEntity entity) {
|
||||||
|
return (CtpAttachmentEntity) super.selectOne("queryCtpAttachmentEntity",entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public CtpAttachmentEntity saveCtpAttachmentEntity(CtpAttachmentEntity entity) {
|
||||||
|
return super.save("saveCtpAttachmentEntity",entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public Integer updateCtpAttachmentEntity(CtpAttachmentEntity entity) {
|
||||||
|
return super.update("updateCtpAttachmentEntity",entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,19 @@
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询 采用==查询 -->
|
||||||
|
<select id="queryCtpAttachmentEntity" resultMap="get-CtpAttachmentEntity-result" parameterType="com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity">
|
||||||
|
select
|
||||||
|
id,
|
||||||
|
category,
|
||||||
|
type,
|
||||||
|
filename,
|
||||||
|
mime_type, FILE_SIZE AS attachment_size
|
||||||
|
from CTP_FILE where id= #{file_url}
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<insert id="entity_insert" parameterType="com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity">
|
<insert id="saveCtpAttachmentEntity" parameterType="com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity">
|
||||||
insert into CTP_ATTACHMENT(
|
insert into CTP_ATTACHMENT(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="id != null and id !='' "> id, </if>
|
<if test="id != null and id !='' "> id, </if>
|
||||||
|
@ -76,7 +87,7 @@
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 修改 付款单中的电子回单字段-->
|
<!-- 修改 付款单中的电子回单字段-->
|
||||||
<update id="entity_update" parameterType="com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity">
|
<update id="updateCtpAttachmentEntity" parameterType="com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity">
|
||||||
update CTP_ATTACHMENT set
|
update CTP_ATTACHMENT set
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="sub_reference != null and sub_reference !='' "> sub_reference = #{sub_reference},</if>
|
<if test="sub_reference != null and sub_reference !='' "> sub_reference = #{sub_reference},</if>
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class ServiceDataEntity extends BaseEntity {
|
||||||
private String receipt;//电子回单值
|
private String receipt;//电子回单值
|
||||||
private String billCode;//单据编号
|
private String billCode;//单据编号
|
||||||
|
|
||||||
private String summary_id;//summary_id
|
private String summaryId;//summaryId
|
||||||
|
|
||||||
private String bipAmountField;//BIP打款金额字段
|
private String bipAmountField;//BIP打款金额字段
|
||||||
private String bipAmount;//BIP打款金额
|
private String bipAmount;//BIP打款金额
|
||||||
|
@ -37,12 +37,12 @@ public class ServiceDataEntity extends BaseEntity {
|
||||||
this.bipAmount = bipAmount;
|
this.bipAmount = bipAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSummary_id() {
|
public String getSummaryId() {
|
||||||
return summary_id;
|
return summaryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSummary_id(String summary_id) {
|
public void setSummaryId(String summaryId) {
|
||||||
this.summary_id = summary_id;
|
this.summaryId = summaryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTabName() {
|
public String getTabName() {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
,receipt_filed as receiptFiled
|
,receipt_filed as receiptFiled
|
||||||
,receipt as receipt
|
,receipt as receipt
|
||||||
,vdef1 as billCode
|
,vdef1 as billCode
|
||||||
,summary_id
|
,summary_id as summaryId
|
||||||
,bip_payment_number_field as bipPaymentNumberField
|
,bip_payment_number_field as bipPaymentNumberField
|
||||||
,bip_payment_number as bipPaymentNumber
|
,bip_payment_number as bipPaymentNumber
|
||||||
,bip_amount_field as bipAmountField
|
,bip_amount_field as bipAmountField
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
<update id="updatePayResult" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity" >
|
<update id="updatePayResult" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity" >
|
||||||
update ${tabName} set
|
update ${tabName} set
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="payDate != null and payDate != ''"> ${payDateFiled} = #{payDate},</if>
|
<if test="payDate != null and payDate != ''"> ${payDateFiled} = to_date(#{payDate},'YYYY-MM-DD HH24:MI:SS'),</if>
|
||||||
<if test="bipAmount != null and bipAmount != ''"> ${bipAmountField} = #{bipAmount},</if>
|
<if test="bipAmount != null and bipAmount != ''"> ${bipAmountField} = #{bipAmount},</if>
|
||||||
<if test="payResult != null and payResult != ''"> ${payResultFiled} = #{payResult}</if>
|
<if test="payResult != null and payResult != ''"> ${payResultFiled} = #{payResult}</if>
|
||||||
</trim>
|
</trim>
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
<!--通过主键修改方法-->
|
<!--通过主键修改方法-->
|
||||||
<update id="updateElectronic" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity" >
|
<update id="updateElectronic" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity" >
|
||||||
update ${tabName} set
|
update ${tabName} set
|
||||||
set ${receiptFiled} = #{receipt}
|
${receiptFiled} = #{receipt}
|
||||||
where id=#{id}
|
where id=#{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
@ -197,38 +197,46 @@ public class ServiceDataServiceImpl extends BaseService<ComparisonEntity,String>
|
||||||
String file_url = jsonObject.getString("fileUrl");
|
String file_url = jsonObject.getString("fileUrl");
|
||||||
CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
|
CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
|
||||||
ctpAttachmentEntity.setFile_url(file_url);
|
ctpAttachmentEntity.setFile_url(file_url);
|
||||||
String att_reference = serviceDataEntity.getSummary_id();//Summary_id
|
String att_reference = serviceDataEntity.getSummaryId();//Summary_id
|
||||||
|
logger.info("==========oa_id:{}的表单的Summary_id值为:{}",serviceDataEntity.getId(),att_reference);
|
||||||
ctpAttachmentEntity.setSub_reference(sub_reference);
|
ctpAttachmentEntity.setSub_reference(sub_reference);
|
||||||
ctpAttachmentEntity.setAtt_reference(att_reference);
|
ctpAttachmentEntity.setAtt_reference(att_reference);
|
||||||
|
ctpAttachmentEntity.setDataSourceCode(serviceDataEntity.getDataSourceCode());
|
||||||
List<CtpAttachmentEntity> ctpAttachmentEntityListBase = ctpAttachmentDao.query(ctpAttachmentEntity);
|
List<CtpAttachmentEntity> ctpAttachmentEntityListBase = ctpAttachmentDao.query(ctpAttachmentEntity);
|
||||||
|
logger.info("====根据附件id:{}查询出来在CTP_ATTACHMENT表中的数据有:{}条",file_url,ctpAttachmentEntityListBase.size());
|
||||||
|
CtpAttachmentEntity ctpAttachment = ctpAttachmentDao.queryCtpAttachmentEntity(ctpAttachmentEntity);
|
||||||
|
logger.info("====根据附件id:{}查询在CTP_file表中的文件名称为",file_url,ctpAttachment.getFilename());
|
||||||
//如果没有查询到数据,就新增附件业务,否则更新
|
//如果没有查询到数据,就新增附件业务,否则更新
|
||||||
if (ctpAttachmentEntityListBase.size() == 0) {
|
if (ctpAttachmentEntityListBase.size() == 0) {
|
||||||
String category = jsonObject.getString("category");
|
if(null !=ctpAttachment) {
|
||||||
String type = jsonObject.getString("type");
|
String type =ctpAttachment.getType();
|
||||||
String filename = jsonObject.getString("filename");
|
String filename = ctpAttachment.getFilename();
|
||||||
String mime_type = jsonObject.getString("mimeType");
|
String mime_type =ctpAttachment.getMime_type();
|
||||||
String attachment_size = jsonObject.getString("size");
|
String attachment_size = ctpAttachment.getAttachment_size();
|
||||||
String id = String.valueOf(UUIDLong.longUUID());
|
String id = String.valueOf(UUIDLong.longUUID());
|
||||||
ctpAttachmentEntity.setCategory(category);
|
ctpAttachmentEntity.setCategory("66");
|
||||||
ctpAttachmentEntity.setFilename(filename);
|
ctpAttachmentEntity.setFilename(filename);
|
||||||
ctpAttachmentEntity.setType(type);
|
ctpAttachmentEntity.setType(type);
|
||||||
ctpAttachmentEntity.setMime_type(mime_type);
|
ctpAttachmentEntity.setMime_type(mime_type);
|
||||||
ctpAttachmentEntity.setAttachment_size(attachment_size);
|
ctpAttachmentEntity.setAttachment_size(attachment_size);
|
||||||
ctpAttachmentEntity.setId(id);
|
ctpAttachmentEntity.setId(id);
|
||||||
ctpAttachmentEntity.setCategory("2");
|
|
||||||
ctpAttachmentEntity.setCreatedate(new Date());
|
ctpAttachmentEntity.setCreatedate(new Date());
|
||||||
ctpAttachmentEntity.setDataSourceCode(jsonObject.getString("dataSourceCode"));
|
ctpAttachmentEntity.setDataSourceCode(serviceDataEntity.getDataSourceCode());
|
||||||
ctpAttachmentDao.save(ctpAttachmentEntity);
|
ctpAttachmentDao.saveCtpAttachmentEntity(ctpAttachmentEntity);
|
||||||
logger.info("OA附件新增成功");
|
logger.info("OA附件新增成功");
|
||||||
|
}else{
|
||||||
|
logger.info("======根据附件id:{}查询在CTP_file表中不存在======");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ctpAttachmentEntityListBase.size() > 1) {
|
if (ctpAttachmentEntityListBase.size() > 1) {
|
||||||
throw new BaseSystemException("OA附件业务表中查到多条记录");
|
throw new BaseSystemException("OA附件业务表中查到多条记录");
|
||||||
}
|
}
|
||||||
//更新数据到OA附件业务表中
|
//更新数据到OA附件业务表中
|
||||||
ctpAttachmentDao.save(ctpAttachmentEntity);
|
ctpAttachmentDao.updateCtpAttachmentEntity(ctpAttachmentEntity);
|
||||||
logger.info("OA附件更新成功");
|
logger.info("OA附件更新成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("电子回单更新成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +320,7 @@ public class ServiceDataServiceImpl extends BaseService<ComparisonEntity,String>
|
||||||
vdef1=cmp_apply.getString("vdef1");
|
vdef1=cmp_apply.getString("vdef1");
|
||||||
StringBuffer stringBufferDetails = new StringBuffer();
|
StringBuffer stringBufferDetails = new StringBuffer();
|
||||||
stringBufferDetails.append("select d_id as data_id,tab_name,pk_balatype,pk_acceptorg,pk_org,pk_group,pk_busitype,rowno,\n" +
|
stringBufferDetails.append("select d_id as data_id,tab_name,pk_balatype,pk_acceptorg,pk_org,pk_group,pk_busitype,rowno,\n" +
|
||||||
"pk_supplier,pk_bankacc_r,pk_currtype,pk_decidedept,gllcrate,applysum,applymny,vdef1,pk_project,vdef2,vdef3,\n" +
|
"pk_supplier,pk_bankacc_r,customer,pk_currtype,pk_decidedept,gllcrate,applysum,applymny,vdef1,pk_project,vdef2,vdef3,\n" +
|
||||||
"vdef4 from v_cmp_apply_b where formmain_id= '"+formmainId+"' " );
|
"vdef4 from v_cmp_apply_b where formmain_id= '"+formmainId+"' " );
|
||||||
List<HashMap<String, Object>> hashMapsDetails = serviceDataDao.queryListBySWSource(stringBufferDetails.toString(),mdmModuleSourceEntity);
|
List<HashMap<String, Object>> hashMapsDetails = serviceDataDao.queryListBySWSource(stringBufferDetails.toString(),mdmModuleSourceEntity);
|
||||||
JSONArray cmp_apply_b = new JSONArray();
|
JSONArray cmp_apply_b = new JSONArray();
|
||||||
|
|
Loading…
Reference in New Issue