Merge branch 'dev_New_pro' into dev_山西_黎城县胜德建材
已添加8个文件
已修改46个文件
已删除14个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # éè´å¤æä»¶åæç¡®è®¤æ¥å£ä¼ åç±»å约æï¼`purchase_ledger`ï¼ |
| | | |
| | | ## 1. éç¨æ¥å£ |
| | | |
| | | - `POST /purchase-ai/analyze-files/confirm` |
| | | - `businessType = purchase_ledger` |
| | | |
| | | > æ¬æç¨äºçº¦æå端æäº¤å°ç¡®è®¤æ¥å£ç `payload` ç±»åï¼é¿å
`Cannot deserialize ...` è¿ç±»ååºååå¼å¸¸ã |
| | | |
| | | ## 2. é¡¶å±è¯·æ±ä½ |
| | | |
| | | ```json |
| | | { |
| | | "businessType": "purchase_ledger", |
| | | "payload": { |
| | | "purchaseLedgers": [] |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ## 3. payload ç»æ |
| | | |
| | | æ¨èç»ä¸ä½¿ç¨æ¹éç»æï¼å³ä½¿åªæ 1 æ¡ï¼ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "purchaseLedgers": [ |
| | | { |
| | | "purchaseContractNumber": "CG-2026-001", |
| | | "supplierId": 10001, |
| | | "entryDate": "2026-05-07", |
| | | "type": 2, |
| | | "approvalStatus": 1, |
| | | "productData": [ |
| | | { |
| | | "productCategory": "颿", |
| | | "specificationModel": "Q235-A", |
| | | "unit": "å¨", |
| | | "quantity": 10, |
| | | "taxInclusiveUnitPrice": 1200, |
| | | "taxInclusiveTotalPrice": 12000, |
| | | "taxRate": 13, |
| | | "type": 2 |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | å端ä¹å
¼å®¹âåæ¡ç´ä¼ âï¼`payload` ç´æ¥æ¯ä¸æ¡ `PurchaseLedgerDto`ï¼ï¼ä½ä¸å»ºè®®æ°å端继ç»ä½¿ç¨ã |
| | | |
| | | ## 4. Java ç±»åå° JSON ç±»åæ å°è§å |
| | | |
| | | - `Long` / `Integer`ï¼ä¼ **number**ï¼æ´æ°ï¼ï¼ä¸è¦ä¼ `"pending"`ã`"1级"` è¿ç±»å符串ã |
| | | - `BigDecimal`ï¼ä¼ **number**ï¼å¯å°æ°ï¼ï¼ä¸è¦ä¼ 带éå·ãåä½çå符串ï¼å¦ `"12,000å
"`ï¼ã |
| | | - `Date`ï¼ä¼ **string**ï¼æ ¼å¼åºå® `yyyy-MM-dd`ã |
| | | - `Boolean`ï¼ä¼ `true/false`ï¼ä¸è¦ä¼ `"true"`ã`"æ¯"`ã |
| | | - `List<T>`ï¼ä¼ æ°ç» `[]`ã |
| | | |
| | | ## 5. `PurchaseLedgerDto` åæ®µç±»å约æï¼ç¡®è®¤æ¥å£å¯è¯å«åæ®µï¼ |
| | | |
| | | | åæ®µ | Java ç±»å | JSON ç±»å | 说æ | |
| | | | --- | --- | --- | --- | |
| | | | entryDateStart | String | string | æ¥è¯¢åºé´å¼å§æ¥æï¼`yyyy-MM-dd`ï¼ | |
| | | | entryDateEnd | String | string | æ¥è¯¢åºé´ç»ææ¥æï¼`yyyy-MM-dd`ï¼ | |
| | | | id | Long | number(integer) | å°è´¦ID | |
| | | | purchaseContractNumber | String | string | **å¿
å¡«**ï¼ä¸»ä¸å¡åå·ï¼ | |
| | | | supplierId | Long | number(integer) | `supplierId` ä¸ `supplierName` äºéä¸å¿
å¡« | |
| | | | supplierName | String | string | `supplierId` ä¸ `supplierName` äºéä¸å¿
å¡« | |
| | | | recorderId | Long | number(integer) | å½å
¥äººID | |
| | | | recorderName | String | string | å½å
¥äººåç§° | |
| | | | salesContractNo | String | string | éå®ååå· | |
| | | | salesContractNoId | Long | number(integer) | éå®ååID | |
| | | | projectName | String | string | 项ç®åç§° | |
| | | | entryDate | Date | string(`yyyy-MM-dd`) | å½å
¥æ¥æï¼ç¼ºçæ¶å端ä¼è¡¥å½å¤© | |
| | | | executionDate | Date | string(`yyyy-MM-dd`) | ç¾è®¢æ¥æ | |
| | | | remarks | String | string | 夿³¨ | |
| | | | attachmentMaterials | String | string | é件说æ/è·¯å¾ | |
| | | | createdAt | Date | string(`yyyy-MM-dd`) | åå»ºæ¥æ | |
| | | | updatedAt | Date | string(`yyyy-MM-dd`) | æ´æ°æ¥æ | |
| | | | salesLedgerId | Long | number(integer) | éå®å°è´¦ID | |
| | | | hasChildren | Boolean | boolean | æ¯å¦æå项 | |
| | | | Type | Integer | number(integer) | åå²å段ï¼ä¸æ¨èæ°å端使ç¨ï¼ | |
| | | | productData | List<SalesLedgerProduct> | array | 产åæç»ï¼è§ä¸è | |
| | | | tempFileIds | List<String> | array[string] | ä¸´æ¶æä»¶IDå表 | |
| | | | SalesLedgerFiles | List<CommonFile> | array[object] | åå²å
¼å®¹å段 | |
| | | | phoneNumber | String | string | ä¸å¡åææºå· | |
| | | | businessPersonId | Long | number(integer) | ä¸å¡åID | |
| | | | productId | Long | number(integer) | 产åID | |
| | | | productModelId | Long | number(integer) | 产åè§æ ¼ID | |
| | | | invoiceNumber | String | string | åç¥¨å· | |
| | | | invoiceAmount | BigDecimal | number | å票éé¢ | |
| | | | ticketRegistrationId | Long | number(integer) | æ¥ç¥¨ç»è®°ID | |
| | | | contractAmount | BigDecimal | number | ååéé¢ | |
| | | | receiptPaymentAmount | BigDecimal | number | æ¥ç¥¨éé¢ | |
| | | | unReceiptPaymentAmount | BigDecimal | number | æªæ¥ç¥¨éé¢ | |
| | | | type | Integer | number(integer) | å°è´¦ç±»åï¼éè´åºå® `2`ï¼ç¼ºçæ¶å端补 `2`ï¼ | |
| | | | paymentMethod | String | string | 仿¬¾æ¹å¼ | |
| | | | approvalStatus | Integer | number(integer) | 审æ¹ç¶æï¼**严ç¦ä¼ å符串**ï¼å¦ `"pending"`ï¼ | |
| | | | templateName | String | string | 模æ¿åç§° | |
| | | |
| | | ### 审æ¹ç¶æå»ºè®®å¼ï¼`approvalStatus`ï¼ |
| | | |
| | | å»ºè®®ææ°åä¼ å¼ï¼ |
| | | |
| | | - `1`ï¼å¾
å®¡æ ¸ |
| | | - `2`ï¼å®¡æ ¸ä¸ |
| | | - `3`ï¼å®¡æ ¸éè¿ |
| | | - `4`ï¼å®¡æ ¸æç»/失败 |
| | | - `5`ï¼æ¨¡æ¿æ°æ®ï¼åå²å®ä¹ï¼ |
| | | |
| | | ## 6. `productData`ï¼`SalesLedgerProduct`ï¼å»ºè®®å段åç±»å |
| | | |
| | | | åæ®µ | Java ç±»å | JSON ç±»å | 说æ | |
| | | | --- | --- | --- | --- | |
| | | | productCategory | String | string | **å¿
å¡«**ï¼äº§å大类/åç§° | |
| | | | specificationModel | String | string | **å¿
å¡«**ï¼è§æ ¼åå· | |
| | | | unit | String | string | **å¿
å¡«**ï¼åä½ | |
| | | | quantity | BigDecimal | number | **å¿
å¡«**ï¼æ°é | |
| | | | taxRate | BigDecimal | number | ç¨çï¼å¦ `13`ï¼ | |
| | | | taxInclusiveUnitPrice | BigDecimal | number | **å¿
å¡«**ï¼å«ç¨åä»· | |
| | | | taxInclusiveTotalPrice | BigDecimal | number | **å¿
å¡«**ï¼å«ç¨æ»ä»· | |
| | | | taxExclusiveTotalPrice | BigDecimal | number | ä¸å«ç¨æ»ä»·ï¼å¯ä¸ä¼ ï¼åç«¯å¯æ¨å¯¼ï¼ | |
| | | | invoiceType | String | string | å票类å | |
| | | | productId | Long | number(integer) | 产åID | |
| | | | productModelId | Long | number(integer) | 产ååå·ID | |
| | | | isChecked | Boolean | boolean | æ¯å¦è´¨æ£ | |
| | | | type | Integer | number(integer) | éè´äº§ååºå® `2`ï¼å»ºè®®ä¼ `2`ï¼ | |
| | | |
| | | ## 7. å¿
å¡«ä¸å端é»è®¤è¡ä¸º |
| | | |
| | | - å°è´¦ä¸»è¡¨å¿
å¡«ï¼`purchaseContractNumber`ï¼ä»¥å `supplierId` / `supplierName` äºéä¸ã |
| | | - 产åæç»è¥ä¼ äº `productData`ï¼åæ¯æ¡äº§åå¿
å¡«ï¼`productCategory`ã`specificationModel`ã`unit`ã`quantity`ã`taxInclusiveUnitPrice`ã`taxInclusiveTotalPrice`ã |
| | | - `entryDate` 为空æ¶ï¼å端补å½å¤©æ¥æã |
| | | - `type` 为空æ¶ï¼å端补 `2`ã |
| | | |
| | | ## 8. å端é«é¢éè¯¯ç¤ºä¾ |
| | | |
| | | é误ï¼ä¼è§¦åååºååå¼å¸¸ï¼ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "approvalStatus": "pending", |
| | | "type": "éè´", |
| | | "supplierId": "ä¾åºåA" |
| | | } |
| | | ``` |
| | | |
| | | æ£ç¡®ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "approvalStatus": 1, |
| | | "type": 2, |
| | | "supplierId": 10001 |
| | | } |
| | | ``` |
| | | |
| | | ## 9. æäº¤åèªæ£æ¸
å |
| | | |
| | | 1. ææ `Long/Integer/BigDecimal` åæ®µé½ä¸ºæ°åï¼ä¸æ¯ä¸å¡è¯å符串ã |
| | | 2. æææ¥æåæ®µé½æ¯ `yyyy-MM-dd`ã |
| | | 3. `approvalStatus` ä»
ä¼ æ°åç¶æç ã |
| | | 4. `supplierId` ä¸ `supplierName` è³å°æä¸ä¸ªææå¼ã |
| | | 5. `productData` ä¸å¿
å¡«åé½å
¨ä¸ä¸ºæ£ç¡®ç±»åã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | drop table if exists customer_user; |
| | | create table customer_user |
| | | ( |
| | | id bigint auto_increment |
| | | primary key, |
| | | customer_id bigint not null default 0 comment '客æ·id', |
| | | user_id bigint not null default 0 comment 'ç¨æ·id', |
| | | create_time datetime null comment 'å½å
¥æ¶é´', |
| | | tenant_id bigint not null default 0 comment 'ç§æ·id' |
| | | ); |
| | |
| | | case 6 -> "æ¥ä»·å®¡æ¹"; |
| | | case 7 -> "å货审æ¹"; |
| | | case 8 -> "å±é©ä½ä¸å®¡æ¹"; |
| | | case 9 -> "åå
¬ç¨å审æ¹"; |
| | | default -> "ç±»å" + type; |
| | | }; |
| | | } |
| | |
| | | return "å货审æ¹"; |
| | | case 8: |
| | | return "å±é©ä½ä¸å®¡æ¹"; |
| | | case 9: |
| | | return "åå
¬ç¨å审æ¹"; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | qualityInspect.setUnit(saleProduct.getUnit()); |
| | | qualityInspect.setQuantity(saleProduct.getQuantity()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| | | List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(saleProduct.getProductId(), 0,null); |
| | | if (qualityTestStandard.size()>0){ |
| | | List<QualityTestStandard> qualityTestStandard = qualityTestStandardMapper.getQualityTestStandardByProductId(saleProduct.getProductId(), 0, null); |
| | | 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())) |
| | | .eq(QualityTestStandardParam::getTestStandardId, qualityTestStandard.get(0).getId())) |
| | | .forEach(qualityTestStandardParam -> { |
| | | QualityInspectParam param = new QualityInspectParam(); |
| | | com.ruoyi.common.utils.bean.BeanUtils.copyProperties(qualityTestStandardParam, param); |
| | |
| | | .map(ApproveProcessConfigNodeVo::getApproverId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | if (list.isEmpty()) { |
| | | throw new RuntimeException("æµç¨ä¸åå¨"); |
| | | } |
| | | // æ å®¡æ ¸äººé»è¾æ·»å |
| | | if (CollectionUtils.isEmpty(nodeIds)) { |
| | | autoPassPurchaseApproveIfNoApprover(approveProcessVO); |
| | | autoPassPurchaseApproveIfNoApprover(approveProcessVO); // éè´åæ å®¡æ ¸äººé»è¾ |
| | | return; |
| | | } |
| | | List<SysUser> sysUsers = sysUserMapper.selectUserByIds(nodeIds); |
| | |
| | | return "å货审æ¹"; |
| | | case 8: |
| | | return "å±é©ä½ä¸å®¡æ¹"; |
| | | case 9: |
| | | return "åå
¬ç¨å审æ¹"; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | import com.ruoyi.basic.dto.CustomerDto; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.service.ICustomerService; |
| | | import com.ruoyi.basic.vo.CustomerVo; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | 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 jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | public R list(Page<CustomerDto> page, CustomerDto customer) { |
| | | IPage<CustomerDto> customerDtoIPage = customerService.selectCustomerList(page, customer); |
| | | IPage<CustomerVo> customerDtoIPage = customerService.selectCustomerList(page, customer); |
| | | return R.ok(customerDtoIPage); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, Customer customer) { |
| | | Long[] ids = customer.getIds(); |
| | | List<Customer> list; |
| | | if (ids != null && ids.length > 0) { |
| | | list = customerService.selectCustomerListByIds(ids); |
| | | } else { |
| | | list = customerService.selectCustomerLists(customer); |
| | | } |
| | | ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class); |
| | | util.exportExcel(response, list, "å®¢æ·æ¡£æ¡æ°æ®"); |
| | | public void export(HttpServletResponse response, CustomerDto customer) { |
| | | ExcelUtil<CustomerVo> util = new ExcelUtil<CustomerVo>(CustomerVo.class); |
| | | util.exportExcel(response, customerService.selectCustomerLists(customer), "å®¢æ·æ¡£æ¡æ°æ®"); |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | public R importData(MultipartFile file, Integer type) throws Exception { |
| | | |
| | | return customerService.importData(file); |
| | | return customerService.importData(file, type); |
| | | } |
| | | |
| | | /** |
| | | * è·åå®¢æ·æ¡£æ¡è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(customerService.selectCustomerDetailById(id)); |
| | | public R getInfo(@PathVariable("id") Long id) { |
| | | return R.ok(customerService.selectCustomerDetailById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addCustomer") |
| | | public AjaxResult add(@RequestBody Customer customer) { |
| | | return toAjax(customerService.insertCustomer(customer)); |
| | | public R add(@RequestBody Customer customer) { |
| | | return R.ok(customerService.insertCustomer(customer)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/updateCustomer") |
| | | public AjaxResult edit(@RequestBody Customer customer) { |
| | | return toAjax(customerService.updateCustomer(customer)); |
| | | public R edit(@RequestBody Customer customer) { |
| | | return R.ok(customerService.updateCustomer(customer)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delCustomer") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | public R remove(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return toAjax(customerService.deleteCustomerByIds(ids)); |
| | | return R.ok(customerService.deleteCustomerByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åé
å®¢æ· |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.OTHER) |
| | | @PostMapping("/assignCustomer") |
| | | public R assignCustomer(@RequestBody CustomerDto customer) { |
| | | customerService.assignCustomer(customer); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * åæ¶å®¢æ· |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.OTHER) |
| | | @PostMapping("/recycleCustomer") |
| | | public R recycleCustomer(@RequestBody CustomerDto customer) { |
| | | customerService.recycleCustomer(customer); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å
±äº«å®¢æ· |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.OTHER) |
| | | @PostMapping("/together") |
| | | public R together(@RequestBody CustomerDto customer) { |
| | | customerService.together(customer); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ç§æµ·å®¢æ·æµåå
¬æµ· |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.OTHER) |
| | | @PostMapping("/back") |
| | | public R back(Long id) { |
| | | return R.ok(customerService.back(id)); |
| | | } |
| | | } |
| | |
| | | @Operation(summary = "æ¥è¯¢å®¢æ·è·è¿å表") |
| | | public IPage<CustomerFollowUp> list(Page<CustomerFollowUp> page, CustomerFollowUp customerFollowUp) { |
| | | LambdaQueryWrapper<CustomerFollowUp> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(customerFollowUp.getCustomerPrivatePoolId() != null, CustomerFollowUp::getCustomerPrivatePoolId, customerFollowUp.getCustomerPrivatePoolId()) |
| | | queryWrapper.eq(customerFollowUp.getCustomerId() != null, CustomerFollowUp::getCustomerId, customerFollowUp.getCustomerId()) |
| | | .like(customerFollowUp.getFollowerUserName() != null, CustomerFollowUp::getFollowerUserName, customerFollowUp.getFollowerUserName()) |
| | | .orderByDesc(CustomerFollowUp::getFollowUpTime); |
| | | return customerFollowUpService.page(page, queryWrapper); |
| | |
| | | |
| | | private String togetherUserNames; |
| | | |
| | | } |
| | | /** |
| | | * å
±äº«ç¨æ·IDå表 |
| | | */ |
| | | private List<Long> userIds; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.CustomerDto; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.vo.CustomerVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | int deleteCustomerByIds(Long[] ids); |
| | | |
| | | IPage<CustomerDto> listPage(Page<CustomerDto> page, @Param("c") CustomerDto customer); |
| | | } |
| | | IPage<CustomerVo> listPage(Page<CustomerDto> page, @Param("c") CustomerDto customer, @Param("loginUserId") Long loginUserId); |
| | | |
| | | List<CustomerVo> list(@Param("c") CustomerDto customer, @Param("loginUserId") Long loginUserId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.basic.pojo.CustomerUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * 客æ·å
±äº«Mapperæ¥å£ |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @date 2026-04-29 |
| | | */ |
| | | @Mapper |
| | | public interface CustomerUserMapper extends BaseMapper<CustomerUser> { |
| | | } |
| | |
| | | @Schema(description = "使ç¨ç¶æ") |
| | | private Long usageStatus; |
| | | |
| | | @Schema(description = "ç±»å 0 ç§æµ·å®¢æ· 1 å
¬æµ·å®¢æ·") |
| | | private Integer type; |
| | | |
| | | @Schema(description = "æ¯å¦è¢«åé
ï¼0-æªåé
ï¼1-å·²åé
") |
| | | private Integer isAssigned; |
| | | } |
| | |
| | | /** |
| | | * å
³èçç§æµ·id |
| | | */ |
| | | private Long customerPrivatePoolId; |
| | | private Long customerId; |
| | | |
| | | /** |
| | | * è·è¿æ¹å¼ |
| | |
| | | /** |
| | | * å
³è客æ·ID |
| | | */ |
| | | private Integer customerPrivatePoolId; |
| | | private Long customerId; |
| | | |
| | | /** |
| | | * æéå¼å
³ (0:å
³é, 1:å¼å¯) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @TableName(value = "customer_user") |
| | | @Data |
| | | public class CustomerUser implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 客æ·id |
| | | */ |
| | | private Long customerId; |
| | | |
| | | /** |
| | | * ç¨æ·id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * ç§æ·id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * å½å
¥æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.CustomerUser; |
| | | |
| | | /** |
| | | * 客æ·å
±äº«Serviceæ¥å£ |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @date 2026-04-29 |
| | | */ |
| | | public interface CustomerUserService extends IService<CustomerUser> { |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.dto.CustomerDto; |
| | | import com.ruoyi.basic.dto.CustomerPrivatePoolDto; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.basic.vo.CustomerVo; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param id å®¢æ·æ¡£æ¡ä¸»é® |
| | | * @return 客æ·è¯¦æ
DTO |
| | | */ |
| | | Customer selectCustomerDetailById(Long id); |
| | | CustomerVo selectCustomerDetailById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·æ¡£æ¡å表 |
| | |
| | | */ |
| | | List<Map<String, Object>> customerList(Customer customer); |
| | | |
| | | List<Customer> selectCustomerLists(Customer customer); |
| | | List<CustomerVo> selectCustomerLists(CustomerDto customer); |
| | | |
| | | AjaxResult importData(MultipartFile file); |
| | | R importData(MultipartFile file, Integer type); |
| | | |
| | | IPage<CustomerDto> selectCustomerList(Page<CustomerDto> page, CustomerDto customer); |
| | | IPage<CustomerVo> selectCustomerList(Page<CustomerDto> page, CustomerDto customer); |
| | | |
| | | void assignCustomer(CustomerDto customer); |
| | | |
| | | void recycleCustomer(CustomerDto customer); |
| | | |
| | | /** |
| | | * å
±äº«å®¢æ·ç»å
¶ä»ç¨æ· |
| | | * |
| | | * @param customerDto 客æ·DTOï¼å
å«å®¢æ·IDåå
±äº«ç¨æ·IDåè¡¨ï¼ |
| | | */ |
| | | void together(CustomerDto customerDto); |
| | | |
| | | Boolean back(Long id); |
| | | } |
| | |
| | | } |
| | | |
| | | List<CustomerFollowUp> followUps = list(new LambdaQueryWrapper<CustomerFollowUp>() |
| | | .eq(CustomerFollowUp::getCustomerPrivatePoolId, customerId)); |
| | | .eq(CustomerFollowUp::getCustomerId, customerId)); |
| | | |
| | | if (followUps != null && !followUps.isEmpty()) { |
| | | for (CustomerFollowUp followUp : followUps) { |
| | |
| | | throw new ServiceException("客æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | LambdaQueryWrapper<CustomerReturnVisit> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerPrivatePoolId, customerId); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerId, customerId); |
| | | CustomerReturnVisit returnVisit = baseMapper.selectOne(queryWrapper); |
| | | |
| | | if (returnVisit == null) { |
| | |
| | | throw new ServiceException("客æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | LambdaQueryWrapper<CustomerReturnVisit> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerPrivatePoolId, customerId); |
| | | queryWrapper.eq(CustomerReturnVisit::getCustomerId, customerId); |
| | | List<CustomerReturnVisit> returnVisits = baseMapper.selectList(queryWrapper); |
| | | |
| | | for (CustomerReturnVisit returnVisit : returnVisits) { |
| | |
| | | if (returnVisit == null) { |
| | | throw new ServiceException("å访æéæ°æ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (returnVisit.getCustomerPrivatePoolId() == null) { |
| | | if (returnVisit.getCustomerId() == null) { |
| | | throw new ServiceException("客æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | if (returnVisit.getReminderTime() == null) { |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.CustomerDto; |
| | | import com.ruoyi.basic.dto.CustomerFollowUpDto; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.pojo.CustomerFollowUp; |
| | | import com.ruoyi.basic.pojo.CustomerPrivatePool; |
| | | import com.ruoyi.basic.service.CustomerFollowUpService; |
| | | import com.ruoyi.basic.service.CustomerReturnVisitService; |
| | | import com.ruoyi.basic.service.ICustomerService; |
| | | import com.ruoyi.basic.pojo.CustomerFollowUpFile; |
| | | import com.ruoyi.basic.pojo.CustomerUser; |
| | | import com.ruoyi.basic.service.*; |
| | | import com.ruoyi.basic.vo.CustomerVo; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | * @date 2025-05-07 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | | public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService { |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | private final CustomerPrivatePoolMapper customerPrivatePoolMapper; |
| | | private final CustomerMapper customerMapper; |
| | | @Autowired |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | @Autowired |
| | | private CustomerMapper customerMapper; |
| | | |
| | | private final CustomerFollowUpService customerFollowUpService; |
| | | private final CustomerReturnVisitService customerReturnVisitService; |
| | | @Autowired |
| | | private CustomerFollowUpService customerFollowUpService; |
| | | @Autowired |
| | | private CustomerFollowUpFileService customerFollowUpFileService; |
| | | @Autowired |
| | | private CustomerReturnVisitService customerReturnVisitService; |
| | | @Autowired |
| | | private CustomerUserService customerUserService; |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·æ¡£æ¡ |
| | |
| | | * @return 客æ·è¯¦æ
DTO |
| | | */ |
| | | @Override |
| | | public Customer selectCustomerDetailById(Long id) { |
| | | return this.getById( id); |
| | | public CustomerVo selectCustomerDetailById(Long id) { |
| | | CustomerVo customerVo = new CustomerVo(); |
| | | BeanUtils.copyProperties(this.getById(id), customerVo); |
| | | |
| | | // æ¥è¯¢è·è¿è®°å½ |
| | | List<CustomerFollowUp> followUpList = customerFollowUpService.list( |
| | | new LambdaQueryWrapper<CustomerFollowUp>() |
| | | .eq(CustomerFollowUp::getCustomerId, id) |
| | | .orderByDesc(CustomerFollowUp::getFollowUpTime) |
| | | ); |
| | | if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(followUpList)) { |
| | | List<CustomerFollowUpDto> followUpDtoList = followUpList.stream().map(followUp -> { |
| | | CustomerFollowUpDto followUpDto = new CustomerFollowUpDto(); |
| | | BeanUtils.copyProperties(followUp, followUpDto); |
| | | |
| | | // æ¥è¯¢éä»¶ |
| | | List<CustomerFollowUpFile> fileList = customerFollowUpFileService.list( |
| | | new LambdaQueryWrapper<CustomerFollowUpFile>() |
| | | .eq(CustomerFollowUpFile::getFollowUpId, followUp.getId()) |
| | | ); |
| | | followUpDto.setFileList(fileList); |
| | | |
| | | return followUpDto; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | customerVo.setFollowUpList(followUpDtoList); |
| | | } |
| | | |
| | | return customerVo; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return å®¢æ·æ¡£æ¡ |
| | | */ |
| | | @Override |
| | | public IPage<CustomerDto> selectCustomerList(Page<CustomerDto> page, CustomerDto customer) { |
| | | IPage<CustomerDto> customerPage = customerMapper.listPage(page, customer); |
| | | public IPage<CustomerVo> selectCustomerList(Page<CustomerDto> page, CustomerDto customer) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long loginUserId = loginUser.getUserId(); |
| | | IPage<CustomerVo> customerPage = customerMapper.listPage(page, customer, loginUserId); |
| | | |
| | | List<CustomerDto> records = customerPage.getRecords(); |
| | | List<CustomerVo> records = customerPage.getRecords(); |
| | | if (CollectionUtils.isEmpty(records)) { |
| | | return customerPage; |
| | | } |
| | | |
| | | List<Long> customerIds = records.stream() |
| | | .map(CustomerDto::getId) |
| | | .map(CustomerVo::getId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | |
| | |
| | | followUp.getFollowUpTime().atZone(ZoneId.systemDefault()).toInstant() |
| | | )); |
| | | } |
| | | |
| | | // 转æ¢å
±äº«ç¨æ·IDå符串为List<Long> |
| | | String userIdsStr = c.getUserIdsStr(); |
| | | if (StringUtils.isNotEmpty(userIdsStr)) { |
| | | List<Long> userIds = Arrays.stream(userIdsStr.split(",")) |
| | | .map(String::trim) |
| | | .map(Long::parseLong) |
| | | .collect(Collectors.toList()); |
| | | c.setUserIds(userIds); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | private Map<Long, CustomerFollowUp> getLatestFollowUpMap(List<Long> customerIds) { |
| | | List<CustomerFollowUp> followUps = customerFollowUpService.list( |
| | | new LambdaQueryWrapper<CustomerFollowUp>() |
| | | .in(CustomerFollowUp::getCustomerPrivatePoolId, customerIds) |
| | | .in(CustomerFollowUp::getCustomerId, customerIds) |
| | | .orderByDesc(CustomerFollowUp::getFollowUpTime) |
| | | ); |
| | | |
| | | return followUps.stream() |
| | | .collect(Collectors.toMap( |
| | | CustomerFollowUp::getCustomerPrivatePoolId, |
| | | CustomerFollowUp::getCustomerId, |
| | | followUp -> followUp, |
| | | (existing, replacement) -> existing |
| | | )); |
| | |
| | | if (!salesLedgers.isEmpty()) { |
| | | throw new RuntimeException("å®¢æ·æ¡£æ¡ä¸æéå®ååï¼è¯·å
å é¤éå®åå"); |
| | | } |
| | | List<CustomerPrivatePool> customerPrivatePools = customerPrivatePoolMapper.selectList(new QueryWrapper<CustomerPrivatePool>().lambda().in(CustomerPrivatePool::getCustomerId, idList)); |
| | | if (!customerPrivatePools.isEmpty()) { |
| | | throw new RuntimeException("å®¢æ·æ¡£æ¡ä¸æå®¢æ·ç§æµ·ï¼è¯·å
æ¶åç§æµ·æ°æ®"); |
| | | // æ¥è¯¢æ¯å¦æå·²åé
çå
¬æµ·å®¢æ· |
| | | List<Customer> assignedPools = customerMapper.selectList( |
| | | new QueryWrapper<Customer>().lambda() |
| | | .in(Customer::getId, idList) |
| | | .eq(Customer::getType, 1). |
| | | eq(Customer::getIsAssigned, 1) // å
¬æµ·å®¢æ· |
| | | ); |
| | | if (!assignedPools.isEmpty()) { |
| | | throw new RuntimeException("å®¢æ·æ¡£æ¡ä¸æå·²åé
çå
¬æµ·å®¢æ·ï¼è¯·å
æ¶å"); |
| | | } |
| | | // å é¤å®¢æ·çåæ¶ä¹éè¦å é¤å¯¹åºç客æ·è·éãéä»¶åå访æé |
| | | // å é¤å®¢æ·çåæ¶ä¹éè¦å é¤å¯¹åºç客æ·è·éãéä»¶åå访æé |
| | | for (Long id : ids) { |
| | | customerFollowUpService.deleteByCustomerId(id); |
| | | customerReturnVisitService.deleteByCustomerId(id); |
| | | // å é¤å®¢æ·çå
±äº«å
³ç³» |
| | | customerUserService.remove( |
| | | new QueryWrapper<CustomerUser>().lambda() |
| | | .eq(CustomerUser::getCustomerId, id) |
| | | ); |
| | | } |
| | | |
| | | // å é¤å®¢æ·ä¸»è¡¨æ°æ® |
| | | return customerMapper.deleteBatchIds(idList); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Customer> selectCustomerLists(Customer customer) { |
| | | return customerMapper.selectList(null); |
| | | public List<CustomerVo> selectCustomerLists(CustomerDto customer) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long loginUserId = loginUser.getUserId(); |
| | | return customerMapper.list(customer, loginUserId); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult importData(MultipartFile file) { |
| | | public R importData(MultipartFile file, Integer type) { |
| | | try { |
| | | ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class); |
| | | List<Customer> userList = util.importExcel(file.getInputStream()); |
| | | if (CollectionUtils.isEmpty(userList)) { |
| | | return AjaxResult.warn("模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | return R.fail("模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | } |
| | | |
| | | // æ ¹æ® type åæ°è®¾ç½®å®¢æ·ç±»åï¼ç§æµ·/å
¬æµ·ï¼ |
| | | if (type != null) { |
| | | userList.forEach(customer -> { |
| | | customer.setType(type); |
| | | }); |
| | | } |
| | | this.saveOrUpdateBatch(userList); |
| | | return AjaxResult.success(true); |
| | | return R.ok(true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | return R.fail("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | |
| | | ).collect(Collectors.toList()); |
| | | } |
| | | |
| | | // åé
å
¬æµ·å®¢æ·ç»ç§æµ· |
| | | @Override |
| | | public void assignCustomer(CustomerDto customerDto) { |
| | | Customer customer = customerMapper.selectById(customerDto.getId()); |
| | | if (customer.getType() == 1 && customer.getIsAssigned() == 0) { // å
¬æµ·ä¸å¯åé
|
| | | customer.setIsAssigned(1); |
| | | customer.setUsageStatus(1L); |
| | | customer.setUsageUser(customerDto.getUsageUser()); |
| | | customerMapper.updateById(customer); |
| | | } |
| | | } |
| | | |
| | | // åæ¶ç§æµ·å®¢æ·å°å
¬æµ· |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void recycleCustomer(CustomerDto customerDto) { |
| | | Customer customer = customerMapper.selectById(customerDto.getId()); |
| | | if (customer.getType() == 1 && customer.getIsAssigned() == 1) { // å
¬æµ·ä¸å·²åé
|
| | | customer.setIsAssigned(0); |
| | | customer.setUsageStatus(0L); |
| | | customer.setUsageUser(0L); |
| | | customerMapper.updateById(customer); |
| | | |
| | | // å é¤è¯¥å®¢æ·çææå
±äº«å
³ç³» |
| | | customerUserService.remove( |
| | | new QueryWrapper<CustomerUser>().lambda() |
| | | .eq(CustomerUser::getCustomerId, customerDto.getId()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | // 客æ·å
񄧮 |
| | | @Override |
| | | public void together(CustomerDto customerDto) { |
| | | // æ¥è¯¢ç°æçå
±äº«è®°å½ |
| | | List<CustomerUser> existingUsers = customerUserService.list( |
| | | new QueryWrapper<CustomerUser>().lambda().eq(CustomerUser::getCustomerId, customerDto.getId()) |
| | | ); |
| | | |
| | | // è·åå·²åå¨çç¨æ·IDå表 |
| | | List<Long> existingUserIds = existingUsers.stream() |
| | | .map(CustomerUser::getUserId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // è¿æ»¤æå·²åå¨çç¨æ·ï¼åªä¿çæ°ç¨æ· |
| | | List<Long> newUserIds = customerDto.getUserIds().stream() |
| | | .filter(userId -> !existingUserIds.contains(userId)) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if (CollectionUtils.isEmpty(newUserIds)) { |
| | | return; |
| | | } |
| | | |
| | | // è·åå½åç§æ·ID |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long tenantId = loginUser.getTenantId(); |
| | | |
| | | // æ¹éä¿åæ°çå
±äº«è®°å½ |
| | | List<CustomerUser> customerUsers = newUserIds.stream() |
| | | .map(userId -> { |
| | | CustomerUser customerUser = new CustomerUser(); |
| | | customerUser.setCustomerId(customerDto.getId()); |
| | | customerUser.setUserId(userId); |
| | | customerUser.setTenantId(tenantId); |
| | | return customerUser; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | customerUserService.saveBatch(customerUsers); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean back(Long id) { |
| | | //å°å®¢æ·çtypeæ¹ä¸º1 ä¸ç´æ¥åé
ç»å½åç¨æ· |
| | | Customer customer = customerMapper.selectById(id); |
| | | customer.setType(1); |
| | | customer.setIsAssigned(1); |
| | | return this.updateById(customer); |
| | | } |
| | | |
| | | /** |
| | | * ä¸å线å½å转驼峰å½å |
| | | */ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.ruoyi.basic.mapper.CustomerUserMapper; |
| | | import com.ruoyi.basic.pojo.CustomerUser; |
| | | import com.ruoyi.basic.service.CustomerUserService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 客æ·å
±äº«Serviceå®ç°ç±» |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @date 2026-04-29 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class CustomerUserServiceImpl extends ServiceImpl<CustomerUserMapper, CustomerUser> implements CustomerUserService { |
| | | } |
| | |
| | | } |
| | | |
| | | try { |
| | | unipushService.sendReturnVisitReminder(returnVisitId, client.getCid(), returnVisit.getContent(), returnVisit.getCustomerPrivatePoolId()); |
| | | unipushService.sendReturnVisitReminder(returnVisitId, client.getCid(), returnVisit.getContent(), returnVisit.getCustomerId()); |
| | | CustomerReturnVisit updateObj = new CustomerReturnVisit(); |
| | | updateObj.setId(returnVisitId); |
| | | updateObj.setIsCompleted(1); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.vo; |
| | | |
| | | import com.ruoyi.basic.dto.CustomerFollowUpDto; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CustomerVo extends Customer { |
| | | @ApiModelProperty(value = "è·è¿è®°å½") |
| | | private List<CustomerFollowUpDto> followUpList; |
| | | |
| | | private String usageUserName; |
| | | |
| | | private String togetherUserNames; |
| | | |
| | | /** |
| | | * å
±äº«ç¨æ·IDå表 |
| | | */ |
| | | private List<Long> userIds; |
| | | |
| | | /** |
| | | * å
±äº«ç¨æ·IDå符串ï¼SQLæ¥è¯¢è¿åï¼ç¨äºè½¬æ¢ä¸ºListï¼ |
| | | */ |
| | | private String userIdsStr; |
| | | } |
| | |
| | | stockUninventoryDto.setRecordType(String.valueOf(recordType)); |
| | | stockUninventoryDto.setQualitity(quantity); |
| | | stockUninventoryDto.setProductModelId(productModelId); |
| | | stockUninventoryService.addStockUninventory(stockUninventoryDto); |
| | | stockUninventoryService.addStockInRecordOnly(stockUninventoryDto); |
| | | } |
| | | |
| | | /** |
| | |
| | | stockInventoryDto.setRecordType(String.valueOf(recordType)); |
| | | stockInventoryDto.setQualitity(quantity); |
| | | stockInventoryDto.setProductModelId(productModelId); |
| | | stockInventoryService.addstockInventory(stockInventoryDto); |
| | | stockInventoryService.addStockInRecordOnly(stockInventoryDto); |
| | | } |
| | | |
| | | /** |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | |
| | | |
| | | @Schema(description = "宿è¿åº¦") |
| | | private BigDecimal completionStatus; |
| | | |
| | | @Schema(description = "订åå·") |
| | | private String npsNo; |
| | | |
| | | @Schema(description = "å¼å§æ¥æ") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | |
| | | @Schema(description = "ç»ææ¥æ") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | } |
| | |
| | | @Schema(description = "å·¥åç±»å æ£å¸¸/è¿å·¥è¿ä¿®") |
| | | private String workOrderType; |
| | | |
| | | @Schema(description = "çäº§ä»»å¡æ°") |
| | | private Long productionTaskCount; |
| | | |
| | | @Schema(description = "è¯åæ°") |
| | | private BigDecimal goodQuantity; |
| | | |
| | | @Schema(description = "æ¥åºæ°é") |
| | | private BigDecimal scrapQty; |
| | | |
| | | @Schema(description = "宿è¿åº¦") |
| | | private BigDecimal completionStatus; |
| | | |
| | |
| | | |
| | | @Schema(description = "宿è¿åº¦") |
| | | private BigDecimal completionStatus; |
| | | |
| | | @Schema(description = "æ¯å¦å·²éæ") |
| | | private Boolean returned; |
| | | } |
| | |
| | | package com.ruoyi.production.bean.vo; |
| | | |
| | | import com.ruoyi.production.pojo.ProductionOperationTask; |
| | | import com.ruoyi.production.pojo.ProductionOrderRoutingOperationParam; |
| | | import com.ruoyi.production.pojo.ProductionProductMain; |
| | | import com.ruoyi.production.pojo.ProductionProductOutput; |
| | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Schema(name = "ProductionOrderWorkOrderDetailVo", description = "Production order work order/report/inspect detail") |
| | | @Schema(name = "ProductionOrderWorkOrderDetailVo", description = "ç产追溯è¿å对象") |
| | | public class ProductionOrderWorkOrderDetailVo { |
| | | |
| | | @Schema(description = "Production order info") |
| | | @Schema(description = "订å") |
| | | private ProductionOrderVo productionOrder; |
| | | |
| | | @Schema(description = "Work order list") |
| | | @Schema(description = "å·¥åæç»å表") |
| | | private List<WorkOrderDetail> workOrderList; |
| | | |
| | | @Data |
| | | @Schema(name = "WorkOrderDetail", description = "Work order detail") |
| | | @Schema(name = "WorkOrderDetail", description = "å·¥åæç»") |
| | | public static class WorkOrderDetail { |
| | | |
| | | @Schema(description = "Work order info") |
| | | private ProductionOperationTask workOrder; |
| | | @Schema(description = "å·¥åä¿¡æ¯") |
| | | private ProductionOperationTaskVo workOrder; |
| | | |
| | | @Schema(description = "Report list under current work order") |
| | | @Schema(description = "æ¥å·¥è¯¦æ
å表") |
| | | private List<ReportDetail> reportList; |
| | | } |
| | | |
| | | @Data |
| | | @Schema(name = "ReportDetail", description = "Production report detail") |
| | | public static class ReportDetail { |
| | | |
| | | @Schema(description = "Report main info") |
| | | private ProductionProductMain reportMain; |
| | | |
| | | @Schema(description = "Report output list") |
| | | private List<ProductionProductOutput> reportOutputList; |
| | | |
| | | @Schema(description = "Report process param list") |
| | | private List<ProductionOrderRoutingOperationParam> reportParamList; |
| | | |
| | | @Schema(description = "Inspect list under current report") |
| | | @Schema(description = "è´¨æ£è¯¦æ
å表") |
| | | private List<InspectDetail> inspectList; |
| | | } |
| | | |
| | | @Data |
| | | @Schema(name = "InspectDetail", description = "Quality inspect detail") |
| | | @Schema(name = "ReportDetail", description = "æ¥å·¥è¯¦æ
") |
| | | public static class ReportDetail { |
| | | |
| | | @Schema(description = "æ¥å·¥ä¸»ä¿¡æ¯") |
| | | private ProductionProductMain reportMain; |
| | | |
| | | @Schema(description = "æ¥å·¥äº§åºæç»") |
| | | private List<ProductionProductOutput> reportOutputList; |
| | | |
| | | @Schema(description = "æ¥å·¥å·¥åºåæ°") |
| | | private List<ProductionOrderRoutingOperationParam> reportParamList; |
| | | } |
| | | |
| | | @Data |
| | | @Schema(name = "InspectDetail", description = "è´¨æ£è¯¦æ
") |
| | | public static class InspectDetail { |
| | | |
| | | @Schema(description = "Inspect main info") |
| | | @Schema(description = "æ¥å·¥ID") |
| | | private Long reportId; |
| | | |
| | | @Schema(description = "æ¥å·¥åå·") |
| | | private String reportNo; |
| | | |
| | | @Schema(description = "æ¥å·¥ä¸»ä¿¡æ¯") |
| | | private ProductionProductMain reportMain; |
| | | |
| | | @Schema(description = "è´¨æ£ä¸»ä¿¡æ¯") |
| | | private QualityInspect inspect; |
| | | |
| | | @Schema(description = "Inspect param list") |
| | | @Schema(description = "è´¨æ£ææ æç»") |
| | | private List<QualityInspectParam> inspectParamList; |
| | | |
| | | @Schema(description = "Inspect attachment list") |
| | | @Schema(description = "è´¨æ£éä»¶å表") |
| | | private List<QualityInspectFile> inspectFileList; |
| | | } |
| | | } |
| | |
| | | return R.ok(productionOperationTaskService.assign(dto)); |
| | | } |
| | | |
| | | /** |
| | | * å·¥åæµè½¬å¡ä¸è½½ |
| | | * @param response |
| | | * @param dto |
| | | */ |
| | | @PostMapping("/down") |
| | | @Operation(summary = "å·¥åæµè½¬å¡ä¸è½½") |
| | | public void down(HttpServletResponse response, @RequestBody ProductionOperationTaskDto dto) { |
| | | productionOperationTaskService.down(response, dto); |
| | | } |
| | | |
| | | @GetMapping("/getOperation") |
| | | @Operation(summary = "å·¥åºè¯¦æ
æ¥è¯¢") |
| | | public R<List<ProductionOperationTaskVo>> getOperation(ProductionOperationTaskDto dto) { |
| | | return R.ok(productionOperationTaskService.getOperation(dto)); |
| | | } |
| | | |
| | | } |
| | |
| | | return R.ok(productionOrderService.pick(productionOrderId)); |
| | | } |
| | | |
| | | @GetMapping("/workOrder/detail/{productionOrderId}") |
| | | @Operation(summary = "Query work orders/reports/inspects by production order id") |
| | | public R<ProductionOrderWorkOrderDetailVo> getWorkOrderReportInspectDetail(@PathVariable Long productionOrderId) { |
| | | return R.ok(productionOrderService.getWorkOrderReportInspectDetail(productionOrderId)); |
| | | @GetMapping("/ordeDetail") |
| | | @Operation(summary = "ç产追溯") |
| | | public R<ProductionOrderWorkOrderDetailVo> getWorkOrderReportInspectDetail(ProductionOrderDto productionOrderDto) { |
| | | return R.ok(productionOrderService.getWorkOrderReportInspectDetail(productionOrderDto)); |
| | | } |
| | | |
| | | @Operation(summary = "æ´æ°è®¢åç¶æ") |
| | |
| | | @Param("processIds") List<Long> processIds); |
| | | |
| | | ProductionOperationTaskDto getProductWorkOrderFlowCard(@Param("id") Long id); |
| | | |
| | | List<ProductionOperationTaskVo> getOperation(@Param("c") ProductionOperationTaskDto dto); |
| | | } |
| | |
| | | boolean assign(ProductionOperationTaskDto dto); |
| | | |
| | | void down(HttpServletResponse response, ProductionOperationTaskDto dto); |
| | | |
| | | List<ProductionOperationTaskVo> getOperation(ProductionOperationTaskDto dto); |
| | | } |
| | |
| | | |
| | | List<ProductionOrderPickVo> pick(Long productionOrderId); |
| | | |
| | | ProductionOrderWorkOrderDetailVo getWorkOrderReportInspectDetail(Long productionOrderId); |
| | | ProductionOrderWorkOrderDetailVo getWorkOrderReportInspectDetail(ProductionOrderDto productionOrderDto); |
| | | |
| | | int updateOrder(ProductionOrderDto productionOrderDto); |
| | | } |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductionOperationTaskVo> getOperation(ProductionOperationTaskDto dto) { |
| | | return baseMapper.getOperation(dto); |
| | | } |
| | | } |
| | |
| | | if (dto.getProductModelId() == null) { |
| | | throw new ServiceException("第" + rowNo + "æ¡äº§åè§æ ¼IDä¸è½ä¸ºç©º"); |
| | | } |
| | | if (dto.getPickQuantity() == null || dto.getPickQuantity().compareTo(BigDecimal.ZERO) <= 0) { |
| | | throw new ServiceException("第" + rowNo + "æ¡é¢ææ°éå¿
须大äº0"); |
| | | if (dto.getPickQuantity() == null || dto.getPickQuantity().compareTo(BigDecimal.ZERO) < 0) { |
| | | throw new ServiceException("第" + rowNo + "æ¡é¢ææ°éä¸è½å°äº0"); |
| | | } |
| | | if (dto.getPickType() != null && dto.getPickType() != PICK_TYPE_NORMAL && dto.getPickType() != PICK_TYPE_FEEDING) { |
| | | throw new ServiceException("第" + rowNo + "æ¡é¢æç±»ååªè½æ¯1æ2"); |
| | |
| | | if (dto.getId() == null) { |
| | | throw new ServiceException("第" + rowNo + "æ¡é¢æIDä¸è½ä¸ºç©º"); |
| | | } |
| | | if (dto.getFeedingQuantity() == null || dto.getFeedingQuantity().compareTo(BigDecimal.ZERO) <= 0) { |
| | | throw new ServiceException("第" + rowNo + "æ¡æ¬æ¬¡è¡¥ææ°éå¿
须大äº0"); |
| | | if (dto.getFeedingQuantity() == null || dto.getFeedingQuantity().compareTo(BigDecimal.ZERO) < 0) { |
| | | throw new ServiceException("第" + rowNo + "æ¡æ¬æ¬¡è¡¥ææ°éä¸è½å°äº0"); |
| | | } |
| | | if (!isFeedingPick(dto)) { |
| | | throw new ServiceException("第" + rowNo + "æ¡è¡¥æç±»åå¿
须为2"); |
| | |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.common.constant.StorageAttachmentConstants; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.production.bean.dto.ProductionOperationTaskDto; |
| | | import com.ruoyi.production.bean.dto.ProductionOrderDto; |
| | | import com.ruoyi.production.bean.vo.ProductionBomStructureVo; |
| | | import com.ruoyi.production.bean.vo.ProductionOperationTaskVo; |
| | | import com.ruoyi.production.bean.vo.ProductionOrderPickVo; |
| | | import com.ruoyi.production.bean.vo.ProductionOrderVo; |
| | | import com.ruoyi.production.bean.vo.ProductionPlanVo; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ProductionOrderWorkOrderDetailVo getWorkOrderReportInspectDetail(Long productionOrderId) { |
| | | if (productionOrderId == null) { |
| | | throw new ServiceException("productionOrderId can not be null"); |
| | | } |
| | | public ProductionOrderWorkOrderDetailVo getWorkOrderReportInspectDetail(ProductionOrderDto dto) { |
| | | Long productionOrderId = resolveProductionOrderId(dto); |
| | | ProductionOrderVo orderInfo = getProductionOrderInfo(productionOrderId); |
| | | if (orderInfo == null) { |
| | | throw new ServiceException("production order not found"); |
| | | throw new ServiceException("ç产订åä¸åå¨"); |
| | | } |
| | | |
| | | ProductionOrderWorkOrderDetailVo detailVo = new ProductionOrderWorkOrderDetailVo(); |
| | | detailVo.setProductionOrder(orderInfo); |
| | | |
| | | List<ProductionOperationTask> workOrderList = productionOperationTaskMapper.selectList( |
| | | Wrappers.<ProductionOperationTask>lambdaQuery() |
| | | .eq(ProductionOperationTask::getProductionOrderId, productionOrderId) |
| | | .orderByAsc(ProductionOperationTask::getId)); |
| | | ProductionOperationTaskDto taskQuery = new ProductionOperationTaskDto(); |
| | | taskQuery.setProductionOrderId(productionOrderId); |
| | | IPage<ProductionOperationTaskVo> workOrderPage = productionOperationTaskMapper.pageProductionOperationTask( |
| | | new Page<ProductionOperationTaskVo>(1, -1), taskQuery); |
| | | List<ProductionOperationTaskVo> workOrderList = workOrderPage == null || workOrderPage.getRecords() == null |
| | | ? Collections.emptyList() |
| | | : workOrderPage.getRecords().stream() |
| | | .filter(Objects::nonNull) |
| | | .sorted(Comparator.comparing(ProductionOperationTaskVo::getId, Comparator.nullsLast(Comparator.naturalOrder()))) |
| | | .collect(Collectors.toList()); |
| | | if (workOrderList == null || workOrderList.isEmpty()) { |
| | | detailVo.setWorkOrderList(Collections.emptyList()); |
| | | return detailVo; |
| | | } |
| | | |
| | | List<Long> workOrderIdList = workOrderList.stream() |
| | | .map(ProductionOperationTask::getId) |
| | | .map(ProductionOperationTaskVo::getId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | List<ProductionProductMain> reportMainList = workOrderIdList.isEmpty() |
| | |
| | | Wrappers.<ProductionProductMain>lambdaQuery() |
| | | .in(ProductionProductMain::getProductionOperationTaskId, workOrderIdList) |
| | | .orderByAsc(ProductionProductMain::getId)); |
| | | Map<Long, List<ProductionProductMain>> reportMainMap = new LinkedHashMap<>(); |
| | | Map<Long, List<ProductionProductMain>> reportMainByWorkOrderMap = new LinkedHashMap<>(); |
| | | for (ProductionProductMain reportMain : reportMainList) { |
| | | if (reportMain == null || reportMain.getProductionOperationTaskId() == null) { |
| | | continue; |
| | | } |
| | | reportMainMap.computeIfAbsent(reportMain.getProductionOperationTaskId(), k -> new ArrayList<>()).add(reportMain); |
| | | reportMainByWorkOrderMap.computeIfAbsent(reportMain.getProductionOperationTaskId(), key -> new ArrayList<>()).add(reportMain); |
| | | } |
| | | |
| | | List<Long> reportMainIdList = reportMainList.stream() |
| | |
| | | if (inspect == null || inspect.getProductMainId() == null) { |
| | | continue; |
| | | } |
| | | inspectMap.computeIfAbsent(inspect.getProductMainId(), k -> new ArrayList<>()).add(inspect); |
| | | inspectMap.computeIfAbsent(inspect.getProductMainId(), key -> new ArrayList<>()).add(inspect); |
| | | } |
| | | |
| | | List<Long> inspectIdList = inspectList.stream() |
| | |
| | | } |
| | | |
| | | List<ProductionOrderWorkOrderDetailVo.WorkOrderDetail> workOrderDetailList = new ArrayList<>(); |
| | | for (ProductionOperationTask workOrder : workOrderList) { |
| | | for (ProductionOperationTaskVo workOrder : workOrderList) { |
| | | ProductionOrderWorkOrderDetailVo.WorkOrderDetail workOrderDetail = new ProductionOrderWorkOrderDetailVo.WorkOrderDetail(); |
| | | workOrderDetail.setWorkOrder(workOrder); |
| | | |
| | | List<ProductionProductMain> workOrderReportMainList = reportMainMap.get(workOrder.getId()); |
| | | if (workOrderReportMainList == null || workOrderReportMainList.isEmpty()) { |
| | | List<ProductionProductMain> workOrderReportMainList = reportMainByWorkOrderMap.getOrDefault(workOrder.getId(), Collections.emptyList()); |
| | | if (workOrderReportMainList.isEmpty()) { |
| | | workOrderDetail.setReportList(Collections.emptyList()); |
| | | workOrderDetail.setInspectList(Collections.emptyList()); |
| | | workOrderDetailList.add(workOrderDetail); |
| | | continue; |
| | | } |
| | | |
| | | List<ProductionOrderWorkOrderDetailVo.ReportDetail> reportDetailList = new ArrayList<>(); |
| | | List<ProductionOrderWorkOrderDetailVo.InspectDetail> inspectDetailList = new ArrayList<>(); |
| | | for (ProductionProductMain reportMain : workOrderReportMainList) { |
| | | Long reportMainId = reportMain.getId(); |
| | | |
| | | ProductionOrderWorkOrderDetailVo.ReportDetail reportDetail = new ProductionOrderWorkOrderDetailVo.ReportDetail(); |
| | | reportDetail.setReportMain(reportMain); |
| | | reportDetail.setReportOutputList(reportOutputMap.getOrDefault(reportMainId, Collections.emptyList())); |
| | | reportDetail.setReportParamList(reportParamMap.getOrDefault(reportMainId, Collections.emptyList())); |
| | | |
| | | List<QualityInspect> reportInspectList = inspectMap.get(reportMainId); |
| | | if (reportInspectList == null || reportInspectList.isEmpty()) { |
| | | reportDetail.setInspectList(Collections.emptyList()); |
| | | } else { |
| | | List<ProductionOrderWorkOrderDetailVo.InspectDetail> inspectDetailList = new ArrayList<>(); |
| | | for (QualityInspect inspect : reportInspectList) { |
| | | ProductionOrderWorkOrderDetailVo.InspectDetail inspectDetail = new ProductionOrderWorkOrderDetailVo.InspectDetail(); |
| | | inspectDetail.setInspect(inspect); |
| | | inspectDetail.setInspectParamList(inspectParamMap.getOrDefault(inspect.getId(), Collections.emptyList())); |
| | | inspectDetail.setInspectFileList(inspectFileMap.getOrDefault(inspect.getId(), Collections.emptyList())); |
| | | inspectDetailList.add(inspectDetail); |
| | | } |
| | | reportDetail.setInspectList(inspectDetailList); |
| | | } |
| | | reportDetailList.add(reportDetail); |
| | | |
| | | List<QualityInspect> reportInspectList = inspectMap.getOrDefault(reportMainId, Collections.emptyList()); |
| | | for (QualityInspect inspect : reportInspectList) { |
| | | ProductionOrderWorkOrderDetailVo.InspectDetail inspectDetail = new ProductionOrderWorkOrderDetailVo.InspectDetail(); |
| | | inspectDetail.setReportId(reportMainId); |
| | | inspectDetail.setReportNo(reportMain.getProductNo()); |
| | | inspectDetail.setReportMain(reportMain); |
| | | inspectDetail.setInspect(inspect); |
| | | inspectDetail.setInspectParamList(inspectParamMap.getOrDefault(inspect.getId(), Collections.emptyList())); |
| | | inspectDetail.setInspectFileList(inspectFileMap.getOrDefault(inspect.getId(), Collections.emptyList())); |
| | | inspectDetailList.add(inspectDetail); |
| | | } |
| | | } |
| | | |
| | | workOrderDetail.setReportList(reportDetailList); |
| | | workOrderDetail.setInspectList(inspectDetailList); |
| | | workOrderDetailList.add(workOrderDetail); |
| | | } |
| | | |
| | |
| | | return detailVo; |
| | | } |
| | | |
| | | private Long resolveProductionOrderId(ProductionOrderDto dto) { |
| | | if (dto == null) { |
| | | throw new ServiceException("è¯·ä¼ å
¥ç产订åIDæç产订åå·"); |
| | | } |
| | | if (dto.getId() != null) { |
| | | return dto.getId(); |
| | | } |
| | | if (dto.getNpsNo() == null || dto.getNpsNo().trim().isEmpty()) { |
| | | throw new ServiceException("è¯·ä¼ å
¥ç产订åIDæç产订åå·"); |
| | | } |
| | | ProductionOrder productionOrder = baseMapper.selectOne( |
| | | Wrappers.<ProductionOrder>lambdaQuery() |
| | | .eq(ProductionOrder::getNpsNo, dto.getNpsNo().trim()) |
| | | .last("limit 1")); |
| | | if (productionOrder == null || productionOrder.getId() == null) { |
| | | throw new ServiceException("ç产订åä¸åå¨"); |
| | | } |
| | | return productionOrder.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductionOrderPickVo> pick(Long productionOrderId) { |
| | | if (productionOrderId == null) { |
| | |
| | | /** |
| | | * åéå访æé |
| | | */ |
| | | public void sendReturnVisitReminder(Long returnVisitId, String cid, String content, Integer customerId) { |
| | | public void sendReturnVisitReminder(Long returnVisitId, String cid, String content, Long customerId) { |
| | | String targetPath = "pages/cooperativeOffice/customerManage/detail?customerId=" + customerId; |
| | | sendRoutingPush(returnVisitId, cid, "客æ·å访æé", content, targetPath, false); |
| | | } |
| | |
| | | */ |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | /** |
| | | * æ¯å¦ç½åå |
| | | */ |
| | | @Excel(name = "æ¯å¦ç½åå") |
| | | private Integer isWhite; |
| | | // /** |
| | | // * æ¯å¦ç½åå |
| | | // */ |
| | | // @Excel(name = "æ¯å¦ç½åå") |
| | | // private Integer isWhite; |
| | | |
| | | /** |
| | | * å½å
¥äººå§åid |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addOrEditPurchase(PurchaseLedgerDto purchaseLedgerDto) throws Exception { |
| | | PurchaseLedger purchaseLedger = new PurchaseLedger(); |
| | | // DTO转Entity |
| | | BeanUtils.copyProperties(purchaseLedgerDto, purchaseLedger); |
| | | SalesLedger salesLedger = salesLedgerMapper.selectById(purchaseLedgerDto.getSalesLedgerId()); |
| | | //å½å
¥äºº |
| | | SysUser sysUser = userMapper.selectUserById(purchaseLedgerDto.getRecorderId()); |
| | |
| | | |
| | | SupplierManage supplierManage = supplierManageMapper.selectById(purchaseLedgerDto.getSupplierId()); |
| | | |
| | | // DTO转Entity |
| | | |
| | | BeanUtils.copyProperties(purchaseLedgerDto, purchaseLedger); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | if (ObjectUtils.isNotEmpty(loginUser) && null != loginUser.getTenantId()) { |
| | | purchaseLedger.setTenantId(loginUser.getTenantId()); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.approve.bean.vo.ApproveProcessVO; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.service.ShippingInfoService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | public AjaxResult getByCustomerName(String customerName) { |
| | | return AjaxResult.success(shippingInfoService.getShippingInfoByCustomerName(customerName)); |
| | | } |
| | | |
| | | @GetMapping("/getDateil/{id}") |
| | | public R getDateil(@PathVariable("id") Long id) { |
| | | return R.ok(shippingInfoService.getDetail(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.ruoyi.sales.pojo.ShippingProductDetail; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ShippingProductDetailDto extends ShippingProductDetail { |
| | | |
| | | private String specificationModel; |
| | | |
| | | private String productName; |
| | | |
| | | private BigDecimal deliveryQuantity; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.procurementrecord.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.pojo.ShippingProductDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | List<ShippingInfo> getShippingInfoByCustomerName(String customerName); |
| | | |
| | | List<ShippingProductDetail> getDateil(Long id); |
| | | } |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.dto.ShippingProductDetailDto; |
| | | import com.ruoyi.sales.pojo.ShippingProductDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface ShippingProductDetailMapper extends BaseMapper<ShippingProductDetail> { |
| | | |
| | | List<ShippingProductDetailDto> getDetail(Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | public class SalesQuotation { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | @Schema(description = "æ¥ä»·åç¼å·") |
| | | @ApiModelProperty(value = "æ¥ä»·åç¼å·") |
| | | @Excel(name = "æ¥ä»·åç¼å·") |
| | | private String quotationNo; |
| | | @Schema(description = "客æ·åç§°") |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customer; |
| | | |
| | | @Schema(description = "ä¸å¡å") |
| | | @ApiModelProperty(value = "客æ·id") |
| | | private Long customerId; |
| | | |
| | | @ApiModelProperty(value = "ä¸å¡å") |
| | | @Excel(name = "ä¸å¡å") |
| | | private String salesperson; |
| | | @Schema(description = "æ¥ä»·æ¥æ") |
| | | @ApiModelProperty(value = "æ¥ä»·æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æ¥ä»·æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate quotationDate; |
| | | @Schema(description = "æææè³") |
| | | @ApiModelProperty(value = "æææè³") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æææè³", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate validDate; |
| | | @Schema(description = "仿¬¾æ¹å¼") |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | @Schema(description = "äº¤è´§å¨æå¤©æ°") |
| | | @ApiModelProperty(value = "äº¤è´§å¨æå¤©æ°") |
| | | private String deliveryPeriod; |
| | | @Schema(description = "ç¶æ") |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | private String status; |
| | | @Schema(description = "æ¥ä»·æ»éé¢") |
| | | @ApiModelProperty(value = "æ¥ä»·æ»éé¢") |
| | | @Excel(name = "æ¥ä»·éé¢") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @Schema(description = "夿³¨") |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | @Schema(description = "å建æ¶é´") |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "ä¿®æ¹æ¶é´") |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @Schema(description = "åå»ºç¨æ·") |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @Schema(description = "ä¿®æ¹ç¨æ·") |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @Schema(description = "ç§æ·ID") |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.dto.ShippingProductDetailDto; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | |
| | | import java.util.List; |
| | |
| | | List<ShippingInfo> getShippingInfoByCustomerName(String customerName); |
| | | |
| | | boolean add(ShippingInfoDto req); |
| | | |
| | | List<ShippingProductDetailDto> getDetail(Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.basic.dto.CustomerPrivatePoolDto; |
| | | import com.ruoyi.basic.dto.StorageBlobVO; |
| | | import com.ruoyi.basic.enums.ApplicationTypeEnum; |
| | | import com.ruoyi.basic.enums.RecordTypeEnum; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper; |
| | | import com.ruoyi.basic.mapper.ProductMapper; |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.SaleEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductInputMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductMainMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductOutputMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.production.mapper.*; |
| | | import com.ruoyi.production.service.ProductionProductMainService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | |
| | | import com.ruoyi.sales.vo.SalesLedgerVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.jetbrains.annotations.Nullable; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.script.DefaultRedisScript; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.nio.file.StandardCopyOption; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.YearMonth; |
| | |
| | | private static final String LOCK_PREFIX = "contract_no_lock:"; |
| | | private static final long LOCK_WAIT_TIMEOUT = 10; // éçå¾
è¶
æ¶æ¶é´ï¼ç§ï¼ |
| | | private static final long LOCK_EXPIRE_TIME = 30; // éèªå¨è¿ææ¶é´ï¼ç§ï¼ |
| | | private final AccountIncomeService accountIncomeService; |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | private final CustomerMapper customerMapper; |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | | private final SalesLedgerProductServiceImpl salesLedgerProductServiceImpl; |
| | | private final CommonFileMapper commonFileMapper; |
| | | private final TempFileMapper tempFileMapper; |
| | | private final ReceiptPaymentMapper receiptPaymentMapper; |
| | | private final ShippingInfoServiceImpl shippingInfoServiceImpl; |
| | | private final CommonFileServiceImpl commonFileService; |
| | |
| | | private final InvoiceLedgerMapper invoiceLedgerMapper; |
| | | private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | private final InvoiceRegistrationMapper invoiceRegistrationMapper; |
| | | private final ProductModelMapper productModelMapper; |
| | | private final ProductionProductMainMapper productionProductMainMapper; |
| | | private final ProductionProductOutputMapper productionProductOutputMapper; |
| | | private final ProductionProductInputMapper productionProductInputMapper; |
| | | private final QualityInspectMapper qualityInspectMapper; |
| | | private final RedisTemplate<String, String> redisTemplate; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | private final ProductionProductMainService productionProductMainService; |
| | | private final PurchaseReturnOrderProductsMapper purchaseReturnOrderProductsMapper; |
| | | private final SysUserMapper sysUserMapper; |
| | | private final CustomerPrivatePoolMapper customerPrivatePoolMapper; |
| | | private final FileUtil fileUtil; |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | @Autowired |
| | | private ProductModelMapper productModelMapper; |
| | | |
| | | @Autowired |
| | | private ProductMapper productMapper; |
| | | @Autowired |
| | | private ProductionProductMainService productionProductMainService; |
| | | @Autowired |
| | | private PurchaseReturnOrderProductsMapper purchaseReturnOrderProductsMapper; |
| | | ; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public List<SalesLedger> selectSalesLedgerList(SalesLedgerDto salesLedgerDto) { |
| | |
| | | resultDto.setProductData(products); |
| | | resultDto.setSalesLedgerFiles(salesLedgerFiles); |
| | | } |
| | | // 5. æ¥è¯¢éä»¶ |
| | | List<StorageBlobVO> StorageBlobVOs = fileUtil.getStorageBlobVOsByRecordTypeAndRecordId(RecordTypeEnum.SALES_LEDGER, salesLedger.getId()); |
| | | resultDto.setStorageBlobVOs(StorageBlobVOs); |
| | | return resultDto; |
| | | } |
| | | |
| | |
| | | List<Long> productIds = products.stream() |
| | | .map(SalesLedgerProduct::getId) |
| | | .collect(Collectors.toList()); |
| | | //å é¤ç产计å |
| | | //å é¤çäº§æ°æ® |
| | | salesLedgerProductServiceImpl.deleteProductionData(productIds); |
| | | |
| | | // æ¹éå é¤äº§åå表 |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addOrUpdateSalesLedger(SalesLedgerDto salesLedgerDto) { |
| | | // 1. æ ¡éªå®¢æ·ä¿¡æ¯ |
| | | CustomerPrivatePoolDto customer = customerPrivatePoolMapper.selectInfo(salesLedgerDto.getCustomerId()); |
| | | if (customer == null) { |
| | | throw new BaseException("客æ·ä¸åå¨"); |
| | | try { |
| | | // 1. æ ¡éªå®¢æ·ä¿¡æ¯ |
| | | Customer customer = customerMapper.selectById(salesLedgerDto.getCustomerId()); |
| | | if (customer == null) { |
| | | throw new BaseException("客æ·ä¸åå¨"); |
| | | } |
| | | |
| | | // 2. DTO转Entity |
| | | SalesLedger salesLedger = convertToEntity(salesLedgerDto); |
| | | salesLedger.setCustomerName(customer.getCustomerName()); |
| | | salesLedger.setTenantId(customer.getTenantId()); |
| | | // 3. æ°å¢ææ´æ°ä¸»è¡¨ |
| | | if (salesLedger.getId() == null) { |
| | | String contractNo = generateSalesContractNo(); |
| | | salesLedger.setSalesContractNo(contractNo); |
| | | salesLedgerMapper.insert(salesLedger); |
| | | } else { |
| | | salesLedgerMapper.updateById(salesLedger); |
| | | } |
| | | |
| | | // 4. å¤çåè¡¨æ°æ® |
| | | List<SalesLedgerProduct> productList = salesLedgerDto.getProductData(); |
| | | if (productList != null && !productList.isEmpty()) { |
| | | handleSalesLedgerProducts(salesLedger.getId(), productList, EnumUtil.fromCode(SaleEnum.class, salesLedgerDto.getType())); |
| | | updateMainContractAmount( |
| | | salesLedger.getId(), |
| | | productList, |
| | | SalesLedgerProduct::getTaxInclusiveTotalPrice, |
| | | salesLedgerMapper, |
| | | SalesLedger.class |
| | | ); |
| | | } |
| | | |
| | | // 5. è¿ç§»ä¸´æ¶æä»¶å°æ£å¼ç®å½ |
| | | if (salesLedgerDto.getTempFileIds() != null && !salesLedgerDto.getTempFileIds().isEmpty()) { |
| | | migrateTempFilesToFormal(salesLedger.getId(), salesLedgerDto.getTempFileIds()); |
| | | } |
| | | return 1; |
| | | } catch (IOException e) { |
| | | throw new BaseException("æä»¶è¿ç§»å¤±è´¥: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å°ä¸´æ¶æä»¶è¿ç§»å°æ£å¼ç®å½ |
| | | * |
| | | * @param businessId ä¸å¡IDï¼éå®å°è´¦IDï¼ |
| | | * @param tempFileIds ä¸´æ¶æä»¶IDå表 |
| | | * @throws IOException æä»¶æä½å¼å¸¸ |
| | | */ |
| | | private void migrateTempFilesToFormal(Long businessId, List<String> tempFileIds) throws IOException { |
| | | if (CollectionUtils.isEmpty(tempFileIds)) { |
| | | return; |
| | | } |
| | | |
| | | // 2. DTO转Entity |
| | | SalesLedger salesLedger = convertToEntity(salesLedgerDto); |
| | | salesLedger.setCustomerName(customer.getCustomerName()); |
| | | salesLedger.setTenantId(customer.getTenantId()); |
| | | // 3. æ°å¢ææ´æ°ä¸»è¡¨ |
| | | if (salesLedger.getId() == null) { |
| | | String contractNo = generateSalesContractNo(); |
| | | salesLedger.setSalesContractNo(contractNo); |
| | | salesLedgerMapper.insert(salesLedger); |
| | | } else { |
| | | salesLedgerMapper.updateById(salesLedger); |
| | | // æå»ºæ£å¼ç®å½è·¯å¾ï¼æä¸å¡ç±»å忥æåç»ï¼ |
| | | String formalDir = uploadDir + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE); |
| | | |
| | | Path formalDirPath = Paths.get(formalDir); |
| | | |
| | | // ç¡®ä¿æ£å¼ç®å½åå¨ï¼éå½åå»ºï¼ |
| | | if (!Files.exists(formalDirPath)) { |
| | | Files.createDirectories(formalDirPath); |
| | | } |
| | | |
| | | // 4. å¤çåè¡¨æ°æ® |
| | | List<SalesLedgerProduct> productList = salesLedgerDto.getProductData(); |
| | | if (productList != null && !productList.isEmpty()) { |
| | | handleSalesLedgerProducts(salesLedger.getId(), productList, EnumUtil.fromCode(SaleEnum.class, salesLedgerDto.getType())); |
| | | updateMainContractAmount( |
| | | salesLedger.getId(), |
| | | productList, |
| | | SalesLedgerProduct::getTaxInclusiveTotalPrice, |
| | | salesLedgerMapper, |
| | | SalesLedger.class |
| | | ); |
| | | } |
| | | for (String tempFileId : tempFileIds) { |
| | | // æ¥è¯¢ä¸´æ¶æä»¶è®°å½ |
| | | TempFile tempFile = tempFileMapper.selectById(tempFileId); |
| | | if (tempFile == null) { |
| | | log.warn("ä¸´æ¶æä»¶ä¸åå¨ï¼è·³è¿å¤ç: {}", tempFileId); |
| | | continue; |
| | | } |
| | | |
| | | // 5. ä¿åæä»¶ |
| | | if (salesLedgerDto.getStorageBlobDTOs() != null && !salesLedgerDto.getStorageBlobDTOs().isEmpty()) { |
| | | fileUtil.saveStorageAttachment(ApplicationTypeEnum.FILE, RecordTypeEnum.SALES_LEDGER, salesLedger.getId(), salesLedgerDto.getStorageBlobDTOs()); |
| | | // æå»ºæ£å¼æä»¶åï¼å
å«ä¸å¡IDåæ¶é´æ³ï¼é¿å
å²çªï¼ |
| | | String originalFilename = tempFile.getOriginalName(); |
| | | String fileExtension = FilenameUtils.getExtension(originalFilename); |
| | | String formalFilename = businessId + "_" + |
| | | System.currentTimeMillis() + "_" + |
| | | UUID.randomUUID().toString().substring(0, 8) + |
| | | (StringUtils.hasText(fileExtension) ? "." + fileExtension : ""); |
| | | |
| | | Path formalFilePath = formalDirPath.resolve(formalFilename); |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| | | CommonFile fileRecord = new CommonFile(); |
| | | fileRecord.setCommonId(businessId); |
| | | fileRecord.setName(originalFilename); |
| | | fileRecord.setUrl(formalFilePath.toString()); |
| | | fileRecord.setCreateTime(LocalDateTime.now()); |
| | | //éå® |
| | | fileRecord.setType(FileNameType.SALE.getValue()); |
| | | commonFileMapper.insert(fileRecord); |
| | | |
| | | // å é¤ä¸´æ¶æä»¶è®°å½ |
| | | tempFileMapper.deleteById(tempFile); |
| | | |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | } catch (IOException e) { |
| | | log.error("æä»¶è¿ç§»å¤±è´¥: {}", tempFile.getTempPath(), e); |
| | | // å¯éæ©åæ»äºå¡æè®°å½å¤±è´¥æä»¶ |
| | | throw new IOException("æä»¶è¿ç§»å¼å¸¸", e); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | // æä»¶è¿ç§»æ¹æ³ |
| | |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.approve.bean.vo.ApproveGetAndUpdateVo; |
| | | import com.ruoyi.approve.bean.vo.ApproveProcessVO; |
| | | import com.ruoyi.basic.dto.CustomerPrivatePoolDto; |
| | | import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | |
| | | private final SalesQuotationProductService salesQuotationProductService; |
| | | |
| | | private final ApproveProcessServiceImpl approveProcessService; |
| | | private final CustomerPrivatePoolMapper customerPrivatePoolMapper; |
| | | private final CustomerMapper customerMapper; |
| | | |
| | | @Override |
| | | public IPage<SalesQuotationDto> listPage(Page page, SalesQuotationDto salesQuotationDto) { |
| | |
| | | public boolean add(SalesQuotationDto salesQuotationDto) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SalesQuotation salesQuotation = new SalesQuotation(); |
| | | CustomerPrivatePoolDto customerPrivatePoolDto = customerPrivatePoolMapper.selectInfo(Long.valueOf(salesQuotationDto.getCustomer())); |
| | | if (ObjectUtils.isNotEmpty(customerPrivatePoolDto)) { |
| | | BeanUtils.copyProperties(salesQuotationDto, salesQuotation); |
| | | salesQuotation.setCustomer(customerPrivatePoolDto.getCustomerName()); |
| | | Customer customer = customerMapper.selectById(Long.valueOf(salesQuotationDto.getCustomerId())); |
| | | if (ObjectUtils.isNotEmpty(customer)) { |
| | | salesQuotation.setCustomer(customer.getCustomerName()); |
| | | } |
| | | String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT","quotation_no"); |
| | | salesQuotation.setQuotationNo(quotationNo); |
| | |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | }catch (Exception e){ |
| | | log.error("SalesQuotationServiceImpl error:{}", e); |
| | | throw new RuntimeException("审æ¹å¤±è´¥"); |
| | | throw new RuntimeException("审æ¹å¤±è´¥"); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.dto.ShippingProductDetailDto; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.mapper.ShippingProductDetailMapper; |
| | |
| | | shippingProductDetailMapper.insert(req.getBatchNoDetailList()); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<ShippingProductDetailDto> getDetail(Long id) { |
| | | return shippingProductDetailMapper.getDetail(id); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.PersonalAttendanceLocationConfigService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | |
| | | @RequiredArgsConstructor |
| | | public class PersonalAttendanceLocationConfigController { |
| | | |
| | | private PersonalAttendanceLocationConfigService personalAttendanceLocationConfigService; |
| | | private final PersonalAttendanceLocationConfigService personalAttendanceLocationConfigService; |
| | | |
| | | @Operation(summary = "æ°å¢/ä¿®æ¹äººåæå¡è§åé
ç½®") |
| | | @PostMapping("/add") |
| | |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: NEW |
| | | |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 9036 |
| | | port: 9003 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: demo-product |
| | | default-bucket: jxc |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:3306/product-inventory-management-demo?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://172.17.0.1:9002/product-inventory-management-sdjc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: xd@123456.. |
| | | password: sdjc@123456.. |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: false |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | # host: 127.0.0.1 |
| | | host: 172.17.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | # password: root2022! |
| | | password: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://114.132.189.42:9028/chat_memory_db |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | # host: 127.0.0.1 |
| | | host: 172.17.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | # password: root2022! |
| | | password: |
| | | |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # Quartz宿¶ä»»å¡é
ç½®ï¼æ°å¢é¨åï¼ |
| | | quartz: |
| | | job-store-type: jdbc # ä½¿ç¨æ°æ®åºåå¨ |
| | | jdbc: |
| | | initialize-schema: never # 馿¬¡è¿è¡æ¶èªå¨åå»ºè¡¨ç»æï¼æååæ¹ä¸ºnever |
| | | schema: classpath:org/quartz/impl/jdbcjobstore/tables_mysql_innodb.sql # MySQLè¡¨ç»æèæ¬ |
| | | properties: |
| | | org: |
| | | quartz: |
| | | scheduler: |
| | | instanceName: RuoYiScheduler |
| | | instanceId: AUTO |
| | | jobStore: |
| | | class: org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # MySQLéé
|
| | | tablePrefix: qrtz_ # 表ååç¼ï¼ä¸èæ¬ä¸è´ |
| | | isClustered: false # åèç¹æ¨¡å¼ï¼éç¾¤éæ¹ä¸ºtrueï¼ |
| | | clusterCheckinInterval: 10000 |
| | | txIsolationLevelSerializable: true |
| | | threadPool: |
| | | class: org.quartz.simpl.SimpleThreadPool |
| | | threadCount: 10 # çº¿ç¨æ± å¤§å° |
| | | threadPriority: 5 |
| | | makeThreadsDaemons: true |
| | | updateCheck: false # å
³éçæ¬æ£æ¥ |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | secret: xpAVjhCjQDaDB7mjPAzMDSbQWXNu2zYkTdDNUsPMS5Xx8QMmQVYN7n74eZrYJxDJ |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 450 |
| | | |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | | |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | |
| | | # 代ç çæ |
| | | gen: |
| | | # ä½è
|
| | |
| | | # æ¯å¦å
è®¸çææä»¶è¦çå°æ¬å°ï¼èªå®ä¹è·¯å¾ï¼ï¼é»è®¤ä¸å
许 |
| | | allowOverwrite: false |
| | | |
| | | # æä»¶ä¸ä¼ é
ç½® |
| | | file: |
| | | temp-dir: /javaWork/product-inventory-management/file/temp/uploads |
| | | upload-dir: /javaWork/product-inventory-management/file/prod/uploads |
| | | temp-dir: /javaWork/product-inventory-management/file/temp/uploads # 临æ¶ç®å½ |
| | | upload-dir: /javaWork/product-inventory-management/file/prod/uploads # æ£å¼ç®å½ |
| | | path: /javaWork/product-inventory-management/file # ä¸ä¼ ç®å½ |
| | | urlPrefix: /common # 龿¥åç¼ |
| | | domain: http://36.138.236.153:9001 # åååç¼ |
| | | expired: 120 # è¿ææ¶é´(åä½:åé) |
| | | useLimit: 10 # ä½¿ç¨æ¬¡æ° |
| | | compress: true # æ¯å¦å缩 |
| | | needCompressSize: 10MB # å缩éå¼ |
| | | compressQuality: 0.5 # å缩质é(0.0-1.0) |
| | |
| | | |
| | | # æä»¶ä¸ä¼ é
ç½® |
| | | file: |
| | | temp-dir: D:/ruoyi/temp/uploads # 临æ¶ç®å½ |
| | | upload-dir: D:/ruoyi/prod/uploads # æ£å¼ç®å½ |
| | | path: C:/Users/12631/Desktop/download/uploads # ä¸ä¼ ç®å½ |
| | | urlPrefix: /common # 龿¥åç¼ |
| | | domain: http://127.0.0.1:7003 # åååç¼ |
| | | temp-dir: /javaWork/product-inventory-management/file/temp/uploads # 临æ¶ç®å½ |
| | | upload-dir: /javaWork/product-inventory-management/file/prod/uploads # æ£å¼ç®å½ |
| | | path: /javaWork/product-inventory-management/file # ä¸ä¼ ç®å½ |
| | | urlPrefix: /prod-api/common # 龿¥åç¼ |
| | | domain: http://1.15.17.182:9049 # åååç¼ |
| | | expired: 120 # è¿ææ¶é´(åä½:åé) |
| | | useLimit: 10 # ä½¿ç¨æ¬¡æ° |
| | | compress: true # æ¯å¦å缩 |
| | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.Customer"> |
| | | <id column="id" property="id" /> |
| | | </resultMap> |
| | | <select id="listPage" resultType="com.ruoyi.basic.dto.CustomerDto"> |
| | | <select id="listPage" resultType="com.ruoyi.basic.vo.CustomerVo"> |
| | | select |
| | | c.*, |
| | | u.user_name usage_user_name, |
| | | ( |
| | | select group_concat(u2.user_name separator ', ') |
| | | from customer_private_pool cpp2 |
| | | left join sys_user u2 on cpp2.bound_id = u2.user_id |
| | | where cpp2.customer_id = c.id and cpp2.delete_flag = 0 |
| | | and cpp2.bound_id != c.usage_user |
| | | ) as together_user_names |
| | | from customer_user cu |
| | | left join sys_user u2 on cu.user_id = u2.user_id |
| | | where cu.customer_id = c.id |
| | | and cu.user_id != c.usage_user |
| | | ) as together_user_names, |
| | | ( |
| | | select group_concat(cu.user_id separator ',') |
| | | from customer_user cu |
| | | where cu.customer_id = c.id |
| | | and cu.user_id != c.usage_user |
| | | ) as user_ids_str |
| | | from customer c |
| | | left join sys_user u on c.usage_user = u.user_id |
| | | <where> |
| | |
| | | <if test="c.customerType != null and c.customerType != ''"> |
| | | and customer_type = #{c.customerType} |
| | | </if> |
| | | <!-- å
¬æµ·æ¥è¯¢ï¼type = 1ï¼å
¬æµ·å®¢æ·ï¼--> |
| | | <if test="c.type != null and c.type == 1"> |
| | | and type = #{c.type} |
| | | </if> |
| | | <!-- ç§æµ·æ¥è¯¢ï¼type = 0ï¼ç§æµ·å®¢æ·ï¼æè
type = 1ï¼å
¬æµ·å®¢æ·ï¼ä¸å·²è¢«åé
ï¼å¹¶ä¸æ¯èªå·±é¢ç¨ãèªå·±å建æè
å
±äº«ç»èªå·±çå®¢æ· --> |
| | | <if test="c.type != null and c.type == 0"> |
| | | and ( |
| | | (type = #{c.type} or (type = 1 and is_assigned = 1)) |
| | | and ( |
| | | c.usage_user = #{loginUserId} |
| | | or c.create_user = #{loginUserId} |
| | | or exists ( |
| | | select 1 from customer_user cu |
| | | where cu.customer_id = c.id |
| | | and cu.user_id = #{loginUserId} |
| | | ) |
| | | ) |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | | <select id="list" resultType="com.ruoyi.basic.vo.CustomerVo"> |
| | | select |
| | | c.*, |
| | | u.user_name usage_user_name, |
| | | ( |
| | | select group_concat(u2.user_name separator ', ') |
| | | from customer_user cu |
| | | left join sys_user u2 on cu.user_id = u2.user_id |
| | | where cu.customer_id = c.id |
| | | and cu.user_id != c.usage_user |
| | | ) as together_user_names, |
| | | ( |
| | | select group_concat(cu.user_id separator ',') |
| | | from customer_user cu |
| | | where cu.customer_id = c.id |
| | | and cu.user_id != c.usage_user |
| | | ) as user_ids_str |
| | | from customer c |
| | | left join sys_user u on c.usage_user = u.user_id |
| | | <where> |
| | | <if test="c.ids != null and c.ids.length > 0"> |
| | | and c.id in |
| | | <foreach collection="c.ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="c.customerName != null and c.customerName != ''"> |
| | | and customer_name like concat('%', #{c.customerName}, '%') |
| | | </if> |
| | | <if test="c.customerType != null and c.customerType != ''"> |
| | | and customer_type = #{c.customerType} |
| | | </if> |
| | | <!-- å
¬æµ·æ¥è¯¢ï¼type = 1ï¼å
¬æµ·å®¢æ·ï¼--> |
| | | <if test="c.type != null and c.type == 1"> |
| | | and type = #{c.type} |
| | | </if> |
| | | <!-- ç§æµ·æ¥è¯¢ï¼type = 0ï¼ç§æµ·å®¢æ·ï¼æè
type = 1ï¼å
¬æµ·å®¢æ·ï¼ä¸å·²è¢«åé
ï¼å¹¶ä¸æ¯èªå·±é¢ç¨ãèªå·±å建æè
å
±äº«ç»èªå·±çå®¢æ· --> |
| | | <if test="c.type != null and c.type == 0"> |
| | | and ( |
| | | (type = #{c.type} or (type = 1 and is_assigned = 1)) |
| | | and ( |
| | | c.usage_user = #{loginUserId} |
| | | or c.create_user = #{loginUserId} |
| | | or exists ( |
| | | select 1 from customer_user cu |
| | | where cu.customer_id = c.id |
| | | and cu.user_id = #{loginUserId} |
| | | ) |
| | | ) |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | pm.model as model, |
| | | pm.unit as unit, |
| | | poro.operation_name as operationName, |
| | | ROUND(pot.complete_quantity / pot.plan_quantity * 100, 2) AS completionStatus, |
| | | IFNULL(scrapStat.scrapQty, 0) AS scrapQty, |
| | | ROUND(IFNULL(pot.complete_quantity, 0) / NULLIF(pot.plan_quantity, 0) * 100, 2) AS completionStatus, |
| | | CASE |
| | | WHEN pot.work_order_no LIKE 'FG%' THEN 'è¿å·¥è¿ä¿®' |
| | | ELSE 'æ£å¸¸' |
| | |
| | | left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id |
| | | left join product_model pm on pm.id = ifnull(poro.product_model_id, po.product_model_id) |
| | | left join product p on pm.product_id = p.id |
| | | left join ( |
| | | select ppm.production_operation_task_id as taskId, |
| | | sum(ifnull(ppo.scrap_qty, 0)) as scrapQty |
| | | from production_product_main ppm |
| | | left join production_product_output ppo on ppo.production_product_main_id = ppm.id |
| | | group by ppm.production_operation_task_id |
| | | ) scrapStat on scrapStat.taskId = pot.id |
| | | <where> |
| | | <if test="c != null and c.id != null"> |
| | | and pot.id = #{c.id} |
| | | </if> |
| | | <if test="c != null and c.npsNo != null"> |
| | | and po.nps_no like concat('%', #{c.npsNo}, '%') |
| | | </if> |
| | | <if test="c != null and c.productionOrderId != null"> |
| | | and pot.production_order_id = #{c.productionOrderId} |
| | |
| | | WHERE pot.id = #{id} |
| | | </select> |
| | | |
| | | <select id="getOperation" resultType="com.ruoyi.production.bean.vo.ProductionOperationTaskVo"> |
| | | select poro.operation_name as operationName, |
| | | count(pot.id) as productionTaskCount, |
| | | sum(ifnull(pot.plan_quantity, 0)) as planQuantity, |
| | | sum(ifnull(pot.complete_quantity, 0)) as completeQuantity, |
| | | sum(ifnull(pot.complete_quantity, 0)) as goodQuantity, |
| | | sum(ifnull(outputStat.scrapQty, 0)) as scrapQty, |
| | | round( |
| | | case |
| | | when sum(ifnull(pot.plan_quantity, 0)) = 0 then 0 |
| | | else (sum(ifnull(pot.complete_quantity, 0)) + sum(ifnull(outputStat.scrapQty, 0))) |
| | | / sum(ifnull(pot.plan_quantity, 0)) * 100 |
| | | end, |
| | | 2 |
| | | ) as completionStatus |
| | | from production_operation_task pot |
| | | left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id |
| | | left join ( |
| | | select ppm.production_operation_task_id as taskId, |
| | | sum(ifnull(ppo.scrap_qty, 0)) as scrapQty |
| | | from production_product_main ppm |
| | | left join production_product_output ppo on ppo.production_product_main_id = ppm.id |
| | | group by ppm.production_operation_task_id |
| | | ) outputStat on outputStat.taskId = pot.id |
| | | <where> |
| | | <if test="c != null and c.startDate != null"> |
| | | and date(pot.create_time) >= #{c.startDate} |
| | | </if> |
| | | <if test="c != null and c.endDate != null"> |
| | | and date(pot.create_time) <= #{c.endDate} |
| | | </if> |
| | | <if test="c != null and c.planStartTime != null"> |
| | | and pot.plan_start_time >= #{c.planStartTime} |
| | | </if> |
| | | <if test="c != null and c.planEndTime != null"> |
| | | and pot.plan_end_time <= #{c.planEndTime} |
| | | </if> |
| | | <if test="c != null and c.productionOrderId != null"> |
| | | and pot.production_order_id = #{c.productionOrderId} |
| | | </if> |
| | | <if test="c != null and c.productionOrderRoutingOperationId != null"> |
| | | and pot.production_order_routing_operation_id = #{c.productionOrderRoutingOperationId} |
| | | </if> |
| | | <if test="c != null and c.status != null"> |
| | | and pot.status = #{c.status} |
| | | </if> |
| | | <if test="c != null and c.processName != null and c.processName != ''"> |
| | | and poro.operation_name like concat('%', #{c.processName}, '%') |
| | | </if> |
| | | </where> |
| | | group by poro.operation_name |
| | | order by min(poro.drag_sort), poro.operation_name |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="productName" property="productName" /> |
| | | <result column="model" property="model" /> |
| | | <result column="processRouteCode" property="processRouteCode" /> |
| | | <result column="returned" property="returned" /> |
| | | </resultMap> |
| | | |
| | | <sql id="ProductionOrderVoColumns"> |
| | |
| | | po.is_end_order as endOrder, |
| | | tr.process_route_code as processRouteCode, |
| | | ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus, |
| | | tb.bom_no as bomNo |
| | | tb.bom_no as bomNo, |
| | | pop_return.returned as returned |
| | | </sql> |
| | | |
| | | <sql id="ProductionOrderVoFrom"> |
| | |
| | | left join product p on pm.product_id = p.id |
| | | left join technology_routing tr on po.technology_routing_id = tr.id |
| | | left join technology_bom tb on tb.id = tr.bom_id |
| | | left join ( |
| | | select production_order_id as productionOrderId, |
| | | if(max(case when ifnull(is_returned, 0) = 1 then 1 else 0 end) = 1, true, false) as returned |
| | | from production_order_pick |
| | | group by production_order_id |
| | | ) pop_return on pop_return.productionOrderId = po.id |
| | | </sql> |
| | | |
| | | <sql id="ProductionOrderWhere"> |
| | |
| | | <result column="quantity" property="quantity" /> |
| | | <result column="shipping_info_id" property="shippingInfoId" /> |
| | | </resultMap> |
| | | <select id="getDetail" resultType="com.ruoyi.sales.dto.ShippingProductDetailDto"> |
| | | select si.batch_no, pm.model as specification_model, p.product_name, spd.quantity as delivery_quantity |
| | | from shipping_product_detail spd |
| | | left join stock_inventory si on si.id = spd.stock_inventory_id |
| | | left join product_model pm on pm.id = si.product_model_id |
| | | left join product p on p.id = pm.product_id |
| | | where spd.shipping_info_id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |