凭证已作废接口调整
This commit is contained in:
parent
724ce090ab
commit
1a858e6125
|
@ -19,15 +19,15 @@ spring:
|
||||||
# username: root
|
# username: root
|
||||||
# password: bd993088e8a7c3dc5f44441617f9b4bf
|
# password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||||
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||||
# url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||||
# username: root
|
username: root
|
||||||
# password: 62e4295b615a30dbf3b8ee96f41c820b
|
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||||
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||||
|
|
||||||
url: jdbc:sqlserver://192.168.15.15:1433;DatabaseName=businesscenter;encrypt=false;trustServerCertificate=true
|
# url: jdbc:sqlserver://192.168.15.15:1433;DatabaseName=businesscenter;encrypt=false;trustServerCertificate=true
|
||||||
username: sa
|
# username: sa
|
||||||
password: dec7d858be572746a8432026c0e9312c
|
# password: dec7d858be572746a8432026c0e9312c
|
||||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
savefile:
|
savefile:
|
||||||
# 文件保存路径
|
# 文件保存路径
|
||||||
path: D:\yongansystem\kangarooDataCenter\v3\logs
|
path: D:\yongansystem\kangarooDataCenter\v3\logs
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||||
<beans default-autowire="byName">
|
<beans default-autowire="byName">
|
||||||
<bean name="glPzmlInitializer" class="com.hzya.frame.plugin.grpU8.glpzml.plugin.GlPzmlPluginInitializer" />
|
<bean name="glPzmlInitializer" class="com.hzya.frame.plugin.grpU8.glpzml.plugin.GlPzmlPluginInitializer" />
|
||||||
|
<bean name="glPzmlCancelledInitializer" class="com.hzya.frame.plugin.grpU8.glpzml.plugin.GlPzmlCancelledPluginInitializer" />
|
||||||
</beans>
|
</beans>
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class SenderGlPzmlDaoImpl extends MybatisGenericDao<SenderGlPzmlEntity, S
|
||||||
return (List<SenderGlPzmlEntity>) super.selectList("queryGlPzmlSxy",senderGlPzmlEntity);
|
return (List<SenderGlPzmlEntity>) super.selectList("queryGlPzmlSxy",senderGlPzmlEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DS("#entity.dataSourceCode")
|
@DS("#senderGlPzmlEntity.dataSourceCode")
|
||||||
@Override
|
@Override
|
||||||
public List<SenderGlPzmlEntity> queryGlPzmlSxyCancelled(SenderGlPzmlEntity senderGlPzmlEntity) {
|
public List<SenderGlPzmlEntity> queryGlPzmlSxyCancelled(SenderGlPzmlEntity senderGlPzmlEntity) {
|
||||||
return (List<SenderGlPzmlEntity>) super.selectList("queryGlPzmlSxyCancelled",senderGlPzmlEntity);
|
return (List<SenderGlPzmlEntity>) super.selectList("queryGlPzmlSxyCancelled",senderGlPzmlEntity);
|
||||||
|
|
|
@ -294,7 +294,7 @@
|
||||||
left join pzmlCzrzb czrz on czrz.idpzh=pzml.idpzh
|
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 czrz.update_time > #{ts} and pzml.zt in ('1','2','3')
|
and czrz.update_time > #{ts} and pzml.zt in ('1','2','3')
|
||||||
</trim>
|
</trim>
|
||||||
group by pznr.idpznr,
|
group by pznr.idpznr,
|
||||||
|
@ -306,7 +306,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询列表 商学院所需要的凭证数据-->
|
<!-- 查询列表 商学院所需要的凭证数据-->
|
||||||
<select id="queryGlPzmlSxyqueryGlPzmlSxyCancelled" resultMap="get-SenderGlPzmlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
|
<select id="queryGlPzmlSxyCancelled" resultMap="get-SenderGlPzmlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
|
||||||
select
|
select
|
||||||
pznr.idpznr as idpzh,
|
pznr.idpznr as idpzh,
|
||||||
pznr.kjqj as kjqj,
|
pznr.kjqj as kjqj,
|
||||||
|
@ -317,10 +317,10 @@
|
||||||
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
|
left join pzmlCzrzbzf 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 czrz.update_time > #{ts} and pzml.zt='0'
|
and czrz.update_time > #{ts} and pzml.zt='0'
|
||||||
</trim>
|
</trim>
|
||||||
group by pznr.idpznr,
|
group by pznr.idpznr,
|
||||||
|
|
|
@ -760,8 +760,53 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object queryGlPzmlSxyCancelled(JSONObject jsonObject) {
|
public Object queryGlPzmlSxyCancelled(JSONObject json) {
|
||||||
return null;
|
JSONObject jsonObject = json.getJSONObject("jsonStr");
|
||||||
|
SenderGlPzmlEntity glPzmlEntity = jsonObject.toJavaObject(SenderGlPzmlEntity.class);
|
||||||
|
if(StrUtil.isEmpty(glPzmlEntity.getSrrq())){
|
||||||
|
glPzmlEntity.setSrrq(DateUtil.format(new Date(),"yyyyMMdd"));
|
||||||
|
}
|
||||||
|
if(StrUtil.isEmpty(glPzmlEntity.getShrq())){
|
||||||
|
glPzmlEntity.setShrq(DateUtil.format(new Date(),"yyyyMMdd"));
|
||||||
|
}
|
||||||
|
if(StrUtil.isEmpty(glPzmlEntity.getJzrq())){
|
||||||
|
glPzmlEntity.setJzrq(DateUtil.format(new Date(),"yyyyMMdd"));
|
||||||
|
}
|
||||||
|
//获取token
|
||||||
|
String token = getToken();
|
||||||
|
if(StrUtil.isEmpty(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.queryGlPzmlSxyCancelled(glPzmlEntity);
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
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 {
|
||||||
|
String result=null;
|
||||||
|
for (SenderGlPzmlEntity pzmlEntity : list) {
|
||||||
|
JSONObject jsonObjectCode=new JSONObject();
|
||||||
|
jsonObjectCode.put("code",pzmlEntity.getIdpzh());
|
||||||
|
String params = jsonObjectCode.toJSONString();
|
||||||
|
logger.info("调用商学院凭证作废接口请求参数:{}",params);
|
||||||
|
result = HttpRequest.post(URL + "nky/service/zsApi/dealInvalid?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("根据凭证查询作废凭证失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue