增加凭证日志关联,当凭证日志时间大于当前时间才推送凭证

This commit is contained in:
hecan 2024-11-05 11:42:58 +08:00
parent f90d1808a0
commit 3c3b23c17c
3 changed files with 22 additions and 0 deletions

View File

@ -59,6 +59,16 @@ public class SenderGlPzmlEntity extends BaseEntity {
private String bmdm; private String bmdm;
private String ts;
public String getTs() {
return ts;
}
public void setTs(String ts) {
this.ts = ts;
}
public String getBmdm() { public String getBmdm() {
return bmdm; return bmdm;
} }

View File

@ -42,6 +42,7 @@
<result property="pzsbm" column="pzsbm" jdbcType="VARCHAR"/> <result property="pzsbm" column="pzsbm" jdbcType="VARCHAR"/>
<result property="stamp" column="stamp" jdbcType="VARCHAR"/> <result property="stamp" column="stamp" jdbcType="VARCHAR"/>
<result property="yspzje" column="yspzje" jdbcType="VARCHAR"/> <result property="yspzje" column="yspzje" jdbcType="VARCHAR"/>
<result property="ts" column="ts" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 查询的字段--> <!-- 查询的字段-->
<sql id = "SenderGlPzmlEntity_Base_Column_List"> <sql id = "SenderGlPzmlEntity_Base_Column_List">
@ -290,9 +291,11 @@
pznr.gsdm,pznr.zth,pznr.kjqj,pznr.pzh pznr.gsdm,pznr.zth,pznr.kjqj,pznr.pzh
from GL_Pzml pzml from GL_Pzml pzml
left join gl_pznr pznr on pznr.idpzh=pzml.idpzh and pzml.kjqj=pznr.kjqj left join gl_pznr pznr on pznr.idpzh=pzml.idpzh and pzml.kjqj=pznr.kjqj
left join pzmlCzrzb czrz on czrz.idpzh=pzml.idpzh
<trim prefix="where" prefixOverrides="and"> <trim prefix="where" prefixOverrides="and">
<if test="idpzh !=null and idpzh!='' "> and pzml.idpzh = #{idpzh} </if> <if test="idpzh !=null and idpzh!='' "> and pzml.idpzh = #{idpzh} </if>
and (pzml.srrq>=#{srrq} or pzml.shrq >=#{shrq} or pzml.jzrq>=#{jzrq}) and pznr.zbid!=0 and pzml.zt!='0' and (pzml.srrq>=#{srrq} or pzml.shrq >=#{shrq} or pzml.jzrq>=#{jzrq}) and pznr.zbid!=0 and pzml.zt!='0'
and czrz.update_time > #{ts}
</trim> </trim>
group by pznr.idpznr, group by pznr.idpznr,
pznr.kjqj, pznr.kjqj,

View File

@ -38,6 +38,8 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
private static String URLTest="http://60.205.205.82/";//测试环境 http://39.106.158.149/ private static String URLTest="http://60.205.205.82/";//测试环境 http://39.106.158.149/
private static String URL="http://192.168.250.71/";//正式环境 http://192.168.42.22/ private static String URL="http://192.168.250.71/";//正式环境 http://192.168.42.22/
private String ts = "";
private ISenderGlPzmlDao senderGlPzmlDao; private ISenderGlPzmlDao senderGlPzmlDao;
@Autowired @Autowired
@ -684,11 +686,18 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
if(StrUtil.isEmpty(token)){ if(StrUtil.isEmpty(token)){
return BaseResult.getFailureMessageEntity("token为空请先获取token"); return BaseResult.getFailureMessageEntity("token为空请先获取token");
} }
if(null== ts|| "".equals(ts)){
ts = com.hzya.frame.dateutil.DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
}
glPzmlEntity.setTs(ts);
//查询凭证数据 //查询凭证数据
List<SenderGlPzmlEntity> list = senderGlPzmlDao.queryGlPzmlSxy(glPzmlEntity); List<SenderGlPzmlEntity> list = senderGlPzmlDao.queryGlPzmlSxy(glPzmlEntity);
if(CollectionUtils.isEmpty(list)){ if(CollectionUtils.isEmpty(list)){
return BaseResult.getSuccessMessageEntity("没有需要同步得凭证",null); return BaseResult.getSuccessMessageEntity("没有需要同步得凭证",null);
} }
//更新TS时间
ts = com.hzya.frame.dateutil.DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
logger.info("凭证TS已更新" + ts);
try { try {
String result=null; String result=null;
for (SenderGlPzmlEntity pzmlEntity : list) { for (SenderGlPzmlEntity pzmlEntity : list) {