| | |
| | | LambdaQueryWrapper<ApproveProcess> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ApproveProcess::getApproveId, id); |
| | | queryWrapper.eq(ApproveProcess::getApproveDelete, 0); |
| | | queryWrapper.eq(ApproveProcess::getTenantId, SecurityUtils.getLoginUser().getTenantId()); |
| | | // queryWrapper.eq(ApproveProcess::getTenantId, SecurityUtils.getLoginUser().getTenantId()); |
| | | queryWrapper.last("limit 1"); |
| | | ApproveProcess one = approveProcessMapper.selectOne(queryWrapper); |
| | | return one; |
| | |
| | | @Override |
| | | public void initApproveNodes(String approveUserIds,String approveID,Long tenantId) { |
| | | Long userId = SecurityUtils.getLoginUser().getUser().getUserId(); |
| | | ApproveProcess approve = getApproveById(approveID); |
| | | String[] names = approveUserIds.split(","); |
| | | String approveId = approve.getApproveId(); |
| | | for (int i = 0; i < names.length; i++) { |
| | | SysUser sysUser = sysUserMapper.selectUserById(Long.parseLong(names[i])); |
| | | if (sysUser == null) continue; |
| | | ApproveNode approveNode = new ApproveNode(); |
| | | approveNode.setApproveProcessId(approveId); |
| | | approveNode.setApproveProcessId(approveID); |
| | | approveNode.setApproveNodeOrder(i +1); |
| | | approveNode.setApproveNodeUser(sysUser.getNickName()); |
| | | approveNode.setApproveNodeUserId(sysUser.getUserId()); |
| | |
| | | LambdaQueryWrapper<ApproveNode> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ApproveNode::getApproveProcessId, id); |
| | | queryWrapper.eq(ApproveNode::getDeleteFlag, 0); |
| | | queryWrapper.eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()); |
| | | List<ApproveNode> list = list(queryWrapper); |
| | | // æç
§ approveNodeOrder åæ®µååºæåº |
| | | list.sort(Comparator.comparingInt(ApproveNode::getApproveNodeOrder)); |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveId, id) |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | .last("limit 1"); |
| | | ApproveProcess approveProcess = approveProcessMapper.selectOne(approveProcessLambdaQueryWrapper); |
| | | if(approveProcess != null && approveProcess.getApproveStatus() == 3){ |
| | |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveId, approveNode.getApproveProcessId()) |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | .last("limit 1"); |
| | | ApproveProcess approveProcess = approveProcessMapper.selectOne(approveProcessLambdaQueryWrapper); |
| | | if(approveProcess == null) throw new RuntimeException("审æ¹ä¸åå¨"); |
| | |
| | | approveNodeLambdaQueryWrapper.eq(ApproveNode::getApproveProcessId, approveNode.getApproveProcessId()) |
| | | .eq(ApproveNode::getApproveNodeOrder, approveNode.getApproveNodeOrder() + 1) |
| | | .eq(ApproveNode::getDeleteFlag, 0) |
| | | .eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | .last("limit 1"); |
| | | ApproveNode approveNode1 = approveNodeMapper.selectOne(approveNodeLambdaQueryWrapper); |
| | | approveProcess.setApproveStatus(status); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.approve.mapper.ApproveNodeMapper; |
| | |
| | | |
| | | @Override |
| | | public ApproveProcess getApproveById(String id) { |
| | | LambdaQueryWrapper<ApproveProcess> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ApproveProcess::getApproveId, id); |
| | | queryWrapper.eq(ApproveProcess::getApproveDelete, 0); |
| | | queryWrapper.eq(ApproveProcess::getTenantId, SecurityUtils.getLoginUser().getTenantId()); |
| | | queryWrapper.last("limit 1"); |
| | | ApproveProcess one = getOne(queryWrapper); |
| | | ApproveProcess one = approveProcessMapper.selectList(Wrappers.<ApproveProcess>lambdaQuery() |
| | | .eq(ApproveProcess::getApproveId,id) |
| | | .eq(ApproveProcess::getApproveDelete,0)).get(0); |
| | | one.setCommonFileList(commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, one.getId()) |
| | | .eq(CommonFile::getType, FileNameType.ApproveProcess.getValue()))); |
| | |
| | | LambdaQueryWrapper<ApproveNode> approveNodeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveNodeLambdaQueryWrapper.eq(ApproveNode::getApproveProcessId, approveProcess.getApproveId()) |
| | | .eq(ApproveNode::getDeleteFlag, 0) |
| | | .eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | // .eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | .orderByAsc(ApproveNode::getApproveNodeOrder); |
| | | approveNodeMapper.delete(approveNodeLambdaQueryWrapper); |
| | | approveNodeService.initApproveNodes(approveGetAndUpdateVo.getApproveUserIds(), approveProcess.getApproveId(), approveProcess.getTenantId()); |
| | |
| | | LambdaQueryWrapper<ApproveNode> approveNodeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveNodeLambdaQueryWrapper.eq(ApproveNode::getApproveProcessId, approve.getApproveId()) |
| | | .eq(ApproveNode::getDeleteFlag, 0) |
| | | .eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | // .eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | .orderByAsc(ApproveNode::getApproveNodeOrder); |
| | | approveNodeMapper.delete(approveNodeLambdaQueryWrapper); |
| | | approveNodeService.initApproveNodes(approveGetAndUpdateVo.getApproveUserIds(), approve.getApproveId(), approve.getTenantId()); |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody NoticeType noticeType) { |
| | | return AjaxResult.success(noticeTypeService.save(noticeType)); |
| | | return AjaxResult.success(noticeTypeService.saveOrUpdate(noticeType)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "å®¢æ·æè®¿-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å®¢æ·æè®¿-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, CustomerVisits customerVisits){ |
| | | public AjaxResult listPage(Page page, CustomerVisits customerVisits) { |
| | | IPage<CustomerVisits> listPage = customerVisitsService.listPage(page, customerVisits); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | |
| | | @ApiOperation("å®¢æ·æè®¿-æ·»å ") |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody CustomerVisits customerVisits){ |
| | | public AjaxResult add(@RequestBody CustomerVisits customerVisits) { |
| | | boolean save = customerVisitsService.save(customerVisits); |
| | | if (save){ |
| | | if (save) { |
| | | return AjaxResult.success("æ·»å æå"); |
| | | } |
| | | return AjaxResult.error("æ·»å 失败"); |
| | | } |
| | | |
| | | @Log(title = "å®¢æ·æè®¿-ç¼è¾", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("å®¢æ·æè®¿-ç¼è¾") |
| | | @PostMapping("update") |
| | | public AjaxResult updateCustomerVisit(@RequestBody CustomerVisits customerVisits) { |
| | | boolean updateResult = customerVisitsService.updateCustomerVisit(customerVisits); |
| | | if (updateResult) { |
| | | return AjaxResult.success("ç¼è¾æå"); |
| | | } |
| | | return AjaxResult.error("ç¼è¾å¤±è´¥"); |
| | | } |
| | | |
| | | @Log(title = "å®¢æ·æè®¿-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å®¢æ·æè®¿-å é¤") |
| | | @DeleteMapping("{customerId}") |
| | | public AjaxResult deleteCustomerVisit(@PathVariable Integer customerId) { |
| | | if (customerId == null) { |
| | | return AjaxResult.error("客æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | boolean deleteResult = customerVisitsService.removeById(customerId); |
| | | if (deleteResult) { |
| | | return AjaxResult.success("å 餿å"); |
| | | } |
| | | return AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.customervisits.pojo.CustomerVisits; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | */ |
| | | public interface CustomerVisitsService extends IService<CustomerVisits> { |
| | | IPage<CustomerVisits> listPage(Page page, CustomerVisits customerVisits); |
| | | |
| | | boolean updateCustomerVisit(CustomerVisits customerVisits); |
| | | |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | @Override |
| | | public IPage<CustomerVisits> listPage(Page page, CustomerVisits customerVisits) { |
| | | LambdaQueryWrapper<CustomerVisits> customerVisitsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(customerVisits != null && !StringUtils.isEmpty(customerVisits.getCustomerName())){ |
| | | if (customerVisits != null && !StringUtils.isEmpty(customerVisits.getCustomerName())) { |
| | | customerVisitsLambdaQueryWrapper.like(CustomerVisits::getCustomerName, customerVisits.getCustomerName()); |
| | | } |
| | | Page page1 = customerVisitsMapper.selectPage(page, customerVisitsLambdaQueryWrapper); |
| | | return page1; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateCustomerVisit(CustomerVisits customerVisits) { |
| | | if (customerVisits == null || customerVisits.getId() == null) { |
| | | return false; |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(customerVisits.getCustomerName()) |
| | | || StringUtils.isEmpty(customerVisits.getPurposeVisit()) |
| | | || StringUtils.isEmpty(customerVisits.getVisitAddress()) |
| | | || StringUtils.isEmpty(customerVisits.getPurposeDate())) { |
| | | return false; |
| | | } |
| | | |
| | | return updateById(customerVisits); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.device.service.DeviceDefectRecordService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | public class DeviceDefectRecordController { |
| | | @Autowired |
| | | private DeviceDefectRecordService deviceDefectRecordService; |
| | | @ApiModelProperty("设å¤ç¼ºé·è®°å½å表") |
| | | @ApiOperation("设å¤ç¼ºé·è®°å½å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceDefectRecordDto deviceDefectRecordDto) { |
| | | return AjaxResult.success(deviceDefectRecordService.listPage(page,deviceDefectRecordDto)); |
| | | } |
| | | @ApiModelProperty("设å¤idæ¥è¯¢è®¾å¤ç¼ºé·è®°å½å表") |
| | | @ApiOperation("设å¤idæ¥è¯¢è®¾å¤ç¼ºé·è®°å½å表") |
| | | @GetMapping("/find/{deviceLedgerId}") |
| | | public AjaxResult find(@PathVariable Long deviceLedgerId) { |
| | | DeviceDefectRecordDto deviceDefectRecordDto = new DeviceDefectRecordDto(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiModelProperty("æ·»å 设å¤ç¼ºé·è®°å½") |
| | | @ApiOperation("æ·»å 设å¤ç¼ºé·è®°å½") |
| | | public AjaxResult add(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return AjaxResult.success(deviceDefectRecordService.add(deviceDefectRecord)); |
| | | } |
| | | @PostMapping("/update") |
| | | @ApiModelProperty("ä¿®æ¹è®¾å¤ç¼ºé·è®°å½") |
| | | @ApiOperation("ä¿®æ¹è®¾å¤ç¼ºé·è®°å½") |
| | | public AjaxResult update(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return AjaxResult.success(deviceDefectRecordService.updateByDDR(deviceDefectRecord)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | @ApiModelProperty("å é¤è®¾å¤ç¼ºé·è®°å½") |
| | | @ApiOperation("å é¤è®¾å¤ç¼ºé·è®°å½") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceDefectRecordService.removeById(id)); |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Anonymous; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("设å¤å°è´¦å表") |
| | | @ApiOperation("设å¤å°è´¦å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceLedgerDto deviceLedger) { |
| | | return AjaxResult.success(deviceLedgerService.queryPage(page,deviceLedger)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @ApiModelProperty("æ·»å 设å¤å°è´¦") |
| | | @ApiOperation("æ·»å 设å¤å°è´¦") |
| | | public AjaxResult add(@RequestBody DeviceLedger deviceLedger) { |
| | | |
| | | return deviceLedgerService.saveDeviceLedger(deviceLedger); |
| | | } |
| | | |
| | | @ApiModelProperty("æ ¹æ®idæ¥è¯¢è®¾å¤å°è´¦") |
| | | @ApiOperation("æ ¹æ®idæ¥è¯¢è®¾å¤å°è´¦") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceLedgerService.getById(id)); |
| | | } |
| | | |
| | | @PutMapping () |
| | | @ApiModelProperty("ä¿®æ¹è®¾å¤å°è´¦") |
| | | @ApiOperation("ä¿®æ¹è®¾å¤å°è´¦") |
| | | public AjaxResult update(@RequestBody DeviceLedger deviceLedger) { |
| | | return deviceLedgerService.updateDeviceLedger(deviceLedger); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @ApiModelProperty("å é¤è®¾å¤å°è´¦") |
| | | @ApiOperation("å é¤è®¾å¤å°è´¦") |
| | | public AjaxResult delete(@PathVariable("ids") ArrayList<Long> ids) { |
| | | boolean b = deviceLedgerService.removeBatchByIds(ids); |
| | | if (!b) { |
| | |
| | | } |
| | | |
| | | @PostMapping("export") |
| | | @ApiModelProperty("导åºè®¾å¤å°è´¦") |
| | | @ApiOperation("导åºè®¾å¤å°è´¦") |
| | | public void export(HttpServletResponse response, Long[] ids) { |
| | | deviceLedgerService.export(response, ids); |
| | | } |
| | | |
| | | @PostMapping("import") |
| | | @ApiModelProperty("导å
¥è®¾å¤å°è´¦") |
| | | @ApiOperation("导å
¥è®¾å¤å°è´¦") |
| | | public AjaxResult importData(MultipartFile file) throws IOException { |
| | | Boolean b = deviceLedgerService.importData(file); |
| | | if (b) { |
| | |
| | | |
| | | |
| | | @GetMapping("getDeviceLedger") |
| | | @ApiModelProperty("è·å设å¤å°è´¦") |
| | | @ApiOperation("è·å设å¤å°è´¦") |
| | | public AjaxResult getDeviceLedger( ) { |
| | | return AjaxResult.success(deviceLedgerService.list(new QueryWrapper<DeviceLedger>().lambda() |
| | | .select(DeviceLedger::getId, DeviceLedger::getDeviceName,DeviceLedger::getDeviceModel))); |
| | |
| | | import com.ruoyi.device.service.IDeviceMaintenanceService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | private IDeviceLedgerService deviceLedgerService; |
| | | |
| | | @ApiModelProperty("设å¤ä¿å
»å表") |
| | | @ApiOperation("设å¤ä¿å
»å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceMaintenanceDto deviceMaintenanceDto) { |
| | | return AjaxResult.success(deviceMaintenanceService.queryPage(page,deviceMaintenanceDto)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @ApiModelProperty("æ·»å 设å¤ä¿å
»") |
| | | @ApiOperation("æ·»å 设å¤ä¿å
»") |
| | | public AjaxResult add(@RequestBody DeviceMaintenance deviceMaintenance) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceMaintenance.getDeviceLedgerId()); |
| | | deviceMaintenance.setDeviceName(byId.getDeviceName()); |
| | |
| | | return deviceMaintenanceService.saveDeviceRepair(deviceMaintenance); |
| | | } |
| | | |
| | | @ApiModelProperty("æ ¹æ®idæ¥è¯¢è®¾å¤ä¿å
»") |
| | | @ApiOperation("æ ¹æ®idæ¥è¯¢è®¾å¤ä¿å
»") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceMaintenanceService.detailById(id)); |
| | | } |
| | | |
| | | @PutMapping () |
| | | @ApiModelProperty("ä¿®æ¹è®¾å¤ä¿å
»") |
| | | @ApiOperation("ä¿®æ¹è®¾å¤ä¿å
»") |
| | | public AjaxResult update(@RequestBody DeviceMaintenance deviceMaintenance) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceMaintenance.getDeviceLedgerId()); |
| | | deviceMaintenance.setDeviceName(byId.getDeviceName()); |
| | |
| | | } |
| | | |
| | | @PostMapping ("maintenance") |
| | | @ApiModelProperty("ä¿®æ¹è®¾å¤ä¿å
»") |
| | | @ApiOperation("ä¿®æ¹è®¾å¤ä¿å
»") |
| | | public AjaxResult maintenance(@RequestBody DeviceMaintenance deviceMaintenance) { |
| | | return deviceMaintenanceService.updateDeviceDeviceMaintenance(deviceMaintenance); |
| | | } |
| | | |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @ApiModelProperty("å é¤è®¾å¤ä¿å
»") |
| | | @ApiOperation("å é¤è®¾å¤ä¿å
»") |
| | | public AjaxResult delete(@PathVariable("ids") Long[] ids) { |
| | | boolean b = deviceMaintenanceService.removeBatchByIds(Arrays.asList(ids)); |
| | | if (!b) { |
| | |
| | | } |
| | | |
| | | @PostMapping("export") |
| | | @ApiModelProperty("导åºè®¾å¤ä¿å
»") |
| | | @ApiOperation("导åºè®¾å¤ä¿å
»") |
| | | public void export(HttpServletResponse response, Long[] ids) { |
| | | deviceMaintenanceService.export(response, ids); |
| | | } |
| | |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | private IDeviceLedgerService deviceLedgerService; |
| | | |
| | | @ApiModelProperty("è®¾å¤æ¥ä¿®å表") |
| | | @ApiOperation("è®¾å¤æ¥ä¿®å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceRepairDto deviceRepairDto) { |
| | | return AjaxResult.success(deviceRepairService.queryPage(page,deviceRepairDto)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @ApiModelProperty("æ·»å è®¾å¤æ¥ä¿®") |
| | | @ApiOperation("æ·»å è®¾å¤æ¥ä¿®") |
| | | public AjaxResult add( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.saveDeviceRepair(deviceRepair); |
| | | } |
| | | |
| | | @ApiModelProperty("æ ¹æ®idæ¥è¯¢è®¾å¤æ¥ä¿®") |
| | | @ApiOperation("æ ¹æ®idæ¥è¯¢è®¾å¤æ¥ä¿®") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | DeviceRepairDto byId = deviceRepairService.detailById(id); |
| | |
| | | } |
| | | |
| | | @PutMapping () |
| | | @ApiModelProperty("ä¿®æ¹è®¾å¤æ¥ä¿®") |
| | | @ApiOperation("ä¿®æ¹è®¾å¤æ¥ä¿®") |
| | | public AjaxResult update( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepair); |
| | | } |
| | | |
| | | @PostMapping ("repair") |
| | | @ApiModelProperty("设å¤ç»´ä¿®") |
| | | @ApiOperation("设å¤ç»´ä¿®") |
| | | public AjaxResult repair( @RequestBody DeviceRepair deviceRepair) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepair); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @ApiModelProperty("å é¤è®¾å¤æ¥ä¿®") |
| | | @ApiOperation("å é¤è®¾å¤æ¥ä¿®") |
| | | public AjaxResult delete(@PathVariable("ids") Long[] ids) { |
| | | boolean b = deviceRepairService.removeBatchByIds(Arrays.asList(ids)); |
| | | if (!b) { |
| | |
| | | } |
| | | |
| | | @PostMapping("export") |
| | | @ApiModelProperty("导åºè®¾å¤æ¥ä¿®") |
| | | @ApiOperation("导åºè®¾å¤æ¥ä¿®") |
| | | public void export(HttpServletResponse response, Long[] ids) { |
| | | deviceRepairService.export(response, ids); |
| | | } |
| | |
| | | @Autowired |
| | | private HomeService homeService; |
| | | |
| | | /********************************************************åºç¡ç±»*****************************************************/ |
| | | @GetMapping("/todos") |
| | | @Log(title = "å¾
åäºé¡¹", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å¾
åäºé¡¹") |
| | | public AjaxResult todos(ApproveProcess req) throws ParseException { |
| | | List<ApproveProcess> approveProcessList = homeService.todos(); |
| | | return AjaxResult.success(approveProcessList); |
| | | } |
| | | |
| | | @GetMapping("/approveAndDeviceTodos") |
| | | @ApiOperation("审æ¹ååï¼è®¾å¤æ¥ä¿®å¾
åäºé¡¹") |
| | | public AjaxResult approveAndDeviceTodos(){ |
| | | Map<String, Object> map = homeService.approveAndDeviceTodos(); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | @GetMapping("/noticesCount") |
| | | @ApiOperation("æªè¿æçå
¬åæ°é") |
| | | public AjaxResult noticesCount(){ |
| | | Long count = homeService.noticesCount(); |
| | | return AjaxResult.success(count); |
| | | } |
| | | |
| | | |
| | | /********************************************************è¥ééè´ç±»**************************************************/ |
| | | @GetMapping("/business") |
| | | @Log(title = "éå®-éè´-åºåæ°æ®", businessType = BusinessType.OTHER) |
| | | @ApiOperation("éå®-éè´-åºåæ°æ®") |
| | |
| | | return AjaxResult.success(analysisCustomerContractAmounts); |
| | | } |
| | | |
| | | @GetMapping("/qualityStatistics") |
| | | @Log(title = "è´¨éåæ", businessType = BusinessType.OTHER) |
| | | @ApiOperation("è´¨éåæ") |
| | | public AjaxResult qualityStatistics(QualityStatisticsDto req) { |
| | | QualityStatisticsDto qualityStatisticsDto = homeService.qualityStatistics(); |
| | | return AjaxResult.success(qualityStatisticsDto); |
| | | } |
| | | |
| | | @GetMapping("/todos") |
| | | @Log(title = "å¾
åäºé¡¹", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å¾
åäºé¡¹") |
| | | public AjaxResult todos(ApproveProcess req) throws ParseException { |
| | | List<ApproveProcess> approveProcessList = homeService.todos(); |
| | | return AjaxResult.success(approveProcessList); |
| | | } |
| | | |
| | | @GetMapping("/statisticsReceivablePayable") |
| | | @Log(title = "åºæ¶åºä»ç»è®¡", businessType = BusinessType.OTHER) |
| | | @ApiOperation("åºæ¶åºä»ç»è®¡") |
| | | public AjaxResult statisticsReceivablePayable(StatisticsReceivablePayableDto req, @RequestParam(value = "type", defaultValue = "1") Integer type ) { |
| | | StatisticsReceivablePayableDto statisticsReceivablePayable = homeService.statisticsReceivablePayable(type); |
| | | return AjaxResult.success(statisticsReceivablePayable); |
| | | } |
| | | |
| | | @GetMapping("/approveAndDeviceTodos") |
| | | @ApiOperation("审æ¹ååï¼è®¾å¤æ¥ä¿®å¾
åäºé¡¹") |
| | | public AjaxResult approveAndDeviceTodos(){ |
| | | Map<String, Object> map = homeService.approveAndDeviceTodos(); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | @GetMapping("/noticesCount") |
| | | @ApiOperation("æªè¿æçå
¬åæ°é") |
| | | public AjaxResult noticesCount(){ |
| | | Long count = homeService.noticesCount(); |
| | | return AjaxResult.success(count); |
| | | } |
| | | /********************************************************ç产类*****************************************************/ |
| | | @GetMapping("/progressStatistics") |
| | | @ApiOperation("åç产订åç宿è¿åº¦ç»è®¡") |
| | | public AjaxResult progressStatistics(){ |
| | |
| | | ProductionTurnoverDto productionTurnoverDto = homeService.workInProcessTurnover(); |
| | | return AjaxResult.success(productionTurnoverDto); |
| | | } |
| | | |
| | | |
| | | /********************************************************è´¨éç±»*****************************************************/ |
| | | @GetMapping("/qualityStatistics") |
| | | @Log(title = "è´¨éåæ", businessType = BusinessType.OTHER) |
| | | @ApiOperation("è´¨éåæ") |
| | | public AjaxResult qualityStatistics(QualityStatisticsDto req) { |
| | | QualityStatisticsDto qualityStatisticsDto = homeService.qualityStatistics(); |
| | | return AjaxResult.success(qualityStatisticsDto); |
| | | } |
| | | |
| | | |
| | | /********************************************************è´¢å¡ç±»*****************************************************/ |
| | | @GetMapping("/statisticsReceivablePayable") |
| | | @Log(title = "åºæ¶åºä»ç»è®¡", businessType = BusinessType.OTHER) |
| | | @ApiOperation("åºæ¶åºä»ç»è®¡") |
| | | public AjaxResult statisticsReceivablePayable(StatisticsReceivablePayableDto req, @RequestParam(value = "type", defaultValue = "1") Integer type ) { |
| | | StatisticsReceivablePayableDto statisticsReceivablePayable = homeService.statisticsReceivablePayable(type); |
| | | return AjaxResult.success(statisticsReceivablePayable); |
| | | } |
| | | |
| | | |
| | | /********************************************************ä»å¨ç±»*****************************************************/ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveUserCurrentId, loginUser.getUserId()) |
| | | .ne(ApproveProcess::getApproveStatus, 2) |
| | | .eq(ApproveProcess::getTenantId, loginUser.getTenantId()); |
| | | .ne(ApproveProcess::getApproveStatus, 2); |
| | | // .eq(ApproveProcess::getTenantId, loginUser.getTenantId()); |
| | | List<ApproveProcess> approveProcesses = approveProcessMapper.selectList(approveProcessLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty(approveProcesses)){ |
| | | approveProcesses = new ArrayList<>(); |
| | |
| | | import com.ruoyi.production.service.ProductBomService; |
| | | import com.ruoyi.production.service.ProductProcessRouteService; |
| | | import com.ruoyi.production.service.ProductProcessService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/productBom") |
| | | @Api(tags = "BOM") |
| | | public class ProductBomController { |
| | | |
| | | @Autowired |
| | |
| | | private ProductStructureService productStructureService; |
| | | |
| | | |
| | | @ApiOperation("æ°å¢BOM") |
| | | @ApiOperation("æ°å¢BOMåé") |
| | | @PostMapping() |
| | | public R addOrUpdate(@RequestBody ProductStructureDto productStructureDto){ |
| | | return R.ok(productStructureService.addProductStructureDto(productStructureDto)); |
| | | } |
| | | |
| | | @ApiOperation("BOMæ¥ç详æ
") |
| | | @ApiOperation("BOMæ¥çåé详æ
") |
| | | @GetMapping("/listBybomId/{bomId}") |
| | | public R listBybomId( @PathVariable("bomId") Long bomId){ |
| | | return R.ok(productStructureService.listBybomId(bomId)); |
| | |
| | | @Excel(name = "æ¥å·¥æ°é") |
| | | private BigDecimal quantity; |
| | | |
| | | @ApiModelProperty(value = "æ¥åºæ°é") |
| | | @Excel(name = "æ¥åºæ°é") |
| | | private BigDecimal scrapQty; |
| | | |
| | | //产ååç§° |
| | | @Excel(name = "产ååç§°") |
| | | private String productName; |
| | |
| | | @ApiModelProperty(value = "产åid") |
| | | private Long productModelId; |
| | | |
| | | @ApiModelProperty(value = "æ°é") |
| | | //åæ ¼æ°é=æ¥å·¥æ°é-æ¥åºæ°é |
| | | @ApiModelProperty(value = "æ¥å·¥æ°é") |
| | | private BigDecimal quantity; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty(value = "æ¥åºæ°é") |
| | | private BigDecimal scrapQty; |
| | | } |
| | |
| | | productionProductOutput.setProductMainId(productionProductMain.getId()); |
| | | productionProductOutput.setProductModelId(productProcessRouteItem.getProductModelId()); |
| | | productionProductOutput.setQuantity(dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO); |
| | | productionProductOutput.setScrapQty(dto.getScrapQty() != null ? dto.getScrapQty() : BigDecimal.ZERO); |
| | | productionProductOutputMapper.insert(productionProductOutput); |
| | | /*æ°å¢è´¨æ£*/ |
| | | //对åºçè¿ç¨æ£æè
åºåæ£ |
| | | List<ProductProcessRouteItem> productProcessRouteItems = productProcessRouteItemMapper.selectList(Wrappers.<ProductProcessRouteItem>lambdaQuery().eq(ProductProcessRouteItem::getProductRouteId, productProcessRouteItem.getProductRouteId())); |
| | | int inspectType = 1; |
| | | String process = productProcess.getName();//å·¥åº |
| | | if (productProcessRouteItem.getDragSort()==productProcessRouteItems.size()){ |
| | | //æåä¸éå·¥åºçæåºåæ£ |
| | | inspectType = 2; |
| | | process = null; |
| | | } |
| | | Product product = productMapper.selectById(productModel.getProductId()); |
| | | QualityInspect qualityInspect = new QualityInspect(); |
| | | qualityInspect.setProductId(product.getId()); |
| | | qualityInspect.setProductName(product.getProductName()); |
| | | qualityInspect.setModel(productModel.getModel()); |
| | | qualityInspect.setUnit(productModel.getUnit()); |
| | | qualityInspect.setQuantity(dto.getQuantity()); |
| | | qualityInspect.setProcess(productProcess.getName()); |
| | | qualityInspect.setInspectState(0); |
| | | qualityInspect.setInspectType(inspectType); |
| | | qualityInspect.setProductMainId(productionProductMain.getId()); |
| | | qualityInspect.setProductModelId(productModel.getId()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| | | List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(product.getId(), inspectType,process); |
| | | if (qualityTestStandard.size()>0){ |
| | | qualityInspect.setTestStandardId(qualityTestStandard.get(0).getId()); |
| | | qualityInspectMapper.updateById(qualityInspect); |
| | | qualityTestStandardParamMapper.selectList(Wrappers.<QualityTestStandardParam>lambdaQuery() |
| | | .eq(QualityTestStandardParam::getTestStandardId,qualityTestStandard.get(0).getId()))//é»è®¤è·åææ°ç |
| | | .forEach(qualityTestStandardParam -> { |
| | | QualityInspectParam param = new QualityInspectParam(); |
| | | BeanUtils.copyProperties(qualityTestStandardParam, param); |
| | | param.setId(null); |
| | | param.setInspectId(qualityInspect.getId()); |
| | | qualityInspectParamMapper.insert(param); |
| | | }); |
| | | } |
| | | /*æ´æ°å·¥ååç产订å*/ |
| | | ProductWorkOrder productWorkOrder = productWorkOrderMapper.selectById(dto.getWorkOrderId()); |
| | | productWorkOrder.setCompleteQuantity(productWorkOrder.getCompleteQuantity().add(dto.getQuantity())); |
| | | if (ObjectUtils.isNull(productWorkOrder.getActualStartTime())){ |
| | | productWorkOrder.setActualStartTime(LocalDate.now());//å®é
å¼å§æ¶é´ |
| | | } |
| | | if (productWorkOrder.getCompleteQuantity().compareTo(productWorkOrder.getPlanQuantity()) == 0){ |
| | | productWorkOrder.setActualEndTime(LocalDate.now());//å®é
ç»ææ¶é´ |
| | | } |
| | | productWorkOrderMapper.updateById(productWorkOrder); |
| | | //ç产订å |
| | | ProductOrder productOrder = productOrderMapper.selectById(productWorkOrder.getProductOrderId()); |
| | | if (ObjectUtils.isNull(productOrder.getStartTime())){ |
| | | productOrder.setStartTime(LocalDateTime.now());//å¼å§æ¶é´ |
| | | } |
| | | if (productProcessRouteItem.getDragSort()==productProcessRouteItems.size()){ |
| | | //å¦ææ¯æåä¸éå·¥åºæ¥å·¥ä¹åç产订å宿æ°é+ |
| | | productOrder.setCompleteQuantity(productOrder.getCompleteQuantity().add(dto.getQuantity())); |
| | | if (productOrder.getCompleteQuantity().compareTo(productOrder.getQuantity()) == 0){ |
| | | productOrder.setEndTime(LocalDateTime.now());//ç»ææ¶é´ |
| | | //åæ ¼æ°é=æ¥å·¥æ°é-æ¥åºæ°é |
| | | BigDecimal productQty = productionProductOutput.getQuantity().subtract(productionProductOutput.getScrapQty()); |
| | | //åªæåæ ¼æ°é>0æè½å¢å ç¸åºæ°æ® |
| | | if (productQty.compareTo(BigDecimal.ZERO)>0) { |
| | | /*æ°å¢è´¨æ£*/ |
| | | //对åºçè¿ç¨æ£æè
åºåæ£ |
| | | List<ProductProcessRouteItem> productProcessRouteItems = productProcessRouteItemMapper.selectList(Wrappers.<ProductProcessRouteItem>lambdaQuery().eq(ProductProcessRouteItem::getProductRouteId, productProcessRouteItem.getProductRouteId())); |
| | | int inspectType = 1; |
| | | String process = productProcess.getName();//å·¥åº |
| | | if (productProcessRouteItem.getDragSort() == productProcessRouteItems.size()) { |
| | | //æåä¸éå·¥åºçæåºåæ£ |
| | | inspectType = 2; |
| | | process = null; |
| | | } |
| | | Product product = productMapper.selectById(productModel.getProductId()); |
| | | QualityInspect qualityInspect = new QualityInspect(); |
| | | qualityInspect.setProductId(product.getId()); |
| | | qualityInspect.setProductName(product.getProductName()); |
| | | qualityInspect.setModel(productModel.getModel()); |
| | | qualityInspect.setUnit(productModel.getUnit()); |
| | | qualityInspect.setQuantity(productQty); |
| | | qualityInspect.setProcess(productProcess.getName()); |
| | | qualityInspect.setInspectState(0); |
| | | qualityInspect.setInspectType(inspectType); |
| | | qualityInspect.setProductMainId(productionProductMain.getId()); |
| | | qualityInspect.setProductModelId(productModel.getId()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| | | List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(product.getId(), inspectType, process); |
| | | if (qualityTestStandard.size() > 0) { |
| | | qualityInspect.setTestStandardId(qualityTestStandard.get(0).getId()); |
| | | qualityInspectMapper.updateById(qualityInspect); |
| | | qualityTestStandardParamMapper.selectList(Wrappers.<QualityTestStandardParam>lambdaQuery() |
| | | .eq(QualityTestStandardParam::getTestStandardId, qualityTestStandard.get(0).getId()))//é»è®¤è·åææ°ç |
| | | .forEach(qualityTestStandardParam -> { |
| | | QualityInspectParam param = new QualityInspectParam(); |
| | | BeanUtils.copyProperties(qualityTestStandardParam, param); |
| | | param.setId(null); |
| | | param.setInspectId(qualityInspect.getId()); |
| | | qualityInspectParamMapper.insert(param); |
| | | }); |
| | | } |
| | | /*æ´æ°å·¥ååç产订å*/ |
| | | ProductWorkOrder productWorkOrder = productWorkOrderMapper.selectById(dto.getWorkOrderId()); |
| | | productWorkOrder.setCompleteQuantity(productQty.add(dto.getQuantity())); |
| | | if (ObjectUtils.isNull(productWorkOrder.getActualStartTime())) { |
| | | productWorkOrder.setActualStartTime(LocalDate.now());//å®é
å¼å§æ¶é´ |
| | | } |
| | | if (productWorkOrder.getCompleteQuantity().compareTo(productWorkOrder.getPlanQuantity()) == 0) { |
| | | productWorkOrder.setActualEndTime(LocalDate.now());//å®é
ç»ææ¶é´ |
| | | } |
| | | productWorkOrderMapper.updateById(productWorkOrder); |
| | | //ç产订å |
| | | ProductOrder productOrder = productOrderMapper.selectById(productWorkOrder.getProductOrderId()); |
| | | if (ObjectUtils.isNull(productOrder.getStartTime())) { |
| | | productOrder.setStartTime(LocalDateTime.now());//å¼å§æ¶é´ |
| | | } |
| | | if (productProcessRouteItem.getDragSort() == productProcessRouteItems.size()) { |
| | | //å¦ææ¯æåä¸éå·¥åºæ¥å·¥ä¹åç产订å宿æ°é+ |
| | | productOrder.setCompleteQuantity(productOrder.getCompleteQuantity().add(productQty)); |
| | | if (productOrder.getCompleteQuantity().compareTo(productOrder.getQuantity()) == 0) { |
| | | productOrder.setEndTime(LocalDateTime.now());//ç»ææ¶é´ |
| | | } |
| | | } |
| | | productOrderMapper.updateById(productOrder); |
| | | /*æ·»å çäº§æ ¸ç®*/ |
| | | SalesLedgerProductionAccounting salesLedgerProductionAccounting = SalesLedgerProductionAccounting.builder() |
| | | .salesLedgerWorkId(productionProductMain.getId()) |
| | | .salesLedgerSchedulingId(0L) |
| | | .salesLedgerId(productOrder.getSalesLedgerId()) |
| | | .salesLedgerProductId(productOrder.getProductModelId()) |
| | | .schedulingUserId(user.getUserId()) |
| | | .schedulingUserName(user.getNickName()) |
| | | .finishedNum(productQty) |
| | | .workHours(productProcess.getSalaryQuota()) |
| | | .process(productProcess.getName()) |
| | | .schedulingDate(LocalDate.now()) |
| | | .tenantId(dto.getTenantId()) |
| | | .build(); |
| | | salesLedgerProductionAccountingMapper.insert(salesLedgerProductionAccounting); |
| | | } |
| | | productOrderMapper.updateById(productOrder); |
| | | /*æ·»å çäº§æ ¸ç®*/ |
| | | SalesLedgerProductionAccounting salesLedgerProductionAccounting = SalesLedgerProductionAccounting.builder() |
| | | .salesLedgerWorkId(productionProductMain.getId()) |
| | | .salesLedgerSchedulingId(0L) |
| | | .salesLedgerId(productOrder.getSalesLedgerId()) |
| | | .salesLedgerProductId(productOrder.getProductModelId()) |
| | | .schedulingUserId(user.getUserId()) |
| | | .schedulingUserName(user.getNickName()) |
| | | .finishedNum(dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO) |
| | | .workHours(productProcess.getSalaryQuota()) |
| | | .process(productProcess.getName()) |
| | | .schedulingDate(LocalDate.now()) |
| | | .tenantId(dto.getTenantId()) |
| | | .build(); |
| | | salesLedgerProductionAccountingMapper.insert(salesLedgerProductionAccounting); |
| | | //妿æ¥åºæ°é>0,éè¦è¿å
¥æ¥åºçåºå |
| | | return true; |
| | | } |
| | | |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | |
| | | |
| | | return iPage; |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢éå®å°è´¦æ¶èç©æä¿¡æ¯") |
| | | @GetMapping("/getSalesLedgerWithProductsLoss") |
| | | public R getSalesLedgerWithProductsLoss(Long salesLedgerId) { |
| | | return R.ok(salesLedgerService.getSalesLedgerWithProductsLoss(salesLedgerId)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class LossProductModelDto { |
| | | |
| | | private String productName; |
| | | |
| | | private String model; |
| | | |
| | | private String unit; |
| | | |
| | | //æ¶èæ»é |
| | | private BigDecimal lossNum; |
| | | |
| | | //åä½ç¨é |
| | | private BigDecimal unitQuantity; |
| | | |
| | | //å个ç¨é |
| | | private BigDecimal singleQuantity; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.config.MyBaseMapper; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.purchase.dto.ProcurementBusinessSummaryDto; |
| | | import com.ruoyi.sales.dto.LossProductModelDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | IPage<SalesLedgerProductDto> listPagePurchaseLedger(Page page,@Param("req") SalesLedgerProductDto salesLedgerProduct); |
| | | |
| | | IPage<ProcurementBusinessSummaryDto> procurementBusinessSummaryListPage(Page page,@Param("req") ProcurementBusinessSummaryDto procurementBusinessSummaryDto); |
| | | |
| | | List<LossProductModelDto> selectProductBomStructure(@Param("salesLedegerId") Long salesLedegerId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.LossProductModelDto; |
| | | import com.ruoyi.sales.dto.MonthlyAmountDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | |
| | | IPage<SalesLedger> selectSalesLedgerListPage(Page page, SalesLedgerDto salesLedgerDto); |
| | | |
| | | AjaxResult importData(MultipartFile file); |
| | | |
| | | List<LossProductModelDto> getSalesLedgerWithProductsLoss(Long salesLedgerId); |
| | | |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void invoiceRegistrationSave(SalesLedgerDto salesLedgerDto) { |
| | | // æ°å¢å¼ç¥¨ç»è®°ä¸»è¡¨ |
| | | InvoiceRegistration invoiceRegistration = new InvoiceRegistration(); |
| | | BeanUtils.copyProperties(salesLedgerDto, invoiceRegistration); |
| | | invoiceRegistration.setId(null); |
| | | invoiceRegistration.setCustomerId(salesLedgerDto.getCustomerId().intValue()); |
| | | invoiceRegistration.setSalesLedgerId(salesLedgerDto.getId().intValue()); |
| | | invoiceRegistrationMapper.insert(invoiceRegistration); |
| | | |
| | | List<SalesLedgerProduct> productData = salesLedgerDto.getProductData(); |
| | | BigDecimal invoiceAmountTotal = BigDecimal.ZERO; |
| | | if(CollectionUtils.isNotEmpty(productData)){ |
| | | for (SalesLedgerProduct productDatum : productData) { |
| | | // 妿å¼ç¥¨æ°ä¸º0 è·³è¿ |
| | | BigDecimal currentInvoiceNum = productDatum.getCurrentInvoiceNum(); |
| | | if(null == currentInvoiceNum || BigDecimal.ZERO.compareTo(currentInvoiceNum) == 0){ |
| | | continue; |
| | | } |
| | | invoiceAmountTotal = invoiceAmountTotal.add(currentInvoiceNum); |
| | | InvoiceRegistrationProduct invoiceRegistrationProduct = new InvoiceRegistrationProduct(); |
| | | BeanUtils.copyProperties(productDatum, invoiceRegistrationProduct); |
| | | //æ´æ°å·²å¼ç¥¨å©ä½æªå¼ç¥¨æ° |
| | | invoiceRegistrationProductMapper.update( |
| | | null, |
| | | new LambdaUpdateWrapper<InvoiceRegistrationProduct>() |
| | | .eq(InvoiceRegistrationProduct::getSalesLedgerId, salesLedgerDto.getId()) |
| | | .set(InvoiceRegistrationProduct::getNoInvoiceAmount, productDatum.getNoInvoiceAmount()) |
| | | ); |
| | | invoiceRegistrationProduct.setId(null); |
| | | invoiceRegistrationProduct.setSalesLedgerId(salesLedgerDto.getId().intValue()); |
| | | invoiceRegistrationProduct.setInvoiceRegistrationId(invoiceRegistration.getId()); |
| | | invoiceRegistrationProduct.setInvoiceAmount(productDatum.getCurrentInvoiceAmount()); |
| | | invoiceRegistrationProduct.setInvoiceNum(productDatum.getCurrentInvoiceNum()); |
| | | invoiceRegistrationProduct.setSalesLedgerProductId(productDatum.getId().intValue()); |
| | | if (CollectionUtils.isEmpty(productData)) { |
| | | return; |
| | | } |
| | | |
| | | invoiceRegistrationProductMapper.insert(invoiceRegistrationProduct); |
| | | productDatum.setInvoiceNum(currentInvoiceNum); |
| | | productDatum.setInvoiceAmount(productDatum.getCurrentInvoiceAmount()); |
| | | salesLedgerProductMapper.updateById(productDatum); |
| | | // æ°å¢ä¸æ¡å¼ç¥¨å°è´¦æ°æ® |
| | | InvoiceLedger invoiceLedger = new InvoiceLedger(); |
| | | invoiceLedger.setInvoiceDate(salesLedgerDto.getIssueDate()); |
| | | invoiceLedger.setInvoiceRegistrationProductId(invoiceRegistrationProduct.getId()); |
| | | invoiceLedger.setInvoiceTotal(invoiceRegistrationProduct.getInvoiceAmount()); |
| | | invoiceLedger.setInvoiceNo(salesLedgerDto.getInvoiceNo()); |
| | | invoiceLedger.setCreateUser(SecurityUtils.getUserId().intValue()); |
| | | invoiceLedger.setInvoicePerson(productDatum.getRegister()); |
| | | for (SalesLedgerProduct productDatum : productData) { |
| | | // æ¬æ¬¡å¼ç¥¨æ° / éé¢ |
| | | BigDecimal currentInvoiceNum = productDatum.getCurrentInvoiceNum(); |
| | | BigDecimal currentInvoiceAmount = productDatum.getCurrentInvoiceAmount(); |
| | | |
| | | invoiceLedgerMapper.insert(invoiceLedger); |
| | | if (currentInvoiceNum == null || BigDecimal.ZERO.compareTo(currentInvoiceNum) == 0) { |
| | | continue; |
| | | } |
| | | |
| | | LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductLambdaQueryWrapper = new LambdaQueryWrapper<SalesLedgerProduct>() |
| | | .eq(SalesLedgerProduct::getId, productDatum.getId()) |
| | | .eq(SalesLedgerProduct::getSalesLedgerId, productDatum.getSalesLedgerId()); |
| | | SalesLedgerProduct dbProduct = salesLedgerProductMapper.selectOne(salesLedgerProductLambdaQueryWrapper); |
| | | |
| | | if (dbProduct == null) { |
| | | throw new RuntimeException("éå®å°è´¦äº§åä¸åå¨ï¼IDï¼" + productDatum.getId()); |
| | | } |
| | | |
| | | // 计ç®ç´¯è®¡å¼ç¥¨ |
| | | BigDecimal newInvoiceNum = dbProduct.getInvoiceNum().add(currentInvoiceNum); |
| | | |
| | | BigDecimal newInvoiceAmount = dbProduct.getInvoiceAmount().add(currentInvoiceAmount); |
| | | |
| | | // è®¡ç®æªå¼ç¥¨ |
| | | BigDecimal newNoInvoiceNum = dbProduct.getQuantity().subtract(newInvoiceNum); |
| | | |
| | | BigDecimal newNoInvoiceAmount = dbProduct.getTaxInclusiveTotalPrice().subtract(newInvoiceAmount); |
| | | |
| | | if (newNoInvoiceNum.compareTo(BigDecimal.ZERO) < 0 |
| | | || newNoInvoiceAmount.compareTo(BigDecimal.ZERO) < 0) { |
| | | throw new RuntimeException("å¼ç¥¨æ°éæéé¢è¶
è¿ååæ»é"); |
| | | } |
| | | |
| | | // æ´æ° sales_ledger_product |
| | | salesLedgerProductMapper.update( |
| | | null, |
| | | new LambdaUpdateWrapper<SalesLedgerProduct>() |
| | | .eq(SalesLedgerProduct::getId, dbProduct.getId()) |
| | | .set(SalesLedgerProduct::getInvoiceNum, newInvoiceNum) |
| | | .set(SalesLedgerProduct::getInvoiceAmount, newInvoiceAmount) |
| | | .set(SalesLedgerProduct::getNoInvoiceNum, newNoInvoiceNum) |
| | | .set(SalesLedgerProduct::getNoInvoiceAmount, newNoInvoiceAmount) |
| | | ); |
| | | |
| | | InvoiceRegistrationProduct invoiceRegistrationProduct = new InvoiceRegistrationProduct(); |
| | | BeanUtils.copyProperties(dbProduct, invoiceRegistrationProduct); |
| | | |
| | | invoiceRegistrationProduct.setId(null); |
| | | invoiceRegistrationProduct.setSalesLedgerId(salesLedgerDto.getId().intValue()); |
| | | invoiceRegistrationProduct.setInvoiceRegistrationId(invoiceRegistration.getId()); |
| | | invoiceRegistrationProduct.setSalesLedgerProductId(dbProduct.getId().intValue()); |
| | | invoiceRegistrationProduct.setInvoiceNum(currentInvoiceNum); |
| | | invoiceRegistrationProduct.setInvoiceAmount(currentInvoiceAmount); |
| | | invoiceRegistrationProduct.setNoInvoiceAmount(newNoInvoiceAmount); |
| | | |
| | | invoiceRegistrationProductMapper.insert(invoiceRegistrationProduct); |
| | | |
| | | InvoiceLedger invoiceLedger = new InvoiceLedger(); |
| | | invoiceLedger.setInvoiceDate(salesLedgerDto.getIssueDate()); |
| | | invoiceLedger.setInvoiceRegistrationProductId(invoiceRegistrationProduct.getId()); |
| | | invoiceLedger.setInvoiceTotal(currentInvoiceAmount); |
| | | invoiceLedger.setInvoiceNo(salesLedgerDto.getInvoiceNo()); |
| | | invoiceLedger.setCreateUser(SecurityUtils.getUserId().intValue()); |
| | | invoiceLedger.setInvoicePerson(dbProduct.getRegister()); |
| | | |
| | | invoiceLedgerMapper.insert(invoiceLedger); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.sales.dto.MonthlyAmountDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerImportDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductImportDto; |
| | | import com.ruoyi.sales.dto.*; |
| | | import com.ruoyi.sales.mapper.*; |
| | | import com.ruoyi.sales.pojo.*; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | |
| | | // æ¥è¯¢åå§æ°æ® |
| | | LambdaQueryWrapper<SalesLedger> queryWrapper = Wrappers.lambdaQuery(); |
| | | queryWrapper.select(SalesLedger::getCustomerId, |
| | | SalesLedger::getCustomerName, |
| | | SalesLedger::getContractAmount) |
| | | SalesLedger::getCustomerName, |
| | | SalesLedger::getContractAmount) |
| | | .orderByDesc(SalesLedger::getContractAmount); |
| | | List<SalesLedger> records = salesLedgerMapper.selectList(queryWrapper); |
| | | |
| | |
| | | Map<Long, GroupedCustomer> groupedMap = new LinkedHashMap<>(); // 使ç¨LinkedHashMapä¿ææåº |
| | | for (SalesLedger record : records) { |
| | | groupedMap.computeIfAbsent(record.getCustomerId(), |
| | | k -> new GroupedCustomer(record.getCustomerId(), record.getCustomerName())) |
| | | k -> new GroupedCustomer(record.getCustomerId(), record.getCustomerName())) |
| | | .addAmount(record.getContractAmount()); |
| | | } |
| | | |
| | |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | ExcelUtil<SalesLedgerImportDto> salesLedgerImportDtoExcelUtil = new ExcelUtil<>(SalesLedgerImportDto.class); |
| | | Map<String, List<SalesLedgerImportDto>> stringListMap = salesLedgerImportDtoExcelUtil.importExcelMultiSheet(Arrays.asList("éå®å°è´¦æ°æ®","éå®äº§åæ°æ®"), inputStream, 0); |
| | | if(CollectionUtils.isEmpty(stringListMap)) return AjaxResult.error("éå®è¡¨æ ¼ä¸ºç©ºï¼"); |
| | | Map<String, List<SalesLedgerImportDto>> stringListMap = salesLedgerImportDtoExcelUtil.importExcelMultiSheet(Arrays.asList("éå®å°è´¦æ°æ®", "éå®äº§åæ°æ®"), inputStream, 0); |
| | | if (CollectionUtils.isEmpty(stringListMap)) return AjaxResult.error("éå®è¡¨æ ¼ä¸ºç©ºï¼"); |
| | | // ä¸å¡å±åå¹¶ |
| | | List<SalesLedgerImportDto> salesLedgerImportDtoList = stringListMap.get("éå®å°è´¦æ°æ®"); |
| | | if(CollectionUtils.isEmpty(salesLedgerImportDtoList)) return AjaxResult.error("éå®å°è´¦æ°æ®ä¸ºç©ºï¼"); |
| | | if (CollectionUtils.isEmpty(salesLedgerImportDtoList)) return AjaxResult.error("éå®å°è´¦æ°æ®ä¸ºç©ºï¼"); |
| | | List<SalesLedgerImportDto> salesLedgerProductImportDtoList = stringListMap.get("éå®äº§åæ°æ®"); |
| | | if(CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return AjaxResult.error("éå®äº§åæ°æ®ä¸ºç©ºï¼"); |
| | | if (CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return AjaxResult.error("éå®äº§åæ°æ®ä¸ºç©ºï¼"); |
| | | // å®¢æ·æ°æ® |
| | | List<Customer> customers = customerMapper.selectList(new LambdaQueryWrapper<Customer>().in(Customer::getCustomerName, |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getCustomerName).toArray(String[]::new))); |
| | |
| | | .findFirst() |
| | | .map(SysUser::getUserId) |
| | | .orElse(null); |
| | | if(aLong == null) throw new RuntimeException("å½å
¥äºº:"+salesLedger.getEntryPerson()+",æ 对åºç¨æ·ï¼"); |
| | | if (aLong == null) |
| | | throw new RuntimeException("å½å
¥äºº:" + salesLedger.getEntryPerson() + ",æ 对åºç¨æ·ï¼"); |
| | | salesLedger.setEntryPerson(aLong.toString()); |
| | | salesLedgerMapper.insert(salesLedger); |
| | | // éå®äº§åæ°æ®ç»å®ï¼éè¿éå®åå·è·å对åºéå®äº§åæ°æ® |
| | | List<SalesLedgerProductImportDto> salesLedgerProductImportDtos = salesLedgerProductImportDtoList.stream() |
| | | .filter(salesLedgerProductImportDto -> salesLedgerProductImportDto.getSalesContractNo().equals(salesLedger.getSalesContractNo())) |
| | | .collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(salesLedgerProductImportDtos)) throw new RuntimeException("éå®åå·:"+salesLedgerImportDto.getSalesContractNo()+",æ 对åºäº§åæ°æ®ï¼"); |
| | | if (CollectionUtils.isEmpty(salesLedgerProductImportDtos)) |
| | | throw new RuntimeException("éå®åå·:" + salesLedgerImportDto.getSalesContractNo() + ",æ 对åºäº§åæ°æ®ï¼"); |
| | | for (SalesLedgerProductImportDto salesLedgerProductImportDto : salesLedgerProductImportDtos) { |
| | | SalesLedgerProduct salesLedgerProduct = new SalesLedgerProduct(); |
| | | BeanUtils.copyProperties(salesLedgerProductImportDto, salesLedgerProduct); |
| | |
| | | } |
| | | |
| | | return AjaxResult.success("导å
¥æå"); |
| | | }catch (Exception e) { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return AjaxResult.success("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public List<LossProductModelDto> getSalesLedgerWithProductsLoss(Long salesLedgerId) { |
| | | |
| | | |
| | | List<LossProductModelDto> lossProductModelDtos = salesLedgerProductMapper.selectProductBomStructure(salesLedgerId); |
| | | |
| | | |
| | | return lossProductModelDtos; |
| | | } |
| | | |
| | | |
| | | // å
é¨ç±»ç¨äºåå¨èåç»æ |
| | | private static class GroupedCustomer { |
| | | private final Long customerId; |
| | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @AllArgsConstructor |
| | | @Service |
| | |
| | | |
| | | @Override |
| | | public List<StaffLeaveDto> staffLeaveReasonAnalytics() { |
| | | List<StaffLeaveDto> result = staffLeaveMapper.staffLeaveReasonAnalytics(); |
| | | result.forEach(dto -> { |
| | | List<StaffLeaveDto> dbResult = staffLeaveMapper.staffLeaveReasonAnalytics(); |
| | | |
| | | // å建ä¸ä¸ªMapç¨äºå卿ææä¸¾åå çæ°éï¼é»è®¤å¼ä¸º0 |
| | | Map<String, Integer> reasonCountMap = new HashMap<>(); |
| | | for (StaffLeaveReason reasonEnum : StaffLeaveReason.values()) { |
| | | reasonCountMap.put(reasonEnum.getCode(), 0); |
| | | } |
| | | |
| | | // å°æ°æ®åºæ¥è¯¢ç»æåå¹¶å°Mapä¸ |
| | | for (StaffLeaveDto dto : dbResult) { |
| | | String reasonCode = dto.getReason(); |
| | | StaffLeaveReason reasonEnum = StaffLeaveReason.getByCode(reasonCode); |
| | | if (reasonEnum != null) { |
| | | dto.setReasonText(reasonEnum.getInfo()); |
| | | } else { |
| | | dto.setReasonText("æªç¥åå "); |
| | | if (reasonCountMap.containsKey(reasonCode)) { |
| | | reasonCountMap.put(reasonCode, dto.getCount()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // å°Map转æ¢ä¸ºList<StaffLeaveDto> |
| | | List<StaffLeaveDto> result = new ArrayList<>(); |
| | | for (StaffLeaveReason reasonEnum : StaffLeaveReason.values()) { |
| | | StaffLeaveDto dto = new StaffLeaveDto(); |
| | | dto.setReason(reasonEnum.getCode()); |
| | | dto.setCount(reasonCountMap.get(reasonEnum.getCode())); |
| | | dto.setReasonText(reasonEnum.getInfo()); |
| | | result.add(dto); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | // æ°å¢ç¦»èè®°å½ |
| | | StaffLeave staffLeave = new StaffLeave(); |
| | | staffLeave.setStaffOnJobId(staffLeaveDto.getStaffOnJobId()); |
| | | staffLeave.setReason(staffLeaveDto.getReason()); |
| | | String reason = staffLeaveDto.getReason(); |
| | | if (!StaffLeaveReasonOther.getCode().equals(reason)){ |
| | | staffLeave.setRemark(""); |
| | | if (StaffLeaveReasonOther.getCode().equals(reason)){ |
| | | staffLeave.setRemark(staffLeaveDto.getRemark()); |
| | | } |
| | | staffLeaveMapper.insert(staffLeave); |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "éè´å
¥åº") |
| | | @Api(tags = "å
¥åº") |
| | | @RequestMapping("/stockInRecord") |
| | | public class StockInRecordController { |
| | | @Autowired |
| | | private StockInRecordService stockInRecordService; |
| | | |
| | | @GetMapping("/listPageByProduction") |
| | | @GetMapping("/listPage") |
| | | @Log(title = "ç产å
¥åº-å
¥åºç®¡ç-å表", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "å
¥åºç®¡çå表") |
| | | public AjaxResult listPage(Page page, StockInRecordDto stockInRecordDto) { |
| | |
| | | package com.ruoyi.stock.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.service.StockInventoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/stockInventory") |
| | | @Api(tags = "åºå表") |
| | | public class StockInventoryController { |
| | | |
| | | @Autowired |
| | | private StockInventoryService stockInventoryService; |
| | | |
| | | @GetMapping("/pagestockInventory") |
| | | @ApiOperation("å页æ¥è¯¢åºå") |
| | | public R pagestockInventory(Page page, StockInventoryDto stockInventoryDto) { |
| | | IPage<StockInventoryDto> stockInventoryDtoIPage = stockInventoryService.pagestockInventory(page, stockInventoryDto); |
| | | return R.ok(stockInventoryDtoIPage); |
| | | } |
| | | |
| | | @PostMapping("/addstockInventory") |
| | | @ApiOperation("æ°å¢åºå") |
| | | public R addstockInventory(StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.addstockInventory(stockInventoryDto)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/subtractStockInventory") |
| | | @ApiOperation("æ£ååºå") |
| | | public R subtractStockInventory(StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.subtractStockInventory(stockInventoryDto)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-21 05:27:04 |
| | | */ |
| | | @Api(tags = "åºåº") |
| | | @RestController |
| | | @RequestMapping("/stockOutRecord") |
| | | public class StockOutRecordController { |
| | | @Autowired |
| | | private StockOutRecordService stockOutRecordService; |
| | | |
| | | @GetMapping("/listPageByProduction") |
| | | @GetMapping("/listPage") |
| | | @Log(title = "ç产åºåº-åºåºç®¡ç-å表", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "åºåºç®¡çå表") |
| | | public AjaxResult listPage(Page page, StockOutRecordDto stockOutRecordDto) { |
| | |
| | | package com.ruoyi.stock.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | public class StockInRecordDto extends StockInRecord { |
| | | /** |
| | | * 产ååç§° |
| | |
| | | * 产ååä½ |
| | | */ |
| | | private String unit; |
| | | |
| | | private String timeStr; |
| | | |
| | | private String createBy; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.dto; |
| | | |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StockInventoryDto extends StockInventory { |
| | | |
| | | private String productName; |
| | | private String model; |
| | | private String unit; |
| | | |
| | | |
| | | //å
¥åºç±»å |
| | | private String recordType; |
| | | |
| | | //å
¥åºç±»å对åºçid |
| | | private Long recordId; |
| | | } |
| | |
| | | package com.ruoyi.stock.dto; |
| | | |
| | | import com.ruoyi.stock.pojo.StockOutRecord; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class StockOutRecordDto extends StockOutRecord { |
| | | /** |
| | | * 产ååç§° |
| | |
| | | * 产ååä½ |
| | | */ |
| | | private String unit; |
| | | |
| | | private String timeStr; |
| | | |
| | | private String createBy; |
| | | } |
| | |
| | | package com.ruoyi.stock.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface StockInventoryMapper extends BaseMapper<StockInventory> { |
| | | |
| | | IPage<StockInventoryDto> pagestockInventory(Page page, @Param("ew") StockInventoryDto stockInventoryDto); |
| | | |
| | | |
| | | int updateAddStockInventory(@Param("ew") StockInventoryDto stockInventoryDto); |
| | | |
| | | int updateSubtractStockInventory(@Param("ew") StockInventoryDto stockInventoryDto); |
| | | } |
| | |
| | | @ApiModelProperty(value = "å
¥åºæ°é") |
| | | private BigDecimal stockInNum; |
| | | |
| | | @ApiModelProperty(value = "è®°å½ç±»å") |
| | | @ApiModelProperty(value = "è®°å½ç±»å éè´å
¥åº/ç产å
¥åº/è´¨éå
¥åº/èªå®ä¹å
¥åº") |
| | | private String recordType; |
| | | |
| | | @ApiModelProperty(value = "è®°å½ID") |
| | | @ApiModelProperty(value = "è®°å½ID salesProductId/ProductrMainId/qualityInspectId/0") |
| | | private Long recordId; |
| | | |
| | | @ApiModelProperty(value = "产åè§æ ¼ID") |
| | |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0åæ ¼å
¥åº 1ä¸åæ ¼å
¥åº") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.lang.Nullable; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("è§æ ¼id") |
| | | private Integer productModelId; |
| | | @NotBlank(message = "ä¸è½ä¸ºç©º") |
| | | private Long productModelId; |
| | | |
| | | @ApiModelProperty("æ°é") |
| | | private BigDecimal qualitity; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("çæ¬å·") |
| | | private Integer version; |
| | |
| | | package com.ruoyi.stock.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | |
| | | private BigDecimal stockOutNum; |
| | | |
| | | @ApiModelProperty("å
¥åºæ¥æºid") |
| | | private Integer recordId; |
| | | private Long recordId; |
| | | |
| | | @ApiModelProperty("å
¥åºç±»å") |
| | | private String recordType; |
| | | |
| | | @ApiModelProperty("产åè§æ ¼id") |
| | | private Integer productModelId; |
| | | private Long productModelId; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人") |
| | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("ç§æ·id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | @ApiModelProperty(value = "ç±»å 0åæ ¼å
¥åº 1ä¸åæ ¼å
¥åº") |
| | | private String type; |
| | | } |
| | |
| | | package com.ruoyi.stock.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | */ |
| | | public interface StockInventoryService extends IService<StockInventory> { |
| | | |
| | | IPage<StockInventoryDto> pagestockInventory(Page page, StockInventoryDto stockInventoryDto); |
| | | |
| | | Boolean addstockInventory(StockInventoryDto stockInventoryDto); |
| | | |
| | | Boolean subtractStockInventory(StockInventoryDto stockInventoryDto); |
| | | } |
| | |
| | | package com.ruoyi.stock.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.mapper.StockInRecordMapper; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.service.StockInRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public class StockInRecordServiceImpl extends ServiceImpl<StockInRecordMapper, StockInRecord> implements StockInRecordService { |
| | | @Autowired |
| | | private StockInRecordMapper stockInRecordMapper; |
| | | @Autowired |
| | | private StockInventoryMapper stockInventoryMapper; |
| | | |
| | | @Override |
| | | public IPage<StockInRecordDto> listPage(Page page, StockInRecordDto stockInRecordDto) { |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int batchDelete(List<Long> ids) { |
| | | for (Long id : ids) { |
| | | StockInRecord stockInRecord = stockInRecordMapper.selectById(id); |
| | | StockInventory stockInventory = stockInventoryMapper.selectOne(new LambdaQueryWrapper<StockInventory>().eq(StockInventory::getProductModelId, id)); |
| | | if (stockInventory == null) { |
| | | throw new BaseException("该å
¥åºè®°å½ä¸æ²¡æå¯¹åºç产å,æ æ³å é¤!!!"); |
| | | }else { |
| | | StockInventoryDto stockInRecordDto = new StockInventoryDto(); |
| | | stockInRecordDto.setProductModelId(stockInventory.getProductModelId()); |
| | | stockInRecordDto.setQualitity(stockInRecord.getStockInNum()); |
| | | stockInventoryMapper.updateSubtractStockInventory(stockInRecordDto); |
| | | } |
| | | } |
| | | return stockInRecordMapper.deleteBatchIds(ids); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.stock.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.service.StockInRecordService; |
| | | import com.ruoyi.stock.service.StockInventoryService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class StockInventoryServiceImpl extends ServiceImpl<StockInventoryMapper, StockInventory> implements StockInventoryService { |
| | | |
| | | @Autowired |
| | | private StockInventoryMapper stockInventoryMapper; |
| | | |
| | | @Autowired |
| | | private StockInRecordService stockInRecordService; |
| | | @Autowired |
| | | private StockOutRecordService stockOutRecordService; |
| | | |
| | | @Override |
| | | public IPage<StockInventoryDto> pagestockInventory(Page page, StockInventoryDto stockInventoryDto) { |
| | | return stockInventoryMapper.pagestockInventory(page, stockInventoryDto); |
| | | } |
| | | |
| | | //å
¥åºè°ç¨ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean addstockInventory(StockInventoryDto stockInventoryDto) { |
| | | //æ°å¢å
¥åºè®°å½åæ·»å åºå |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | stockInRecordDto.setRecordId(stockInventoryDto.getRecordId()); |
| | | stockInRecordDto.setRecordType(stockInventoryDto.getRecordType()); |
| | | stockInRecordDto.setStockInNum(stockInventoryDto.getQualitity()); |
| | | stockInRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockInRecordService.add(stockInRecordDto); |
| | | //åè¿è¡æ°å¢åºåæ°éåºå |
| | | //å
æ¥è¯¢åºå表ä¸çäº§åæ¯å¦åå¨ï¼ä¸å卿°å¢ï¼å卿´æ° |
| | | StockInventory oldStockInventory = stockInventoryMapper.selectOne(new QueryWrapper<StockInventory>().lambda().eq(StockInventory::getProductModelId, stockInventoryDto.getProductModelId())); |
| | | if (ObjectUtils.isEmpty(oldStockInventory)) { |
| | | StockInventory newStockInventory = new StockInventory(); |
| | | newStockInventory.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | newStockInventory.setQualitity(stockInventoryDto.getQualitity()); |
| | | newStockInventory.setVersion(1); |
| | | stockInventoryMapper.insert(newStockInventory); |
| | | }else { |
| | | stockInventoryMapper.updateAddStockInventory(stockInventoryDto); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | //åºåºè°ç¨ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean subtractStockInventory(StockInventoryDto stockInventoryDto) { |
| | | // æ°å¢åºåºè®°å½ |
| | | StockOutRecordDto stockOutRecordDto = new StockOutRecordDto(); |
| | | stockOutRecordDto.setRecordId(stockInventoryDto.getRecordId()); |
| | | stockOutRecordDto.setRecordType(stockInventoryDto.getRecordType()); |
| | | stockOutRecordDto.setStockOutNum(stockInventoryDto.getQualitity()); |
| | | stockOutRecordDto.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | stockOutRecordService.add(stockOutRecordDto); |
| | | StockInventory oldStockInventory = stockInventoryMapper.selectOne(new QueryWrapper<StockInventory>().lambda().eq(StockInventory::getProductModelId, stockInventoryDto.getProductModelId())); |
| | | if (ObjectUtils.isEmpty(oldStockInventory)) { |
| | | throw new RuntimeException("产ååºåä¸åå¨"); |
| | | }else { |
| | | stockInventoryMapper.updateSubtractStockInventory(stockInventoryDto); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.stock.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.mapper.StockOutRecordMapper; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.pojo.StockOutRecord; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class StockOutRecordServiceImpl extends ServiceImpl<StockOutRecordMapper, StockOutRecord> implements StockOutRecordService { |
| | | @Autowired |
| | | private StockOutRecordMapper stockOutRecordMapper; |
| | | @Autowired |
| | | private StockInventoryMapper stockInventoryMapper; |
| | | |
| | | @Override |
| | | public IPage<StockOutRecordDto> listPage(Page page, StockOutRecordDto stockOutRecordDto) { |
| | |
| | | throw new BaseException("该åºåºè®°å½ä¸åå¨,æ æ³æ´æ°!!!"); |
| | | } |
| | | |
| | | String[] ignoreProperties = {"id", "inbound_batches"};//æé¤id屿§ |
| | | String[] ignoreProperties = {"id", "outbound_batches"};//æé¤id屿§ |
| | | BeanUtils.copyProperties(stockOutRecordDto, stockOutRecord, ignoreProperties); |
| | | return stockOutRecordMapper.updateById(stockOutRecord); |
| | | } |
| | | |
| | | @Override |
| | | public int batchDelete(List<Long> ids) { |
| | | for (Long id : ids) { |
| | | StockOutRecord stockOutRecord = stockOutRecordMapper.selectById(id); |
| | | StockInventory stockInventory = stockInventoryMapper.selectOne(new LambdaQueryWrapper<StockInventory>().eq(StockInventory::getProductModelId, id)); |
| | | if (stockInventory == null) { |
| | | throw new BaseException("该å
¥åºè®°å½ä¸æ²¡æå¯¹åºç产å,æ æ³å é¤!!!"); |
| | | }else { |
| | | StockInventoryDto stockInRecordDto = new StockInventoryDto(); |
| | | stockInRecordDto.setProductModelId(stockInventory.getProductModelId()); |
| | | stockInRecordDto.setQualitity(stockOutRecord.getStockOutNum()); |
| | | stockInventoryMapper.updateAddStockInventory(stockInRecordDto); |
| | | } |
| | | } |
| | | return stockOutRecordMapper.deleteBatchIds(ids); |
| | | } |
| | | } |
| | |
| | | sjlr.phone, |
| | | scp.create_time |
| | | FROM staff_contacts_personal scp |
| | | LEFT JOIN (select * from staff_join_leave_record WHERE staff_state = 1) sjlr ON scp.contact_id=sjlr.id |
| | | LEFT JOIN (select * from staff_on_job WHERE staff_state = 1) sjlr ON scp.contact_id=sjlr.id |
| | | where 1=1 |
| | | <if test="staffContactsPersonalDTO.staffName != null and staffContactsPersonalDTO.staffName != ''"> |
| | | and sjlr.staff_name like concat('%',#{staffContactsPersonalDTO.staffName},'%') |
| | |
| | | t3.dict_label as dictName, |
| | | t4.dict_label as dictTypeName |
| | | from labor_issue t1 |
| | | left join staff_join_leave_record t2 on t1.staff_id = t2.id |
| | | left join staff_on_job t2 on t1.staff_id = t2.id |
| | | left join sys_dict_data t3 on t1.dict_id = t3.dict_value |
| | | left join sys_dict_data t4 on t1.dict_type = t4.dict_value |
| | | <where> |
| | |
| | | t3.dict_label as dictName, |
| | | t4.dict_label as dictTypeName |
| | | from labor_issue t1 |
| | | left join staff_join_leave_record t2 on t1.staff_id = t2.id |
| | | left join staff_on_job t2 on t1.staff_id = t2.id |
| | | left join sys_dict_data t3 on t1.dict_id = t3.dict_value |
| | | left join sys_dict_data t4 on t1.dict_type = t4.dict_value |
| | | <where> |
| | |
| | | p.product_name as productName, |
| | | pm.model as productModelName, |
| | | ppo.quantity, |
| | | ppo.scrap_qty, |
| | | pm.unit, |
| | | sl.sales_contract_no salesContractNo |
| | | from |
| | |
| | | sl.customer_name, |
| | | sl.contract_amount |
| | | ORDER BY |
| | | sl.sales_contract_no; |
| | | sl.sales_contract_no |
| | | </select> |
| | | <select id="listVat" resultType="com.ruoyi.purchase.dto.VatDto"> |
| | | select * |
| | |
| | | <where> |
| | | 1=1 |
| | | <if test="salesLedgerProduct.salesLedgerId != null and salesLedgerProduct.salesLedgerId != '' "> |
| | | AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId} |
| | | AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId} |
| | | </if> |
| | | <if test="salesLedgerProduct.type != null and salesLedgerProduct.type != '' "> |
| | | AND T1.type = #{salesLedgerProduct.type} |
| | | AND T1.type = #{salesLedgerProduct.type} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | from quality_inspect qi |
| | | left join production_product_main ppm on qi.product_main_id = ppm.id |
| | | left join product_work_order pwo on ppm.work_order_id = pwo.id |
| | | left join product_order po on pwo.product_order_id = po.id |
| | | left join product_order po on pwo.product_order_id = po.id |
| | | left join sales_ledger_product slp on po.product_model_id = slp.id |
| | | where qi.product_main_id = #{productMainId} |
| | | |
| | |
| | | <where> |
| | | slp.type = 1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != '' "> |
| | | AND sl.sales_contract_no like concat('%',#{req.salesContractNo},'%') |
| | | AND sl.sales_contract_no like concat('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | <if test="req.customerContractNo != null and req.customerContractNo != '' "> |
| | | AND sl.customer_contract_no like concat('%',#{req.customerContractNo},'%') |
| | | AND sl.customer_contract_no like concat('%',#{req.customerContractNo},'%') |
| | | </if> |
| | | <if test="req.projectName != null and req.projectName != '' "> |
| | | AND sl.project_name like concat('%',#{req.projectName},'%') |
| | | AND sl.project_name like concat('%',#{req.projectName},'%') |
| | | </if> |
| | | <if test="req.customerName != null and req.customerName != '' "> |
| | | AND sl.customer_name like concat('%',#{req.customerName},'%') |
| | | AND sl.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != '' "> |
| | | AND slp.product_category like concat('%',#{req.productCategory},'%') |
| | | AND slp.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.status != null and req.status "> |
| | | AND slp.pending_invoice_total > 0 |
| | | AND slp.pending_invoice_total > 0 |
| | | </if> |
| | | </where> |
| | | order by slp.register_date desc |
| | |
| | | <where> |
| | | slp.type = 2 |
| | | <if test="req.purchaseContractNumber != null and req.purchaseContractNumber != '' "> |
| | | AND sl.purchase_contract_number like concat('%',#{req.purchaseContractNumber},'%') |
| | | AND sl.purchase_contract_number like concat('%',#{req.purchaseContractNumber},'%') |
| | | </if> |
| | | <if test="req.customerContractNo != null and req.customerContractNo != '' "> |
| | | AND sl.customer_contract_no like concat('%',#{req.customerContractNo},'%') |
| | | AND sl.customer_contract_no like concat('%',#{req.customerContractNo},'%') |
| | | </if> |
| | | <if test="req.projectName != null and req.projectName != '' "> |
| | | AND sl.project_name like concat('%',#{req.projectName},'%') |
| | | AND sl.project_name like concat('%',#{req.projectName},'%') |
| | | </if> |
| | | <if test="req.customerName != null and req.customerName != '' "> |
| | | AND sl.customer_name like concat('%',#{req.customerName},'%') |
| | | AND sl.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.productCategory != null and req.productCategory != '' "> |
| | | AND slp.product_category like concat('%',#{req.productCategory},'%') |
| | | AND slp.product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.status != null and req.status "> |
| | | AND slp.pending_invoice_total > 0 |
| | | AND slp.pending_invoice_total > 0 |
| | | </if> |
| | | </where> |
| | | order by slp.register_date desc |
| | |
| | | <!-- æäº§å大类æåº --> |
| | | ORDER BY slp.product_category |
| | | </select> |
| | | <select id="selectProductBomStructure" resultType="com.ruoyi.sales.dto.LossProductModelDto"> |
| | | select |
| | | a.model, |
| | | a.product_name, |
| | | a.unit, |
| | | sum(a.single_quantity) AS loss_num |
| | | from (SELECT ps.unit, |
| | | ps.unit_quantity, |
| | | pm1.model, |
| | | p.product_name, |
| | | ps.unit_quantity * slp.quantity AS single_quantity |
| | | FROM sales_ledger sl |
| | | LEFT JOIN sales_ledger_product slp ON slp.sales_ledger_id = sl.id |
| | | LEFT JOIN product_model pm ON pm.id = slp.product_model_id |
| | | LEFT JOIN product_bom pb ON pb.product_model_id = pm.id |
| | | LEFT JOIN product_structure ps ON pb.id = ps.bom_id |
| | | LEFT JOIN product_model pm1 ON pm1.id = ps.product_model_id |
| | | LEFT JOIN product p ON p.id = pm1.product_id |
| | | WHERE sl.id = #{salesLedegerId}) A |
| | | group by a.model, a.product_name, a.unit |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.stock.dto.StockInRecordDto"> |
| | | SELECT |
| | | sir.* |
| | | pm.product_name as productName, |
| | | sir.*, |
| | | p.product_name as productName, |
| | | pm.model, |
| | | pm.unit |
| | | pm.unit, |
| | | u.nick_name as createBy |
| | | FROM stock_in_record as sir |
| | | LEFT JOIN product_models as pm on sir.product_model_id = pm.id |
| | | LEFT JOIN product_model as pm on sir.product_model_id = pm.id |
| | | LEFT JOIN product as p on pm.product_id = p.id |
| | | LEFT JOIN sys_user as u on sir.create_user = u.user_id |
| | | <where> |
| | | <if test="params.timeStr != null and params.timeStr != ''"> |
| | | and sir.create_time like concat('%',#{param.timeStr},'%') |
| | | and sir.create_time like concat('%',#{params.timeStr},'%') |
| | | </if> |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | </where> |
| | | order by sir.id desc |
| | |
| | | <result column="locked_quantity" property="lockedQuantity" /> |
| | | <result column="warn_num" property="warnNum" /> |
| | | </resultMap> |
| | | <update id="updateAddStockInventory"> |
| | | update stock_inventory |
| | | <set> |
| | | <if test="ew.qualitity != null"> |
| | | qualitity = qualitity + #{ew.qualitity}, |
| | | </if> |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | | </set> |
| | | where product_model_id = #{ew.productModelId} |
| | | </update> |
| | | <update id="updateSubtractStockInventory"> |
| | | update stock_inventory |
| | | <set> |
| | | <if test="ew.qualitity != null"> |
| | | qualitity = qualitity - #{ew.qualitity}, |
| | | </if> |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | | </set> |
| | | where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity} |
| | | </update> |
| | | <select id="pagestockInventory" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |
| | | select si.*, |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name |
| | | from stock_inventory si |
| | | left join product_model pm on si.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | where 1 = 1 |
| | | <if test="ew.productName != null and ew.productName !=''"> |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | </resultMap> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.stock.dto.StockOutRecordDto"> |
| | | SELECT |
| | | sor.* |
| | | pm.product_name as productName, |
| | | sor.*, |
| | | p.product_name as productName, |
| | | pm.model, |
| | | pm.unit |
| | | pm.unit, |
| | | u.nick_name as createBy |
| | | FROM stock_out_record as sor |
| | | LEFT JOIN product_models as pm on sor.product_model_id = pm.id |
| | | LEFT JOIN product_model as pm on sor.product_model_id = pm.id |
| | | LEFT JOIN product as p on pm.product_id = p.id |
| | | LEFT JOIN sys_user as u on sor.create_user = u.user_id |
| | | <where> |
| | | <if test="params.timeStr != null and params.timeStr != ''"> |
| | | and sor.create_time like concat('%',#{param.timeStr},'%') |
| | | </if> |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{param.productName},'%') |
| | | </if> |
| | | </where> |
| | | order by sor.id desc |
| | | </select> |