parent
e8aefea901
commit
d196b34978
@ -0,0 +1,418 @@ |
|||||||
|
package com.dxhy.order.consumer.handle; |
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil; |
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.alibaba.fastjson.JSONArray; |
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.dxhy.order.baseservice.module.base.service.BaseService; |
||||||
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.DeptEntity; |
||||||
|
import com.dxhy.order.constant.*; |
||||||
|
import com.dxhy.order.consumer.config.OpenApiConfig; |
||||||
|
import com.dxhy.order.consumer.openapi.protocol.v6.hzqrd.QdCommonRspV6; |
||||||
|
import com.dxhy.order.consumer.openapi.service.InterfaceServiceV6; |
||||||
|
import com.dxhy.order.invoice.module.invoicespecial.model.CommonSpecialInvoice; |
||||||
|
import com.dxhy.order.invoice.module.invoicespecial.model.SpecialInvoiceReversalEntity; |
||||||
|
import com.dxhy.order.invoice.module.invoicespecial.service.SpecialInvoiceReversalService; |
||||||
|
import com.dxhy.order.model.SpecialInvoiceReversalItem; |
||||||
|
import com.dxhy.order.utils.HttpUtils; |
||||||
|
import com.dxhy.order.utils.JsonUtils; |
||||||
|
import com.google.common.collect.Maps; |
||||||
|
import com.xxl.job.core.biz.model.ReturnT; |
||||||
|
import com.xxl.job.core.handler.IJobHandler; |
||||||
|
import com.xxl.job.core.handler.annotation.JobHandler; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
import org.apache.http.entity.ContentType; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.text.ParseException; |
||||||
|
import java.text.SimpleDateFormat; |
||||||
|
import java.util.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Description: 同步全电红字确认单 |
||||||
|
* @Author liufeilong |
||||||
|
* @Date 2023-04-15 |
||||||
|
**/ |
||||||
|
@Slf4j |
||||||
|
@Component |
||||||
|
@JobHandler(value = "/qdHzqrdTask") |
||||||
|
@RequestMapping(value = "/qdHzqrd") |
||||||
|
public class SyncQdHzqrdTask extends IJobHandler { |
||||||
|
private static final String LOGGER_MSG = "(定时同步全电红字确认单)"; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private InterfaceServiceV6 interfaceServiceV6; |
||||||
|
@Resource |
||||||
|
private BaseService baseService; |
||||||
|
@Resource |
||||||
|
private SpecialInvoiceReversalService specialInvoiceReversalService; |
||||||
|
@Resource |
||||||
|
private OpenApiConfig openApiConfig; |
||||||
|
|
||||||
|
@Override |
||||||
|
@PostMapping("/sync") |
||||||
|
public ReturnT<String> execute(String param) { |
||||||
|
log.debug("{}定时任务开始,请求参数:{}", LOGGER_MSG, param); |
||||||
|
try { |
||||||
|
/** |
||||||
|
* { |
||||||
|
* "YHJSLX": "用户角色类型", |
||||||
|
* "XSFNSRSBH": "(销售方)统一社会信用代码/纳税人识别号/身份证件号码", |
||||||
|
* "XSFMC": "(销售方)名称", |
||||||
|
* "GMFNSRSBH": "(购买方)统一社会信用代码/纳税人识别号/身份证件号码", |
||||||
|
* "GMFMC": "(购买方)名称", |
||||||
|
* "LRFSF": "录入方身份", |
||||||
|
* "LRRQQ": "录入日期起", |
||||||
|
* "LRRQZ": "录入日期止", |
||||||
|
* "LZFPDM": "蓝字发票代码", |
||||||
|
* "LZFPHM": "蓝字发票号码", |
||||||
|
* "HZFPXXQRDBH": "红字确认单编号", |
||||||
|
* "HZQRXXZTDM": "红字确认信息状态代码", |
||||||
|
* "PAGENUMBER": "页码", |
||||||
|
* "PAGESIZE": "每页数量" |
||||||
|
* } |
||||||
|
*/ |
||||||
|
Map paramMap = JsonUtils.getInstance().parseObject(param, Map.class); |
||||||
|
List<Map> paramList = new ArrayList<>(); |
||||||
|
if (ObjectUtil.isNull(paramMap)) { |
||||||
|
Map<String,String> shMap = new HashMap(); |
||||||
|
final List<DeptEntity> deptEntities = queryAllDeptInfo(); |
||||||
|
deptEntities.stream().forEach(f -> { |
||||||
|
if(!shMap.containsKey(f.getTaxpayerCode())){ |
||||||
|
shMap.put(f.getTaxpayerCode(),f.getTaxpayerName()); |
||||||
|
} |
||||||
|
}); |
||||||
|
final org.joda.time.DateTime dateTime = new org.joda.time.DateTime(); |
||||||
|
final String endTime = dateTime.toString(ConfigureConstant.DATE_FORMAT_DATE); |
||||||
|
final String startTime = dateTime.minusDays(5).toString(ConfigureConstant.DATE_FORMAT_DATE); |
||||||
|
for(Map.Entry<String, String> entry:shMap.entrySet()){ |
||||||
|
Map paramMap001 = new HashMap(); |
||||||
|
//用户角色类型 0:销方 1:购方
|
||||||
|
paramMap001.put("YHJSLX","0"); |
||||||
|
paramMap001.put("XSFNSRSBH",entry.getKey()); |
||||||
|
paramMap001.put("XSFMC",entry.getValue()); |
||||||
|
paramMap001.put("LRRQQ",startTime); |
||||||
|
paramMap001.put("LRRQZ",endTime); |
||||||
|
paramMap001.put("PAGENUMBER","1"); |
||||||
|
paramMap001.put("PAGESIZE","100"); |
||||||
|
paramList.add(paramMap001); |
||||||
|
|
||||||
|
Map paramMap101 = new HashMap(); |
||||||
|
//用户角色类型 0:销方 1:购方
|
||||||
|
paramMap101.put("YHJSLX","1"); |
||||||
|
paramMap101.put("GMFNSRSBH",entry.getKey()); |
||||||
|
paramMap101.put("GMFMC",entry.getValue()); |
||||||
|
paramMap101.put("LRRQQ",startTime); |
||||||
|
paramMap101.put("LRRQZ",endTime); |
||||||
|
paramMap101.put("PAGENUMBER","1"); |
||||||
|
paramMap101.put("PAGESIZE","100"); |
||||||
|
paramList.add(paramMap101); |
||||||
|
} |
||||||
|
}else { |
||||||
|
paramList.add(paramMap); |
||||||
|
} |
||||||
|
for(Map map:paramList){ |
||||||
|
String queryMainParam = JsonUtils.getInstance().toJsonString(map); |
||||||
|
syncQdSpecialInvoice(queryMainParam); |
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
log.error("{}定时任务执行异常:{}", LOGGER_MSG, e); |
||||||
|
return FAIL; |
||||||
|
} |
||||||
|
log.debug("{}定时任务完成", LOGGER_MSG); |
||||||
|
return SUCCESS; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private void syncQdSpecialInvoice(String queryMainParam){ |
||||||
|
List<CommonSpecialInvoice> commonSpecialInvoiceAddList = new ArrayList<>(); |
||||||
|
List<CommonSpecialInvoice > commonSpecialInvoiceEditList = new ArrayList<>(); |
||||||
|
Map<String, List<SpecialInvoiceReversalEntity>> mainMap = queryQdSpecialInvoiceMain(queryMainParam); |
||||||
|
List<SpecialInvoiceReversalEntity> addList = mainMap.get("add"); |
||||||
|
List<SpecialInvoiceReversalEntity> editList = mainMap.get("edit"); |
||||||
|
addList.forEach(f -> { |
||||||
|
CommonSpecialInvoice csi = new CommonSpecialInvoice(); |
||||||
|
Map<String,String> queryDetailMap = new HashMap<>(); |
||||||
|
queryDetailMap.put("HZQRDUUID",f.getUuid()); |
||||||
|
queryDetailMap.put("XSFNSRSBH",f.getXhfNsrsbh()); |
||||||
|
String queryDetailParam = JsonUtils.getInstance().toJsonString(queryDetailMap); |
||||||
|
List<SpecialInvoiceReversalItem> specialInvoiceReversalItems = queryQdSpecialInvoiceDetail(queryDetailParam, false, f.getId()); |
||||||
|
String dslbz = specialInvoiceReversalItems.get(0).getSl(); |
||||||
|
for(SpecialInvoiceReversalItem en:specialInvoiceReversalItems){ |
||||||
|
if(!dslbz.equals(en.getSl())){ |
||||||
|
dslbz = "多税率"; |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
f.setDslbz(dslbz); |
||||||
|
csi.setSpecialInvoiceReversalEntity(f); |
||||||
|
csi.setSpecialInvoiceReversalItemEntities(specialInvoiceReversalItems); |
||||||
|
commonSpecialInvoiceAddList.add(csi); |
||||||
|
}); |
||||||
|
editList.forEach(f -> { |
||||||
|
CommonSpecialInvoice csi = new CommonSpecialInvoice(); |
||||||
|
Map<String,String> queryDetailMap = new HashMap<>(); |
||||||
|
queryDetailMap.put("HZQRDUUID",f.getUuid()); |
||||||
|
queryDetailMap.put("XSFNSRSBH",f.getXhfNsrsbh()); |
||||||
|
String queryDetailParam = JsonUtils.getInstance().toJsonString(queryDetailMap); |
||||||
|
List<SpecialInvoiceReversalItem> specialInvoiceReversalItems = queryQdSpecialInvoiceDetail(queryDetailParam, true, f.getId()); |
||||||
|
String dslbz = specialInvoiceReversalItems.get(0).getSl(); |
||||||
|
for(SpecialInvoiceReversalItem en:specialInvoiceReversalItems){ |
||||||
|
if(!dslbz.equals(en.getSl())){ |
||||||
|
dslbz = "多税率"; |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
f.setDslbz(dslbz); |
||||||
|
csi.setSpecialInvoiceReversalEntity(f); |
||||||
|
csi.setSpecialInvoiceReversalItemEntities(specialInvoiceReversalItems); |
||||||
|
commonSpecialInvoiceEditList.add(csi); |
||||||
|
}); |
||||||
|
//数据库字段长度问题,单条报错不影响其他数据插入
|
||||||
|
for(CommonSpecialInvoice en:commonSpecialInvoiceAddList){ |
||||||
|
List<CommonSpecialInvoice > list = new ArrayList<>(); |
||||||
|
list.add(en); |
||||||
|
try { |
||||||
|
specialInvoiceReversalService.processCommonSpecialInvoice(false,list); |
||||||
|
}catch (Exception e){ |
||||||
|
log.error("{},{}红字确认单同步失败:{}",LOGGER_MSG,en.getSpecialInvoiceReversalEntity().getXxbbh(),e); |
||||||
|
} |
||||||
|
} |
||||||
|
for(CommonSpecialInvoice en:commonSpecialInvoiceEditList){ |
||||||
|
List<CommonSpecialInvoice > list = new ArrayList<>(); |
||||||
|
list.add(en); |
||||||
|
try { |
||||||
|
specialInvoiceReversalService.processCommonSpecialInvoice(true,list); |
||||||
|
}catch (Exception e){ |
||||||
|
log.error("{},{}红字确认单同步失败:{}",LOGGER_MSG,en.getSpecialInvoiceReversalEntity().getXxbbh(),e); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private Map<String,List<SpecialInvoiceReversalEntity>> queryQdSpecialInvoiceMain(String param){ |
||||||
|
Map<String,List<SpecialInvoiceReversalEntity>> returnMap = new HashMap<>(); |
||||||
|
List<SpecialInvoiceReversalEntity> addList = new ArrayList<>(); |
||||||
|
List<SpecialInvoiceReversalEntity> editList = new ArrayList<>(); |
||||||
|
QdCommonRspV6 hzqrdRspV6 = interfaceServiceV6.processProxyForQd(ConfigurerInfo.QUERY_RED_CONFIRMATION_LIST, param); |
||||||
|
if(ConfigureConstant.STRING_000000.equals(hzqrdRspV6.getZTDM())){ |
||||||
|
Map dataMap = JsonUtils.getInstance().parseObject(hzqrdRspV6.getDATA().toString(), Map.class);; |
||||||
|
List<Map> list = (List<Map>) dataMap.get("LIST"); |
||||||
|
for(Map en:list){ |
||||||
|
Map<String,Object> enterMap = new HashMap<>(); |
||||||
|
enterMap.put("uuid",en.get("UUID")); |
||||||
|
List<SpecialInvoiceReversalEntity> specialInvoiceReversalEntities = specialInvoiceReversalService.querySpecialInvoice(enterMap); |
||||||
|
if(specialInvoiceReversalEntities.size() == 0){ |
||||||
|
SpecialInvoiceReversalEntity hzxxbEn = createHzxxbEn(en); |
||||||
|
addList.add(hzxxbEn); |
||||||
|
}else if(specialInvoiceReversalEntities.size() == 1){ |
||||||
|
SpecialInvoiceReversalEntity specialInvoiceReversalEntity = specialInvoiceReversalEntities.get(0); |
||||||
|
specialInvoiceReversalEntity.setStatusCode((String)en.get("HZQRXXZTDM")); |
||||||
|
specialInvoiceReversalEntity.setStatusMessage(getStatusMessage((String)en.get("HZQRXXZTDM"))); |
||||||
|
specialInvoiceReversalEntity.setQrrq((String)en.get("QRRQ")); |
||||||
|
specialInvoiceReversalEntity.setDataStatus("Y".equals((String)en.get("YXBZ"))?"0":"1"); |
||||||
|
specialInvoiceReversalEntity.setEditorId("1"); |
||||||
|
specialInvoiceReversalEntity.setEditorName("系统管理员 "); |
||||||
|
specialInvoiceReversalEntity.setUpdateTime(new Date()); |
||||||
|
editList.add(specialInvoiceReversalEntity); |
||||||
|
}else { |
||||||
|
log.info("{}根据uuid查询主表查出了多条,不做处理"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
returnMap.put("add",addList); |
||||||
|
returnMap.put("edit",editList); |
||||||
|
return returnMap; |
||||||
|
} |
||||||
|
|
||||||
|
private List<SpecialInvoiceReversalItem> queryQdSpecialInvoiceDetail(String param,Boolean edit,String specialInvoiceId){ |
||||||
|
if(edit){ |
||||||
|
return specialInvoiceReversalService.querySpecialInvoiceReversalItems(specialInvoiceId); |
||||||
|
}else { |
||||||
|
List<SpecialInvoiceReversalItem> returnList = new ArrayList<>(); |
||||||
|
QdCommonRspV6 hzqrdRspV6 = interfaceServiceV6.processProxyForQd(ConfigurerInfo.QUERY_RED_CONFIRMATION_ITEM_LIST, param); |
||||||
|
if(ConfigureConstant.STRING_000000.equals(hzqrdRspV6.getZTDM())){ |
||||||
|
Map detailMap = JsonUtils.getInstance().parseObject(hzqrdRspV6.getDATA().toString(), Map.class); |
||||||
|
List<Map> list = (List<Map>) detailMap.get("HZQRXXMXLIST"); |
||||||
|
for(Map en:list){ |
||||||
|
SpecialInvoiceReversalItem hzxxbItem = createHzxxbItem(en, specialInvoiceId); |
||||||
|
returnList.add(hzxxbItem); |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
return returnList; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private SpecialInvoiceReversalEntity createHzxxbEn(Map en){ |
||||||
|
String uuid = (String)en.get("UUID"); |
||||||
|
String hzfpxxqrdbh = (String)en.get("HZFPXXQRDBH"); |
||||||
|
String lrfsf = (String)en.get("LRFSF"); |
||||||
|
String xsfnsrsbh = (String)en.get("XSFNSRSBH"); |
||||||
|
String xsfmc = (String)en.get("XSFMC"); |
||||||
|
String gmfnsrsbh = (String)en.get("GMFNSRSBH"); |
||||||
|
String gmfmc = (String)en.get("GMFMC"); |
||||||
|
String lzfpdm = (String)en.get("LZFPDM"); |
||||||
|
String lzfphm = (String)en.get("LZFPHM"); |
||||||
|
String sfzzfpbz = (String)en.get("SFZZFPBZ"); |
||||||
|
String lzkprq = (String)en.get("LZKPRQ"); |
||||||
|
String lzhjje = (String)en.get("LZHJJE"); |
||||||
|
String lzhjse = (String)en.get("LZHJSE"); |
||||||
|
String lzfppzdm = (String)en.get("LZFPPZDM"); |
||||||
|
String lzfptdyslxdm = (String)en.get("LZFPTDYSLXDM"); |
||||||
|
String hzcxje = (String)en.get("HZCXJE"); |
||||||
|
String hzcxse = (String)en.get("HZCXSE"); |
||||||
|
String hzqrdmxsl = (String)en.get("HZQRDMXSL"); |
||||||
|
String chyydm = (String)en.get("CHYYDM"); |
||||||
|
String hzqrxxztdm = (String)en.get("HZQRXXZTDM"); |
||||||
|
String qrrq = (String)en.get("QRRQ"); |
||||||
|
String ykjhzfpbz = (String)en.get("YKJHZFPBZ"); |
||||||
|
String hzfphm = (String)en.get("HZFPHM"); |
||||||
|
String hzkprq = (String)en.get("HZKPRQ"); |
||||||
|
String yxbz = (String)en.get("YXBZ"); |
||||||
|
|
||||||
|
SpecialInvoiceReversalEntity redEn = new SpecialInvoiceReversalEntity(); |
||||||
|
String id = baseService.getGenerateShotKey(); |
||||||
|
redEn.setId(id); |
||||||
|
redEn.setType(ConfigureConstant.STRING_5); |
||||||
|
redEn.setSqsm(lrfsf); |
||||||
|
redEn.setUuid(uuid); |
||||||
|
redEn.setXxbbh(hzfpxxqrdbh); |
||||||
|
redEn.setLrfsf(lrfsf); |
||||||
|
redEn.setXhfNsrsbh(xsfnsrsbh); |
||||||
|
redEn.setXhfMc(xsfmc); |
||||||
|
redEn.setGhfNsrsbh(gmfnsrsbh); |
||||||
|
redEn.setGhfMc(gmfmc); |
||||||
|
redEn.setYfpDm(lzfpdm); |
||||||
|
redEn.setYfpHm(lzfphm); |
||||||
|
redEn.setSfzzfpbz(sfzzfpbz); |
||||||
|
if(StrUtil.isNotBlank(lzkprq)){ |
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
||||||
|
try { |
||||||
|
redEn.setYfpKprq(sdf.parse(lzkprq)); |
||||||
|
} catch (ParseException e) { |
||||||
|
log.error("{}格式化蓝字发票开票日期错误:{}",LOGGER_MSG,e); |
||||||
|
} |
||||||
|
} |
||||||
|
redEn.setLzhjje(lzhjje); |
||||||
|
redEn.setLzhjse(lzhjse); |
||||||
|
redEn.setLzfppzdm(lzfppzdm); |
||||||
|
redEn.setLzfptdyslxdm(lzfptdyslxdm); |
||||||
|
redEn.setHjbhsje(hzcxje); |
||||||
|
redEn.setHjse(hzcxse); |
||||||
|
redEn.setKphjje(new BigDecimal(hzcxje).add(new BigDecimal(hzcxse)).toString()); |
||||||
|
redEn.setHzqrdmxsl(hzqrdmxsl); |
||||||
|
redEn.setChyy(chyydm); |
||||||
|
redEn.setStatusCode(hzqrxxztdm); |
||||||
|
redEn.setStatusMessage(getStatusMessage(hzqrxxztdm)); |
||||||
|
redEn.setQrrq(qrrq); |
||||||
|
redEn.setKpzt("Y".equals(ykjhzfpbz)?"2":"0"); |
||||||
|
redEn.setFphm(hzfphm); |
||||||
|
redEn.setDataStatus("Y".equals(yxbz)?"0":"1"); |
||||||
|
redEn.setInvoiceType("1"); |
||||||
|
redEn.setFpzlDm(lzfppzdm); |
||||||
|
redEn.setNsrsbh(xsfnsrsbh); |
||||||
|
redEn.setGhfqylx("01"); |
||||||
|
redEn.setCreatorId("1"); |
||||||
|
redEn.setCreatorName("系统管理员"); |
||||||
|
redEn.setEditorId("1"); |
||||||
|
redEn.setEditorName("系统管理员 "); |
||||||
|
redEn.setCreateTime(new Date()); |
||||||
|
redEn.setUpdateTime(new Date()); |
||||||
|
redEn.setTksj(new Date()); |
||||||
|
return redEn; |
||||||
|
} |
||||||
|
|
||||||
|
private SpecialInvoiceReversalItem createHzxxbItem(Map en,String mainId){ |
||||||
|
String xh = (String)en.get("XH"); |
||||||
|
String lzmxxh = (String)en.get("LZMXXH"); |
||||||
|
String sphfwssflhbbm = (String)en.get("SPHFWSSFLHBBM"); |
||||||
|
String hwhyslwfwmc = (String)en.get("HWHYSLWFWMC"); |
||||||
|
String spfwjc = (String)en.get("SPFWJC"); |
||||||
|
String xmmc = (String)en.get("XMMC"); |
||||||
|
String ggxh = (String)en.get("GGXH"); |
||||||
|
String dw = (String)en.get("DW"); |
||||||
|
String fpspdj = (String)en.get("FPSPDJ"); |
||||||
|
String fpspsl = (String)en.get("FPSPSL"); |
||||||
|
String je = (String)en.get("JE"); |
||||||
|
String slv = (String)en.get("SLV"); |
||||||
|
String se = (String)en.get("SE"); |
||||||
|
|
||||||
|
SpecialInvoiceReversalItem item = new SpecialInvoiceReversalItem(); |
||||||
|
item.setId(baseService.getGenerateShotKey()); |
||||||
|
item.setSpecialInvoiceReversalId(mainId); |
||||||
|
item.setSpbm(sphfwssflhbbm); |
||||||
|
item.setXmmc(xmmc); |
||||||
|
item.setGgxh(ggxh); |
||||||
|
item.setXmdw(dw); |
||||||
|
item.setXmsl(fpspsl); |
||||||
|
item.setXmdj(fpspdj); |
||||||
|
item.setXmje(je); |
||||||
|
item.setSl(slv.replaceAll("(0)+$", "")); |
||||||
|
item.setSe(se); |
||||||
|
item.setHsbz("0"); |
||||||
|
item.setSphxh(xh); |
||||||
|
item.setYhzcbs("0"); |
||||||
|
item.setCreateTime(new Date()); |
||||||
|
item.setLzmxxh(lzmxxh); |
||||||
|
|
||||||
|
return item; |
||||||
|
} |
||||||
|
|
||||||
|
private String getStatusMessage(String status){ |
||||||
|
String statusMessage = ""; |
||||||
|
if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_01.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_01.getValue(); |
||||||
|
}else if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_02.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_02.getValue(); |
||||||
|
}else if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_03.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_03.getValue(); |
||||||
|
}else if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_04.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_04.getValue(); |
||||||
|
}else if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_05.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_05.getValue(); |
||||||
|
}else if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_06.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_06.getValue(); |
||||||
|
}else if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_07.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_07.getValue(); |
||||||
|
}else if(OrderInfoEnum.SPECIAL_INVOICE_STATUS_08.getKey().equals(status)){ |
||||||
|
statusMessage = OrderInfoEnum.SPECIAL_INVOICE_STATUS_08.getValue(); |
||||||
|
} |
||||||
|
return statusMessage; |
||||||
|
} |
||||||
|
|
||||||
|
public List<DeptEntity> queryAllDeptInfo(){ |
||||||
|
Map<String,String> headMap = Maps.newHashMap(); |
||||||
|
headMap.put("Content-Type", ContentType.APPLICATION_JSON.toString()); |
||||||
|
|
||||||
|
Map<String,String> requestMap = Maps.newHashMap(); |
||||||
|
requestMap.put("deptId","0"); |
||||||
|
String result = HttpUtils.doPostWithHeader(openApiConfig.queryAllDeptInfo(), JSONObject.toJSONString(requestMap),headMap); |
||||||
|
final String resultData = getDBResultData(result); |
||||||
|
if(resultData != null){ |
||||||
|
final JSONArray jsonArray = JSONObject.parseObject(resultData, JSONArray.class); |
||||||
|
return jsonArray.toJavaList(DeptEntity.class); |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDBResultData(String result){ |
||||||
|
if(StringUtils.isNotBlank(result)){ |
||||||
|
JSONObject jsonObject = JSONObject.parseObject(result, JSONObject.class); |
||||||
|
Object code = jsonObject.get(OrderManagementConstant.CODE); |
||||||
|
if(code != null && OrderInfoContentEnum.SUCCESS.getKey().equals((String) code)){ |
||||||
|
Object data = jsonObject.get(OrderManagementConstant.DATA); |
||||||
|
if(data != null){ |
||||||
|
return JSONObject.toJSONString(data); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue