29 changed files with 1727 additions and 16 deletions
@ -0,0 +1,72 @@ |
|||||
|
package com.example.guoyan.common; |
||||
|
|
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.http.HttpMethod; |
||||
|
import org.springframework.http.client.ClientHttpResponse; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.client.ResponseErrorHandler; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.net.URI; |
||||
|
|
||||
|
@Component |
||||
|
/** |
||||
|
* 自定义Http响应异常处理器 |
||||
|
* @author chuanjieyang |
||||
|
* @since May 23, 2019 10:49:33 AM |
||||
|
*/ |
||||
|
public class RestTempErrorHandler implements ResponseErrorHandler { |
||||
|
|
||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(RestTempErrorHandler.class); |
||||
|
|
||||
|
/** |
||||
|
* 返回false表示不管response的status是多少都返回没有错 |
||||
|
* 这里可以自己定义那些status code你认为是可以抛Error |
||||
|
* Indicate whether the given response has any errors. |
||||
|
* <p>Implementations will typically inspect the |
||||
|
* {@link ClientHttpResponse#getStatusCode() HttpStatus} of the response. |
||||
|
* |
||||
|
* @param response the response to inspect |
||||
|
* @return {@code true} if the response indicates an error; {@code false} otherwise |
||||
|
* @throws IOException in case of I/O errors |
||||
|
*/ |
||||
|
@Override |
||||
|
public boolean hasError(ClientHttpResponse response) throws IOException { |
||||
|
return response.getStatusCode().value() != 200 && response.getStatusCode().value() !=302; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 这里面可以实现你自己遇到了Error进行合理的处理 |
||||
|
* Handle the error in the given response. |
||||
|
* <p>This method is only called when {@link #hasError(ClientHttpResponse)} |
||||
|
* has returned {@code true}. |
||||
|
* |
||||
|
* @param response the response with the error |
||||
|
* @throws IOException in case of I/O errors |
||||
|
*/ |
||||
|
@Override |
||||
|
public void handleError(ClientHttpResponse response) throws IOException { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 替代上面的方法 |
||||
|
* Alternative to {@link #handleError(ClientHttpResponse)} with extra |
||||
|
* information providing access to the request URL and HTTP method. |
||||
|
* |
||||
|
* @param url the request URL |
||||
|
* @param method the HTTP method |
||||
|
* @param response the response with the error |
||||
|
* @throws IOException in case of I/O errors |
||||
|
* @since 5.0 |
||||
|
*/ |
||||
|
@Override |
||||
|
public void handleError(URI url, HttpMethod method, ClientHttpResponse response) throws IOException { |
||||
|
LOGGER.error("=======================ERROR============================"); |
||||
|
LOGGER.error("HOST:{},URI:{}", url.getHost(),url.getPath()); |
||||
|
LOGGER.error("Method:{}", method.name()); |
||||
|
LOGGER.error("Exception:{}", response.getStatusCode()); |
||||
|
LOGGER.error("========================================================"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,142 @@ |
|||||
|
package com.example.guoyan.controller; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.example.guoyan.common.Result; |
||||
|
import com.example.guoyan.entity.SendHt; |
||||
|
import com.example.guoyan.entity.SendKpxx; |
||||
|
import com.example.guoyan.entity.SendXm; |
||||
|
import com.example.guoyan.mapper.*; |
||||
|
import com.example.guoyan.response.ResponseBeanForBeiJing; |
||||
|
import com.example.guoyan.scheduled.ProcessScheduled; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.http.entity.ContentType; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
|
||||
|
import org.springframework.core.io.FileSystemResource; |
||||
|
import org.springframework.http.HttpEntity; |
||||
|
import org.springframework.http.HttpHeaders; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.util.LinkedMultiValueMap; |
||||
|
import org.springframework.util.MultiValueMap; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
import org.springframework.web.client.RestTemplate; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.File; |
||||
|
import java.io.FileInputStream; |
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("/test") |
||||
|
@Slf4j |
||||
|
public class TestController { |
||||
|
@Resource |
||||
|
private RestTemplate restTemplate; |
||||
|
@Autowired |
||||
|
private SendXmMapper sendXmMapper; |
||||
|
@Autowired |
||||
|
private SendHtMapper sendHtMapper; |
||||
|
@Autowired |
||||
|
private OtherMapper otherMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
private SendKpxxMapper sendKpxxMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
private ProcessScheduled processScheduled; |
||||
|
@GetMapping() |
||||
|
public Result<String> upLoadFile() { |
||||
|
|
||||
|
return Result.success("成功"); |
||||
|
} |
||||
|
@GetMapping("/c") |
||||
|
public Result<String> test1(){ |
||||
|
|
||||
|
List<SendKpxx> sendKpxxList = sendKpxxMapper.querySendKpxxByNoDel(); |
||||
|
String url = "http://123.57.82.48:13310/api/auth/login"; |
||||
|
//提交参数设置
|
||||
|
HashMap<String, String> map = new HashMap<>(); |
||||
|
map.put("username", "0519999"); |
||||
|
map.put("password", "123456"); |
||||
|
|
||||
|
//发起请求
|
||||
|
ResponseBeanForBeiJing responseBean = restTemplate.postForObject(url, map, ResponseBeanForBeiJing.class); |
||||
|
System.out.println(responseBean.toString()); |
||||
|
String data = responseBean.getData().toString(); |
||||
|
HttpHeaders headers = new HttpHeaders(); |
||||
|
headers.set("Authorization", data); |
||||
|
|
||||
|
|
||||
|
sendKpxxList.forEach(item->{ |
||||
|
Integer interfaceType = item.getInterfaceType();//类型字段
|
||||
|
if(interfaceType==0){//开票信息有关的
|
||||
|
//判断是否过了节点5,通过流程id,节点
|
||||
|
String requestid = item.getRequestid(); |
||||
|
String kpssProcessNode5="2c9adae478fdbe15017906f93ec90265"; |
||||
|
List<HashMap<String, String>> selectProcessNo5IsSubmit = otherMapper.selectProcessNo5IsSubmit(requestid, kpssProcessNode5); |
||||
|
if (selectProcessNo5IsSubmit.size()>0){//存在
|
||||
|
processScheduled.senKpxxToYunPingtai(item,headers); |
||||
|
} |
||||
|
//开票确认
|
||||
|
}else if (interfaceType==1){ |
||||
|
processScheduled.sendKpqrToYunPingtai(item,headers); |
||||
|
//开票确认收入
|
||||
|
}else if(interfaceType==2){ |
||||
|
processScheduled.sendKpqrsrToYunPingtai(item,headers); |
||||
|
}else if (interfaceType==3){ |
||||
|
processScheduled.sendKpqrdzToYunPingtai(item,headers); |
||||
|
}else { |
||||
|
log.info("未知编号:"+interfaceType); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
return Result.success("成功"); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/a") |
||||
|
public Result<String> testt() { |
||||
|
|
||||
|
List<SendHt> sendHtList = sendHtMapper.querySendHtByNoDel(); |
||||
|
String url = "http://123.57.82.48:13310/api/auth/login"; |
||||
|
//提交参数设置
|
||||
|
HashMap<String, String> map = new HashMap<>(); |
||||
|
map.put("username", "0519999"); |
||||
|
map.put("password", "123456"); |
||||
|
|
||||
|
//发起请求
|
||||
|
ResponseBeanForBeiJing responseBean = restTemplate.postForObject(url, map, ResponseBeanForBeiJing.class); |
||||
|
System.out.println(responseBean.toString()); |
||||
|
String data = responseBean.getData().toString(); |
||||
|
HttpHeaders headers = new HttpHeaders(); |
||||
|
headers.set("Authorization", data); |
||||
|
processScheduled.sendHtToYunPingtai(sendHtList,headers); |
||||
|
return Result.success("成功"); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/t") |
||||
|
public Result<String> test() { |
||||
|
|
||||
|
List<SendXm> sendXmList = sendXmMapper.querySendXmByNoDel(); |
||||
|
String url = "http://123.57.82.48:13310/api/auth/login"; |
||||
|
//提交参数设置
|
||||
|
HashMap<String, String> map = new HashMap<>(); |
||||
|
map.put("username", "0519999"); |
||||
|
map.put("password", "123456"); |
||||
|
|
||||
|
//发起请求
|
||||
|
ResponseBeanForBeiJing responseBean = restTemplate.postForObject(url, map, ResponseBeanForBeiJing.class); |
||||
|
System.out.println(responseBean.toString()); |
||||
|
String data = responseBean.getData().toString(); |
||||
|
HttpHeaders headers = new HttpHeaders(); |
||||
|
headers.set("Authorization", data); |
||||
|
processScheduled.sendXmToYunPingtai(sendXmList, headers); |
||||
|
return Result.success("成功"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.example.guoyan.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Data |
||||
|
@Component |
||||
|
public class KpssProcessNode6IdInfo { |
||||
|
@Value("${kpssProcessNode6IdInfo.perStepid}") |
||||
|
private String perStepid; |
||||
|
@Value("${kpssProcessNode6IdInfo.currentStepid}") |
||||
|
private String currentStepid; |
||||
|
@Value("${kpssProcessNode6IdInfo.currentStaffid}") |
||||
|
private String currentStaffid; |
||||
|
@Value("${kpssProcessNode6IdInfo.nextStepid}") |
||||
|
private String nextStepid; |
||||
|
@Value("${kpssProcessNode6IdInfo.nextTypeid}") |
||||
|
private String nextTypeid; |
||||
|
@Value("${kpssProcessNode6IdInfo.nextAllowStaffids}") |
||||
|
private String nextAllowStaffids; |
||||
|
@Value("${kpssProcessNode6IdInfo.nextStepOperid}") |
||||
|
private String nextStepOperid; |
||||
|
|
||||
|
} |
@ -0,0 +1,63 @@ |
|||||
|
package com.example.guoyan.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* (Permissionrulegroup)实体类 |
||||
|
* |
||||
|
* @author makejava |
||||
|
* @since 2024-01-12 13:26:39 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class Permissionrulegroup implements Serializable { |
||||
|
private static final long serialVersionUID = -89320443451328585L; |
||||
|
|
||||
|
private String typeid; |
||||
|
|
||||
|
private String restype; |
||||
|
|
||||
|
private String resid; |
||||
|
|
||||
|
private Integer operate; |
||||
|
|
||||
|
private Integer optquery; |
||||
|
|
||||
|
private Integer optcreate; |
||||
|
|
||||
|
private Integer optupdate; |
||||
|
|
||||
|
private Integer optdelete; |
||||
|
|
||||
|
private Integer optmanage; |
||||
|
|
||||
|
private String pageid; |
||||
|
|
||||
|
private Integer minlevel; |
||||
|
|
||||
|
private Integer maxlevel; |
||||
|
|
||||
|
private Integer ntmp; |
||||
|
|
||||
|
private String stmp; |
||||
|
|
||||
|
private String id; |
||||
|
|
||||
|
private Integer dsporder; |
||||
|
|
||||
|
private String layoutview; |
||||
|
|
||||
|
private String layoutedit; |
||||
|
|
||||
|
private String layoutprint; |
||||
|
|
||||
|
private String adddate; |
||||
|
|
||||
|
private String rulewhere; |
||||
|
|
||||
|
private String allowstaffids; |
||||
|
|
||||
|
private Integer matrixtype; |
||||
|
} |
||||
|
|
@ -0,0 +1,77 @@ |
|||||
|
package com.example.guoyan.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* (SendHt)实体类 |
||||
|
* |
||||
|
* @author makejava |
||||
|
* @since 2024-01-10 17:25:07 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SendHt implements Serializable { |
||||
|
private static final long serialVersionUID = 858146175447648096L; |
||||
|
|
||||
|
private Integer id; |
||||
|
/** |
||||
|
* 合同编号 |
||||
|
*/ |
||||
|
private String contractCode; |
||||
|
/** |
||||
|
* 合同名称 |
||||
|
*/ |
||||
|
private String contractName; |
||||
|
/** |
||||
|
* 项目编号 |
||||
|
*/ |
||||
|
private String projectNo; |
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String projectId; |
||||
|
/** |
||||
|
* 是否高新 |
||||
|
*/ |
||||
|
private String highTech; |
||||
|
/** |
||||
|
* 中标方式 |
||||
|
*/ |
||||
|
private String winningBidWay; |
||||
|
/** |
||||
|
* 合同金额 |
||||
|
*/ |
||||
|
private Double contractAmount; |
||||
|
/** |
||||
|
* 是否签出 |
||||
|
*/ |
||||
|
private String signOut; |
||||
|
/** |
||||
|
* 是否签回 |
||||
|
*/ |
||||
|
private String signIn; |
||||
|
/** |
||||
|
* 确认日期 |
||||
|
*/ |
||||
|
private String confirmDate; |
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date addtime; |
||||
|
/** |
||||
|
* 状态 |
||||
|
*/ |
||||
|
private String status; |
||||
|
/** |
||||
|
* 操作类型,0:新增,1:修改 |
||||
|
*/ |
||||
|
private String operatetype; |
||||
|
/** |
||||
|
* 合同id |
||||
|
*/ |
||||
|
private String contractId; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,139 @@ |
|||||
|
package com.example.guoyan.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* (SendKpxx)实体类 |
||||
|
* |
||||
|
* @author makejava |
||||
|
* @since 2024-01-10 21:51:56 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SendKpxx implements Serializable { |
||||
|
private static final long serialVersionUID = -50863336481165055L; |
||||
|
|
||||
|
private Integer id; |
||||
|
/** |
||||
|
* sc_kpspsq的id |
||||
|
*/ |
||||
|
private String requestid; |
||||
|
/** |
||||
|
* 开票id |
||||
|
*/ |
||||
|
private String invoiceNo; |
||||
|
/** |
||||
|
* 开票日期 |
||||
|
*/ |
||||
|
private String invoiceDate; |
||||
|
/** |
||||
|
* 项目编号 |
||||
|
*/ |
||||
|
private String projectNo; |
||||
|
/** |
||||
|
* 合同收款进度 |
||||
|
*/ |
||||
|
private String receiptScheduleName; |
||||
|
/** |
||||
|
* 付款方名称 |
||||
|
*/ |
||||
|
private String payerName; |
||||
|
/** |
||||
|
* 纳税识别号 |
||||
|
*/ |
||||
|
private String payerNumber; |
||||
|
/** |
||||
|
* 开票金额 |
||||
|
*/ |
||||
|
private Double invoiceAmount; |
||||
|
/** |
||||
|
* 开票内容 |
||||
|
*/ |
||||
|
private String invoiceContent; |
||||
|
/** |
||||
|
* 付款方式 |
||||
|
*/ |
||||
|
private String paymentMode; |
||||
|
/** |
||||
|
* 发票类型 |
||||
|
*/ |
||||
|
private String invoiceType; |
||||
|
/** |
||||
|
* 发票备注 |
||||
|
*/ |
||||
|
private String remarkInfo; |
||||
|
/** |
||||
|
* 特殊说明 |
||||
|
*/ |
||||
|
private String specialInfo; |
||||
|
/** |
||||
|
* 证明文件 |
||||
|
*/ |
||||
|
private String evidenceId; |
||||
|
/** |
||||
|
* 申请员工编号 |
||||
|
*/ |
||||
|
private String applyUserCode; |
||||
|
/** |
||||
|
* 开票时间 |
||||
|
*/ |
||||
|
private String confirmDate; |
||||
|
/** |
||||
|
* 开票员工id |
||||
|
*/ |
||||
|
private String confirmUserCode; |
||||
|
/** |
||||
|
* 确认收入日期 |
||||
|
*/ |
||||
|
private String incomeDate; |
||||
|
/** |
||||
|
* 确认收入金额 |
||||
|
*/ |
||||
|
private Double incomeAmount; |
||||
|
/** |
||||
|
* 确认收入操作员工id |
||||
|
*/ |
||||
|
private String incomeUserCode; |
||||
|
/** |
||||
|
* 到账时间 |
||||
|
*/ |
||||
|
private String accountDate; |
||||
|
/** |
||||
|
* 到账金额 |
||||
|
*/ |
||||
|
private Double accountAmount; |
||||
|
/** |
||||
|
* 到账操作员工id |
||||
|
*/ |
||||
|
private String accountUserCode; |
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createtime; |
||||
|
/** |
||||
|
* 状态 |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
/** |
||||
|
* 操作类型,0新增,1修改 |
||||
|
*/ |
||||
|
private Integer operatetype; |
||||
|
/** |
||||
|
* 类型 |
||||
|
*/ |
||||
|
private Integer interfaceType; |
||||
|
/** |
||||
|
* 操作标记 0 新增;1 删除 |
||||
|
*/ |
||||
|
private Integer opFlag; |
||||
|
/** |
||||
|
* 操作员工编码 |
||||
|
*/ |
||||
|
private String opUserCode; |
||||
|
private String wfrequest; |
||||
|
private String incomeId; |
||||
|
private String accountId; |
||||
|
} |
||||
|
|
@ -0,0 +1,113 @@ |
|||||
|
package com.example.guoyan.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* (SendXm)实体类 |
||||
|
* |
||||
|
* @author makejava |
||||
|
* @since 2024-01-10 13:59:54 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SendXm implements Serializable { |
||||
|
private static final long serialVersionUID = -66646432538806807L; |
||||
|
|
||||
|
private Long id; |
||||
|
private String projectId; |
||||
|
/** |
||||
|
* 项目编号 |
||||
|
*/ |
||||
|
private String projectNo; |
||||
|
/** |
||||
|
* 项目名称 |
||||
|
*/ |
||||
|
private String projectName; |
||||
|
/** |
||||
|
* 项目类型 |
||||
|
*/ |
||||
|
private String projectType; |
||||
|
/** |
||||
|
* 所属区域 |
||||
|
*/ |
||||
|
private String areaCode; |
||||
|
/** |
||||
|
* 客户类别 |
||||
|
*/ |
||||
|
private Integer projectSecret; |
||||
|
/** |
||||
|
* 销售负责人 |
||||
|
*/ |
||||
|
private String salesLeaderCode; |
||||
|
/** |
||||
|
* 名义总监 |
||||
|
*/ |
||||
|
private String nominalDirectorCode; |
||||
|
/** |
||||
|
* 实施部门 |
||||
|
*/ |
||||
|
private String deptCode; |
||||
|
/** |
||||
|
* 实施负责人 |
||||
|
*/ |
||||
|
private String projectManagerCode; |
||||
|
/** |
||||
|
* 项目金额 |
||||
|
*/ |
||||
|
private Double contractAmount; |
||||
|
/** |
||||
|
* 投资金额 |
||||
|
*/ |
||||
|
private Double projectConstructionScale; |
||||
|
/** |
||||
|
* 甲方单位名称 |
||||
|
*/ |
||||
|
private String projectCompany; |
||||
|
/** |
||||
|
* 项目起始时间 |
||||
|
*/ |
||||
|
private String projectStartDate; |
||||
|
/** |
||||
|
* 项目截止时间 |
||||
|
*/ |
||||
|
private String projectEndDate; |
||||
|
/** |
||||
|
* 所属行业 |
||||
|
*/ |
||||
|
private String projectIndustry; |
||||
|
/** |
||||
|
* 所属类型 |
||||
|
*/ |
||||
|
private String projectCaseType; |
||||
|
/** |
||||
|
* 用户属性 |
||||
|
*/ |
||||
|
private String projectUserProperty; |
||||
|
/** |
||||
|
* 项目描述 |
||||
|
*/ |
||||
|
private String projectDescription; |
||||
|
/** |
||||
|
* 项目备注 |
||||
|
*/ |
||||
|
private String remarks; |
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createtime; |
||||
|
/** |
||||
|
* 状态 |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
/** |
||||
|
* 0:新增,1:修改,2:删除 |
||||
|
*/ |
||||
|
private Integer operatetype; |
||||
|
|
||||
|
private Double fyys; |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,37 @@ |
|||||
|
package com.example.guoyan.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.example.guoyan.entity.SendXm; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface OtherMapper extends BaseMapper<Object> { |
||||
|
|
||||
|
void updateScXMkp1_yptbh_ByPjid(HashMap<String,String> map); |
||||
|
|
||||
|
HashMap<String,String> selectScXMkp1_yptbh_ByPjid(@Param("projectID") String id); |
||||
|
void updateScHTLC_yptbh_ByPjid(HashMap<String,String> map); |
||||
|
|
||||
|
HashMap<String,String> selectScHTLC_yptbh_ByPjid(@Param("contractId") String id); |
||||
|
|
||||
|
String selectXmAmount(@Param("id") String id); |
||||
|
|
||||
|
HashMap<String,String> selectFileById(@Param("id") String id); |
||||
|
void updateScKpsqsp_yptbh_Byid(HashMap<String,String> map); |
||||
|
|
||||
|
HashMap<String,String> selectScKpsqsp_yptbh_ByPjid(@Param("id") String id); |
||||
|
|
||||
|
void updateScKpcwqrsr_incomeId_Byid(HashMap<String,String> map); |
||||
|
|
||||
|
HashMap<String,String>selectScKpcwqrsr_incomeId_Bylcid(@Param("lcid") String id); |
||||
|
|
||||
|
void updateScKpsqsp_accountId_Byid(HashMap<String,String> map); |
||||
|
HashMap<String,String> selectScKpcwqrsr_accountId_Bylcid(@Param("id") String id); |
||||
|
HashMap<String,String> selectScKpsqsp_yptbh_Byreqid(@Param("requestid") String id); |
||||
|
|
||||
|
List<HashMap<String,String>> selectProcessNo5IsSubmit(@Param("reqid") String id,@Param("setpid") String setpid); |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
package com.example.guoyan.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.example.guoyan.entity.Permissionrulegroup; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface PermissionrulegroupMapper extends BaseMapper<Permissionrulegroup> { |
||||
|
} |
@ -1,4 +1,7 @@ |
|||||
package com.example.guoyan.mapper; |
package com.example.guoyan.mapper; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
@Mapper |
||||
public interface ScKpsqspMapper { |
public interface ScKpsqspMapper { |
||||
} |
} |
||||
|
@ -0,0 +1,12 @@ |
|||||
|
package com.example.guoyan.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.example.guoyan.entity.SendHt; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface SendHtMapper extends BaseMapper<SendHt> { |
||||
|
List<SendHt> querySendHtByNoDel(); |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.example.guoyan.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.example.guoyan.entity.SendKpxx; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface SendKpxxMapper extends BaseMapper<SendKpxx> { |
||||
|
|
||||
|
List<SendKpxx> querySendKpxxByNoDel(); |
||||
|
List<SendKpxx> querySendToYPT(); |
||||
|
|
||||
|
String selectProcessId(@Param("id") String id); |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.example.guoyan.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.example.guoyan.entity.SendXm; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface SendXmMapper extends BaseMapper<SendXm> { |
||||
|
/** |
||||
|
* 查询新增或修改的信息,这些信息未被发送到北京 |
||||
|
* @return 项目信息 |
||||
|
*/ |
||||
|
List<SendXm> querySendXmByNoDel(); |
||||
|
List<SendXm> querySendXmByProjectId(@Param("projectId") String id); |
||||
|
|
||||
|
} |
@ -1,19 +1,632 @@ |
|||||
package com.example.guoyan.scheduled; |
package com.example.guoyan.scheduled; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
||||
|
import com.example.guoyan.entity.*; |
||||
|
import com.example.guoyan.mapper.*; |
||||
|
import com.example.guoyan.response.ResponseBeanForBeiJing; |
||||
import lombok.extern.slf4j.Slf4j; |
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.core.io.FileSystemResource; |
||||
|
import org.springframework.http.*; |
||||
import org.springframework.scheduling.annotation.Scheduled; |
import org.springframework.scheduling.annotation.Scheduled; |
||||
import org.springframework.stereotype.Component; |
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.util.LinkedMultiValueMap; |
||||
|
import org.springframework.util.MultiValueMap; |
||||
|
import org.springframework.web.client.RestTemplate; |
||||
|
|
||||
import java.util.Date; |
import javax.annotation.Resource; |
||||
|
import java.io.File; |
||||
|
import java.time.Duration; |
||||
|
import java.time.LocalDate; |
||||
|
import java.time.format.DateTimeFormatter; |
||||
|
import java.util.*; |
||||
|
|
||||
@Component |
@Component |
||||
@Slf4j |
@Slf4j |
||||
public class ProcessScheduled { |
public class ProcessScheduled { |
||||
|
|
||||
@Scheduled(cron = "0 0/5 * * * ?") |
@Autowired |
||||
public void invoice_request_Process_Scheduled(){ |
private SendXmMapper sendXmMapper; |
||||
//先查询开票申请的流程
|
@Resource |
||||
|
private RestTemplate restTemplate; |
||||
|
@Autowired |
||||
|
private OtherMapper otherMapper; |
||||
|
@Autowired |
||||
|
private SendHtMapper sendHtMapper; |
||||
|
@Autowired |
||||
|
private SendKpxxMapper sendKpxxMapper; |
||||
|
@Autowired |
||||
|
private ReadlogMapper readlogMapper; |
||||
|
@Autowired |
||||
|
private RequestlogMapper requestlogMapper; |
||||
|
@Autowired |
||||
|
private RequestoperatorMapper requestoperatorMapper; |
||||
|
@Autowired |
||||
|
private WfrequestMapper wfrequestMapper; |
||||
|
@Autowired |
||||
|
private RequeststatusMapper requeststatusMapper; |
||||
|
@Autowired |
||||
|
private ScXglcMapper scXglcMapper; |
||||
|
@Autowired |
||||
|
private PermissionrulegroupMapper permissionrulegroupMapper; |
||||
|
@Value("${ypt.username}") |
||||
|
private String username; |
||||
|
@Value("${ypt.password}") |
||||
|
private String password; |
||||
|
@Value("${ypt.loginUrl}") |
||||
|
private String loginUrl; |
||||
|
@Value("${ypt.projectUrl}") |
||||
|
private String projectUrl; |
||||
|
@Value("${ypt.contractUrl}") |
||||
|
private String contractUrl; |
||||
|
@Value("${ypt.invoiceUrl}") |
||||
|
private String invoiceUrl; |
||||
|
@Value("${ypt.confirmUrl}") |
||||
|
private String confirmUrl; |
||||
|
@Value("${ypt.fileDownPre}") |
||||
|
private String fileDownPre; |
||||
|
@Value("${ypt.uploadFileUrl}") |
||||
|
private String uploadFileUrl; |
||||
|
@Value("${ypt.incomeUrl}") |
||||
|
private String incomeUrl; |
||||
|
@Value("${ypt.InvoicingApprovalStatusUrl}") |
||||
|
private String InvoicingApprovalStatusUrl; |
||||
|
@Autowired |
||||
|
private KpssProcessNode6IdInfo kpssProcessNode6IdInfo; |
||||
|
/** |
||||
|
* 定时任务跑合同和项目信息的变化发给北京,五分钟一次 |
||||
|
*/ |
||||
|
//@Scheduled(cron = "0 0/5 * * * ?")
|
||||
|
|
||||
log.info(new Date ().toString()); |
public void invoice_request_Process_Scheduled() { |
||||
|
//提交参数设置
|
||||
|
log.info("我开始跑任务啦"); |
||||
|
HashMap<String, String> map = new HashMap<>(); |
||||
|
map.put("username", username); |
||||
|
map.put("password", password); |
||||
|
//查询需要更新到北京云平台的数据
|
||||
|
List<SendXm> sendXmList = sendXmMapper.querySendXmByNoDel(); |
||||
|
List<SendHt> sendHtList = sendHtMapper.querySendHtByNoDel(); |
||||
|
//发起请求 获取权限token
|
||||
|
log.info(map.toString()); |
||||
|
ResponseBeanForBeiJing responseBean = restTemplate.postForObject(loginUrl, map, ResponseBeanForBeiJing.class); |
||||
|
log.info("登录返回的信息:"+responseBean.toString()); |
||||
|
if("200".equals(responseBean.getCode())){ |
||||
|
String data = responseBean.getData().toString(); |
||||
|
HttpHeaders headers = new HttpHeaders(); |
||||
|
headers.set("Authorization", data); |
||||
|
sendXmToYunPingtai(sendXmList, headers); |
||||
|
sendHtToYunPingtai(sendHtList,headers); |
||||
|
//处理开票信息
|
||||
|
List<SendKpxx> sendKpxxList = sendKpxxMapper.querySendKpxxByNoDel(); |
||||
|
sendKpxxList.forEach(item->{ |
||||
|
Integer interfaceType = item.getInterfaceType();//类型字段
|
||||
|
if(interfaceType==0){//开票信息有关的
|
||||
|
//判断是否过了节点5,通过流程id,节点
|
||||
|
String requestid = item.getRequestid(); |
||||
|
String kpssProcessNode5=kpssProcessNode6IdInfo.getPerStepid(); |
||||
|
List<HashMap<String, String>> selectProcessNo5IsSubmit = otherMapper.selectProcessNo5IsSubmit(requestid, kpssProcessNode5); |
||||
|
if (selectProcessNo5IsSubmit.size()>0){//存在
|
||||
|
senKpxxToYunPingtai(item,headers); |
||||
|
} |
||||
|
//开票确认
|
||||
|
}else if (interfaceType==1){ |
||||
|
sendKpqrToYunPingtai(item,headers); |
||||
|
//开票确认收入
|
||||
|
}else if(interfaceType==2){ |
||||
|
sendKpqrsrToYunPingtai(item,headers); |
||||
|
//开票确认到账
|
||||
|
}else if (interfaceType==3){ |
||||
|
sendKpqrdzToYunPingtai(item,headers); |
||||
|
}else { |
||||
|
log.info("未知编号:"+interfaceType); |
||||
|
} |
||||
|
}); |
||||
|
//处理云平台开票信息更新流程
|
||||
|
queryInvoicingApprovalStatus(headers); |
||||
|
//
|
||||
|
|
||||
|
}else { |
||||
|
log.info("登录失败!"); |
||||
|
} |
||||
|
log.info("本次任务结束了"); |
||||
|
|
||||
|
} |
||||
|
@Transactional() |
||||
|
public void sendXmToYunPingtai(List<SendXm> sendXmList, HttpHeaders headers) { |
||||
|
//把查到的数据按次序更新或新增到北京
|
||||
|
sendXmList.forEach(iteam -> { |
||||
|
//0表示新增,要传到北京
|
||||
|
if (iteam.getOperatetype() == 0) { |
||||
|
iteam.setProjectNo(null); |
||||
|
//传到北京的接口
|
||||
|
// 组装请求体
|
||||
|
HttpEntity<SendXm> request = new HttpEntity<>(iteam, headers); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(projectUrl, request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
String projectNo = dataMap.get("projectNo").toString(); |
||||
|
HashMap<String, String> paramMap = new HashMap<>(); |
||||
|
paramMap.put("yptbh", projectNo); |
||||
|
paramMap.put("id", iteam.getProjectId()); |
||||
|
otherMapper.updateScXMkp1_yptbh_ByPjid(paramMap);//把返回的项目编号存入Sc_Xmkp1
|
||||
|
LambdaUpdateWrapper<SendXm> sendXmLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId, iteam.getId());//更新条件
|
||||
|
sendXmLambdaUpdateWrapper.set(SendXm::getStatus, 1);//更新的值
|
||||
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
||||
|
log.info("新增到北京成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("新增失败,projectId是" + iteam.getProjectId() + " id是" + iteam.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
//修改
|
||||
|
if (iteam.getOperatetype() == 1) { |
||||
|
// 组装请求体
|
||||
|
HashMap<String, String> getdata = otherMapper.selectScXMkp1_yptbh_ByPjid(iteam.getProjectId()); |
||||
|
String yptbh = getdata.get("yptbh").toString();//云平台编号
|
||||
|
iteam.setProjectNo(yptbh); |
||||
|
HttpEntity<SendXm> request = new HttpEntity<>(iteam, headers); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(projectUrl, request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
String projectNo = dataMap.get("projectNo").toString(); |
||||
|
LambdaUpdateWrapper<SendXm> sendXmLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId, iteam.getId());//更新条件
|
||||
|
sendXmLambdaUpdateWrapper.set(SendXm::getStatus, 1);//更新的值
|
||||
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
||||
|
log.info("更新到北京成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("更新失败,projectId是" + iteam.getProjectId() + " id是" + iteam.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
@Transactional() |
||||
|
public void sendHtToYunPingtai(List<SendHt> sendHtList, HttpHeaders headers) { |
||||
|
sendHtList.forEach(item -> { |
||||
|
//用项目id 查询项目金额
|
||||
|
String xmAmount = otherMapper.selectXmAmount(item.getProjectId()); |
||||
|
Double contractAmount = item.getContractAmount(); |
||||
|
Double amt = Double.valueOf(xmAmount); |
||||
|
log.info("金额是"+xmAmount,amt); |
||||
|
//如果合同金额和项目金额不一样,更新云平台的项目金额 为合同金额
|
||||
|
if (amt!=contractAmount){ |
||||
|
//更新数据需要所有字段都有值,所以去查最新的一笔更新记录,改一下合同金额
|
||||
|
List<SendXm> sendXms = sendXmMapper.querySendXmByProjectId(item.getProjectId()); |
||||
|
SendXm sendXm = sendXms.get(0);//得到最新的一条已修改记录
|
||||
|
sendXm.setContractAmount(contractAmount);//修改金额
|
||||
|
sendXm.setProjectNo(item.getProjectNo());//修改项目编号
|
||||
|
HttpEntity<SendXm> request = new HttpEntity<>(sendXm, headers); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(projectUrl, request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
log.info("更新项目金额到云平台成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("更新项目金额失败,projectId是" + sendXm.getProjectId() + " id是" + sendXm.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
//0表示新增,要传到北京
|
||||
|
if ("0".equals(item.getOperatetype())) { |
||||
|
item.setContractCode(null); |
||||
|
//传到云平台的接口
|
||||
|
// 组装请求体
|
||||
|
HttpEntity<SendHt> request = new HttpEntity<>(item, headers); |
||||
|
log.info(item.toString()); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(contractUrl, request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
String contractCode = dataMap.get("contractCode").toString(); |
||||
|
HashMap<String, String> paramMap = new HashMap<>(); |
||||
|
paramMap.put("yptbh", contractCode); |
||||
|
paramMap.put("id", item.getContractId()); |
||||
|
otherMapper.updateScHTLC_yptbh_ByPjid(paramMap);//把返回的项目编号存入Sc_Xmkp1
|
||||
|
LambdaUpdateWrapper<SendHt> sendHtLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
||||
|
sendHtLambdaUpdateWrapper.set(SendHt::getStatus, 1);//更新的值
|
||||
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
||||
|
log.info("新增到北京成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("新增失败,projectId是" + item.getContractId() + " id是" + item.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
//修改
|
||||
|
if ("1".equals(item.getOperatetype())) { |
||||
|
// 组装请求体
|
||||
|
HashMap<String, String> getdata = otherMapper.selectScHTLC_yptbh_ByPjid(item.getContractId()); |
||||
|
String yptbh = getdata.get("yptbh").toString();//云平台编号
|
||||
|
item.setContractCode(yptbh); |
||||
|
HttpEntity<SendHt> request = new HttpEntity<>(item, headers); |
||||
|
log.info(item.toString()); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(contractUrl,request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
LambdaUpdateWrapper<SendHt> sendHtLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
||||
|
sendHtLambdaUpdateWrapper.set(SendHt::getStatus, 1);//更新的值
|
||||
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
||||
|
log.info("更新到北京成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("更新失败,projectId是" + item.getContractId() + " id是" + item.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
@Transactional() |
||||
|
public void senKpxxToYunPingtai(SendKpxx sendKpxx, HttpHeaders headers){ |
||||
|
//新增
|
||||
|
if(sendKpxx.getOperatetype()==0){ |
||||
|
sendKpxx.setInvoiceNo(null); |
||||
|
String[] evidenceIds = sendKpxx.getEvidenceId().split(",");//获取文件id组
|
||||
|
String evidenceid= ""; |
||||
|
for (String id:evidenceIds) { |
||||
|
//查询
|
||||
|
HashMap<String, String> fileMap = otherMapper.selectFileById(id); |
||||
|
//String filePath = fileMap.get("filepath");
|
||||
|
String filetype = fileMap.get("filetype"); |
||||
|
String filePath = "E:\\adad.txt"; |
||||
|
//filePath =fileDownPre+filePath;
|
||||
|
File file = new File(filePath); |
||||
|
if(file.exists()){ |
||||
|
headers.setContentType(MediaType.MULTIPART_FORM_DATA); |
||||
|
MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); |
||||
|
body.add("file", new FileSystemResource(new File(filePath))); |
||||
|
HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(body, headers); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(uploadFileUrl ,request, ResponseBeanForBeiJing.class); |
||||
|
//文件处理
|
||||
|
String dataString = responseData.getData().toString(); |
||||
|
evidenceid = evidenceid+dataString+","; |
||||
|
}else { |
||||
|
log.info("文件不存在,文件位置"+filePath); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
if(evidenceid.length()>0){ |
||||
|
evidenceid=evidenceid.substring(0,evidenceid.length()-1); |
||||
|
} |
||||
|
headers.setContentType(MediaType.APPLICATION_JSON); |
||||
|
sendKpxx.setEvidenceId(evidenceid); |
||||
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(invoiceUrl,request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
String invoiceNo = dataMap.get("invoiceNo").toString(); |
||||
|
HashMap<String, String> paramMap = new HashMap<>(); |
||||
|
paramMap.put("yptbh", invoiceNo); |
||||
|
paramMap.put("id", sendKpxx.getRequestid()); |
||||
|
otherMapper.updateScKpsqsp_yptbh_Byid(paramMap);//把返回的项目编号存入Sc_kssqsp
|
||||
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
||||
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
||||
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
||||
|
log.info("新增开票信息到云平台成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("新增开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
||||
|
log.error("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
//修改 暂无修改
|
||||
|
if (sendKpxx.getOperatetype()==1){ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
@Transactional() |
||||
|
public void sendKpqrToYunPingtai(SendKpxx sendKpxx, HttpHeaders headers){ |
||||
|
String invoiceNo = sendKpxx.getInvoiceNo(); |
||||
|
HashMap<String,String> hashMap = new HashMap<>(); |
||||
|
hashMap.put("invoiceNo",invoiceNo); |
||||
|
HttpEntity<HashMap<String,String>> requestEntity = new HttpEntity<>(hashMap, headers); |
||||
|
ResponseEntity<ResponseBeanForBeiJing> exchange = restTemplate.exchange(InvoicingApprovalStatusUrl, HttpMethod.GET, requestEntity, ResponseBeanForBeiJing.class); |
||||
|
ResponseBeanForBeiJing beanForBeiJing = exchange.getBody(); |
||||
|
if (!"200".equals(beanForBeiJing.getCode())){ |
||||
|
log.info("返回信息错误!"+beanForBeiJing.toString()); |
||||
|
return; |
||||
|
} |
||||
|
Map dataMap = (Map) beanForBeiJing.getData(); |
||||
|
Integer status = (Integer) dataMap.get("status"); |
||||
|
if (status!=4){ |
||||
|
log.info("开票申请未通过,不能进行开票确认"); |
||||
|
return; |
||||
|
} |
||||
|
//新增
|
||||
|
if(sendKpxx.getOperatetype()==0){ |
||||
|
invoiceNo = otherMapper.selectScKpsqsp_yptbh_ByPjid(sendKpxx.getRequestid()).get("yptbh"); |
||||
|
sendKpxx.setInvoiceNo(invoiceNo); |
||||
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(confirmUrl,request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
||||
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
||||
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
||||
|
log.info("新增开票确认到云平台成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("新增开票确认失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
//修改
|
||||
|
if (sendKpxx.getOperatetype()==1){ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
@Transactional() |
||||
|
public void sendKpqrsrToYunPingtai(SendKpxx sendKpxx, HttpHeaders headers){ |
||||
|
String invoiceNo = sendKpxx.getInvoiceNo(); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.getForObject(InvoicingApprovalStatusUrl,ResponseBeanForBeiJing.class,headers,invoiceNo); |
||||
|
if (!"200".equals(responseData.getCode())){ |
||||
|
log.info("返回信息错误!"+responseData.toString()); |
||||
|
return; |
||||
|
} |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
Integer status = (Integer) dataMap.get("status"); |
||||
|
if (status!=4){ |
||||
|
log.info("开票申请未通过,不能进行开票确认"); |
||||
|
return; |
||||
|
} |
||||
|
//新增
|
||||
|
if(sendKpxx.getOperatetype()==0){ |
||||
|
invoiceNo = otherMapper.selectScKpsqsp_yptbh_Byreqid(sendKpxx.getWfrequest()).get("yptbh"); |
||||
|
sendKpxx.setInvoiceNo(invoiceNo); |
||||
|
sendKpxx.setOpUserCode(sendKpxx.getIncomeUserCode());//操作员工编码
|
||||
|
sendKpxx.setOpFlag(0); |
||||
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
||||
|
responseData = restTemplate.postForObject(incomeUrl,request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
dataMap = (Map) responseData.getData(); |
||||
|
String incomeId = dataMap.get("incomeId").toString(); |
||||
|
HashMap<String, String> paramMap = new HashMap<>(); |
||||
|
paramMap.put("incomeId", incomeId); |
||||
|
paramMap.put("lcid", sendKpxx.getWfrequest()); |
||||
|
otherMapper.updateScKpcwqrsr_incomeId_Byid(paramMap);//把返回的项目编号存入Sc_kssqsp
|
||||
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
||||
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
||||
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
||||
|
log.info("新增开票确认到云平台成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("新增开票确认失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
//修改
|
||||
|
if (sendKpxx.getOperatetype()==1){ |
||||
|
invoiceNo = otherMapper.selectScKpsqsp_yptbh_ByPjid(sendKpxx.getRequestid()).get("yptbh"); |
||||
|
sendKpxx.setInvoiceNo(invoiceNo); |
||||
|
sendKpxx.setOpUserCode(sendKpxx.getIncomeUserCode());//操作员工编码
|
||||
|
sendKpxx.setOpFlag(1); |
||||
|
String incomeId = otherMapper.selectScKpcwqrsr_incomeId_Bylcid(sendKpxx.getWfrequest()).get("incomeId"); |
||||
|
sendKpxx.setIncomeId(incomeId); |
||||
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
||||
|
responseData = restTemplate.postForObject(incomeUrl,request, ResponseBeanForBeiJing.class); |
||||
|
//删除成功后在新增
|
||||
|
if ("200".equals(responseData.getCode())){ |
||||
|
sendKpxx.setOpFlag(0); |
||||
|
sendKpxx.setIncomeId(null); |
||||
|
HttpEntity<SendKpxx> request1 = new HttpEntity<>(sendKpxx, headers); |
||||
|
responseData = restTemplate.postForObject(incomeUrl,request, ResponseBeanForBeiJing.class); |
||||
|
if("200".equals(responseData.getCode())){ |
||||
|
dataMap = (Map) responseData.getData(); |
||||
|
incomeId = dataMap.get("incomeId").toString(); |
||||
|
HashMap<String, String> paramMap = new HashMap<>(); |
||||
|
paramMap.put("incomeId", incomeId); |
||||
|
paramMap.put("lcid", sendKpxx.getWfrequest()); |
||||
|
otherMapper.updateScKpcwqrsr_incomeId_Byid(paramMap);//把返回的项目编号存入Sc_kssqsp
|
||||
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
||||
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
||||
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
||||
|
log.info("删除后新增开票确认到云平台成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
@Transactional() |
||||
|
public void sendKpqrdzToYunPingtai(SendKpxx sendKpxx, HttpHeaders headers){ |
||||
|
String invoiceNo = sendKpxx.getInvoiceNo(); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.getForObject(InvoicingApprovalStatusUrl,ResponseBeanForBeiJing.class,headers,invoiceNo); |
||||
|
if (!"200".equals(responseData.getCode())){ |
||||
|
log.info("返回信息错误!"+responseData.toString()); |
||||
|
return; |
||||
|
} |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
Integer status = (Integer) dataMap.get("status"); |
||||
|
if (status!=4){ |
||||
|
log.info("开票申请未通过,不能进行开票确认"); |
||||
|
return; |
||||
|
} |
||||
|
//新增
|
||||
|
if(sendKpxx.getOperatetype()==0){ |
||||
|
invoiceNo = otherMapper.selectScKpsqsp_yptbh_ByPjid(sendKpxx.getRequestid()).get("yptbh"); |
||||
|
sendKpxx.setInvoiceNo(invoiceNo); |
||||
|
sendKpxx.setOpUserCode(sendKpxx.getIncomeUserCode());//操作员工编码
|
||||
|
sendKpxx.setOpFlag(0); |
||||
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
||||
|
responseData = restTemplate.postForObject(incomeUrl,request, ResponseBeanForBeiJing.class); |
||||
|
if ("200".equals(responseData.getCode())) { |
||||
|
dataMap = (Map) responseData.getData(); |
||||
|
String incomeId = dataMap.get("accountId").toString(); |
||||
|
HashMap<String, String> paramMap = new HashMap<>(); |
||||
|
paramMap.put("accountId", incomeId); |
||||
|
paramMap.put("id", sendKpxx.getRequestid()); |
||||
|
otherMapper.updateScKpsqsp_accountId_Byid(paramMap);//把返回的项目编号存入Sc_kssqsp
|
||||
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
||||
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
||||
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
||||
|
log.info("新增开票确认到账信息到云平台成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} else { |
||||
|
log.info("新增开票确认失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
||||
|
log.info("返回的信息是" + responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
//修改
|
||||
|
if (sendKpxx.getOperatetype()==1){ |
||||
|
invoiceNo = otherMapper.selectScKpsqsp_yptbh_ByPjid(sendKpxx.getRequestid()).get("yptbh"); |
||||
|
sendKpxx.setInvoiceNo(invoiceNo); |
||||
|
sendKpxx.setOpUserCode(sendKpxx.getIncomeUserCode());//操作员工编码
|
||||
|
sendKpxx.setOpFlag(1); |
||||
|
String accountId = otherMapper.selectScKpcwqrsr_accountId_Bylcid(sendKpxx.getRequestid()).get("accountId"); |
||||
|
sendKpxx.setAccountId(accountId); |
||||
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
||||
|
responseData = restTemplate.postForObject(incomeUrl,request, ResponseBeanForBeiJing.class); |
||||
|
//删除成功后在新增
|
||||
|
if ("200".equals(responseData.getCode())){ |
||||
|
sendKpxx.setOpFlag(0); |
||||
|
sendKpxx.setAccountId(null); |
||||
|
HttpEntity<SendKpxx> request1 = new HttpEntity<>(sendKpxx, headers); |
||||
|
responseData = restTemplate.postForObject(incomeUrl,request, ResponseBeanForBeiJing.class); |
||||
|
if("200".equals(responseData.getCode())){ |
||||
|
dataMap = (Map) responseData.getData(); |
||||
|
accountId = dataMap.get("accountId").toString(); |
||||
|
HashMap<String, String> paramMap = new HashMap<>(); |
||||
|
paramMap.put("accountId", accountId); |
||||
|
paramMap.put("id", sendKpxx.getWfrequest()); |
||||
|
otherMapper.updateScKpsqsp_accountId_Byid(paramMap);//把返回的项目编号存入Sc_kssqsp
|
||||
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
||||
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
||||
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
||||
|
log.info("删除后新增开票确认到账到云平台成功"); |
||||
|
log.info(responseData.toString()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
@Transactional() |
||||
|
public void queryInvoicingApprovalStatus(HttpHeaders headers){ |
||||
|
List<SendKpxx> sendKpxxToYPTList = sendKpxxMapper.querySendToYPT(); |
||||
|
sendKpxxToYPTList.forEach(item->{ |
||||
|
String invoiceNo = item.getInvoiceNo(); |
||||
|
HttpEntity<String> requestEntity = new HttpEntity<>(invoiceNo, headers); |
||||
|
ResponseBeanForBeiJing responseData = restTemplate.getForObject(InvoicingApprovalStatusUrl,ResponseBeanForBeiJing.class,invoiceNo,headers); |
||||
|
if (!"200".equals(responseData.getCode())){ |
||||
|
log.info("返回信息错误!"+responseData.toString()); |
||||
|
return; |
||||
|
} |
||||
|
Map dataMap = (Map) responseData.getData(); |
||||
|
Integer status = (Integer) dataMap.get("status"); |
||||
|
if (status==4){ |
||||
|
//已确认
|
||||
|
//更新这边的流程
|
||||
|
String processId = sendKpxxMapper.selectProcessId(item.getRequestid()); |
||||
|
Requestlog requestlog = new Requestlog(); |
||||
|
requestlog.setRequestid(processId); |
||||
|
requestlog.setStaffid(kpssProcessNode6IdInfo.getCurrentStaffid()); |
||||
|
requestlog.setIsedit(1); |
||||
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
||||
|
requestlog.setCreatedate(LocalDate.now().format(dateTimeFormatter)); |
||||
|
requestlog.setStepid(kpssProcessNode6IdInfo.getCurrentStepid()); |
||||
|
requestlog.setNtype(1); |
||||
|
requestlog.setInfo("北京同意"); |
||||
|
requestlog.setIstodo(1); |
||||
|
requestlog.setNextstepid(kpssProcessNode6IdInfo.getNextStepid()); |
||||
|
requestlogMapper.insert(requestlog); |
||||
|
log.info("requestlog新增成功:"+requestlog.toString()); |
||||
|
Permissionrulegroup permissionrulegroup = new Permissionrulegroup(); |
||||
|
permissionrulegroup.setTypeid(kpssProcessNode6IdInfo.getNextTypeid()); |
||||
|
permissionrulegroup.setRestype("4028818327ba2e450127ba2e5b000012"); |
||||
|
permissionrulegroup.setResid(processId); |
||||
|
permissionrulegroup.setOperate(197); |
||||
|
permissionrulegroup.setOptquery(1); |
||||
|
permissionrulegroup.setOptcreate(0); |
||||
|
permissionrulegroup.setOptupdate(4); |
||||
|
permissionrulegroup.setOptdelete(0); |
||||
|
permissionrulegroup.setOptmanage(0); |
||||
|
permissionrulegroup.setPageid("2c9adae4797fd663017982c00bf301e3"); |
||||
|
permissionrulegroup.setStmp("2c9adae478fdbe15017906f93ec90266"); |
||||
|
permissionrulegroup.setDsporder(0); |
||||
|
permissionrulegroup.setLayoutedit("2c9a59b681805f1301818a7047300091"); |
||||
|
permissionrulegroup.setAdddate(LocalDate.now().format(dateTimeFormatter)); |
||||
|
permissionrulegroup.setAllowstaffids(kpssProcessNode6IdInfo.getNextAllowStaffids()); |
||||
|
permissionrulegroup.setMatrixtype(0); |
||||
|
permissionrulegroupMapper.insert(permissionrulegroup); |
||||
|
log.info("permissionrulegroup新增成功:"+permissionrulegroup.toString()); |
||||
|
Readlog readlog = new Readlog(); |
||||
|
readlog.setDataid(processId); |
||||
|
readlog.setStepid(kpssProcessNode6IdInfo.getCurrentStepid()); |
||||
|
readlog.setStaffid(kpssProcessNode6IdInfo.getCurrentStaffid()); |
||||
|
readlog.setReadnum("1"); |
||||
|
readlog.setResid("2c9adae478fdbe15017906f73e8a0261"); |
||||
|
readlog.setLastaccessdate(LocalDate.now().format(dateTimeFormatter)); |
||||
|
readlog.setAdddate(LocalDate.now().format(dateTimeFormatter)); |
||||
|
readlogMapper.insert(readlog); |
||||
|
log.info("readlog1111新增成功:"+readlog.toString()); |
||||
|
readlog.setStepid(kpssProcessNode6IdInfo.getNextStepid()); |
||||
|
readlog.setAdddate(LocalDate.now().plus(Duration.ofSeconds(10)).format(dateTimeFormatter));//加10
|
||||
|
readlog.setLastaccessdate(LocalDate.now().plus(Duration.ofSeconds(10)).format(dateTimeFormatter)); |
||||
|
readlogMapper.insert(readlog); |
||||
|
log.info("readlog22222新增成功:"+readlog.toString()); |
||||
|
Requestoperator requestoperator = new Requestoperator(); |
||||
|
//流程号查询id
|
||||
|
LambdaQueryWrapper<Requestoperator> requestoperatorLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
||||
|
requestoperatorLambdaQueryWrapper.eq(Requestoperator::getIssubmit,0); |
||||
|
requestoperatorLambdaQueryWrapper.eq(Requestoperator::getRequestid,processId); |
||||
|
String requestoperatorId = requestoperatorMapper.selectList(requestoperatorLambdaQueryWrapper).get(0).getId(); |
||||
|
|
||||
|
LambdaUpdateWrapper<Requestoperator> requestoperatorLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
requestoperatorLambdaUpdateWrapper.set(Requestoperator::getIssubmit,1); |
||||
|
requestoperatorLambdaUpdateWrapper.set(Requestoperator::getSubmitdate,LocalDate.now().format(dateTimeFormatter)); |
||||
|
requestoperatorLambdaUpdateWrapper.eq(Requestoperator::getId,requestoperatorId); |
||||
|
requestoperatorMapper.update(null,requestoperatorLambdaUpdateWrapper); |
||||
|
log.info("requestoperatorLambdaUpdateWrapper成功:"+requestoperatorLambdaUpdateWrapper.toString()); |
||||
|
|
||||
|
requestoperator.setRequestid(processId); |
||||
|
requestoperator.setStepid(kpssProcessNode6IdInfo.getNextStepid()); |
||||
|
requestoperator.setStepoperid(kpssProcessNode6IdInfo.getNextStepOperid()); |
||||
|
requestoperator.setStaffid(kpssProcessNode6IdInfo.getNextAllowStaffids()); |
||||
|
requestoperator.setIssubmit(0); |
||||
|
requestoperator.setReceivedate(LocalDate.now().format(dateTimeFormatter)); |
||||
|
requestoperator.setOpertype(1); |
||||
|
requestoperator.setIsremind(0); |
||||
|
requestoperator.setIsorioperator(0); |
||||
|
requestoperator.setDsporder(1); |
||||
|
requestoperatorMapper.insert(requestoperator); |
||||
|
log.info("requestoperator新增成功:"+requestoperator.toString()); |
||||
|
|
||||
|
LambdaUpdateWrapper<Wfrequest> wfrequestLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
wfrequestLambdaUpdateWrapper.set(Wfrequest::getLastmodifydate,LocalDate.now().format(dateTimeFormatter)); |
||||
|
wfrequestLambdaUpdateWrapper.set(Wfrequest::getLaststaffid,kpssProcessNode6IdInfo.getCurrentStaffid()); |
||||
|
wfrequestLambdaUpdateWrapper.eq(Wfrequest::getId,processId); |
||||
|
wfrequestMapper.update(null,wfrequestLambdaUpdateWrapper); |
||||
|
log.info("wfrequestLambdaUpdateWrapper修改成功:"+wfrequestLambdaUpdateWrapper.toString()); |
||||
|
|
||||
|
LambdaUpdateWrapper<Requeststatus> requeststatusLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
requeststatusLambdaUpdateWrapper.set(Requeststatus::getStepid,kpssProcessNode6IdInfo.getNextStepid()); |
||||
|
requeststatusLambdaUpdateWrapper.set(Requeststatus::getPrestepid,kpssProcessNode6IdInfo.getCurrentStepid()); |
||||
|
requeststatusLambdaUpdateWrapper.set(Requeststatus::getModifydate,LocalDate.now().format(dateTimeFormatter)); |
||||
|
requeststatusLambdaUpdateWrapper.eq(Requeststatus::getRequestid,processId); |
||||
|
requeststatusMapper.update(null,requeststatusLambdaUpdateWrapper); |
||||
|
log.info("requeststatusLambdaUpdateWrapper修改成功:"+requeststatusLambdaUpdateWrapper.toString()); |
||||
|
|
||||
|
LambdaUpdateWrapper<ScXglc> scXglcLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
||||
|
scXglcLambdaUpdateWrapper.set(ScXglc::getZhtjsj,LocalDate.now().format(dateTimeFormatter)); |
||||
|
scXglcLambdaUpdateWrapper.set(ScXglc::getZhtjr,kpssProcessNode6IdInfo.getCurrentStaffid()); |
||||
|
scXglcLambdaUpdateWrapper.set(ScXglc::getDqjd,kpssProcessNode6IdInfo.getNextStepid()); |
||||
|
scXglcLambdaUpdateWrapper.eq(ScXglc::getLc,processId); |
||||
|
scXglcMapper.update(null,scXglcLambdaUpdateWrapper); |
||||
|
log.info("scXglcLambdaUpdateWrapper修改成功:"+scXglcLambdaUpdateWrapper.toString()); |
||||
|
log.info("流程数据更新成功,流程到财务开票"); |
||||
|
} |
||||
|
|
||||
|
}); |
||||
} |
} |
||||
} |
} |
||||
|
@ -0,0 +1,48 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.example.guoyan.mapper.OtherMapper"> |
||||
|
<update id="updateScXMkp1_yptbh_ByPjid" parameterType="Map"> |
||||
|
update sc_xmkp1 set yptbh = #{yptbh} where id = #{id} |
||||
|
</update> |
||||
|
<select id="selectScXMkp1_yptbh_ByPjid" resultType="Map"> |
||||
|
select yptbh from sc_xmkp1 where id = #{projectID} |
||||
|
</select> |
||||
|
<update id="updateScHTLC_yptbh_ByPjid" parameterType="Map"> |
||||
|
update sc_htlc set yptbh = #{yptbh} where id = #{id} |
||||
|
</update> |
||||
|
<select id="selectScHTLC_yptbh_ByPjid" resultType="Map"> |
||||
|
select yptbh from sc_htlc where id = #{contractId} |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectXmAmount" resultType="String"> |
||||
|
select case when htje is null or htje =0.00 THEN fyys |
||||
|
else htje end as htje from sc_xmkp1 where id = #{id}; |
||||
|
</select> |
||||
|
<select id="selectFileById" resultType="Map"> |
||||
|
select filename,filepath,filetype from attach where id = #{id} |
||||
|
</select> |
||||
|
<update id="updateScKpsqsp_yptbh_Byid" parameterType="Map"> |
||||
|
update sc_kpsqsp set yptbh = #{yptbh} where id = #{id} |
||||
|
</update> |
||||
|
<select id="selectScKpsqsp_yptbh_ByPjid" resultType="Map"> |
||||
|
select yptbh from sc_kpsqsp where id = #{id} |
||||
|
</select> |
||||
|
<select id="selectScKpsqsp_yptbh_Byreqid" resultType="Map"> |
||||
|
select yptbh from sc_kpsqsp where requestid = #{requestid} |
||||
|
</select> |
||||
|
<update id="updateScKpcwqrsr_incomeId_Byid" parameterType="Map"> |
||||
|
update sc_kpcwqrsr set incomeId = #{incomeId} where lcid = #{lcid} |
||||
|
</update> |
||||
|
<select id="selectScKpcwqrsr_incomeId_Bylcid" resultType="Map"> |
||||
|
select DISTINCT incomeId from sc_kpsqsp where id = #{lcid} |
||||
|
</select> |
||||
|
<update id="updateScKpsqsp_accountId_Byid" parameterType="Map"> |
||||
|
update sc_kpsqsp set accountId = #{accountId} where id = #{id} |
||||
|
</update> |
||||
|
<select id="selectScKpcwqrsr_accountId_Bylcid" resultType="Map"> |
||||
|
select DISTINCT accountId from sc_kpsqsp where id = #{id} |
||||
|
</select> |
||||
|
<select id="selectProcessNo5IsSubmit" resultType="Map"> |
||||
|
SELECT * FROM requestoperator WHERE requestid=(select DISTINCT requestid from sc_kpsqsp where id =#{reqid}) and stepid =#{setpid} and isSubmit =1 |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,47 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.example.guoyan.mapper.SendHtMapper"> |
||||
|
|
||||
|
<resultMap type="com.example.guoyan.entity.SendHt" id="SendHtMap"> |
||||
|
<result property="id" column="id" jdbcType="INTEGER"/> |
||||
|
<result property="contractCode" column="contract_code" jdbcType="VARCHAR"/> |
||||
|
<result property="contractName" column="contract_name" jdbcType="VARCHAR"/> |
||||
|
<result property="projectId" column="project_id" jdbcType="VARCHAR"/> |
||||
|
<result property="highTech" column="high_tech" jdbcType="VARCHAR"/> |
||||
|
<result property="winningBidWay" column="winning_bid_way" jdbcType="VARCHAR"/> |
||||
|
<result property="contractAmount" column="contract_amount" jdbcType="NUMERIC"/> |
||||
|
<result property="signOut" column="sign_out" jdbcType="VARCHAR"/> |
||||
|
<result property="signIn" column="sign_in" jdbcType="VARCHAR"/> |
||||
|
<result property="confirmDate" column="confirm_date" jdbcType="VARCHAR"/> |
||||
|
<result property="addtime" column="addtime" jdbcType="TIMESTAMP"/> |
||||
|
<result property="status" column="status" jdbcType="VARCHAR"/> |
||||
|
<result property="operatetype" column="operatetype" jdbcType="VARCHAR"/> |
||||
|
<result property="contractId" column="contract_id" jdbcType="VARCHAR"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<!--查询单个--> |
||||
|
<select id="querySendHtByNoDel" resultMap="SendHtMap"> |
||||
|
select |
||||
|
id, |
||||
|
contract_code, |
||||
|
contract_name, |
||||
|
(select yptbh from sc_xmkp1 where id =project_no ) project_no, |
||||
|
project_no as project_id, |
||||
|
high_tech, |
||||
|
(select name from selectitem e WHERE e.id =winning_bid_way) winning_bid_way, |
||||
|
contract_amount, |
||||
|
sign_out, |
||||
|
sign_in, |
||||
|
confirm_date, |
||||
|
addtime, |
||||
|
status, |
||||
|
operatetype, |
||||
|
contract_id |
||||
|
from send_ht |
||||
|
where status is null |
||||
|
order by addtime |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
|
|
@ -0,0 +1,89 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.example.guoyan.mapper.SendKpxxMapper"> |
||||
|
|
||||
|
<resultMap type="com.example.guoyan.entity.SendKpxx" id="SendKpxxMap"> |
||||
|
<result property="id" column="id" jdbcType="INTEGER"/> |
||||
|
<result property="requestid" column="requestid" jdbcType="VARCHAR"/> |
||||
|
<result property="invoiceNo" column="invoice_no" jdbcType="VARCHAR"/> |
||||
|
<result property="invoiceDate" column="invoice_date" jdbcType="VARCHAR"/> |
||||
|
<result property="projectNo" column="project_no" jdbcType="VARCHAR"/> |
||||
|
<result property="receiptScheduleName" column="receipt_schedule_name" jdbcType="VARCHAR"/> |
||||
|
<result property="payerName" column="payer_name" jdbcType="VARCHAR"/> |
||||
|
<result property="payerNumber" column="payer_number" jdbcType="VARCHAR"/> |
||||
|
<result property="invoiceAmount" column="invoice_amount" jdbcType="NUMERIC"/> |
||||
|
<result property="invoiceContent" column="invoice_content" jdbcType="VARCHAR"/> |
||||
|
<result property="paymentMode" column="payment_mode" jdbcType="VARCHAR"/> |
||||
|
<result property="invoiceType" column="invoice_type" jdbcType="VARCHAR"/> |
||||
|
<result property="remarkInfo" column="remark_info" jdbcType="VARCHAR"/> |
||||
|
<result property="specialInfo" column="special_info" jdbcType="VARCHAR"/> |
||||
|
<result property="evidenceId" column="evidence_id" jdbcType="VARCHAR"/> |
||||
|
<result property="applyUserCode" column="apply_user_code" jdbcType="VARCHAR"/> |
||||
|
<result property="confirmDate" column="confirm_date" jdbcType="VARCHAR"/> |
||||
|
<result property="confirmUserCode" column="confirm_user_code" jdbcType="VARCHAR"/> |
||||
|
<result property="incomeDate" column="income_date" jdbcType="VARCHAR"/> |
||||
|
<result property="incomeAmount" column="income_amount" jdbcType="NUMERIC"/> |
||||
|
<result property="incomeUserCode" column="income_user_code" jdbcType="VARCHAR"/> |
||||
|
<result property="accountDate" column="account_date" jdbcType="VARCHAR"/> |
||||
|
<result property="accountAmount" column="account_amount" jdbcType="NUMERIC"/> |
||||
|
<result property="accountUserCode" column="account_user_code" jdbcType="VARCHAR"/> |
||||
|
<result property="createtime" column="createtime" jdbcType="TIMESTAMP"/> |
||||
|
<result property="status" column="status" jdbcType="INTEGER"/> |
||||
|
<result property="operatetype" column="operatetype" jdbcType="INTEGER"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<!--查询单个--> |
||||
|
<select id="querySendKpxxByNoDel" resultMap="SendKpxxMap"> |
||||
|
select |
||||
|
id, |
||||
|
requestid, |
||||
|
(select yptbh from sc_kpsqsp where id = requestid) invoice_no, |
||||
|
invoice_date, |
||||
|
(select yptbh from sc_xmkp1 where id =project_no ) project_no, |
||||
|
(select zftk from sc_zfmx where id =receipt_schedule_name ) receipt_schedule_name, |
||||
|
(select kpdwmc from sc_fp1 where id =payer_name ) payer_name, |
||||
|
payer_number, |
||||
|
invoice_amount, |
||||
|
(SELECT kpnr FROM sc_kpnr e WHERE e.id =invoice_content) invoice_content, |
||||
|
"非现金" as payment_mode, |
||||
|
(SELECT name FROM selectitem e WHERE e.id =(SELECT fplx FROM sc_fplx e WHERE e.id =invoice_type)) invoice_type, |
||||
|
remark_info, |
||||
|
special_info, |
||||
|
evidence_id, |
||||
|
(SELECT number0 from staff b WHERE b.id = apply_user_code) apply_user_code, |
||||
|
confirm_date, |
||||
|
(SELECT number0 from staff b WHERE b.id = confirm_user_code) confirm_user_code, |
||||
|
income_date, |
||||
|
income_amount, |
||||
|
(SELECT number0 from staff b WHERE b.id = income_user_code) income_user_code, |
||||
|
account_date, |
||||
|
account_amount, |
||||
|
(SELECT number0 from staff b WHERE b.id = account_user_code) account_user_code, |
||||
|
createtime, |
||||
|
status, |
||||
|
interface_type, |
||||
|
operatetype, |
||||
|
wfrequest |
||||
|
from send_kpxx |
||||
|
where status is null |
||||
|
order by createtime |
||||
|
</select> |
||||
|
<select id="querySendToYPT" resultMap="SendKpxxMap"> |
||||
|
select |
||||
|
id, |
||||
|
requestid, |
||||
|
(select yptbh from sc_kpsqsp where id = requestid) invoice_no, |
||||
|
createtime, |
||||
|
status, |
||||
|
interface_type, |
||||
|
operatetype, |
||||
|
wfrequest |
||||
|
from send_kpxx |
||||
|
where status =1 and operatetype = 0 and interface_type = 0 |
||||
|
order by createtime |
||||
|
</select> |
||||
|
<select id="selectProcessId" resultType="String"> |
||||
|
select DISTINCT requestid from sc_kpsqsp where id =#{id} |
||||
|
</select> |
||||
|
</mapper> |
||||
|
|
@ -0,0 +1,119 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.example.guoyan.mapper.SendXmMapper"> |
||||
|
|
||||
|
<resultMap type="com.example.guoyan.entity.SendXm" id="SendXmMap"> |
||||
|
<result property="id" column="id" jdbcType="INTEGER"/> |
||||
|
<result property="projectNo" column="project_no" jdbcType="VARCHAR"/> |
||||
|
<result property="projectName" column="project_name" jdbcType="VARCHAR"/> |
||||
|
<result property="projectType" column="project_type" jdbcType="VARCHAR"/> |
||||
|
<result property="areaCode" column="area_code" jdbcType="VARCHAR"/> |
||||
|
<result property="projectSecret" column="project_secret" jdbcType="INTEGER"/> |
||||
|
<result property="salesLeaderCode" column="sales_leader_code" jdbcType="VARCHAR"/> |
||||
|
<result property="nominalDirectorCode" column="nominal_director_code" jdbcType="VARCHAR"/> |
||||
|
<result property="deptCode" column="dept_code" jdbcType="VARCHAR"/> |
||||
|
<result property="projectManagerCode" column="project_manager_code" jdbcType="VARCHAR"/> |
||||
|
<result property="contractAmount" column="contract_amount" jdbcType="NUMERIC"/> |
||||
|
<result property="projectConstructionScale" column="project_construction_scale" jdbcType="NUMERIC"/> |
||||
|
<result property="projectCompany" column="project_company" jdbcType="VARCHAR"/> |
||||
|
<result property="projectStartDate" column="project_start_date" jdbcType="VARCHAR"/> |
||||
|
<result property="projectEndDate" column="project_end_date" jdbcType="VARCHAR"/> |
||||
|
<result property="projectIndustry" column="project_industry" jdbcType="VARCHAR"/> |
||||
|
<result property="projectCaseType" column="project_case_type" jdbcType="VARCHAR"/> |
||||
|
<result property="projectUserProperty" column="project_user_property" jdbcType="VARCHAR"/> |
||||
|
<result property="projectDescription" column="project_description" jdbcType="VARCHAR"/> |
||||
|
<result property="remarks" column="remarks" jdbcType="VARCHAR"/> |
||||
|
<result property="createtime" column="createtime" jdbcType="TIMESTAMP"/> |
||||
|
<result property="status" column="status" jdbcType="INTEGER"/> |
||||
|
<result property="operatetype" column="operatetype" jdbcType="INTEGER"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="querySendXmByNoDel" resultMap="SendXmMap"> |
||||
|
select |
||||
|
id, |
||||
|
project_id, |
||||
|
project_no, |
||||
|
project_name, |
||||
|
(select |
||||
|
CASE |
||||
|
WHEN name ='监理' THEN |
||||
|
'supervision' |
||||
|
WHEN name = '咨询' THEN |
||||
|
'advisory' |
||||
|
WHEN name ='监理加咨询' THEN |
||||
|
'supervision_advisory' |
||||
|
END AS name |
||||
|
from selectitem a where a.id=project_type) project_type, |
||||
|
area_code, |
||||
|
CASE |
||||
|
WHEN SUBSTRING(project_name, 1, 1) REGEXP '^[a-zA-Z]' THEN 2 |
||||
|
ELSE 1 |
||||
|
END AS project_secret, |
||||
|
(SELECT number0 from staff b WHERE b.id = sales_leader_code) sales_leader_code, |
||||
|
(SELECT number0 from staff c WHERE c.id = nominal_director_code) nominal_director_code, |
||||
|
"051999" as dept_code, |
||||
|
(SELECT number0 from staff d WHERE d.id = project_manager_code) project_manager_code, |
||||
|
case when contract_amount is null or contract_amount =0.00 THEN fyys |
||||
|
else contract_amount end as contract_amount, |
||||
|
project_construction_scale, |
||||
|
(select qymc from sc_hh1 f where f.id=project_company ) project_company, |
||||
|
project_start_date, |
||||
|
project_end_date, |
||||
|
(SELECT name FROM selectitem e WHERE e.id =project_industry) project_industry, |
||||
|
(SELECT name FROM selectitem e WHERE e.id =project_case_type) project_case_type, |
||||
|
(SELECT name FROM selectitem e WHERE e.id =project_user_property) project_user_property, |
||||
|
project_description, |
||||
|
remarks, |
||||
|
createtime, |
||||
|
status, |
||||
|
operatetype |
||||
|
from send_xm |
||||
|
where status is null |
||||
|
order by createtime |
||||
|
</select> |
||||
|
<select id="querySendXmByProjectId" resultMap="SendXmMap"> |
||||
|
select |
||||
|
id, |
||||
|
project_id, |
||||
|
project_no, |
||||
|
project_name, |
||||
|
(select |
||||
|
CASE |
||||
|
WHEN name ='监理' THEN |
||||
|
'supervision' |
||||
|
WHEN name = '咨询' THEN |
||||
|
'advisory' |
||||
|
WHEN name ='监理加咨询' THEN |
||||
|
'supervision_advisory' |
||||
|
END AS name |
||||
|
from selectitem a where a.id=project_type) project_type, |
||||
|
area_code, |
||||
|
CASE |
||||
|
WHEN SUBSTRING(project_name, 1, 1) REGEXP '^[a-zA-Z]' THEN 2 |
||||
|
ELSE 1 |
||||
|
END AS project_secret, |
||||
|
(SELECT number0 from staff b WHERE b.id = sales_leader_code) sales_leader_code, |
||||
|
(SELECT number0 from staff c WHERE c.id = nominal_director_code) nominal_director_code, |
||||
|
"051999" as dept_code, |
||||
|
(SELECT number0 from staff d WHERE d.id = project_manager_code) project_manager_code, |
||||
|
case when contract_amount is null or contract_amount =0.00 THEN fyys |
||||
|
else contract_amount end as contract_amount, |
||||
|
project_construction_scale, |
||||
|
(select qymc from sc_hh1 f where f.id=project_company ) project_company, |
||||
|
project_start_date, |
||||
|
project_end_date, |
||||
|
(SELECT name FROM selectitem e WHERE e.id =project_industry) project_industry, |
||||
|
(SELECT name FROM selectitem e WHERE e.id =project_case_type) project_case_type, |
||||
|
(SELECT name FROM selectitem e WHERE e.id =project_user_property) project_user_property, |
||||
|
project_description, |
||||
|
remarks, |
||||
|
createtime, |
||||
|
status, |
||||
|
operatetype |
||||
|
from send_xm |
||||
|
where status = 1 and project_id = #{projectId} |
||||
|
order by createtime desc |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
|
|
Loading…
Reference in new issue