| | |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <!-- å¤çwordæä»¶ --> |
| | | <dependency> |
| | | <groupId>org.jxls</groupId> |
| | | <artifactId>jxls</artifactId> |
| | | <version>2.6.0</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>ch.qos.logback</groupId> |
| | | <artifactId>logback-core</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.jxls</groupId> |
| | | <artifactId>jxls-poi</artifactId> |
| | | <version>1.2.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>fr.opensagres.xdocreport</groupId> |
| | | <artifactId>fr.opensagres.xdocreport.core</artifactId> |
| | | <version>2.0.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>fr.opensagres.xdocreport</groupId> |
| | | <artifactId>fr.opensagres.xdocreport.document</artifactId> |
| | | <version>2.0.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>fr.opensagres.xdocreport</groupId> |
| | | <artifactId>fr.opensagres.xdocreport.template</artifactId> |
| | | <version>2.0.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>fr.opensagres.xdocreport</groupId> |
| | | <artifactId>fr.opensagres.xdocreport.document.docx</artifactId> |
| | | <version>2.0.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>fr.opensagres.xdocreport</groupId> |
| | | <artifactId>fr.opensagres.xdocreport.template.freemarker</artifactId> |
| | | <version>2.0.2</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.freemarker</groupId> |
| | | <artifactId>freemarker</artifactId> |
| | | <version>2.3.23</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>2.5</version> |
| | | </dependency> |
| | | <!-- <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-dependencies</artifactId> |
| | |
| | | public static final String YW_CONTRACT_BILL ="YW_CONTRACT_BILL" ; |
| | | public static final String YW_MATERIAL ="YW_MATERIAL" ; |
| | | public static final String YW_PROBLEM ="YW_PROBLEM" ; |
| | | public static final String YW_QUICK_MODEL ="YW_QUICK_MODEL" ; |
| | | |
| | | public static final String RESERVATION_TOTAL_NUM ="RESERVATION_TOTAL_NUM" ; |
| | | public static final String SIGN_IN_PLACE_LAT ="SIGN_IN_PLACE_LAT" ; |
| | |
| | | @ExcelColumn(name="é®ç®±") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ 0æªä½¿ç¨ 1å·²ä½¿ç¨ 2çå¾
åé") |
| | | @ExcelColumn(name="ç¶æ 0æªä½¿ç¨ 1å·²ä½¿ç¨ 2çå¾
åé") |
| | | @ApiModelProperty(value = "ç¶æ 0=æåï¼1=失败") |
| | | @ExcelColumn(name="ç¶æ 0=æåï¼1=失败") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0çä¿¡ 1é®ä»¶") |
| | |
| | | @ExcelColumn(name="å
³è对象ç¼ç ") |
| | | private Integer objId; |
| | | |
| | | @ApiModelProperty(value = "å
³è对象类å 0=éªè¯ç ï¼1=访客ä¸å¡ï¼2=访客æ¥å¤ï¼3=鿣鿿ï¼4=ç¨è½¦ç³è¯·ï¼5=ä¼è®®å®¤ä¿¡æ¯ï¼6=ç©æµè½¦é¢çº¦ï¼7=ç©æµè½¦ä½ä¸") |
| | | @ExcelColumn(name="å
³è对象类å 0=éªè¯ç ï¼1=访客ä¸å¡ï¼2=访客æ¥å¤ï¼3=鿣鿿ï¼4=ç¨è½¦ç³è¯·ï¼5=ä¼è®®å®¤ä¿¡æ¯ï¼6=ç©æµè½¦é¢çº¦ï¼7=ç©æµè½¦ä½ä¸;8=ä¼è®®å®¤ç³è¯·") |
| | | @ApiModelProperty(value = "å
³è对象类å 0=éªè¯ç ï¼1=å¬è´¹çä¿¡ï¼2=å¬è´¹é®ä»¶") |
| | | @ExcelColumn(name="å
³è对象类å 0=éªè¯ç ï¼1=å¬è´¹çä¿¡ï¼2=å¬è´¹é®ä»¶") |
| | | private String objType; |
| | | |
| | | @ApiModelProperty(value = "éä»¶éå") |
| | |
| | | @ExcelColumn(name="å
³è对象ç¼ç ") |
| | | private Integer objId; |
| | | |
| | | @ApiModelProperty(value = "å
³è对象类å 0=çç¹ä¸å¡ 1=å·¡æ£ä»»å¡") |
| | | @ApiModelProperty(value = "å
³è对象类å 0=çç¹ä¸å¡ 1=å·¡æ£ä»»å¡ 2=å·¥åä¸å¡") |
| | | @ExcelColumn(name="å
³è对象类å") |
| | | private Integer objType; |
| | | |
| | |
| | | @TableField(exist = false) |
| | | private String typeDetail; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ°1" ,notes = "å
³èåæ°1") |
| | | @ApiModelProperty(value = "å¾
忥æ" ,notes = "å
³èåæ°1") |
| | | @ExcelColumn(name="å
³èåæ°1") |
| | | private String param1; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ°2",notes = "å
³èåæ°2") |
| | | @ApiModelProperty(value = "jsonH5å±ç¤ºæ°æ®",notes = "å
³èåæ°2") |
| | | @ExcelColumn(name="å
³èåæ°2") |
| | | private String param2; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ°3",notes = "å
³èåæ°3") |
| | | @ExcelColumn(name="å
³èåæ°3") |
| | | @ApiModelProperty(value = "ä¸å¡ç¶æï¼0=å¾
å¤ç/æªå¼å§ï¼1=è¿è¡ä¸ï¼2=已宿/å·²å¤ç",notes = "å
³èåæ°3") |
| | | private String param3; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ°4") |
| | |
| | | throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN); |
| | | } |
| | | |
| | | if(isDebug == null || !isDebug){ |
| | | /*if(isDebug == null || !isDebug){ |
| | | //éªè¯ çä¿¡ç |
| | | SmsEmail model = smsEmailMapper.selectOne(new QueryWrapper<SmsEmail>().lambda() |
| | | .eq(SmsEmail::getType, Constants.ZERO) |
| | |
| | | model.setStatus(Constants.ONE); |
| | | model.setEditDate(new Date()); |
| | | smsEmailMapper.updateById(model); |
| | | } |
| | | }*/ |
| | | |
| | | Company company = new Company(); |
| | | if(Objects.nonNull(user.getCompanyId())){ |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.dto.YwSmsEmailBillCallDTO; |
| | | import com.doumee.dao.business.model.YwContractBill; |
| | | import com.doumee.dao.business.vo.YwContractBillCallDataVO; |
| | | import com.doumee.dao.business.vo.YwContractBillDataVO; |
| | | import com.doumee.service.business.YwContractBillService; |
| | | import com.doumee.service.business.impl.SmsEmailServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private YwContractBillService ywContractBillService; |
| | | |
| | | @Autowired |
| | | private SmsEmailServiceImpl smsEmailService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | |
| | | return ApiResponse.success(ywContractBillService.getNoticeCustomerData(billIds)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä¸è½½å¬è´¹æä»¶") |
| | | @PostMapping("/downloadCallFeeDoc") |
| | | @CloudRequiredPermission("business:ywcontractbill:query") |
| | | public void downloadCallFeeDoc(@RequestBody List<Integer> billIds,@RequestHeader(Constants.HEADER_USER_TOKEN) String token,HttpServletResponse response) { |
| | | ywContractBillService.downloadCallFeeDoc(billIds,getLoginUser(token),response); |
| | | } |
| | | |
| | | @ApiOperation("åéçä¿¡ä¸é®ä»¶") |
| | | @PostMapping("/sendSmsEmail") |
| | | @CloudRequiredPermission("business:ywcontractbill:query") |
| | | public ApiResponse sendSmsEmail(@RequestBody List<YwSmsEmailBillCallDTO> ywSmsEmailBillCallDTOList, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywContractBillService.sendSmsEmail(ywSmsEmailBillCallDTOList,smsEmailService,getLoginUser(token)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.YwDevice; |
| | | import com.doumee.dao.business.vo.YwDeviceCateDataVO; |
| | | import com.doumee.dao.business.vo.YwDeviceParentCateDataVO; |
| | | import com.doumee.dao.business.vo.YwDeviceStatusDataVO; |
| | | import com.doumee.service.business.YwDeviceService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @ApiOperation("è®¾å¤æ°éåç±»ç»è®¡") |
| | | @PostMapping("/getDeviceCateData") |
| | | @CloudRequiredPermission("business:ywdevice:query") |
| | | public ApiResponse<Set<YwDeviceCateDataVO>> getDeviceCateData (@RequestBody YwDevice ywDevice,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | public ApiResponse<Set<YwDeviceParentCateDataVO>> getDeviceCateData (@RequestBody YwDevice ywDevice, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywDeviceService.getDeviceCateData(ywDevice)); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.YwOutinboundRecord; |
| | | import com.doumee.service.business.YwOutinboundRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/01/06 14:28 |
| | | */ |
| | | @Api(tags = "è¿ç»´åºå
¥åºä¿¡æ¯æç»è¡¨") |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywOutinboundRecord") |
| | | public class YwOutinboundRecordCloudController extends BaseController { |
| | | |
| | | @Autowired |
| | | private YwOutinboundRecordService ywOutinboundRecordService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:ywoutinboundrecord:create") |
| | | public ApiResponse create(@RequestBody YwOutinboundRecord ywOutinboundRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywOutinboundRecordService.create(ywOutinboundRecord)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:ywoutinboundrecord:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywOutinboundRecordService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:ywoutinboundrecord:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | ywOutinboundRecordService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:ywoutinboundrecord:update") |
| | | public ApiResponse updateById(@RequestBody YwOutinboundRecord ywOutinboundRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywOutinboundRecordService.updateById(ywOutinboundRecord); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:ywoutinboundrecord:query") |
| | | public ApiResponse<PageData<YwOutinboundRecord>> findPage (@RequestBody PageWrap<YwOutinboundRecord> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywOutinboundRecordService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:ywoutinboundrecord:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<YwOutinboundRecord> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ExcelExporter.build(YwOutinboundRecord.class).export(ywOutinboundRecordService.findPage(pageWrap).getRecords(), "è¿ç»´åºå
¥åºä¿¡æ¯æç»è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:ywoutinboundrecord:query") |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywOutinboundRecordService.findById(id)); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | |
| | | |
| | | @ApiOperation("æ«ç è·åå·¡æ£ç¹ä»»å¡ä¿¡æ¯") |
| | | @PostMapping("/getPointRecordByCode") |
| | | @CloudRequiredPermission("business:ywpatroltaskrecord:update") |
| | | public ApiResponse<YwPatrolTaskRecord> getPointRecordByCode(@RequestBody YwPatrolTaskRecord ywPatrolTaskRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success("æ¥è¯¢æå",ywPatrolTaskRecordService.getPointRecordByCode(ywPatrolTaskRecord)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ«ç è·åå·¡æ£ç¹ä»»å¡ä¿¡æ¯") |
| | | @PostMapping("/getRecordByUserPoint") |
| | | public ApiResponse<YwPatrolTaskRecord> getRecordByUserPoint(@RequestBody YwPatrolTaskRecord ywPatrolTaskRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success("æ¥è¯¢æå",ywPatrolTaskRecordService.getRecordByUserPoint(ywPatrolTaskRecord,getLoginUser(token))); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Autowired |
| | | private YwWorkorderServiceImpl ywWorkorderService; |
| | | |
| | | @LoginNoRequired |
| | | @PreventRepeat |
| | | @ApiOperation("é®é¢ææ¥") |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @ApiOperation("转工å") |
| | | @PostMapping("/editProblem") |
| | | @CloudRequiredPermission("business:ywproblem:update") |
| | | public ApiResponse editProblem(@RequestBody YwProblem ywProblem,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:ywproblem:query") |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywProblemService.getDetail(id)); |
| | | return ApiResponse.success(ywProblemService.getDetail(id,null)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("æ ¹æ®å·¥åæ¥è¯¢") |
| | | @GetMapping("/getByWorkorderId") |
| | | @CloudRequiredPermission("business:ywproblem:query") |
| | | public ApiResponse getByWorkorderId(@RequestParam Integer workorderId,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywProblemService.getDetail(null,workorderId)); |
| | | } |
| | | |
| | | } |
| | |
| | | return ApiResponse.success(ywProjectService.projectTree(dataDTO)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:ywproject:exportExcel") |
| | |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:ywstock:create") |
| | | public ApiResponse create(@RequestBody YwStock ywStock) { |
| | | public ApiResponse create(@RequestBody YwStock ywStock,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywStockService.create(ywStock)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:ywstock:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywStockService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:ywstock:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:ywstock:update") |
| | | public ApiResponse updateById(@RequestBody YwStock ywStock) { |
| | | public ApiResponse updateById(@RequestBody YwStock ywStock,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywStockService.updateById(ywStock); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:ywstock:query") |
| | | public ApiResponse<PageData<YwStock>> findPage (@RequestBody PageWrap<YwStock> pageWrap) { |
| | | public ApiResponse<PageData<YwStock>> findPage (@RequestBody PageWrap<YwStock> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywStockService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:ywstock:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<YwStock> pageWrap, HttpServletResponse response) { |
| | | public void exportExcel (@RequestBody PageWrap<YwStock> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ExcelExporter.build(YwStock.class).export(ywStockService.findPage(pageWrap).getRecords(), "è¿ç»´åºåä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:ywstock:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywStockService.findById(id)); |
| | | } |
| | | } |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.YwOutinbound; |
| | | import com.doumee.dao.business.model.YwStocktaking; |
| | | import com.doumee.service.business.YwOutinboundService; |
| | | import com.doumee.service.business.YwStocktakingService; |
| | | import com.doumee.service.business.impl.YwOutinboundServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | |
| | | |
| | | @Autowired |
| | | private YwStocktakingService ywStocktakingService; |
| | | |
| | | @Autowired |
| | | private YwOutinboundServiceImpl ywOutinboundService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:ywstocktaking:query") |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | public ApiResponse<YwStocktaking> findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywStocktakingService.getDetail(id)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/finishById") |
| | | @CloudRequiredPermission("business:ywstocktaking:delete") |
| | | public ApiResponse finishById(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywStocktakingService.finishById(id,getLoginUser(token)); |
| | | ywStocktakingService.finishById(id,ywOutinboundService,getLoginUser(token)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.dto.YwCallTempDataDTO; |
| | | import com.doumee.dao.business.model.YwTempConfig; |
| | | import com.doumee.dao.business.vo.YwCallTempDataVO; |
| | | import com.doumee.service.business.YwTempConfigService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:ywtempconfig:create") |
| | | public ApiResponse create(@RequestBody YwTempConfig ywTempConfig) { |
| | | @CloudRequiredPermission("business:ywtempconfig:create") |
| | | public ApiResponse create(@RequestBody YwTempConfig ywTempConfig,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywTempConfigService.create(ywTempConfig)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:ywtempconfig:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | @CloudRequiredPermission("business:ywtempconfig:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywTempConfigService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:ywtempconfig:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | @CloudRequiredPermission("business:ywtempconfig:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:ywtempconfig:update") |
| | | public ApiResponse updateById(@RequestBody YwTempConfig ywTempConfig) { |
| | | @CloudRequiredPermission("business:ywtempconfig:update") |
| | | public ApiResponse updateById(@RequestBody YwTempConfig ywTempConfig,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywTempConfigService.updateById(ywTempConfig); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:ywtempconfig:query") |
| | | public ApiResponse<PageData<YwTempConfig>> findPage (@RequestBody PageWrap<YwTempConfig> pageWrap) { |
| | | @CloudRequiredPermission("business:ywtempconfig:query") |
| | | public ApiResponse<PageData<YwTempConfig>> findPage (@RequestBody PageWrap<YwTempConfig> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywTempConfigService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:ywtempconfig:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<YwTempConfig> pageWrap, HttpServletResponse response) { |
| | | @CloudRequiredPermission("business:ywtempconfig:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<YwTempConfig> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ExcelExporter.build(YwTempConfig.class).export(ywTempConfigService.findPage(pageWrap).getRecords(), "å¬ç¼´ä¿¡æ¯é
ç½®", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:ywtempconfig:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | @CloudRequiredPermission("business:ywtempconfig:query") |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywTempConfigService.findById(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @ApiOperation("è·åé
置信æ¯") |
| | | @GetMapping("/getCallTemp") |
| | | @RequiresPermissions("business:ywtempconfig:query") |
| | | public ApiResponse<YwCallTempDataVO> getCallTemp() { |
| | | @CloudRequiredPermission("business:ywtempconfig:query") |
| | | public ApiResponse<YwCallTempDataVO> getCallTemp(@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywTempConfigService.getCallTemp()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ´æ°é
置模æ¿ä¿¡æ¯") |
| | | @PostMapping("/updTempConfig") |
| | | @CloudRequiredPermission("business:ywtempconfig:update") |
| | | public ApiResponse updTempConfig (@RequestBody YwCallTempDataDTO ywCallTempDataDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ywTempConfigService.updTempConfig(ywCallTempDataDTO); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.dao.business.model.YwQuickModel; |
| | | import com.doumee.dao.business.vo.MonthDataResponse; |
| | | import com.doumee.dao.business.vo.WorkDeskDataResponse; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.service.business.WorkbenchesService; |
| | | import com.doumee.service.business.YwPatrolTaskRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | return ApiResponse.success(workbenchesService.getYwQuickList(getLoginUser(token))); |
| | | } |
| | | |
| | | @ApiOperation("è·åé»è®¤å¿«æ·è忍¡åä¿¡æ¯") |
| | | @GetMapping("/getDefaultYwQuickList") |
| | | public ApiResponse<List<YwQuickModel>> getDefaultYwQuickList() { |
| | | return ApiResponse.success(workbenchesService.getYwQuickList(null)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ´æ°å¿«æ·æ¨¡åæ°æ®") |
| | | @GetMapping("/updMyYwQuickModel") |
| | | @PostMapping("/updMyYwQuickModel") |
| | | public ApiResponse updMyYwQuickModel(@RequestBody List<Integer> idList,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | workbenchesService.updMyYwQuickModel(idList,getLoginUser(token)); |
| | | return ApiResponse.success("æä½æå"); |
| | |
| | | return ApiResponse.success(workbenchesService.workDeskData(getLoginUser(token))); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("H5-æçå¾
å") |
| | | @PostMapping("/myNoticesH5") |
| | | public ApiResponse<PageData<Notices>> myNoticesH5 (@RequestBody PageWrap<Notices> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(workbenchesService.getMyNotices(pageWrap,getLoginUser(token))); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.YwTempConfig; |
| | | import fr.opensagres.xdocreport.document.IXDocReport; |
| | | import fr.opensagres.xdocreport.document.registry.XDocReportRegistry; |
| | | import fr.opensagres.xdocreport.template.IContext; |
| | | import fr.opensagres.xdocreport.template.TemplateEngineKind; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.xwpf.usermodel.XWPFDocument; |
| | | import org.apache.poi.xwpf.usermodel.XWPFParagraph; |
| | | import org.apache.poi.xwpf.usermodel.XWPFRun; |
| | |
| | | |
| | | |
| | | |
| | | public static String modifyWordTemplate(String templatePath, List<YwTempConfig> ywTempConfigList,String fileName) { |
| | | public static String modifyWordTemplate_old(String templatePath, List<YwTempConfig> ywTempConfigList,String fileName) { |
| | | try ( |
| | | XWPFDocument document = new XWPFDocument(getFileInputStream(templatePath))) { |
| | | // æ¤å¤è¿æ¥å°åç»æ¿æ¢æ¥éª¤ |
| | |
| | | for (XWPFRun run : paragraph.getRuns()) { |
| | | // æ¿æ¢å ä½ç¬¦ |
| | | String text = run.getText(0); |
| | | System.out.println(text); |
| | | if (text != null) { |
| | | for (YwTempConfig ywTempConfig:ywTempConfigList |
| | | ) { |
| | | text = text.replace(ywTempConfig.getTitle(), ywTempConfig.getUrl()); |
| | | for (YwTempConfig ywTempConfig:ywTempConfigList) { |
| | | if(StringUtils.isNotBlank(ywTempConfig.getUrl())){ |
| | | text = text.replace(ywTempConfig.getTitle(), ywTempConfig.getUrl()); |
| | | }else{ |
| | | text = text.replace(ywTempConfig.getTitle(), ""); |
| | | } |
| | | |
| | | } |
| | | run.setText(text, 0); // éæ°è®¾ç½®ææ¬ |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æä»¶è½¬æ¢å¼å¸¸!"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public static String modifyWordTemplate(String templatePath, List<YwTempConfig> ywTempConfigList,String fileName,String zipFilePath) { |
| | | InputStream ins = null; |
| | | OutputStream out = null; |
| | | try{ |
| | | //è·åWord模æ¿ï¼æ¨¡æ¿åæ¾è·¯å¾å¨é¡¹ç®çresourcesç®å½ä¸ |
| | | ins = getFileInputStream(templatePath) ; |
| | | // ins = new FileInputStream("D:\\3.docx"); |
| | | //注åxdocreportå®ä¾å¹¶å è½½FreeMarker模æ¿å¼æ |
| | | IXDocReport report = XDocReportRegistry.getRegistry().loadReport(ins, |
| | | TemplateEngineKind.Freemarker); |
| | | //å建xdocreportä¸ä¸æå¯¹è±¡ |
| | | IContext context = report.createContext(); |
| | | for (YwTempConfig ywTempConfig:ywTempConfigList) { |
| | | if(StringUtils.isBlank(ywTempConfig.getUrl())){ |
| | | ywTempConfig.setUrl("-"); |
| | | } |
| | | context.put(ywTempConfig.getTitle().replace("${","").replace("}",""), ywTempConfig.getUrl()); |
| | | } |
| | | String path = zipFilePath + fileName; |
| | | out = new FileOutputStream(new File(path)); |
| | | report.process(context, out); |
| | | return path; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (null != ins) { |
| | | try { |
| | | ins.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /*读åç½ç»æä»¶*/ |
| | | public static InputStream getFileInputStream(String path) { |
| | | URL url = null; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.doumee.dao.business.model.YwTempConfig; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2025/1/8 15:32 |
| | | */ |
| | | @Data |
| | | public class YwCallTempDataDTO { |
| | | |
| | | @ApiModelProperty(value = "çæ¯æ¨¡æ¿", example = "1") |
| | | private YwTempConfig smsTemp; |
| | | |
| | | @ApiModelProperty(value = "é®ä»¶ä¿¡æ¯æ¨¡æ¿", example = "1") |
| | | private YwTempConfig emailTemp; |
| | | |
| | | @ApiModelProperty(value = "ç§èµéç¥å模æ¿", example = "1") |
| | | private YwTempConfig leaseTemp; |
| | | |
| | | @ApiModelProperty(value = "å
¶ä»éç¥å模æ¿", example = "1") |
| | | private YwTempConfig otherTemp; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.core.model.LoginUserModel; |
| | | import com.doumee.dao.business.model.YwContractBill; |
| | | import com.doumee.dao.business.model.YwContractRevenue; |
| | | import com.doumee.dao.business.model.YwContractRoom; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è¿ç»´ååè´¦åä¿¡æ¯è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/11/19 16:07 |
| | | */ |
| | | @Data |
| | | public class YwContractBillDTO { |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "计å仿¬¾æ¥") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planPayDate; |
| | | |
| | | @ApiModelProperty(value = "æåºç ", example = "1") |
| | | private Integer sortnum; |
| | | |
| | | @ApiModelProperty(value = "è´¦åéé¢", example = "1") |
| | | private BigDecimal totleFee; |
| | | |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»åï¼0=ç§èµè´¹ï¼1=ç©ä¸è´¹ï¼2=ç§èµæ¼éï¼3=ç©ä¸æ¼éï¼4=æ°´çµè´¹ï¼5=æé¡¹è´¹ï¼6=å
¶ä»; 7=ä¿è¯é", example = "1") |
| | | private Integer costType; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @date 2023/02/14 11:14 |
| | | */ |
| | | @Data |
| | | public class YwSmsEmailBillCallDTO implements Serializable { |
| | | public class YwSmsEmailBillCallDTO{ |
| | | |
| | | @ApiModelProperty(value = "æ¥æ¶äººä¸»é®" ) |
| | | private Integer userId; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.core.model.LoginUserModel; |
| | | import com.doumee.dao.business.dto.YwContractBillDTO; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ExcelColumn(name="ç©ä¸ç§èµæ¡æ¬¾ä»·æ ¼åä½") |
| | | private Integer wyFirstCircle; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç§èµæ¯ä»æ¹å¼ 0=䏿¬¡æ§ä»æ¬¾ï¼1=æ¯ä¸ä¸ªæä¸ä»ï¼2=å
个æä¸ä»ï¼3=ä¸å¹´ä¸ä»", example = "1") |
| | | @ExcelColumn(name="ç§èµæ¯ä»æ¹å¼ 0=䏿¬¡æ§ä»æ¬¾ï¼1=æ¯ä¸ä¸ªæä¸ä»ï¼2=å
个æä¸ä»ï¼3=ä¸å¹´ä¸ä»") |
| | | private Integer zlPayType; |
| | |
| | | @ApiModelProperty(value = "æ¿é´ä¸»é® æ¥è¯¢ä½¿ç¨") |
| | | @TableField(exist = false) |
| | | private Integer roomId; |
| | | @ApiModelProperty(value = "楼å®ä¸»é® æ¥è¯¢ä½¿ç¨") |
| | | @TableField(exist = false) |
| | | private Integer buildingId; |
| | | @ApiModelProperty(value = "éä»¶éå") |
| | | @TableField(exist = false) |
| | | private List<Multifile> fileList; |
| | |
| | | @ApiModelProperty(value = "éç§æ¶æ°å¢çæ¶ä»æ¬¾è´¦å") |
| | | @TableField(exist = false) |
| | | private List<YwContractBill> addBillList; |
| | | @ApiModelProperty(value = "ç§èµå¤©æ°", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer leaseDays; |
| | | @ApiModelProperty(value = "ç§èµåä»·ï¼å
ï¼", example = "1") |
| | | @TableField(exist = false) |
| | | private BigDecimal leasePrice; |
| | | @ApiModelProperty(value = "å½åæ¯æéæ¬¾ä¿®æ¹éé¢çè´¦åéå") |
| | | @TableField(exist = false) |
| | | private List<YwContractBill> canBackRentBills; |
| | | |
| | | @ApiModelProperty(value = "ååå建账åä¿¡æ¯") |
| | | @TableField(exist = false) |
| | | private List<YwContractBillDTO> ywContractBillDTOList; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç§èµè´¹è´¦å",hidden = true) |
| | | @TableField(exist = false) |
| | | private List<YwContractBillDTO> zlBillDTOList; |
| | | @ApiModelProperty(value = "ç©ä¸è´¹è´¦å",hidden = true) |
| | | @TableField(exist = false) |
| | | private List<YwContractBillDTO> wyBillDTOList; |
| | | @ApiModelProperty(value = "ç©ä¸æ¼éè´¦å",hidden = true) |
| | | @TableField(exist = false) |
| | | private YwContractBillDTO wyBillDTO; |
| | | @ApiModelProperty(value = "ç§èµæ¼éè´¦å",hidden = true) |
| | | @TableField(exist = false) |
| | | private YwContractBillDTO zlBillDTO; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "éç§ç»ç®éé¢å计", example = "1") |
| | | @ExcelColumn(name="éç§ç»ç®éé¢å计") |
| | | private BigDecimal btFee; |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°ï¼ä»æ¬¾æ¹ï¼", example = "1") |
| | | @ExcelColumn(name="客æ·åç§°",index = 0,width = 10) |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private Integer customerId; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦åéé®ä»¶ï¼0=å¦ï¼1=æ¯", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer isSendEmail; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦åéçä¿¡ï¼0=å¦ï¼1=æ¯", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer isSendSms; |
| | | |
| | | @ApiModelProperty(value = "å
¬å¸åç§°", example = "1") |
| | | @TableField(exist = false) |
| | |
| | | @ApiModelProperty(value = "ç»´ä¿è¯´æ") |
| | | private String maintenanceContent; |
| | | |
| | | @ApiModelProperty(value = "è´å
¥æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date buyDate; |
| | | |
| | | @ApiModelProperty(value = "åç±»åç§°") |
| | | @TableField(exist = false) |
| | | private String categoryName; |
| | |
| | | @TableField(exist = false) |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "ç»´ä¿äººååç§°") |
| | | @TableField(exist = false) |
| | | private String maintenanceUserName; |
| | | |
| | | @ApiModelProperty(value = "å¾çå°å") |
| | | @TableField(exist = false) |
| | | private String fileUrl; |
| | |
| | | private List<Multifile> multifileList; |
| | | |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | @TableField(exist = false) |
| | | private String projectName; |
| | | @ApiModelProperty(value = "楼å®åç§°") |
| | | @TableField(exist = false) |
| | | private String buildingName; |
| | | @ApiModelProperty(value = "楼å±åç§°") |
| | | @TableField(exist = false) |
| | | private String floorName; |
| | | @ApiModelProperty(value = "æ¿é´åç§°") |
| | | @TableField(exist = false) |
| | | private String roomName; |
| | | |
| | | |
| | | // @ApiModelProperty(value = "éä»¶ä¿¡æ¯") |
| | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "åæ®æ¥æ") |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date doneDate; |
| | | |
| | | @ApiModelProperty(value = "ä¸çº§åç±»åç§°") |
| | |
| | | @TableField(exist = false) |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0éè´å
¥åº 1é¢ç¨éå 2è°æ´å
¥åº 3å
¶ä»å
¥åº 4ççå
¥åº 5é¢ç¨åºåº 6ä»åºåºåº 7è°æ´åºåº 8éè´åºåº 9å
¶ä»åºåº 10çäºåºåº", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "åæ®æ¥æ å¼å§ yyyy-MM-dd", example = "1") |
| | | @TableField(exist = false) |
| | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ 0å¯ç¨ 1ç¦ç¨", example = "1") |
| | | @ApiModelProperty(value = "ç¶æ 0å¯ç¨ 1ç¦ç¨ ", example = "1") |
| | | @ExcelColumn(name="ç¶æ",index = 8,width = 6,valueMapping = "0=å¯ç¨;1=åç¨;") |
| | | private Integer status; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "ææ¥æ¶é´") |
| | | @ExcelColumn(name="ææ¥æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date submitDate; |
| | | |
| | | @ApiModelProperty(value = "ç¼å·") |
| | |
| | | @TableField(exist = false) |
| | | private Integer workOrderFloorId; |
| | | |
| | | @ApiModelProperty(value = "æå±é¡¹ç®ç¼ç ", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer workOrderProjectId; |
| | | |
| | | @ApiModelProperty(value = "æå±æ¥¼å®ç¼ç ", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer workOrderBuildId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å·¥ååç±»ç¼ç (å
³ècategoryï¼", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer workOrderCateId; |
| | |
| | | @TableField(exist = false) |
| | | private String floorName; |
| | | |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="å·¥ååç±»",index = 3,width = 10) |
| | | @TableField(exist = false) |
| | | private String categoryName; |
| | | @ApiModelProperty(value = "å·¥åç¶çº§åç±»") |
| | | @TableField(exist = false) |
| | | private String categoryParentName; |
| | | @ApiModelProperty(value = "åé
人å§å") |
| | | @TableField(exist = false) |
| | | private String dispatchUserName; |
| | |
| | | package com.doumee.dao.business.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.dao.business.model.Approve; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "é¢ç§¯") |
| | | private BigDecimal area; |
| | | |
| | | @ApiModelProperty(value = "ç§èµç¶æï¼0=å¾
ç§èµï¼1=å·²ç§èµ ;2=æªå¼å¯ç§èµ", example = "1") |
| | | private Integer leaseStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç¶çº§ä¸»é®") |
| | | private Integer pId; |
| | | |
| | |
| | | @ApiModelProperty(value = "楼å±åç§°", example = "1") |
| | | private String floorName; |
| | | |
| | | @ApiModelProperty(value = "æ¥¼å±æ°", example = "1") |
| | | private Integer floor; |
| | | |
| | | @ApiModelProperty(value = "æ¿é´ç¶ææ°æ®", example = "1") |
| | | private List<YwRoomStatusDataVO> ywRoomStatusDataVOList; |
| | | |
| | |
| | | @ApiModelProperty(value = "å¯æåæ¿æºæ°", example = "1") |
| | | private Integer investmentRoomAmount; |
| | | |
| | | @ApiModelProperty(value = "å¨ç§æ¯å¤©éé¢", example = "1" ,hidden = true) |
| | | private BigDecimal leaseDayPrice; |
| | | |
| | | @ApiModelProperty(value = "å¨ç§å®æ¶åä»·", example = "1") |
| | | private BigDecimal leasePrice; |
| | | |
| | |
| | | @ApiModelProperty(value = "ç§å®¢åç§°", example = "1") |
| | | private String customerName; |
| | | |
| | | @ApiModelProperty(value = "æ¿é´ç¶æï¼0=å¾
ç§ï¼1=å·²ç§ï¼2=å³å°å°æ", example = "1") |
| | | @ApiModelProperty(value = "æ¿é´ç¶æï¼0=å¾
ç§ï¼1=å·²ç§ï¼2=å³å°å°æï¼", example = "1") |
| | | private Integer roomStatus; |
| | | |
| | | @ApiModelProperty(value = "å°ææ¥æ", example = "1") |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.YwQuickModel; |
| | | import com.doumee.dao.business.vo.MonthDataResponse; |
| | | import com.doumee.dao.business.vo.WorkDeskDataResponse; |
| | | import com.doumee.dao.system.model.Notices; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | WorkDeskDataResponse workDeskData(LoginUserInfo loginUserInfo); |
| | | |
| | | PageData<Notices> getMyNotices(PageWrap<Notices> pageWrap, LoginUserInfo loginUserInfo); |
| | | } |
| | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.dto.YwSmsEmailBillCallDTO; |
| | | import com.doumee.dao.business.model.YwContractBill; |
| | | import com.doumee.dao.business.vo.YwContractBillCallDataVO; |
| | | import com.doumee.dao.business.vo.YwContractBillDataVO; |
| | | import com.doumee.service.business.impl.SmsEmailServiceImpl; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | |
| | | |
| | | void downloadCallFeeDoc(List<Integer> billIds, LoginUserInfo loginUserInfo, HttpServletResponse response); |
| | | |
| | | |
| | | void sendSmsEmail(List<YwSmsEmailBillCallDTO> ywSmsEmailBillCallDTOList, SmsEmailServiceImpl smsEmailService, LoginUserInfo loginUserInfo); |
| | | |
| | | } |
| | |
| | | import com.doumee.dao.business.model.YwDevice; |
| | | import com.doumee.dao.business.vo.YwDeviceCateDataVO; |
| | | import com.doumee.dao.business.vo.YwDeviceDataVO; |
| | | import com.doumee.dao.business.vo.YwDeviceParentCateDataVO; |
| | | import com.doumee.dao.business.vo.YwDeviceStatusDataVO; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | YwDevice findByCode(String deviceCode); |
| | | |
| | | Set<YwDeviceCateDataVO> getDeviceCateData(YwDevice model); |
| | | Set<YwDeviceParentCateDataVO> getDeviceCateData(YwDevice model); |
| | | |
| | | YwDeviceStatusDataVO getDeviceStatus(YwDevice model); |
| | | } |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.YwPatrolTaskRecord; |
| | |
| | | YwPatrolTaskRecord getDetail(Integer id); |
| | | |
| | | YwPatrolTaskRecord getPointRecordByCode(YwPatrolTaskRecord bean); |
| | | |
| | | YwPatrolTaskRecord getRecordByUserPoint(YwPatrolTaskRecord bean, LoginUserInfo loginUserInfo); |
| | | } |
| | |
| | | */ |
| | | YwProblem findById(Integer id); |
| | | |
| | | YwProblem getDetail(Integer id); |
| | | YwProblem getDetail(Integer id,Integer workorderId); |
| | | |
| | | |
| | | /** |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.YwStocktaking; |
| | | import com.doumee.service.business.impl.YwOutinboundServiceImpl; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | void beginById(Integer id, LoginUserInfo loginUserInfo); |
| | | |
| | | void finishById(Integer id, LoginUserInfo loginUserInfo); |
| | | void finishById(Integer id, YwOutinboundServiceImpl ywOutinboundService,LoginUserInfo loginUserInfo); |
| | | /** |
| | | * å é¤ |
| | | * |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.dto.YwCallTempDataDTO; |
| | | import com.doumee.dao.business.model.YwTempConfig; |
| | | import com.doumee.dao.business.vo.YwCallTempDataVO; |
| | | |
| | |
| | | long count(YwTempConfig ywTempConfig); |
| | | |
| | | YwCallTempDataVO getCallTemp(); |
| | | |
| | | void updTempConfig(YwCallTempDataDTO ywCallTempDataDTO); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Integer sendBillSms(String content,String mobile,Integer billId) { |
| | | boolean result = true; |
| | | if(StringUtils.isBlank(mobile)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | result = false; |
| | | } |
| | | boolean result= emayService.sendSingleSms(mobile,content); |
| | | if(!result){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼çä¿¡åé失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | if(result){ |
| | | result = emayService.sendSingleSms(mobile,content); |
| | | } |
| | | SmsEmail smsEmail = new SmsEmail(); |
| | | smsEmail.setIsdeleted(Constants.ZERO); |
| | | smsEmail.setCreateDate(new Date()); |
| | | smsEmail.setStatus(Constants.ZERO); |
| | | smsEmail.setStatus(result?Constants.ZERO:Constants.ONE); |
| | | smsEmail.setType(Constants.ZERO); |
| | | smsEmail.setRemark(result?"çä¿¡åéæå":"çä¿¡åé失败"); |
| | | smsEmail.setTitle("è´¦åå¬è´¹"); |
| | | smsEmail.setObjId(billId); |
| | | smsEmail.setObjType(Constants.ZERO+""); |
| | | smsEmail.setObjType(Constants.ONE+""); |
| | | smsEmail.setContent(content); |
| | | smsEmailMapper.insert(smsEmail); |
| | | return smsEmail.getId(); |
| | |
| | | |
| | | @Override |
| | | public Integer sendEmail(String email,String content,Integer billId) { |
| | | boolean result = true; |
| | | if(StringUtils.isBlank(email)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | result = false; |
| | | } |
| | | boolean result= emailService.sendEmail(email,"è´¦åå¬è´¹",content,null); |
| | | if(result){ |
| | | result= emailService.sendEmail(email,"è´¦åå¬è´¹",content,null); |
| | | } |
| | | SmsEmail smsEmail = new SmsEmail(); |
| | | smsEmail.setRemark("é®ä»¶åçæå"); |
| | | if(!result){ |
| | | smsEmail.setRemark("é®ä»¶åç失败"); |
| | | } |
| | | smsEmail.setRemark(result?"é®ä»¶åéæå":"é®ä»¶åé失败"); |
| | | smsEmail.setIsdeleted(Constants.ZERO); |
| | | smsEmail.setCreateDate(new Date()); |
| | | smsEmail.setStatus(Constants.ONE); |
| | | smsEmail.setStatus(result?Constants.ZERO:Constants.ONE); |
| | | smsEmail.setType(Constants.TWO); |
| | | smsEmail.setObjId(billId); |
| | | smsEmail.setObjType(Constants.ONE+""); |
| | | smsEmail.setObjType(Constants.TWO+""); |
| | | smsEmail.setContent(content); |
| | | smsEmailMapper.insert(smsEmail); |
| | | return smsEmail.getId(); |
| | |
| | | |
| | | import com.alibaba.druid.sql.visitor.functions.Concat; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.LoginUserModel; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.MonthDataResponse; |
| | |
| | | import com.doumee.service.business.WorkbenchesService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import io.jsonwebtoken.lang.Objects; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.tomcat.util.bcel.classfile.Constant; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private YwStocktakingMapper ywStocktakingMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<YwQuickModel> getYwQuickList(LoginUserInfo loginUserInfo){ |
| | | List<YwQuickModel> ywQuickModelList = ywQuickModelMapper.selectList(new QueryWrapper<YwQuickModel>().lambda() |
| | | .eq(YwQuickModel::getIsdeleted, Constants.ZERO) |
| | | .eq(YwQuickModel::getUserId,loginUserInfo.getId()) |
| | | .isNull(YwQuickModel::getUserId) |
| | | .orderByAsc(YwQuickModel::getSort) |
| | | ); |
| | | if(CollectionUtils.isEmpty(ywQuickModelList)){ |
| | | ywQuickModelList = ywQuickModelMapper.selectList(new QueryWrapper<YwQuickModel>().lambda() |
| | | if(Objects.nonNull(loginUserInfo)){ |
| | | List<YwQuickModel> userModelList = ywQuickModelMapper.selectList(new QueryWrapper<YwQuickModel>().lambda() |
| | | .eq(YwQuickModel::getIsdeleted, Constants.ZERO) |
| | | .isNull(YwQuickModel::getUserId) |
| | | .eq(YwQuickModel::getUserId,loginUserInfo.getId()) |
| | | .orderByAsc(YwQuickModel::getSort) |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(userModelList)){ |
| | | ywQuickModelList = userModelList; |
| | | } |
| | | } |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_QUICK_MODEL).getCode(); |
| | | for (YwQuickModel ywQuickModel:ywQuickModelList) { |
| | | ywQuickModel.setIcoPath(path + ywQuickModel.getIcoPath()); |
| | | } |
| | | return ywQuickModelList; |
| | | } |
| | |
| | | .isNull(YwQuickModel::getUserId) |
| | | .orderByAsc(YwQuickModel::getSort) |
| | | ); |
| | | if(CollectionUtils.isEmpty(ywQuickModelList) || Constants.equalsInteger(idList.size(),ywQuickModelList.size())){ |
| | | if(CollectionUtils.isEmpty(ywQuickModelList) ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å¿«æ·æ¨¡åé
ç½®å¼å¸¸,请è系管çå"); |
| | | } |
| | | ywQuickModelMapper.delete(new QueryWrapper<YwQuickModel>().lambda().eq(YwQuickModel::getUserId,loginUserInfo.getId())); |
| | |
| | | .eq(Notices::getUserId,loginUserInfo.getId()) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .like(Notices::getParam1,yearMonth) |
| | | .ne(Notices::getObjType,Constants.TWO) |
| | | ); |
| | | for (String str:dataList) { |
| | | MonthDataResponse monthDataResponse = new MonthDataResponse(); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public PageData<Notices> getMyNotices(PageWrap<Notices> pageWrap,LoginUserInfo loginUserInfo) { |
| | | IPage<Notices> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<Notices> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Notices model = pageWrap.getModel(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.selectAll(Notices.class) |
| | | .eq(Notices::getUserId,loginUserInfo.getId()) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getStatus()),Notices::getStatus,model.getStatus()) |
| | | .apply(" param1 <= CURDATE() ") |
| | | .orderByAsc(Notices::getReaded) |
| | | .orderByDesc(Notices::getId); |
| | | PageData<Notices> pageData = PageData.from(noticesJoinMapper.selectJoinPage(page,Notices.class, queryWrapper)); |
| | | return pageData; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | .selectAs(YwProject::getName,YwBuilding::getProjectName) |
| | | .select(" (select ifnull(sum(y.FEE_AREA),0) from yw_room y where y.ISDELETED = 0 and y.status = 0 and y.IS_INVESTMENT = 1 and y.BUILDING_ID = t.id ) ",YwBuilding::getRoomFeeArea) |
| | | .select(" (select ifnull(sum(y.RENT_AREA),0) from yw_room y where y.ISDELETED = 0 and y.status = 0 and y.IS_INVESTMENT = 1 and y.BUILDING_ID = t.id ) ",YwBuilding::getRoomRentArea) |
| | | .select("",YwBuilding::getRoomFeeArea) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwBuilding::getProjectId) |
| | | .eq(YwBuilding::getId,id) |
| | | .last(" limit 1 ") |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | private YwContractMapper ywContractMapper; |
| | | |
| | | @Autowired |
| | | private YwAccountMapper ywAccountMapper; |
| | | |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Autowired |
| | | private YwTempConfigMapper ywTempConfigMapper; |
| | | |
| | | |
| | | @Value("${zip_file_path}") |
| | | private String zipFilePath; |
| | | |
| | | @Override |
| | | public Integer create(YwContractBill ywContractBill) { |
| | |
| | | .selectAs(YwContractDetail::getType,YwContractBill::getDetailType) |
| | | .selectAs(YwContract::getZlPayType,YwContractBill::getZlPayType) |
| | | .selectAs(YwContract::getWyPayType,YwContractBill::getWyPayType) |
| | | .select(" ( select ifnull(sum(r.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 0 and yr.type = 0 ) " , YwContractBill::getTotalArea) |
| | | .select(" ( select ifnull(sum(y.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 0 and yr.type = 0 ) " , YwContractBill::getTotalArea) |
| | | .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId) |
| | | .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId) |
| | | .leftJoin(YwContractDetail.class,YwContractDetail::getId,YwContractBill::getDetailId) |
| | | .in(YwContractBill::getId,billIds) |
| | | ); |
| | | this.dealRoomDetail(ywContractBillList); |
| | | List<YwTempConfig> ywTempConfigList = ywTempConfigMapper.selectList(new QueryWrapper<YwTempConfig>().lambda().eq(YwTempConfig::getIsdeleted,Constants.ZERO)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywTempConfigList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªæ¥è¯¢å°æ¨¡æ¿é
置项,请è系管çå"); |
| | |
| | | } |
| | | List<File> fileList = new ArrayList<>(); |
| | | for (YwContractBill ywContractBill:ywContractBillList) { |
| | | this.dealTempData(tempList,ywContractBill,loginUserInfo); |
| | | List<YwTempConfig> dealList = this.dealTempData(tempList,ywContractBill,loginUserInfo); |
| | | String fileName = "å¬è´¹éç¥å_" +ywContractBill.getCode() +"_" + System.currentTimeMillis()+".docx"; |
| | | YwTempConfig ywTempConfig = new YwTempConfig(); |
| | | if(Constants.equalsInteger(ywContractBill.getType(),Constants.ZERO)){ |
| | |
| | | if(Objects.isNull(ywTempConfig)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"模æ¿ä¿¡æ¯å¼å¸¸,请è系管çå"); |
| | | } |
| | | String path = ExcelReplaceCommon.modifyWordTemplate(ywTempConfig.getUrl(),tempList,fileName); |
| | | String path = ExcelReplaceCommon.modifyWordTemplate(ywTempConfig.getUrl(),dealList,fileName,zipFilePath); |
| | | File f = new File(path); |
| | | if(f !=null && f.isFile()){ |
| | | fileList.add(f); |
| | |
| | | } |
| | | |
| | | |
| | | public void dealTempData(List<YwTempConfig> ywTempConfigList , YwContractBill ywContractBill, LoginUserInfo loginUserInfo){ |
| | | public List<YwTempConfig> dealTempData(List<YwTempConfig> ywTempConfigList , YwContractBill ywContractBill, LoginUserInfo loginUserInfo){ |
| | | //æ¥è¯¢æ¶æ¯è´¦å·æ°æ® |
| | | YwAccount ywAccount = ywAccountMapper.selectOne(new QueryWrapper<YwAccount>().lambda().eq(YwAccount::getIsdeleted,Constants.ZERO).eq(YwAccount::getStatus,Constants.ZERO).eq(YwAccount::getCompanyId,ywContractBill.getCompanyId()) |
| | | .orderByDesc(YwAccount::getId) |
| | | .last(" limit 1 ")); |
| | | |
| | | List<YwTempConfig> dealList = new ArrayList<>(); |
| | | for (YwTempConfig y:ywTempConfigList) { |
| | | if(y.getTitle().equals("${è´¹ç¨åç§°}")&&Objects.nonNull(ywContractBill.getCostType())){ |
| | | //è´¹ç¨ç±»åï¼0=ç§èµè´¹ï¼1=ç©ä¸è´¹ï¼2=ç§èµæ¼éï¼3=ç©ä¸æ¼éï¼4=æ°´çµè´¹ï¼5=æé¡¹è´¹ï¼6=å
¶ä»; 7=ä¿è¯é |
| | |
| | | y.setUrl("å
æ¯å¹³ç±³å¤©"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){ |
| | | y.setUrl("å
æ¯å¹³ç±³æ"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){ |
| | | }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.TWO)){ |
| | | y.setUrl("å
æ¯å¹³ç±³å¹´"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){ |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.THREE)){ |
| | | y.setUrl("å
æ¯å¤©"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){ |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.FOUR)){ |
| | | y.setUrl("å
æ¯æ"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){ |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.FIVE)){ |
| | | y.setUrl("å
æ¯å¹´"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){ |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.SIX)){ |
| | | y.setUrl("å
æ¯åº"); |
| | | } |
| | | }else if(y.getTitle().equals("${åºæ¶æ¥æ}")&&Objects.nonNull(ywContractBill.getPlanPayDate())){ |
| | |
| | | } |
| | | }else if(y.getTitle().equals("${ç§å®¢åç§°}")&&StringUtils.isNotBlank(ywContractBill.getCustomerName())){ |
| | | y.setUrl(ywContractBill.getCustomerName()); |
| | | }else if(y.getTitle().equals("${楼å®/楼å±/æ¿æº}")){ |
| | | }else if(y.getTitle().equals("${æ¿é´ä¿¡æ¯}")){ |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBill.getYwContractRoomList())){ |
| | | StringBuilder roomPathName = new StringBuilder(); |
| | | for (YwContractRoom ywContractRoom:ywContractBill.getYwContractRoomList()) { |
| | |
| | | }else if(y.getTitle().equals("${ç§èµé¢ç§¯}")&&Objects.nonNull(ywContractBill.getTotalArea())){ |
| | | y.setUrl(ywContractBill.getTotalArea().toString()); |
| | | }else if(y.getTitle().equals("${æå±å
¬å¸è´¦æ·åç§°}")){ |
| | | y.setUrl("æå±å
¬å¸è´¦æ·åç§°"); |
| | | if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getName())){ |
| | | y.setUrl(ywAccount.getName()); |
| | | }else{ |
| | | y.setUrl("-"); |
| | | } |
| | | }else if(y.getTitle().equals("${æå±å
¬å¸é¶è¡è´¦å·}")){ |
| | | y.setUrl("æå±å
¬å¸é¶è¡è´¦å·"); |
| | | if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getName())){ |
| | | y.setUrl(ywAccount.getName()); |
| | | }else{ |
| | | y.setUrl("-"); |
| | | } |
| | | }else if(y.getTitle().equals("${æå±å
¬å¸å¼æ·é¶è¡}")){ |
| | | y.setUrl("æå±å
¬å¸å¼æ·é¶è¡"); |
| | | if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getBankNo())){ |
| | | y.setUrl(ywAccount.getBankNo()); |
| | | }else{ |
| | | y.setUrl("-"); |
| | | } |
| | | }else if(y.getTitle().equals("${éç¥åçææ¥æ}")){ |
| | | y.setUrl(DateUtil.formatDate(new Date(),"yyyy-MM-dd")); |
| | | }else if(y.getTitle().equals("${å½åç¨æ·å§å}")){ |
| | | }else if(y.getTitle().equals("${å¶è¡¨äººåç§°}")){ |
| | | y.setUrl(loginUserInfo.getRealname()); |
| | | } |
| | | dealList.add(y); |
| | | } |
| | | return dealList; |
| | | } |
| | | |
| | | |
| | | public void sendSmsEmail(List<YwSmsEmailBillCallDTO> ywSmsEmailBillCallDTOList,LoginUserInfo loginUserInfo){ |
| | | @Override |
| | | public void sendSmsEmail(List<YwSmsEmailBillCallDTO> ywSmsEmailBillCallDTOList,SmsEmailServiceImpl smsEmailService,LoginUserInfo loginUserInfo){ |
| | | if(CollectionUtils.isEmpty(ywSmsEmailBillCallDTOList)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(tempList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªæ¥è¯¢å°æ¨¡æ¿é
置项,请è系管çå"); |
| | | } |
| | | Optional<YwTempConfig> smsTempConfigOptional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).findAny(); |
| | | Optional<YwTempConfig> emailTempConfigOptional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)).findAny(); |
| | | for (YwSmsEmailBillCallDTO ywSmsEmailBillCallDTO:ywSmsEmailBillCallDTOList) { |
| | | if(Objects.isNull(ywSmsEmailBillCallDTO) |
| | | || Objects.isNull(ywSmsEmailBillCallDTO.getBillId()) |
| | | || Objects.isNull(ywSmsEmailBillCallDTO.getBillId()) |
| | | || Objects.isNull(ywSmsEmailBillCallDTO.getUserId()) |
| | | ||Objects.isNull(ywSmsEmailBillCallDTO.getSendEmail()) |
| | | || Objects.isNull(ywSmsEmailBillCallDTO.getSendSms())){ |
| | | ||Objects.isNull(ywSmsEmailBillCallDTO.getSendEmail()) |
| | | || Objects.isNull(ywSmsEmailBillCallDTO.getSendSms()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | |
| | |
| | | if(Objects.isNull(member)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å卿ªæ¥è¯¢å°ç人åä¿¡æ¯"); |
| | | } |
| | | |
| | | |
| | | if(Objects.nonNull(member)){ |
| | | if(Constants.equalsInteger(ywSmsEmailBillCallDTO.getSendSms(),Constants.ONE) && StringUtils.isNotBlank(member.getPhone()) |
| | | && smsTempConfigOptional.isPresent()){ |
| | | String content = this.dealTempSmsEmailData(smsTempConfigOptional.get().getTitle(),tempList,ywContractBill,loginUserInfo); |
| | | smsEmailService.sendBillSms(content,member.getPhone(),ywContractBill.getId()); |
| | | } |
| | | if(Constants.equalsInteger(ywSmsEmailBillCallDTO.getSendEmail(),Constants.ONE) && StringUtils.isNotBlank(member.getEmail()) |
| | | && emailTempConfigOptional.isPresent()){ |
| | | String content = this.dealTempSmsEmailData(emailTempConfigOptional.get().getTitle(),tempList,ywContractBill,loginUserInfo); |
| | | smsEmailService.sendEmail(content,member.getEmail(),ywContractBill.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | for (YwSmsEmailBillCallDTO ywSmsEmailBillCallDTO:ywSmsEmailBillCallDTOList) { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public String dealTempSmsEmailData(String tempStr,List<YwTempConfig> ywTempConfigList , YwContractBill ywContractBill, LoginUserInfo loginUserInfo){ |
| | | //æ¥è¯¢æ¶æ¯è´¦å·æ°æ® |
| | | YwAccount ywAccount = ywAccountMapper.selectOne(new QueryWrapper<YwAccount>().lambda().eq(YwAccount::getIsdeleted,Constants.ZERO).eq(YwAccount::getStatus,Constants.ZERO).eq(YwAccount::getCompanyId,ywContractBill.getCompanyId()) |
| | | .orderByDesc(YwAccount::getId) |
| | | .last(" limit 1 ")); |
| | | for (YwTempConfig y:ywTempConfigList) { |
| | | if(y.getTitle().equals("${è´¹ç¨åç§°}")&&Objects.nonNull(ywContractBill.getCostType())){ |
| | | //è´¹ç¨ç±»åï¼0=ç§èµè´¹ï¼1=ç©ä¸è´¹ï¼2=ç§èµæ¼éï¼3=ç©ä¸æ¼éï¼4=æ°´çµè´¹ï¼5=æé¡¹è´¹ï¼6=å
¶ä»; 7=ä¿è¯é |
| | | if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.ZERO)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","ç§èµè´¹"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.ONE)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","ç©ä¸è´¹"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.TWO)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","ç§èµæ¼é"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.THREE)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","ç©ä¸æ¼é"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.FOUR)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","æ°´çµè´¹"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.FIVE)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","æé¡¹è´¹"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.SIX)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","å
¶ä»"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.SEVEN)){ |
| | | tempStr.replace("${è´¹ç¨åç§°}","ä¿è¯é"); |
| | | } |
| | | }else if(y.getTitle().equals("${è®¡è´¹å¨æ}")&&Objects.nonNull(ywContractBill.getDetailType())){ |
| | | if(Constants.equalsInteger(ywContractBill.getDetailType(),Constants.ZERO)){ |
| | | //ç§èµæ¯ä»æ¹å¼ 0=䏿¬¡æ§ä»æ¬¾ï¼1=æ¯ä¸ä¸ªæä¸ä»ï¼2=å
个æä¸ä»ï¼3=ä¸å¹´ä¸ä» |
| | | if(Objects.nonNull(ywContractBill.getZlPayType())){ |
| | | if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ZERO)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","䏿¬¡æ§ä»æ¬¾"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ONE)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","æ¯ä¸ä¸ªæä¸ä»"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.TWO)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","å
个æä¸ä»"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.THREE)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","ä¸å¹´ä¸ä»"); |
| | | } |
| | | } |
| | | }else{ |
| | | //ç©ä¸æ¯ä»æ¹å¼ 0=䏿¬¡æ§ä»æ¬¾ï¼1=æ¯ä¸ä¸ªæä¸ä»ï¼2=å
个æä¸ä»ï¼3=ä¸å¹´ä¸ä» |
| | | if(Objects.nonNull(ywContractBill.getWyPayType())){ |
| | | if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ZERO)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","䏿¬¡æ§ä»æ¬¾"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ONE)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","æ¯ä¸ä¸ªæä¸ä»"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.TWO)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","å
个æä¸ä»"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.THREE)){ |
| | | tempStr.replace("${è®¡è´¹å¨æ}","ä¸å¹´ä¸ä»"); |
| | | } |
| | | } |
| | | } |
| | | }else if(y.getTitle().equals("${åä»·}")&&Objects.nonNull(ywContractBill.getPrice())){ |
| | | tempStr.replace("${åä»·}",ywContractBill.getPrice().toString()); |
| | | }else if(y.getTitle().equals("${åä½}")&&Objects.nonNull(ywContractBill.getCircleType())){ |
| | | //仿¬¾å¨æç±»å 0=å
æ¯å¹³ç±³å¤©;1=å
æ¯å¹³ç±³æ;2=å
æ¯å¹³ç±³å¹´;3=å
æ¯å¤©;4=å
æ¯æ;5=å
æ¯å¹´;6=å
æ¯åº; |
| | | if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ZERO)){ |
| | | tempStr.replace("${åä½}","å
æ¯å¹³ç±³å¤©"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){ |
| | | tempStr.replace("${åä½}","å
æ¯å¹³ç±³æ"); |
| | | }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.TWO)){ |
| | | tempStr.replace("${åä½}","å
æ¯å¹³ç±³å¹´"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.THREE)){ |
| | | tempStr.replace("${åä½}","å
æ¯å¤©"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.FOUR)){ |
| | | tempStr.replace("${åä½}","å
æ¯æ"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.FIVE)){ |
| | | tempStr.replace("${åä½}","å
æ¯å¹´"); |
| | | } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.SIX)){ |
| | | tempStr.replace("${åä½}","å
æ¯åº"); |
| | | } |
| | | }else if(y.getTitle().equals("${åºæ¶æ¥æ}")&&Objects.nonNull(ywContractBill.getPlanPayDate())){ |
| | | tempStr.replace("${åºæ¶æ¥æ}",DateUtil.formatDate(ywContractBill.getPlanPayDate(),"yyyy-MM-dd")); |
| | | }else if(y.getTitle().equals("${åºæ¶éé¢}")&&Objects.nonNull(ywContractBill.getReceivableFee())){ |
| | | tempStr.replace("${åºæ¶éé¢}",ywContractBill.getReceivableFee().toString()); |
| | | }else if(y.getTitle().equals("${è´¦å夿³¨}")){ |
| | | if(StringUtils.isNotBlank(ywContractBill.getRemark())){ |
| | | tempStr.replace("${è´¦å夿³¨}",ywContractBill.getRemark()); |
| | | }else{ |
| | | tempStr.replace("${è´¦å夿³¨}",""); |
| | | } |
| | | }else if(y.getTitle().equals("${ç§å®¢åç§°}")&&StringUtils.isNotBlank(ywContractBill.getCustomerName())){ |
| | | tempStr.replace("${ç§å®¢åç§°}",ywContractBill.getCustomerName()); |
| | | }else if(y.getTitle().equals("${æ¿é´ä¿¡æ¯}")){ |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBill.getYwContractRoomList())){ |
| | | StringBuilder roomPathName = new StringBuilder(); |
| | | for (YwContractRoom ywContractRoom:ywContractBill.getYwContractRoomList()) { |
| | | if(StringUtils.isNotBlank(ywContractRoom.getProjectName())){ |
| | | roomPathName.append(ywContractRoom.getProjectName()+"/"); |
| | | } |
| | | if(StringUtils.isNotBlank(ywContractRoom.getBuildingName())){ |
| | | roomPathName.append(ywContractRoom.getBuildingName()+"/"); |
| | | } |
| | | if(StringUtils.isNotBlank(ywContractRoom.getFloorName())){ |
| | | roomPathName.append(ywContractRoom.getFloorName()+"/"); |
| | | } |
| | | if(StringUtils.isNotBlank(ywContractRoom.getRoomName())){ |
| | | roomPathName.append(ywContractRoom.getRoomName()); |
| | | } |
| | | if(StringUtils.isNotBlank(roomPathName)){ |
| | | roomPathName.append(";"); |
| | | } |
| | | } |
| | | tempStr.replace("${æ¿é´ä¿¡æ¯}",roomPathName.toString()); |
| | | } |
| | | }else if(y.getTitle().equals("${ç§èµé¢ç§¯}")&&Objects.nonNull(ywContractBill.getTotalArea())){ |
| | | tempStr.replace("${ç§èµé¢ç§¯}",ywContractBill.getTotalArea().toString()); |
| | | }else if(y.getTitle().equals("${æå±å
¬å¸è´¦æ·åç§°}")){ |
| | | if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getName())){ |
| | | tempStr.replace("${æå±å
¬å¸è´¦æ·åç§°}",ywAccount.getName()); |
| | | }else{ |
| | | tempStr.replace("${æå±å
¬å¸è´¦æ·åç§°}","-"); |
| | | } |
| | | }else if(y.getTitle().equals("${æå±å
¬å¸é¶è¡è´¦å·}")){ |
| | | if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getName())){ |
| | | tempStr.replace("${æå±å
¬å¸é¶è¡è´¦å·}",ywAccount.getName()); |
| | | }else{ |
| | | tempStr.replace("${æå±å
¬å¸é¶è¡è´¦å·}","-"); |
| | | } |
| | | }else if(y.getTitle().equals("${æå±å
¬å¸å¼æ·é¶è¡}")){ |
| | | if(Objects.nonNull(ywAccount)&&StringUtils.isNotBlank(ywAccount.getBankNo())){ |
| | | tempStr.replace("${æå±å
¬å¸å¼æ·é¶è¡}",ywAccount.getBankNo()); |
| | | }else{ |
| | | tempStr.replace("${æå±å
¬å¸å¼æ·é¶è¡}","-"); |
| | | } |
| | | }else if(y.getTitle().equals("${éç¥åçææ¥æ}")){ |
| | | tempStr.replace("${éç¥åçææ¥æ}",DateUtil.formatDate(new Date(),"yyyy-MM-dd")); |
| | | }else if(y.getTitle().equals("${å¶è¡¨äººåç§°}")){ |
| | | tempStr.replace("${å¶è¡¨äººåç§°}",loginUserInfo.getRealname()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return tempStr; |
| | | } |
| | | |
| | | |
| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.CompanyMapper; |
| | | import com.doumee.dao.business.dto.YwContractBillDTO; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.MultifileMapper; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer create(YwContract model) { |
| | | isParamValidCreated(model); |
| | | |
| | | |
| | | model.setCreator(model.getLoginUserInfo().getId()); |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setCreateDate(new Date()); |
| | |
| | | } |
| | | model.setRemark(getRemarlByParam(model)); |
| | | ywContractMapper.insert(model); |
| | | dealDetailListBiz(model);//å¤çæ¡æ¬¾ä¿¡æ¯ |
| | | dealDetailListBiz(model,false);//å¤çæ¡æ¬¾ä¿¡æ¯ |
| | | dealMultifileBiz(model);//å¤çéä»¶ä¿¡æ¯ |
| | | dealRoomsForContract(model);//å¤çæ¿æºå
³è表 |
| | | dealLogBiz(model,Constants.YwLogType.CONTRACT_CREATE,model.getLoginUserInfo().getRealname(),"ã"+model.getRemark().replace("ååæè¦ï¼","")+"ã");//è®°å½æ°å»ºæ¥å¿ |
| | |
| | | isParamValidForBill(model); |
| | | model.setCreateDate(new Date()); |
| | | model.setEditDate(model.getCreateDate()); |
| | | dealDetailListBiz(model);//å¤çæ¡æ¬¾ä¿¡æ¯ |
| | | dealDetailListBiz(model,true);//å¤çæ¡æ¬¾ä¿¡æ¯ |
| | | return model.getBillList(); |
| | | } |
| | | |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼è¯·æé¡µé¢è¦æ±å¡«åååä¿¡æ¯"); |
| | | } |
| | | if(model.getEndDate().getTime()<= model.getStartDate().getTime()){ |
| | | |
| | | if(model.getEndDate().getTime()< model.getStartDate().getTime()){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ååæææç»ææ¶é´ä¸å¾æ©äºå¼å§æ¶é´ï¼"); |
| | | } |
| | | |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼è¯·æé¡µé¢è¦æ±å¡«åç§èµæ¡æ¬¾ä¿¡æ¯!"); |
| | | } |
| | | if(d.getEndDate().getTime()<= d.getStartDate().getTime()){ |
| | | if(d.getEndDate().getTime()< d.getStartDate().getTime()){ |
| | | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç§èµæ¡æ¬¾æææç»ææ¶é´ä¸å¾æ©äºå¼å§æ¶é´ï¼"); |
| | | } |
| | |
| | | .set(YwContract::getEditDate,DateUtil.getCurrDateTime()) |
| | | .eq(YwContract::getIsdeleted,Constants.ZERO) |
| | | .in(YwContract::getStatus,Constants.ONE,Constants.ZERO) |
| | | .apply(" END_DATE < NOW() ") |
| | | .apply(" END_DATE < CURRENT_DATE ") |
| | | ); |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private void dealDetailListBiz(YwContract model) { |
| | | /** |
| | | * @param model |
| | | * @param createBill æ ¹æ®æ¡æ¬¾çæè´¦å false åæ ¹æ®å端ç¼è¾åçæ°æ®çæ |
| | | */ |
| | | private void dealDetailListBiz(YwContract model,boolean createBill) { |
| | | List<YwContractDetail> details1 = new ArrayList<>(); |
| | | List<YwContractDetail> details2 = new ArrayList<>(); |
| | | int num = 0; |
| | |
| | | } |
| | | } |
| | | //å¤çè´¦åä¿¡æ¯ |
| | | dealBillListBiz(model,details1,details2); |
| | | if(createBill){ |
| | | dealBillListBiz(model,details1,details2); |
| | | }else{ |
| | | //2025-1-23 13:56:53 å å
¥ å端å
¥åè°æ´åçè´¦åä¿¡æ¯ |
| | | List<YwContractBill> ywContractBillList = new ArrayList<>(); |
| | | //æ¥è¯¢ç§èµæ¡æ¬¾ |
| | | if(Constants.equalsInteger(model.getType(),Constants.ZERO ) |
| | | || Constants.equalsInteger(model.getType(),Constants.TWO)&& com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(details1)){ |
| | | YwContractDetail ywContractDetail = details1.get(Constants.ZERO); |
| | | YwContractBill zlBill = new YwContractBill(); |
| | | BeanUtils.copyProperties(model.getZlBillDTO(),zlBill); |
| | | zlBill.setCreator(model.getCreator()); |
| | | zlBill.setCreateDate(model.getCreateDate()); |
| | | zlBill.setIsdeleted(Constants.ZERO); |
| | | zlBill.setStatus(Constants.ZERO); |
| | | zlBill.setReceivableFee(zlBill.getTotleFee()); |
| | | zlBill.setType(Constants.ZERO); |
| | | zlBill.setCompanyId(model.getCompanyId()); |
| | | zlBill.setContractId(model.getId()); |
| | | zlBill.setBillType(Constants.ZERO); |
| | | zlBill.setPayStatus(Constants.ZERO); |
| | | ywContractBillList.add(zlBill); |
| | | Integer sortnum = Constants.ONE; |
| | | for (YwContractBillDTO zlBillDTO:model.getZlBillDTOList()) { |
| | | YwContractBill zl = new YwContractBill(); |
| | | BeanUtils.copyProperties(zlBillDTO,zl); |
| | | zl.setCreator(model.getCreator()); |
| | | zl.setCreateDate(model.getCreateDate()); |
| | | zl.setIsdeleted(Constants.ZERO); |
| | | zl.setStatus(Constants.ZERO); |
| | | zl.setReceivableFee(zl.getTotleFee()); |
| | | zl.setType(Constants.ZERO); |
| | | zl.setCompanyId(model.getCompanyId()); |
| | | zl.setContractId(model.getId()); |
| | | zl.setBillType(Constants.ZERO); |
| | | zl.setPayStatus(Constants.ZERO); |
| | | zl.setSortnum(sortnum); |
| | | zl.setDetailId(ywContractDetail.getId()); |
| | | ywContractBillList.add(zl); |
| | | sortnum++; |
| | | } |
| | | } |
| | | //æ¥è¯¢ç©ä¸è´¦å |
| | | if(Constants.equalsInteger(model.getType(),Constants.ZERO ) |
| | | || Constants.equalsInteger(model.getType(),Constants.TWO)&& com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(details2)){ |
| | | YwContractDetail ywContractDetail = details2.get(Constants.ZERO); |
| | | YwContractBill wyBill = new YwContractBill(); |
| | | BeanUtils.copyProperties(model.getWyBillDTO(),wyBill); |
| | | wyBill.setCreator(model.getCreator()); |
| | | wyBill.setCreateDate(model.getCreateDate()); |
| | | wyBill.setIsdeleted(Constants.ZERO); |
| | | wyBill.setStatus(Constants.ZERO); |
| | | wyBill.setReceivableFee(wyBill.getTotleFee()); |
| | | wyBill.setType(Constants.ZERO); |
| | | wyBill.setCompanyId(model.getCompanyId()); |
| | | wyBill.setContractId(model.getId()); |
| | | wyBill.setBillType(Constants.ZERO); |
| | | wyBill.setPayStatus(Constants.ZERO); |
| | | ywContractBillList.add(wyBill); |
| | | Integer sortnum = Constants.ONE; |
| | | for (YwContractBillDTO wyBillDTO:model.getWyBillDTOList()) { |
| | | YwContractBill wy = new YwContractBill(); |
| | | BeanUtils.copyProperties(wyBillDTO,wy); |
| | | wy.setCreator(model.getCreator()); |
| | | wy.setCreateDate(model.getCreateDate()); |
| | | wy.setIsdeleted(Constants.ZERO); |
| | | wy.setStatus(Constants.ZERO); |
| | | wy.setReceivableFee(wy.getTotleFee()); |
| | | wy.setType(Constants.ZERO); |
| | | wy.setCompanyId(model.getCompanyId()); |
| | | wy.setContractId(model.getId()); |
| | | wy.setBillType(Constants.ZERO); |
| | | wy.setPayStatus(Constants.ZERO); |
| | | wy.setSortnum(sortnum); |
| | | wy.setDetailId(ywContractDetail.getId()); |
| | | ywContractBillList.add(wy); |
| | | sortnum++; |
| | | } |
| | | } |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBillList)){ |
| | | ywContractBillMapper.insert(ywContractBillList); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼è¯·æé¡µé¢è¦æ±å¡«åååä¿¡æ¯"); |
| | | } |
| | | if(model.getEndDate().getTime()<= model.getStartDate().getTime()){ |
| | | |
| | | if(model.getEndDate().getTime()< model.getStartDate().getTime()){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ååæææç»ææ¶é´ä¸å¾æ©äºå¼å§æ¶é´ï¼"); |
| | | } |
| | | if(Constants.equalsInteger(model.getType(),Constants.ZERO ) |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼è¯·æé¡µé¢è¦æ±å¡«åç§èµæ¡æ¬¾ä¿¡æ¯!"); |
| | | } |
| | | if(d.getEndDate().getTime()<= d.getStartDate().getTime()){ |
| | | if(d.getEndDate().getTime()< d.getStartDate().getTime()){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç§èµæ¡æ¬¾æææç»ææ¶é´ä¸å¾æ©äºå¼å§æ¶é´ï¼"); |
| | | } |
| | | if(d.getEndDate().getTime()>model.getEndDate().getTime() ||d.getStartDate().getTime()<model.getStartDate().getTime()){ |
| | |
| | | if(user ==null || (user.getDeleted()!=null && user.getDeleted()) ){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对ä¸èµ·ï¼ç»å人信æ¯ä¸åå¨ï¼è¯·å°è¯å·æ°é¡µé¢éè¯ï¼"); |
| | | } |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(model.getYwContractBillDTOList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æ è´¦åä¿¡æ¯ï¼è¯·å·æ°éè¯"); |
| | | } |
| | | for (YwContractBillDTO billDTO:model.getYwContractBillDTOList()) { |
| | | if( |
| | | Objects.isNull(billDTO.getStartDate()) |
| | | ||Objects.isNull(billDTO.getEndDate()) |
| | | ||Objects.isNull(billDTO.getPlanPayDate()) |
| | | ||Objects.isNull(billDTO.getTotleFee()) |
| | | ||Objects.isNull(billDTO.getCostType()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"è´¦åæç»åæ°é误"); |
| | | } |
| | | } |
| | | |
| | | List<YwContractBillDTO> ywContractBillDTOList = model.getYwContractBillDTOList(); |
| | | //æ¥è¯¢ç§èµæ¡æ¬¾ |
| | | if(Constants.equalsInteger(model.getType(),Constants.ZERO ) |
| | | || Constants.equalsInteger(model.getType(),Constants.TWO)){ |
| | | List<YwContractBillDTO> leaseBillDTOList = ywContractBillDTOList.stream() |
| | | .filter(i->Constants.equalsInteger(i.getCostType(),Constants.ZERO)).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(leaseBillDTOList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ ç§èµè´¹è´¦åï¼"); |
| | | } |
| | | model.setZlBillDTOList(leaseBillDTOList); |
| | | Optional<YwContractBillDTO> leaseBillOptional = ywContractBillDTOList.stream() |
| | | .filter(i->Constants.equalsInteger(i.getCostType(),Constants.TWO)).findAny(); |
| | | if(!leaseBillOptional.isPresent()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ ç§èµæ¼éè´¦åï¼"); |
| | | } |
| | | model.setZlBillDTO(leaseBillOptional.get()); |
| | | } |
| | | if(Constants.equalsInteger(model.getType(),Constants.ZERO ) |
| | | || Constants.equalsInteger(model.getType(),Constants.ONE)){ |
| | | List<YwContractBillDTO> wyBillDTOList = ywContractBillDTOList.stream() |
| | | .filter(i->Constants.equalsInteger(i.getCostType(),Constants.ONE)).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(wyBillDTOList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ ç©ä¸è´¹è´¦åï¼"); |
| | | } |
| | | model.setWyBillDTOList(wyBillDTOList); |
| | | Optional<YwContractBillDTO> wyBillOptional = ywContractBillDTOList.stream() |
| | | .filter(i->Constants.equalsInteger(i.getCostType(),Constants.THREE)).findAny(); |
| | | if(!wyBillOptional.isPresent()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ ç©ä¸æ¼éè´¦åï¼"); |
| | | } |
| | | model.setWyBillDTO(wyBillOptional.get()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (model == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | //ååéä»¶ |
| | | initFiles(model); |
| | | //æ¥è¯¢æ¿æºä¿¡æ¯æ°æ® |
| | | MPJLambdaWrapper<YwRoom> rw = new MPJLambdaWrapper<>(); |
| | | rw.selectAll(YwRoom.class) |
| | | .selectAs(YwProject::getName, YwRoom::getProjectName) |
| | | .selectAs(YwFloor::getName, YwRoom::getFloorName) |
| | | .selectAs(YwBuilding::getName, YwRoom::getBuildingName) |
| | | .leftJoin(YwProject.class, YwProject::getId, YwRoom::getProjectId) |
| | | .leftJoin(YwBuilding.class, YwBuilding::getId, YwRoom::getBuildingId) |
| | | .leftJoin(YwFloor.class, YwFloor::getId, YwRoom::getFloor) |
| | | .eq(YwRoom::getIsdeleted, Constants.ZERO) |
| | | .exists("(select a.id from yw_contract_room a where a.isdeleted=0 and a.type=0 and a.room_id=t.id and a.contract_id=" + model.getId() + ")"); |
| | | model.setRoomList(roomMapper.selectJoinList(YwRoom.class, rw)); |
| | | model.setWyFirstCircleStr(Constants.getUnitTypeByNum(model.getWyFirstCircle())); |
| | | model.setZlFirstCircleStr(Constants.getUnitTypeByNum(model.getZlFirstCircle())); |
| | | //æ¥è¯¢ç§è³æ¡æ¬¾ä¿¡æ¯ |
| | | MPJLambdaWrapper<YwContractDetail> dw = new MPJLambdaWrapper<>(); |
| | | dw.selectAll(YwContractDetail.class) |
| | | .eq(YwContractDetail::getIsdeleted, Constants.ZERO) |
| | | .eq(YwContractDetail::getContractId, model.getId()) |
| | | .in(YwContractDetail::getType, Constants.ZERO, Constants.TWO) |
| | | .orderByAsc(YwContractDetail::getSortnum); |
| | | model.setZlDetailList(ywContractDetailMapper.selectJoinList(YwContractDetail.class, dw)); |
| | | //æ¥è¯¢ç©æ¥æ¡æ¬¾ä¿¡æ¯ |
| | | dw = new MPJLambdaWrapper<>(); |
| | | dw.selectAll(YwContractDetail.class) |
| | | .eq(YwContractDetail::getIsdeleted, Constants.ZERO) |
| | | .eq(YwContractDetail::getContractId, model.getId()) |
| | | .in(YwContractDetail::getType, Constants.ONE, Constants.THREE) |
| | | .orderByAsc(YwContractDetail::getSortnum); |
| | | model.setWyDetailList(ywContractDetailMapper.selectJoinList(YwContractDetail.class, dw)); |
| | | //ååéä»¶ |
| | | initFiles(model); |
| | | //æ¥è¯¢æ¿æºä¿¡æ¯æ°æ® |
| | | MPJLambdaWrapper<YwRoom> rw = new MPJLambdaWrapper<>(); |
| | | rw.selectAll(YwRoom.class) |
| | | .selectAs(YwProject::getName, YwRoom::getProjectName) |
| | | .selectAs(YwFloor::getName, YwRoom::getFloorName) |
| | | .selectAs(YwBuilding::getName, YwRoom::getBuildingName) |
| | | .leftJoin(YwProject.class, YwProject::getId, YwRoom::getProjectId) |
| | | .leftJoin(YwBuilding.class, YwBuilding::getId, YwRoom::getBuildingId) |
| | | .leftJoin(YwFloor.class, YwFloor::getId, YwRoom::getFloor) |
| | | .eq(YwRoom::getIsdeleted, Constants.ZERO) |
| | | .exists("(select a.id from yw_contract_room a where a.isdeleted=0 and a.type=0 and a.room_id=t.id and a.contract_id=" + model.getId() + ")"); |
| | | model.setRoomList(roomMapper.selectJoinList(YwRoom.class, rw)); |
| | | model.setWyFirstCircleStr(Constants.getUnitTypeByNum(model.getWyFirstCircle())); |
| | | model.setZlFirstCircleStr(Constants.getUnitTypeByNum(model.getZlFirstCircle())); |
| | | //æ¥è¯¢ç§è³æ¡æ¬¾ä¿¡æ¯ |
| | | MPJLambdaWrapper<YwContractDetail> dw = new MPJLambdaWrapper<>(); |
| | | dw.selectAll(YwContractDetail.class) |
| | | .eq(YwContractDetail::getIsdeleted, Constants.ZERO) |
| | | .eq(YwContractDetail::getContractId, model.getId()) |
| | | .in(YwContractDetail::getType, Constants.ZERO, Constants.TWO) |
| | | .orderByAsc(YwContractDetail::getSortnum); |
| | | model.setZlDetailList(ywContractDetailMapper.selectJoinList(YwContractDetail.class, dw)); |
| | | //æ¥è¯¢ç©æ¥æ¡æ¬¾ä¿¡æ¯ |
| | | dw = new MPJLambdaWrapper<>(); |
| | | dw.selectAll(YwContractDetail.class) |
| | | .eq(YwContractDetail::getIsdeleted, Constants.ZERO) |
| | | .eq(YwContractDetail::getContractId, model.getId()) |
| | | .in(YwContractDetail::getType, Constants.ONE, Constants.THREE) |
| | | .orderByAsc(YwContractDetail::getSortnum); |
| | | model.setWyDetailList(ywContractDetailMapper.selectJoinList(YwContractDetail.class, dw)); |
| | | |
| | | return model; |
| | | } |
| | |
| | | queryWrapper.selectAll(YwContract.class ) |
| | | .selectAs(Company::getName,YwContract::getCompanyName ) |
| | | .selectAs(YwCustomer::getName,YwContract::getRenterName ) |
| | | .select("(select sum(r.area) from yw_contract_room cr left join yw_room r on r.id = cr.room_id where r.isdeleted=0 and cr.contract_id =t.id)",YwContract::getTotalArea ) |
| | | .select("(select sum(r.RENT_AREA) from yw_contract_room cr left join yw_room r on r.id = cr.room_id where r.isdeleted=0 and cr.contract_id =t.id)",YwContract::getTotalArea ) |
| | | .select(" ( select ifnull(sum(y.TOTLE_FEE),0) from yw_contract_bill y where y.CONTRACT_ID = t.id and y.type = 0 and y.COST_TYPE=0 and y.BILL_TYPE = 0 ) " , YwContract::getTotalFee) |
| | | .leftJoin(Company.class,Company::getId,YwContract::getCompanyId) |
| | | .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | |
| | | if (pageWrap.getModel().getRoomId() != null) { |
| | | queryWrapper.apply(" t.id in ( select ycr.CONTRACT_ID from yw_contract_room ycr where ycr.type = 0 and ycr.ROOM_ID = "+pageWrap.getModel().getRoomId()+" ) "); |
| | | } |
| | | if (pageWrap.getModel().getBuildingId() != null) { |
| | | queryWrapper.apply(" t.id in ( select ycr.CONTRACT_ID from yw_contract_room ycr left join yw_room yr on ycr.ROOM_ID = yr.id where ycr.type = 0 and yr.BUILDING_ID = "+pageWrap.getModel().getBuildingId()+" ) "); |
| | | } |
| | | queryWrapper.ge(Objects.nonNull(pageWrap.getModel().getQueryStartTime()), YwContract::getStartDate, pageWrap.getModel().getQueryStartTime()) |
| | | .le(Objects.nonNull(pageWrap.getModel().getQueryEndTime()), YwContract::getEndDate, pageWrap.getModel().getQueryEndTime()); |
| | | queryWrapper.orderByDesc(YwContract::getCreateDate ); |
| | |
| | | for(YwContract model : data.getRecords()){ |
| | | model.setWyFirstCircleStr(Constants.getUnitTypeByNum(model.getWyFirstCircle())); |
| | | model.setZlFirstCircleStr(Constants.getUnitTypeByNum(model.getZlFirstCircle())); |
| | | //æ¥è¯¢æ¿æºä¿¡æ¯æ°æ® |
| | | MPJLambdaWrapper<YwRoom> rw = new MPJLambdaWrapper<>(); |
| | | rw.selectAll(YwRoom.class) |
| | | .selectAs(YwProject::getName, YwRoom::getProjectName) |
| | | .selectAs(YwFloor::getName, YwRoom::getFloorName) |
| | | .selectAs(YwBuilding::getName, YwRoom::getBuildingName) |
| | | .leftJoin(YwProject.class, YwProject::getId, YwRoom::getProjectId) |
| | | .leftJoin(YwBuilding.class, YwBuilding::getId, YwRoom::getBuildingId) |
| | | .leftJoin(YwFloor.class, YwFloor::getId, YwRoom::getFloor) |
| | | .eq(YwRoom::getIsdeleted, Constants.ZERO) |
| | | .exists("(select a.id from yw_contract_room a where a.isdeleted=0 and a.type=0 and a.room_id=t.id and a.contract_id=" + model.getId() + ")"); |
| | | model.setRoomList(roomMapper.selectJoinList(YwRoom.class, rw)); |
| | | model.setLeaseDays( |
| | | DateUtil.daysBetweenDates(model.getEndDate(),model.getStartDate()) + 1 |
| | | ); |
| | | if(Objects.nonNull(model.getLeaseDays())&&Objects.nonNull(model.getTotalArea())&&Objects.nonNull(model.getTotalFee())){ |
| | | model.setLeasePrice(model.getTotalFee().divide((model.getTotalArea().multiply(new BigDecimal(model.getLeaseDays()))),2,BigDecimal.ROUND_HALF_UP)); |
| | | }else{ |
| | | model.setLeasePrice(BigDecimal.ZERO); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | return data; |
| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwDeviceMapper; |
| | | import com.doumee.dao.business.YwDeviceRecordMapper; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.YwDevice; |
| | | import com.doumee.dao.business.model.YwDeviceRecord; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.YwDeviceCateDataVO; |
| | | import com.doumee.dao.business.vo.YwDeviceDataVO; |
| | | import com.doumee.dao.business.vo.YwDeviceParentCateDataVO; |
| | |
| | | } |
| | | multifile.setCreateDate(ywDevice.getCreateDate()); |
| | | multifile.setEditDate(ywDevice.getCreateDate()); |
| | | multifile.setCreator(ywDevice.getEditor()); |
| | | multifile.setCreator(ywDevice.getCreator()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(ywDevice.getId()); |
| | | multifile.setEditor(ywDevice.getCreator()); |
| | |
| | | |
| | | @Override |
| | | public YwDevice getDetail(Integer id) { |
| | | YwDevice ywDevice = ywDeviceMapper.selectById(id); |
| | | YwDevice ywDevice = ywDeviceMapper.selectJoinOne(YwDevice.class, |
| | | new MPJLambdaWrapper<YwDevice>() |
| | | .selectAll(YwDevice.class) |
| | | .select("c.name",YwDevice::getCategoryName) |
| | | .select("c1.name",YwDevice::getCategoryParentName) |
| | | .select("s.realname",YwDevice::getRealName) |
| | | .select("s1.realname",YwDevice::getMaintenanceUserName) |
| | | .selectAs(YwProject::getName,YwDevice::getProjectName) |
| | | .selectAs(YwFloor::getName,YwDevice::getFloorName) |
| | | .selectAs(YwBuilding::getName,YwDevice::getBuildingName) |
| | | .selectAs(YwRoom::getCode,YwDevice::getRoomName) |
| | | .leftJoin(YwRoom.class,YwRoom::getId,YwDevice::getRoomId) |
| | | .leftJoin(YwFloor.class,YwFloor::getId,YwRoom::getFloor) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwRoom::getProjectId) |
| | | .leftJoin(YwBuilding.class,YwBuilding::getId,YwRoom::getBuildingId) |
| | | .leftJoin("category c on t.CATE_ID = c.id") |
| | | .leftJoin("category c1 on c.PARENT_ID = c1.id") |
| | | .leftJoin("system_user s on t.user_id = s.id") |
| | | .leftJoin("system_user s1 on t.MAINTENANCE_USER_ID = s1.id") |
| | | .eq(YwDevice::getId,id) |
| | | .last(" limit 1 ") |
| | | ); |
| | | Multifile multifile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.FN_DEVICE_FILE.getKey()).last(" limit 1")); |
| | | if(Objects.nonNull(multifile)){ |
| | |
| | | queryWrapper.selectAll(YwDevice.class) |
| | | .select("c.name",YwDevice::getCategoryName) |
| | | .select("c1.name",YwDevice::getCategoryParentName) |
| | | .selectAs(SystemUser::getRealname,YwDevice::getRealName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwDevice::getUserId) |
| | | .select("s.realname",YwDevice::getRealName) |
| | | .select("s1.realname",YwDevice::getMaintenanceUserName) |
| | | .leftJoin("category c on t.CATE_ID = c.id") |
| | | .leftJoin("category c1 on c.PARENT_ID = c1.id") |
| | | .leftJoin("system_user s on t.user_id = s.id") |
| | | .leftJoin("system_user s1 on t.MAINTENANCE_USER_ID = s1.id") |
| | | .and(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getName()),i->i.like(YwDevice::getName,model.getName()).or().like(YwDevice::getCode,model.getName())) |
| | | .eq(Objects.nonNull(model.getStatus()),YwDevice::getStatus,model.getStatus()) |
| | | .eq(Objects.nonNull(model.getRoomId()),YwDevice::getRoomId,model.getRoomId()) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Set<YwDeviceCateDataVO> getDeviceCateData(YwDevice model){ |
| | | public Set<YwDeviceParentCateDataVO> getDeviceCateData(YwDevice model){ |
| | | MPJLambdaWrapper<YwDevice> queryWrapper = new MPJLambdaWrapper<YwDevice>(); |
| | | queryWrapper.selectAll(YwDevice.class) |
| | | .select("c.name",YwDevice::getCategoryName) |
| | |
| | | ywDeviceCateDataVO.setCateName(y.getCategoryName()); |
| | | ywDeviceCateDataVO.setCateParentId(y.getCateParentId()); |
| | | ywDeviceCateDataVOSet.add(ywDeviceCateDataVO); |
| | | |
| | | YwDeviceParentCateDataVO ywDeviceParentCateDataVO = new YwDeviceParentCateDataVO(); |
| | | ywDeviceParentCateDataVO.setCateId(y.getCateParentId()); |
| | | ywDeviceParentCateDataVO.setCateName(y.getCategoryParentName()); |
| | |
| | | ywDeviceCateDataVOSet.stream().filter(i->Constants.equalsInteger(i.getCateParentId(),ywDeviceParentCateDataVO.getCateId())).collect(Collectors.toList()) |
| | | ); |
| | | } |
| | | return ywDeviceCateDataVOSet; |
| | | return ywDeviceParentCateDataVOSet; |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | if(ywOutinboundRecordMapper.selectCount(new QueryWrapper<YwOutinboundRecord>().lambda().eq(YwOutinboundRecord::getMaterialId,id))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åèµäº§å·²æåºå
¥åºè®°å½ï¼ä¸å¯å é¤"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åç©æå·²æåºå
¥åºè®°å½ï¼ä¸å¯å é¤"); |
| | | } |
| | | ywMaterialMapper.update(new UpdateWrapper<YwMaterial>().lambda().set(YwMaterial::getIsdeleted,Constants.ONE).eq(YwMaterial::getId,id)); |
| | | } |
| | |
| | | .and(StringUtils.isNotBlank(model.getCode()),i->i.like(YwMaterial::getCode,model.getCode()).or().like(YwMaterial::getName,model.getCode())) |
| | | .like(StringUtils.isNotBlank(model.getAttr()),YwMaterial::getAttr,model.getAttr()) |
| | | .eq(Objects.nonNull(model.getProjectId()),YwRoom::getProjectId,model.getProjectId()) |
| | | .eq(Objects.nonNull(model.getStatus()),YwMaterial::getStatus,model.getStatus()) |
| | | .eq(Objects.nonNull(model.getRoomId()),YwMaterial::getRoomId,model.getRoomId()) |
| | | .eq(Objects.nonNull(model.getCateId()),YwMaterial::getCateId,model.getCateId()) |
| | | .eq(Objects.nonNull(model.getParentCateId()),YwMaterial::getParentCateId,model.getParentCateId()) |
| | | .eq(Objects.nonNull(model.getFloorId()),YwRoom::getFloor,model.getFloorId()) |
| | | .eq(Objects.nonNull(model.getBuildingId()),YwRoom::getBuildingId,model.getBuildingId()) |
| | | .eq(YwMaterial::getIsdeleted,Constants.ZERO) |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | MPJLambdaWrapper<YwOutinboundRecord> queryWrapper = new MPJLambdaWrapper<YwOutinboundRecord>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | YwOutinboundRecord model = pageWrap.getModel(); |
| | | if(Objects.isNull(model)||Objects.isNull(model.getInOut())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | List<Integer> typeList = new ArrayList<>(); |
| | | if(!(Objects.isNull(model)||Objects.isNull(model.getInOut()))){ |
| | | typeList = Constants.ywOutInType.getAllTypeKey(model.getInOut()); |
| | | } |
| | | List<Integer> typeList = Constants.ywOutInType.getAllTypeKey(model.getInOut()); |
| | | queryWrapper.selectAll(YwOutinboundRecord.class) |
| | | .selectAs(SystemUser::getRealname,YwOutinboundRecord::getCreateUserName) |
| | | .selectAs(YwOutinbound::getCode,YwOutinboundRecord::getCode) |
| | | .selectAs(YwOutinbound::getType,YwOutinboundRecord::getType) |
| | | .selectAs(YwOutinbound::getDoneDate,YwOutinboundRecord::getDoneDate) |
| | | .selectAs(YwWarehouse::getName,YwOutinboundRecord::getWarehouseName) |
| | | .selectAs(YwMaterial::getCode,YwOutinboundRecord::getMaterialCode) |
| | | .selectAs(YwMaterial::getName,YwOutinboundRecord::getMaterialName) |
| | |
| | | ywOutinbound.setOrigin(Constants.ZERO); |
| | | ywOutinboundMapper.insert(ywOutinbound); |
| | | for (YwOutinboundRecord ywOutinboundRecord:recordList) { |
| | | ywOutinboundRecord.setOutInBoundId(ywOutinbound.getId()); |
| | | ywOutinboundRecord.setCreator(loginUserInfo.getId()); |
| | | ywOutinboundRecord.setCreateDate(new Date()); |
| | | ywOutinboundRecord.setIsdeleted(Constants.ZERO); |
| | |
| | | public List<YwOutinboundRecord> verifyData(YwOutinbound ywOutinbound){ |
| | | if(Objects.isNull(ywOutinbound) |
| | | || Objects.isNull(ywOutinbound.getType()) |
| | | || (Objects.nonNull(ywOutinbound.getType()) && (!(ywOutinbound.getType() == Constants.ZERO || ywOutinbound.getType() == Constants.ONE))) |
| | | // || (Objects.nonNull(ywOutinbound.getType()) && (!(ywOutinbound.getType() == Constants.ZERO || ywOutinbound.getType() == Constants.ONE))) |
| | | || Objects.isNull(ywOutinbound.getWarehouseId()) |
| | | || Objects.isNull(ywOutinbound.getDoneDate()) |
| | | || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywOutinbound.getRecordList()) |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | ywOutinboundRecord.setId(null); |
| | | } |
| | | //夿å½åæ¯å¦åå¨è¿è¡ä¸ççç¹å |
| | | if(ywStocktakingMapper.selectCount(new QueryWrapper<YwStocktaking>().lambda().eq(YwStocktaking::getIsdeleted,Constants.ZERO) |
| | |
| | | |
| | | public void dealStockData(YwOutinbound ywOutinbound,List<YwOutinboundRecord> recordList,Integer inOut){ |
| | | for (YwOutinboundRecord ywOutinboundRecord:recordList) { |
| | | YwStock ywStock = ywStockMapper.selectOne(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO).eq(YwStock::getWarehouseId,ywOutinbound.getWarehouseId()).eq(YwStock::getMaterialId,ywOutinboundRecord.getMaterialId())); |
| | | YwStock ywStock = ywStockMapper.selectOne(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO) |
| | | .eq(YwStock::getWarehouseId,ywOutinbound.getWarehouseId()).eq(YwStock::getMaterialId,ywOutinboundRecord.getMaterialId())); |
| | | if(Constants.equalsInteger(inOut,Constants.ZERO)){ |
| | | //å
¥åº |
| | | if(Objects.isNull(ywStock)){ |
| | | ywStock = new YwStock(); |
| | | ywStock.setIsdeleted(Constants.ZERO); |
| | | ywStock.setStock(ywOutinboundRecord.getStock()); |
| | | ywStock.setWarehouseId(ywOutinbound.getWarehouseId()); |
| | | ywStock.setMaterialId(ywOutinboundRecord.getMaterialId()); |
| | |
| | | ywStockMapper.insert(ywStock); |
| | | }else{ |
| | | ywStockMapper.update(new UpdateWrapper<YwStock>().lambda() |
| | | .set(YwStock::getStock," ( stock + " + ywStock.getStock() + " )") |
| | | .setSql(" stock = ( stock + "+ywOutinboundRecord.getStock()+") ") |
| | | .set(YwStock::getEditDate, DateUtil.getCurrDateTime()) |
| | | .set(YwStock::getEditor, ywOutinbound.getCreator()) |
| | | .eq(YwStock::getId,ywStock.getId()) |
| | |
| | | ywStockMapper.deleteById(ywStock.getId()); |
| | | }else{ |
| | | ywStockMapper.update(new UpdateWrapper<YwStock>().lambda() |
| | | .set(YwStock::getStock," ( stock - " + ywStock.getStock() + " )") |
| | | .setSql(" stock = ( stock - "+ywOutinboundRecord.getStock()+") ") |
| | | .set(YwStock::getEditDate, DateUtil.getCurrDateTime()) |
| | | .set(YwStock::getEditor, ywOutinbound.getCreator()) |
| | | .eq(YwStock::getId,ywStock.getId()) |
| | |
| | | |
| | | |
| | | public synchronized String getNextInOutCode(Integer inOut){ |
| | | String prefix = Constants.equalsInteger(inOut,0)?"RK-":"CK-" + DateUtil.getDate(new Date(),"yyyyMMdd") +"-"; |
| | | String prefix = (Constants.equalsInteger(inOut,0)?"RK-":"CK-") + DateUtil.getDate(new Date(),"yyyyMMdd") +"-"; |
| | | Integer countNum = RedisUtil.getObject(redisTemplate, |
| | | Constants.equalsInteger(inOut,0)?Constants.RedisKeys.COM_OUTBOUND_OUT_KEY:Constants.RedisKeys.COM_OUTBOUND_IN_KEY, |
| | | Integer.class); |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | |
| | | |
| | | if(StringUtils.isNotBlank(ywPatrolScheme.getUserIds())){ |
| | | String [] userIds = ywPatrolScheme.getUserIds().split(","); |
| | | for (String userId:userIds) { |
| | | //æ·»å å¾
åä¿¡æ¯ |
| | | Notices notices = new Notices(); |
| | | notices.setCreateDate(new Date()); |
| | | notices.setCreator(ywPatrolScheme.getCreator()); |
| | | notices.setIsdeleted(Constants.ZERO); |
| | | notices.setParam1(DateUtil.formatDate(ywPatrolTask.getStartDate(),"yyyy-MM-dd")); |
| | | notices.setTitle("å·¡æ£ä»»å¡å¾
å"); |
| | | notices.setContent("["+ywPatrolTask.getCode()+"]å°å¨["+notices.getParam1()+"]è¿è¡å·¡æ£ï¼è¯·ææ¶æ§è¡"); |
| | | notices.setObjId(ywPatrolTask.getId()); |
| | | notices.setObjType(Constants.ONE); |
| | | notices.setType(notices.getObjType()); |
| | | notices.setUserId(Integer.valueOf(userId)); |
| | | notices.setStatus(Constants.ZERO); |
| | | noticesJoinMapper.insert(notices); |
| | | List<SystemUser> systemUserList = systemUserMapper.selectList(new QueryWrapper<SystemUser>().lambda().in(SystemUser::getId,userIds)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemUserList)){ |
| | | List<String> names = systemUserList.stream().filter(i->StringUtils.isNotBlank(i.getRealname())).map(i->i.getRealname()).collect(Collectors.toList()); |
| | | for (SystemUser systemUser:systemUserList) { |
| | | //æ·»å å¾
åä¿¡æ¯ |
| | | Notices notices = new Notices(); |
| | | notices.setCreateDate(new Date()); |
| | | notices.setCreator(ywPatrolScheme.getCreator()); |
| | | notices.setIsdeleted(Constants.ZERO); |
| | | notices.setParam1(DateUtil.formatDate(ywPatrolTask.getStartDate(),"yyyy-MM-dd")); |
| | | notices.setTitle("å·¡æ£ä»»å¡å¾
å"); |
| | | notices.setContent("["+ywPatrolTask.getCode()+"]å°å¨["+notices.getParam1()+"]è¿è¡å·¡æ£ï¼è¯·ææ¶æ§è¡"); |
| | | notices.setObjId(ywPatrolTask.getId()); |
| | | notices.setObjType(Constants.ONE); |
| | | notices.setType(notices.getObjType()); |
| | | notices.setUserId(Integer.valueOf(systemUser.getId())); |
| | | notices.setStatus(Constants.ZERO); |
| | | //æ´çjsonæ°æ® |
| | | Map<String,Object> jsonMap = new HashMap<>(); |
| | | jsonMap.put("key1", ywPatrolScheme.getTitle()); |
| | | jsonMap.put("key2", DateUtil.getFomartDate(ywPatrolTask.getStartDate(),"yyyy-MM-dd")); |
| | | jsonMap.put("key3", DateUtil.getFomartDate(ywPatrolTask.getStartDate(),"HH:mm") + "-" + DateUtil.getFomartDate(ywPatrolTask.getEndDate(),"HH:mm")); |
| | | jsonMap.put("key4", StringUtils.join(names , "ã")); |
| | | notices.setParam2(JSONObject.toJSONString(jsonMap)); |
| | | notices.setParam3(Constants.ZERO+""); |
| | | noticesJoinMapper.insert(notices); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | .set(YwPatrolTaskRecord::getDealInfo, ywPatrolTaskRecord.getDealInfo()) |
| | | .eq(YwPatrolTaskRecord::getId,ywPatrolTaskRecord.getId())); |
| | | |
| | | //æ è®°å¾
åå·²å¤ç |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.ONE) |
| | | .eq(Notices::getObjId,ywPatrolTask.getId()) |
| | | ); |
| | | |
| | | if(ywPatrolTaskRecordMapper.selectCount(new QueryWrapper<YwPatrolTaskRecord>().lambda() |
| | | .eq(YwPatrolTaskRecord::getTaskId,ywPatrolTask.getId()) |
| | | .eq(YwPatrolTaskRecord::getStatus,Constants.ZERO) |
| | |
| | | .set(YwPatrolTask::getEditor,loginUserInfo.getId()) |
| | | ); |
| | | |
| | | if(ywPatrolTaskMapper.selectCount(new QueryWrapper<YwPatrolTask>().lambda() |
| | | .eq(YwPatrolTask::getSchemeId,ywPatrolTask.getSchemeId()) |
| | | .in(YwPatrolTask::getStatus,Constants.ZERO,Constants.ONE) |
| | | .ne(YwPatrolTask::getId,ywPatrolTask.getId()) |
| | | )==Constants.ZERO){ |
| | | ywPatrolSchemeMapper.update(null,new UpdateWrapper<YwPatrolScheme>().lambda() |
| | | .eq(YwPatrolScheme::getId,ywPatrolScheme.getId()) |
| | | .set(YwPatrolScheme::getStatus,Constants.TWO) |
| | | .set(YwPatrolScheme::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(YwPatrolScheme::getEditor,loginUserInfo.getId()) |
| | | ); |
| | | } |
| | | // if(ywPatrolTaskMapper.selectCount(new QueryWrapper<YwPatrolTask>().lambda() |
| | | // .eq(YwPatrolTask::getSchemeId,ywPatrolTask.getSchemeId()) |
| | | // .in(YwPatrolTask::getStatus,Constants.ZERO,Constants.ONE) |
| | | // .ne(YwPatrolTask::getId,ywPatrolTask.getId()) |
| | | // )==Constants.ZERO){ |
| | | // ywPatrolSchemeMapper.update(null,new UpdateWrapper<YwPatrolScheme>().lambda() |
| | | // .eq(YwPatrolScheme::getId,ywPatrolScheme.getId()) |
| | | // .set(YwPatrolScheme::getStatus,Constants.TWO) |
| | | // .set(YwPatrolScheme::getEditDate,DateUtil.getCurrDateTime()) |
| | | // .set(YwPatrolScheme::getEditor,loginUserInfo.getId()) |
| | | // ); |
| | | // } |
| | | |
| | | //æ è®°å¾
åå·²å¤ç |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam3,Constants.TWO) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.ONE) |
| | | .eq(Notices::getObjId,ywPatrolTask.getId()) |
| | | ); |
| | | }else{ |
| | | if(Constants.equalsInteger(ywPatrolTask.getStatus(),Constants.ZERO)){ |
| | | ywPatrolTaskMapper.update(null,new UpdateWrapper<YwPatrolTask>().lambda() |
| | |
| | | .set(YwPatrolTask::getEditor,loginUserInfo.getId()) |
| | | ); |
| | | } |
| | | if(Constants.equalsInteger(ywPatrolScheme.getStatus(),Constants.ZERO)){ |
| | | ywPatrolSchemeMapper.update(null,new UpdateWrapper<YwPatrolScheme>().lambda() |
| | | .eq(YwPatrolScheme::getId,ywPatrolScheme.getId()) |
| | | .set(YwPatrolScheme::getStatus,Constants.ONE) |
| | | .set(YwPatrolScheme::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(YwPatrolScheme::getEditor,loginUserInfo.getId()) |
| | | ); |
| | | } |
| | | // if(Constants.equalsInteger(ywPatrolScheme.getStatus(),Constants.ZERO)){ |
| | | // ywPatrolSchemeMapper.update(null,new UpdateWrapper<YwPatrolScheme>().lambda() |
| | | // .eq(YwPatrolScheme::getId,ywPatrolScheme.getId()) |
| | | // .set(YwPatrolScheme::getStatus,Constants.ONE) |
| | | // .set(YwPatrolScheme::getEditDate,DateUtil.getCurrDateTime()) |
| | | // .set(YwPatrolScheme::getEditor,loginUserInfo.getId()) |
| | | // ); |
| | | // } |
| | | //æ è®°å¾
åå·²å¤ç |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getParam3,Constants.ONE) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.ONE) |
| | | .eq(Notices::getObjId,ywPatrolTask.getId()) |
| | | ); |
| | | } |
| | | //éä»¶æ°æ® |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywPatrolTaskRecord.getMultifileList())){ |
| | |
| | | .leftJoin(YwPatrolPoint.class,YwPatrolPoint::getId,YwPatrolTaskRecord::getPointId) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwPatrolTaskRecord::getDealUserId) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .eq(YwPatrolScheme::getIsdeleted, Constants.ZERO) |
| | | .eq(YwPatrolTaskRecord::getIsdeleted, Constants.ZERO) |
| | | .eq(YwPatrolPoint::getCode,bean.getPointCode()) |
| | | .eq(YwPatrolTaskRecord::getTaskId,bean.getTaskId()) |
| | | .orderByDesc(YwPatrolScheme::getCreateDate) |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç»å½äººä¸å·¡æ£ç¹æ¥è¯¢ä»»å¡ä¿¡æ¯ |
| | | * @param bean |
| | | * @return |
| | | */ |
| | | @Override |
| | | public YwPatrolTaskRecord getRecordByUserPoint(YwPatrolTaskRecord bean,LoginUserInfo loginUserInfo) { |
| | | if(Objects.isNull(bean) |
| | | || StringUtils.isBlank(bean.getPointCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(ywPatrolPointMapper.selectCount(new QueryWrapper<YwPatrolPoint>().lambda().eq(YwPatrolPoint::getCode,bean.getPointCode()))==Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªå¹é
å°å·¡æ£ç¹ï¼è¯·éæ°æ«ç !"); |
| | | } |
| | | YwPatrolTaskRecord ywPatrolTaskRecord = ywPatrolTaskRecordMapper.selectJoinOne(YwPatrolTaskRecord.class,new MPJLambdaWrapper<YwPatrolTaskRecord>() |
| | | .selectAll(YwPatrolTaskRecord.class) |
| | | .selectAs(YwPatrolPoint::getName,YwPatrolTaskRecord::getPointName) |
| | | .selectAs(YwPatrolPoint::getContent,YwPatrolTaskRecord::getContent) |
| | | .selectAs(YwPatrolPoint::getDeviceId,YwPatrolTaskRecord::getDeviceId) |
| | | .selectAs(YwPatrolScheme::getTitle,YwPatrolTaskRecord::getSchemeTitle) |
| | | .selectAs(SystemUser::getRealname,YwPatrolTaskRecord::getRealname) |
| | | .selectAs(Company::getName,YwPatrolTaskRecord::getCompanyName) |
| | | .leftJoin(YwPatrolPoint.class,YwPatrolPoint::getId,YwPatrolTaskRecord::getPointId) |
| | | .leftJoin(YwPatrolTask.class,YwPatrolTask::getId,YwPatrolTaskRecord::getTaskId) |
| | | .leftJoin(YwPatrolScheme.class,YwPatrolScheme::getId,YwPatrolTask::getSchemeId) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwPatrolTaskRecord::getDealUserId) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .eq(YwPatrolTaskRecord::getIsdeleted, Constants.ZERO) |
| | | .eq(YwPatrolTaskRecord::getStatus, Constants.ZERO) |
| | | .eq(YwPatrolPoint::getCode,bean.getPointCode()) |
| | | .apply(" DATE(t2.START_DATE) = DATE(NOW()) and find_in_set('"+loginUserInfo.getId()+"', t3.USER_IDS ) ") |
| | | .orderByDesc(YwPatrolScheme::getCreateDate) |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(Objects.isNull(ywPatrolTaskRecord)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"仿¥ææ å·¡æ£ä»»å¡!"); |
| | | } |
| | | getFileListByModel(ywPatrolTaskRecord); |
| | | return ywPatrolTaskRecord; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public Integer create(YwProblem ywProblem) { |
| | | if(Objects.isNull(ywProblem) |
| | | || Objects.isNull(ywProblem.getSubmitDate()) |
| | | || StringUtils.isBlank(ywProblem.getContent()) |
| | | || StringUtils.isBlank(ywProblem.getPhone()) |
| | | || StringUtils.isBlank(ywProblem.getName()) |
| | |
| | | ywProblem.setIsdeleted(Constants.ZERO); |
| | | ywProblem.setStatus(Constants.ZERO); |
| | | ywProblem.setDealStatus(Constants.ZERO); |
| | | ywProblem.setSubmitDate(new Date()); |
| | | ywProblemMapper.insert(ywProblem); |
| | | |
| | | List<Multifile> fileList = new ArrayList<>(); |
| | |
| | | |
| | | |
| | | @Override |
| | | public YwProblem getDetail(Integer id) { |
| | | public YwProblem getDetail(Integer id,Integer workorderId) { |
| | | MPJLambdaWrapper<YwProblem> queryWrapper = new MPJLambdaWrapper<YwProblem>(); |
| | | queryWrapper.selectAll(YwProblem.class) |
| | | .selectAs(SystemUser::getRealname,YwProblem::getDealUserName) |
| | | .selectAs(Company::getName,YwProblem::getDealUserCompanyName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwProblem::getDealUserId) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .eq(YwProblem::getId,id) |
| | | .eq(Objects.nonNull(id),YwProblem::getId,id) |
| | | .eq(Objects.nonNull(workorderId),YwProblem::getWorkorderId,workorderId) |
| | | .last(" limit 1 ") |
| | | ; |
| | | YwProblem ywProblem = ywProblemMapper.selectJoinOne(YwProblem.class,queryWrapper); |
| | | if(Objects.isNull(ywProblem)){ |
| | |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO)); |
| | | if(multifiles!=null){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_PROBLEM).getCode(); |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_WORKORDER_FILE).getCode(); |
| | | for(Multifile f : multifiles){ |
| | | if(StringUtils.isBlank(f.getFileurl())){ |
| | | continue; |
| | |
| | | } |
| | | return ywProblem; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | }else{ |
| | | if(Objects.isNull(ywProblem.getWorkOrderAreaType()) |
| | | ||Objects.isNull(ywProblem.getWorkOrderCateId()) |
| | | ||StringUtils.isBlank(ywProblem.getWorkOrderContent()) |
| | | ||StringUtils.isBlank(ywProblem.getDealInfo()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | YwWorkorder ywWorkorder = new YwWorkorder(); |
| | | ywWorkorder.setProjectId(ywProblem.getWorkOrderProjectId()); |
| | | ywWorkorder.setBuildingId(ywProblem.getWorkOrderBuildId()); |
| | | ywWorkorder.setAreaType(ywProblem.getWorkOrderAreaType()); |
| | | ywWorkorder.setCateId(ywProblem.getWorkOrderCateId()); |
| | | ywWorkorder.setContent(ywProblem.getWorkOrderContent()); |
| | | ywWorkorder.setContent(ywProblem.getDealInfo()); |
| | | ywWorkorder.setRoomId(ywProblem.getWorkOrderRoomId()); |
| | | ywWorkorder.setFloorId(ywProblem.getWorkOrderFloorId()); |
| | | ywWorkorder.setGetDate(ywProblem.getWorkOrderGetDate()); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | projectDataVOList.add(projectDataVO); |
| | | } |
| | | |
| | | List<YwRoom> ywRoomList = ywRoomMapper.selectList(new QueryWrapper<YwRoom>().lambda() |
| | | List<YwRoom> ywRoomList = ywRoomMapper.selectJoinList(YwRoom.class,new MPJLambdaWrapper<YwRoom>() |
| | | .selectAll(YwRoom.class) |
| | | // .select(" ( SELECT count(1) FROM yw_contract y1 " + |
| | | // " left join yw_contract_room y2 on y1.id = y2.contract_id " + |
| | | // " where 1 = 1 and y2.type = 0 and y1.`STATUS` in( 0,1,2) " + |
| | | // " and y1.START_DATE < now() and y1.END_DATE > now() and y2.ROOM_ID = yw_room.id ) as investmentStatus ") |
| | | .select(" ifnull( ( select case when y1.status = 3 then now() BETWEEN y1.START_DATE and y1.BT_DATE else now() BETWEEN y1.START_DATE and y1.END_DATE END " + |
| | | "from yw_contract y1 left join yw_contract_room y2 on y1.id = y2.CONTRACT_ID and y2.TYPE = 0 " + |
| | | "where y1.`STATUS` <> 4 and y2.room_id = t.id order by y1.create_date desc limit 1 ) ,0) ",YwRoom::getLeaseStatus) |
| | | .eq(YwRoom::getIsdeleted,Constants.ZERO) |
| | | .eq(YwRoom::getStatus,Constants.ZERO) |
| | | .eq(YwRoom::getIsInvestment,Constants.ONE) |
| | |
| | | projectDataVO.setArea(data.getRentArea().setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | projectDataVO.setPId(data.getFloor()); |
| | | projectDataVO.setLv(Constants.THREE); |
| | | projectDataVO.setLeaseStatus(data.getLeaseStatus()); |
| | | projectDataVOList.add(projectDataVO); |
| | | } |
| | | |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | YwRoomStatusDataVO roomStatusDataVO = new YwRoomStatusDataVO(); |
| | | roomStatusDataVO.setFloorId(ywRoom.getFloor()); |
| | | roomStatusDataVO.setRoomId(ywRoom.getId()); |
| | | roomStatusDataVO.setRoomCode(ywRoom.getCode()); |
| | | roomStatusDataVO.setRoomCode(ywRoom.getRoomNum()); |
| | | roomStatusDataVO.setRoomRentArea(ywRoom.getRentArea()); |
| | | |
| | | List<YwContract> roomContractList = ywContractMapper.selectJoinList(YwContract.class,new MPJLambdaWrapper<YwContract>() |
| | |
| | | .leftJoin(YwContractRoom.class,YwContractRoom::getContractId,YwContract::getId) |
| | | .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId) |
| | | .eq(YwContract::getIsdeleted,Constants.ZERO) |
| | | .ge(YwContract::getStartDate, DateUtil.getCurrDateTime()) |
| | | .le(YwContract::getStartDate, DateUtil.getCurrDateTime()) |
| | | .ge(YwContract::getEndDate, DateUtil.getCurrDateTime()) |
| | | .eq(YwContractRoom::getType,Constants.ZERO) |
| | | .eq(YwContractRoom::getRoomId,ywRoom.getId()) |
| | | .ne(YwContract::getBillStatus,Constants.THREE) |
| | | .orderByDesc(YwContract::getStartDate) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(roomContractList)){ |
| | |
| | | roomStatusDataVO.setOverData(ywContract.getBtDate()); |
| | | } |
| | | }else{ |
| | | if(Objects.nonNull(ywContract.getEndDate()) && DateUtil.getBetweenDays(DateUtil.getFomartDate(ywContract.getEndDate(),"yyyy-MM-dd"),DateUtil.getFomartDate(new Date(),"yyyy-MM-dd"))<=90){ |
| | | System.out.println(DateUtil.daysBetweenDates(ywContract.getEndDate(),new Date())); |
| | | if(Objects.nonNull(ywContract.getEndDate()) |
| | | && |
| | | DateUtil.daysBetweenDates(ywContract.getEndDate(),new Date())<=90){ |
| | | roomStatusDataVO.setRoomStatus(Constants.TWO); |
| | | roomStatusDataVO.setOverData(ywContract.getEndDate()); |
| | | }else{ |
| | | roomStatusDataVO.setOverData(ywContract.getEndDate()); |
| | | } |
| | | } |
| | | }else{ |
| | | roomStatusDataVO.setRoomStatus(Constants.ZERO); |
| | | //å·²éç§ è®¡ç®éç§æ¶é´ |
| | | if(Objects.nonNull(ywContract.getBtDate())){ |
| | | //æ¥è¯¢éç§æ¥æåå½åæ¥æç¸å·®å¤©æ° |
| | | Integer btDays = DateUtil.daysBetweenDates(new Date(),ywContract.getBtDate()); |
| | | if(btDays>=Constants.ZERO){ |
| | | roomStatusDataVO.setFreeDayAmount(btDays); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | for (YwFloor ywFloor:ywFloorList) { |
| | | YwFloorStatusDataVO ywFloorStatusDataVO = new YwFloorStatusDataVO(); |
| | | ywFloorStatusDataVO.setFloor(ywFloor.getFloor()); |
| | | ywFloorStatusDataVO.setFloorName(ywFloor.getName()); |
| | | ywFloorStatusDataVO.setFloorId(ywFloor.getId()); |
| | | ywFloorStatusDataVO.setFloorArea(ywFloor.getArea()); |
| | | ywFloorStatusDataVO.setFloorArea(BigDecimal.ZERO); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(roomStatusDataList)){ |
| | | List<YwRoomStatusDataVO> floorRoomList = roomStatusDataList.stream().filter(i->Objects.nonNull(i.getFloorId())&&Constants.equalsInteger(i.getFloorId(),ywFloor.getId())).collect(Collectors.toList()); |
| | | ywFloorStatusDataVO.setYwRoomStatusDataVOList(floorRoomList); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(floorRoomList)){ |
| | | ywFloorStatusDataVO.setFloorArea(floorRoomList.stream().filter(i->Objects.nonNull(i.getRoomRentArea())).map(i->i.getRoomRentArea()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | } |
| | | } |
| | | ywFloorStatusDataVOList.add(ywFloorStatusDataVO); |
| | | } |
| | |
| | | ywRoomContractDataVO.setLeasePrice(BigDecimal.ZERO); |
| | | ywRoomContractDataVO.setLeaseArea(BigDecimal.ZERO); |
| | | ywRoomContractDataVO.setLeaseRoomAmount(Constants.ZERO); |
| | | ywRoomContractDataVO.setLeaseDayPrice(BigDecimal.ZERO); |
| | | |
| | | List<YwRoom> ywRoomList = ywRoomMapper.selectList(new QueryWrapper<YwRoom>().lambda() |
| | | .eq(YwRoom::getIsdeleted,Constants.ZERO) |
| | |
| | | List<YwContract> roomContractList = ywContractMapper.selectJoinList(YwContract.class,new MPJLambdaWrapper<YwContract>() |
| | | .selectAll(YwContract.class) |
| | | .select(" ( select ifnull(sum(yr.RENT_AREA),0) from yw_contract_room y left join yw_room yr on y.room_id = yr.id where y.type = 0 and y.CONTRACT_ID = t.id ) " , YwContract::getTotalArea) |
| | | .select(" ( select ifnull(sum(y.TOTLE_FEE),0) from yw_contract_bill y where y.CONTRACT_ID = t.id and y.type = 0 ) " , YwContract::getTotalFee) |
| | | .select(" ( select ifnull(sum(y.TOTLE_FEE),0) from yw_contract_bill y where y.CONTRACT_ID = t.id and y.type = 0 and y.COST_TYPE=0 and y.BILL_TYPE = 0 ) " , YwContract::getTotalFee) |
| | | .eq(YwContract::getIsdeleted,Constants.ZERO) |
| | | .in(YwContract::getStatus,Constants.ONE,Constants.TWO,Constants.THREE) |
| | | .ne(YwContract::getBillStatus,Constants.THREE) |
| | | .apply(Objects.nonNull(model.getBuildingId()), |
| | | " t.id in ( select y.CONTRACT_ID from yw_contract_room y left join yw_room yr on y.room_id = yr.id where y.type = 0 and yr.BUILDING_ID = "+model.getBuildingId()+" ) ") |
| | | .apply(Objects.nonNull(model.getProjectId()), |
| | | " t.id in ( select y.CONTRACT_ID from yw_contract_room y left join yw_room yr on y.room_id = yr.id where y.type = 0 and yr.PROJECT_ID = "+model.getProjectId()+" ) ") |
| | | .apply(Objects.nonNull(model.getProjectId())," ") |
| | | .orderByDesc(YwContract::getStartDate) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(roomContractList)){ |
| | |
| | | } |
| | | //å¤çç§èµåä»· æ ¹æ® ååç§èµæ»é¢ / ï¼ç§èµæ¶é¿ * ç§èµé¢ç§¯ï¼ |
| | | for (YwContract ywContract:roomContractList) { |
| | | long contractDayAmount = DateUtil.getBetweenDays(DateUtil.getFomartDate(ywContract.getEndDate(),"yyyy-MM-dd"),DateUtil.getFomartDate(ywContract.getStartDate(),"yyyy-MM-dd")); |
| | | long contractDayAmount = DateUtil.daysBetweenDates(ywContract.getEndDate() |
| | | ,ywContract.getStartDate()); |
| | | if(Objects.nonNull(contractDayAmount) && Objects.nonNull(ywContract.getTotalArea()) && Objects.nonNull(ywContract.getTotalFee())){ |
| | | ywRoomContractDataVO.setLeasePrice( |
| | | ywRoomContractDataVO.getLeasePrice().add( |
| | | ywRoomContractDataVO.setLeaseDayPrice( |
| | | ywRoomContractDataVO.getLeaseDayPrice().add( |
| | | ywContract.getTotalFee().divide((ywContract.getTotalArea().multiply(new BigDecimal(Long.toString(contractDayAmount)))),2,BigDecimal.ROUND_HALF_UP) |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | ywRoomContractDataVO.setLeaseContractAmount(roomContractList.size()); |
| | | if(Objects.nonNull(ywRoomContractDataVO.getLeaseDayPrice())&&ywRoomContractDataVO.getLeaseDayPrice().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | ywRoomContractDataVO.setLeasePrice( |
| | | ywRoomContractDataVO.getLeaseDayPrice().divide(new BigDecimal(Integer.toString(ywRoomContractDataVO.getLeaseContractAmount())),2,BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | List<Integer> contractId = roomContractList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<YwRoom> ywLeaseRoomList = ywRoomMapper.selectJoinList(YwRoom.class,new MPJLambdaWrapper<YwRoom>() |
| | | .selectAll(YwRoom.class) |
| | |
| | | .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStock::getWarehouseId) |
| | | .leftJoin(YwMaterial.class,YwMaterial::getId,YwStock::getMaterialId) |
| | | .eq(Objects.nonNull(model.getWarehouseId()),YwOutinbound::getWarehouseId,model.getWarehouseId()) |
| | | .and(StringUtils.isNotBlank(model.getMaterialCode()),i->i.like(YwMaterial::getName,model.getMaterialCode()).or().like(YwMaterial::getName,model.getMaterialCode())) |
| | | .like(StringUtils.isNotBlank(model.getMaterialCode()),YwMaterial::getCode,model.getMaterialCode()) |
| | | .and(StringUtils.isNotBlank(model.getMaterialCode()),i->i.like(YwMaterial::getCode,model.getMaterialCode()).or().like(YwMaterial::getName,model.getMaterialCode())) |
| | | .like(StringUtils.isNotBlank(model.getMaterialAttr()),YwMaterial::getAttr,model.getMaterialAttr()) |
| | | .orderByAsc(YwMaterial::getCode) |
| | | ; |
| | |
| | | .eq(Objects.nonNull(model.getStocktakingId()),YwStocktakingRecord::getStocktakingId,model.getStocktakingId()) |
| | | .and(StringUtils.isNotBlank(model.getMaterialCode()),i->i.like(YwMaterial::getCode,model.getMaterialCode()).or().like(YwMaterial::getName,model.getMaterialCode())) |
| | | .eq(Objects.nonNull(model.getType()),YwStocktakingRecord::getType,model.getType()) |
| | | .eq(Objects.nonNull(model.getStatus()),YwStocktakingRecord::getStatus,model.getStatus()); |
| | | .eq(Objects.nonNull(model.getStatus()),YwStocktakingRecord::getStatus,model.getStatus()) |
| | | .eq(Objects.nonNull(model.getMaterialQrcode()),YwMaterial::getQrcode,model.getMaterialQrcode()); |
| | | IPage iPage = ywStocktakingRecordMapper.selectJoinPage(page, YwStocktakingRecord.class,queryWrapper); |
| | | return PageData.from(iPage); |
| | | } |
| | |
| | | } |
| | | LoginUserInfo loginUserInfo = ywStocktakingRecord.getLoginUserInfo(); |
| | | YwStocktakingRecord model = ywStocktakingRecordMapper.selectById(ywStocktakingRecord.getId()); |
| | | if(Objects.nonNull(model)){ |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | YwStocktaking ywStocktaking = ywStocktakingMapper.selectById(ywStocktakingRecord.getStocktakingId()); |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | |
| | | import com.doumee.dao.business.YwStocktakingRecordMapper; |
| | | import com.doumee.dao.business.YwWarehouseMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.join.NoticesJoinMapper; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.YwStocktakingService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | | |
| | | @Autowired |
| | | private SystemUserMapper systemUserMapper; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Override |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ä»åºæ°æ®"); |
| | | } |
| | | //夿å½åä»åºå½åæ¥ææ¯å¦åå¨çç¹å |
| | | if(ywStocktakingMapper.selectCount(new QueryWrapper<YwStocktaking>().lambda().eq(YwStocktaking::getIsdeleted,Constants.ZERO).eq(YwStocktaking::getStatus,Constants.ZERO) |
| | | .eq(YwStocktaking::getWarehouseId,ywStocktaking.getWarehouseId()).apply(" DATE(PLAN_DATE) = '" + DateUtil.formatDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd") +"'" ))>0){ |
| | | if(ywStocktakingMapper.selectCount(new QueryWrapper<YwStocktaking>().lambda() |
| | | .eq(YwStocktaking::getIsdeleted,Constants.ZERO) |
| | | .in(YwStocktaking::getStatus,Constants.ZERO,Constants.ONE) |
| | | .eq(YwStocktaking::getWarehouseId,ywStocktaking.getWarehouseId()) |
| | | .apply(" DATE(PLAN_DATE) = '" + DateUtil.formatDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd") +"'" ))>0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+DateUtil.formatDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd")+"]["+ywWarehouse.getName()+"]å·²æçç¹åï¼ä¸å¯éå¤åèµ·çç¹"); |
| | | } |
| | | SystemUser systemUser = systemUserMapper.selectById(ywStocktaking.getUserId()); |
| | | if(Objects.isNull(systemUser)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°çç¹äººä¿¡æ¯"); |
| | | } |
| | | LoginUserInfo loginUserInfo = ywStocktaking.getLoginUserInfo(); |
| | | ywStocktaking.setCreator(loginUserInfo.getId()); |
| | |
| | | notices.setType(notices.getObjType()); |
| | | notices.setUserId(ywStocktaking.getUserId()); |
| | | notices.setStatus(Constants.ZERO); |
| | | //æ´çjsonæ°æ® |
| | | Map<String,Object> jsonMap = new HashMap<>(); |
| | | jsonMap.put("key1","çç¹å"+ywStocktaking.getCode()); |
| | | jsonMap.put("key2", DateUtil.getFomartDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd")); |
| | | jsonMap.put("key3", ywWarehouse.getName()); |
| | | jsonMap.put("key4", systemUser.getRealname()); |
| | | notices.setParam2(JSONObject.toJSONString(jsonMap)); |
| | | notices.setParam3(Constants.ZERO+""); |
| | | noticesJoinMapper.insert(notices); |
| | | return ywStocktaking.getId(); |
| | | } |
| | |
| | | .eq(YwStocktaking::getId,id) |
| | | ); |
| | | //æ è®°å¾
åå é¤ |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda().set(Notices::getIsdeleted,Constants.ONE) |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getIsdeleted,Constants.ONE) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.ZERO) |
| | | .eq(Notices::getObjId,id) |
| | |
| | | .set(YwStocktaking::getEditor,loginUserInfo.getId()) |
| | | .set(YwStocktaking::getStatus,Constants.THREE).eq(YwStocktaking::getId,id)); |
| | | //æ è®°å¾
åå é¤ |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda().set(Notices::getIsdeleted,Constants.ONE) |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getIsdeleted,Constants.ONE) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.ZERO) |
| | | .eq(Notices::getObjId,id) |
| | |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°çç¹åæ°æ®"); |
| | | } |
| | | if(model.getPlanDate().getTime()<System.currentTimeMillis()){ |
| | | if(model.getPlanDate().getTime()>System.currentTimeMillis()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªå°å¼å§æ¶é´ï¼æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ZERO)&&Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | |
| | | |
| | | //æ è®°å¾
åå·²å¤ç |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam3,Constants.ONE) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.ZERO) |
| | | .eq(Notices::getObjId,id) |
| | |
| | | ywStocktakingRecord.setIsdeleted(Constants.ZERO); |
| | | ywStocktakingRecord.setStatus(Constants.ZERO); |
| | | ywStocktakingRecord.setMaterialId(ywStock.getMaterialId()); |
| | | ywStocktakingRecord.setUserId(model.getUserId()+""); |
| | | ywStocktakingRecord.setStock(ywStock.getStock()); |
| | | ywStocktakingRecord.setStocktakingId(model.getId()); |
| | | ywStocktakingRecordList.add(ywStocktakingRecord); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void finishById(Integer id, LoginUserInfo loginUserInfo) { |
| | | public void finishById(Integer id, YwOutinboundServiceImpl ywOutinboundService, LoginUserInfo loginUserInfo) { |
| | | YwStocktaking model = ywStocktakingMapper.selectById(id); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°çç¹åæ°æ®"); |
| | |
| | | } |
| | | List<YwStocktakingRecord> recordList = ywStocktakingRecordMapper.selectList(new QueryWrapper<YwStocktakingRecord>().lambda() |
| | | .eq(YwStocktakingRecord::getStocktakingId,id).eq(YwStocktakingRecord::getIsdeleted,Constants.ZERO)); |
| | | //ççæ°æ®å表 |
| | | List<YwOutinboundRecord> inBoundRecordList = new ArrayList<>(); |
| | | //çäºæ°æ®å表 |
| | | List<YwOutinboundRecord> outBoundRecordList = new ArrayList<>(); |
| | | for (YwStocktakingRecord ywStocktakingRecord:recordList) { |
| | | //æäº¤æ¶ æªè¿è¡çç¹çæç»æ°æ® |
| | | if(Constants.equalsInteger(ywStocktakingRecord.getStatus(),Constants.ZERO)){ |
| | |
| | | .set(YwStocktakingRecord::getUserId,loginUserInfo.getId()) |
| | | .eq(YwStocktakingRecord::getId,ywStocktakingRecord.getId()) |
| | | ); |
| | | continue; |
| | | } |
| | | //æ¥è¯¢åºåä¿¡æ¯ è¿è¡åºåæ´æ° |
| | | YwStock ywStock = ywStockMapper.selectOne(new QueryWrapper<YwStock>().lambda().eq(YwStock::getMaterialId,ywStocktakingRecord.getMaterialId()) |
| | | .eq(YwStock::getWarehouseId,model.getWarehouseId()).eq(YwStock::getStock,ywStocktakingRecord.getStock())); |
| | | if(Objects.isNull(ywStock)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åºåä¿¡æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | if(ywStock.getStock().compareTo(ywStocktakingRecord.getActStock())<Constants.ZERO ){ |
| | | YwOutinboundRecord ywOutinboundRecord = new YwOutinboundRecord(); |
| | | ywOutinboundRecord.setMaterialId(ywStock.getMaterialId()); |
| | | ywOutinboundRecord.setStock(ywStocktakingRecord.getActStock().subtract(ywStock.getStock())); |
| | | inBoundRecordList.add(ywOutinboundRecord); |
| | | }else if(ywStock.getStock().compareTo(ywStocktakingRecord.getActStock())>Constants.ZERO ){ |
| | | YwOutinboundRecord ywOutinboundRecord = new YwOutinboundRecord(); |
| | | ywOutinboundRecord.setMaterialId(ywStock.getMaterialId()); |
| | | ywOutinboundRecord.setStock(ywStock.getStock().subtract(ywStocktakingRecord.getActStock())); |
| | | outBoundRecordList.add(ywOutinboundRecord); |
| | | } |
| | | if(ywStocktakingRecord.getActStock().compareTo(BigDecimal.ZERO)==Constants.ZERO){ |
| | | ywStockMapper.deleteById(ywStock.getId()); |
| | | }else { |
| | | ywStockMapper.update(new UpdateWrapper<YwStock>().lambda().set(YwStock::getStock,ywStocktakingRecord.getActStock()).eq(YwStock::getId,ywStock.getId())); |
| | | } |
| | | // if(Objects.isNull(ywStock)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åºåä¿¡æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | // } |
| | | // if(ywStocktakingRecord.getActStock().compareTo(BigDecimal.ZERO)==Constants.ZERO){ |
| | | // ywStockMapper.deleteById(ywStock.getId()); |
| | | // }else { |
| | | // ywStockMapper.update(new UpdateWrapper<YwStock>().lambda().set(YwStock::getStock,ywStocktakingRecord.getActStock()).eq(YwStock::getId,ywStock.getId())); |
| | | // } |
| | | } |
| | | ywStocktakingMapper.update(new UpdateWrapper<YwStocktaking>().lambda() |
| | | .set(YwStocktaking::getEditDate,DateUtil.getCurrDateTime()) |
| | |
| | | .set(YwStocktaking::getEditor,loginUserInfo.getId()) |
| | | .set(YwStocktaking::getStatus,Constants.TWO) |
| | | .eq(YwStocktaking::getId,model.getId())); |
| | | //ç产çççå
¥åºå |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(inBoundRecordList)){ |
| | | YwOutinbound ywOutinbound = new YwOutinbound(); |
| | | ywOutinbound.setDoneDate(new Date()); |
| | | ywOutinbound.setWarehouseId(model.getWarehouseId()); |
| | | ywOutinbound.setType(4); |
| | | ywOutinbound.setOrigin(1); |
| | | ywOutinbound.setContent("çç¹åã"+model.getCode() +"ãå¤ççæççæ°æ®"); |
| | | ywOutinbound.setStatus(Constants.ZERO); |
| | | ywOutinbound.setRecordList(inBoundRecordList); |
| | | ywOutinbound.setLoginUserInfo(loginUserInfo); |
| | | ywOutinboundService.create(ywOutinbound); |
| | | } |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(outBoundRecordList)){ |
| | | YwOutinbound ywOutinbound = new YwOutinbound(); |
| | | ywOutinbound.setDoneDate(new Date()); |
| | | ywOutinbound.setWarehouseId(model.getWarehouseId()); |
| | | ywOutinbound.setType(10); |
| | | ywOutinbound.setOrigin(1); |
| | | ywOutinbound.setContent("çç¹åã"+model.getCode() +"ãå¤ççæçäºæ°æ®"); |
| | | ywOutinbound.setStatus(Constants.ZERO); |
| | | ywOutinbound.setRecordList(outBoundRecordList); |
| | | ywOutinbound.setLoginUserInfo(loginUserInfo); |
| | | ywOutinboundService.create(ywOutinbound); |
| | | } |
| | | |
| | | //æ è®°å¾
å已宿 |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam3,Constants.TWO) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.ZERO) |
| | | .eq(Notices::getObjId,id) |
| | | ); |
| | | |
| | | } |
| | | |
| | |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°çç¹åæ°æ®"); |
| | | } |
| | | |
| | | SystemUser systemUser = systemUserMapper.selectById(ywStocktaking.getUserId()); |
| | | if(Objects.isNull(systemUser)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°çç¹äººä¿¡æ¯"); |
| | | } |
| | | |
| | | YwWarehouse ywWarehouse = ywWarehouseMapper.selectById(ywStocktaking.getWarehouseId()); |
| | | if(Objects.isNull(ywWarehouse)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ä»åºæ°æ®"); |
| | |
| | | //æ è®°å¾
åå·²å¤ç |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getIsdeleted,Constants.ONE) |
| | | .eq(Notices::getObjType,Constants.ZERO) |
| | | .eq(Notices::getObjId,ywStocktaking.getId()) |
| | | ); |
| | |
| | | notices.setType(notices.getObjType()); |
| | | notices.setUserId(ywStocktaking.getUserId()); |
| | | notices.setStatus(Constants.ZERO); |
| | | //æ´çjsonæ°æ® |
| | | Map<String,Object> jsonMap = new HashMap<>(); |
| | | jsonMap.put("key1","çç¹å"+ywStocktaking.getCode()); |
| | | jsonMap.put("key2", DateUtil.getFomartDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd")); |
| | | jsonMap.put("key3", ywWarehouse.getName()); |
| | | jsonMap.put("key4", systemUser.getRealname()); |
| | | notices.setParam2(JSONObject.toJSONString(jsonMap)); |
| | | notices.setParam3(Constants.ZERO+""); |
| | | noticesJoinMapper.insert(notices); |
| | | |
| | | |
| | |
| | | public YwStocktaking getDetail(Integer id) { |
| | | MPJLambdaWrapper<YwStocktaking> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(YwStocktaking.class) |
| | | .select(" s.name ", YwStocktaking::getUserName) |
| | | .select(" s1.name ",YwStocktaking::getCreateName) |
| | | .select(" s.realname ", YwStocktaking::getUserName) |
| | | .select(" s1.realname ",YwStocktaking::getCreateName) |
| | | .selectAs(YwWarehouse::getName,YwStocktaking::getWarehouseName) |
| | | .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStocktaking::getWarehouseId) |
| | | .leftJoin("system_user s on t.user_id = s.id") |
| | |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | YwStocktaking model = pageWrap.getModel(); |
| | | queryWrapper.selectAll(YwStocktaking.class) |
| | | .select(" s.name ", YwStocktaking::getUserName) |
| | | .select(" s1.name ",YwStocktaking::getCreateName) |
| | | .select(" s.realname ", YwStocktaking::getUserName) |
| | | .select(" s1.realname ",YwStocktaking::getCreateName) |
| | | .selectAs(YwWarehouse::getName,YwStocktaking::getWarehouseName) |
| | | .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStocktaking::getWarehouseId) |
| | | .leftJoin("system_user s on t.user_id = s.id") |
| | |
| | | .eq(YwStocktaking::getIsdeleted,Constants.ZERO) |
| | | .like(StringUtils.isNotBlank(model.getName()),YwStocktaking::getName,model.getName()) |
| | | .eq(Objects.nonNull(model.getStatus()),YwStocktaking::getStatus,model.getStatus()) |
| | | .eq(Objects.nonNull(model.getUserId()),YwStocktaking::getUserId,model.getUserId()) |
| | | .orderByAsc(YwStocktaking::getStatus) |
| | | .orderByDesc(YwStocktaking::getPlanDate) |
| | | ; |
| | | |
| | | IPage iPage = ywStocktakingMapper.selectJoinPage(page, YwStocktaking.class,queryWrapper); |
| | | return PageData.from(iPage); |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwTempConfigMapper; |
| | | import com.doumee.dao.business.dto.YwCallTempDataDTO; |
| | | import com.doumee.dao.business.model.YwTempConfig; |
| | | import com.doumee.dao.business.vo.YwCallTempDataVO; |
| | | import com.doumee.service.business.YwTempConfigService; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void updTempConfig(YwCallTempDataDTO ywCallTempDataDTO){ |
| | | if(Objects.isNull(ywCallTempDataDTO) |
| | | || Objects.isNull(ywCallTempDataDTO.getSmsTemp()) |
| | | || Objects.isNull(ywCallTempDataDTO.getEmailTemp()) |
| | | || Objects.isNull(ywCallTempDataDTO.getLeaseTemp()) |
| | | || Objects.isNull(ywCallTempDataDTO.getOtherTemp()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | YwTempConfig smsTemp = ywCallTempDataDTO.getSmsTemp(); |
| | | if(Objects.isNull(smsTemp.getId()) |
| | | || Objects.isNull(smsTemp.getTitle())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"çæ¯æ¨¡æ¿åæ°é误"); |
| | | } |
| | | ywTempConfigMapper.update(new UpdateWrapper<YwTempConfig>().lambda() |
| | | .set(YwTempConfig::getTitle,smsTemp.getTitle()) |
| | | .eq(YwTempConfig::getId,smsTemp.getId()) |
| | | ); |
| | | |
| | | |
| | | YwTempConfig emailTemp = ywCallTempDataDTO.getEmailTemp(); |
| | | if(Objects.isNull(emailTemp.getId()) |
| | | || Objects.isNull(emailTemp.getTitle())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"é®ä»¶æ¨¡æ¿åæ°é误"); |
| | | } |
| | | ywTempConfigMapper.update(new UpdateWrapper<YwTempConfig>().lambda() |
| | | .set(YwTempConfig::getTitle,emailTemp.getTitle()) |
| | | .eq(YwTempConfig::getId,emailTemp.getId()) |
| | | ); |
| | | |
| | | YwTempConfig leasesTemp = ywCallTempDataDTO.getLeaseTemp(); |
| | | if(Objects.isNull(leasesTemp.getId()) |
| | | || Objects.isNull(leasesTemp.getTitle()) |
| | | || StringUtils.isBlank(leasesTemp.getUrl()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"ç§èµéç¥å模æ¿åæ°é误"); |
| | | } |
| | | ywTempConfigMapper.update(new UpdateWrapper<YwTempConfig>().lambda() |
| | | .set(YwTempConfig::getTitle,leasesTemp.getTitle()) |
| | | .set(YwTempConfig::getUrl,leasesTemp.getUrl()) |
| | | .eq(YwTempConfig::getId,leasesTemp.getId()) |
| | | ); |
| | | |
| | | |
| | | YwTempConfig otherTemp = ywCallTempDataDTO.getOtherTemp(); |
| | | if(Objects.isNull(otherTemp.getId()) |
| | | || Objects.isNull(otherTemp.getTitle()) |
| | | || StringUtils.isBlank(otherTemp.getUrl()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"å
¶ä»éç¥å模æ¿åæ°é误"); |
| | | } |
| | | ywTempConfigMapper.update(new UpdateWrapper<YwTempConfig>().lambda() |
| | | .set(YwTempConfig::getTitle,otherTemp.getTitle()) |
| | | .set(YwTempConfig::getUrl,otherTemp.getUrl()) |
| | | .eq(YwTempConfig::getId,otherTemp.getId()) |
| | | ); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | if(Objects.isNull(ywWarehouse)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | //å¤ææ°æ®ä¸æ¯å¦åå¨èµäº§æ°æ® |
| | | //å¤ææ°æ®ä¸æ¯å¦åå¨ç©ææ°æ® |
| | | if(ywStockMapper.selectCount(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO) |
| | | .gt(YwStock::getStock,Constants.ZERO) |
| | | .eq(YwStock::getWarehouseId,ywWarehouse.getId()))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åä»åºå
æåºåçèµäº§ï¼ä¸å¯å é¤"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åä»åºå
æåºåçç©æï¼ä¸å¯å é¤"); |
| | | }; |
| | | ywWarehouseMapper.update(new UpdateWrapper<YwWarehouse>().lambda() |
| | | .set(YwWarehouse::getEditDate, DateUtil.getCurrDateTime()) |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //å¤ææ°æ®ä¸æ¯å¦åå¨ç©ææ°æ® |
| | | if(ywStockMapper.selectCount(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO) |
| | | .gt(YwStock::getStock,Constants.ZERO) |
| | | .eq(YwStock::getWarehouseId,ywWarehouse.getId()))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å½åä»åºå
æåºåçç©æï¼ä¸å¯å é¤"); |
| | | }; |
| | | ywWarehouseMapper.update(new UpdateWrapper<YwWarehouse>().lambda().eq(YwWarehouse::getId,ywWarehouse.getId()).set(YwWarehouse::getStatus,ywWarehouse.getStatus())); |
| | | } |
| | | |
| | |
| | | .like(StringUtils.isNotBlank(model.getName()),YwWarehouse::getName,model.getName()) |
| | | .eq(YwWarehouse::getIsdeleted,Constants.ZERO) |
| | | ; |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | if(CollectionUtils.isEmpty(pageWrap.getSorts())){ |
| | | queryWrapper.orderByAsc(YwWarehouse::getSortnum); |
| | | }else{ |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | IPage iPage = ywWarehouseMapper.selectJoinPage(page,YwWarehouse.class,queryWrapper); |
| | | return PageData.from(iPage); |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | import com.doumee.dao.business.vo.YwWorkorderDataVO; |
| | | import com.doumee.dao.system.MultifileMapper; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.join.NoticesJoinMapper; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.YwWorkorderService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | private YwBuildingMapper ywBuildingMapper; |
| | | @Autowired |
| | | private YwFloorMapper ywFloorMapper; |
| | | @Autowired |
| | | private NoticesJoinMapper noticesJoinMapper; |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | |
| | | update.setDispatchInfo(ywWorkorder.getDispatchInfo()); |
| | | update.setDealUserId(ywWorkorder.getDealUserId()); |
| | | ywWorkorderMapper.updateById(update); |
| | | |
| | | //æ·»å å¾
åä¿¡æ¯ |
| | | Notices notices = new Notices(); |
| | | notices.setCreateDate(new Date()); |
| | | notices.setCreator(update.getEditor()); |
| | | notices.setIsdeleted(Constants.ZERO); |
| | | notices.setParam1(DateUtil.formatDate(model.getCreateDate(),"yyyy-MM-dd")); |
| | | notices.setTitle("å·¥åå¾
å"); |
| | | notices.setObjId(update.getId()); |
| | | notices.setObjType(Constants.TWO); |
| | | notices.setType(notices.getObjType()); |
| | | notices.setUserId(ywWorkorder.getDealUserId()); |
| | | notices.setStatus(Constants.ZERO); |
| | | //æ´çjsonæ°æ® |
| | | Map<String,Object> jsonMap = new HashMap<>(); |
| | | jsonMap.put("key1", model.getBuildingName()+"/"+model.getFloorName()); |
| | | jsonMap.put("key2", DateUtil.getFomartDate(model.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |
| | | jsonMap.put("key3", Constants.equalsInteger(model.getAreaType(),Constants.ZERO)?"室å
ç»´ä¿®":"å
Œ
񆧆"); |
| | | jsonMap.put("key4", model.getCategoryParentName()+"/"+model.getCategoryName()); |
| | | notices.setParam2(JSONObject.toJSONString(jsonMap)); |
| | | notices.setParam3(Constants.ZERO+""); |
| | | noticesJoinMapper.insert(notices); |
| | | |
| | | |
| | | dealLogBiz(model,Constants.YwLogType.WORKORDER_DISPATCH,ywWorkorder.getLoginUserInfo().getRealname(),user.getRealname());//è®°å½æ°å»ºæ¥å¿ |
| | | } |
| | | @Override |
| | |
| | | update.setDealDate(update.getEditDate()); |
| | | update.setDealInfo(ywWorkorder.getDealInfo()); |
| | | ywWorkorderMapper.updateById(update); |
| | | |
| | | |
| | | //æ è®°å¾
åå·²å¤ç |
| | | noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam3,Constants.TWO) |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getObjType,Constants.TWO) |
| | | .eq(Notices::getObjId,update.getId()) |
| | | ); |
| | | |
| | | |
| | | List<Multifile> fileList = new ArrayList<>(); |
| | | if(ywWorkorder.getDealFileList()!=null && ywWorkorder.getDealFileList().size()>0){ |
| | |
| | | .selectAs(Company::getName,YwWorkorder::getDealUserCompany) |
| | | .select("t3.realname",YwWorkorder::getCreatorName) |
| | | .select("t3.mobile",YwWorkorder::getCreatorMobile) |
| | | .select("t9.name",YwWorkorder::getCreatorCompany) |
| | | .selectAs(Category::getName,YwWorkorder::getCategoryName) |
| | | .select("c.name",YwWorkorder::getCreatorCompany) |
| | | .select("ct.name",YwWorkorder::getCategoryName) |
| | | .select("ct1.name",YwWorkorder::getCategoryParentName) |
| | | .selectAs(YwRoom::getName,YwWorkorder::getRoomName) |
| | | .selectAs(YwRoom::getRoomNum,YwWorkorder::getRoomNum) |
| | | .selectAs(YwFloor::getName,YwWorkorder::getFloorName) |
| | |
| | | .leftJoin(YwFloor.class,YwFloor::getId,YwWorkorder::getFloorId) |
| | | .leftJoin(YwBuilding.class,YwBuilding::getId,YwWorkorder::getBuildingId) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwWorkorder::getProjectId) |
| | | .leftJoin(" company t9 on t9.id = t1.company_id ") |
| | | .leftJoin(" company c on c.id = t1.company_id ") |
| | | .leftJoin(" category ct on ct.id = t.cate_id ") |
| | | .leftJoin(" category ct1 on ct1.id = ct.PARENT_ID ") |
| | | .eq(YwWorkorder::getId,id); |
| | | YwWorkorder model = ywWorkorderMapper.selectJoinOne(YwWorkorder.class,queryWrapper); |
| | | initFiles(model);//读åéä»¶ä¿¡æ¯ |
| | |
| | | .eq(Constants.equalsInteger(dto.getQueryType(),Constants.THREE),YwWorkorder::getRoomId,dto.getQueryId())); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(list)){ |
| | | ywWorkorderDataVO.setAmount(list.size()); |
| | | ywWorkorderDataVO.setMonthAmount(list.stream().filter(i-> DateUtil.formatDate(i.getSubmitDate(),"yyyy-MM").equals(DateUtil.formatDate(new Date(),"yyyy-MM"))).collect(Collectors.toList()).size()); |
| | | ywWorkorderDataVO.setMonthAmount(list.stream().filter(i-> DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(DateUtil.formatDate(new Date(),"yyyy-MM"))).collect(Collectors.toList()).size()); |
| | | ywWorkorderDataVO.setWaitDealAmount(list.stream().filter(i-> Constants.equalsInteger(i.getDealStatus(),Constants.ONE)).collect(Collectors.toList()).size()); |
| | | ywWorkorderDataVO.setWaitAssignAmount(list.stream().filter(i-> Constants.equalsInteger(i.getDealStatus(),Constants.ZERO)).collect(Collectors.toList()).size()); |
| | | } |