|
@@ -104,12 +104,21 @@ public class InsuranceApplicationController {
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
HttpServletRequest request){
|
|
HttpServletRequest request){
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
- CompanyUser companyUser = companyUserService.findByUserName(principal.getName());
|
|
|
|
- Company company = companyService.get(companyUser.getCompanyId());
|
|
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
+ CompanyUser companyUser = companyUserService.findByUserName(principal.getName());
|
|
|
|
+ Company company = null;
|
|
|
|
+
|
|
|
|
+ if (companyUser!=null && StringUtils.isNotEmpty(companyUser.getCompanyId())) {
|
|
|
|
+ company = companyService.get(companyUser.getCompanyId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (company==null){
|
|
|
|
+ throw new Exception("请先填写企业信息!");
|
|
|
|
+ }
|
|
|
|
+
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|
|
@@ -580,14 +589,23 @@ public class InsuranceApplicationController {
|
|
}
|
|
}
|
|
|
|
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
- Company company = companyService.findByCreateBy(principal.getName());
|
|
|
|
|
|
+ CompanyUser companyUser = companyUserService.findByUserName(principal.getName());
|
|
|
|
+ Company company = null;
|
|
|
|
+
|
|
|
|
+ if(companyUser!=null && StringUtils.isNotEmpty(companyUser.getCompanyId())) {
|
|
|
|
+ company = companyService.get(companyUser.getCompanyId());
|
|
|
|
+ }
|
|
|
|
|
|
String serialNumber = (String)principal.getAttributes().get("serialNumber");
|
|
String serialNumber = (String)principal.getAttributes().get("serialNumber");
|
|
|
|
|
|
TransactionRecord transactionRecord = new TransactionRecord();
|
|
TransactionRecord transactionRecord = new TransactionRecord();
|
|
transactionRecord.setId(UUID.randomUUID().toString());
|
|
transactionRecord.setId(UUID.randomUUID().toString());
|
|
transactionRecord.setApplicationId(applicationId);
|
|
transactionRecord.setApplicationId(applicationId);
|
|
- transactionRecord.setCompanyId(company.getId());
|
|
|
|
|
|
+
|
|
|
|
+ if(company!=null) {
|
|
|
|
+ transactionRecord.setCompanyId(company.getId());
|
|
|
|
+ }
|
|
|
|
+
|
|
transactionRecord.setAmount(insuranceApplication.getInsuranceFee());
|
|
transactionRecord.setAmount(insuranceApplication.getInsuranceFee());
|
|
transactionRecord.setPaymentStatus("0");
|
|
transactionRecord.setPaymentStatus("0");
|
|
transactionRecord.setOrderNo(DateTime.now().toString("yyyyMMddHHmmssSSS"));
|
|
transactionRecord.setOrderNo(DateTime.now().toString("yyyyMMddHHmmssSSS"));
|
|
@@ -655,8 +673,13 @@ public class InsuranceApplicationController {
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,
|
|
HttpServletRequest request){
|
|
HttpServletRequest request){
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
|
|
|
|
+
|
|
CompanyUser companyUser = companyUserService.findByUserName(principal.getName());
|
|
CompanyUser companyUser = companyUserService.findByUserName(principal.getName());
|
|
- Company company = companyService.get(companyUser.getCompanyId());
|
|
|
|
|
|
+ Company company = null;
|
|
|
|
+
|
|
|
|
+ if(companyUser!=null && StringUtils.isNotEmpty(companyUser.getCompanyId())) {
|
|
|
|
+ company = companyService.get(companyUser.getCompanyId());
|
|
|
|
+ }
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
@@ -670,6 +693,9 @@ public class InsuranceApplicationController {
|
|
if (company!=null && StringUtils.isNotEmpty(company.getId())) {
|
|
if (company!=null && StringUtils.isNotEmpty(company.getId())) {
|
|
searchParams.put("companyId", company.getId());
|
|
searchParams.put("companyId", company.getId());
|
|
}
|
|
}
|
|
|
|
+ else{
|
|
|
|
+ searchParams.put("companyId", "");
|
|
|
|
+ }
|
|
|
|
|
|
if (StringUtils.isNotEmpty(definitionId)) {
|
|
if (StringUtils.isNotEmpty(definitionId)) {
|
|
searchParams.put("definitionId", definitionId);
|
|
searchParams.put("definitionId", definitionId);
|