ruoyi-admin/src/main/java/com/ruoyi/web/controller/enums/PersonType.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,47 @@ package com.ruoyi.web.controller.enums; import com.ruoyi.common.enums.OrganEnum; /** * ç¨æ·ç±»å * * @author ls */ public enum PersonType { OTHER("0", "å ¶ä»äººå"), PROFESSIONAL("1", "ä¸è人å"), COORDINATOR("2", "åè°å"), EXPERT("3","ä¸å®¶"), KIN("4","å®¶å±"); private final String code; private final String info; PersonType(String code, String info) { this.code = code; this.info = info; } public String getCode() { return code; } public String getInfo() { return info; } public static String getInfoByCode(String code) { PersonType[] personTypes = values(); for (int i = 0; i < personTypes.length; i++) { PersonType personType = personTypes[i]; if (personType.getCode().equals(code)) { return personType.getInfo(); } } return null; } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -23,11 +23,13 @@ import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut; import com.ruoyi.project.service.*; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.web.controller.enums.PersonType; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang.StringUtils; import org.apache.ibatis.annotations.Options; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,20 +39,19 @@ import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; /** * æ¥éç³è¯·Controller * * * @author ruoyi * @date 2022-01-24 */ @Api("æ¥éç³è¯·") @RestController @RequestMapping("/project/reimbursement") public class ServiceReimbursementController extends BaseController { public class ServiceReimbursementController extends BaseController { @Autowired private IServiceReimbursementService serviceReimbursementService; @@ -73,13 +74,15 @@ private IServiceSystemmessageService ServiceSystemmessage; private static Configuration configuration = null; public ServiceReimbursementController() { configuration = new Configuration(); configuration.setDefaultEncoding("utf-8"); } static String cashUnitLeft[] = { "å ", "æ¾", "ä½°", "ä»", "ä¸", "æ¾", "ä½°", "ä»","亿", "æ¾", "ä½°", "ä»", "ä¸" }; static String cashUnitRight[] = { "è§", "å", "å" }; static String upperNumber[] = { "é¶", "壹", "è´°", "å", "è", "ä¼", "é", "æ","æ", "ç" }; static String cashUnitLeft[] = {"å ", "æ¾", "ä½°", "ä»", "ä¸", "æ¾", "ä½°", "ä»", "亿", "æ¾", "ä½°", "ä»", "ä¸"}; static String cashUnitRight[] = {"è§", "å", "å"}; static String upperNumber[] = {"é¶", "壹", "è´°", "å", "è", "ä¼", "é", "æ", "æ", "ç"}; /** * æ¥è¯¢æ¥éç³è¯·å表 @@ -88,8 +91,7 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:list')") @Log(title = "æ¥è¯¢æ¥éç³è¯·å表", businessType = BusinessType.OTHER) @GetMapping("/list") public TableDataInfo list(ServiceReimbursement serviceReimbursement) { public TableDataInfo list(ServiceReimbursement serviceReimbursement) { SysUser user = SecurityUtils.getLoginUser().getUser(); serviceReimbursement.setCreateBy(user.getUserName()); startPage(); @@ -102,8 +104,7 @@ */ @ApiOperation("æ ¹æ®æ¥ææ¥è¯¢æ¥éç³è¯·å表") @GetMapping("/listWithDate") public TableDataInfo listWithDate(ServiceReimbursementDto serviceReimbursementdto) { public TableDataInfo listWithDate(ServiceReimbursementDto serviceReimbursementdto) { startPage(); List<ServiceReimbursement> list = serviceReimbursementService.selectSearchList(serviceReimbursementdto); return getDataTable(list); @@ -115,45 +116,39 @@ @ApiOperation("æ ¹æ®æéæ¾ç¤ºå®¡æ ¸å表") @Log(title = "æ ¹æ®æéæ¾ç¤ºå®¡æ ¸å表", businessType = BusinessType.OTHER) @GetMapping("/listbypower") public TableDataInfo getListBypower(SpFinancialExpensesIn spFinancialExpensesIn) { public TableDataInfo getListBypower(SpFinancialExpensesIn spFinancialExpensesIn) { LoginUser loginUser = getLoginUser(); String APPLICANT=spFinancialExpensesIn.getAPPLICANT(); String APPLICATIONBEGTIME=spFinancialExpensesIn.getAPPLICATIONBEGTIME(); String APPLICATIONENDTIME=spFinancialExpensesIn.getAPPLICATIONENDTIME(); Integer CHECKFLAG=spFinancialExpensesIn.getCHECKFLAG(); Integer APPLYTYPE=spFinancialExpensesIn.getAPPLYTYPE(); Integer pageNum=spFinancialExpensesIn.getPageNum(); Integer pageSize=spFinancialExpensesIn.getPageSize(); String APPLICANT = spFinancialExpensesIn.getAPPLICANT(); String APPLICATIONBEGTIME = spFinancialExpensesIn.getAPPLICATIONBEGTIME(); String APPLICATIONENDTIME = spFinancialExpensesIn.getAPPLICATIONENDTIME(); Integer CHECKFLAG = spFinancialExpensesIn.getCHECKFLAG(); Integer APPLYTYPE = spFinancialExpensesIn.getAPPLYTYPE(); Integer pageNum = spFinancialExpensesIn.getPageNum(); Integer pageSize = spFinancialExpensesIn.getPageSize(); if(pageNum==null) { pageNum=1; if (pageNum == null) { pageNum = 1; } if(pageSize==null) { pageSize=10; if (pageSize == null) { pageSize = 10; } if(APPLICANT==null) { APPLICANT=""; if (APPLICANT == null) { APPLICANT = ""; } if(APPLICATIONBEGTIME==null) { APPLICATIONBEGTIME=""; if (APPLICATIONBEGTIME == null) { APPLICATIONBEGTIME = ""; } if(APPLICATIONENDTIME==null) { APPLICATIONENDTIME=""; if (APPLICATIONENDTIME == null) { APPLICATIONENDTIME = ""; } //startPage(); List<SpFinancialExpensesReimbursementOut> list = serviceReimbursementService.getListBypower(loginUser.getUsername(),1,APPLICANT,APPLICATIONBEGTIME,APPLICATIONENDTIME,loginUser.getDeptId().toString(),CHECKFLAG,APPLYTYPE); return getCustomDataTable(list,pageNum,pageSize); List<SpFinancialExpensesReimbursementOut> list = serviceReimbursementService.getListBypower(loginUser.getUsername(), 1, APPLICANT, APPLICATIONBEGTIME, APPLICATIONENDTIME, loginUser.getDeptId().toString(), CHECKFLAG, APPLYTYPE); return getCustomDataTable(list, pageNum, pageSize); } /** @@ -163,8 +158,7 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:export')") @Log(title = "æ¥éç³è¯·", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ServiceReimbursement serviceReimbursement) { public AjaxResult export(ServiceReimbursement serviceReimbursement) { List<ServiceReimbursement> list = serviceReimbursementService.queryList(serviceReimbursement); ExcelUtil<ServiceReimbursement> util = new ExcelUtil<ServiceReimbursement>(ServiceReimbursement.class); return util.exportExcel(list, "æ¥éç³è¯·æ°æ®"); @@ -176,18 +170,17 @@ @ApiOperation("è·åæ¥éç³è¯·è¯¦ç»ä¿¡æ¯") //@PreAuthorize("@ss.hasPermi('project:reimbursement:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceReimbursementService.getById(id)); } @GetMapping("/getMaxId") public AjaxResult getMaxId(){ public AjaxResult getMaxId() { return AjaxResult.success(serviceReimbursementService.getMaxId()); } @GetMapping("/getRBDetailList/{id}") public AjaxResult getRBDetailList(@PathVariable("id") Long id){ public AjaxResult getRBDetailList(@PathVariable("id") Long id) { return AjaxResult.success(serviceReimbursementService.getRBDetailList(id)); } @@ -200,32 +193,27 @@ @PostMapping @RepeatSubmit @Options(useGeneratedKeys = true, keyProperty = "id") public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement) { public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement) { boolean b = serviceReimbursementService.save(serviceReimbursement); if(b) { addReiSharedDatd(serviceReimbursement,1); if (b) { addReiSharedDatd(serviceReimbursement, 1); } Long id = serviceReimbursement.getId(); return AjaxResult.success(id); } public int addReiSharedDatd(ServiceReimbursement serviceReimbursement,int nType) { public int addReiSharedDatd(ServiceReimbursement serviceReimbursement, int nType) { //remShare = ; ServiceReimbursementShared remShare = null; if(nType == 1) { if (nType == 1) { remShare = new ServiceReimbursementShared(); remShare.setReimid(serviceReimbursement.getId()); } else //modify } else //modify { List<ServiceReimbursementShared> remlist = serviceReimbursementServiceShare.getRemShareInfoByRemId(serviceReimbursement.getId()); if(remlist!=null) remShare =remlist.get(0); if (remlist != null) remShare = remlist.get(0); } remShare.setUserno(serviceReimbursement.getUserno()); @@ -240,14 +228,14 @@ remShare.setAnnexbankcard(serviceReimbursement.getAnnexbankcard()); remShare.setAnnexfiles(serviceReimbursement.getAnnexfiles()); //remShare.setAnnexfiles(serviceReimbursement.getAnnexfiles()); // remShare.setAmountrequested(BigDecimal.valueOf(serviceReimbursement.getAmountrequested())); // remShare.setAmountrequested(BigDecimal.valueOf(serviceReimbursement.getAmountrequested())); Double nTemp = serviceReimbursement.getAmountrequested(); if( nTemp == null) nTemp = 0d; if (nTemp == null) nTemp = 0d; remShare.setAmountrequested(BigDecimal.valueOf(nTemp)); nTemp = serviceReimbursement.getPrepaidamount(); if(nTemp == null) nTemp = 0.0; if (nTemp == null) nTemp = 0.0; remShare.setPrepaidamount(BigDecimal.valueOf(nTemp)); remShare.setInvoicecount(serviceReimbursement.getInvoicecount()); @@ -272,7 +260,7 @@ remShare.setUploadtime(serviceReimbursement.getUploadtime()); nTemp = serviceReimbursement.getTotalamount(); if(nTemp == null) nTemp = 0.0; if (nTemp == null) nTemp = 0.0; remShare.setTotalamount(BigDecimal.valueOf(nTemp)); remShare.setBigstrmoney(serviceReimbursement.getBigstrmoney()); @@ -285,19 +273,16 @@ remShare.setDonorremark(serviceReimbursement.getDonorremark()); nTemp = serviceReimbursement.getDonoramount(); if(nTemp == null) nTemp = 0.0; if (nTemp == null) nTemp = 0.0; remShare.setDonoramount(nTemp); remShare.setDonorrelatives(serviceReimbursement.getDonorrelatives()); //remShare.setOaid(serviceReimbursement.getOaid()); //remShare.setDonorno(serviceReimbursement.getDonorno()); boolean bRet = false; if(nType==1) { if (nType == 1) { bRet = serviceReimbursementServiceShare.save(remShare); } else { } else { //remShare.setId(serviceReimbursement.); bRet = serviceReimbursementServiceShare.updateById(remShare); } @@ -305,43 +290,39 @@ //if(!bRet) return -1; String strMutfileUrl = remShare.getFileurl(); //æéä»¶æ¶æè°ç¨ç¬¬ä¸æ¹è¿è¡ä¸ä¼ if(strMutfileUrl == null) return 0; if(strMutfileUrl.isEmpty()) return 0; if (strMutfileUrl == null) return 0; if (strMutfileUrl.isEmpty()) return 0; try { try { uploadOAFileAndUpdateDb(remShare); } catch (Exception e) { } catch (Exception e) { logger.error("è°ç¨ç¬¬ä¸æ¹æ¥å£åºé!"); e.printStackTrace(); } //æ¤å¤ä¿åæååè¦ä¸ä¼ OAï¼ä¿åè¿åå¼ return 0; return 0; } int uploadOAFileAndUpdateDb(ServiceReimbursementShared remShare) { //ä¸ä¼ OAæä»¶ int uploadOAFileAndUpdateDb(ServiceReimbursementShared remShare) { //ä¸ä¼ OAæä»¶ //String strUrl = "http://129.88.242.39:8899/seeyon/rest/token?userName=opo&password=127814f8-84e8-4304-84a5-a71573567efd&loginName=demo3"; String strUrl = "http://129.88.242.39:8899/seeyon/rest/token"; //String strUrl = "http://slb.hospitalstar.com:8899/seeyon/rest/token"; //ä¸ä¼ æä»¶æååï¼å»æ´æ°ç¸å ³çæ°æ®åº //ä¸ä¼ æä»¶æååï¼å»æ´æ°ç¸å ³çæ°æ®åº Map<String, Object> map = new HashMap<String, Object>(); map.put("userName","opo"); map.put("password","4126407a-9821-4874-be41-6568abd6dbe5"); map.put("loginName","demo3"); map.put("userName", "opo"); map.put("password", "4126407a-9821-4874-be41-6568abd6dbe5"); map.put("loginName", "demo3"); JSONObject jsonObj = new JSONObject(map); JSONObject jsonObj = new JSONObject(map); System.out.println("uploadOAFileAndUpdateDb + jsonObject"+jsonObj.toString() + "\r\n" + jsonObj.toJSONString()); String strRes = HttpClientKit.postOpr(strUrl,jsonObj.toString());// System.out.println("uploadOAFileAndUpdateDb + jsonObject" + jsonObj.toString() + "\r\n" + jsonObj.toJSONString()); String strRes = HttpClientKit.postOpr(strUrl, jsonObj.toString());// //String strRes = HttpClientKit.postMsg(strUrl,jsonObj);//å¾å°è¿åçtoken? JSONObject json1 = JSONObject.parseObject(strRes); @@ -351,10 +332,10 @@ //ä¸é¢éæ±è°ç¨æä»¶çæ¥å£ï¼è°ç¨æåè¿ååï¼å¾å°filenameåfileid ç¨è¿äºä¸ªå¼å»æ´æ°æ°æ® String filePath = RuoYiConfig.getUploadPath(); String strMutfileUrl = remShare.getFileurl();//å¯è½åå¨å¤ä¸ªå°åï¼ä»¥,åå¼ String filePath = RuoYiConfig.getUploadPath(); String strMutfileUrl = remShare.getFileurl();//å¯è½åå¨å¤ä¸ªå°åï¼ä»¥,åå¼ String strFUrl = "http://129.88.242.39:8899/seeyon/rest/attachment?token="+strRes; String strFUrl = "http://129.88.242.39:8899/seeyon/rest/attachment?token=" + strRes; //String strFUrl = "http://slb.hospitalstar.com:8899/seeyon/rest/attachment?token="+strRes; //strFUrl = String.format(strFUrl, strRes); @@ -372,20 +353,16 @@ String fileid = ""; String[] urlArray = strMutfileUrl.split(","); for (int i = 0; i < urlArray.length; i++) { for (int i = 0; i < urlArray.length; i++) { String strOneFileName = urlArray[i]; String strTemp = strOneFileName.substring(15); String strFile = filePath + strTemp ; String strFile = filePath + strTemp; //FileUploadUtils.getAbsoluteFile(filePath,strOneFileName); String struploadResult = ""; File filetest = new File(strFile); try { struploadResult = HttpClientKit.sendPostWithFile(filetest,strFUrl); } catch (Exception e) { try { struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl); } catch (Exception e) { e.printStackTrace(); } @@ -421,34 +398,32 @@ }*/ //String strFRes = HttpClientKit.postMsg(strFUrl,jsonFObj); if(struploadResult == null) return 0; if(struploadResult.isEmpty()) return 0; if (struploadResult == null) return 0; if (struploadResult.isEmpty()) return 0; JSONObject jsonR = JSONObject.parseObject(struploadResult); JSONArray jsonArr = jsonR.getJSONArray("atts"); for(int j=0;j<jsonArr.size();j++) { for (int j = 0; j < jsonArr.size(); j++) { JSONObject jsonRet = jsonArr.getJSONObject(j); String name1= jsonRet.get("filename").toString(); String name1 = jsonRet.get("filename").toString(); String id1 = jsonRet.get("fileUrl").toString(); filename+=name1; fileid+=id1; if(i!=urlArray.length-1) { filename+=","; fileid+=","; filename += name1; fileid += id1; if (i != urlArray.length - 1) { filename += ","; fileid += ","; } } } long nId = remShare.getId(); remShare.setId(nId); remShare.setFilename(filename); remShare.setFileid(fileid); boolean bRet = serviceReimbursementServiceShare.updateById(remShare); if(!bRet) return -1; long nId = remShare.getId(); remShare.setId(nId); remShare.setFilename(filename); remShare.setFileid(fileid); boolean bRet = serviceReimbursementServiceShare.updateById(remShare); if (!bRet) return -1; return 0; } @@ -459,28 +434,23 @@ @ApiOperation("å·®æ è´¹ä¸æ¥") @Log(title = "å·®æ è´¹ä¸æ¥", businessType = BusinessType.OTHER) @PostMapping("/travelexpensereport") public AjaxResult travelexpensereport(@RequestBody CheckFundVO checkFundVO) { ServiceReimbursement serviceReimbursement= serviceReimbursementService.getById(checkFundVO.getFundid()); if(serviceReimbursement!=null) { Integer TotalLevel=0; public AjaxResult travelexpensereport(@RequestBody CheckFundVO checkFundVO) { ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(checkFundVO.getFundid()); if (serviceReimbursement != null) { Integer TotalLevel = 0; LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); List<Integer> postids =postService.selectPostListByUserId(loginUser.getUserId()); List<Integer> postids = postService.selectPostListByUserId(loginUser.getUserId()); if(!postids.contains(2)) { if (!postids.contains(2)) { serviceReimbursement.setFlowlevel(1L); serviceReimbursement.setRecordstatus(2); } else { } else { serviceReimbursement.setFlowlevel(0L); serviceReimbursement.setRecordstatus(0); } if(!postids.contains(2)) { if (!postids.contains(2)) { ServiceFundflow serviceFundflow = new ServiceFundflow(); serviceFundflow.setFundid(serviceReimbursement.getId()); serviceFundflow.setCheckuserno(user.getUserName()); @@ -496,10 +466,8 @@ serviceReimbursementService.updateById(serviceReimbursement); return AjaxResult.success(); } else { return AjaxResult.error(HttpStatus.NO_CONTENT,"è´¹ç¨ç¼å·ä¸æ£ç¡®"); } else { return AjaxResult.error(HttpStatus.NO_CONTENT, "è´¹ç¨ç¼å·ä¸æ£ç¡®"); } } @@ -510,72 +478,57 @@ @ApiOperation("å®¡æ ¸è´¹ç¨") @Log(title = "å®¡æ ¸è´¹ç¨", businessType = BusinessType.OTHER) @PostMapping("/checkfund") public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO) { ServiceReimbursement serviceReimbursement= serviceReimbursementService.getById(checkFundVO.getFundid()); if(serviceReimbursement!=null) { Integer TotalLevel=0; public AjaxResult checkFund(@RequestBody CheckFundVO checkFundVO) { ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(checkFundVO.getFundid()); if (serviceReimbursement != null) { Integer TotalLevel = 0; LoginUser loginUser = getLoginUser(); ServiceFundflowrule serviceFundflowrule=new ServiceFundflowrule(); ServiceFundflowrule serviceFundflowrule = new ServiceFundflowrule(); serviceFundflowrule.setFundtype(1); serviceFundflowrule.setApplytype("0"); serviceFundflowrule.setCheckuserno(loginUser.getUsername()); List<ServiceFundflowrule> serviceFundflowrules= serviceFundflowruleService.queryList(serviceFundflowrule); List<ServiceFundflowrule> serviceFundflowrules = serviceFundflowruleService.queryList(serviceFundflowrule); if(serviceFundflowrules==null || serviceFundflowrules.stream().count()==0) { return AjaxResult.error(HttpStatus.ERROR,"å½åäººåæ æ¤è®°å½å®¡æ ¸æé"); if (serviceFundflowrules == null || serviceFundflowrules.stream().count() == 0) { return AjaxResult.error(HttpStatus.ERROR, "å½åäººåæ æ¤è®°å½å®¡æ ¸æé"); } if(serviceFundflowrules.get(0).getFlowlevel()-1!=serviceReimbursement.getFlowlevel()) { return AjaxResult.error(HttpStatus.ERROR,"å½å人å䏿¤è®°å½çå®¡æ ¸çº§å«ä¸ç¬¦"); if (serviceFundflowrules.get(0).getFlowlevel() - 1 != serviceReimbursement.getFlowlevel()) { return AjaxResult.error(HttpStatus.ERROR, "å½å人å䏿¤è®°å½çå®¡æ ¸çº§å«ä¸ç¬¦"); } if(serviceFundflowrules!=null && serviceFundflowrules.stream().count()>0) { TotalLevel=serviceFundflowrules.get(0).getTotallevel(); if (serviceFundflowrules != null && serviceFundflowrules.stream().count() > 0) { TotalLevel = serviceFundflowrules.get(0).getTotallevel(); } Integer CheckFlag=0; Integer CheckFlag = 0; Integer RecordStatus = serviceReimbursement.getRecordstatus(); Integer FlowLevel = Integer.valueOf(serviceReimbursement.getFlowlevel().toString()); Integer OriginalFlowLevel=FlowLevel; if(checkFundVO.getFlowconclusion()==1) { CheckFlag=1; if(TotalLevel==0) { RecordStatus=99; } else { if(TotalLevel==FlowLevel+1) { RecordStatus=99; } else { RecordStatus = (FlowLevel+1)*2; Integer OriginalFlowLevel = FlowLevel; if (checkFundVO.getFlowconclusion() == 1) { CheckFlag = 1; if (TotalLevel == 0) { RecordStatus = 99; } else { if (TotalLevel == FlowLevel + 1) { RecordStatus = 99; } else { RecordStatus = (FlowLevel + 1) * 2; } } FlowLevel=FlowLevel+1; } else { CheckFlag=2; RecordStatus = (FlowLevel+1)*2 - 1; FlowLevel=(FlowLevel-1); if(FlowLevel<0) { FlowLevel=0; FlowLevel = FlowLevel + 1; } else { CheckFlag = 2; RecordStatus = (FlowLevel + 1) * 2 - 1; FlowLevel = (FlowLevel - 1); if (FlowLevel < 0) { FlowLevel = 0; } } serviceReimbursement.setRecordstatus(RecordStatus); serviceReimbursement.setFlowlevel(Long.valueOf(FlowLevel.toString())); ServiceFundflow serviceFundflow=new ServiceFundflow(); ServiceFundflow serviceFundflow = new ServiceFundflow(); SysUser user = loginUser.getUser(); serviceFundflow.setFundid(serviceReimbursement.getId()); serviceFundflow.setCheckuserno(user.getUserName()); @@ -584,16 +537,14 @@ serviceFundflow.setApplytype("0"); serviceFundflow.setFlowconclusion(CheckFlag); serviceFundflow.setFlowcontent(checkFundVO.getFlowcontent()); serviceFundflow.setFlowlevel(OriginalFlowLevel+1); serviceFundflow.setFlowlevel(OriginalFlowLevel + 1); serviceFundflowService.save(serviceFundflow); List<Integer> postids =postService.selectPostListByUserId(loginUser.getUserId()); List<Integer> postids = postService.selectPostListByUserId(loginUser.getUserId()); if(!postids.contains(2)) { if(CheckFlag==2 && OriginalFlowLevel==1) { ServiceFundflow serviceFundflowAuto=new ServiceFundflow(); if (!postids.contains(2)) { if (CheckFlag == 2 && OriginalFlowLevel == 1) { ServiceFundflow serviceFundflowAuto = new ServiceFundflow(); serviceFundflowAuto.setFundid(serviceReimbursement.getId()); serviceFundflowAuto.setCheckuserno(user.getUserName()); serviceFundflowAuto.setCheckusername(user.getNickName()); @@ -610,7 +561,7 @@ serviceReimbursementService.updateById(serviceReimbursement); ServiceSystemmessage serviceSystemmessage=new ServiceSystemmessage(); ServiceSystemmessage serviceSystemmessage = new ServiceSystemmessage(); serviceSystemmessage.setFundtype(1); serviceSystemmessage.setApplytype("0"); serviceSystemmessage.setSenduserno(user.getUserName()); @@ -620,26 +571,21 @@ serviceSystemmessage.setIsread(0); serviceSystemmessage.setMessagetype(1); serviceSystemmessage.setRelevantno(serviceReimbursement.getId()); if(CheckFlag==1) { if (CheckFlag == 1) { //éè¿ serviceSystemmessage.setMessagetitle(""+(OriginalFlowLevel+1)+"çº§å®¡æ ¸éè¿"); serviceSystemmessage.setMessagecontent("æ¨"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime())+"æäº¤çå ³äºæç®æ¡ä¾ã"+serviceReimbursement.getDonorname()+"ãçå·®æ è´¹ç³è¯·å·²éè¿"+(OriginalFlowLevel+1)+"çº§å®¡æ ¸"); serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "çº§å®¡æ ¸éè¿"); serviceSystemmessage.setMessagecontent("æ¨" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime()) + "æäº¤çå ³äºæç®æ¡ä¾ã" + serviceReimbursement.getDonorname() + "ãçå·®æ è´¹ç³è¯·å·²éè¿" + (OriginalFlowLevel + 1) + "çº§å®¡æ ¸"); } else { } else { //驳å serviceSystemmessage.setMessagetitle(""+(OriginalFlowLevel+1)+"çº§å®¡æ ¸é©³å"); serviceSystemmessage.setMessagecontent("æ¨"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime())+"æäº¤çå ³äºæç®æ¡ä¾ã"+serviceReimbursement.getDonorname()+"ãçå·®æ è´¹ç³è¯·å·²è¢«"+(OriginalFlowLevel+1)+"çº§å®¡æ ¸é©³åï¼åå 为"+checkFundVO.getFlowcontent()+""); serviceSystemmessage.setMessagetitle("" + (OriginalFlowLevel + 1) + "çº§å®¡æ ¸é©³å"); serviceSystemmessage.setMessagecontent("æ¨" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(serviceReimbursement.getCreateTime()) + "æäº¤çå ³äºæç®æ¡ä¾ã" + serviceReimbursement.getDonorname() + "ãçå·®æ è´¹ç³è¯·å·²è¢«" + (OriginalFlowLevel + 1) + "çº§å®¡æ ¸é©³åï¼åå 为" + checkFundVO.getFlowcontent() + ""); } ServiceSystemmessage.save(serviceSystemmessage); return AjaxResult.success(); } else { return AjaxResult.error(HttpStatus.NO_CONTENT,"è´¹ç¨ç¼å·ä¸æ£ç¡®"); } else { return AjaxResult.error(HttpStatus.NO_CONTENT, "è´¹ç¨ç¼å·ä¸æ£ç¡®"); } } @@ -651,13 +597,11 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:edit')") @Log(title = "æ¥éç³è¯·", businessType = BusinessType.UPDATE) @PutMapping @RepeatSubmit public AjaxResult edit(@RequestBody ServiceReimbursement serviceReimbursement) { boolean b= serviceReimbursementService.updateById(serviceReimbursement); if(b) { addReiSharedDatd(serviceReimbursement,2); @RepeatSubmit public AjaxResult edit(@RequestBody ServiceReimbursement serviceReimbursement) { boolean b = serviceReimbursementService.updateById(serviceReimbursement); if (b) { addReiSharedDatd(serviceReimbursement, 2); } return toAjax(b); } @@ -669,12 +613,10 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:edit')") @Log(title = "å®¡æ ¸è´¹ç¨", businessType = BusinessType.OTHER) @PostMapping("/editMoney") public AjaxResult editMoney(@RequestBody List<ReimbursementService> serviceReimbursement) { boolean b= serviceReimbursementService.updateById(null); if(b) { addReiSharedDatd(null,2); public AjaxResult editMoney(@RequestBody List<ReimbursementService> serviceReimbursement) { boolean b = serviceReimbursementService.updateById(null); if (b) { addReiSharedDatd(null, 2); } return toAjax(b); } @@ -686,8 +628,7 @@ //@PreAuthorize("@ss.hasPermi('project:reimbursement:remove')") @Log(title = "æ¥éç³è¯·", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceReimbursementService.removeByIds(Arrays.asList(ids))); } @@ -698,13 +639,13 @@ @GetMapping(value = "/download/{id}") public Map downloadInfo(@PathVariable("id") Long id) throws IOException { Map dataMap = new HashMap(); getData(dataMap,id); getData(dataMap, id); String filePath = getClass().getResource("/template/").getPath(); System.out.println(filePath); //设置模æ¬è£ ç½®æ¹æ³åè·¯å¾,FreeMarkeræ¯æå¤ç§æ¨¡æ¿è£ è½½æ¹æ³ãå¯ä»¥éservletï¼classpathï¼æ°æ®åºæç¨è£ è½½ï¼ configuration.setDirectoryForTemplateLoading(new File(filePath)); Template t=null; Template t = null; try { //æç®è¡¨.ftl为è¦è£ è½½çæ¨¡æ¿ t = configuration.getTemplate("å·®æ è´¹æ¥éç³è¯·å.ftl"); @@ -712,14 +653,28 @@ e.printStackTrace(); } String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis()); String name = "å·®æ è´¹æ¥éç³è¯·å_"+dataMap.get("XM")+"_"+ newTime; String name = "å·®æ è´¹æ¥éç³è¯·å_" + dataMap.get("XM") + "_" + newTime; //è¾åºææ¡£è·¯å¾ååç§° File outFile = new File(RuoYiConfig.getProfile()+"/download/wordtemplate/"+name+".doc"); File outFile = new File(RuoYiConfig.getProfile() + "/download/wordtemplate/" + name + ".doc"); //å建æä»¶å¤¹ File folderPath = new File(RuoYiConfig.getProfile() + "/download/wordtemplate"); if (!folderPath.exists()) { boolean success = folderPath.mkdirs(); if (success) { System.out.println("ç®å½å建æå"); } else { System.out.println("ç®å½å建失败"); } } else { System.out.println("ç®å½å·²åå¨"); } Writer out = null; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile),"utf-8")); out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8")); } catch (FileNotFoundException e1) { e1.printStackTrace(); @@ -729,76 +684,156 @@ } catch (TemplateException e) { e.printStackTrace(); } Map<String ,Object> map = new HashMap<>(); map.put("downloadUrl", "/profile/download/wordtemplate/"+name+".doc"); Map<String, Object> map = new HashMap<>(); map.put("downloadUrl", "/profile/download/wordtemplate/" + name + ".doc"); return map; } private void getData(Map dataMap,Long id) { ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(id); if (serviceReimbursement == null) { throw new ServiceException("ä¸è½½å¤±è´¥ï¼ç¨æ·ä¿¡æ¯åºé", HttpStatus.NO_CONTENT); private void getData(Map dataMap, Long id) { //ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(id); ServiceReimbursement serviceReimbursement = null; ServiceReimbursementEo serviceReimbursementEo = new ServiceReimbursementEo(); serviceReimbursementEo.setId(id); List<ServiceReimbursementEo> rdInfoByItem = serviceReimbursementService.getRDInfoByItem(serviceReimbursementEo); Map<String, List<ServiceReimbursementEo>> listMap = rdInfoByItem.stream() .collect(Collectors.groupingBy(ServiceReimbursementEo::getPersontype)); List<Map<String, BigDecimal>> list = new ArrayList<>(); StringBuffer FYXM1 = new StringBuffer(); StringBuffer FYXM2 = new StringBuffer(); StringBuffer FYXM3 = new StringBuffer(); int flag = 0; String key1 = null; BigDecimal allMoney = new BigDecimal(0.00); BigDecimal otherMoneyall = new BigDecimal(0.00); for (String key : listMap.keySet()) { Map<String, BigDecimal> map = new HashMap<>(); List<ServiceReimbursementEo> values = listMap.get(key); BigDecimal otherMoney = new BigDecimal(0.00); BigDecimal keyOneMoney = new BigDecimal(0.00); BigDecimal keyTwoMoney = new BigDecimal(0.00); for (ServiceReimbursementEo serviceReimbursementEo1 : values) { otherMoney = otherMoney.add(serviceReimbursementEo1.getTrafficexpense()).add(serviceReimbursementEo1.getHotelexpense()) .add(serviceReimbursementEo1.getFoodexpenses()).add(serviceReimbursementEo1.getFoodallowance()) .add(serviceReimbursementEo1.getOtherexpense()).add(serviceReimbursementEo1.getOtherfeeamount()); } map.put(key, otherMoney); list.add(map); // ä¸ä¸ºä¸å®¶æå®¶å± if (!key.equals("3") && !key.equals("4")) { //å°ä¸ä¸æ¬¡çæ¸ ç©º FYXM1.delete(0, FYXM1.length()); //åæ°å¢ otherMoneyall = otherMoneyall.add(otherMoney); FYXM1.append("OPOå·¥ä½äººå" + ":" + otherMoneyall + " "); } else { if (flag == 0) { key1 = key; flag = 1; } if (key1 == key) { FYXM2.append(PersonType.getInfoByCode(key) + ":" + otherMoney); allMoney = allMoney.add(otherMoney); } else { FYXM3.append(PersonType.getInfoByCode(key) + ":" + otherMoney); allMoney = allMoney.add(otherMoney); } } } allMoney = allMoney.add(otherMoneyall); if (FYXM1.length() == 0) { if (FYXM2.length() != 0 && FYXM3.length() != 0) { FYXM1.append(FYXM3); FYXM3.setLength(0); } else if (FYXM2.length() != 0 && FYXM3.length() == 0) { FYXM1.append(FYXM2); FYXM2.setLength(0); } } else if (FYXM2.length() == 0) { if (FYXM3.length() != 0) { FYXM2.append(FYXM3); FYXM3.setLength(0); } } Date dt = serviceReimbursement.getCreateTime(); if (rdInfoByItem == null || rdInfoByItem.size() == 0) { throw new ServiceException("ä¸è½½å¤±è´¥ï¼ç¨æ·ä¿¡æ¯åºé", HttpStatus.NO_CONTENT); } Date dt = rdInfoByItem.get(0).getCreateTime(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date = formatter.format(dt); String time = date.substring(0, 10); dataMap.put("TBYYMMDD", time); dataMap.put("BXDFJ", serviceReimbursement.getAttachcount() == 0 ? " " : "" + serviceReimbursement.getAttachcount()); dataMap.put("JXZXM", serviceReimbursement.getDonorname() == null ? "" : serviceReimbursement.getDonorname()); dataMap.put("JSR", serviceReimbursement.getUsername() == null ? "" : serviceReimbursement.getUsername()); dataMap.put("FYXM1", "å·®æ è´¹æ¥éæ»éé¢ï¼ " + String.format("%.2f", serviceReimbursement.getAmountrequested()).toString() + "å "); dataMap.put("FYXM2", ""); dataMap.put("FYXM3", ""); dataMap.put("JEXS", serviceReimbursement.getAmountrequested()); dataMap.put("BXDFJ", rdInfoByItem.get(0).getAttachcount() == null ? " " : "" + rdInfoByItem.get(0).getAttachcount()); dataMap.put("JXZXM", rdInfoByItem.get(0).getDonorname() == null ? "" : rdInfoByItem.get(0).getDonorname()); dataMap.put("JSR", rdInfoByItem.get(0).getUsername() == null ? "" : rdInfoByItem.get(0).getUsername()); if (FYXM1.length() != 0) { dataMap.put("FYXM1", FYXM1.toString() + "å "); } else { dataMap.put("FYXM1", ""); } if (FYXM2.length() != 0) { dataMap.put("FYXM2", FYXM2.toString() + "å "); } else { dataMap.put("FYXM2", ""); } if (FYXM3.length() != 0) { dataMap.put("FYXM3", FYXM3.toString() + "å "); } else { dataMap.put("FYXM3", ""); } // dataMap.put("JEXS", rdInfoByItem.get(0).getAmountrequested()); dataMap.put("JEXS", allMoney); //double temp = 0; //temp = Math.round(serviceReimbursement.getAmountrequested() * 100) * 0.01d; dataMap.put("JEDS", convert(serviceReimbursement.getAmountrequested()) + "æ´"); // dataMap.put("JEDS", convert(rdInfoByItem.get(0).getAmountrequested().doubleValue()) + "æ´"); dataMap.put("JEDS", convert(allMoney.doubleValue()) + "æ´"); String remark = ""; remark += serviceReimbursement.getCosttypename() == null ? "" : serviceReimbursement.getCosttypename() + "("; remark += rdInfoByItem.get(0).getCosttypename() == null ? "" : rdInfoByItem.get(0).getCosttypename() + "("; remark += serviceReimbursement.getTravelers() == null ? "" : serviceReimbursement.getTravelers() + ": "; remark += rdInfoByItem.get(0).getTravelers() == null ? "" : rdInfoByItem.get(0).getTravelers() + ": "; remark += serviceReimbursement.getIdcardno() == null ? "" : serviceReimbursement.getIdcardno() + "; "; remark += rdInfoByItem.get(0).getIdcardno() == null ? "" : rdInfoByItem.get(0).getIdcardno() + "; "; remark += serviceReimbursement.getDepositbank() == null ? "" : serviceReimbursement.getDepositbank() + ": "; remark += rdInfoByItem.get(0).getDepositbank() == null ? "" : rdInfoByItem.get(0).getDepositbank() + ": "; remark += serviceReimbursement.getBankcardno() == null ? "" : serviceReimbursement.getBankcardno() + ")"; remark += rdInfoByItem.get(0).getBankcardno() == null ? "" : rdInfoByItem.get(0).getBankcardno() + ")"; remark += "\n"; remark += serviceReimbursement.getRemark() == null ? "" : serviceReimbursement.getRemark(); remark += rdInfoByItem.get(0).getRemark() == null ? "" : rdInfoByItem.get(0).getRemark(); dataMap.put("BXBZ", remark); dataMap.put("YYMMDD", time); dataMap.put("FJ", serviceReimbursement.getAttachcount() == 0 ? " " : "" + serviceReimbursement.getAttachcount()); dataMap.put("FP", serviceReimbursement.getInvoicecount() == 0 ? " " : "" + serviceReimbursement.getInvoicecount()); dataMap.put("XM", serviceReimbursement.getTravelers() == null ? "" : serviceReimbursement.getTravelers()); dataMap.put("BXR", serviceReimbursement.getUsername() == null ? "" : serviceReimbursement.getUsername()); dataMap.put("QYZZ", serviceReimbursement.getManagername() == null ? "" : serviceReimbursement.getManagername()); dataMap.put("CCSY", serviceReimbursement.getReason() == null ? "" : serviceReimbursement.getReason()); dataMap.put("FJ", rdInfoByItem.get(0).getAttachcount() == null ? " " : "" + rdInfoByItem.get(0).getAttachcount()); dataMap.put("FP", rdInfoByItem.get(0).getInvoicecount() == null ? " " : "" + rdInfoByItem.get(0).getInvoicecount()); dataMap.put("XM", rdInfoByItem.get(0).getTravelers() == null ? "" : rdInfoByItem.get(0).getTravelers()); dataMap.put("BXR", rdInfoByItem.get(0).getUsername() == null ? "" : rdInfoByItem.get(0).getUsername()); dataMap.put("QYZZ", rdInfoByItem.get(0).getManagername() == null ? "" : rdInfoByItem.get(0).getManagername()); dataMap.put("CCSY", rdInfoByItem.get(0).getReason() == null ? "" : rdInfoByItem.get(0).getReason()); List<ServiceReimbursementdetail> rd = serviceReimbursementdetailService.getAllDetailsByRBID(id); if (rd == null) { throw new ServiceException("ä¸è½½å¤±è´¥ï¼æ²¡æå¯¹åºä¿¡æ¯", HttpStatus.NO_CONTENT); } List<Map<String, Object>> newsList = new ArrayList<Map<String,Object>>(); List<Map<String, Object>> newsList = new ArrayList<Map<String, Object>>(); int days = 0; double te = 0; double cf = 0; double he = 0; double oe = 0; double fe = 0; double fa = 0; double hj = 0; double qt = 0; for(ServiceReimbursementdetail s : rd) { Map<String, Object> map=new HashMap<String, Object>(); BigDecimal te = BigDecimal.ZERO; BigDecimal cf = BigDecimal.ZERO; BigDecimal he = BigDecimal.ZERO; BigDecimal oe = BigDecimal.ZERO; BigDecimal fe = BigDecimal.ZERO; BigDecimal fa = BigDecimal.ZERO; BigDecimal hj = BigDecimal.ZERO; BigDecimal qt = BigDecimal.ZERO; for (ServiceReimbursementdetail s : rd) { Map<String, Object> map = new HashMap<String, Object>(); Date st = s.getStarttime(); SimpleDateFormat formatter_st = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -828,35 +863,35 @@ days += s.getDays(); map.put("JT", s.getTraffictype() == null ? "" : s.getTraffictype()); map.put("QTFSM", s.getOtherfeedesc() == null ? "" : s.getOtherfeedesc()); map.put("JTF", s.getTrafficexpense() == 0.00 ? "" : String.format("%.2f", s.getTrafficexpense()).toString() + ""); te += s.getTrafficexpense(); map.put("SNJT", s.getCityfee() == 0.00 ? "" : String.format("%.2f", s.getCityfee()).toString() + ""); cf += s.getCityfee(); map.put("ZSF", s.getHotelexpense() == 0.00 ? "" : String.format("%.2f", s.getHotelexpense()).toString() + ""); he += s.getHotelexpense(); map.put("ZF", s.getOtherexpense() == 0.00 ? "" : String.format("%.2f", s.getOtherexpense()).toString() + ""); oe += s.getOtherexpense(); map.put("HSBX", s.getFoodexpenses() == 0.00 ? "" : String.format("%.2f",s.getFoodexpenses()).toString() + ""); fe += s.getFoodexpenses(); map.put("HSBZ", s.getFoodallowance() == 0.00 ? "" : String.format("%.2f",s.getFoodallowance()).toString() + ""); fa += s.getFoodallowance(); map.put("QTF", s.getOtherfeeamount() == 0.00 ? "" : String.format("%.2f",s.getOtherfeeamount()).toString() + ""); qt += s.getOtherfeeamount(); map.put("HJ", String.format("%.2f", s.getTrafficexpense() + s.getCityfee() + s.getHotelexpense() + s.getOtherexpense() + s.getFoodexpenses() + s.getFoodallowance() + s.getOtherfeeamount()).toString() + ""); hj += s.getTrafficexpense() + s.getCityfee() + s.getHotelexpense() + s.getOtherexpense() + s.getFoodexpenses() + s.getFoodallowance() + s.getOtherfeeamount(); map.put("JTF", s.getTrafficexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getTrafficexpense()).toString() + ""); te = te.add(s.getTrafficexpense()); map.put("SNJT", s.getCityfee().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getCityfee()).toString() + ""); cf = cf.add(s.getCityfee()); map.put("ZSF", s.getHotelexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getHotelexpense()).toString() + ""); he = he.add(s.getHotelexpense()); map.put("ZF", s.getOtherexpense().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getOtherexpense()).toString() + ""); oe = oe.add(s.getOtherexpense()); map.put("HSBX", s.getFoodexpenses().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getFoodexpenses()).toString() + ""); fe = fe.add(s.getFoodexpenses()); map.put("HSBZ", s.getFoodallowance().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getFoodallowance()).toString() + ""); fa = fa.add(s.getFoodallowance()); map.put("QTF", s.getOtherfeeamount().equals(BigDecimal.ZERO) ? "" : String.format("%.2f", s.getOtherfeeamount()).toString() + ""); qt = qt.add(s.getOtherfeeamount()); map.put("HJ", String.format("%.2f", s.getTrafficexpense().add(s.getCityfee()).add(s.getHotelexpense()).add(s.getOtherexpense()).add(s.getFoodexpenses()).add(s.getFoodallowance()).add(s.getOtherfeeamount())).toString() + ""); hj = hj.add(s.getTrafficexpense().add(s.getCityfee()).add(s.getHotelexpense()).add(s.getOtherexpense()).add(s.getFoodexpenses()).add(s.getFoodallowance()).add(s.getOtherfeeamount())); //hj = Math.round(hj * 100) * 0.01d; DecimalFormat df = new DecimalFormat("0.00"); // DecimalFormat df = new DecimalFormat("0.00"); hj = new Double(df.format(hj).toString()); // hj = new Double(df.format(hj).toString()); newsList.add(map); } dataMap.put("list",newsList); dataMap.put("list", newsList); dataMap.put("TND", "" + days); dataMap.put("TJT", ""); dataMap.put("TJTF", "" + String.format("%.2f",te).toString() + ""); dataMap.put("TSNJT", "" + String.format("%.2f",cf).toString() + ""); dataMap.put("TJTF", "" + String.format("%.2f", te).toString() + ""); dataMap.put("TSNJT", "" + String.format("%.2f", cf).toString() + ""); dataMap.put("TZSF", "" + String.format("%.2f", he).toString() + ""); dataMap.put("TZF", "" + String.format("%.2f", oe).toString() + ""); dataMap.put("THSBX", "" + String.format("%.2f", fe).toString() + ""); @@ -864,17 +899,17 @@ dataMap.put("TQTF", "" + String.format("%.2f", qt).toString() + ""); dataMap.put("THJ", "" + String.format("%.2f", hj).toString() + ""); dataMap.put("DS", convert(hj) + "æ´"); dataMap.put("DS", convert(hj.doubleValue()) + "æ´"); //dataMap.put("DS", "æ´"); dataMap.put("XS", String.format("%.2f", hj).toString() + ""); dataMap.put("R", serviceReimbursement.getCosttypename() == null ? "" : serviceReimbursement.getCosttypename()); dataMap.put("R", StringUtils.isEmpty(rdInfoByItem.get(0).getCosttypename()) ? "" : rdInfoByItem.get(0).getCosttypename()); } public static String convert(Double money) { String smoney = money.toString(); try{ try { if (smoney.indexOf(".") != -1) { //ææ°å¼åä¸ºæ´æ°åå另尿°çæ°å¼åå¼å¤çã String left = smoney.substring(0, smoney.indexOf(".")); String right = smoney.substring(smoney.indexOf(".") + 1); @@ -884,7 +919,7 @@ } else { return convertLeft(smoney); } }catch(IllegalArgumentException e){ } catch (IllegalArgumentException e) { System.out.println(e.getMessage()); System.out.println("请è¾å ¥è½¬æ¢èå´å ç°é"); return null; @@ -896,12 +931,12 @@ int length = left.length(); //æ ¹æ®åä½'亿','ä¸','å 'ï¼ææ´æ°é¨åå为3ç§æ åµå¤çã if (length <= 4) { //éé¢å¨åå 以å ã if(length == 1 && Integer.valueOf(left) == 0) //éé¢ä¸º'0'å æ¶çç¹æ®æ åµã if (length == 1 && Integer.valueOf(left) == 0) //éé¢ä¸º'0'å æ¶çç¹æ®æ åµã return "é¶å "; return convertPart(left, length); } else if (length <= 8) { //éé¢å¨åä¸å 以å ã String part1 = left.substring(0,length - 4); String part1 = left.substring(0, length - 4); String part2 = left.substring(length - 4, length); String result1 = convertPart(part1, length); @@ -952,7 +987,7 @@ String number = ""; String unit = ""; if(part.equals("0000") && position == 8) //ç¨äºæé¤åä½ä¸º'ä¸'æ¶ï¼å使°å¼å为'0'çæ åµã if (part.equals("0000") && position == 8) //ç¨äºæé¤åä½ä¸º'ä¸'æ¶ï¼å使°å¼å为'0'çæ åµã return ""; for (int i = 0; i < part.length(); i++) { int value = Integer.valueOf(String.valueOf(part.charAt(i))); @@ -977,7 +1012,6 @@ System.out.println(result); return result; } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailController.java
@@ -1,7 +1,12 @@ package com.ruoyi.web.controller.project; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; import com.ruoyi.common.utils.bean.DtoConversionUtils; import com.ruoyi.project.domain.ServiceReimbursementdetailShared; import com.ruoyi.project.service.IServiceReimbursementdetailSharedService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; @@ -37,6 +42,8 @@ { @Autowired private IServiceReimbursementdetailService serviceReimbursementdetailService; @Autowired private IServiceReimbursementdetailSharedService detailSharedService; /** * æ¥è¯¢æ¥éç³è¯·æç»å表 @@ -109,15 +116,11 @@ public AjaxResult updateRDlList(@RequestBody List<ServiceReimbursementdetail> serviceReimbursementdetails) { for (ServiceReimbursementdetail serviceReimbursementdetail:serviceReimbursementdetails) { if(serviceReimbursementdetail.getId()!=null) { serviceReimbursementdetailService.updateById(serviceReimbursementdetail); }else { //妿ID为空ï¼åè¦æ°å¢ add(serviceReimbursementdetail); } serviceReimbursementdetailService.saveOrUpdate(serviceReimbursementdetail); //æ°å¢æä¿®æ¹æ¥éç³è¯·æç»å享表 ServiceReimbursementdetailShared serviceReimbursementdetailShared = DtoConversionUtils.sourceToTarget(serviceReimbursementdetail, ServiceReimbursementdetailShared.class); detailSharedService.saveOrUpdate(serviceReimbursementdetailShared); } // return toAjax("null"); return null; } ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementdetailSharedController.java
@@ -1,4 +1,4 @@ package com.ruoyi.project.controller; package com.ruoyi.web.controller.project; import java.util.Arrays; import java.util.List; ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementpayeeController.java
@@ -1,13 +1,13 @@ package com.ruoyi.project.controller; package com.ruoyi.web.controller.project; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.ruoyi.project.domain.ReimbursementService; import com.ruoyi.common.utils.bean.DtoConversionUtils; import com.ruoyi.project.domain.Reimbursementpayee; import io.netty.util.internal.ObjectUtil; import com.ruoyi.project.domain.ServiceReimbursementpayeeShared; import com.ruoyi.project.service.IServiceReimbursementpayeeSharedService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; @@ -34,17 +34,19 @@ /** * å·®æ æ¥é仿¬¾ä¿¡æ¯Controller * * * @author ruoyi * @date 2023-04-20 */ @Api("å·®æ æ¥é仿¬¾ä¿¡æ¯") @RestController @RequestMapping("/project/reimbursementpayee") public class ServiceReimbursementpayeeController extends BaseController { public class ServiceReimbursementpayeeController extends BaseController { @Autowired private IServiceReimbursementpayeeService serviceReimbursementpayeeService; @Autowired private IServiceReimbursementpayeeSharedService serviceReimbursementpayeeSharedService; /** * æ¥è¯¢å·®æ æ¥é仿¬¾ä¿¡æ¯å表 @@ -52,13 +54,12 @@ @ApiOperation("æ¥è¯¢å·®æ æ¥é仿¬¾ä¿¡æ¯å表") @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:list')") @GetMapping("/list") public TableDataInfo list(ServiceReimbursementpayee serviceReimbursementpayee) { public TableDataInfo list(ServiceReimbursementpayee serviceReimbursementpayee) { startPage(); List<ServiceReimbursementpayee> list = serviceReimbursementpayeeService.queryList(serviceReimbursementpayee); List<Reimbursementpayee> reimbursementpayees=new ArrayList<>(); for(int i=0;i<list.size();i++){ Reimbursementpayee reimbursementpayee=new Reimbursementpayee(); List<Reimbursementpayee> reimbursementpayees = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { Reimbursementpayee reimbursementpayee = new Reimbursementpayee(); reimbursementpayee.setCol_personname(list.get(i).getPersonname()); reimbursementpayee.setCol_personType(list.get(i).getPersontype()); reimbursementpayee.setCol_accounts(list.get(i).getBankcardno()); @@ -79,8 +80,7 @@ @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:export')") @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ServiceReimbursementpayee serviceReimbursementpayee) { public AjaxResult export(ServiceReimbursementpayee serviceReimbursementpayee) { List<ServiceReimbursementpayee> list = serviceReimbursementpayeeService.queryList(serviceReimbursementpayee); ExcelUtil<ServiceReimbursementpayee> util = new ExcelUtil<ServiceReimbursementpayee>(ServiceReimbursementpayee.class); return util.exportExcel(list, "å·®æ æ¥é仿¬¾ä¿¡æ¯æ°æ®"); @@ -92,42 +92,47 @@ @ApiOperation("è·åå·®æ æ¥é仿¬¾ä¿¡æ¯è¯¦ç»ä¿¡æ¯") @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceReimbursementpayeeService.getById(id)); } /** * æ°å¢å·®æ æ¥é仿¬¾ä¿¡æ¯ * æ°å¢æä¿®æ¹å·®æ æ¥é仿¬¾ä¿¡æ¯ */ @ApiOperation("æ°å¢å·®æ æ¥é仿¬¾ä¿¡æ¯") @ApiOperation("æ°å¢æä¿®æ¹å·®æ æ¥é仿¬¾ä¿¡æ¯") @PostMapping("/addOrUpdateRBpayee") public AjaxResult addOrUpdateRBpayee(@RequestBody List<Reimbursementpayee> reimbursementPayees) { List<ServiceReimbursementpayee> addserviceReimbursementpayees=new ArrayList<>(); List<ServiceReimbursementpayee> updateserviceReimbursementpayees=new ArrayList<>(); for (Reimbursementpayee reimbursementPayee:reimbursementPayees) { ServiceReimbursementpayee serviceReimbursementpayee=new ServiceReimbursementpayee(); serviceReimbursementpayee.setRbid(reimbursementPayee.getRbid()); serviceReimbursementpayee.setPersonname(reimbursementPayee.getCol_personname()); serviceReimbursementpayee.setPersontype(reimbursementPayee.getCol_personType()); serviceReimbursementpayee.setBankname(reimbursementPayee.getCol_bank()); serviceReimbursementpayee.setBankcardno(reimbursementPayee.getCol_accounts()); serviceReimbursementpayee.setPaiddate(reimbursementPayee.getCol_date()); serviceReimbursementpayee.setRemark(reimbursementPayee.getCol_illustrate()); serviceReimbursementpayee.setId(reimbursementPayee.getId()); if(ObjectUtils.isEmpty(reimbursementPayee.getId())){ addserviceReimbursementpayees.add(serviceReimbursementpayee); }else { updateserviceReimbursementpayees.add(serviceReimbursementpayee); } public AjaxResult addOrUpdateRBpayee(@RequestBody List<Reimbursementpayee> reimbursementPayees) { List<ServiceReimbursementpayee> payees = new ArrayList<>(); List<ServiceReimbursementpayeeShared> payeeSareds = new ArrayList<>(); for (Reimbursementpayee reimbursementPayee : reimbursementPayees) { //å°è£ æ¯ä»æ°æ® ServiceReimbursementpayee payee = new ServiceReimbursementpayee(); payee.setRbid(reimbursementPayee.getRbid()); payee.setPersonname(reimbursementPayee.getCol_personname()); payee.setPersontype(reimbursementPayee.getCol_personType()); payee.setBankname(reimbursementPayee.getCol_bank()); payee.setBankcardno(reimbursementPayee.getCol_accounts()); payee.setPaiddate(reimbursementPayee.getCol_date()); payee.setRemark(reimbursementPayee.getCol_illustrate()); payee.setId(reimbursementPayee.getId()); //å°è£ æ¯ä»åäº«æ°æ® ServiceReimbursementpayeeShared payeeShared = new ServiceReimbursementpayeeShared(); payeeShared.setRbid(reimbursementPayee.getRbid()); payeeShared.setPersonname(reimbursementPayee.getCol_personname()); payeeShared.setPersontype(reimbursementPayee.getCol_personType()); payeeShared.setBankname(reimbursementPayee.getCol_bank()); payeeShared.setBankcardno(reimbursementPayee.getCol_accounts()); payeeShared.setPaiddate(reimbursementPayee.getCol_date()); payeeShared.setRemark(reimbursementPayee.getCol_illustrate()); payeeShared.setId(reimbursementPayee.getId()); payees.add(payee); payeeSareds.add(payeeShared); } boolean b = false; if(!CollectionUtils.isEmpty(addserviceReimbursementpayees)){ b = serviceReimbursementpayeeService.saveBatch(addserviceReimbursementpayees); }else { b = serviceReimbursementpayeeService.updateBatchById(updateserviceReimbursementpayees); } b = serviceReimbursementpayeeService.saveOrUpdateBatch(payees); b = serviceReimbursementpayeeSharedService.saveOrUpdateBatch(payeeSareds); return toAjax(b); } @@ -139,8 +144,7 @@ @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.INSERT) @PostMapping @RepeatSubmit public AjaxResult add(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { public AjaxResult add(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { return toAjax(serviceReimbursementpayeeService.save(serviceReimbursementpayee)); } @@ -151,9 +155,8 @@ @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:edit')") @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.UPDATE) @PutMapping @RepeatSubmit public AjaxResult edit(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { @RepeatSubmit public AjaxResult edit(@RequestBody ServiceReimbursementpayee serviceReimbursementpayee) { return toAjax(serviceReimbursementpayeeService.updateById(serviceReimbursementpayee)); } @@ -164,8 +167,7 @@ @PreAuthorize("@ss.hasPermi('project:reimbursementpayee:remove')") @Log(title = "å·®æ æ¥é仿¬¾ä¿¡æ¯", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceReimbursementpayeeService.removeByIds(Arrays.asList(ids))); } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -103,7 +103,7 @@ /** * è·åè·¯ç±ä¿¡æ¯ * * /addOrUpdateRBpayee/addOrUpdateRBpayee/addOrUpdateRBpayee * @return è·¯ç±ä¿¡æ¯ */ @GetMapping("getRouters") ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/DtoConversionUtils.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,64 @@ package com.ruoyi.common.utils.bean; import org.springframework.beans.BeanUtils; import java.util.ArrayList; import java.util.Collection; import java.util.List; /** * DTOåentityç¸äºè½¬åå·¥å ·ç±» * * @author liusheng * @date 2023/5/06 */ public class DtoConversionUtils { /** * entity转å为DTO * * @param source å®ä½ç±»entity * @param target ç®æ ç±»DTO * @return 转ååçDTO */ public static <T> T sourceToTarget(Object source, Class<T> target){ if(source == null){ return null; } T targetObject = null; try { targetObject = target.newInstance(); BeanUtils.copyProperties(source, targetObject); } catch (Exception e) { e.printStackTrace(); } return targetObject; } /** * List<entity>转å为List<DTO> * * @param sourceList å®ä½ç±»éåCollection<entity> * @param target ç®æ ç±»DTO * @return 转ååçCollection<DTO> */ public static <T> List<T> sourceToTarget(Collection<?> sourceList, Class<T> target){ if(sourceList == null){ return null; } ArrayList<T> targetList = new ArrayList<>(sourceList.size()); try { for(Object source : sourceList){ T targetObject = target.newInstance(); BeanUtils.copyProperties(source, targetObject); targetList.add(targetObject); } } catch (Exception e) { e.printStackTrace(); } return targetList; } } ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java
@@ -225,5 +225,15 @@ @ApiModelProperty("æç®å®¶å±äººæ°") private Integer donorrelatives; @ApiModelProperty("ç³è¯·æ¶é´") private Date createTime; // @ApiModelProperty("å¼å§æ¶é´") // private Date starttime; // // @ApiModelProperty("ç»ææ¶é´") // private Date endtime; } ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementEo.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,270 @@ package com.ruoyi.project.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; /** * æ¥éç³è¯·å¯¹è±¡å ¥å对象 * * @author åç * @date 2023-04-28 */ @Data @ApiModel("æ¥éç³è¯·å ¥åEO") public class ServiceReimbursementEo extends BaseEntity { /** $column.columnComment */ @ApiModelProperty("$column.columnComment") //æ°æ®åºèªå¢æ¹æ@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO) private Long id; /** æ¥é人ç¼å· */ @ApiModelProperty("æ¥é人ç¼å·") @Excel(name = "æ¥é人ç¼å·") private String userno; /** æ¥é人å§å */ @ApiModelProperty("æ¥é人å§å") @Excel(name = "æ¥é人å§å") private String username; /** è¯ä»¶ç±»å æ ¹æ®åå ¸sys_IDType */ @ApiModelProperty("è¯ä»¶ç±»å æ ¹æ®åå ¸sys_IDType") @Excel(name = "è¯ä»¶ç±»å æ ¹æ®åå ¸sys_IDType") private String idcardtype; /** è¯ä»¶å·ç */ @ApiModelProperty("è¯ä»¶å·ç ") @Excel(name = "è¯ä»¶å·ç ") private String idcardno; /** èç³»çµè¯ */ @ApiModelProperty("èç³»çµè¯") @Excel(name = "èç³»çµè¯") private String phone; /** 弿·é¶è¡ */ @ApiModelProperty("弿·é¶è¡") @Excel(name = "弿·é¶è¡") private String depositbank; /** å¡å· */ @ApiModelProperty("å¡å·") @Excel(name = "å¡å·") private String bankcardno; /** åè¡åç§° */ @ApiModelProperty("åè¡åç§°") @Excel(name = "åè¡åç§°") private String branchbankname; /** é¶è¡å¡ç §çè·¯å¾ å¤ä¸ªç¨;åå¼ */ @ApiModelProperty("é¶è¡å¡ç §çè·¯å¾ å¤ä¸ªç¨;åå¼") @Excel(name = "é¶è¡å¡ç §çè·¯å¾ å¤ä¸ªç¨;åå¼") private String annexbankcard; /** éä»¶è·¯å¾ å¤ä¸ªç¨;åå¼ */ @ApiModelProperty("éä»¶è·¯å¾ å¤ä¸ªç¨;åå¼") @Excel(name = "éä»¶è·¯å¾ å¤ä¸ªç¨;åå¼") private String annexfiles; /** ç³è¯·éé¢ */ @ApiModelProperty("ç³è¯·éé¢") @Excel(name = "ç³è¯·éé¢") private BigDecimal amountrequested; /** 交éè´¹ */ @ApiModelProperty("交éè´¹") @Excel(name = "交éè´¹") private BigDecimal trafficexpense; /** ä½å®¿è´¹ */ @ApiModelProperty("ä½å®¿è´¹") @Excel(name = "ä½å®¿è´¹") private BigDecimal hotelexpense; /** ä¼é£è´¹ */ @ApiModelProperty("ä¼é£è´¹") @Excel(name = "ä¼é£è´¹") private BigDecimal foodexpenses; /** ä¼é£è´¹è¡¥å© */ @ApiModelProperty("ä¼é£è´¹è¡¥å©") @Excel(name = "ä¼é£è´¹è¡¥å©") private BigDecimal foodallowance; /** æè´¹ */ @ApiModelProperty("æè´¹") @Excel(name = "æè´¹") private BigDecimal otherexpense; /** å ¶ä»è´¹ç¨éé¢ */ @ApiModelProperty("å ¶ä»è´¹ç¨éé¢") @Excel(name = "å ¶ä»è´¹ç¨éé¢") private BigDecimal otherfeeamount; /** 颿¯è´¹ç¨ */ @ApiModelProperty("颿¯è´¹ç¨") @Excel(name = "颿¯è´¹ç¨") private Double prepaidamount; /** åç¥¨å¼ æ° */ @ApiModelProperty("åç¥¨å¼ æ°") @Excel(name = "åç¥¨å¼ æ°") private Long invoicecount; /** éä»¶æ° */ @ApiModelProperty("éä»¶æ°") @Excel(name = "éä»¶æ°") private Long attachcount; /** é¨é¨ä¸»ç®¡å·¥å· */ @ApiModelProperty("é¨é¨ä¸»ç®¡å·¥å·") @Excel(name = "é¨é¨ä¸»ç®¡å·¥å·") private String managerno; /** é¨é¨ä¸»ç®¡åå */ @ApiModelProperty("é¨é¨ä¸»ç®¡åå") @Excel(name = "é¨é¨ä¸»ç®¡åå") private String managername; /** é¨é¨ç¼å· */ @ApiModelProperty("é¨é¨ç¼å·") @Excel(name = "é¨é¨ç¼å·") private String deptmentno; /** é¨é¨åç§° */ @ApiModelProperty("é¨é¨åç§°") @Excel(name = "é¨é¨åç§°") private String deptmentname; /** ä¸å¿ç¾å */ @ApiModelProperty("ä¸å¿ç¾å") @Excel(name = "ä¸å¿ç¾å") private String opochecker; /** è´¢å¡å¯é¢é¿ç¾å */ @ApiModelProperty("è´¢å¡å¯é¢é¿ç¾å") @Excel(name = "è´¢å¡å¯é¢é¿ç¾å") private String finvicepresident; /** ä¸å¡å¯é¢é¿ç¾å */ @ApiModelProperty("ä¸å¡å¯é¢é¿ç¾å") @Excel(name = "ä¸å¡å¯é¢é¿ç¾å") private String busvicepresident; /** åå ¬å®¤ä¸»ä»»ç¾å */ @ApiModelProperty("åå ¬å®¤ä¸»ä»»ç¾å") @Excel(name = "åå ¬å®¤ä¸»ä»»ç¾å") private String officedirector; /** è´¢å¡å®¤ä¸»ä»»ç¾å */ @ApiModelProperty("è´¢å¡å®¤ä¸»ä»»ç¾å") @Excel(name = "è´¢å¡å®¤ä¸»ä»»ç¾å") private String financedirector; /** è´¢å¡å®¡æ ¸ */ @ApiModelProperty("è´¢å¡å®¡æ ¸") @Excel(name = "è´¢å¡å®¡æ ¸") private String financechecher; /** å ³èservice_donatebaseinfo表çID */ @ApiModelProperty("å ³èservice_donatebaseinfo表çID") @Excel(name = "å ³èservice_donatebaseinfo表çID") private Long infoid; /** æç®è ç¼å· */ @ApiModelProperty("æç®è ç¼å·") @Excel(name = "æç®è ç¼å·") private String donorno; /** è®°å½ç¶æ */ @ApiModelProperty("è®°å½ç¶æ") @Excel(name = "è®°å½ç¶æ") private Integer recordstatus; /** ä¸ä¼ æ å¿ */ @ApiModelProperty("ä¸ä¼ æ å¿") @Excel(name = "ä¸ä¼ æ å¿") private String uploadflag; /** ä¸ä¼ æ¶é´ */ @ApiModelProperty("ä¸ä¼ æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "ä¸ä¼ æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date uploadtime; @ApiModelProperty("åºå·®äºº") @Excel(name = "åºå·®äºº") private String travelers; @ApiModelProperty("åºå·®äºç±") private String reason; @ApiModelProperty("æç®è å§å") private String donorname; @ApiModelProperty("æ»éé¢") private Double totalamount; @ApiModelProperty("æ»éé¢ç大å") private String bigstrmoney; /** éä»¶å°åï¼add by yangjb 20221124 */ @ApiModelProperty("éä»¶å°å") private String fileurl; private String remark; /** å½åå®¡æ ¸çº§å« å¤äºåªä¸ªé¶æ®µ 0ï¼ç³è¯·ï¼1ï¼ä¸çº§å®¡æ ¸ï¼2ï¼äºçº§å®¡æ ¸ï¼3ï¼ä¸çº§å®¡æ ¸ç */ @ApiModelProperty("å½åå®¡æ ¸çº§å«") private Long flowlevel; /** è´¹ç¨å½å±ï¼0ï¼å ¶ä»äººåï¼1ï¼ä¸è人åï¼2ï¼åè°åï¼3ï¼ä¸å®¶ï¼4ï¼æç®è å®¶å± */ @ApiModelProperty("è´¹ç¨å½å±") private String persontype; /** è´¹ç¨å½å±æè¿° */ @ApiModelProperty("è´¹ç¨å½å±æè¿°") private String costtypename; @ApiModelProperty("æç®å®¶å±é¶è¡") private String donorbank; @ApiModelProperty("æç®å®¶å±é¶è¡å¡å·") private String donorbankcard; @ApiModelProperty("æç®å®¶å±è´¹ç¨è¯´æ") private String donorremark; @ApiModelProperty("æç®å®¶å±è´¹ç¨éé¢") private Double donoramount; @ApiModelProperty("æç®å®¶å±äººæ°") private Integer donorrelatives; @ApiModelProperty("ç³è¯·æ¶é´") private Date createTime; @ApiModelProperty("ç³è¯·æ¶é´") private Date starttime; @ApiModelProperty("ç³è¯·æ¶é´") private Date endtime; } ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetail.java
@@ -64,7 +64,7 @@ /** 交éè´¹ */ @ApiModelProperty("交éè´¹") @Excel(name = "交éè´¹") private Double trafficexpense; private BigDecimal trafficexpense; /** 交éå·¥å · */ @ApiModelProperty("交éå·¥å ·") @@ -74,12 +74,12 @@ /** å¸å 交éè´¹ */ @ApiModelProperty("å¸å 交éè´¹") @Excel(name = "å¸å 交éè´¹") private Double cityfee; private BigDecimal cityfee; /** ä½å®¿è´¹ */ @ApiModelProperty("ä½å®¿è´¹") @Excel(name = "ä½å®¿è´¹") private Double hotelexpense; private BigDecimal hotelexpense; /** åç¥¨å¼ æ° */ @ApiModelProperty("åç¥¨å¼ æ°") @@ -94,17 +94,17 @@ /** æè´¹ */ @ApiModelProperty("æè´¹") @Excel(name = "æè´¹") private Double otherexpense; private BigDecimal otherexpense; /** ä¼é£è´¹ */ @ApiModelProperty("ä¼é£è´¹") @Excel(name = "ä¼é£è´¹") private Double foodexpenses; private BigDecimal foodexpenses; /** ä¼é£è´¹è¡¥å© */ @ApiModelProperty("ä¼é£è´¹è¡¥å©") @Excel(name = "ä¼é£è´¹è¡¥å©") private Double foodallowance; private BigDecimal foodallowance; /** é件表 */ @ApiModelProperty("é件表") @@ -154,7 +154,7 @@ @Excel(name = "æå±è¡éï¼éï¼åç§°") private String traveltownname; private Double otherfeeamount; private BigDecimal otherfeeamount; private String otherfeedesc; ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementdetailShared.java
@@ -177,15 +177,15 @@ @Excel(name = "å ¶ä»è´¹ç¨è¯´æ") private String otherfeedesc; /** éé¢-æ¥å£ */ @ApiModelProperty("éé¢-æ¥å£") @Excel(name = "éé¢-æ¥å£") private String jine; /** çç±-æ¥å£ */ @ApiModelProperty("çç±-æ¥å£") @Excel(name = "çç±-æ¥å£") private String liyou; // /** éé¢-æ¥å£ */ // @ApiModelProperty("éé¢-æ¥å£") // @Excel(name = "éé¢-æ¥å£") // private String jine; // // /** çç±-æ¥å£ */ // @ApiModelProperty("çç±-æ¥å£") // @Excel(name = "çç±-æ¥å£") // private String liyou; } ruoyi-project/src/main/java/com/ruoyi/project/mapper/ServiceReimbursementMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import java.util.List; import com.ruoyi.project.domain.ServiceReimbursement; import com.ruoyi.project.domain.ServiceReimbursementEo; import com.ruoyi.project.domain.dto.ServiceReimbursementDto; import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut; import org.apache.ibatis.annotations.Param; @@ -33,4 +34,12 @@ List<ServiceReimbursement> getInfoByInfoId(Long infoid); List<ServiceReimbursement> getInfoByInfoIdRelatives(Long infoid); /** * * @param serviceReimbursementEo * @return */ List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo); } ruoyi-project/src/main/java/com/ruoyi/project/service/IServiceReimbursementService.java
@@ -3,6 +3,7 @@ import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.project.domain.ServiceReimbursement; import com.ruoyi.project.domain.ServiceReimbursementEo; import com.ruoyi.project.domain.ServiceReimbursementdetail; import com.ruoyi.project.domain.dto.ServiceReimbursementDto; import com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut; @@ -35,4 +36,6 @@ List<ServiceReimbursement> getInfoByInfoId(Long infoid); List<ServiceReimbursement> getInfoByInfoIdRelatives(Long infoid); List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo); } ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementServiceImpl.java
@@ -2,6 +2,7 @@ import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.project.domain.ServiceReimbursementEo; import com.ruoyi.project.domain.ServiceReimbursementdetail; import com.ruoyi.project.domain.ServiceRelativesconfirmation; import com.ruoyi.project.domain.dto.ServiceReimbursementDto; @@ -106,4 +107,10 @@ return serviceReimbursementMapper.getInfoByInfoIdRelatives(infoid); } @Override public List<ServiceReimbursementEo> getRDInfoByItem(ServiceReimbursementEo serviceReimbursementEo){ return serviceReimbursementMapper.getRDInfoByItem(serviceReimbursementEo); } } ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailServiceImpl.java
@@ -1,9 +1,11 @@ package com.ruoyi.project.service.impl; import java.math.BigDecimal; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.project.domain.ServiceReimbursement; import com.ruoyi.project.mapper.ServiceReimbursementMapper; import com.ruoyi.project.mapper.ServiceReimbursementdetailSharedMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -28,6 +30,9 @@ @Autowired ServiceReimbursementdetailMapper serviceReimbursementdetailMapper; @Autowired ServiceReimbursementdetailSharedMapper detailSharedMapper; @Autowired ServiceReimbursementMapper serviceReimbursementMapper; @@ -77,10 +82,15 @@ Long rbid = serviceReimbursementdetail.getRbid(); ServiceReimbursement serviceReimbursement = serviceReimbursementMapper.selectById(rbid); Double amount = serviceReimbursement.getAmountrequested(); amount = amount - serviceReimbursementdetail.getTrafficexpense() - serviceReimbursementdetail.getCityfee() - serviceReimbursementdetail.getHotelexpense() - serviceReimbursementdetail.getFoodexpenses() - serviceReimbursementdetail.getFoodallowance() - serviceReimbursementdetail.getOtherexpense() - serviceReimbursementdetail.getOtherfeeamount(); serviceReimbursement.setAmountrequested(amount); BigDecimal subtract = BigDecimal.valueOf(amount).subtract(serviceReimbursementdetail.getTrafficexpense()).subtract(serviceReimbursementdetail.getCityfee()).subtract(serviceReimbursementdetail.getHotelexpense()) .subtract(serviceReimbursementdetail.getFoodexpenses()).subtract(serviceReimbursementdetail.getFoodallowance()) .subtract(serviceReimbursementdetail.getOtherexpense()).subtract(serviceReimbursementdetail.getOtherfeeamount()); serviceReimbursement.setAmountrequested(subtract.doubleValue()); int updateAmount = serviceReimbursementMapper.updateById(serviceReimbursement); detailSharedMapper.deleteById(id); return serviceReimbursementdetailMapper.deleteById(id); } ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementdetailSharedServiceImpl.java
@@ -124,12 +124,12 @@ if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getOtherfeedesc())){ wrappers.eq(ServiceReimbursementdetailShared::getOtherfeedesc ,serviceReimbursementdetailShared.getOtherfeedesc()); } if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getJine())){ wrappers.eq(ServiceReimbursementdetailShared::getJine ,serviceReimbursementdetailShared.getJine()); } if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getLiyou())){ wrappers.eq(ServiceReimbursementdetailShared::getLiyou ,serviceReimbursementdetailShared.getLiyou()); } // if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getJine())){ // wrappers.eq(ServiceReimbursementdetailShared::getJine ,serviceReimbursementdetailShared.getJine()); // } // if (StringUtils.isNotBlank(serviceReimbursementdetailShared.getLiyou())){ // wrappers.eq(ServiceReimbursementdetailShared::getLiyou ,serviceReimbursementdetailShared.getLiyou()); // } return this.list(wrappers); } ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml
@@ -1,94 +1,149 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.project.mapper.ServiceReimbursementMapper"> <resultMap type="ServiceReimbursement" id="ServiceReimbursementResult"> <result property="id" column="ID" /> <result property="delFlag" column="del_flag" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> <result property="userno" column="UserNo" /> <result property="username" column="UserName" /> <result property="idcardtype" column="IDCardType" /> <result property="idcardno" column="IDCardNo" /> <result property="phone" column="Phone" /> <result property="depositbank" column="DepositBank" /> <result property="bankcardno" column="BankCardNo" /> <result property="branchbankname" column="BranchBankName" /> <result property="annexbankcard" column="AnnexBankCard" /> <result property="annexfiles" column="AnnexFiles" /> <result property="amountrequested" column="AmountRequested" /> <result property="prepaidamount" column="PrepaidAmount" /> <result property="invoicecount" column="InvoiceCount" /> <result property="attachcount" column="AttachCount" /> <result property="managerno" column="ManagerNo" /> <result property="managername" column="ManagerName" /> <result property="deptmentno" column="DeptmentNo" /> <result property="deptmentname" column="DeptmentName" /> <result property="opochecker" column="OPOchecker" /> <result property="finvicepresident" column="FinVicePresident" /> <result property="busvicepresident" column="BusVicePresident" /> <result property="officedirector" column="OfficeDirector" /> <result property="financedirector" column="FinanceDirector" /> <result property="financechecher" column="FinanceChecher" /> <result property="infoid" column="InfoID" /> <result property="donorno" column="DonorNo" /> <result property="remark" column="remark" /> <result property="recordstatus" column="RecordStatus" /> <result property="uploadflag" column="uploadflag" /> <result property="uploadtime" column="uploadtime" /> <result property="travelers" column="Travelers" /> <result property="reason" column="Reason" /> <result property="donorname" column="DonorName" /> <result property="totalamount" column="totalAmount" /> <result property="bigstrmoney" column="bigStrMoney" /> <result property="flowlevel" column="FlowLevel" /> <result property="costtype" column="costtype" /> <result property="costtypename" column="costtypename" /> <result property="fileurl" column="fileurl" /> <result property="donorbank" column="donorbank" /> <result property="donorbankcard" column="donorbankcard" /> <result property="donorremark" column="donorremark" /> <result property="donoramount" column="donoramount" /> <result property="donorrelatives" column="donorrelatives" /> <result property="id" column="ID"/> <result property="delFlag" column="del_flag"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="userno" column="UserNo"/> <result property="username" column="UserName"/> <result property="idcardtype" column="IDCardType"/> <result property="idcardno" column="IDCardNo"/> <result property="phone" column="Phone"/> <result property="depositbank" column="DepositBank"/> <result property="bankcardno" column="BankCardNo"/> <result property="branchbankname" column="BranchBankName"/> <result property="annexbankcard" column="AnnexBankCard"/> <result property="annexfiles" column="AnnexFiles"/> <result property="amountrequested" column="AmountRequested"/> <result property="prepaidamount" column="PrepaidAmount"/> <result property="invoicecount" column="InvoiceCount"/> <result property="attachcount" column="AttachCount"/> <result property="managerno" column="ManagerNo"/> <result property="managername" column="ManagerName"/> <result property="deptmentno" column="DeptmentNo"/> <result property="deptmentname" column="DeptmentName"/> <result property="opochecker" column="OPOchecker"/> <result property="finvicepresident" column="FinVicePresident"/> <result property="busvicepresident" column="BusVicePresident"/> <result property="officedirector" column="OfficeDirector"/> <result property="financedirector" column="FinanceDirector"/> <result property="financechecher" column="FinanceChecher"/> <result property="infoid" column="InfoID"/> <result property="donorno" column="DonorNo"/> <result property="remark" column="remark"/> <result property="recordstatus" column="RecordStatus"/> <result property="uploadflag" column="uploadflag"/> <result property="uploadtime" column="uploadtime"/> <result property="travelers" column="Travelers"/> <result property="reason" column="Reason"/> <result property="donorname" column="DonorName"/> <result property="totalamount" column="totalAmount"/> <result property="bigstrmoney" column="bigStrMoney"/> <result property="flowlevel" column="FlowLevel"/> <result property="costtype" column="costtype"/> <result property="costtypename" column="costtypename"/> <result property="fileurl" column="fileurl"/> <result property="donorbank" column="donorbank"/> <result property="donorbankcard" column="donorbankcard"/> <result property="donorremark" column="donorremark"/> <result property="donoramount" column="donoramount"/> <result property="donorrelatives" column="donorrelatives"/> </resultMap> <sql id="selectServiceReimbursementVo"> select ID, del_flag, create_by, create_time, update_by, update_time, UserNo, UserName, IDCardType, IDCardNo, Phone, DepositBank, BankCardNo, BranchBankName, AnnexBankCard, AnnexFiles, AmountRequested, PrepaidAmount, InvoiceCount, AttachCount, ManagerNo, ManagerName, DeptmentNo, DeptmentName, OPOchecker, FinVicePresident, BusVicePresident, OfficeDirector, FinanceDirector, FinanceChecher, InfoID, DonorNo, remark, RecordStatus, uploadflag, uploadtime, Travelers, DonorName, Reason, FlowLevel, costtype, costtypename,fileurl,donorbank,donorbankcard,donorremark, donoramount,donorrelatives from service_reimbursement select ID, del_flag, create_by, create_time, update_by, update_time, UserNo, UserName, IDCardType, IDCardNo, Phone, DepositBank, BankCardNo, BranchBankName, AnnexBankCard, AnnexFiles, AmountRequested, PrepaidAmount, InvoiceCount, AttachCount, ManagerNo, ManagerName, DeptmentNo, DeptmentName, OPOchecker, FinVicePresident, BusVicePresident, OfficeDirector, FinanceDirector, FinanceChecher, InfoID, DonorNo, remark, RecordStatus, uploadflag, uploadtime, Travelers, DonorName, Reason, FlowLevel, costtype, costtypename, fileurl, donorbank, donorbankcard, donorremark, donoramount, donorrelatives from service_reimbursement </sql> <select id="selectServiceReimbursementList" parameterType="ServiceReimbursement" resultMap="ServiceReimbursementResult"> <select id="selectServiceReimbursementList" parameterType="ServiceReimbursement" resultMap="ServiceReimbursementResult"> <include refid="selectServiceReimbursementVo"/> <where> <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> <if test="createTime != null "> and create_time = #{createTime}</if> <if test="username != null and username != ''"> and UserName like concat('%', #{username}, '%')</if> <if test="deptmentname != null and deptmentname != ''"> and DeptmentName like concat('%', #{deptmentname}, '%')</if> <if test="donorno != null and donorno != ''"> and DonorNo = #{donorno}</if> <if test="recordstatus != null and recordstatus != ''"> and RecordStatus = #{recordstatus}</if> <if test="uploadflag != null and uploadflag != ''"> and uploadflag = #{uploadflag}</if> <if test="travelers != null and travelers != ''"> and Travelers = #{travelers}</if> <if test="createBy != null and createBy != ''">and create_by = #{createBy}</if> <if test="createTime != null ">and create_time = #{createTime}</if> <if test="username != null and username != ''">and UserName like concat('%', #{username}, '%')</if> <if test="deptmentname != null and deptmentname != ''">and DeptmentName like concat('%', #{deptmentname}, '%') </if> <if test="donorno != null and donorno != ''">and DonorNo = #{donorno}</if> <if test="recordstatus != null and recordstatus != ''">and RecordStatus = #{recordstatus}</if> <if test="uploadflag != null and uploadflag != ''">and uploadflag = #{uploadflag}</if> <if test="travelers != null and travelers != ''">and Travelers = #{travelers}</if> </where> </select> <select id="getMaxId" resultType="java.lang.Long"> select max(ID) from service_reimbursement select max(ID) from service_reimbursement </select> <select id="selectSearchList" resultMap="ServiceReimbursementResult"> <include refid="selectServiceReimbursementVo"/> <where> <if test="createTime != null and createTime != ''" > and create_time >= #{searchstarttime} and create_time <= #{searchendtime} </if> <if test="travelers != null and travelers != ''"> and Travelers = #{travelers}</if> <if test="createTime != null and createTime != ''">and create_time >= #{searchstarttime} and create_time <= #{searchendtime} </if> <if test="travelers != null and travelers != ''">and Travelers = #{travelers}</if> </where> </select> <select id="getListBypower" statementType="CALLABLE" resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut"> <select id="getListBypower" statementType="CALLABLE" resultType="com.ruoyi.project.domain.vo.SpFinancialExpensesReimbursementOut"> call SP_FINANCIAL_EXPENSES(#{PAUSERNO,mode=IN,jdbcType=VARCHAR},#{PAFUNDTYPE,mode=IN,jdbcType=INTEGER},#{PAAPPLICANT,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONBEGTIME,mode=IN,jdbcType=VARCHAR},#{PAAPPLICATIONENDTIME,mode=IN,jdbcType=VARCHAR},#{PADEPARTMENT,mode=IN,jdbcType=VARCHAR},#{CHECKFLAG,mode=IN,jdbcType=INTEGER},#{APPLYTYPE,mode=IN,jdbcType=INTEGER}) </select> <select id="getInfoByInfoId" resultType="com.ruoyi.project.domain.ServiceReimbursement"> @@ -100,4 +155,34 @@ where infoid = #{infoid} and del_flag = '0' and costtype = "4" </select> <select id="getRDInfoByItem" resultType="com.ruoyi.project.domain.ServiceReimbursementEo"> SELECT a.id as id,a.UserNo as userno,a.FlowLevel as recordstatus,b.persontype as persontype,a.create_time as createTime, a.UserName as username,b.personname as travelers,a.AmountRequested as amountrequested,a.Reason as reason,a.Phone as phone,a.DepositBank as depositbank,a.BankCardNo as bankcardno,a.DonorName as donorname,b.trafficexpense as trafficexpense,b.hotelexpense as hotelexpense,b.FoodExpenses as foodexpenses, b.foodallowance as foodallowance, b.otherexpense as otherexpense,b.otherfeeamount as otherfeeamount FROM service_reimbursement a LEFT JOIN service_reimbursementdetail b on a.id=b.RBID where a.del_flag != 1 and b.del_flag!=1 <if test="id != null"> and a.id = #{id} </if> <if test='travelers != null and travelers != ""'> and b.personname=#{travelers} </if> <if test='username != null and username != ""'> and a.UserName=#{username} </if> <if test='recordstatus != null and recordstatus != ""'> and a.FlowLevel=#{recordstatus} </if> <if test='travelers != null and travelers != ""'> and b.personname=#{travelers} </if> <if test='starttime != null and endtime != ""'> and a.create_time BETWEEN #{starttime} AND #{endtime} </if> ORDER BY a.id desc </select> </mapper>