调整电子回单和支付结果回写
This commit is contained in:
parent
f2938a2dc4
commit
b378f3f9ba
base-service/src/main/java/com/hzya/frame/sysnew/comparison/serviceData
|
@ -4,4 +4,34 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
|||
import com.hzya.frame.sysnew.comparison.serviceData.entity.CtpAttachmentEntity;
|
||||
|
||||
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;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sysnew.comparison.serviceData.dao.ICtpAttachmentDao;
|
||||
import com.hzya.frame.sysnew.comparison.serviceData.dao.IServiceDataDao;
|
||||
|
@ -8,4 +9,21 @@ import org.springframework.stereotype.Repository;
|
|||
|
||||
@Repository(value = "CtpAttachmentDaoImpl")
|
||||
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>
|
||||
</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(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' "> id, </if>
|
||||
|
@ -76,7 +87,7 @@
|
|||
</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
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<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 billCode;//单据编号
|
||||
|
||||
private String summary_id;//summary_id
|
||||
private String summaryId;//summaryId
|
||||
|
||||
private String bipAmountField;//BIP打款金额字段
|
||||
private String bipAmount;//BIP打款金额
|
||||
|
@ -37,12 +37,12 @@ public class ServiceDataEntity extends BaseEntity {
|
|||
this.bipAmount = bipAmount;
|
||||
}
|
||||
|
||||
public String getSummary_id() {
|
||||
return summary_id;
|
||||
public String getSummaryId() {
|
||||
return summaryId;
|
||||
}
|
||||
|
||||
public void setSummary_id(String summary_id) {
|
||||
this.summary_id = summary_id;
|
||||
public void setSummaryId(String summaryId) {
|
||||
this.summaryId = summaryId;
|
||||
}
|
||||
|
||||
public String getTabName() {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
,receipt_filed as receiptFiled
|
||||
,receipt as receipt
|
||||
,vdef1 as billCode
|
||||
,summary_id
|
||||
,summary_id as summaryId
|
||||
,bip_payment_number_field as bipPaymentNumberField
|
||||
,bip_payment_number as bipPaymentNumber
|
||||
,bip_amount_field as bipAmountField
|
||||
|
@ -90,7 +90,7 @@
|
|||
<update id="updatePayResult" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity" >
|
||||
update ${tabName} set
|
||||
<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="payResult != null and payResult != ''"> ${payResultFiled} = #{payResult}</if>
|
||||
</trim>
|
||||
|
@ -100,7 +100,7 @@
|
|||
<!--通过主键修改方法-->
|
||||
<update id="updateElectronic" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity" >
|
||||
update ${tabName} set
|
||||
set ${receiptFiled} = #{receipt}
|
||||
${receiptFiled} = #{receipt}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
|
|
|
@ -197,38 +197,46 @@ public class ServiceDataServiceImpl extends BaseService<ComparisonEntity,String>
|
|||
String file_url = jsonObject.getString("fileUrl");
|
||||
CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
|
||||
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.setAtt_reference(att_reference);
|
||||
ctpAttachmentEntity.setDataSourceCode(serviceDataEntity.getDataSourceCode());
|
||||
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) {
|
||||
String category = jsonObject.getString("category");
|
||||
String type = jsonObject.getString("type");
|
||||
String filename = jsonObject.getString("filename");
|
||||
String mime_type = jsonObject.getString("mimeType");
|
||||
String attachment_size = jsonObject.getString("size");
|
||||
String id = String.valueOf(UUIDLong.longUUID());
|
||||
ctpAttachmentEntity.setCategory(category);
|
||||
ctpAttachmentEntity.setFilename(filename);
|
||||
ctpAttachmentEntity.setType(type);
|
||||
ctpAttachmentEntity.setMime_type(mime_type);
|
||||
ctpAttachmentEntity.setAttachment_size(attachment_size);
|
||||
ctpAttachmentEntity.setId(id);
|
||||
ctpAttachmentEntity.setCategory("2");
|
||||
ctpAttachmentEntity.setCreatedate(new Date());
|
||||
ctpAttachmentEntity.setDataSourceCode(jsonObject.getString("dataSourceCode"));
|
||||
ctpAttachmentDao.save(ctpAttachmentEntity);
|
||||
logger.info("OA附件新增成功");
|
||||
if(null !=ctpAttachment) {
|
||||
String type =ctpAttachment.getType();
|
||||
String filename = ctpAttachment.getFilename();
|
||||
String mime_type =ctpAttachment.getMime_type();
|
||||
String attachment_size = ctpAttachment.getAttachment_size();
|
||||
String id = String.valueOf(UUIDLong.longUUID());
|
||||
ctpAttachmentEntity.setCategory("66");
|
||||
ctpAttachmentEntity.setFilename(filename);
|
||||
ctpAttachmentEntity.setType(type);
|
||||
ctpAttachmentEntity.setMime_type(mime_type);
|
||||
ctpAttachmentEntity.setAttachment_size(attachment_size);
|
||||
ctpAttachmentEntity.setId(id);
|
||||
ctpAttachmentEntity.setCreatedate(new Date());
|
||||
ctpAttachmentEntity.setDataSourceCode(serviceDataEntity.getDataSourceCode());
|
||||
ctpAttachmentDao.saveCtpAttachmentEntity(ctpAttachmentEntity);
|
||||
logger.info("OA附件新增成功");
|
||||
}else{
|
||||
logger.info("======根据附件id:{}查询在CTP_file表中不存在======");
|
||||
}
|
||||
} else {
|
||||
if (ctpAttachmentEntityListBase.size() > 1) {
|
||||
throw new BaseSystemException("OA附件业务表中查到多条记录");
|
||||
}
|
||||
//更新数据到OA附件业务表中
|
||||
ctpAttachmentDao.save(ctpAttachmentEntity);
|
||||
ctpAttachmentDao.updateCtpAttachmentEntity(ctpAttachmentEntity);
|
||||
logger.info("OA附件更新成功");
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("电子回单更新成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -312,7 +320,7 @@ public class ServiceDataServiceImpl extends BaseService<ComparisonEntity,String>
|
|||
vdef1=cmp_apply.getString("vdef1");
|
||||
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" +
|
||||
"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+"' " );
|
||||
List<HashMap<String, Object>> hashMapsDetails = serviceDataDao.queryListBySWSource(stringBufferDetails.toString(),mdmModuleSourceEntity);
|
||||
JSONArray cmp_apply_b = new JSONArray();
|
||||
|
|
Loading…
Reference in New Issue