480 changed files with 56778 additions and 4708 deletions
@ -0,0 +1,25 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.domain.entity.BandConfig; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2023/9/25 16:06 |
||||
|
**/ |
||||
|
public interface BandConfigService { |
||||
|
RestResponse list(Map<String, Object> params); |
||||
|
|
||||
|
RestResponse update(BandConfig bandConfig); |
||||
|
|
||||
|
RestResponse delete(Integer id); |
||||
|
|
||||
|
RestResponse export(Map<String, Object> params, HttpServletResponse response); |
||||
|
|
||||
|
RestResponse upload(MultipartFile file); |
||||
|
} |
||||
@ -1,40 +0,0 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
|
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
|
||||
import com.cmsen.ticket.domain.entity.manager.InvoiceImage; |
|
||||
|
|
||||
import javax.servlet.http.HttpServletResponse; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* @author OWTS |
|
||||
* @version 1.0.0 |
|
||||
* @date 2021/3/3 14:14 |
|
||||
**/ |
|
||||
public interface InvoiceImageService { |
|
||||
RestResponse list(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse selectImg(Integer id); |
|
||||
|
|
||||
RestResponse selectByPrimaryKey(Integer id); |
|
||||
|
|
||||
RestResponse create(InvoiceImage invoiceImage); |
|
||||
|
|
||||
RestResponse update(InvoiceImage invoiceImage); |
|
||||
|
|
||||
RestResponse delete(Integer id); |
|
||||
|
|
||||
RestResponse deleteBatch(String ids); |
|
||||
|
|
||||
RestResponse download(Integer id, HttpServletResponse response); |
|
||||
|
|
||||
RestResponse exportExcel(Map<String, Object> params, HttpServletResponse response); |
|
||||
|
|
||||
RestResponse downloadImages(Map<String, Object> params, HttpServletResponse response); |
|
||||
|
|
||||
RestResponse downloadXmls(Map<String, Object> params, HttpServletResponse response); |
|
||||
|
|
||||
RestResponse downloadXmlsPoc(Map<String, Object> params, HttpServletResponse response); |
|
||||
|
|
||||
RestResponse getUnMatchImg(String reportId); |
|
||||
} |
|
||||
@ -1,12 +1,16 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
package com.cmsen.ticket.application.manager.service; |
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.domain.entity.Jsadapter; |
||||
|
|
||||
import java.util.Map; |
import java.util.Map; |
||||
|
|
||||
public interface JsadapterService { |
public interface JsadapterService { |
||||
RestResponse list(Map<String, Object> params); |
RestResponse list(Map<String, Object> params); |
||||
|
|
||||
|
RestResponse create(Jsadapter jsadapter); |
||||
|
|
||||
|
RestResponse update(Jsadapter jsadapter); |
||||
|
|
||||
RestResponse delete(Integer id); |
RestResponse delete(Integer id); |
||||
} |
} |
||||
|
|||||
@ -1,19 +0,0 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
|
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
|
||||
import org.springframework.web.multipart.MultipartFile; |
|
||||
|
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* @author OWTS |
|
||||
* @version 1.0.0 |
|
||||
* @date 2022/10/9 16:06 |
|
||||
**/ |
|
||||
public interface MtAgreementService { |
|
||||
|
|
||||
RestResponse getList(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse upload(MultipartFile file); |
|
||||
|
|
||||
} |
|
||||
@ -1,54 +0,0 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
|
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
|
||||
import org.springframework.web.multipart.MultipartFile; |
|
||||
|
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* @author OWTS |
|
||||
* @version 1.0.0 |
|
||||
* @date 2022/11/17 16:06 |
|
||||
**/ |
|
||||
public interface MtListPcService { |
|
||||
|
|
||||
RestResponse listMeetPic(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse deletePic(Long id); |
|
||||
|
|
||||
RestResponse meetPicUpload(MultipartFile file); |
|
||||
|
|
||||
RestResponse insertPic(MultipartFile file, String reqId, String picType, String expenseName, String extId); |
|
||||
|
|
||||
RestResponse reqList2(String reqName); |
|
||||
|
|
||||
RestResponse valueSetList(String category); |
|
||||
|
|
||||
RestResponse meetingSpeakerList(String reqId); |
|
||||
|
|
||||
RestResponse listMeeting(Map<String, Object> params); |
|
||||
|
|
||||
|
|
||||
RestResponse getOrgListByPid(Integer pid, String orgName); |
|
||||
|
|
||||
RestResponse checkinList(Map<String, Object> params); |
|
||||
|
|
||||
|
|
||||
RestResponse getEditFlag(String roleId); |
|
||||
|
|
||||
RestResponse meetingDetails(Long id); |
|
||||
|
|
||||
RestResponse meetRevoke(String reqId); |
|
||||
|
|
||||
RestResponse meetReActive(String reqId); |
|
||||
|
|
||||
RestResponse speakerFallBack(Long id); |
|
||||
|
|
||||
RestResponse checkinReset(String reqId); |
|
||||
|
|
||||
RestResponse checkinDel(Long id); |
|
||||
|
|
||||
RestResponse listSignMeet(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse listSignMeetAttend(Map<String, Object> params); |
|
||||
} |
|
||||
@ -1,99 +0,0 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
|
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
|
||||
import com.cmsen.ticket.domain.dto.SubmitOrderMatchDto; |
|
||||
import com.cmsen.ticket.domain.entity.SupplierOrder; |
|
||||
|
|
||||
import java.util.Map; |
|
||||
|
|
||||
|
|
||||
public interface PaymentService { |
|
||||
|
|
||||
RestResponse list(Map<String, Object> params); |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
RestResponse listCompany(String keyword); |
|
||||
|
|
||||
RestResponse listOrg(String keyword); |
|
||||
|
|
||||
RestResponse codeList(); |
|
||||
|
|
||||
RestResponse getCompOrg(String userId); |
|
||||
|
|
||||
RestResponse getUserList(String keyword); |
|
||||
|
|
||||
RestResponse getSupplierList(String orgCode, String keyword, String isDigital); |
|
||||
|
|
||||
|
|
||||
RestResponse deleteHeader(String billId); |
|
||||
|
|
||||
RestResponse orderList(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse createOrder(SupplierOrder supplierOrder); |
|
||||
|
|
||||
RestResponse updateOrder(SupplierOrder supplierOrder); |
|
||||
|
|
||||
RestResponse deleteOrder(String ids, String orderNo); |
|
||||
|
|
||||
RestResponse listItems(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse submitOrderMatchList(SubmitOrderMatchDto dto); |
|
||||
|
|
||||
RestResponse deleteOrderMatch(Long matchId); |
|
||||
|
|
||||
RestResponse submitBill(String billId); |
|
||||
|
|
||||
RestResponse recallBill(String billId); |
|
||||
|
|
||||
RestResponse backBill(String billId); |
|
||||
|
|
||||
RestResponse matchBill(String billId); |
|
||||
|
|
||||
RestResponse getPayTypeList(String keyword); |
|
||||
|
|
||||
RestResponse getMaterialList(String keyword); |
|
||||
|
|
||||
RestResponse getWhiteCompList(String keyword); |
|
||||
|
|
||||
RestResponse listContracts(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse listPurchaces(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse getFlowType(); |
|
||||
|
|
||||
RestResponse listBrands(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse listReceives(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse listInternals(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse valueSetList(String category, Integer pid, String keywords); |
|
||||
|
|
||||
RestResponse getSysConfig(String code); |
|
||||
|
|
||||
RestResponse getBillName(String businessType, String userName); |
|
||||
|
|
||||
RestResponse getMatchFlag(String roleId, String userId, String costCenter); |
|
||||
|
|
||||
RestResponse getMatchFinFlag(String roleId, String userId); |
|
||||
|
|
||||
RestResponse getTransferUser(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse transferBill(String billId, String owner, String toUserId); |
|
||||
|
|
||||
RestResponse listForTransfer(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse transferBatch(Map<String, Object> params, String current, String target); |
|
||||
|
|
||||
RestResponse transferRecallBatch(Map<String, Object> params); |
|
||||
|
|
||||
RestResponse listOwner(String keyword); |
|
||||
} |
|
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
|
||||
|
public interface SearchValueService { |
||||
|
RestResponse clients(); |
||||
|
|
||||
|
RestResponse rules(Integer type); |
||||
|
|
||||
|
RestResponse ticketTypes(); |
||||
|
|
||||
|
RestResponse orgs(); |
||||
|
} |
||||
@ -1,54 +0,0 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
|
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
|
||||
import com.cmsen.ticket.domain.entity.manager.ComplianceCheck; |
|
||||
import com.cmsen.ticket.domain.response.Response; |
|
||||
import org.springframework.web.multipart.MultipartFile; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* @author OWTS |
|
||||
* @version 1.0.0 |
|
||||
* @date 2021/9/9 16:20 |
|
||||
**/ |
|
||||
public interface SmartImageCheckService { |
|
||||
|
|
||||
Response<List<String>> getImages(String id); |
|
||||
|
|
||||
|
|
||||
Response<Object> batchCheck(List<String> reportIds); |
|
||||
|
|
||||
Response<Object> compliance(String reportId); |
|
||||
|
|
||||
Response<Object> uploadImage(MultipartFile file, String reportId); |
|
||||
|
|
||||
Response<Object> forcePassed(List<String> ids); |
|
||||
|
|
||||
Response<List<ComplianceCheck>> getComlianceCheckList(String id); |
|
||||
|
|
||||
Response<Object> approved(String id); |
|
||||
|
|
||||
Response<Object> rejected(String id, String comment); |
|
||||
|
|
||||
|
|
||||
Response<Object> deleteErrorReport(String reportId); |
|
||||
|
|
||||
Response<Object> updateErrorReport(Long id, String newReportId); |
|
||||
|
|
||||
Response<Object> reCheckErrorReport(Long id); |
|
||||
|
|
||||
RestResponse reportLine(String id); |
|
||||
|
|
||||
Response<List<String>> getLineImageList(String id); |
|
||||
|
|
||||
|
|
||||
RestResponse getLogList(Map<String, Object> params); |
|
||||
|
|
||||
Response<List<String>> getErrImages(String reportId); |
|
||||
|
|
||||
RestResponse editRemark(String reportId, String ext02); |
|
||||
|
|
||||
Response<Object> delPaperImage(String id); |
|
||||
} |
|
||||
@ -1,14 +1,20 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
package com.cmsen.ticket.application.manager.service; |
||||
|
|
||||
|
import com.cmsen.ticket.domain.dto.SqlDownloadDto; |
||||
import com.cmsen.ticket.domain.response.Response; |
import com.cmsen.ticket.domain.response.Response; |
||||
|
|
||||
import javax.servlet.http.HttpServletResponse; |
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
import java.util.Map; |
import java.util.Map; |
||||
|
|
||||
/** |
/** |
||||
* @author OWTS |
* @author OWTS |
||||
*/ |
*/ |
||||
public interface SqlDownloadService { |
public interface SqlDownloadService { |
||||
|
Response<Map<String, Object>> getListData(SqlDownloadDto downloadDto); |
||||
|
|
||||
|
Response<List<Map<String, Object>>> getListData2(SqlDownloadDto downloadDto); |
||||
|
|
||||
//Response<Object> exportListData(SqlDownloadDto downloadDto, HttpServletResponse response);
|
//Response<Object> exportListData(SqlDownloadDto downloadDto, HttpServletResponse response);
|
||||
Response<Object> exportListData(Map<String, Object> params, HttpServletResponse response); |
Response<Object> exportListData(Map<String, Object> params, HttpServletResponse response); |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,86 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
package com.cmsen.ticket.application.manager.service; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoice; |
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoiceItems; |
||||
|
import com.cmsen.ticket.domain.vo.FileVo; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
/** |
/** |
||||
* @author OWTS |
* @author OWTS |
||||
* @version 1.0.0 |
* @version 1.0.0 |
||||
* @date 2021/2/19 9:49 |
* @date 2021/2/19 9:49 |
||||
**/ |
**/ |
||||
public interface SysCorInvoiceService { |
public interface SysCorInvoiceService { |
||||
} |
|
||||
|
RestResponse receiveLines(String pid); |
||||
|
RestResponse corporateLines(String pid); |
||||
|
|
||||
|
RestResponse receiveList(Integer pageSize, Integer pageNum, String status,String selNo); |
||||
|
|
||||
|
RestResponse list(Map<String, Object> params); |
||||
|
|
||||
|
RestResponse create(CorporateInvoice corporateInvoice); |
||||
|
RestResponse createLine(CorporateInvoiceItems item); |
||||
|
|
||||
|
RestResponse update(CorporateInvoice corporateInvoice); |
||||
|
|
||||
|
RestResponse delete(String id); |
||||
|
|
||||
|
// RestResponse importFile(MultipartFile file);
|
||||
|
|
||||
|
RestResponse exportExcel(HttpServletResponse response, Map<String, Object> params); |
||||
|
|
||||
|
RestResponse exportImages(HttpServletResponse response, Map<String, Object> params); |
||||
|
|
||||
|
RestResponse selectById(String id); |
||||
|
|
||||
|
RestResponse download(String id, HttpServletResponse response); |
||||
|
|
||||
|
RestResponse upload(MultipartFile[] files, String type, String com,String invoiceType); |
||||
|
RestResponse uploadReceive(MultipartFile[] files, String type, String com); |
||||
|
|
||||
|
RestResponse uploadAtt(MultipartFile[] files, String id); |
||||
|
|
||||
|
RestResponse uploadInvPdf(MultipartFile files); |
||||
|
|
||||
|
RestResponse updateData(MultipartFile file); |
||||
|
|
||||
|
RestResponse updateDeductStatus(); |
||||
|
|
||||
|
RestResponse completeCheck(String invoiceId); |
||||
|
|
||||
|
RestResponse getAllSubjects(); |
||||
|
|
||||
|
RestResponse getAllSubjectsTreeNode(); |
||||
|
|
||||
|
|
||||
|
RestResponse getSubjectById(String invoiceId); |
||||
|
|
||||
|
RestResponse updateSubject(CorporateInvoice corporateInvoice); |
||||
|
|
||||
|
void updatePOAndHTBH(CorporateInvoice corporateInvoice); |
||||
|
|
||||
|
RestResponse exportInvoiceReport(Map<String, Object> params, HttpServletResponse response); |
||||
|
|
||||
|
RestResponse exportByMultiNumber(Map<String, Object> params, HttpServletResponse response); |
||||
|
|
||||
|
RestResponse exportValidExcel(HttpServletResponse response, Map<String, Object> params); |
||||
|
|
||||
|
RestResponse refundTicket(String id); |
||||
|
|
||||
|
RestResponse importAdvanceOfPayment(MultipartFile file); |
||||
|
|
||||
|
RestResponse pushListUpload(MultipartFile file); |
||||
|
|
||||
|
RestResponse pushKofox(String invoiceId); |
||||
|
|
||||
|
JSONObject ncImport(List<FileVo> fileVoList); |
||||
|
|
||||
|
void dealNcExport(int ncImportId,int userId,String type,String originalFilename,String companyId); |
||||
|
} |
||||
|
|||||
@ -1,23 +0,0 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
|
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
|
||||
|
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* @author OWTS |
|
||||
* @version 1.0.0 |
|
||||
* @date 2021/3/2 13:22 |
|
||||
**/ |
|
||||
public interface SysExpenseTypeService { |
|
||||
RestResponse list(Map<String, Object> params); |
|
||||
|
|
||||
|
|
||||
RestResponse delete(Integer id); |
|
||||
|
|
||||
RestResponse selectByPaimaryKey(Integer id); |
|
||||
|
|
||||
RestResponse updateIsDel(Integer id, String isDel); |
|
||||
|
|
||||
RestResponse getPidList(Integer pid); |
|
||||
} |
|
||||
@ -1,19 +0,0 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
|
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
|
||||
|
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* @author OWTS |
|
||||
* @version 1.0.0 |
|
||||
* @date 2021/3/2 13:33 |
|
||||
**/ |
|
||||
public interface SysExtraFieldsService { |
|
||||
RestResponse list(Map<String, Object> params); |
|
||||
|
|
||||
|
|
||||
RestResponse delete(Integer id); |
|
||||
|
|
||||
RestResponse selectByPaimaryKey(Integer id); |
|
||||
} |
|
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysLogo; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2022/8/24 15:40 |
||||
|
**/ |
||||
|
public interface SysLogoService { |
||||
|
RestResponse select(); |
||||
|
|
||||
|
RestResponse create(SysLogo sysLogo); |
||||
|
|
||||
|
RestResponse update(MultipartFile file, String typeStr, String str, Long id); |
||||
|
} |
||||
@ -1,21 +1,23 @@ |
|||||
package com.cmsen.ticket.application.manager.service; |
package com.cmsen.ticket.application.manager.service; |
||||
|
|
||||
import com.cmsen.common.http.response.RestResponse; |
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.domain.entity.Company; |
||||
|
|
||||
import javax.servlet.http.HttpServletResponse; |
|
||||
import java.util.Map; |
import java.util.Map; |
||||
|
|
||||
/** |
/** |
||||
* @author OWTS |
* @author OWTS |
||||
* @version 1.0.0 |
* @version 1.0.0 |
||||
* @date 2021/3/2 14:19 |
* @date 2021/2/22 9:21 |
||||
**/ |
**/ |
||||
public interface SysExtraValueService { |
public interface SysWhitelistService { |
||||
RestResponse list(Map<String, Object> params); |
RestResponse list(Map<String, Object> params); |
||||
|
|
||||
RestResponse selectByPrimaryKey(Integer id); |
RestResponse selectByPrimaryKey(Integer id); |
||||
|
|
||||
RestResponse delete(Integer ids); |
RestResponse create(Company company); |
||||
|
|
||||
RestResponse export(HttpServletResponse response); |
RestResponse update(Company company); |
||||
|
|
||||
|
RestResponse delete(Integer id); |
||||
} |
} |
||||
@ -0,0 +1,159 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.io.IoUtil; |
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.support.ExcelTypeEnum; |
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.ContentEnctype; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.common.util.FileMime; |
||||
|
import com.cmsen.common.util.StringUtil; |
||||
|
import com.cmsen.ticket.application.manager.service.BandConfigService; |
||||
|
import com.cmsen.ticket.domain.entity.BandConfig; |
||||
|
import com.cmsen.ticket.domain.mapper.BandConfigMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.ServletOutputStream; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.io.InputStream; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class BandConfigServiceImpl implements BandConfigService { |
||||
|
|
||||
|
@Resource |
||||
|
private BandConfigMapper bandConfigMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
params.put("pageNum",params.get("pageNo").toString()); |
||||
|
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
||||
|
|
||||
|
List<BandConfig> list = bandConfigMapper.list(params); |
||||
|
int count = bandConfigMapper.count(params); |
||||
|
|
||||
|
return RestResponse.success(PaginationUtil.getPageResult(count, params, list)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public RestResponse update(BandConfig bandConfig) { |
||||
|
bandConfigMapper.updateByPrimaryKeySelective(bandConfig); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
bandConfigMapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse export(Map<String, Object> params, HttpServletResponse response) { |
||||
|
|
||||
|
response.reset(); |
||||
|
ServletOutputStream out = null; |
||||
|
try { |
||||
|
response.setContentType(FileMime.XLSX.getMimeType()); |
||||
|
response.setHeader("Content-Disposition", "attachment;filename=export.xlsx"); |
||||
|
out = response.getOutputStream(); |
||||
|
List<BandConfig> list = bandConfigMapper.list(params); |
||||
|
EasyExcel.write(out).excelType(ExcelTypeEnum.XLSX) |
||||
|
.sheet(0, "Band配置") |
||||
|
.head(BandConfig.class) |
||||
|
.doWrite(list); |
||||
|
out.flush(); |
||||
|
return null; |
||||
|
} catch (Exception e) { |
||||
|
//response.reset();
|
||||
|
log.error(e.getMessage(), e); |
||||
|
response.setContentType(ContentEnctype.JSON); |
||||
|
return RestResponse.failure(e.getMessage()); |
||||
|
} finally { |
||||
|
IoUtil.close(out); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
@Override |
||||
|
public RestResponse upload(MultipartFile file) { |
||||
|
try { |
||||
|
InputStream inputStream = file.getInputStream(); |
||||
|
List<Map<Integer, String>> sheetRowData = EasyExcel.read(inputStream).sheet(0).doReadSync(); |
||||
|
//先进行判断:为空
|
||||
|
for (int i = 0; i < sheetRowData.size(); i++) { |
||||
|
Map<Integer, String> sheetRowDatum = sheetRowData.get(i); |
||||
|
if(StringUtil.isEmpty(sheetRowDatum.get(0))){ |
||||
|
return RestResponse.failure("第"+(i+2)+"行的BAND为空,请检查!"); |
||||
|
} |
||||
|
if(StringUtil.isEmpty(sheetRowDatum.get(1))){ |
||||
|
return RestResponse.failure("第"+(i+2)+"行的AREA为空,请检查!"); |
||||
|
} |
||||
|
if(StringUtil.isEmpty(sheetRowDatum.get(2))){ |
||||
|
return RestResponse.failure("第"+(i+2)+"行的ITEM为空,请检查!"); |
||||
|
} |
||||
|
if(StringUtil.isEmpty(sheetRowDatum.get(3))){ |
||||
|
return RestResponse.failure("第"+(i+2)+"行的RATE为空,请检查!"); |
||||
|
} |
||||
|
} |
||||
|
//数据处理
|
||||
|
for (int i = 0; i < sheetRowData.size(); i++) { |
||||
|
Map<Integer, String> sheetRowDatum = sheetRowData.get(i); |
||||
|
String band = StringUtil.trim(String.valueOf(sheetRowDatum.get(0))); |
||||
|
String area = StringUtil.trim(String.valueOf(sheetRowDatum.get(1))); |
||||
|
String item = StringUtil.trim(String.valueOf(sheetRowDatum.get(2))); |
||||
|
|
||||
|
BandConfig bean = bandConfigMapper.selectRate(band, area, item); |
||||
|
if(bean == null){//插入
|
||||
|
BandConfig bandConfig = new BandConfig(){{ |
||||
|
setBandValue(band); |
||||
|
setArea(area); |
||||
|
setItem(item); |
||||
|
setRate(StringUtil.trim(String.valueOf(sheetRowDatum.get(3)))); |
||||
|
setExt01(StringUtil.trim(String.valueOf(sheetRowDatum.get(4)))); |
||||
|
setExt02(StringUtil.trim(String.valueOf(sheetRowDatum.get(5)))); |
||||
|
setExt03(StringUtil.trim(String.valueOf(sheetRowDatum.get(6)))); |
||||
|
setExt04(StringUtil.trim(String.valueOf(sheetRowDatum.get(7)))); |
||||
|
setExt05(StringUtil.trim(String.valueOf(sheetRowDatum.get(8)))); |
||||
|
setExt06(StringUtil.trim(String.valueOf(sheetRowDatum.get(9)))); |
||||
|
setExt07(StringUtil.trim(String.valueOf(sheetRowDatum.get(10)))); |
||||
|
setExt08(StringUtil.trim(String.valueOf(sheetRowDatum.get(11)))); |
||||
|
setExt09(StringUtil.trim(String.valueOf(sheetRowDatum.get(12)))); |
||||
|
setExt10(StringUtil.trim(String.valueOf(sheetRowDatum.get(13)))); |
||||
|
}}; |
||||
|
bandConfigMapper.insertSelective(bandConfig); |
||||
|
}else{//更新
|
||||
|
BandConfig bandConfig = new BandConfig(){{ |
||||
|
setId(bean.getId()); |
||||
|
setRate(StringUtil.trim(String.valueOf(sheetRowDatum.get(3)))); |
||||
|
setExt01(StringUtil.trim(String.valueOf(sheetRowDatum.get(4)))); |
||||
|
setExt02(StringUtil.trim(String.valueOf(sheetRowDatum.get(5)))); |
||||
|
setExt03(StringUtil.trim(String.valueOf(sheetRowDatum.get(6)))); |
||||
|
setExt04(StringUtil.trim(String.valueOf(sheetRowDatum.get(7)))); |
||||
|
setExt05(StringUtil.trim(String.valueOf(sheetRowDatum.get(8)))); |
||||
|
setExt06(StringUtil.trim(String.valueOf(sheetRowDatum.get(9)))); |
||||
|
setExt07(StringUtil.trim(String.valueOf(sheetRowDatum.get(10)))); |
||||
|
setExt08(StringUtil.trim(String.valueOf(sheetRowDatum.get(11)))); |
||||
|
setExt09(StringUtil.trim(String.valueOf(sheetRowDatum.get(12)))); |
||||
|
setExt10(StringUtil.trim(String.valueOf(sheetRowDatum.get(13)))); |
||||
|
}}; |
||||
|
bandConfigMapper.updateByPrimaryKeySelective(bandConfig); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("数据导入失败"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.JsadapterService; |
||||
|
import com.cmsen.ticket.domain.entity.Jsadapter; |
||||
|
import com.cmsen.ticket.domain.mapper.JsadapterMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class JsadapterServiceImpl implements JsadapterService { |
||||
|
|
||||
|
@Resource |
||||
|
private JsadapterMapper jsadapterMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
PaginationUtil.paginationInit(params); |
||||
|
|
||||
|
List<Jsadapter> list = jsadapterMapper.listByParams(params); |
||||
|
int total = jsadapterMapper.countByParams(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse create(Jsadapter jsadapter) { |
||||
|
jsadapterMapper.insert(jsadapter); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse update(Jsadapter jsadapter) { |
||||
|
jsadapterMapper.updateByPrimaryKeySelective(jsadapter); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
jsadapterMapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,146 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.io.IoUtil; |
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.alibaba.excel.support.ExcelTypeEnum; |
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.ContentEnctype; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.common.util.FileMime; |
||||
|
import com.cmsen.common.util.StringUtil; |
||||
|
import com.cmsen.ticket.application.manager.service.PreferencesService; |
||||
|
import com.cmsen.ticket.domain.entity.Preferences; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.PreferencesMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.ServletOutputStream; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.io.InputStream; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2023/6/26 16:06 |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class PreferencesServiceImpl implements PreferencesService { |
||||
|
|
||||
|
@Resource |
||||
|
private PreferencesMapper preferencesMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
//PaginationUtil.paginationInit(params);
|
||||
|
params.put("pageNum",params.get("pageNo").toString()); |
||||
|
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
||||
|
|
||||
|
List<Preferences> list = preferencesMapper.list(params); |
||||
|
int count = preferencesMapper.count(params); |
||||
|
|
||||
|
return RestResponse.success(PaginationUtil.getPageResult(count, params, list)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public RestResponse update(Preferences preferences) { |
||||
|
preferencesMapper.updateByPrimaryKeySelective(preferences); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse insert(Preferences preferences) { |
||||
|
preferencesMapper.insert(preferences); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
preferencesMapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse export(Map<String, Object> params, HttpServletResponse response) { |
||||
|
|
||||
|
response.reset(); |
||||
|
ServletOutputStream out = null; |
||||
|
try { |
||||
|
response.setContentType(FileMime.XLSX.getMimeType()); |
||||
|
response.setHeader("Content-Disposition", "attachment;filename=export.xlsx"); |
||||
|
out = response.getOutputStream(); |
||||
|
List<Preferences> list = preferencesMapper.list(params); |
||||
|
EasyExcel.write(out).excelType(ExcelTypeEnum.XLSX) |
||||
|
.sheet(0, "费用优选项") |
||||
|
.head(Preferences.class) |
||||
|
.doWrite(list); |
||||
|
out.flush(); |
||||
|
return null; |
||||
|
} catch (Exception e) { |
||||
|
//response.reset();
|
||||
|
log.error(e.getMessage(), e); |
||||
|
response.setContentType(ContentEnctype.JSON); |
||||
|
return RestResponse.failure(e.getMessage()); |
||||
|
} finally { |
||||
|
IoUtil.close(out); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
@Override |
||||
|
public RestResponse upload(MultipartFile file) { |
||||
|
try { |
||||
|
InputStream inputStream = file.getInputStream(); |
||||
|
List<Map<Integer, String>> sheetRowData = EasyExcel.read(inputStream).sheet(0).doReadSync(); |
||||
|
//先进行判断:为空
|
||||
|
for (int i = 0; i < sheetRowData.size(); i++) { |
||||
|
Map<Integer, String> sheetRowDatum = sheetRowData.get(i); |
||||
|
if(StringUtil.isEmpty(sheetRowDatum.get(0))){ |
||||
|
return RestResponse.failure("第"+(i+2)+"行的发票类型为空,请检查!"); |
||||
|
} |
||||
|
if(StringUtil.isEmpty(sheetRowDatum.get(1))){ |
||||
|
return RestResponse.failure("第"+(i+2)+"行的消费类型为空,请检查!"); |
||||
|
} |
||||
|
if(StringUtil.isEmpty(sheetRowDatum.get(2))){ |
||||
|
return RestResponse.failure("第"+(i+2)+"行的费用类型为空,请检查!"); |
||||
|
} |
||||
|
} |
||||
|
//数据处理
|
||||
|
for (int i = 0; i < sheetRowData.size(); i++) { |
||||
|
Map<Integer, String> sheetRowDatum = sheetRowData.get(i); |
||||
|
int invoiceType = Integer.parseInt(StringUtil.trim(String.valueOf(sheetRowDatum.get(0)))); //发票类型
|
||||
|
String consumptionType = StringUtil.trim(String.valueOf(sheetRowDatum.get(1))); //消费类型
|
||||
|
|
||||
|
Preferences bean = preferencesMapper.selectByTicketTypeAndConsumeType(invoiceType, consumptionType); |
||||
|
if(bean == null){//插入
|
||||
|
Preferences preferences = new Preferences(){{ |
||||
|
setInvoiceType(invoiceType); |
||||
|
setConsumptionType(consumptionType); |
||||
|
setExpenseTypes(StringUtil.trim(String.valueOf(sheetRowDatum.get(2)))); |
||||
|
}}; |
||||
|
preferencesMapper.insert(preferences); |
||||
|
}else{//更新
|
||||
|
Preferences preferences = new Preferences(){{ |
||||
|
setId(bean.getId()); |
||||
|
setExpenseTypes(StringUtil.trim(String.valueOf(sheetRowDatum.get(2)))); |
||||
|
}}; |
||||
|
preferencesMapper.updateByPrimaryKeySelective(preferences); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("数据导入失败"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,412 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.alibaba.excel.EasyExcel; |
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.common.util.StringUtil; |
||||
|
import com.cmsen.ticket.application.manager.service.ProcureOrderService; |
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoice; |
||||
|
import com.cmsen.ticket.domain.entity.Supplier; |
||||
|
import com.cmsen.ticket.domain.entity.SupplierPo; |
||||
|
import com.cmsen.ticket.domain.entity.SupplierPoLine; |
||||
|
import com.cmsen.ticket.domain.mapper.CorporateInvoiceMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.SupplierMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.SupplierPoLineMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.SupplierPoMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.cmsenframework.security.RequestSecurityPolicy; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.InputStream; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class ProcureOrderServiceImpl implements ProcureOrderService { |
||||
|
|
||||
|
@Resource |
||||
|
private SupplierPoMapper supplierPoMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SupplierPoLineMapper supplierPoLineMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SupplierMapper supplierMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private CorporateInvoiceMapper corporateInvoiceMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
|
||||
|
PaginationUtil.paginationInit(params); |
||||
|
List<SupplierPo> list = supplierPoMapper.list(params); |
||||
|
int count = supplierPoMapper.count(params); |
||||
|
|
||||
|
return RestResponse.success(PaginationUtil.getPageResult(count, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse detail(String po) { |
||||
|
SupplierPo supplierPo = supplierPoMapper.selectByPo(po); |
||||
|
|
||||
|
List<SupplierPoLine> line = supplierPoLineMapper.selectByPo(po); |
||||
|
supplierPo.setLine(line); |
||||
|
|
||||
|
return RestResponse.success(supplierPo); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(SupplierPo supplierPo) { |
||||
|
|
||||
|
supplierPo.setNetAmount("0"); |
||||
|
supplierPo.setCreateBy(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
supplierPo.setCreateDate(new Date()); |
||||
|
|
||||
|
supplierPoMapper.insertSelective(supplierPo); |
||||
|
|
||||
|
return RestResponse.success(supplierPo); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse update(SupplierPo supplierPo) { |
||||
|
supplierPo.setUpdateBy(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
supplierPo.setUpdateDate(new Date()); |
||||
|
|
||||
|
supplierPoMapper.updateByPrimaryKeySelective(supplierPo); |
||||
|
|
||||
|
return RestResponse.success(supplierPo); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse deletePo(Integer id) { |
||||
|
SupplierPo supplierPo = supplierPoMapper.selectByPrimaryKey(id); |
||||
|
|
||||
|
if(supplierPo == null){ |
||||
|
return RestResponse.failure("采购订单不存在,请确认"); |
||||
|
} |
||||
|
|
||||
|
supplierPoMapper.deleteByPo(supplierPo.getPo()); |
||||
|
|
||||
|
supplierPoLineMapper.deleteByPo(supplierPo.getPo()); |
||||
|
|
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse lineList(Map<String, Object> params) { |
||||
|
|
||||
|
PaginationUtil.paginationInit(params); |
||||
|
List<SupplierPoLine> list = supplierPoLineMapper.list(params); |
||||
|
int count = supplierPoLineMapper.count(params); |
||||
|
|
||||
|
return RestResponse.success(PaginationUtil.getPageResult(count, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse createLine(SupplierPoLine supplierPoLine) { |
||||
|
supplierPoLine.setCreateBy(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
supplierPoLine.setCreateDate(new Date()); |
||||
|
|
||||
|
supplierPoLineMapper.insertSelective(supplierPoLine); |
||||
|
|
||||
|
//更新po金额
|
||||
|
SupplierPo supplierPo = supplierPoMapper.selectByPo(supplierPoLine.getPo()); |
||||
|
supplierPo.setNetAmount(new BigDecimal(supplierPo.getNetAmount()).add(new BigDecimal(supplierPoLine.getNetLineAmount())).toString()); |
||||
|
supplierPoMapper.updateByPrimaryKeySelective(supplierPo); |
||||
|
|
||||
|
return RestResponse.success(supplierPoLine); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse updateLine(SupplierPoLine supplierPoLine) { |
||||
|
|
||||
|
//得到原来的明细行
|
||||
|
SupplierPoLine oldLine = supplierPoLineMapper.selectByPrimaryKey(supplierPoLine.getId()); |
||||
|
if(!oldLine.getNetLineAmount().equals(supplierPoLine.getNetLineAmount())){ |
||||
|
//更新po金额
|
||||
|
SupplierPo supplierPo = supplierPoMapper.selectByPo(supplierPoLine.getPo()); |
||||
|
supplierPo.setNetAmount(new BigDecimal(supplierPo.getNetAmount()).subtract(new BigDecimal(oldLine.getNetLineAmount())).add(new BigDecimal(supplierPoLine.getNetLineAmount())).toString()); |
||||
|
supplierPoMapper.updateByPrimaryKeySelective(supplierPo); |
||||
|
} |
||||
|
|
||||
|
supplierPoLine.setUpdateBy(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
supplierPoLine.setUpdateDate(new Date()); |
||||
|
|
||||
|
supplierPoLineMapper.updateByPrimaryKeySelective(supplierPoLine); |
||||
|
|
||||
|
return RestResponse.success(supplierPoLine); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse deleteLine(String ids, String po) { |
||||
|
if(StringUtil.isBlank(ids)){ |
||||
|
return RestResponse.failure("请选择要删除的明细行"); |
||||
|
} |
||||
|
|
||||
|
String[] idArr = ids.split(","); |
||||
|
for (String id : idArr) { |
||||
|
|
||||
|
SupplierPoLine supplierPoLine = supplierPoLineMapper.selectByPrimaryKey(Integer.parseInt(id)); |
||||
|
|
||||
|
//更新po金额
|
||||
|
SupplierPo supplierPo = supplierPoMapper.selectByPo(po); |
||||
|
supplierPo.setNetAmount(new BigDecimal(supplierPo.getNetAmount()).subtract(new BigDecimal(supplierPoLine.getNetLineAmount())).toString()); |
||||
|
supplierPoMapper.updateByPrimaryKeySelective(supplierPo); |
||||
|
|
||||
|
//删除行记录
|
||||
|
supplierPoLineMapper.deleteById(Integer.parseInt(id)); |
||||
|
} |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
@Override |
||||
|
public RestResponse uploadPo(MultipartFile file) { |
||||
|
try { |
||||
|
InputStream inputStream = file.getInputStream(); |
||||
|
|
||||
|
//PO数据
|
||||
|
List<Map<Integer, String>> sheetRowData1 = EasyExcel.read(inputStream).sheet(0).doReadSync(); |
||||
|
//数据必填判断
|
||||
|
for (int i = 0; i < sheetRowData1.size(); i++) { |
||||
|
Map<Integer, String> sheetRowDatum = sheetRowData1.get(i); |
||||
|
String po = StringUtil.trim(String.valueOf(sheetRowDatum.get(0))); |
||||
|
String companyCode = StringUtil.trim(String.valueOf(sheetRowDatum.get(4))); |
||||
|
String supplierCode = StringUtil.trim(String.valueOf(sheetRowDatum.get(5))); |
||||
|
String supplierName = StringUtil.trim(String.valueOf(sheetRowDatum.get(6))); |
||||
|
//String netAmount = StringUtil.trim(String.valueOf(sheetRowDatum.get(7)));
|
||||
|
String currency = StringUtil.trim(String.valueOf(sheetRowDatum.get(8))); |
||||
|
String costCenter = StringUtil.trim(String.valueOf(sheetRowDatum.get(9))); |
||||
|
String requestersName = StringUtil.trim(String.valueOf(sheetRowDatum.get(10))); |
||||
|
|
||||
|
if(StringUtil.isBlank(po) || StringUtil.isBlank(companyCode) || StringUtil.isBlank(supplierCode) |
||||
|
|| StringUtil.isBlank(supplierName) || StringUtil.isBlank(currency) |
||||
|
|| StringUtil.isBlank(costCenter)|| StringUtil.isBlank(requestersName)){ |
||||
|
return RestResponse.failure("po导入中存在必填项为空,请检查!"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//数据po处理
|
||||
|
for (int i = 0; i < sheetRowData1.size(); i++) { |
||||
|
|
||||
|
Map<Integer, String> sheetRowDatum = sheetRowData1.get(i); |
||||
|
String po = StringUtil.trim(String.valueOf(sheetRowDatum.get(0))); |
||||
|
String versionNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(1) == null ? "" : sheetRowDatum.get(1))); |
||||
|
// 2024 0709 orderDate作为 税额 去除千分号
|
||||
|
String orderDate = StringUtil.trim(String.valueOf(sheetRowDatum.get(2) == null ? "" : sheetRowDatum.get(2))).replace(",",""); |
||||
|
String contractNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(3) == null ? "" : sheetRowDatum.get(3))); |
||||
|
String companyCode = StringUtil.trim(String.valueOf(sheetRowDatum.get(4))); |
||||
|
String supplierCode = StringUtil.trim(String.valueOf(sheetRowDatum.get(5))); |
||||
|
String supplierName = StringUtil.trim(String.valueOf(sheetRowDatum.get(6))); |
||||
|
String netamount = StringUtil.trim(String.valueOf(sheetRowDatum.get(7))).replace(",",""); |
||||
|
String currency = StringUtil.trim(String.valueOf(sheetRowDatum.get(8))); |
||||
|
String costCenter = StringUtil.trim(String.valueOf(sheetRowDatum.get(9))); |
||||
|
String requestersName = StringUtil.trim(String.valueOf(sheetRowDatum.get(10))); |
||||
|
String poType = StringUtil.trim(String.valueOf(sheetRowDatum.get(11) == null ? "" : sheetRowDatum.get(11))); |
||||
|
String contacts = StringUtil.trim(String.valueOf(sheetRowDatum.get(12) == null ? "" : sheetRowDatum.get(12))); |
||||
|
String mailAddress = StringUtil.trim(String.valueOf(sheetRowDatum.get(13) == null ? "" : sheetRowDatum.get(13))); |
||||
|
|
||||
|
if(StringUtils.isNotEmpty(supplierCode)){ |
||||
|
Supplier supplier = supplierMapper.selectCodeByNameAndCode2(null,supplierCode); |
||||
|
if(null==supplier){ |
||||
|
supplier = new Supplier(); |
||||
|
supplier.setCode(supplierCode); |
||||
|
supplier.setName(supplierName); |
||||
|
supplier.setTaxNo(supplierName); |
||||
|
supplier.setStatus(1); |
||||
|
supplierMapper.insert(supplier); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 2024-05-13 目前用versionNo 表示 发票号码 更新 发票中的PO
|
||||
|
if(StringUtils.isNotEmpty(versionNo)){ |
||||
|
List<CorporateInvoice> invoices = corporateInvoiceMapper.selectByInvoiceNumber(versionNo); |
||||
|
for (CorporateInvoice invoice : invoices) { |
||||
|
Integer status = invoice.getStatus(); |
||||
|
if(1!=status){ |
||||
|
// 不在已完成中
|
||||
|
invoice.setPo(po); |
||||
|
invoice.setUpdateDate(new Date()); |
||||
|
corporateInvoiceMapper.updateByPrimaryKeySelective(invoice); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
if(po.startsWith("virtual")){ |
||||
|
SupplierPo bean = new SupplierPo(); |
||||
|
bean.setPo(po); |
||||
|
bean.setVersionNo(versionNo); |
||||
|
bean.setOrderDate(orderDate); |
||||
|
bean.setContractNo(contractNo); |
||||
|
bean.setCompanyCode(companyCode); |
||||
|
bean.setSupplierCode(supplierCode); |
||||
|
bean.setSupplierName(supplierName); |
||||
|
bean.setCurrency(currency); |
||||
|
bean.setCostCenter(costCenter); |
||||
|
bean.setRequestersName(requestersName); |
||||
|
bean.setPoType(poType); |
||||
|
bean.setContacts(contacts); |
||||
|
bean.setMailAddress(mailAddress); |
||||
|
bean.setNetAmount(netamount); |
||||
|
bean.setCreateBy(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
bean.setCreateDate(new Date()); |
||||
|
supplierPoMapper.insertSelective(bean); |
||||
|
}else{ |
||||
|
SupplierPo supplierPo = supplierPoMapper.selectByNumber(versionNo); |
||||
|
if(supplierPo != null){ |
||||
|
supplierPo.setPo(po); |
||||
|
supplierPo.setOrderDate(orderDate); |
||||
|
supplierPo.setContractNo(contractNo); |
||||
|
supplierPo.setCompanyCode(companyCode); |
||||
|
supplierPo.setSupplierCode(supplierCode); |
||||
|
supplierPo.setSupplierName(supplierName); |
||||
|
supplierPo.setCurrency(currency); |
||||
|
supplierPo.setCostCenter(costCenter); |
||||
|
supplierPo.setRequestersName(requestersName); |
||||
|
supplierPo.setPoType(poType); |
||||
|
supplierPo.setContacts(contacts); |
||||
|
supplierPo.setMailAddress(mailAddress); |
||||
|
supplierPo.setNetAmount(netamount); |
||||
|
supplierPo.setUpdateBy(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
supplierPo.setUpdateDate(new Date()); |
||||
|
supplierPo.setExt01(versionNo); |
||||
|
supplierPoMapper.updateByPrimaryKeySelective(supplierPo); |
||||
|
}else{ |
||||
|
SupplierPo bean = new SupplierPo(); |
||||
|
bean.setPo(po); |
||||
|
bean.setVersionNo(versionNo); |
||||
|
bean.setOrderDate(orderDate); |
||||
|
bean.setContractNo(contractNo); |
||||
|
bean.setCompanyCode(companyCode); |
||||
|
bean.setSupplierCode(supplierCode); |
||||
|
bean.setSupplierName(supplierName); |
||||
|
bean.setCurrency(currency); |
||||
|
bean.setCostCenter(costCenter); |
||||
|
bean.setRequestersName(requestersName); |
||||
|
bean.setPoType(poType); |
||||
|
bean.setContacts(contacts); |
||||
|
bean.setMailAddress(mailAddress); |
||||
|
bean.setNetAmount(netamount); |
||||
|
bean.setCreateBy(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
bean.setCreateDate(new Date()); |
||||
|
supplierPoMapper.insertSelective(bean); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
//PO-line数据
|
||||
|
// InputStream inputStream2 = file.getInputStream();
|
||||
|
// List<Map<Integer, String>> sheetRowData2 = EasyExcel.read(inputStream2).sheet(1).doReadSync();
|
||||
|
// //数据必填判断
|
||||
|
// for (int i = 0; i < sheetRowData2.size(); i++) {
|
||||
|
// Map<Integer, String> sheetRowDatum = sheetRowData2.get(i);
|
||||
|
// String po = StringUtil.trim(String.valueOf(sheetRowDatum.get(0) == null ? "" :sheetRowDatum.get(0)));
|
||||
|
// String lineNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(1)== null ? "" :sheetRowDatum.get(1)));
|
||||
|
// String materialNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(2)== null ? "" :sheetRowDatum.get(2)));
|
||||
|
// String materialDesc = StringUtil.trim(String.valueOf(sheetRowDatum.get(3)== null ? "" :sheetRowDatum.get(3)));
|
||||
|
// String quantity = StringUtil.trim(String.valueOf(sheetRowDatum.get(4)== null ? "" :sheetRowDatum.get(4)));
|
||||
|
// String unit = StringUtil.trim(String.valueOf(sheetRowDatum.get(5)== null ? "" :sheetRowDatum.get(5)));
|
||||
|
// String unitPrice = StringUtil.trim(String.valueOf(sheetRowDatum.get(6)== null ? "" :sheetRowDatum.get(6))).replace(",","");
|
||||
|
// String tax = StringUtil.trim(String.valueOf(sheetRowDatum.get(7)== null ? "" :sheetRowDatum.get(7)));
|
||||
|
// String discount = StringUtil.trim(String.valueOf(sheetRowDatum.get(8)== null ? "" :sheetRowDatum.get(8)));
|
||||
|
// String netLineAmount = StringUtil.trim(String.valueOf(sheetRowDatum.get(9)== null ? "" :sheetRowDatum.get(9))).replace(",","");
|
||||
|
//
|
||||
|
// if(StringUtil.isBlank(po) || StringUtil.isBlank(lineNo) || StringUtil.isBlank(materialNo)
|
||||
|
// || StringUtil.isBlank(materialDesc) || StringUtil.isBlank(quantity)
|
||||
|
// || StringUtil.isBlank(unit)|| StringUtil.isBlank(unitPrice)
|
||||
|
// // 2024-02-22 不需要必填
|
||||
|
//// || StringUtil.isBlank(tax)
|
||||
|
//// || StringUtil.isBlank(discount)
|
||||
|
// || StringUtil.isBlank(netLineAmount)){
|
||||
|
// return RestResponse.failure("po-line导入中存在必填项为空,请检查!");
|
||||
|
// }
|
||||
|
//
|
||||
|
// //判断po号是否存在
|
||||
|
// SupplierPo supplierPo = supplierPoMapper.selectByPo(po);
|
||||
|
// if(supplierPo == null){
|
||||
|
// return RestResponse.failure("po-line中的PO号("+po+")不存在,请检查!");
|
||||
|
// }
|
||||
|
// }
|
||||
|
//
|
||||
|
// //数据po-line处理
|
||||
|
// String uuid = StringUtil.UUID();
|
||||
|
// for (int i = 0; i < sheetRowData2.size(); i++) {
|
||||
|
// Map<Integer, String> sheetRowDatum = sheetRowData2.get(i);
|
||||
|
// String po = StringUtil.trim(String.valueOf(sheetRowDatum.get(0)));
|
||||
|
// SupplierPo supplierPo = supplierPoMapper.selectByPo(po);
|
||||
|
// if(supplierPo == null){
|
||||
|
// return RestResponse.failure("po-line中的PO号("+po+")不存在,请检查!");
|
||||
|
// }
|
||||
|
//
|
||||
|
// String lineNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(1)== null ? "" :sheetRowDatum.get(1)));
|
||||
|
// String materialNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(2)== null ? "" :sheetRowDatum.get(2)));
|
||||
|
// String materialDesc = StringUtil.trim(String.valueOf(sheetRowDatum.get(3)== null ? "" :sheetRowDatum.get(3)));
|
||||
|
// String quantity = StringUtil.trim(String.valueOf(sheetRowDatum.get(4)== null ? "" :sheetRowDatum.get(4))).replace(",","");
|
||||
|
// String unit = StringUtil.trim(String.valueOf(sheetRowDatum.get(5)== null ? "" :sheetRowDatum.get(5)));
|
||||
|
// String unitPrice = StringUtil.trim(String.valueOf(sheetRowDatum.get(6)== null ? "" :sheetRowDatum.get(6))).replace(",","");
|
||||
|
// String tax = StringUtil.trim(String.valueOf(sheetRowDatum.get(7)== null ? "" :sheetRowDatum.get(7))).replace(",","");
|
||||
|
// String discount = StringUtil.trim(String.valueOf(sheetRowDatum.get(8)== null ? "" :sheetRowDatum.get(8))).replace(",","");
|
||||
|
// String netLineAmount = StringUtil.trim(String.valueOf(sheetRowDatum.get(9)).replace(",","")).replace(",","");
|
||||
|
// String payDate = StringUtil.trim(String.valueOf(sheetRowDatum.get(10) == null ? "" : sheetRowDatum.get(10)));
|
||||
|
//
|
||||
|
// SupplierPoLine line = supplierPoLineMapper.selectByPoAndLineNo(po, lineNo);
|
||||
|
// if(line != null){
|
||||
|
// line.setMaterialNo(materialNo);
|
||||
|
// line.setMaterialDesc(materialDesc);
|
||||
|
// line.setQuantity(quantity);
|
||||
|
// line.setUnit(unit);
|
||||
|
// line.setUnitPrice(unitPrice);
|
||||
|
// line.setTax(tax);
|
||||
|
// line.setDiscount(discount);
|
||||
|
// line.setNetLineAmount(netLineAmount);
|
||||
|
// line.setPayDate(payDate);
|
||||
|
// line.setExt01(uuid);//记录本次导入
|
||||
|
// line.setUpdateBy(String.valueOf(RequestSecurityPolicy.getUserId()));
|
||||
|
// line.setUpdateDate(new Date());
|
||||
|
// supplierPoLineMapper.updateByPrimaryKeySelective(line);
|
||||
|
// }else{
|
||||
|
// SupplierPoLine bean = new SupplierPoLine();
|
||||
|
// bean.setPo(po);
|
||||
|
// bean.setLineNo(lineNo);
|
||||
|
// bean.setMaterialNo(materialNo);
|
||||
|
// bean.setMaterialDesc(materialDesc);
|
||||
|
// bean.setQuantity(quantity);
|
||||
|
// bean.setUnit(unit);
|
||||
|
// bean.setUnitPrice(unitPrice);
|
||||
|
// bean.setTax(tax);
|
||||
|
// bean.setDiscount(discount);
|
||||
|
// bean.setNetLineAmount(netLineAmount);
|
||||
|
// bean.setPayDate(payDate);
|
||||
|
// bean.setExt01(uuid);//记录本次导入
|
||||
|
// bean.setCreateBy(String.valueOf(RequestSecurityPolicy.getUserId()));
|
||||
|
// bean.setCreateDate(new Date());
|
||||
|
// supplierPoLineMapper.insertSelective(bean);
|
||||
|
// }
|
||||
|
// }
|
||||
|
|
||||
|
//更新po的金额
|
||||
|
// supplierPoMapper.updateAmount(uuid);
|
||||
|
|
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("po导入失败"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.RuleService; |
||||
|
import com.cmsen.ticket.domain.entity.Rule; |
||||
|
import com.cmsen.ticket.domain.mapper.RuleMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author |
||||
|
* @version 1.0.0 |
||||
|
* @date 2024/2/18 16:23 |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class RuleServiceImpl implements RuleService { |
||||
|
@Resource |
||||
|
private RuleMapper ruleMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
||||
|
List<Rule> list = ruleMapper.listByParams(params); |
||||
|
int total = ruleMapper.countByParams(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(Rule rule) { |
||||
|
try { |
||||
|
int count = ruleMapper.checkRule(rule.getName(), rule.getType(), null); |
||||
|
if (count > 0) { |
||||
|
return RestResponse.failure("该类型的规则名称已存在。"); |
||||
|
} |
||||
|
rule.setClientId(1); |
||||
|
ruleMapper.insertSelective(rule); |
||||
|
return RestResponse.success(rule); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse update(Rule rule) { |
||||
|
try { |
||||
|
int count = ruleMapper.checkRule(rule.getName(), rule.getType(), rule.getId()); |
||||
|
if (count > 0) { |
||||
|
return RestResponse.failure("该类型的规则名称已存在。"); |
||||
|
} |
||||
|
|
||||
|
ruleMapper.updateByPrimaryKeySelective(rule); |
||||
|
return RestResponse.success(rule); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
try { |
||||
|
ruleMapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.SearchValueService; |
||||
|
import com.cmsen.ticket.domain.mapper.CustomerMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.RuleMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.TicketTypeMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysOrgMapper; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
@Service |
||||
|
public class SearchValueServiceImpl implements SearchValueService { |
||||
|
@Resource |
||||
|
private CustomerMapper customerMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SysOrgMapper sysOrgMapper; |
||||
|
@Resource |
||||
|
private RuleMapper ruleMapper; |
||||
|
@Resource |
||||
|
private TicketTypeMapper ticketTypeMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse clients() { |
||||
|
return RestResponse.success(customerMapper.queryAll(null)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse rules(Integer type) { |
||||
|
return RestResponse.success(ruleMapper.list(type)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse ticketTypes() { |
||||
|
return RestResponse.success(ticketTypeMapper.list()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse orgs() { |
||||
|
return RestResponse.success(sysOrgMapper.list(null)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,143 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.io.IoUtil; |
||||
|
import cn.hutool.poi.excel.ExcelUtil; |
||||
|
import cn.hutool.poi.excel.ExcelWriter; |
||||
|
import com.cmsen.common.util.StringUtil; |
||||
|
import com.cmsen.ticket.application.manager.service.SqlDownloadService; |
||||
|
import com.cmsen.ticket.domain.dto.SqlDownloadDto; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysUserMapper; |
||||
|
import com.cmsen.ticket.domain.response.Response; |
||||
|
import org.springframework.jdbc.core.JdbcTemplate; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.ServletOutputStream; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SqlDownloadServiceImpl implements SqlDownloadService { |
||||
|
|
||||
|
@Resource |
||||
|
private JdbcTemplate jdbcTemplate; |
||||
|
@Resource |
||||
|
private SysUserMapper sysUserMapper; |
||||
|
|
||||
|
@Override |
||||
|
public Response<Map<String, Object>> getListData(SqlDownloadDto downloadDto) { |
||||
|
try { |
||||
|
if (StringUtil.isNotBlank(downloadDto.getStatement()) && downloadDto.getStatement().toLowerCase().startsWith("select")) { |
||||
|
|
||||
|
//先查询总数
|
||||
|
String interfaceListSql = downloadDto.getStatement(); |
||||
|
List<Map<String, Object>> resTotal = sysUserMapper.execSelectSql(interfaceListSql); |
||||
|
if (resTotal.isEmpty()) { |
||||
|
return Response.failure("查询记录为空"); |
||||
|
}else{//查询每个分页数据
|
||||
|
int s = (Integer.parseInt(downloadDto.getPageNo()) - 1) * Integer.parseInt(downloadDto.getPageSize()); |
||||
|
int e = Integer.parseInt(downloadDto.getPageSize()); |
||||
|
interfaceListSql = downloadDto.getStatement() + " limit "+ s +"," + e; |
||||
|
List<Map<String, Object>> res = sysUserMapper.execSelectSql(interfaceListSql); |
||||
|
Map<String, Object> dataMap = new HashMap<>(); |
||||
|
dataMap.put("total",resTotal.size()); |
||||
|
dataMap.put("data",res); |
||||
|
return Response.success(dataMap); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/*List<Map<String, Object>> res = jdbcTemplate.queryForList(downloadDto.getStatement()); |
||||
|
if (res.isEmpty()) { |
||||
|
return Response.failure("查询记录为空"); |
||||
|
}*/ |
||||
|
|
||||
|
} |
||||
|
return Response.failure("请输入正确的sql语句"); |
||||
|
} catch (Exception e) { |
||||
|
return Response.failure(e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Response<List<Map<String, Object>>> getListData2(SqlDownloadDto downloadDto) { |
||||
|
try { |
||||
|
if (StringUtil.isNotBlank(downloadDto.getStatement()) && downloadDto.getStatement().toLowerCase().startsWith("select")) { |
||||
|
|
||||
|
List<Map<String, Object>> res = jdbcTemplate.queryForList(downloadDto.getStatement()); |
||||
|
if (res.isEmpty()) { |
||||
|
return Response.failure("查询记录为空"); |
||||
|
} |
||||
|
return Response.success(res); |
||||
|
} |
||||
|
return Response.failure("请输入正确的sql语句"); |
||||
|
} catch (Exception e) { |
||||
|
return Response.failure(e.getMessage()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/*@Override |
||||
|
public Response<Object> exportListData(SqlDownloadDto downloadDto, HttpServletResponse response) { |
||||
|
if (StringUtil.isBlank(downloadDto.getStatement()) || !downloadDto.getStatement().toLowerCase().startsWith("select")) { |
||||
|
return Response.failure("请输入正确的sql语句"); |
||||
|
} |
||||
|
ServletOutputStream out = null; |
||||
|
ExcelWriter writer = null; |
||||
|
try { |
||||
|
out = response.getOutputStream(); |
||||
|
List<Map<String, Object>> rows = jdbcTemplate.queryForList(downloadDto.getStatement()); |
||||
|
if (rows.isEmpty()) { |
||||
|
return Response.failure("查询记录为空"); |
||||
|
} |
||||
|
if (rows.size() > 5000) { |
||||
|
return Response.failure("导出记录不可大于5000条"); |
||||
|
} |
||||
|
writer = ExcelUtil.getWriter(true); |
||||
|
writer.write(rows, true); |
||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); |
||||
|
response.setHeader("Content-Disposition", "attachment;filename=SQL_EXPORT_DATA.xlsx"); |
||||
|
writer.flush(out, true); |
||||
|
} catch (Exception e) { |
||||
|
return null; |
||||
|
} finally { |
||||
|
IoUtil.close(writer); |
||||
|
IoUtil.close(out); |
||||
|
} |
||||
|
return null; |
||||
|
}*/ |
||||
|
|
||||
|
@Override |
||||
|
public Response<Object> exportListData(Map<String, Object> params, HttpServletResponse response) { |
||||
|
if (StringUtil.isBlank(params.get("statement").toString()) || !params.get("statement").toString().toLowerCase().startsWith("select")) { |
||||
|
return Response.failure("请输入正确的sql语句"); |
||||
|
} |
||||
|
ServletOutputStream out = null; |
||||
|
ExcelWriter writer = null; |
||||
|
try { |
||||
|
out = response.getOutputStream(); |
||||
|
List<Map<String, Object>> rows = jdbcTemplate.queryForList(params.get("statement").toString()); |
||||
|
if (rows.isEmpty()) { |
||||
|
return Response.failure("查询记录为空"); |
||||
|
} |
||||
|
if (rows.size() > 5000) { |
||||
|
return Response.failure("导出记录不可大于5000条"); |
||||
|
} |
||||
|
writer = ExcelUtil.getWriter(true); |
||||
|
writer.write(rows, true); |
||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); |
||||
|
response.setHeader("Content-Disposition", "attachment;filename=SQL_EXPORT_DATA.xlsx"); |
||||
|
writer.flush(out, true); |
||||
|
} catch (Exception e) { |
||||
|
return null; |
||||
|
} finally { |
||||
|
IoUtil.close(writer); |
||||
|
IoUtil.close(out); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,53 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.ticket.application.service.SupplierStateService; |
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoice; |
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoiceItems; |
||||
|
import com.cmsen.ticket.domain.entity.SupplierState; |
||||
|
import com.cmsen.ticket.domain.mapper.SupplierStateMapper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SupplierStateServiceImpl implements SupplierStateService { |
||||
|
|
||||
|
|
||||
|
@Resource |
||||
|
private SupplierStateMapper supplierStateMapper; |
||||
|
|
||||
|
@Override |
||||
|
public void insertCorporateInvoicePO(CorporateInvoice corporateInvoice,CorporateInvoiceItems corporateInvoiceItem, String po) { |
||||
|
|
||||
|
|
||||
|
List<SupplierState> list = supplierStateMapper.listByPo(po); |
||||
|
if(list.isEmpty()){ |
||||
|
|
||||
|
}else{ |
||||
|
supplierStateMapper.updateIsDel("1",po); |
||||
|
} |
||||
|
|
||||
|
SupplierState supplierState = new SupplierState(); |
||||
|
supplierState.setAmount(corporateInvoiceItem.getTotal()); |
||||
|
supplierState.setCode(corporateInvoice.getCode()); |
||||
|
supplierState.setCreateBy(String.valueOf(corporateInvoice.getOwner())); |
||||
|
supplierState.setDesc(corporateInvoiceItem.getName()); |
||||
|
supplierState.setCreateDate(new Date()); |
||||
|
supplierState.setUpdateDate(corporateInvoice.getUpdateDate()); |
||||
|
supplierState.setUpdateBy(String.valueOf(corporateInvoice.getOwner())); |
||||
|
// supplierState.setItemNo();
|
||||
|
// supplierState.setLineNo();
|
||||
|
supplierState.setNumber(corporateInvoice.getNumber()); |
||||
|
supplierState.setPo(po); |
||||
|
supplierState.setQuantity(corporateInvoiceItem.getQuantity()); |
||||
|
supplierState.setStatus(String.valueOf(corporateInvoice.getStatus())); |
||||
|
supplierState.setUnitPrice(corporateInvoiceItem.getPrice()); |
||||
|
supplierState.setUom(corporateInvoiceItem.getUnit()); |
||||
|
supplierState.setIsDel("0"); |
||||
|
supplierStateMapper.insert(supplierState); |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,109 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.common.util.FileUtil; |
||||
|
import com.cmsen.ticket.application.manager.service.SysLogoService; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysLogo; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysLogoMapper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.InputStream; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2022/8/24 16:06 |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SysLogoServiceImpl implements SysLogoService { |
||||
|
|
||||
|
@Value("${manager-file.uploadPath}") |
||||
|
private String uploadPath; |
||||
|
|
||||
|
@Resource |
||||
|
private SysLogoMapper sysLogoMapper; |
||||
|
@Resource |
||||
|
private SysConfigMapper sysConfigMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse select() { |
||||
|
SysLogo sysLogo = sysLogoMapper.getRecord(); |
||||
|
SysConfig sysConfig = sysConfigMapper.selectByCode("SSO_URL"); |
||||
|
Map<String,String> sso = new HashMap<>(); |
||||
|
if(sysConfig != null){ |
||||
|
sysLogo.setSsoUrl(sysConfig.getValue()); |
||||
|
} |
||||
|
return RestResponse.success(sysLogo); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(SysLogo sysLogo) { |
||||
|
try { |
||||
|
sysLogoMapper.insertSelective(sysLogo); |
||||
|
return RestResponse.success(sysLogo); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse update(MultipartFile file, String typeStr, String str, Long id) { |
||||
|
log.info("typeStr===={}",typeStr); |
||||
|
try{ |
||||
|
if(file != null){ |
||||
|
String originalFilename = file.getOriginalFilename(); |
||||
|
assert originalFilename != null; |
||||
|
String suffix = originalFilename.substring(originalFilename.lastIndexOf(".")); |
||||
|
if (!(".png".equalsIgnoreCase(suffix))) { |
||||
|
return RestResponse.failure("错误的图片类型,请上传PNG图片。"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if(typeStr.equals("pc")){//pc logo
|
||||
|
String uploadFilePath = uploadPath + "logoPc.png"; |
||||
|
InputStream inputStream = file.getInputStream(); |
||||
|
FileUtil.saveFile(inputStream, uploadFilePath); |
||||
|
}else if(typeStr.equals("base")){//app 底图
|
||||
|
String uploadFilePath = uploadPath + "banner.png"; |
||||
|
InputStream inputStream = file.getInputStream(); |
||||
|
FileUtil.saveFile(inputStream, uploadFilePath); |
||||
|
}else if(typeStr.equals("app")){//app logo
|
||||
|
String uploadFilePath = uploadPath + "logo.png"; |
||||
|
InputStream inputStream = file.getInputStream(); |
||||
|
FileUtil.saveFile(inputStream, uploadFilePath); |
||||
|
}else if(typeStr.equals("sysName")){ |
||||
|
SysLogo sysLogo = new SysLogo(){{ |
||||
|
setSysName(str); |
||||
|
setId(id); |
||||
|
}}; |
||||
|
sysLogoMapper.updateByPrimaryKeySelective(sysLogo); |
||||
|
}else if(typeStr.equals("ext01")){ |
||||
|
SysLogo sysLogo = new SysLogo(){{ |
||||
|
setExt01(str); |
||||
|
setId(id); |
||||
|
}}; |
||||
|
sysLogoMapper.updateByPrimaryKeySelective(sysLogo); |
||||
|
} |
||||
|
return RestResponse.success(); |
||||
|
|
||||
|
}catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统异常"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,77 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.SysPolicyService; |
||||
|
import com.cmsen.ticket.domain.entity.ExpenseUse; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysUser; |
||||
|
import com.cmsen.ticket.domain.mapper.ExpenseUseMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2021/2/22 10:14 |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SysPolicyServiceImpl implements SysPolicyService { |
||||
|
@Resource |
||||
|
private ExpenseUseMapper mapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
PaginationUtil.paginationInit(params); |
||||
|
List<SysUser> list = mapper.list(params); |
||||
|
int total = mapper.count(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectByPrimaryKey(Integer id) { |
||||
|
return RestResponse.success(mapper.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(ExpenseUse expenseUse) { |
||||
|
try { |
||||
|
mapper.insert(expenseUse); |
||||
|
return RestResponse.success(expenseUse); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse update(ExpenseUse expenseUse) { |
||||
|
try { |
||||
|
mapper.update(expenseUse); |
||||
|
return RestResponse.success(expenseUse); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
try { |
||||
|
mapper.deleteById(id); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,142 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.SysProxySetService; |
||||
|
import com.cmsen.ticket.domain.entity.ProxySysUser; |
||||
|
import com.cmsen.ticket.domain.entity.ProxyUser; |
||||
|
import com.cmsen.ticket.domain.entity.User; |
||||
|
import com.cmsen.ticket.domain.mapper.ProxySysUserMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.ProxyUserMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.UserMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysUserMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.cmsenframework.security.RequestSecurityPolicy; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SysProxySetServiceImpl implements SysProxySetService { |
||||
|
@Resource |
||||
|
private ProxySysUserMapper mapper; |
||||
|
@Resource |
||||
|
private ProxyUserMapper proxyUserMapper; |
||||
|
@Resource |
||||
|
private UserMapper userMapper; |
||||
|
@Resource |
||||
|
private SysUserMapper sysUserMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
//PaginationUtil.paginationInit(params);
|
||||
|
params.put("pageNum", params.get("pageNo").toString()); |
||||
|
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()), Integer.parseInt(params.get("pageSize").toString())); |
||||
|
|
||||
|
if(!params.get("roleType").equals("admin")){ |
||||
|
params.put("proxyId",RequestSecurityPolicy.getUserId()); |
||||
|
} |
||||
|
List<ProxySysUser> list = mapper.list(params); |
||||
|
int total = mapper.count(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(ProxySysUser proxySysUser) { |
||||
|
try { |
||||
|
int count = mapper.checkExist(proxySysUser); |
||||
|
if (count > 0) { |
||||
|
return RestResponse.failure("该代理已存在。"); |
||||
|
} |
||||
|
proxySysUser.setProxyEmail(sysUserMapper.selectByPrimaryKey(proxySysUser.getProxyId()).getEmail()); |
||||
|
proxySysUser.setMainEmail(sysUserMapper.selectByPrimaryKey(proxySysUser.getMainId()).getEmail()); |
||||
|
|
||||
|
//根据email判断是否存在user
|
||||
|
User pUser = userMapper.selectByEmail(proxySysUser.getProxyEmail()); |
||||
|
User mUser = userMapper.selectByEmail(proxySysUser.getMainEmail()); |
||||
|
if (pUser != null && mUser != null) { |
||||
|
ProxyUser proxyUser = new ProxyUser() {{ |
||||
|
setProxyId(pUser.getUserId()); |
||||
|
setMainId(mUser.getUserId()); |
||||
|
}}; |
||||
|
proxyUserMapper.insert(proxyUser); |
||||
|
proxySysUser.setPuId(proxyUser.getId()); |
||||
|
} |
||||
|
|
||||
|
mapper.insert(proxySysUser); |
||||
|
return RestResponse.success(proxySysUser); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
try { |
||||
|
ProxySysUser proxySysUser = mapper.selectByPrimaryKey(id); |
||||
|
if (proxySysUser != null && proxySysUser.getPuId() != null) { |
||||
|
proxyUserMapper.deleteByPrimaryKey(proxySysUser.getPuId()); |
||||
|
} |
||||
|
|
||||
|
mapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse update(ProxySysUser proxySysUser) { |
||||
|
try { |
||||
|
int count = mapper.checkExist(proxySysUser); |
||||
|
if (count > 0) { |
||||
|
return RestResponse.failure("该代理已存在。"); |
||||
|
} |
||||
|
proxySysUser.setProxyEmail(sysUserMapper.selectByPrimaryKey(proxySysUser.getProxyId()).getEmail()); |
||||
|
proxySysUser.setMainEmail(sysUserMapper.selectByPrimaryKey(proxySysUser.getMainId()).getEmail()); |
||||
|
//先删除原来的代理
|
||||
|
ProxySysUser oldBean = mapper.selectByPrimaryKey(proxySysUser.getId()); |
||||
|
if (oldBean != null && oldBean.getPuId() != null) { |
||||
|
proxyUserMapper.deleteByPrimaryKey(oldBean.getPuId()); |
||||
|
} |
||||
|
//根据email判断是否存在user--插入代理
|
||||
|
User pUser = userMapper.selectByEmail(proxySysUser.getProxyEmail()); |
||||
|
User mUser = userMapper.selectByEmail(proxySysUser.getMainEmail()); |
||||
|
if (pUser != null && mUser != null) { |
||||
|
ProxyUser proxyUser = new ProxyUser() {{ |
||||
|
setProxyId(pUser.getUserId()); |
||||
|
setMainId(mUser.getUserId()); |
||||
|
}}; |
||||
|
proxyUserMapper.insert(proxyUser); |
||||
|
proxySysUser.setPuId(proxyUser.getId()); |
||||
|
} |
||||
|
mapper.updateByPrimaryKeySelective(proxySysUser); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectUserList(String keyword) { |
||||
|
return RestResponse.success(sysUserMapper.selectSearchList(keyword)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse getRepresentedList() { |
||||
|
Integer mainId = Integer.valueOf(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
return RestResponse.success(mapper.getRepresentedList(mainId)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.SysProxyUserService; |
||||
|
import com.cmsen.ticket.domain.entity.ProxyUser; |
||||
|
import com.cmsen.ticket.domain.mapper.ProxyUserMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.UserMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SysProxyUserServiceImpl implements SysProxyUserService { |
||||
|
@Resource |
||||
|
private ProxyUserMapper mapper; |
||||
|
|
||||
|
@Resource |
||||
|
private UserMapper userMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
//PaginationUtil.paginationInit(params);
|
||||
|
params.put("pageNum",params.get("pageNo").toString()); |
||||
|
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
||||
|
List<ProxyUser> list = mapper.list(params); |
||||
|
int total = mapper.count(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(ProxyUser proxyUser) { |
||||
|
try { |
||||
|
int count = mapper.checkExist(proxyUser); |
||||
|
if (count > 0) { |
||||
|
return RestResponse.failure("该代理已存在。"); |
||||
|
} |
||||
|
mapper.insert(proxyUser); |
||||
|
return RestResponse.success(proxyUser); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
try { |
||||
|
mapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse update(ProxyUser proxyUser) { |
||||
|
try { |
||||
|
mapper.updateByPrimaryKeySelective(proxyUser); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectUserList(String name) { |
||||
|
return RestResponse.success(userMapper.selectSearchList(name)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,97 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.SysRulesService; |
||||
|
import com.cmsen.ticket.domain.entity.RuleConfig; |
||||
|
import com.cmsen.ticket.domain.entity.RuleType; |
||||
|
import com.cmsen.ticket.domain.mapper.RuleConfigMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.RuleTypeMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2021/2/22 14:23 |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SysRulesServiceImpl implements SysRulesService { |
||||
|
@Resource |
||||
|
private RuleConfigMapper mapper; |
||||
|
|
||||
|
@Resource |
||||
|
private RuleTypeMapper ruleTypeMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
/*PageHelper.clearPage();*/ |
||||
|
/*StringUtils.decoderUrl(params); |
||||
|
PaginationUtil.paginationInit(params);*/ |
||||
|
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
||||
|
List<RuleConfig> list = mapper.list(params); |
||||
|
int total = mapper.count(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectByPrimaryKey(Integer id) { |
||||
|
return RestResponse.success(mapper.selectByPrimaryKey(id)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(RuleConfig config) { |
||||
|
try { |
||||
|
int count = mapper.checkRuleAndTicketType(config.getRule(), config.getTicketType()); |
||||
|
if (count > 0) { |
||||
|
return RestResponse.failure("该规则已存在。"); |
||||
|
} |
||||
|
mapper.insert(config); |
||||
|
return RestResponse.success(config); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse update(RuleConfig config) { |
||||
|
try { |
||||
|
config.setTicketType(null); |
||||
|
config.setRule(null); |
||||
|
mapper.updateByPrimaryKeySelective(config); |
||||
|
return RestResponse.success(config); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
try { |
||||
|
mapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse getRuleType() { |
||||
|
List<RuleType> list = ruleTypeMapper.list(); |
||||
|
return RestResponse.success(list); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,77 @@ |
|||||
|
package com.cmsen.ticket.application.manager.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.manager.service.SysWhitelistService; |
||||
|
import com.cmsen.ticket.domain.entity.Company; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysUser; |
||||
|
import com.cmsen.ticket.domain.mapper.CompanyMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2021/2/22 9:56 |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SysWhitelistServiceImpl implements SysWhitelistService { |
||||
|
@Resource |
||||
|
private CompanyMapper mapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse list(Map<String, Object> params) { |
||||
|
PaginationUtil.paginationInit(params); |
||||
|
List<SysUser> list = mapper.list(params); |
||||
|
int total = mapper.count(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectByPrimaryKey(Integer id) { |
||||
|
return RestResponse.success(mapper.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse create(Company company) { |
||||
|
try { |
||||
|
mapper.insert(company); |
||||
|
return RestResponse.success(company); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse update(Company company) { |
||||
|
try { |
||||
|
mapper.update(company); |
||||
|
return RestResponse.success(company); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse delete(Integer id) { |
||||
|
try { |
||||
|
mapper.deleteById(id); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,5 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
public interface BayerCorInvoiceService { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.domain.entity.CorpPaymentHeader; |
||||
|
import com.cmsen.ticket.domain.entity.CorpPaymentLine; |
||||
|
|
||||
|
/** |
||||
|
* 供应商付款 |
||||
|
* @author xp |
||||
|
* @version 1.0.0 |
||||
|
* @date 2022年5月16日 15:10:36 |
||||
|
**/ |
||||
|
public interface CorpPaymentService { |
||||
|
RestResponse insertPayment(CorpPaymentHeader header); |
||||
|
RestResponse insertHeader(CorpPaymentHeader header); |
||||
|
RestResponse insertLine(CorpPaymentLine line); |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author ran hao yu |
||||
|
* @date 2020/8/7 9:15 |
||||
|
* @description |
||||
|
*/ |
||||
|
public interface CurrencyService { |
||||
|
RestResponse selectList(String name); |
||||
|
|
||||
|
RestResponse selectALlColumn(String tableName); |
||||
|
|
||||
|
|
||||
|
RestResponse insertActive(Map<String, String> map); |
||||
|
} |
||||
@ -0,0 +1,58 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.ticket.domain.entity.Customer; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* (Customer)表服务接口 |
||||
|
* |
||||
|
* @author ran hao yu |
||||
|
* @since 2020-09-18 14:11:43 |
||||
|
*/ |
||||
|
public interface CustomerService { |
||||
|
|
||||
|
/** |
||||
|
* 通过ID查询单条数据 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 实例对象 |
||||
|
*/ |
||||
|
Customer queryById(Integer id); |
||||
|
|
||||
|
/** |
||||
|
* 查询多条数据 |
||||
|
* |
||||
|
* @param offset 查询起始位置 |
||||
|
* @param limit 查询条数 |
||||
|
* @return 对象列表 |
||||
|
*/ |
||||
|
List<Customer> queryAllByLimit(int offset, int limit); |
||||
|
|
||||
|
List<Customer> queryAll(Customer customer); |
||||
|
|
||||
|
/** |
||||
|
* 新增数据 |
||||
|
* |
||||
|
* @param customer 实例对象 |
||||
|
* @return 实例对象 |
||||
|
*/ |
||||
|
Customer insert(Customer customer); |
||||
|
|
||||
|
/** |
||||
|
* 修改数据 |
||||
|
* |
||||
|
* @param customer 实例对象 |
||||
|
* @return 实例对象 |
||||
|
*/ |
||||
|
Customer update(Customer customer); |
||||
|
|
||||
|
/** |
||||
|
* 通过主键删除数据 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 是否成功 |
||||
|
*/ |
||||
|
boolean deleteById(Integer id); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.ticket.common.AjaxJson; |
||||
|
|
||||
|
public interface HLYInterfaceService { |
||||
|
|
||||
|
AjaxJson saveDatas(String resBody); |
||||
|
|
||||
|
AjaxJson getReportKey(String hlyReportId); |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
|
||||
|
/** |
||||
|
* @author ran hao yu |
||||
|
* @date 2020/8/7 9:50 |
||||
|
* @description |
||||
|
*/ |
||||
|
public interface HelpService { |
||||
|
RestResponse selectList(); |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
|
||||
|
/** |
||||
|
* @author ran hao yu |
||||
|
* @date 2020/8/4 15:47 |
||||
|
* @description 国际化接口业务层 |
||||
|
*/ |
||||
|
public interface InternationalizationService { |
||||
|
RestResponse selectList(); |
||||
|
|
||||
|
RestResponse getAppMenus(); |
||||
|
} |
||||
@ -0,0 +1,4 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
public interface MeetingClient { |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
public interface SendMailService { |
||||
|
Boolean sendVerifiedCode(String to, String verifiedCode); |
||||
|
|
||||
|
Boolean sendVerifiedText(String to, String Text); |
||||
|
|
||||
|
Boolean sendVerifiedText2(String to, String cc, String Text); |
||||
|
|
||||
|
Boolean sendSubjectAndText(String to, String subject, String Text); |
||||
|
|
||||
|
Boolean sendFileAndText(String to, String text, String files); |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
|
||||
|
/** |
||||
|
* @author ran hao yu |
||||
|
* @date 2020/8/17 17:03 |
||||
|
* @description |
||||
|
*/ |
||||
|
public interface SendSmsService { |
||||
|
RestResponse getSmsCode(String tel); |
||||
|
|
||||
|
// RestResponse verifySmsCode(String tel,String verificationCode);
|
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoice; |
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoiceItems; |
||||
|
|
||||
|
public interface SupplierStateService { |
||||
|
|
||||
|
|
||||
|
public void insertCorporateInvoicePO(CorporateInvoice corporateInvoice,CorporateInvoiceItems corporateInvoiceItem, String po); |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
/** |
||||
|
* @author fengql |
||||
|
* @date 2022/8/17 11:39 |
||||
|
* @description 用户PC业务层接口 |
||||
|
*/ |
||||
|
public interface UserPcService { |
||||
|
RestResponse getUrl(); |
||||
|
|
||||
|
RestResponse loginPc(String code); |
||||
|
|
||||
|
RestResponse getVerCode(String openId, String telOrEmail); |
||||
|
|
||||
|
RestResponse codeLogin(String verCode, String telOrEmail); |
||||
|
|
||||
|
RestResponse upload(MultipartFile[] files, String typeCode, String email); |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.cmsen.ticket.application.service; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.domain.entity.CorporateInvoice; |
||||
|
import com.cmsen.ticket.domain.entity.Supplier; |
||||
|
import com.cmsen.ticket.domain.entity.weitai.SendResult; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
public interface WeiTaiOcrService { |
||||
|
RestResponse supplierList(Map<String, Object> params); |
||||
|
|
||||
|
RestResponse supplierInsert(Supplier supplier); |
||||
|
RestResponse supplierInsertList(List<Supplier> ls); |
||||
|
|
||||
|
RestResponse supplierUpdate(Supplier supplier); |
||||
|
|
||||
|
RestResponse supplierDelete(Integer id); |
||||
|
|
||||
|
RestResponse corInvoiceList(Map<String, Object> params); |
||||
|
|
||||
|
RestResponse corInvoiceAndPoAndDetailList(Map<String, Object> params); |
||||
|
|
||||
|
RestResponse updateContractOwner(String jsonStr); |
||||
|
|
||||
|
RestResponse updateInternalOwner(String jsonStr); |
||||
|
|
||||
|
RestResponse updateFlowOwner(String jsonStr); |
||||
|
|
||||
|
RestResponse updateStatus(String jsonStr); |
||||
|
|
||||
|
RestResponse updateMatchingStatus(String jsonStr); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,75 @@ |
|||||
|
package com.cmsen.ticket.application.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.service.CorpPaymentService; |
||||
|
import com.cmsen.ticket.domain.entity.CorpPaymentHeader; |
||||
|
import com.cmsen.ticket.domain.entity.CorpPaymentLine; |
||||
|
import com.cmsen.ticket.domain.mapper.CorpPaymentHeaderMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.CorpPaymentLineMapper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 供应商付款 |
||||
|
* @author xp |
||||
|
* @version 1.0.0 |
||||
|
* @date 2022年5月16日 15:10:36 |
||||
|
**/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class CorpPaymentServiceImpl implements CorpPaymentService { |
||||
|
@Resource |
||||
|
private CorpPaymentHeaderMapper corpPaymentHeaderMapper; |
||||
|
@Resource |
||||
|
private CorpPaymentLineMapper corpPaymentLineMapper; |
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public RestResponse insertPayment(CorpPaymentHeader header){ |
||||
|
// 判断对象是否为空
|
||||
|
if(header==null){ |
||||
|
return RestResponse.failure("Header不能为空"); |
||||
|
} |
||||
|
// 判断明细是否为空
|
||||
|
if(header!=null&& (header.getPayMentLine()==null ||header.getPayMentLine().size()==0)){ |
||||
|
return RestResponse.failure("Line不能为空"); |
||||
|
|
||||
|
} |
||||
|
CorpPaymentHeader query = new CorpPaymentHeader(); |
||||
|
query.setRequestId(header.getRequestId()); |
||||
|
List<CorpPaymentHeader> ls =corpPaymentHeaderMapper.selectList(query); |
||||
|
if(ls.size()>0){ |
||||
|
return RestResponse.failure("付款记录已存在"); |
||||
|
} |
||||
|
try { |
||||
|
header.setId(null); |
||||
|
corpPaymentHeaderMapper.insertSelective(header); |
||||
|
List<CorpPaymentLine> line = new ArrayList<>(); |
||||
|
for (CorpPaymentLine tmp : header.getPayMentLine()) { |
||||
|
tmp.setPId(header.getId().toString()); |
||||
|
line.add(tmp); |
||||
|
} |
||||
|
corpPaymentLineMapper.insertBatch(line); |
||||
|
}catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
return RestResponse.failure("操作错误"); |
||||
|
} |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
@Override |
||||
|
public RestResponse insertHeader(CorpPaymentHeader header){ |
||||
|
corpPaymentHeaderMapper.insertSelective(header); |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
@Override |
||||
|
public RestResponse insertLine(CorpPaymentLine line){ |
||||
|
corpPaymentLineMapper.insertSelective(line); |
||||
|
return RestResponse.success(); |
||||
|
|
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,65 @@ |
|||||
|
package com.cmsen.ticket.application.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.service.CurrencyService; |
||||
|
import com.cmsen.ticket.domain.entity.Currency; |
||||
|
import com.cmsen.ticket.domain.mapper.CurrencyMapper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author ran hao yu |
||||
|
* @date 2020/8/7 9:15 |
||||
|
* @description |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class CurrencyServiceImpl implements CurrencyService { |
||||
|
@Resource |
||||
|
private CurrencyMapper currencyMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectList(String name) { |
||||
|
List<Currency> maps = currencyMapper.selectList(name); |
||||
|
return RestResponse.success(maps); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectALlColumn(String tableName) { |
||||
|
List<String> columns = currencyMapper.selectALlColumn(tableName); |
||||
|
if (columns != null) { |
||||
|
return RestResponse.success(columns); |
||||
|
} else { |
||||
|
return RestResponse.failure("查询失败"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse insertActive(Map<String, String> map) { |
||||
|
List<String> columns = currencyMapper.selectALlColumn("currency"); |
||||
|
StringBuilder stringBuilder = new StringBuilder("insert into currency ("); |
||||
|
StringBuilder stringBuilder1 = new StringBuilder("values("); |
||||
|
for (String column : columns) { |
||||
|
stringBuilder.append(column).append(","); |
||||
|
} |
||||
|
String sqlColumn = stringBuilder.substring(0, stringBuilder.length() - 1); |
||||
|
sqlColumn = sqlColumn + ")"; |
||||
|
log.info(sqlColumn); |
||||
|
for (int i = 0; i < columns.size(); i++) { |
||||
|
stringBuilder1.append("\"").append(map.get(columns.get(i))).append("\"").append(","); |
||||
|
} |
||||
|
String sqlValue = stringBuilder1.substring(0, stringBuilder1.length() - 1); |
||||
|
sqlValue = sqlValue + ")"; |
||||
|
log.info(stringBuilder1.toString()); |
||||
|
log.info(sqlValue); |
||||
|
String s = sqlColumn + sqlValue; |
||||
|
int i = currencyMapper.insertActive(s); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,84 @@ |
|||||
|
package com.cmsen.ticket.application.service.impl; |
||||
|
|
||||
|
import com.cmsen.ticket.application.service.CustomerService; |
||||
|
import com.cmsen.ticket.domain.entity.Customer; |
||||
|
import com.cmsen.ticket.domain.mapper.CustomerMapper; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* (Customer)表服务实现类 |
||||
|
* |
||||
|
* @author ran hao yu |
||||
|
* @since 2020-09-18 14:11:43 |
||||
|
*/ |
||||
|
@Service("customerService") |
||||
|
public class CustomerServiceImpl implements CustomerService { |
||||
|
@Resource |
||||
|
private CustomerMapper customerMapper; |
||||
|
|
||||
|
/** |
||||
|
* 通过ID查询单条数据 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 实例对象 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Customer queryById(Integer id) { |
||||
|
return this.customerMapper.queryById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询多条数据 |
||||
|
* |
||||
|
* @param offset 查询起始位置 |
||||
|
* @param limit 查询条数 |
||||
|
* @return 对象列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<Customer> queryAllByLimit(int offset, int limit) { |
||||
|
return this.customerMapper.queryAllByLimit(offset, limit); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<Customer> queryAll(Customer customer) { |
||||
|
return this.customerMapper.queryAll(customer); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增数据 |
||||
|
* |
||||
|
* @param customer 实例对象 |
||||
|
* @return 实例对象 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Customer insert(Customer customer) { |
||||
|
this.customerMapper.insert(customer); |
||||
|
return customer; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改数据 |
||||
|
* |
||||
|
* @param customer 实例对象 |
||||
|
* @return 实例对象 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Customer update(Customer customer) { |
||||
|
this.customerMapper.update(customer); |
||||
|
return this.queryById(customer.getId()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 通过主键删除数据 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 是否成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public boolean deleteById(Integer id) { |
||||
|
return this.customerMapper.deleteById(id) > 0; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.cmsen.ticket.application.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.service.HelpService; |
||||
|
import com.cmsen.ticket.domain.entity.Help; |
||||
|
import com.cmsen.ticket.domain.mapper.HelpMapper; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author ran hao yu |
||||
|
* @date 2020/8/7 9:50 |
||||
|
* @description |
||||
|
*/ |
||||
|
@Service |
||||
|
public class HelpServiceImpl implements HelpService { |
||||
|
@Resource |
||||
|
private HelpMapper helpMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectList() { |
||||
|
List<Help> helps = helpMapper.selectList(); |
||||
|
return RestResponse.success(helps); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,70 @@ |
|||||
|
package com.cmsen.ticket.application.service.impl; |
||||
|
|
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.ticket.application.service.InternationalizationService; |
||||
|
import com.cmsen.ticket.domain.entity.Internationalization; |
||||
|
import com.cmsen.ticket.domain.entity.User; |
||||
|
import com.cmsen.ticket.domain.entity.VerifiedUser; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
||||
|
import com.cmsen.ticket.domain.mapper.AppMenuMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.InternationalizationMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.UserMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.VerifiedUserMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
||||
|
import com.cmsenframework.security.RequestSecurityPolicy; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author ran hao yu |
||||
|
* @date 2020/8/4 15:48 |
||||
|
* @description 国际化接口调用层 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class InternationalizationServiceImpl implements InternationalizationService { |
||||
|
@Resource |
||||
|
private InternationalizationMapper mapper; |
||||
|
|
||||
|
@Resource |
||||
|
private AppMenuMapper appMenuMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SysConfigMapper sysConfigMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private UserMapper userMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private VerifiedUserMapper verifiedUserMapper; |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse selectList() { |
||||
|
try { |
||||
|
List<Internationalization> internationalizations = mapper.selectList(); |
||||
|
return RestResponse.success(internationalizations, "查询国际化数据成功"); |
||||
|
} catch (ServiceException e) { |
||||
|
throw new ServiceException(e); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse getAppMenus() { |
||||
|
|
||||
|
SysConfig sysConfig = sysConfigMapper.selectByCode("menu_show"); |
||||
|
if(sysConfig != null && sysConfig.getValue().equals("2")){//角色控制
|
||||
|
Integer userId = Integer.valueOf(String.valueOf(RequestSecurityPolicy.getUserId())); |
||||
|
User user = userMapper.selectByPrimaryKey(userId); |
||||
|
VerifiedUser verifiedUser = verifiedUserMapper.checkByTel(user.getTel()); |
||||
|
if(verifiedUser == null){ |
||||
|
return RestResponse.failure("verifiedUser不存在,请检查"); |
||||
|
} |
||||
|
|
||||
|
return RestResponse.success(appMenuMapper.selByType(verifiedUser.getType())); |
||||
|
}else{ |
||||
|
return RestResponse.success(appMenuMapper.listActive()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,178 @@ |
|||||
|
package com.cmsen.ticket.application.service.impl; |
||||
|
|
||||
|
import com.cmsen.ticket.application.service.SendMailService; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.mail.javamail.JavaMailSender; |
||||
|
import org.springframework.mail.javamail.MimeMessageHelper; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.activation.DataHandler; |
||||
|
import javax.activation.FileDataSource; |
||||
|
import javax.annotation.Resource; |
||||
|
import javax.mail.Address; |
||||
|
import javax.mail.BodyPart; |
||||
|
import javax.mail.Message; |
||||
|
import javax.mail.Multipart; |
||||
|
import javax.mail.internet.*; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @author ONE MORE THING |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class SendMailServiceImpl implements SendMailService { |
||||
|
|
||||
|
@Resource |
||||
|
private JavaMailSender javaMailSender; |
||||
|
|
||||
|
@Value("${spring.mail.username}") |
||||
|
private String from; |
||||
|
|
||||
|
// @Value("${mail-public.username}")
|
||||
|
// private String pub_from;
|
||||
|
|
||||
|
@Resource |
||||
|
private SysConfigMapper sysConfigMapper; |
||||
|
|
||||
|
@Override |
||||
|
public Boolean sendVerifiedCode(String to, String verifiedCode) { |
||||
|
try { |
||||
|
String title = "智能发票助手"; |
||||
|
SysConfig sysConfig = sysConfigMapper.selectByCode("appletTitle_Cn"); |
||||
|
if(sysConfig != null){ |
||||
|
title = sysConfig.getValue(); |
||||
|
} |
||||
|
String text = "<p>Dear User: Your verification code is <strong>" + verifiedCode + "</strong>, valid for 5 minutes. Please verify ASAP.<br>"+ |
||||
|
"亲爱的用户:您的验证码是<strong>" + verifiedCode + "</strong> ,有效期为五分钟,请尽快完成验证。<br>"+ |
||||
|
"【"+title+"】</p>"; |
||||
|
log.info("sendVerifiedCode >> {} >> {}", to, verifiedCode); |
||||
|
MimeMessage message = javaMailSender.createMimeMessage(); |
||||
|
MimeMessageHelper helper = new MimeMessageHelper(message, true); |
||||
|
helper.setFrom(from); |
||||
|
helper.setTo(to); |
||||
|
helper.setSubject(title); |
||||
|
helper.setText(text, true); |
||||
|
javaMailSender.send(message); |
||||
|
return true; |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean sendVerifiedText(String to, String Text) { |
||||
|
try { |
||||
|
String title = "智能发票管家"; |
||||
|
SysConfig sysConfig = sysConfigMapper.selectByCode("appletTitle_Cn"); |
||||
|
if(sysConfig != null){ |
||||
|
title = sysConfig.getValue(); |
||||
|
} |
||||
|
|
||||
|
log.info("sendException >> {} >> {} >> {}", from, to, Text); |
||||
|
MimeMessage message = javaMailSender.createMimeMessage(); |
||||
|
MimeMessageHelper helper = new MimeMessageHelper(message, true); |
||||
|
helper.setFrom(from); |
||||
|
helper.setTo(to); |
||||
|
helper.setSubject(title); |
||||
|
helper.setText("<p>"+Text+"</p>", true); |
||||
|
javaMailSender.send(message); |
||||
|
return true; |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public Boolean sendVerifiedText2(String to, String cc, String Text) { |
||||
|
try { |
||||
|
log.info("sendVerifiedText2 >> {} >> {} >> {} >> {}", from, to, cc, Text); |
||||
|
MimeMessage message = javaMailSender.createMimeMessage(); |
||||
|
MimeMessageHelper helper = new MimeMessageHelper(message, true); |
||||
|
helper.setFrom(from); |
||||
|
helper.setTo(to); |
||||
|
helper.setCc(cc); |
||||
|
helper.setSubject("易合宝-会议信息变更通知邮件"); |
||||
|
helper.setText("<p>"+Text+"</p>", true); |
||||
|
javaMailSender.send(message); |
||||
|
return true; |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean sendSubjectAndText(String to, String subject, String Text) { |
||||
|
try { |
||||
|
log.info("sendSubjectAndText >> {} >> {} >> {} >> {}", from, to, subject, Text); |
||||
|
MimeMessage message = javaMailSender.createMimeMessage(); |
||||
|
MimeMessageHelper helper = new MimeMessageHelper(message, true); |
||||
|
helper.setFrom(from); |
||||
|
helper.setTo(to); |
||||
|
helper.setSubject(subject); |
||||
|
helper.setText("<p>"+Text+"</p>", true); |
||||
|
javaMailSender.send(message); |
||||
|
return true; |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean sendFileAndText(String to, String text, String filePath) { |
||||
|
try { |
||||
|
|
||||
|
log.info("sendFileAndText >> {} >> {} >> {}", from, to, text); |
||||
|
MimeMessage message = javaMailSender.createMimeMessage(); |
||||
|
// 设置发件人邮箱地址
|
||||
|
message.setFrom(new InternetAddress(from, text, "UTF-8")); |
||||
|
// 设置收件人邮箱地址
|
||||
|
//message.setRecipients(Message.RecipientType.TO, new InternetAddress[]{new InternetAddress("xxx@qq.com"),new InternetAddress("xxx@qq.com"),new InternetAddress("xxx@qq.com")});
|
||||
|
/*设置收件人 |
||||
|
To收件人 CC 抄送 BCC密送*/ |
||||
|
Address[] internetAddressTo = new InternetAddress().parse(to); |
||||
|
message.setRecipients(Message.RecipientType.TO, internetAddressTo);//一个收件人
|
||||
|
// 多个收件人
|
||||
|
/*String[] split = emails.split(";"); |
||||
|
InternetAddress[] address = new InternetAddress[split.length]; |
||||
|
for (int i = 0; i < split.length; i++) { |
||||
|
address[i] = new InternetAddress(split[i]); |
||||
|
} |
||||
|
message.setRecipients(Message.RecipientType.TO, address); |
||||
|
*/ |
||||
|
// 设置邮件标题
|
||||
|
message.setSubject("智能发票管家定时任务文件"); |
||||
|
// 创建消息部分
|
||||
|
BodyPart messageBodyPart = new MimeBodyPart(); |
||||
|
// 消息内容
|
||||
|
messageBodyPart.setText(text); |
||||
|
// 创建多重消息
|
||||
|
Multipart multipart = new MimeMultipart(); |
||||
|
// 设置文本消息部分
|
||||
|
multipart.addBodyPart(messageBodyPart); |
||||
|
|
||||
|
//创建附件节点 读取本地文件,并读取附件名称
|
||||
|
MimeBodyPart file = new MimeBodyPart(); |
||||
|
DataHandler dataHandler = new DataHandler(new FileDataSource(filePath)); |
||||
|
file.setDataHandler(dataHandler); |
||||
|
file.setFileName(MimeUtility.encodeText(dataHandler.getName())); |
||||
|
multipart.addBodyPart(file); |
||||
|
message.setSentDate(new Date()); |
||||
|
message.setContent(multipart); |
||||
|
javaMailSender.send(message); |
||||
|
return true; |
||||
|
}catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,462 @@ |
|||||
|
package com.cmsen.ticket.application.service.impl; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.alibaba.fastjson.JSONArray; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.cmsen.common.exception.ServiceException; |
||||
|
import com.cmsen.common.http.ClientHttp; |
||||
|
import com.cmsen.common.http.ClientHttpRequest; |
||||
|
import com.cmsen.common.http.ClientHttpResponse; |
||||
|
import com.cmsen.common.http.ContentEnctype; |
||||
|
import com.cmsen.common.http.response.RestResponse; |
||||
|
import com.cmsen.common.util.DateFormat; |
||||
|
import com.cmsen.common.util.JsonUtil; |
||||
|
import com.cmsen.common.util.StringUtil; |
||||
|
import com.cmsen.ticket.application.service.WeiTaiOcrService; |
||||
|
import com.cmsen.ticket.domain.dto.ScannerInvoiceDto; |
||||
|
import com.cmsen.ticket.domain.entity.*; |
||||
|
import com.cmsen.ticket.domain.entity.baozun.InterfaceRequestEntity; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SupplierOrderItemMatching; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
||||
|
import com.cmsen.ticket.domain.entity.manager.SysUser; |
||||
|
import com.cmsen.ticket.domain.entity.weitai.LineDOCUP; |
||||
|
import com.cmsen.ticket.domain.entity.weitai.OCREXPRESS; |
||||
|
import com.cmsen.ticket.domain.entity.weitai.SendResult; |
||||
|
import com.cmsen.ticket.domain.mapper.*; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SupplierOrderItemMatchingMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
||||
|
import com.cmsen.ticket.domain.mapper.manager.SysUserMapper; |
||||
|
import com.cmsen.ticket.domain.util.PaginationUtil; |
||||
|
import com.cmsen.ticket.domain.util.StringUtils; |
||||
|
import lombok.Cleanup; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.ByteArrayOutputStream; |
||||
|
import java.io.InputStream; |
||||
|
import java.net.HttpURLConnection; |
||||
|
import java.net.URL; |
||||
|
import java.util.*; |
||||
|
|
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class WeiTaiOcrServiceImpl implements WeiTaiOcrService { |
||||
|
|
||||
|
@Resource |
||||
|
private SupplierMapper supplierMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private CorporateInvoiceMapper corporateInvoiceMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private InvokeContractMapper invokeContractMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private InvokeInternalMapper invokeInternalMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private InvokePurchaseMapper invokePurchaseMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SupplierOrderHeaderMapper supplierOrderHeaderMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SupplierOrderItemMatchingMapper supplierOrderItemMatchingMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SysUserMapper sysUserMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private SysConfigMapper sysConfigMapper; |
||||
|
|
||||
|
@Resource |
||||
|
private CorporateInvoiceScannerFilesMapper corporateInvoiceScannerFilesMapper; |
||||
|
|
||||
|
private static final List<String> statusList = new ArrayList<String>() {{ |
||||
|
add("2"); |
||||
|
add("4"); |
||||
|
add("6"); |
||||
|
add("8"); |
||||
|
add("10"); |
||||
|
add("12"); |
||||
|
add("14"); |
||||
|
add("99"); |
||||
|
}}; |
||||
|
|
||||
|
//方法二:效率比较高 备注:pageSize集合显示的分组个数,soruceDatas为集合原数据
|
||||
|
private static List<List<File>> groupByList(List<File> sourceDatas, |
||||
|
int pageSize) { |
||||
|
// 分组集合
|
||||
|
List<List<File>> groupLists = new ArrayList<>(); |
||||
|
// 分组数据
|
||||
|
List<File> tempDatas = new ArrayList<>(); |
||||
|
if (sourceDatas != null && pageSize > 0) { |
||||
|
for (int i = 0; i < sourceDatas.size(); i++) { |
||||
|
if (i % pageSize == 0) { |
||||
|
if (!tempDatas.isEmpty()) { |
||||
|
groupLists.add(tempDatas); |
||||
|
} |
||||
|
tempDatas = new ArrayList<>(); |
||||
|
tempDatas.add(sourceDatas.get(i)); |
||||
|
} else { |
||||
|
tempDatas.add(sourceDatas.get(i)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
if (!tempDatas.isEmpty()) { |
||||
|
groupLists.add(tempDatas); |
||||
|
} |
||||
|
return groupLists; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse supplierList(Map<String, Object> params) { |
||||
|
PaginationUtil.paginationInit(params); |
||||
|
List<Supplier> list = supplierMapper.list(params); |
||||
|
int total = supplierMapper.count(params); |
||||
|
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse supplierInsert(Supplier supplier) { |
||||
|
try { |
||||
|
Supplier supplierObj =supplierMapper.selectCodeByNameAndCode2("",supplier.getCode()); |
||||
|
if (supplierObj==null) { |
||||
|
if(supplier.getTaxNo()==null){ |
||||
|
supplier.setTaxNo(""); |
||||
|
} |
||||
|
supplierMapper.insertSelective(supplier); |
||||
|
}else{ |
||||
|
supplier.setId(supplierObj.getId()); |
||||
|
supplierMapper.updateByPrimaryKeySelective(supplier); |
||||
|
} |
||||
|
return RestResponse.success(supplier); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse supplierInsertList(List<Supplier> ls) { |
||||
|
try { |
||||
|
for(Supplier supplier:ls) { |
||||
|
Supplier supplierObj = supplierMapper.selectCodeByNameAndCode2("", supplier.getCode()); |
||||
|
if (supplierObj == null) { |
||||
|
if (supplier.getTaxNo() == null) { |
||||
|
supplier.setTaxNo(""); |
||||
|
} |
||||
|
supplierMapper.insertSelective(supplier); |
||||
|
} else { |
||||
|
supplier.setId(supplierObj.getId()); |
||||
|
supplierMapper.updateByPrimaryKeySelective(supplier); |
||||
|
} |
||||
|
} |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse supplierUpdate(Supplier supplier) { |
||||
|
try { |
||||
|
supplierMapper.updateByPrimaryKeySelective(supplier); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public RestResponse supplierDelete(Integer id) { |
||||
|
try { |
||||
|
supplierMapper.deleteByPrimaryKey(id); |
||||
|
return RestResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
throw new ServiceException("系统错误"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public RestResponse corInvoiceList(Map<String, Object> params) { |
||||
|
StringUtils.decoderUrl(params); |
||||
|
ScannerInvoiceDto result = new ScannerInvoiceDto(); |
||||
|
// 优先判断是否多文件已处理
|
||||
|
// "completed": true, // 文件处理返回状态 若 false 则 processStatus totalQty processedQty 都为null data 数组为[]
|
||||
|
// "processStatus":"SUCCESS", //文件处理返回状态 信息 若 FAILED 则totalQty > processedQty
|
||||
|
// "totalQty": 20, // 发票总数
|
||||
|
// "processedQty": 20, // 已完成发票总数
|
||||
|
List<CorporateInvoiceScannerFiles> scannerFiles = corporateInvoiceScannerFilesMapper.list(params); |
||||
|
log.info("供应商发票查询 返回scannerFile结果size=>{}",scannerFiles.size()); |
||||
|
result.setTotalQty(scannerFiles.size()); |
||||
|
result.setCompleted(true); |
||||
|
result.setProcessedQty(0); |
||||
|
result.setProcessStatus("SUCCESS"); |
||||
|
boolean flag = true; |
||||
|
boolean flag2 = true; |
||||
|
if(scannerFiles.isEmpty()){ |
||||
|
log.info("供应商发票查询 返回scannerFile结果size = 0,返回空结果Completed false"); |
||||
|
result.setTotalQty(scannerFiles.size()); |
||||
|
result.setCompleted(true); |
||||
|
result.setProcessedQty(0); |
||||
|
result.setProcessStatus("NONE"); |
||||
|
return RestResponse.success(result); |
||||
|
} |
||||
|
for (CorporateInvoiceScannerFiles scannerFile : scannerFiles) { |
||||
|
// if(scannerFile.getOcrStatus()==0||scannerFile.getVerifyStatus()==0){
|
||||
|
if(scannerFile.getOcrStatus()==0){ |
||||
|
// 表示还有ocr没执行
|
||||
|
log.info("供应商发票查询 有OCR未执行"); |
||||
|
flag = false; |
||||
|
// result.setProcessStatus("FAILED");
|
||||
|
} |
||||
|
if(scannerFile.getOcrStatus()==2){ |
||||
|
// 表示出现了异常
|
||||
|
log.info("供应商发票查询 有OCR失败"); |
||||
|
flag2 = false; |
||||
|
} |
||||
|
if(scannerFile.getOcrStatus()==1&&scannerFile.getVerifyStatus()==1){ |
||||
|
// if(scannerFile.getOcrStatus()==1){
|
||||
|
// 表示 ocr和 验真都没问题
|
||||
|
log.info("供应商发票查询 ocr和验真均成功 数量+1"); |
||||
|
result.setProcessedQty(result.getProcessedQty()+1); |
||||
|
} |
||||
|
} |
||||
|
if(flag&&flag2){ |
||||
|
log.info("供应商发票查询 无错误信息"); |
||||
|
}else{ |
||||
|
if(!flag2){ |
||||
|
log.info("供应商发票查询 OCR失败情况返回空的结果集"); |
||||
|
result.setProcessStatus("FAILED"); |
||||
|
result.setData(Collections.emptyList()); |
||||
|
return RestResponse.success(result); |
||||
|
} |
||||
|
if(!flag){ |
||||
|
log.info("供应商发票查询 OCR还未执行完成 Completed false"); |
||||
|
result.setCompleted(false); |
||||
|
result.setProcessedQty(null); |
||||
|
result.setTotalQty(null); |
||||
|
result.setProcessStatus(null); |
||||
|
return RestResponse.success(result); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
PaginationUtil.paginationInit(params); |
||||
|
// list 和count都需要变更参数
|
||||
|
params.remove("startNo"); |
||||
|
params.remove("length"); |
||||
|
List<CorporateInvoice> list = corporateInvoiceMapper.list2(params); |
||||
|
log.info("供应商发票查询 正常返回结果集111111=》{}",JSON.toJSONString(list)); |
||||
|
|
||||
|
int total = corporateInvoiceMapper.count2(params); |
||||
|
Object o = PaginationUtil.getPageResult(total, params, list); |
||||
|
result.setData(o); |
||||
|
return RestResponse.success(result); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse corInvoiceAndPoAndDetailList(Map<String,Object> params) { |
||||
|
StringUtils.decoderUrl(params); |
||||
|
PaginationUtil.paginationInit(params); |
||||
|
// list 和count都需要变更参数
|
||||
|
List<CorporateInvoice> list = corporateInvoiceMapper.list6(params); |
||||
|
return RestResponse.success(list); |
||||
|
} |
||||
|
|
||||
|
private byte[] netImageToBytes(String netPath) { |
||||
|
try { |
||||
|
@Cleanup |
||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream(); |
||||
|
URL url = new URL(netPath); |
||||
|
byte[] bytes = new byte[1024]; |
||||
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
||||
|
conn.setRequestMethod("GET"); |
||||
|
conn.setConnectTimeout(5000); |
||||
|
@Cleanup |
||||
|
InputStream is = conn.getInputStream(); |
||||
|
int len = -1; |
||||
|
while ((len = is.read(bytes)) != -1) { |
||||
|
os.write(bytes, 0, len); |
||||
|
} |
||||
|
return os.toByteArray(); |
||||
|
} catch (Exception e) { |
||||
|
log.error(e.getMessage(), e); |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse updateContractOwner(String jsonStr) { |
||||
|
log.info("updateContractOwner====jsonStr==>>{}",jsonStr); |
||||
|
InterfaceRequestEntity entity = JSONArray.parseObject(jsonStr,InterfaceRequestEntity.class); |
||||
|
InvokeContract invokeContract = invokeContractMapper.selectByRequestId(entity.getRequestId()); |
||||
|
if(invokeContract != null){ |
||||
|
String owner = invokeContract.getOwner()+","+entity.getOwner(); |
||||
|
invokeContractMapper.updateOwnerByRequestId(entity.getRequestId(), owner); |
||||
|
}else{ |
||||
|
return RestResponse.failure("requestId不存在"); |
||||
|
} |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse updateInternalOwner(String jsonStr) { |
||||
|
log.info("updateInternalOwner====jsonStr==>>{}",jsonStr); |
||||
|
InterfaceRequestEntity entity = JSONArray.parseObject(jsonStr,InterfaceRequestEntity.class); |
||||
|
InvokeInternal invokeInternal = invokeInternalMapper.selectByRequestId(entity.getRequestId()); |
||||
|
if(invokeInternal != null){ |
||||
|
String owner = invokeInternal.getOwner()+","+entity.getOwner(); |
||||
|
invokeInternalMapper.updateOwnerByRequestId(entity.getRequestId(), owner); |
||||
|
}else{ |
||||
|
return RestResponse.failure("requestId不存在"); |
||||
|
} |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse updateFlowOwner(String jsonStr) { |
||||
|
log.info("updateFlowOwner====jsonStr==>>{}",jsonStr); |
||||
|
InterfaceRequestEntity entity = JSONArray.parseObject(jsonStr,InterfaceRequestEntity.class); |
||||
|
String flowId = entity.getFlowId(); |
||||
|
SysConfig sysConfig = sysConfigMapper.selectByValue("WORKFLOW_", flowId); |
||||
|
if(sysConfig != null){ |
||||
|
String code = sysConfig.getCode(); |
||||
|
if(code.contains("CONTRACT")){//合同
|
||||
|
InvokeContract invokeContract = invokeContractMapper.selectByRequestId(entity.getRequestId()); |
||||
|
if(invokeContract != null){ |
||||
|
String owner = invokeContract.getOwner()+","+entity.getOwner(); |
||||
|
invokeContractMapper.updateOwnerByRequestId(entity.getRequestId(), owner); |
||||
|
}else{ |
||||
|
return RestResponse.failure("requestId不存在"); |
||||
|
} |
||||
|
} |
||||
|
if(code.contains("INTERNAL")){//内结
|
||||
|
InvokeInternal invokeInternal = invokeInternalMapper.selectByRequestId(entity.getRequestId()); |
||||
|
if(invokeInternal != null){ |
||||
|
String owner = invokeInternal.getOwner()+","+entity.getOwner(); |
||||
|
invokeInternalMapper.updateOwnerByRequestId(entity.getRequestId(), owner); |
||||
|
}else{ |
||||
|
return RestResponse.failure("requestId不存在"); |
||||
|
} |
||||
|
} |
||||
|
if(code.contains("PURCHASE")){//采购
|
||||
|
InvokePurchase invokePurchase = invokePurchaseMapper.selectByRequestId(entity.getRequestId()); |
||||
|
if(invokePurchase != null){ |
||||
|
String owner = invokePurchase.getExt02()+","+entity.getOwner(); |
||||
|
invokePurchaseMapper.updateOwnerByRequestId(entity.getRequestId(), owner); |
||||
|
}else{ |
||||
|
return RestResponse.failure("requestId不存在"); |
||||
|
} |
||||
|
} |
||||
|
}else{ |
||||
|
return RestResponse.failure("无效的flowId"); |
||||
|
} |
||||
|
|
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse updateStatus(String jsonStr) { |
||||
|
log.info("updateStatus====jsonStr==>>{}",jsonStr); |
||||
|
InterfaceRequestEntity entity = JSONArray.parseObject(jsonStr,InterfaceRequestEntity.class); |
||||
|
String status = entity.getStatus(); |
||||
|
if(!statusList.contains(status)){ |
||||
|
return RestResponse.failure("status值不正确"); |
||||
|
} |
||||
|
Map<String, Object> params = new HashMap<>(); |
||||
|
SupplierOrderHeader header = supplierOrderHeaderMapper.selectByBillNum(entity.getRequestId()); |
||||
|
if(header != null){ |
||||
|
if(status.equals("8")){ |
||||
|
//判断是否是 后票、后票充值,是--则到下一流程 10-财务节点3
|
||||
|
/*if(!header.getInvoiceType().equals("后票") && !header.getInvoiceType().equals("后票充值")){ |
||||
|
status = "10"; |
||||
|
}*/ |
||||
|
//不包含 后票 --则到下一流程 10-财务节点3
|
||||
|
if(!header.getInvoiceType().contains("后票")){ |
||||
|
status = "10"; |
||||
|
} |
||||
|
if(header.getInvoiceType().equals("后票")){ |
||||
|
//更新匹配表的状态--0-匹配中
|
||||
|
supplierOrderItemMatchingMapper.updateByOrderNo(header.getBillId(),"0"); |
||||
|
} |
||||
|
} |
||||
|
if(status.equals("99")){//驳回
|
||||
|
//更新匹配表的状态--0-匹配中
|
||||
|
supplierOrderItemMatchingMapper.updateByOrderNo(header.getBillId(),"0"); |
||||
|
} |
||||
|
if(header.getInvoiceType().equals("后票充值") && status.equals("6") && StringUtil.isNotEmpty(entity.getFinApprover())){//出纳付款
|
||||
|
String[] aAIdArr = entity.getFinApprover().split(","); |
||||
|
String approver = ""; |
||||
|
for (String oaId : aAIdArr) { |
||||
|
SysUser sysUser = sysUserMapper.selectByOAId(oaId); |
||||
|
if(sysUser != null){ |
||||
|
approver += sysUser.getId() + ","; |
||||
|
} |
||||
|
} |
||||
|
params.put("owner",approver + header.getOwner()); |
||||
|
} |
||||
|
if(status.equals("2")){//上级审批
|
||||
|
//标记一个字段--用于不可撤回验证
|
||||
|
params.put("billNumber",entity.getRequestId()); |
||||
|
params.put("ext04","1"); |
||||
|
supplierOrderHeaderMapper.updateByParams(params); |
||||
|
} |
||||
|
if(status.equals("14")){//删除匹配行
|
||||
|
status = "12";//重新赋值为归档
|
||||
|
|
||||
|
//删除匹配记录
|
||||
|
supplierOrderItemMatchingMapper.deleteByOrderNo(header.getBillId()); |
||||
|
} |
||||
|
}else{ |
||||
|
return RestResponse.failure("requestId不存在"); |
||||
|
} |
||||
|
|
||||
|
//上级审批、空接口不处理状态
|
||||
|
if(!status.equals("2") && !status.equals("10")){ |
||||
|
params.put("billNumber",entity.getRequestId()); |
||||
|
params.put("status",status); |
||||
|
params.put("approvalComment",entity.getApprovalComment()); |
||||
|
supplierOrderHeaderMapper.updateByParams(params); |
||||
|
} |
||||
|
|
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public RestResponse updateMatchingStatus(String jsonStr) { |
||||
|
log.info("updateMatchingStatus====jsonStr==>>{}",jsonStr); |
||||
|
Map<String, Object> params = new HashMap<>(); |
||||
|
JSONObject jsonObject = JSON.parseObject(jsonStr); |
||||
|
JSONArray jsonArray = jsonObject.getJSONArray("data"); |
||||
|
for(int i=0; i<jsonArray.size(); i++){ |
||||
|
JSONObject item = (JSONObject)jsonArray.get(i); |
||||
|
String ocrid = item.getString("ocrid"); |
||||
|
supplierOrderItemMatchingMapper.updateById(ocrid,"0"); |
||||
|
|
||||
|
//更新header的状态为8
|
||||
|
SupplierOrderItemMatching matching = supplierOrderItemMatchingMapper.selectByPrimaryKey(Long.parseLong(ocrid)); |
||||
|
if(matching != null){ |
||||
|
SupplierOrderHeader header = supplierOrderHeaderMapper.selectByPrimaryKey(matching.getOrderNo()); |
||||
|
if(header != null){ |
||||
|
params.put("billNumber",header.getBillNumber()); |
||||
|
params.put("status","8"); |
||||
|
supplierOrderHeaderMapper.updateByParams(params); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
return RestResponse.success(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.cmsen.ticket.application.util; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
*/ |
||||
|
public class CacheKey { |
||||
|
public static final String ATTACHMENT_VERIFY_TYPE = "ATTACHMENT_VERIFY_TYPE:"; |
||||
|
public static final String ATTACHMENT_EXPENSE_TYPE_ID = "ATTACHMENT_EXPENSE_TYPE_ID:"; |
||||
|
public static final String ATTACHMENT_IMAGE_FILE_ID = "ATTACHMENT_IMAGE_FILE_ID:"; |
||||
|
|
||||
|
public static final String INVOICE_VERIFY_KEY = "INVOICE_VERIFY_KEY:"; |
||||
|
|
||||
|
public static final Integer INVOICE_VERIFY_KEY_TIMEOUT = 1000 * 60; |
||||
|
|
||||
|
public static final String ATTACHMENT_FINISHED_FLAG = "ATTACHMENT_FINISHED_FLAG:"; |
||||
|
|
||||
|
public static final Integer ATTACHMENT_FINISHED_FLAG_TIMEOUT = 1000 * 80; |
||||
|
|
||||
|
public static final Integer ATTACHMENT_SAVE_TIMEOUT = 1000 * 60 * 30; |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.cmsen.ticket.application.util; |
||||
|
|
||||
|
import java.text.SimpleDateFormat; |
||||
|
|
||||
|
public class DateUtil { |
||||
|
private static SimpleDateFormat dateFormat = null; |
||||
|
static |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
public static boolean isValidDate(String s,SimpleDateFormat dateFormat){ |
||||
|
dateFormat.setLenient(false); |
||||
|
try |
||||
|
{ |
||||
|
dateFormat.parse(s); |
||||
|
return true; |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
// 如果throw java.text.ParseException或者NullPointerException,就说明格式不对
|
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,127 @@ |
|||||
|
package com.cmsen.ticket.application.util; |
||||
|
|
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import microsoft.exchange.webservices.data.core.ExchangeService; |
||||
|
import microsoft.exchange.webservices.data.core.PropertySet; |
||||
|
import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion; |
||||
|
import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; |
||||
|
import microsoft.exchange.webservices.data.core.enumeration.search.SortDirection; |
||||
|
import microsoft.exchange.webservices.data.core.service.folder.Folder; |
||||
|
import microsoft.exchange.webservices.data.core.service.item.Item; |
||||
|
import microsoft.exchange.webservices.data.core.service.schema.ItemSchema; |
||||
|
import microsoft.exchange.webservices.data.credential.ExchangeCredentials; |
||||
|
import microsoft.exchange.webservices.data.credential.WebCredentials; |
||||
|
import microsoft.exchange.webservices.data.property.complex.Attachment; |
||||
|
import microsoft.exchange.webservices.data.property.complex.FileAttachment; |
||||
|
import microsoft.exchange.webservices.data.property.complex.FolderId; |
||||
|
import microsoft.exchange.webservices.data.property.complex.Mailbox; |
||||
|
import microsoft.exchange.webservices.data.search.FindItemsResults; |
||||
|
import microsoft.exchange.webservices.data.search.FolderView; |
||||
|
import microsoft.exchange.webservices.data.search.ItemView; |
||||
|
|
||||
|
import java.net.URI; |
||||
|
import java.net.URISyntaxException; |
||||
|
|
||||
|
@Slf4j |
||||
|
public class ExchangeUtil { |
||||
|
|
||||
|
private static final String shareInbox = "Inbox"; |
||||
|
// 共享邮件服务器地址
|
||||
|
private static final String shareSMTP = "FLC.invoice.center@flender.com"; |
||||
|
//邮件服务器地址
|
||||
|
private static final String mailServer = "https://email-cn.flender.com/EWS/Exchange.asmx"; |
||||
|
//登录用户名
|
||||
|
private static final String user = "Z004DHXW"; |
||||
|
//登录密码
|
||||
|
private static final String password = "Temp@Win2023003"; |
||||
|
//域
|
||||
|
private static final String domain = "fle01"; |
||||
|
private static final String attachmentFolder = "/docker/upload/exchange_attachment/"; |
||||
|
|
||||
|
/** |
||||
|
* 创建邮件服务 |
||||
|
* @return 邮件服务 |
||||
|
*/ |
||||
|
private static ExchangeService getExchangeService() { |
||||
|
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); |
||||
|
//用户认证信息
|
||||
|
ExchangeCredentials credentials = new WebCredentials(user, password, domain); |
||||
|
service.setCredentials(credentials); |
||||
|
try { |
||||
|
service.setUrl(new URI(mailServer)); |
||||
|
} catch (URISyntaxException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return service; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param srcFolder |
||||
|
* @param max |
||||
|
* @param destFolder |
||||
|
* @throws Exception |
||||
|
*/ |
||||
|
public static void receiveDownloadMove(String srcFolder, int max, String destFolder) throws Exception { |
||||
|
ExchangeService service = getExchangeService(); |
||||
|
// 移动的目标目录
|
||||
|
Folder dest = null; |
||||
|
// 接收指定目录邮件
|
||||
|
Folder folder = null; |
||||
|
// 获取共享文件夹inbox
|
||||
|
Folder inbox = null; |
||||
|
// 获取共享文件夹的根文件夹
|
||||
|
FolderId sharedFolderId = new FolderId(WellKnownFolderName.MsgFolderRoot, new Mailbox(shareSMTP)); |
||||
|
|
||||
|
for (Folder f : service.findFolders(sharedFolderId, new FolderView(Integer.MAX_VALUE)).getFolders()) { |
||||
|
if (shareInbox.equals(f.getDisplayName())) { |
||||
|
inbox = f; |
||||
|
} |
||||
|
} |
||||
|
if (inbox == null) { |
||||
|
throw new Exception("共享邮箱的Inbox不存在"); |
||||
|
} |
||||
|
for (Folder f : inbox.findFolders(new FolderView(Integer.MAX_VALUE)).getFolders()) { |
||||
|
if (srcFolder.equals(f.getDisplayName())) { |
||||
|
folder = f; |
||||
|
} |
||||
|
if (destFolder.equals(f.getDisplayName())) { |
||||
|
dest = f; |
||||
|
} |
||||
|
} |
||||
|
// 校验
|
||||
|
if (folder == null || dest == null) { |
||||
|
throw new Exception("源文件夹或目标文件夹不存在"); |
||||
|
} |
||||
|
|
||||
|
// 源文件夹邮件总数
|
||||
|
int count = folder.getTotalCount(); |
||||
|
if (count <= 0) return; |
||||
|
if (max > 0) { |
||||
|
count = Math.min(max, count); |
||||
|
} |
||||
|
ItemView itemView = new ItemView(count); |
||||
|
// 设置按照时间顺序收取
|
||||
|
itemView.getOrderBy().add(ItemSchema.DateTimeReceived, SortDirection.Descending); |
||||
|
FindItemsResults<Item> findResults = service.findItems(folder.getId(), itemView); |
||||
|
service.loadPropertiesForItems(findResults, PropertySet.FirstClassProperties); |
||||
|
|
||||
|
// 遍历邮件
|
||||
|
for (Item item : findResults.getItems()) { |
||||
|
item.move(folder.getId()); |
||||
|
// 下载附件
|
||||
|
if (!item.getHasAttachments()) continue; |
||||
|
for (Attachment attachment : item.getAttachments()) { |
||||
|
if (attachment instanceof FileAttachment) { |
||||
|
((FileAttachment) attachment).load(attachmentFolder + attachment.getName()); |
||||
|
} |
||||
|
} |
||||
|
// 移动邮件
|
||||
|
try { |
||||
|
item.move(dest.getId()); |
||||
|
} catch (Exception e) { |
||||
|
log.info("移动邮件出错:{}", item.getSubject()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,91 @@ |
|||||
|
package com.cmsen.ticket.application.util; |
||||
|
|
||||
|
import com.alibaba.fastjson2.JSON; |
||||
|
import com.cmsen.ticket.domain.entity.ExpenseTypeActive; |
||||
|
import com.cmsen.ticket.domain.entity.hly.FormItem; |
||||
|
import com.cmsen.ticket.domain.entity.hly.ReportReceive; |
||||
|
|
||||
|
import java.lang.reflect.Field; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
public class ExpFormConvertUtil { |
||||
|
|
||||
|
// FormItem.value -> ReportReceiveLine实体属性映射
|
||||
|
private static final Map<String, String> VALUE_TO_RECEIVE_PROP = new HashMap<>(); |
||||
|
static { |
||||
|
VALUE_TO_RECEIVE_PROP.put("ext31", "ext31"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("ext32", "ext32"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("ext33", "ext33"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("ext34", "ext34"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("ext35", "ext35"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("ext36", "ext36"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("EventCode", "ext21"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("EventFull", "ext22"); |
||||
|
VALUE_TO_RECEIVE_PROP.put("SubType", "ext23"); |
||||
|
} |
||||
|
|
||||
|
// 自定义包装类,一次性存id+pid,避免两次Map
|
||||
|
private static class ActiveIdPidDTO { |
||||
|
Integer id; |
||||
|
Integer pid; |
||||
|
ActiveIdPidDTO(Integer id, Integer pid) { |
||||
|
this.id = id; |
||||
|
this.pid = pid; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 完整处理:替换id、替换pid、回填defaultValue,返回最终JSON字符串 |
||||
|
* @param jsonStr 原始表单JSON |
||||
|
* @param activeList 数据源:提供id、pid |
||||
|
* @param receive 数据源:提供defaultValue |
||||
|
* @return 处理后JSON字符串 |
||||
|
*/ |
||||
|
public static String processFormJson(String jsonStr, List<ExpenseTypeActive> activeList, ReportReceive.ReportReceiveLine receive) { |
||||
|
// 1. JSON转对象列表
|
||||
|
List<FormItem> itemList = JSON.parseArray(jsonStr, FormItem.class); |
||||
|
|
||||
|
// 2. 预构建 value -> id+pid 映射表
|
||||
|
Map<String, ActiveIdPidDTO> valueMap = new HashMap<>(); |
||||
|
for (ExpenseTypeActive active : activeList) { |
||||
|
valueMap.put(active.getValue(), new ActiveIdPidDTO(active.getId(), active.getPid())); |
||||
|
} |
||||
|
|
||||
|
// 3. 遍历逐条赋值
|
||||
|
for (FormItem item : itemList) { |
||||
|
String itemValue = item.getValue(); |
||||
|
ActiveIdPidDTO dto = valueMap.get(itemValue); |
||||
|
|
||||
|
// 匹配到:同时替换id、pid
|
||||
|
if (dto != null) { |
||||
|
item.setId(dto.id); |
||||
|
item.setPid(String.valueOf(dto.pid)); |
||||
|
} |
||||
|
|
||||
|
// 原有逻辑:替换defaultValue
|
||||
|
String receiveProp = VALUE_TO_RECEIVE_PROP.get(itemValue); |
||||
|
if (receiveProp != null) { |
||||
|
String realVal = getFieldValue(receive, receiveProp); |
||||
|
if (realVal != null) { |
||||
|
item.setDefaultValue(realVal); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 转回JSON字符串返回
|
||||
|
return JSON.toJSONString(itemList); |
||||
|
} |
||||
|
|
||||
|
// 反射取值
|
||||
|
private static String getFieldValue(ReportReceive.ReportReceiveLine receive, String fieldName) { |
||||
|
try { |
||||
|
Field field = ReportReceive.ReportReceiveLine.class.getDeclaredField(fieldName); |
||||
|
field.setAccessible(true); |
||||
|
return (String) field.get(receive); |
||||
|
} catch (Exception e) { |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
package com.cmsen.ticket.application.util; |
||||
|
|
||||
|
import com.alibaba.fastjson2.JSON; |
||||
|
import com.cmsen.ticket.domain.entity.hly.FormItem; |
||||
|
import com.cmsen.ticket.domain.entity.hly.ReportReceive; |
||||
|
|
||||
|
import java.lang.reflect.Field; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
public class FormFillUtil { |
||||
|
|
||||
|
// value -> ReportReceive真实属性名
|
||||
|
private static final Map<String, String> VALUE_PROP_MAP = new HashMap<>(); |
||||
|
static { |
||||
|
VALUE_PROP_MAP.put("ou1", "ext11"); |
||||
|
VALUE_PROP_MAP.put("ou2", "ext12"); |
||||
|
VALUE_PROP_MAP.put("ou3", "ext13"); |
||||
|
VALUE_PROP_MAP.put("ou4", "ext14"); |
||||
|
VALUE_PROP_MAP.put("ou5", "ext15"); |
||||
|
VALUE_PROP_MAP.put("WBS", "ext17"); |
||||
|
VALUE_PROP_MAP.put("费用期间", "ext18"); |
||||
|
VALUE_PROP_MAP.put("业务描述", "ext19"); |
||||
|
VALUE_PROP_MAP.put("备注", "ext20"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 批量回填defaultValue |
||||
|
*/ |
||||
|
public static String fillDefaultValue(List<FormItem> itemList, ReportReceive receive) { |
||||
|
for (FormItem item : itemList) { |
||||
|
String value = item.getValue(); |
||||
|
String realProp = VALUE_PROP_MAP.get(value); |
||||
|
if (realProp == null) { |
||||
|
continue; // 无映射,跳过不修改
|
||||
|
} |
||||
|
String val = getReceiveFieldValue(receive, realProp); |
||||
|
if (val != null) { |
||||
|
item.setDefaultValue(val); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return JSON.toJSONString(itemList); |
||||
|
} |
||||
|
|
||||
|
// 反射获取ReportReceive指定属性值
|
||||
|
private static String getReceiveFieldValue(ReportReceive receive, String fieldName) { |
||||
|
try { |
||||
|
Field field = ReportReceive.class.getDeclaredField(fieldName); |
||||
|
field.setAccessible(true); |
||||
|
return (String) field.get(receive); |
||||
|
} catch (Exception e) { |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,71 @@ |
|||||
|
//package com.cmsen.ticket.application;
|
||||
|
//
|
||||
|
//import lombok.extern.log4j.Log4j2;
|
||||
|
//import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
//import org.springframework.stereotype.Component;
|
||||
|
//
|
||||
|
//import javax.annotation.Resource;
|
||||
|
//import java.util.HashSet;
|
||||
|
//import java.util.Set;
|
||||
|
//import java.util.concurrent.TimeUnit;
|
||||
|
//
|
||||
|
///**
|
||||
|
// * @author OWTS
|
||||
|
// */
|
||||
|
//@Slf4j
|
||||
|
//@Component
|
||||
|
//public class RedisUtils {
|
||||
|
//
|
||||
|
// public final String KEY_IMAGE = "SCAN_IMAGE:";
|
||||
|
//
|
||||
|
// @Resource
|
||||
|
// private RedisTemplate<String, Object> redisTemplate;
|
||||
|
//
|
||||
|
// public boolean hasKey(String key) {
|
||||
|
// try {
|
||||
|
// return redisTemplate.hasKey(key);
|
||||
|
// } catch (Exception e) {
|
||||
|
// log.error(e.getMessage(), e);
|
||||
|
// return false;
|
||||
|
// }
|
||||
|
// }
|
||||
|
//
|
||||
|
// public void del(String... keys) {
|
||||
|
// if (keys != null && keys.length > 0) {
|
||||
|
// Set<String> keySets = new HashSet<>();
|
||||
|
// for (String key : keys) {
|
||||
|
// keySets.addAll(redisTemplate.keys(key));
|
||||
|
// }
|
||||
|
// redisTemplate.delete(keySets);
|
||||
|
// }
|
||||
|
// }
|
||||
|
//
|
||||
|
// public Object get(String key) {
|
||||
|
// return key == null ? null : redisTemplate.opsForValue().get(key);
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean set(String key, Object value, long time) {
|
||||
|
// try {
|
||||
|
// if (time > 0) {
|
||||
|
// redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
|
||||
|
// } else {
|
||||
|
// set(key, value);
|
||||
|
// }
|
||||
|
// return true;
|
||||
|
// } catch (Exception e) {
|
||||
|
// log.error(e.getMessage(), e);
|
||||
|
// return false;
|
||||
|
// }
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean set(String key, Object value) {
|
||||
|
// try {
|
||||
|
// log.info("Redis put key >> {} >> value >> {}", key, value);
|
||||
|
// redisTemplate.opsForValue().set(key, value);
|
||||
|
// return true;
|
||||
|
// } catch (Exception e) {
|
||||
|
// log.error(e.getMessage(), e);
|
||||
|
// return false;
|
||||
|
// }
|
||||
|
// }
|
||||
|
//}
|
||||
@ -0,0 +1,204 @@ |
|||||
|
package com.cmsen.ticket.bestsign.client; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.cmsen.ticket.bestsign.encrypt.MD5Utils; |
||||
|
import com.cmsen.ticket.bestsign.encrypt.RSAUtils; |
||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import okhttp3.*; |
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Objects; |
||||
|
import java.util.concurrent.TimeUnit; |
||||
|
|
||||
|
/** |
||||
|
* @Auther: xp |
||||
|
* @Date: 2022-07-09 |
||||
|
* @Description: com.jeeplus.modules.contract.bestsign.client |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
public class BestSignClient { |
||||
|
|
||||
|
|
||||
|
private static final MediaType JSON_TYPE = MediaType.parse("application/json; charset=utf-8"); |
||||
|
|
||||
|
|
||||
|
private final ObjectMapper objectMapper = new ObjectMapper(); |
||||
|
|
||||
|
//shared perform best
|
||||
|
private final OkHttpClient okHttpClient = new OkHttpClient |
||||
|
.Builder() |
||||
|
.readTimeout(1, TimeUnit.MINUTES) |
||||
|
.build(); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param uriWithParam 请求的URL和参数 |
||||
|
* @param method HTTP请求动词 |
||||
|
* @param requestData 请求的内容 |
||||
|
* |
||||
|
* @return JSON字符串 |
||||
|
*/ |
||||
|
public String executeRequest(String uriWithParam, String token, String method, Object requestData,Map<String,String> params) { |
||||
|
int retryTime = 3; |
||||
|
while (retryTime > 0) { |
||||
|
Long timestamp = System.currentTimeMillis(); |
||||
|
String urlWithQueryParam = String.format("%s%s", params.get("BS_host"), uriWithParam); |
||||
|
String signTemp = ""; |
||||
|
|
||||
|
try { |
||||
|
//queryToken();
|
||||
|
final String signRSA = signRequest(uriWithParam, timestamp, requestData, params); |
||||
|
signTemp = signRSA; |
||||
|
Headers headers = new Headers |
||||
|
.Builder() |
||||
|
.add("content-type", "application/json") |
||||
|
.add("bestsign-client-id", params.get("BS_clientId")) |
||||
|
.add("bestsign-sign-timestamp", timestamp.toString()) |
||||
|
.add("bestsign-signature-type", "RSA256") |
||||
|
.add("bestsign-signature", signRSA) |
||||
|
.add("Authorization", "bearer " + token) |
||||
|
.build(); |
||||
|
|
||||
|
final Request.Builder requestBuilder = new Request |
||||
|
.Builder() |
||||
|
.url(urlWithQueryParam) |
||||
|
.headers(headers); |
||||
|
|
||||
|
if (Objects.equals(method.toUpperCase(), "GET")) { |
||||
|
requestBuilder.get(); |
||||
|
} else { |
||||
|
final RequestBody requestBody = RequestBody.create(JSON_TYPE, requestData == null ? "" : requestData.toString()); |
||||
|
requestBuilder.method(method.toUpperCase(), requestBody); |
||||
|
} |
||||
|
|
||||
|
final Response response = okHttpClient.newCall(requestBuilder.build()).execute(); |
||||
|
System.out.println("response==={}"+response); |
||||
|
if (response.code() == 401) { |
||||
|
// token失效, 重新获取token
|
||||
|
//invalidToken(token);
|
||||
|
} else if (response.code() == 200) { |
||||
|
if(response.headers().get("Content-Type").equals("application/zip") || response.headers().get("Content-Type").equals("application/pdf")) { |
||||
|
return response.body().string(); |
||||
|
} |
||||
|
return response.body() != null ? response.body().string() : null; |
||||
|
}else{ |
||||
|
System.out.println(timestamp.toString()); |
||||
|
System.out.println(signTemp); |
||||
|
System.out.println(token); |
||||
|
System.out.println(urlWithQueryParam); |
||||
|
System.out.println(params); |
||||
|
} |
||||
|
retryTime--; |
||||
|
} catch (Exception ex) { |
||||
|
retryTime--; |
||||
|
ex.printStackTrace(); |
||||
|
System.out.println(timestamp.toString()); |
||||
|
System.out.println(signTemp); |
||||
|
System.out.println(token); |
||||
|
System.out.println(urlWithQueryParam); |
||||
|
System.out.println(params); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param uriWithParam 请求的URL和参数 |
||||
|
* @param method HTTP请求动词 |
||||
|
* @param requestData 请求的内容 |
||||
|
* |
||||
|
* @return JSON字符串 |
||||
|
*/ |
||||
|
public String executeRequestFile(String uriWithParam, String token, String method, Map<String,String> requestData, Map<String,String> params, List<String> mfiles) { |
||||
|
int retryTime = 3; |
||||
|
while (retryTime > 0) { |
||||
|
Long timestamp = System.currentTimeMillis(); |
||||
|
String urlWithQueryParam = String.format("%s%s", params.get("HLY_host"), uriWithParam); |
||||
|
String signTemp = ""; |
||||
|
|
||||
|
try { |
||||
|
JSONObject json2 = new JSONObject(); |
||||
|
Headers headers = new Headers |
||||
|
.Builder() |
||||
|
.add("content-type", "multipart/form-data") |
||||
|
.add("enctype", "multipart/form-data") |
||||
|
.add("Authorization", "Bearer " + token) |
||||
|
.build(); |
||||
|
|
||||
|
//.build();
|
||||
|
|
||||
|
|
||||
|
//把参数传进Map中
|
||||
|
Map<String,String> paramsMap= requestData; |
||||
|
final MultipartBody.Builder requestBuilder = new MultipartBody.Builder(); |
||||
|
for (String key : paramsMap.keySet()) { |
||||
|
//追加表单信息
|
||||
|
requestBuilder.addFormDataPart(key, paramsMap.get(key)); |
||||
|
} |
||||
|
// 添加文件
|
||||
|
for (String key : mfiles) { |
||||
|
File file = new File(key); |
||||
|
//追加表单信息
|
||||
|
requestBuilder.addFormDataPart("attachments", file.getName(),RequestBody.create(MediaType.parse("multipart/form-data"),file)); |
||||
|
} |
||||
|
//MultipartBody.Builder requestBody = new MultipartBody.Builder()
|
||||
|
requestBuilder.setType(MultipartBody.FORM); |
||||
|
Request request = new Request.Builder() |
||||
|
.headers(headers) |
||||
|
.url(urlWithQueryParam) |
||||
|
.post(requestBuilder.build()) |
||||
|
.build(); |
||||
|
final Response response = okHttpClient.newCall(request).execute(); |
||||
|
log.info("response==={}",response); |
||||
|
if (response.code() == 200) { |
||||
|
|
||||
|
return response.body() != null ? response.body().string() : null; |
||||
|
}else{ |
||||
|
log.info(timestamp.toString()); |
||||
|
log.info(signTemp); |
||||
|
log.info(token); |
||||
|
log.info(urlWithQueryParam); |
||||
|
log.info("请求参数{}",params); |
||||
|
} |
||||
|
retryTime--; |
||||
|
} catch (Exception ex) { |
||||
|
retryTime--; |
||||
|
ex.printStackTrace(); |
||||
|
log.info(timestamp.toString()); |
||||
|
log.info(signTemp); |
||||
|
log.info(token); |
||||
|
log.info(urlWithQueryParam); |
||||
|
log.info("请求参数{}",params); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 数据加密 |
||||
|
* @param uriWithParam |
||||
|
* @param timestamp |
||||
|
* @param requestData |
||||
|
* @param params |
||||
|
* @return |
||||
|
* @throws Exception |
||||
|
*/ |
||||
|
private String signRequest(String uriWithParam, Long timestamp, Object requestData,Map<String,String> params) throws Exception { |
||||
|
String content = String.format( |
||||
|
"bestsign-client-id=%sbestsign-sign-timestamp=%sbestsign-signature-type=%srequest-body=%suri=%s", |
||||
|
params.get("BS_clientId"), |
||||
|
timestamp.toString(), |
||||
|
"RSA256", |
||||
|
MD5Utils.stringMD5(requestData == null ? "" : requestData.toString()), |
||||
|
uriWithParam); |
||||
|
|
||||
|
return RSAUtils.signRSA(content, params.get("BS_privateKey")); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,115 @@ |
|||||
|
package com.cmsen.ticket.bestsign.encrypt; |
||||
|
|
||||
|
import javax.crypto.Cipher; |
||||
|
import javax.crypto.KeyGenerator; |
||||
|
import javax.crypto.SecretKey; |
||||
|
import javax.crypto.spec.SecretKeySpec; |
||||
|
import java.security.Key; |
||||
|
import java.security.NoSuchAlgorithmException; |
||||
|
import java.security.SecureRandom; |
||||
|
|
||||
|
/** |
||||
|
* Created by whthomas on 15/6/23. |
||||
|
*/ |
||||
|
public class AESCoder { |
||||
|
|
||||
|
public static final String KEY_ALGORITHM = "AES"; |
||||
|
|
||||
|
public static final String CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding"; |
||||
|
// public static final String CIPHER_ALGORITHM = "AES";
|
||||
|
|
||||
|
// 转换密钥
|
||||
|
private static Key toKey(byte[] key) { |
||||
|
|
||||
|
KeyGenerator keyGenerator = null; |
||||
|
try { |
||||
|
keyGenerator = KeyGenerator.getInstance(KEY_ALGORITHM); |
||||
|
} catch (NoSuchAlgorithmException ex) { |
||||
|
ex.printStackTrace(); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
SecureRandom secureRandom; |
||||
|
try { |
||||
|
secureRandom = SecureRandom.getInstance("SHA1PRNG"); |
||||
|
} catch (NoSuchAlgorithmException ex) { |
||||
|
ex.printStackTrace(); |
||||
|
return null; |
||||
|
} |
||||
|
secureRandom.setSeed(key); |
||||
|
|
||||
|
keyGenerator.init(128, secureRandom); |
||||
|
|
||||
|
// 实例化DES的材料
|
||||
|
SecretKey secretKey = keyGenerator.generateKey(); |
||||
|
return new SecretKeySpec(secretKey.getEncoded(), KEY_ALGORITHM); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 解密 |
||||
|
*/ |
||||
|
public static byte[] decrypt(byte[] data, byte[] key) { |
||||
|
// 还原密钥
|
||||
|
Key translatedKey = toKey(key); |
||||
|
try { |
||||
|
// 实例化
|
||||
|
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); |
||||
|
// 初始化,设置为解密模式
|
||||
|
cipher.init(Cipher.DECRYPT_MODE, translatedKey); |
||||
|
// 执行操作
|
||||
|
return cipher.doFinal(data); |
||||
|
} catch (Exception ex) { |
||||
|
ex.printStackTrace(); |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static String decryptAsString(byte[] data, byte[] key) { |
||||
|
return new String(decrypt(data, key)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 加密 |
||||
|
*/ |
||||
|
public static byte[] encrypt(byte[] data, byte[] key) { |
||||
|
// 还原密钥
|
||||
|
Key traslatedKey = toKey(key); |
||||
|
try { |
||||
|
// 实例化
|
||||
|
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); |
||||
|
cipher.init(Cipher.ENCRYPT_MODE, traslatedKey); |
||||
|
// 执行操作
|
||||
|
return cipher.doFinal(data); |
||||
|
} catch (Exception ex) { |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 生成密钥 |
||||
|
* |
||||
|
* @return |
||||
|
* @throws Exception |
||||
|
*/ |
||||
|
public static byte[] initKey() { |
||||
|
|
||||
|
// 实例化
|
||||
|
KeyGenerator kg = null; |
||||
|
try { |
||||
|
kg = KeyGenerator.getInstance(KEY_ALGORITHM); |
||||
|
} catch (NoSuchAlgorithmException ex) { |
||||
|
ex.printStackTrace(); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
// 要求密钥长度为256
|
||||
|
kg.init(256); |
||||
|
|
||||
|
// 生成秘密密钥
|
||||
|
SecretKey secretKey = kg.generateKey(); |
||||
|
|
||||
|
// 获得秘密密钥
|
||||
|
return secretKey.getEncoded(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.cmsen.ticket.bestsign.encrypt; |
||||
|
|
||||
|
/** |
||||
|
* @author whthomas |
||||
|
* @date 2018/6/17 |
||||
|
*/ |
||||
|
public class HexUtils { |
||||
|
|
||||
|
private final static char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; |
||||
|
|
||||
|
public static String byteArrayToHex(byte[] byteArray) { |
||||
|
// 首先初始化一个字符数组,用来存放每个16进制字符
|
||||
|
|
||||
|
// new一个字符数组,这个就是用来组成结果字符串的(解释一下:一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方))
|
||||
|
char[] resultCharArray = new char[byteArray.length * 2]; |
||||
|
// 遍历字节数组,通过位运算(位运算效率高),转换成字符放到字符数组中去
|
||||
|
int index = 0; |
||||
|
for (byte b : byteArray) { |
||||
|
resultCharArray[index++] = hexDigits[b >>> 4 & 0xf]; |
||||
|
resultCharArray[index++] = hexDigits[b & 0xf]; |
||||
|
} |
||||
|
// 字符数组组合成字符串返回
|
||||
|
return new String(resultCharArray).toLowerCase(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,52 @@ |
|||||
|
package com.cmsen.ticket.bestsign.encrypt; |
||||
|
|
||||
|
import java.io.UnsupportedEncodingException; |
||||
|
import java.security.MessageDigest; |
||||
|
import java.security.NoSuchAlgorithmException; |
||||
|
|
||||
|
import static com.cmsen.ticket.bestsign.encrypt.HexUtils.byteArrayToHex; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author jozdoo |
||||
|
* @company 杭州尚尚签网络科技有限公司 |
||||
|
* @date 16/8/31 |
||||
|
* @since 3.0 |
||||
|
*/ |
||||
|
public class MD5Utils { |
||||
|
|
||||
|
public static String stringMD5(String input) { |
||||
|
try { |
||||
|
// 拿到一个MD5转换器(如果想要SHA1参数换成”SHA1”)
|
||||
|
MessageDigest messageDigest = MessageDigest.getInstance("MD5"); |
||||
|
// 输入的字符串转换成字节数组
|
||||
|
byte[] inputByteArray = input.getBytes("UTF-8"); |
||||
|
// inputByteArray是输入字符串转换得到的字节数组
|
||||
|
messageDigest.update(inputByteArray); |
||||
|
// 转换并返回结果,也是字节数组,包含16个元素
|
||||
|
byte[] resultByteArray = messageDigest.digest(); |
||||
|
// 字符数组转换成字符串返回
|
||||
|
return byteArrayToHex(resultByteArray); |
||||
|
} catch (NoSuchAlgorithmException e) { |
||||
|
return null; |
||||
|
} catch (UnsupportedEncodingException e) { |
||||
|
throw new IllegalStateException("md5 request body fail. "+input); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static String stringMD5(byte[] inputByteArray) { |
||||
|
try { |
||||
|
// 拿到一个MD5转换器(如果想要SHA1参数换成”SHA1”)
|
||||
|
MessageDigest messageDigest = MessageDigest.getInstance("MD5"); |
||||
|
// inputByteArray是输入字符串转换得到的字节数组
|
||||
|
messageDigest.update(inputByteArray); |
||||
|
// 转换并返回结果,也是字节数组,包含16个元素
|
||||
|
byte[] resultByteArray = messageDigest.digest(); |
||||
|
// 字符数组转换成字符串返回
|
||||
|
return byteArrayToHex(resultByteArray); |
||||
|
} catch (NoSuchAlgorithmException e) { |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,79 @@ |
|||||
|
package com.cmsen.ticket.bestsign.encrypt; |
||||
|
|
||||
|
|
||||
|
import java.io.UnsupportedEncodingException; |
||||
|
import java.net.URLDecoder; |
||||
|
import java.net.URLEncoder; |
||||
|
import java.security.KeyFactory; |
||||
|
import java.security.PublicKey; |
||||
|
import java.security.Signature; |
||||
|
import java.security.spec.PKCS8EncodedKeySpec; |
||||
|
import java.security.spec.X509EncodedKeySpec; |
||||
|
import java.util.Base64; |
||||
|
|
||||
|
public class RSAUtils { |
||||
|
|
||||
|
private static final String SIGNATURE_ALGORITHM = "SHA256withRSA"; |
||||
|
private static final String CHARSET = "utf-8"; |
||||
|
|
||||
|
private static String signSHA256RSA(String input, String privateKey) throws Exception { |
||||
|
|
||||
|
byte[] b1 = Base64.getDecoder().decode(privateKey.getBytes()); |
||||
|
|
||||
|
KeyFactory kf; |
||||
|
try { |
||||
|
kf = KeyFactory.getInstance("RSA"); |
||||
|
|
||||
|
Signature privateSignature = Signature.getInstance(SIGNATURE_ALGORITHM); |
||||
|
|
||||
|
privateSignature.initSign(kf.generatePrivate(new PKCS8EncodedKeySpec(b1))); |
||||
|
|
||||
|
privateSignature.update(input.getBytes("UTF-8")); |
||||
|
|
||||
|
byte[] s = privateSignature.sign(); |
||||
|
//先base64 在urlEncoder
|
||||
|
return URLEncoder.encode(Base64.getEncoder().encodeToString(s), CHARSET); |
||||
|
|
||||
|
} catch (Exception e) { |
||||
|
throw new Exception(e); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public static boolean verifySHA256RSA(byte[] data, String sign, String publicKey) throws Exception { |
||||
|
|
||||
|
try { |
||||
|
|
||||
|
sign = URLDecoder.decode(sign, CHARSET); |
||||
|
KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
||||
|
|
||||
|
PublicKey pubKey = keyFactory |
||||
|
.generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(publicKey.getBytes()))); |
||||
|
|
||||
|
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); |
||||
|
|
||||
|
signature.initVerify(pubKey); |
||||
|
signature.update(data); |
||||
|
|
||||
|
return signature.verify(Base64.getDecoder().decode(sign.getBytes())); |
||||
|
|
||||
|
} catch (Exception e) { // 签名数据失败
|
||||
|
throw new Exception(e); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public static String signRSA(String content, String privateKey) throws Exception { |
||||
|
return signSHA256RSA(content, privateKey); |
||||
|
} |
||||
|
|
||||
|
public static boolean verifySHA256RSA(String data, String sign, String publicKey) throws Exception { |
||||
|
|
||||
|
try { |
||||
|
return verifySHA256RSA(data.getBytes("UTF-8"), sign, publicKey); |
||||
|
} catch (UnsupportedEncodingException e) { |
||||
|
throw new Exception(e); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
package com.cmsen.ticket.bestsign.entity; |
||||
|
|
||||
|
/** |
||||
|
* @Auther: xp |
||||
|
* @Date: 2022-07-08 |
||||
|
* @Description: com.jeeplus.modules.contract.util |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
public class TokenDataPojo { |
||||
|
private String tokenType; |
||||
|
private String accessToken; |
||||
|
private String refreshToken; |
||||
|
private String expiration; |
||||
|
private String expiresIn; |
||||
|
|
||||
|
public String getTokenType() { |
||||
|
return tokenType; |
||||
|
} |
||||
|
|
||||
|
public void setTokenType(String tokenType) { |
||||
|
this.tokenType = tokenType; |
||||
|
} |
||||
|
|
||||
|
public String getAccessToken() { |
||||
|
return accessToken; |
||||
|
} |
||||
|
|
||||
|
public void setAccessToken(String accessToken) { |
||||
|
this.accessToken = accessToken; |
||||
|
} |
||||
|
|
||||
|
public String getRefreshToken() { |
||||
|
return refreshToken; |
||||
|
} |
||||
|
|
||||
|
public void setRefreshToken(String refreshToken) { |
||||
|
this.refreshToken = refreshToken; |
||||
|
} |
||||
|
|
||||
|
public String getExpiration() { |
||||
|
return expiration; |
||||
|
} |
||||
|
|
||||
|
public void setExpiration(String expiration) { |
||||
|
this.expiration = expiration; |
||||
|
} |
||||
|
|
||||
|
public String getExpiresIn() { |
||||
|
return expiresIn; |
||||
|
} |
||||
|
|
||||
|
public void setExpiresIn(String expiresIn) { |
||||
|
this.expiresIn = expiresIn; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,46 @@ |
|||||
|
package com.cmsen.ticket.bestsign.entity; |
||||
|
|
||||
|
/** |
||||
|
* @Auther: xp |
||||
|
* @Date: 2022-07-08 |
||||
|
* @Description: com.jeeplus.modules.contract.util |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
public class TokenPojo { |
||||
|
private String code; |
||||
|
private String message; |
||||
|
private String access_token; |
||||
|
private TokenDataPojo data; |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getMessage() { |
||||
|
return message; |
||||
|
} |
||||
|
|
||||
|
public void setMessage(String message) { |
||||
|
this.message = message; |
||||
|
} |
||||
|
|
||||
|
public TokenDataPojo getData() { |
||||
|
return data; |
||||
|
} |
||||
|
|
||||
|
public void setData(TokenDataPojo data) { |
||||
|
this.data = data; |
||||
|
} |
||||
|
|
||||
|
public String getAccess_token() { |
||||
|
return access_token; |
||||
|
} |
||||
|
|
||||
|
public void setAccess_token(String access_token) { |
||||
|
this.access_token = access_token; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.cmsen.ticket.domain.dto; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
@NoArgsConstructor |
||||
|
public class ScannerInvoiceDto { |
||||
|
|
||||
|
private boolean completed; |
||||
|
private String processStatus; |
||||
|
private Integer totalQty; |
||||
|
private Integer processedQty; |
||||
|
private Object data; |
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
package com.cmsen.ticket.domain.dto; |
||||
|
|
||||
|
import com.cmsen.ticket.domain.response.PageDto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2021/9/9 16:22 |
||||
|
**/ |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@Data |
||||
|
public class SmartImageCheckListSearchDto extends PageDto { |
||||
|
@ApiModelProperty("日期起 yyyy-MM-dd") |
||||
|
private String dateStart; |
||||
|
@ApiModelProperty("日期止 yyyy-MM-dd") |
||||
|
private String dateEnd; |
||||
|
@ApiModelProperty("报告名称") |
||||
|
private String reportName; |
||||
|
@ApiModelProperty("报告ID") |
||||
|
private String reportId; |
||||
|
@ApiModelProperty("组织") |
||||
|
private String organization; |
||||
|
@ApiModelProperty("提交人") |
||||
|
private String submiter; |
||||
|
@ApiModelProperty("处理状态 0 待处理 1 待审核 2 通过 3 已处理 4 驳回 5 关闭") |
||||
|
private Integer processingState; |
||||
|
@ApiModelProperty("单据状态") |
||||
|
private String reportStatus; |
||||
|
|
||||
|
@ApiModelProperty(hidden = true) |
||||
|
private String username; |
||||
|
|
||||
|
@ApiModelProperty("显示全部") |
||||
|
private String showAll;//显示全部:''则不显示,非''则显示全部
|
||||
|
|
||||
|
@ApiModelProperty("policy") |
||||
|
private String policy; |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.cmsen.ticket.domain.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SqlDownloadDto { |
||||
|
private String statement; |
||||
|
private String pageNo; |
||||
|
private String pageSize; |
||||
|
} |
||||
@ -0,0 +1,70 @@ |
|||||
|
package com.cmsen.ticket.domain.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2021/10/27 15:08 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class SupplierMainDataDto { |
||||
|
@ApiModelProperty("标题") |
||||
|
private String bt; |
||||
|
@ApiModelProperty("流程编号") |
||||
|
private String liushuihao; |
||||
|
@ApiModelProperty("Request Id") |
||||
|
private String requestid; |
||||
|
@ApiModelProperty("申请人姓名") |
||||
|
private String shenqingren; |
||||
|
@ApiModelProperty("工号") |
||||
|
private String workcode; |
||||
|
@ApiModelProperty("一级部门") |
||||
|
private String fb; |
||||
|
@ApiModelProperty("二级部门") |
||||
|
private String sshy; |
||||
|
@ApiModelProperty("末级部门") |
||||
|
private String bm; |
||||
|
@ApiModelProperty("所属公司") |
||||
|
private String company; |
||||
|
@ApiModelProperty("供应商名称") |
||||
|
private String fkgongyingsh; |
||||
|
@ApiModelProperty("供应商编号") |
||||
|
private String gysbh; |
||||
|
@ApiModelProperty("发票类型") |
||||
|
private String fplx; |
||||
|
@ApiModelProperty("币种") |
||||
|
private String bizhong; |
||||
|
@ApiModelProperty("操作人") |
||||
|
private String czr; |
||||
|
@ApiModelProperty("workflowid") |
||||
|
private String workflowid; |
||||
|
@ApiModelProperty("流程行") |
||||
|
private List<LineData> processItems; |
||||
|
|
||||
|
|
||||
|
@lombok.Data |
||||
|
public static class LineData { |
||||
|
@ApiModelProperty("日期") |
||||
|
private String fyfsrquser; |
||||
|
@ApiModelProperty("费用类型") |
||||
|
private String fylx; |
||||
|
@ApiModelProperty("付款金额") |
||||
|
private String fkje; |
||||
|
@ApiModelProperty("成本中心") |
||||
|
private String cbzx; |
||||
|
@ApiModelProperty("发票金额") |
||||
|
private String fphsje; |
||||
|
@ApiModelProperty("发票号") |
||||
|
private String fph; |
||||
|
@ApiModelProperty("税额") |
||||
|
private String fpsekdk; |
||||
|
@ApiModelProperty("明细ID") |
||||
|
private String mianid; |
||||
|
@ApiModelProperty("付款理由") |
||||
|
private String fkyybz; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,79 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class AbPolicyItem { |
||||
|
@JsonProperty("id") |
||||
|
private String id; |
||||
|
@JsonProperty("remarks") |
||||
|
private Object remarks; |
||||
|
@JsonProperty("createBy") |
||||
|
private String createBy; |
||||
|
@JsonProperty("createDate") |
||||
|
private String createDate; |
||||
|
@JsonProperty("updateBy") |
||||
|
private String updateBy; |
||||
|
@JsonProperty("updateDate") |
||||
|
private String updateDate; |
||||
|
@JsonProperty("runFlag") |
||||
|
private String runFlag; |
||||
|
@JsonProperty("runBatch") |
||||
|
private String runBatch; |
||||
|
@JsonProperty("policyId") |
||||
|
private String policyId; |
||||
|
@JsonProperty("policyName") |
||||
|
private String policyName; |
||||
|
@JsonProperty("recipientName") |
||||
|
private String recipientName; |
||||
|
@JsonProperty("recipientPosition") |
||||
|
private String recipientPosition; |
||||
|
@JsonProperty("poOrganization") |
||||
|
private String poOrganization; |
||||
|
@JsonProperty("poDesc") |
||||
|
private String poDesc; |
||||
|
@JsonProperty("poReceivedDate") |
||||
|
private String poReceivedDate; |
||||
|
@JsonProperty("offerorName") |
||||
|
private String offerorName; |
||||
|
@JsonProperty("offerorPosition") |
||||
|
private String offerorPosition; |
||||
|
@JsonProperty("poOfferingDate") |
||||
|
private String poOfferingDate; |
||||
|
@JsonProperty("poRecipientPer") |
||||
|
private String poRecipientPer; |
||||
|
@JsonProperty("ownerUrl") |
||||
|
private String ownerUrl; |
||||
|
@JsonProperty("ownerName") |
||||
|
private String ownerName; |
||||
|
@JsonProperty("ownerEmail") |
||||
|
private String ownerEmail; |
||||
|
@JsonProperty("attributer1") |
||||
|
private String attributer1; |
||||
|
@JsonProperty("attributer2") |
||||
|
private String attributer2; |
||||
|
@JsonProperty("attributer3") |
||||
|
private String attributer3; |
||||
|
@JsonProperty("attributer4") |
||||
|
private String attributer4; |
||||
|
@JsonProperty("attributer5") |
||||
|
private String attributer5; |
||||
|
@JsonProperty("attributer6") |
||||
|
private String attributer6; |
||||
|
@JsonProperty("attributer7") |
||||
|
private String attributer7; |
||||
|
@JsonProperty("attributer8") |
||||
|
private String attributer8; |
||||
|
@JsonProperty("attributer9") |
||||
|
private String attributer9; |
||||
|
@JsonProperty("attributer10") |
||||
|
private String attributer10; |
||||
|
@JsonProperty("listItemId") |
||||
|
private String listItemId; |
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 费用科目表 |
||||
|
* @TableName expense_subject |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccountMapping implements Serializable { |
||||
|
/** |
||||
|
* 主键ID |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* 类型 |
||||
|
*/ |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* 借方科目1 |
||||
|
*/ |
||||
|
private String debitAccount1; |
||||
|
|
||||
|
/** |
||||
|
* 贷方科目1 |
||||
|
*/ |
||||
|
private String creditSubject1; |
||||
|
|
||||
|
/** |
||||
|
* 借方科目2 |
||||
|
*/ |
||||
|
private String debitAccount2; |
||||
|
|
||||
|
/** |
||||
|
* 贷方科目2 |
||||
|
*/ |
||||
|
private String creditSubject2; |
||||
|
|
||||
|
/** |
||||
|
* 大类 |
||||
|
*/ |
||||
|
private String category; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 科目 |
||||
|
* @TableName account_object |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccountObject implements Serializable { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* 科目类别 |
||||
|
*/ |
||||
|
private String category; |
||||
|
|
||||
|
/** |
||||
|
* 科目 |
||||
|
*/ |
||||
|
private String account; |
||||
|
|
||||
|
/** |
||||
|
* 描述 |
||||
|
*/ |
||||
|
private String description; |
||||
|
|
||||
|
/** |
||||
|
* 级别 |
||||
|
*/ |
||||
|
private String level; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @TableName account_period |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccountPeriod implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String period; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @TableName app_menu |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppMenu implements Serializable { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
@JsonIgnoreProperties |
||||
|
private Integer id; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String pagePath; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String iconPath; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String selectedIconPath; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String text; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String enText; |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
@JsonIgnoreProperties |
||||
|
private Boolean active; |
||||
|
} |
||||
@ -0,0 +1,70 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* attend_org |
||||
|
* @author |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AttendOrg implements Serializable { |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* 父id |
||||
|
*/ |
||||
|
private Integer pid; |
||||
|
|
||||
|
/** |
||||
|
* 组织CODE |
||||
|
*/ |
||||
|
private String orgCode; |
||||
|
|
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String orgName; |
||||
|
|
||||
|
private String isDel; |
||||
|
|
||||
|
private String ext01; |
||||
|
|
||||
|
private String ext02; |
||||
|
|
||||
|
private String ext03; |
||||
|
|
||||
|
private String ext04; |
||||
|
|
||||
|
private String ext05; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createDate; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updateDate; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2021/11/22 10:54 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BandAreaConfig implements Serializable { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
private Integer id; |
||||
|
private String band; |
||||
|
private String area; |
||||
|
private String hotel; |
||||
|
private String ext01; |
||||
|
private String ext02; |
||||
|
private String ext03; |
||||
|
private String ext04; |
||||
|
private String ext05; |
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelIgnore; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author OWTS |
||||
|
* @version 1.0.0 |
||||
|
* @date 2021/11/22 10:53 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BandConfig implements Serializable { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
@ExcelIgnore |
||||
|
private Integer id; |
||||
|
@ExcelProperty(value = "band", index = 0) |
||||
|
private String bandValue; |
||||
|
@ExcelProperty(value = "area", index = 1) |
||||
|
private String area; |
||||
|
@ExcelProperty(value = "item", index = 2) |
||||
|
private String item; |
||||
|
@ExcelProperty(value = "rate", index = 3) |
||||
|
private String rate; |
||||
|
@ExcelProperty(value = "ext01", index = 4) |
||||
|
private String ext01; |
||||
|
@ExcelProperty(value = "ext02", index = 5) |
||||
|
private String ext02; |
||||
|
@ExcelProperty(value = "ext03", index = 6) |
||||
|
private String ext03; |
||||
|
@ExcelProperty(value = "ext04", index = 7) |
||||
|
private String ext04; |
||||
|
@ExcelProperty(value = "ext05", index = 8) |
||||
|
private String ext05; |
||||
|
@ExcelProperty(value = "ext06", index = 9) |
||||
|
private String ext06; |
||||
|
@ExcelProperty(value = "ext07", index = 10) |
||||
|
private String ext07; |
||||
|
@ExcelProperty(value = "ext08", index = 11) |
||||
|
private String ext08; |
||||
|
@ExcelProperty(value = "ext09", index = 12) |
||||
|
private String ext09; |
||||
|
@ExcelProperty(value = "ext10", index = 13) |
||||
|
private String ext10; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String mileage; |
||||
|
} |
||||
@ -0,0 +1,151 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* bz_customer |
||||
|
* @author |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BzCustomer implements Serializable { |
||||
|
/** |
||||
|
* 表ID,供其他表做外键 |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 主键,客户ID |
||||
|
*/ |
||||
|
private Long customerId; |
||||
|
|
||||
|
/** |
||||
|
* 客户编码 |
||||
|
*/ |
||||
|
private String customerNumber; |
||||
|
|
||||
|
/** |
||||
|
* 客户名称 |
||||
|
*/ |
||||
|
private String customerName; |
||||
|
|
||||
|
/** |
||||
|
* 地址 |
||||
|
*/ |
||||
|
private String billAddress; |
||||
|
|
||||
|
/** |
||||
|
* 开票纳税人识别号 |
||||
|
*/ |
||||
|
private String taxReference; |
||||
|
|
||||
|
/** |
||||
|
* 开票地址 |
||||
|
*/ |
||||
|
private String invoiceAddress; |
||||
|
|
||||
|
/** |
||||
|
* 开票电话 |
||||
|
*/ |
||||
|
private String invoicePhone; |
||||
|
|
||||
|
/** |
||||
|
* 开户行 |
||||
|
*/ |
||||
|
private String bankName; |
||||
|
|
||||
|
/** |
||||
|
* 开户账号 |
||||
|
*/ |
||||
|
private String bankAccountNum; |
||||
|
|
||||
|
/** |
||||
|
* 详细说明 |
||||
|
*/ |
||||
|
private String description; |
||||
|
|
||||
|
/** |
||||
|
* 启用标识 |
||||
|
*/ |
||||
|
private String enabledFlag; |
||||
|
|
||||
|
/** |
||||
|
* 后台处理组ID,供分批、并发控制用 |
||||
|
*/ |
||||
|
private Long processGroupId; |
||||
|
|
||||
|
/** |
||||
|
* 后台处理状态,约定: |
||||
|
PENDING/用户已确认,数据可以导入 |
||||
|
ERROR/出错,数据验证不通过 |
||||
|
COMPLETE/数据已经进入接口,用户不可以修改 |
||||
|
*/ |
||||
|
private String processStatus; |
||||
|
|
||||
|
/** |
||||
|
* 后台处理日期 |
||||
|
*/ |
||||
|
private Date processDate; |
||||
|
|
||||
|
/** |
||||
|
* 后台处理信息 |
||||
|
*/ |
||||
|
private String processMessage; |
||||
|
|
||||
|
/** |
||||
|
* 备注,有条件的话做成多行文本 |
||||
|
*/ |
||||
|
private String comments; |
||||
|
|
||||
|
/** |
||||
|
* 行版本号,用来处理锁 |
||||
|
*/ |
||||
|
private Long rowVersionNumber; |
||||
|
|
||||
|
private Date creationDate; |
||||
|
|
||||
|
private Long createdBy; |
||||
|
|
||||
|
private Long lastUpdatedBy; |
||||
|
|
||||
|
private Date lastUpdateDate; |
||||
|
|
||||
|
private Long lastUpdateLogin; |
||||
|
|
||||
|
private String attributeCategory; |
||||
|
|
||||
|
private String attribute1; |
||||
|
|
||||
|
private String attribute2; |
||||
|
|
||||
|
private String attribute3; |
||||
|
|
||||
|
private String attribute4; |
||||
|
|
||||
|
private String attribute5; |
||||
|
|
||||
|
private String attribute6; |
||||
|
|
||||
|
private String attribute7; |
||||
|
|
||||
|
private String attribute8; |
||||
|
|
||||
|
private String attribute9; |
||||
|
|
||||
|
private String attribute10; |
||||
|
|
||||
|
private String attribute11; |
||||
|
|
||||
|
private String attribute12; |
||||
|
|
||||
|
private String attribute13; |
||||
|
|
||||
|
private String attribute14; |
||||
|
|
||||
|
private String attribute15; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class CheckMessage { |
||||
|
// 是否能提交
|
||||
|
private Boolean submit; |
||||
|
//错误消息集合
|
||||
|
private List<Message> messageList = new ArrayList<>(); |
||||
|
|
||||
|
@Data |
||||
|
public static class Message { |
||||
|
private int level = 1; |
||||
|
private String message; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
@ -0,0 +1,112 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @TableName corp_invoice_receive_header |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CorpInvoiceReceiveHeader implements Serializable { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date dateOfReceipt; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String buyer; |
||||
|
private String buyerCode; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String invoiceType; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String seller; |
||||
|
private String sellerCode; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String invoiceCode; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String invoiceNum; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String invoiceDate; |
||||
|
private String invoiceRemark; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String amountMoney; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String taxAmount; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String totalAmount; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String username; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String oddNum; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String validStatus; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String remarks; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
private List<CorpInvoiceReceiveLine> lines = new ArrayList<>(); |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
private String ticketCode; |
||||
|
private String verifiedCode; |
||||
|
private String imgUrl; |
||||
|
private String sendStatus; |
||||
|
} |
||||
@ -0,0 +1,125 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @TableName corp_invoice_receive_line |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CorpInvoiceReceiveLine implements Serializable { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String unit; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String quantity; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String price; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String total; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String extraFields; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String specification; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String taxRate; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String tax; |
||||
|
|
||||
|
/** |
||||
|
* 抵扣金额 |
||||
|
*/ |
||||
|
private String deductionAmount; |
||||
|
|
||||
|
/** |
||||
|
* 抵扣税率 |
||||
|
*/ |
||||
|
private String deductionTaxRate; |
||||
|
|
||||
|
/** |
||||
|
* 抵扣税额 |
||||
|
*/ |
||||
|
private String deductionTax; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer isDel; |
||||
|
|
||||
|
/** |
||||
|
* 差异 |
||||
|
*/ |
||||
|
private String difference; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String originUnit; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String originQuantity; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String originPrice; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
// public BigDecimal getUnUsedAmount() {
|
||||
|
// if (usedAmount == null) return new BigDecimal(total);
|
||||
|
// return new BigDecimal(total).subtract(usedAmount).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
|
// }
|
||||
|
//
|
||||
|
// public Integer getUnUsedQuantity() {
|
||||
|
// if (usedQuantity == null) return new BigDecimal(quantity).intValue();
|
||||
|
// return new BigDecimal(quantity).intValue() - usedQuantity;
|
||||
|
// }
|
||||
|
|
||||
|
public String getDifference() { |
||||
|
if (difference == null) return total; |
||||
|
if (difference.equals("")) return "0"; |
||||
|
return difference; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,92 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @TableName corp_payment_header |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CorpPaymentHeader implements Serializable { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String businessCompany; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String payNum; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String type; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String currency; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Long amount; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String submitName; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date submitDate; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String status; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String checker; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String costCenter; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String document; |
||||
|
private String vendor; |
||||
|
private String vendorCode; |
||||
|
private String requestId; |
||||
|
private String ext01;//记录workflowId
|
||||
|
private String ext02; |
||||
|
private String ext03; |
||||
|
private String ext04; |
||||
|
private String ext05; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
private List<CorpPaymentLine> payMentLine = new ArrayList<>(); |
||||
|
} |
||||
@ -0,0 +1,74 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @TableName corp_payment_line |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CorpPaymentLine implements Serializable { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String pId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String expenseType; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String invoiceCode; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String invoiceNum; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String invoiceDate; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String tax; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String taxAmount; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String currency; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String amount;//总价
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String received; |
||||
|
private String ext01; |
||||
|
private String ext02; |
||||
|
private String ext03; |
||||
|
private String ext04; |
||||
|
private String ext05; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,422 @@ |
|||||
|
package com.cmsen.ticket.domain.entity; |
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelIgnore; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import com.cmsen.common.http.response.Validation; |
||||
|
import com.cmsen.common.util.StringUtil; |
||||
|
import com.cmsen.ticket.domain.util.StringUtils; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @TableName corporate_invoice |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CorporateInvoice3 implements Serializable { |
||||
|
|
||||
|
@NotNull(message = "required", groups = {Validation.Update.class}) |
||||
|
@ExcelIgnore |
||||
|
private String id; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private Integer orgId; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String title; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private Integer invoiceType; |
||||
|
|
||||
|
@ExcelProperty(value = "发票代码", index = 3) |
||||
|
private String code; |
||||
|
|
||||
|
//供应商代码
|
||||
|
@ExcelIgnore |
||||
|
private String supplierCode; |
||||
|
|
||||
|
@ExcelProperty(value = "发票号码", index = 4) |
||||
|
private String number; |
||||
|
|
||||
|
@ExcelProperty(value = "发票日期", index = 5) |
||||
|
private String date; |
||||
|
|
||||
|
@ExcelProperty(value = "总金额", index = 8) |
||||
|
private String total; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String imgPath; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String extraFields; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String remark; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String loginId; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private Integer isSend; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String entryId; |
||||
|
|
||||
|
@ExcelProperty(value = "更新日期", index = 11) |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date updateDate; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private List<CorporateInvoiceItems> items = new ArrayList<>(); |
||||
|
|
||||
|
@ExcelProperty(value = "销售方", index = 2) |
||||
|
private String seller; |
||||
|
@ExcelIgnore |
||||
|
private String vendor; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String sellerNo; |
||||
|
|
||||
|
@ExcelProperty(value = "购买方", index = 0) |
||||
|
private String buyer; |
||||
|
@ExcelIgnore |
||||
|
private String fullBuyer; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String buyerNo; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String originalFilePath; |
||||
|
|
||||
|
@ExcelProperty(value = "NPO", index = 12) |
||||
|
private String po; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String ticketCode; |
||||
|
|
||||
|
@ExcelProperty(value = "发票类型", index = 1) |
||||
|
private String ticketCodeStr; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String kind; |
||||
|
|
||||
|
/* 0 未处理 1 已处理 2 异常 3 pending */ |
||||
|
@ExcelIgnore |
||||
|
private Integer status; |
||||
|
|
||||
|
/** |
||||
|
* 0 待处理 1 待审核 2 未发送 3 已发送 |
||||
|
*/ |
||||
|
@ExcelIgnore |
||||
|
private Integer matchStatus; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String verifiedCode; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String fileName; |
||||
|
|
||||
|
@ExcelProperty(value = "金额", index = 6) |
||||
|
private String pretaxAmount; |
||||
|
|
||||
|
@ExcelProperty(value = "税额", index = 7) |
||||
|
private String tax; |
||||
|
|
||||
|
// @ExcelProperty(value = "发票内容", index = 13)
|
||||
|
@ExcelIgnore |
||||
|
private String details; |
||||
|
|
||||
|
@ExcelProperty(value = "操作人", index = 9) |
||||
|
private String operator; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private Integer operatorId; |
||||
|
|
||||
|
@ExcelProperty(value = "创建日期", index = 10) |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date createDate; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String currency; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private Integer checked; |
||||
|
|
||||
|
@ExcelProperty(value = "备注", index = 13) |
||||
|
private String desc; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String message; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String showTitle; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String payDate; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private CheckMessage checkResult = new CheckMessage(); |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private List<String> base64 = new ArrayList<>(); |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private List<File> files = new ArrayList<>(); |
||||
|
// New filed added
|
||||
|
|
||||
|
// @ExcelProperty(value = "入账日期", index = 16)
|
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
|
@ExcelIgnore |
||||
|
private Date postingDate; |
||||
|
|
||||
|
// @ExcelProperty(value = "抵扣日期", index = 18)
|
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
|
@ExcelIgnore |
||||
|
private Date deductTime; |
||||
|
|
||||
|
// @ExcelProperty(value = "抵扣状态", index = 17)
|
||||
|
@ExcelIgnore |
||||
|
private String deductStatus; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String downloadUri; |
||||
|
|
||||
|
/** |
||||
|
* 0 未验真 1已验真 |
||||
|
*/ |
||||
|
@ExcelIgnore |
||||
|
private Byte validStatus; |
||||
|
|
||||
|
/** |
||||
|
* 总验真次数 |
||||
|
*/ |
||||
|
@ExcelIgnore |
||||
|
private Integer validCount; |
||||
|
|
||||
|
/** |
||||
|
* 当日验真次数 |
||||
|
*/ |
||||
|
@ExcelIgnore |
||||
|
private Integer validDayCount; |
||||
|
|
||||
|
@ExcelProperty(value = "状态", index = 14) |
||||
|
private String statusStr; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private Integer owner; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String ownerName; |
||||
|
@ExcelIgnore |
||||
|
private String invoiceTypeName; |
||||
|
@ExcelIgnore |
||||
|
private String orgName; |
||||
|
|
||||
|
/** |
||||
|
* 使用状态 0 未使用 1 已使用 2 后票 |
||||
|
*/ |
||||
|
@ExcelIgnore |
||||
|
private Integer useStatus; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private int percent; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private Integer subject; |
||||
|
|
||||
|
// 0 金额 1 数量
|
||||
|
@ExcelIgnore |
||||
|
private Integer matchType; |
||||
|
|
||||
|
// 0 折后 1 折前
|
||||
|
@ExcelIgnore |
||||
|
private Integer priceType; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String period; //增加字段
|
||||
|
@ExcelIgnore |
||||
|
private String received; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String numberBackup; |
||||
|
@ExcelIgnore |
||||
|
private String numberConfirm; |
||||
|
@ExcelIgnore |
||||
|
private String companySeal; |
||||
|
@ExcelIgnore |
||||
|
private String deductionAmount;//抵扣金额
|
||||
|
@ExcelIgnore |
||||
|
private String ext01; |
||||
|
@ExcelIgnore |
||||
|
private String ext02; |
||||
|
@ExcelIgnore |
||||
|
private String ext03; |
||||
|
@ExcelIgnore |
||||
|
private String ext04; |
||||
|
@ExcelIgnore |
||||
|
private String ext05; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String ext06; |
||||
|
@ExcelIgnore |
||||
|
private String ext07; |
||||
|
@ExcelIgnore |
||||
|
private String ext08; |
||||
|
@ExcelIgnore |
||||
|
private String ext09; |
||||
|
@ExcelIgnore |
||||
|
private String ext10; |
||||
|
|
||||
|
@ExcelIgnore |
||||
|
private String different;//差异金额 total - deductionAmount
|
||||
|
@ExcelIgnore |
||||
|
private String taxRate;//税率
|
||||
|
@ExcelIgnore |
||||
|
private String ticketType; |
||||
|
@ExcelIgnore |
||||
|
private String docName; |
||||
|
@ExcelIgnore |
||||
|
private Integer del; |
||||
|
@ExcelProperty(value = "是否删除", index = 15) |
||||
|
private String delStr; |
||||
|
|
||||
|
public String getDelStr(){ |
||||
|
if(del == null) return ""; |
||||
|
switch (del) { |
||||
|
case 0: |
||||
|
return "未删除"; |
||||
|
case 1: |
||||
|
return "已删除"; |
||||
|
default: |
||||
|
return ""; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public static Integer statusStrToNumber(String str) { |
||||
|
if (str == null) return null; |
||||
|
switch (str.toLowerCase()) { |
||||
|
case "已处理": |
||||
|
return 1; |
||||
|
case "异常": |
||||
|
return 2; |
||||
|
case "pending": |
||||
|
return 3; |
||||
|
case "未处理": |
||||
|
return 0; |
||||
|
case "退票": |
||||
|
return 4; |
||||
|
case "暂挂": |
||||
|
return 5; |
||||
|
default: |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public String getDownloadUri() { |
||||
|
if (StringUtil.isNotEmpty(this.originalFilePath)) { |
||||
|
return this.originalFilePath; |
||||
|
} |
||||
|
return this.imgPath; |
||||
|
} |
||||
|
|
||||
|
public String getFileName() { |
||||
|
if (StringUtil.isNotEmpty(this.originalFilePath)) { |
||||
|
return this.number + this.originalFilePath.substring(this.originalFilePath.lastIndexOf(".")); |
||||
|
} |
||||
|
if (StringUtil.isNotEmpty(this.imgPath)) { |
||||
|
return this.number + this.imgPath.substring(this.imgPath.lastIndexOf(".")); |
||||
|
} |
||||
|
return "null"; |
||||
|
} |
||||
|
|
||||
|
public String getShowTitle() { |
||||
|
return this.message; |
||||
|
} |
||||
|
|
||||
|
public String getDeductStatus() { |
||||
|
return StringUtil.isEmpty(deductStatus) ? "未抵扣" : deductStatus; |
||||
|
} |
||||
|
|
||||
|
// public String getTicketCodeStr() {
|
||||
|
// if (ticketCode == null) return "";
|
||||
|
// switch (ticketCode) {
|
||||
|
// case "10101":s
|
||||
|
// return "增值税普通发票";
|
||||
|
// case "10100":
|
||||
|
// return "增值税专用发票";
|
||||
|
// case "10107":
|
||||
|
// return "增值税电子专用发票";
|
||||
|
// case "10102":
|
||||
|
// return "增值税电子普通发票";
|
||||
|
// case "30100":
|
||||
|
// return "形式发票";
|
||||
|
// case "30101":
|
||||
|
// return "收据";
|
||||
|
// default:
|
||||
|
// return "";
|
||||
|
// }
|
||||
|
// }
|
||||
|
|
||||
|
public String getStatusStr() { |
||||
|
if (status == null) return ""; |
||||
|
switch (status) { |
||||
|
case 1: |
||||
|
return "已处理"; |
||||
|
case 2: |
||||
|
return "异常"; |
||||
|
case 3: |
||||
|
return "Pending"; |
||||
|
case 0: |
||||
|
return "未处理"; |
||||
|
case 4: |
||||
|
return "退票"; |
||||
|
case 5: |
||||
|
return "暂挂"; |
||||
|
default: |
||||
|
return ""; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public String getImgPath() { |
||||
|
return imgPath == null ? null : StringUtils.formatUrl(imgPath, "/"); |
||||
|
} |
||||
|
|
||||
|
public void setImgPath(String imgPath) { |
||||
|
this.imgPath = imgPath == null ? null : StringUtils.formatUrl(imgPath, "/"); |
||||
|
} |
||||
|
|
||||
|
public String getOriginalFilePath() { |
||||
|
return originalFilePath == null ? null : StringUtils.formatUrl(originalFilePath, "/"); |
||||
|
} |
||||
|
|
||||
|
public void setOriginalFilePath(String originalFilePath) { |
||||
|
this.originalFilePath = originalFilePath == null ? null : StringUtils.formatUrl(originalFilePath, "/"); |
||||
|
} |
||||
|
|
||||
|
public String getSeller() { |
||||
|
return StringUtils.getStringWithOutSpecialCode2(seller); |
||||
|
} |
||||
|
|
||||
|
public void setSeller(String seller) { |
||||
|
this.seller = StringUtils.getStringWithOutSpecialCode2(seller); |
||||
|
} |
||||
|
|
||||
|
public String getBuyer() { |
||||
|
return StringUtils.getStringWithOutSpecialCode2(buyer); |
||||
|
} |
||||
|
|
||||
|
public void setBuyer(String buyer) { |
||||
|
this.buyer = StringUtils.getStringWithOutSpecialCode2(buyer); |
||||
|
} |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue