凭证已作废接口调整
This commit is contained in:
parent
724ce090ab
commit
1a858e6125
|
@ -19,15 +19,15 @@ spring:
|
|||
# username: root
|
||||
# password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
# 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
|
||||
# username: root
|
||||
# password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
# 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
|
||||
username: root
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
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
|
||||
username: sa
|
||||
password: dec7d858be572746a8432026c0e9312c
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://192.168.15.15:1433;DatabaseName=businesscenter;encrypt=false;trustServerCertificate=true
|
||||
# username: sa
|
||||
# password: dec7d858be572746a8432026c0e9312c
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
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">
|
||||
<beans default-autowire="byName">
|
||||
<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>
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SenderGlPzmlDaoImpl extends MybatisGenericDao<SenderGlPzmlEntity, S
|
|||
return (List<SenderGlPzmlEntity>) super.selectList("queryGlPzmlSxy",senderGlPzmlEntity);
|
||||
}
|
||||
|
||||
@DS("#entity.dataSourceCode")
|
||||
@DS("#senderGlPzmlEntity.dataSourceCode")
|
||||
@Override
|
||||
public List<SenderGlPzmlEntity> queryGlPzmlSxyCancelled(SenderGlPzmlEntity senderGlPzmlEntity) {
|
||||
return (List<SenderGlPzmlEntity>) super.selectList("queryGlPzmlSxyCancelled",senderGlPzmlEntity);
|
||||
|
|
|
@ -294,7 +294,7 @@
|
|||
left join pzmlCzrzb czrz on czrz.idpzh=pzml.idpzh
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<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')
|
||||
</trim>
|
||||
group by pznr.idpznr,
|
||||
|
@ -306,7 +306,7 @@
|
|||
</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
|
||||
pznr.idpznr as idpzh,
|
||||
pznr.kjqj as kjqj,
|
||||
|
@ -317,10 +317,10 @@
|
|||
pznr.gsdm,pznr.zth,pznr.kjqj,pznr.pzh
|
||||
from GL_Pzml pzml
|
||||
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">
|
||||
<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'
|
||||
</trim>
|
||||
group by pznr.idpznr,
|
||||
|
|
|
@ -760,8 +760,53 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object queryGlPzmlSxyCancelled(JSONObject jsonObject) {
|
||||
return null;
|
||||
public Object queryGlPzmlSxyCancelled(JSONObject json) {
|
||||
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