Commit e628f3cd authored by 5359's avatar 5359

中登网开发

parent bdff3c2d
package com.hand.app.zhongDengWang.dto;
/**
* Auto Generated By Hap Code Generator
**/
import com.hand.hap.mybatis.annotation.ExtensionAttribute;
import com.hand.hap.system.dto.BaseDTO;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@ExtensionAttribute(disable = true)
@Table(name = "FND_ZHONG_DENG_HEADS")
public class FndZhongDengHeads extends BaseDTO {
@Id
@GeneratedValue
private Long headId;
private String contractNumber;
private String bpName;
private String upStage;
private String initRegisterNumber;
private String amendRegisterNumber;
private String extendRegisterNumber;
private String abolishRegisterNumber;
private String authorizationCode;
public void setHeadId(Long headId) {
this.headId = headId;
}
public Long getHeadId() {
return headId;
}
public void setContractNumber(String contractNumber) {
this.contractNumber = contractNumber;
}
public String getContractNumber() {
return contractNumber;
}
public void setBpName(String bpName) {
this.bpName = bpName;
}
public String getBpName() {
return bpName;
}
public void setUpStage(String upStage) {
this.upStage = upStage;
}
public String getUpStage() {
return upStage;
}
public void setInitRegisterNumber(String initRegisterNumber) {
this.initRegisterNumber = initRegisterNumber;
}
public String getInitRegisterNumber() {
return initRegisterNumber;
}
public void setAmendRegisterNumber(String amendRegisterNumber) {
this.amendRegisterNumber = amendRegisterNumber;
}
public String getAmendRegisterNumber() {
return amendRegisterNumber;
}
public void setExtendRegisterNumber(String extendRegisterNumber) {
this.extendRegisterNumber = extendRegisterNumber;
}
public String getExtendRegisterNumber() {
return extendRegisterNumber;
}
public void setAbolishRegisterNumber(String abolishRegisterNumber) {
this.abolishRegisterNumber = abolishRegisterNumber;
}
public String getAbolishRegisterNumber() {
return abolishRegisterNumber;
}
public void setAuthorizationCode(String authorizationCode) {
this.authorizationCode = authorizationCode;
}
public String getAuthorizationCode() {
return authorizationCode;
}
}
package com.hand.app.zhongDengWang.mapper;
import com.hand.app.zhongDengWang.dto.FndZhongDengHeads;
import com.hand.hap.mybatis.common.Mapper;
public interface FndZhongDengHeadsMapper extends Mapper<FndZhongDengHeads>{
}
\ No newline at end of file
package com.hand.app.zhongDengWang.service;
import com.hand.app.zhongDengWang.dto.FndZhongDengHeads;
import com.hand.hap.core.ProxySelf;
import com.hand.hap.system.service.IBaseService;
public interface IFndZhongDengHeadsService extends IBaseService<FndZhongDengHeads>, ProxySelf<IFndZhongDengHeadsService>{
}
\ No newline at end of file
package com.hand.app.zhongDengWang.service.impl;
import com.hand.app.zhongDengWang.dto.FndZhongDengHeads;
import com.hand.app.zhongDengWang.service.IFndZhongDengHeadsService;
import com.hand.hap.system.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional(rollbackFor = Exception.class)
public class FndZhongDengHeadsServiceImpl extends BaseServiceImpl<FndZhongDengHeads> implements IFndZhongDengHeadsService {
}
\ No newline at end of file
package com.hand.app.zhongDengWang.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hand.app.zhongDengWang.service.IFndZhongDengHeadsService;
import com.hand.app.zhongDengWang.service.IZdwWsRequestsService;
import com.hand.app.zhongDengWang.dto.ZdwLoginTokenInterface;
import com.hand.app.zhongDengWang.dto.FndZhongDengHeads;
import com.hand.app.zhongDengWang.dto.FndZhongDengLines;
import com.hand.app.zhongDengWang.dto.FndZhongDengBatch;
import com.hand.app.zhongDengWang.dto.HlsWsRequests;
......@@ -10,6 +12,7 @@ import com.hand.app.zhongDengWang.service.IZdwWsRequestsService;
import com.hand.app.zhongDengWang.mapper.HlsWsRequestsMapper;
import com.hand.app.zhongDengWang.service.IFndZhongDengLinesService;
import com.hand.app.zhongDengWang.mapper.ZdwLoginTokenInterfaceMapper;
import com.hand.app.zhongDengWang.mapper.FndZhongDengHeadsMapper;
import com.hand.app.zhongDengWang.mapper.FndZhongDengLinesMapper;
import com.hand.app.zhongDengWang.mapper.FndZhongDengBatchMapper;
import com.hand.app.zhongDengWang.utils.ClientUtils;
......@@ -50,8 +53,12 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
@Autowired
ZdwLoginTokenInterfaceMapper zdwLoginTokenInterfaceMapper;
@Autowired
FndZhongDengHeadsMapper fndZhongDengHeadsMapper;
@Autowired
FndZhongDengLinesMapper fndZhongDengLinesMapper;
@Autowired
IFndZhongDengHeadsService fndZhongDengHeadsService;
@Autowired
IFndZhongDengLinesService fndZhongDengLinesService;
@Autowired
IZdwWsRequestsService zdwWsRequestsService;
......@@ -356,6 +363,7 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
public void registerThread(IRequest request, List<FndZhongDengBatch> fndZhongDengBatches, String loginToken) {
JSONObject resultJson = new JSONObject();
List<FndZhongDengLines> fndZhongDengLinesList = new ArrayList<>();
List<FndZhongDengHeads> fndZhongDengHeadsList = new ArrayList<>();
/*根据传入ids循环上报中登网*/
synchronized (lock) {
for (FndZhongDengBatch batch : fndZhongDengBatches) {
......@@ -406,10 +414,33 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
/*成功*/
if (Objects.nonNull(registerResult) && "001".equalsIgnoreCase(registerResult)) {
FndZhongDengHeads fndZhongDengHeads = new FndZhongDengHeads();
fndZhongDengHeads.setHeadId(fndZhongDengLines.getHeadId());
fndZhongDengHeads = fndZhongDengHeadsMapper.selectByPrimaryKey(fndZhongDengHeads);
/*回写登记报文号registernumber*/
if (!returnJson.getJSONObject("feedback").isNull("registernumber")) {
String registerNumber = returnJson.getJSONObject("feedback").getString("registernumber");
String authorizationCode = returnJson.getJSONObject("feedback").getString("authorizationcode");
fndZhongDengLines.setRegisterNumber(registerNumber);
/*初始登记*/
if ("01".equalsIgnoreCase(fndZhongDengLines.getUpStage())) {
fndZhongDengHeads.setInitRegisterNumber(registerNumber);
} else if ("02".equalsIgnoreCase(fndZhongDengLines.getUpStage())) {
fndZhongDengHeads.setAmendRegisterNumber(registerNumber);
} else if ("03".equalsIgnoreCase(fndZhongDengLines.getUpStage())) {
fndZhongDengHeads.setExtendRegisterNumber(registerNumber);
} else if ("05".equalsIgnoreCase(fndZhongDengLines.getUpStage())) {
fndZhongDengHeads.setAbolishRegisterNumber(registerNumber);
}
}
/*回写修改码authorizationcode*/
if (!returnJson.getJSONObject("feedback").isNull("authorizationcode")) {
String authorizationCode = returnJson.getJSONObject("feedback").getString("authorizationcode");
fndZhongDengLines.setAuthorizationCode(authorizationCode);
fndZhongDengHeads.setAuthorizationCode(authorizationCode);
}
fndZhongDengHeads.set__status(DTOStatus.UPDATE);
fndZhongDengHeadsList.add(fndZhongDengHeads);
fndZhongDengLines.setUpStatus("SUCCESS");
fndZhongDengLines.setReturnMsg("上报成功");
/*失败*/
......@@ -435,6 +466,9 @@ public class ZdwWsRequestsServiceImpl implements IZdwWsRequestsService {
}
}
if (fndZhongDengHeadsList.size() > 0) {
fndZhongDengHeadsService.batchUpdate(request, fndZhongDengHeadsList);
}
if (fndZhongDengLinesList.size() > 0) {
fndZhongDengLinesService.batchUpdate(request, fndZhongDengLinesList);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment