开票定时任务查询瑞宏接口

master
pangyang 2 years ago
parent 2ee0c22970
commit e6958e0f77

@ -13,7 +13,7 @@ public interface InvInvoiceInfoMapper extends CommonMapper<InvInvoiceInfo> {
List<InvInvoiceInfo> getByIds(String GID);
void updateById(InvInvoiceInfo invoice);
List<InvInvoiceInfo> selectcheck();
List<InvInvoiceInfo> selectcheck(String linkId);
void updateBySerinal(InvInvoiceInfo invoice);

@ -19,4 +19,7 @@ public interface InvLinkInfoMapper extends CommonMapper<InvLinkInfo> {
List<InvLinkInfo> selectByStatus();
List<InvLinkInfo> selectLinkInfoByStatus();
}

@ -44,7 +44,7 @@ public class InvoiceSendTask {
@Autowired
private InvInvoiceInfoMapper invInvoiceInfoMapper;
// @Scheduled(cron = "*/50 * * * * ?")//每个5秒执行一次任务(方法)
@Scheduled(cron = "*/58 * * * * ?")//每个5秒执行一次任务(方法)
public void timeScheduled(){

@ -11,7 +11,7 @@ public class InvoiceTask {
@Autowired
private InvLinkInfoService invLinkInfoService;
@Scheduled(cron = "*/20 * * * * ?")//每个5秒执行一次任务(方法)
@Scheduled(cron = "*/58 * * * * ?")//每个58秒执行一次任务(方法)
public void timeScheduled(){
invLinkInfoService.getInvoice(new InvLinkInfo());

@ -1098,19 +1098,21 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService {
public HttpResult getInvoice(InvLinkInfo info) {
List<InvInvoiceInfo> list = invInvoiceInfoMapper.selectcheck();
List<InvLinkInfo> linkinfos = invLinkInfoMapper.selectLinkInfoByStatus();
for(InvLinkInfo invlink : linkinfos){
List<InvInvoiceInfo> list = invInvoiceInfoMapper.selectcheck(invlink.getGID());
if(null != list && list.size()>0){
ResponseData data = null;
for(InvInvoiceInfo invoice : list){
String linkid = invInvoiceSplitMapper.getLinkIdsByinvoiceId(invoice.getGID());
InvLinkInfo invlink = new InvLinkInfo();
invlink.setGID(linkid);
InvLinkInfo linkinfo = invLinkInfoMapper.selectByGID(invlink);
if(!"1".equals(linkinfo.getStatus())){
continue;
}
// String linkid = invInvoiceSplitMapper.getLinkIdsByinvoiceId(invoice.getGID());
//
// InvLinkInfo invlink = new InvLinkInfo();
// invlink.setGID(linkid);
// InvLinkInfo linkinfo = invLinkInfoMapper.selectByGID(invlink);
// if(!"1".equals(linkinfo.getStatus())){
// continue;
// }
try {
data = new ResponseData();
@ -1155,14 +1157,14 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService {
for(InvInvoiceInfo invoice : list){
String linkid = invInvoiceSplitMapper.getLinkIdsByinvoiceId(invoice.getGID());
InvLinkInfo invlink = new InvLinkInfo();
invlink.setGID(linkid);
InvLinkInfo invlinkinfo = invLinkInfoMapper.selectByGID(invlink);
if(!"1".equals(invlinkinfo.getStatus())){
continue;
}
// String linkid = invInvoiceSplitMapper.getLinkIdsByinvoiceId(invoice.getGID());
//
// InvLinkInfo invlink = new InvLinkInfo();
// invlink.setGID(linkid);
// InvLinkInfo invlinkinfo = invLinkInfoMapper.selectByGID(invlink);
// if(!"1".equals(invlinkinfo.getStatus())){
// continue;
// }
String likid = invInvoiceSplitMapper.getlinkdId(invoice.getGID());
//判断是否存在重复的linkid
@ -1244,6 +1246,9 @@ public class InvLinkInfoServiceImpl implements InvLinkInfoService {
}
}
}
return HttpResult.ok();
}

@ -81,8 +81,12 @@
select * from InvInvoiceInfo info WHERE GID = #{GID} and (Status='success' or Status='fail')
</select>
<select id="selectcheck" resultMap="invInvoiceInfoMap" >
select * from InvInvoiceInfo info WHERE info.InvCode is null and (info.Status is null or info.Status='process')
<select id="selectcheck" resultMap="invInvoiceInfoMap" parameterType="String">
SELECT info.* FROM InvInvoiceInfo info
WHERE info.GID IN (SELECT distinct(split.InvoiceId) from InvInvoiceSplit split LEFT JOIN InvLinkInfo link
ON split.LinkId = link.GID
where split.LinkId = #{linkId}) and info.InvCode is null and (info.Status is null or info.Status='process')
</select>

@ -36,6 +36,10 @@
SELECT * from InvLinkInfo linkinfo where linkinfo.GID = #{GID}
</select>
<select id="selectLinkInfoByStatus" resultMap="invLinkInfoMap" >
SELECT * from InvLinkInfo linkinfo where linkinfo.Status='1'
</select>
<select id="selectByStatus" resultMap="invLinkInfoMap" parameterType="String">
SELECT * from InvLinkInfo linkinfo where linkinfo.Status = '2' and linkinfo.SendStatus='0'
</select>

Loading…
Cancel
Save