Commit a3b7a347ff264236a5e48919c2f5ba5d5e148dda
1 parent
25b987be
添加财务模块,main分支为完整的未添加财务模块之前的线上正常代码
Showing
74 changed files
with
4461 additions
and
11 deletions
Too many changes to show.
To preserve performance only 74 of 82 files are displayed.
src/main/java/com/order/erp/common/constant/Constant.java
@@ -185,6 +185,8 @@ public class Constant { | @@ -185,6 +185,8 @@ public class Constant { | ||
185 | 185 | ||
186 | public static final String DELETE_SUCCESS_RESULT_CHARACTER = "删除成功"; | 186 | public static final String DELETE_SUCCESS_RESULT_CHARACTER = "删除成功"; |
187 | 187 | ||
188 | + public static final String REDISKEY = "REDISKEY"; | ||
189 | + | ||
188 | 190 | ||
189 | /** | 191 | /** |
190 | * token rediskey | 192 | * token rediskey |
@@ -335,4 +337,6 @@ public class Constant { | @@ -335,4 +337,6 @@ public class Constant { | ||
335 | */ | 337 | */ |
336 | public static final long REDIS_EMAIL_TIME = 90; | 338 | public static final long REDIS_EMAIL_TIME = 90; |
337 | 339 | ||
340 | + public static final String FINANCE_EVENT_TIME = "请自行去系统中查询!"; | ||
341 | + | ||
338 | } | 342 | } |
src/main/java/com/order/erp/common/utils/EasyPdfUtils.java
@@ -63,7 +63,8 @@ public class EasyPdfUtils { | @@ -63,7 +63,8 @@ public class EasyPdfUtils { | ||
63 | public List<OrderProducePdfVO> build(List<Long> ids) { | 63 | public List<OrderProducePdfVO> build(List<Long> ids) { |
64 | List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(new LambdaQueryWrapper<OrderBaseInfoDO>() | 64 | List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(new LambdaQueryWrapper<OrderBaseInfoDO>() |
65 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | 65 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) |
66 | - .in(OrderBaseInfoDO::getId, ids)); | 66 | + .in(OrderBaseInfoDO::getId, ids) |
67 | + .orderByAsc(OrderBaseInfoDO::getInnerNo)); | ||
67 | Set<String> productionDepartments = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getProductionDepartment).filter(Objects::nonNull) | 68 | Set<String> productionDepartments = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getProductionDepartment).filter(Objects::nonNull) |
68 | .filter(department -> !department.trim().isEmpty()).collect(Collectors.toSet()); | 69 | .filter(department -> !department.trim().isEmpty()).collect(Collectors.toSet()); |
69 | if (productionDepartments.size() > 1) { | 70 | if (productionDepartments.size() > 1) { |
@@ -79,7 +80,7 @@ public class EasyPdfUtils { | @@ -79,7 +80,7 @@ public class EasyPdfUtils { | ||
79 | List<String> personList= new ArrayList<>(setPerson); | 80 | List<String> personList= new ArrayList<>(setPerson); |
80 | Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); | 81 | Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); |
81 | List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>().in(OrderProfitAnalysisDO::getOrderId, orderIds)); | 82 | List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>().in(OrderProfitAnalysisDO::getOrderId, orderIds)); |
82 | - Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = profitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity())); | 83 | + Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = profitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(),(x,y)->x)); |
83 | return orderBaseInfoDOList.stream().map(x -> { | 84 | return orderBaseInfoDOList.stream().map(x -> { |
84 | OrderProducePdfVO producePdfVO = new OrderProducePdfVO(); | 85 | OrderProducePdfVO producePdfVO = new OrderProducePdfVO(); |
85 | BeanUtils.copyProperties(x, producePdfVO); | 86 | BeanUtils.copyProperties(x, producePdfVO); |
src/main/java/com/order/erp/common/utils/EmailSendUtils.java
1 | package com.order.erp.common.utils; | 1 | package com.order.erp.common.utils; |
2 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | 2 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
3 | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | 3 | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
4 | +import com.order.erp.common.constant.Constant; | ||
4 | import com.order.erp.common.constant.ServerResultCode; | 5 | import com.order.erp.common.constant.ServerResultCode; |
5 | import com.order.erp.common.exception.BusinessException; | 6 | import com.order.erp.common.exception.BusinessException; |
6 | import com.order.erp.domain.EmailTemplateEnum; | 7 | import com.order.erp.domain.EmailTemplateEnum; |
8 | +import com.order.erp.domain.FinanceOverEnum; | ||
9 | +import com.order.erp.domain.vo.order.FinanceEventJobVO; | ||
7 | import com.order.erp.domain.vo.order.OrderEventJobVO; | 10 | import com.order.erp.domain.vo.order.OrderEventJobVO; |
8 | import freemarker.template.Template; | 11 | import freemarker.template.Template; |
9 | import freemarker.template.TemplateException; | 12 | import freemarker.template.TemplateException; |
@@ -107,4 +110,41 @@ public class EmailSendUtils { | @@ -107,4 +110,41 @@ public class EmailSendUtils { | ||
107 | } | 110 | } |
108 | javaMailSender.send(mimeMessage); | 111 | javaMailSender.send(mimeMessage); |
109 | } | 112 | } |
113 | + | ||
114 | + | ||
115 | + /** | ||
116 | + * @Description: 发送财务应收款,应付款过期时间的单据 | ||
117 | + * @param emailTemplateEnum 应收款,应付款邮件事件类型 | ||
118 | + * @param receiveemailList 收件人邮箱 | ||
119 | + * @param orderEventJobVO 应收款,应付款订单。 | ||
120 | + * @throws IOException | ||
121 | + */ | ||
122 | + | ||
123 | + public void sendEmail(FinanceOverEnum emailTemplateEnum, List<String> receiveemailList, FinanceEventJobVO orderEventJobVO) { | ||
124 | + if(CollectionUtils.isEmpty(receiveemailList) && emailTemplateEnum ==null && ObjectUtils.isNull(orderEventJobVO)){ | ||
125 | + throw new BusinessException(ServerResultCode.PARAM_ERROR); | ||
126 | + } | ||
127 | + MimeMessage mimeMessage = javaMailSender.createMimeMessage(); | ||
128 | + MimeMessageHelper helper= null; | ||
129 | + //设置收件人 | ||
130 | + String[] receiveemailListArray = receiveemailList.toArray(new String[receiveemailList.size()]); | ||
131 | + try { | ||
132 | + helper = new MimeMessageHelper(mimeMessage); | ||
133 | + //设置邮件的主题 | ||
134 | + helper.setSubject(emailTemplateEnum.getTitle()); | ||
135 | + //设置发件人 | ||
136 | + helper.setFrom(sendEmail); | ||
137 | + helper.setTo(receiveemailListArray); | ||
138 | + helper.setSentDate(new Date()); | ||
139 | + if(FinanceOverEnum.INVOICE_OVERTIME==emailTemplateEnum){ | ||
140 | + helper.setText(emailTemplateEnum.getDesc()+orderEventJobVO.getInvoiceBillOrderDO().getInvoiceNo()+" "+ Constant.FINANCE_EVENT_TIME); | ||
141 | + }else if(FinanceOverEnum.PRODUCE_PAYMENT_CHECK_OVERTIME==emailTemplateEnum){ | ||
142 | + helper.setText(emailTemplateEnum.getDesc()+orderEventJobVO.getProducePaymentCheckBillOrderDO().getCheckNo()+" "+Constant.FINANCE_EVENT_TIME); | ||
143 | + } | ||
144 | + } catch ( MessagingException e) { | ||
145 | + throw new RuntimeException("邮件发送失败!", e); | ||
146 | + } | ||
147 | + javaMailSender.send(mimeMessage); | ||
148 | + } | ||
149 | + | ||
110 | } | 150 | } |
111 | \ No newline at end of file | 151 | \ No newline at end of file |
src/main/java/com/order/erp/common/utils/OrderFieldUtils.java
@@ -38,9 +38,9 @@ public class OrderFieldUtils { | @@ -38,9 +38,9 @@ public class OrderFieldUtils { | ||
38 | * @param orderId | 38 | * @param orderId |
39 | * @return | 39 | * @return |
40 | */ | 40 | */ |
41 | - public static OrderFieldLockApplyDO generatorBaseInfoFieldLockApplyDO(OrderBaseFieldVO baseFields, Long userId, Long orderId) { | 41 | + public static OrderFieldLockApplyDO generatorBaseInfoFieldLockApplyDO(OrderUnlockFieldApplyVO fieldVO, Long userId, Long orderId) { |
42 | OrderLockFieldVO lockFieldVO = new OrderLockFieldVO(); | 42 | OrderLockFieldVO lockFieldVO = new OrderLockFieldVO(); |
43 | - lockFieldVO.setBaseFields(baseFields); | 43 | + lockFieldVO.setBaseFields(fieldVO.getBaseFields()); |
44 | OrderFieldLockApplyDO applyDO = OrderFieldLockApplyDO.builder() | 44 | OrderFieldLockApplyDO applyDO = OrderFieldLockApplyDO.builder() |
45 | .applyUserId(userId) | 45 | .applyUserId(userId) |
46 | .auditUserId(null) | 46 | .auditUserId(null) |
@@ -49,12 +49,14 @@ public class OrderFieldUtils { | @@ -49,12 +49,14 @@ public class OrderFieldUtils { | ||
49 | .remark(ApplyTypeEnum.FIELD_EDIT_APPLY.getDesc()) | 49 | .remark(ApplyTypeEnum.FIELD_EDIT_APPLY.getDesc()) |
50 | .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | 50 | .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) |
51 | .build(); | 51 | .build(); |
52 | - if (Objects.nonNull(baseFields) && checkOrderBaseField4apply(baseFields)) { | 52 | + if (Objects.nonNull(fieldVO.getBaseFields()) && checkOrderBaseField4apply(fieldVO.getBaseFields())) { |
53 | lockFieldVO.setInspectionStageFields(initInspectionStageField(OrderLockFieldEnum.LOCKED)); | 53 | lockFieldVO.setInspectionStageFields(initInspectionStageField(OrderLockFieldEnum.LOCKED)); |
54 | lockFieldVO.setProfitAnalysisFields(initProfitAnalysisField(OrderLockFieldEnum.LOCKED)); | 54 | lockFieldVO.setProfitAnalysisFields(initProfitAnalysisField(OrderLockFieldEnum.LOCKED)); |
55 | lockFieldVO.setReportFields(initReportField(OrderLockFieldEnum.LOCKED)); | 55 | lockFieldVO.setReportFields(initReportField(OrderLockFieldEnum.LOCKED)); |
56 | lockFieldVO.setTrackStageFields(initTrackStageField(OrderLockFieldEnum.LOCKED)); | 56 | lockFieldVO.setTrackStageFields(initTrackStageField(OrderLockFieldEnum.LOCKED)); |
57 | applyDO.setFields(JSONObject.toJSONString(lockFieldVO)); | 57 | applyDO.setFields(JSONObject.toJSONString(lockFieldVO)); |
58 | + //在这里增加字段的描述。 applyDO.setXxxx("xxxx原因。"); | ||
59 | + applyDO.setApplyRemark(fieldVO.getApplyRemark()); | ||
58 | applyDO.setAuditRoleCodes(RoleEnum.BUSINESS_USER.getCode() + Constant.COMMA_CHARACTER + RoleEnum.ADMIN.getCode()); | 60 | applyDO.setAuditRoleCodes(RoleEnum.BUSINESS_USER.getCode() + Constant.COMMA_CHARACTER + RoleEnum.ADMIN.getCode()); |
59 | return applyDO; | 61 | return applyDO; |
60 | } else { | 62 | } else { |
@@ -97,7 +99,7 @@ public class OrderFieldUtils { | @@ -97,7 +99,7 @@ public class OrderFieldUtils { | ||
97 | */ | 99 | */ |
98 | public static List<OrderFieldLockApplyDO> initOrderFieldLockApplyDOS(OrderUnlockFieldApplyVO fieldVO, Long userId) { | 100 | public static List<OrderFieldLockApplyDO> initOrderFieldLockApplyDOS(OrderUnlockFieldApplyVO fieldVO, Long userId) { |
99 | List<OrderFieldLockApplyDO> resultList = new ArrayList<>(); | 101 | List<OrderFieldLockApplyDO> resultList = new ArrayList<>(); |
100 | - OrderFieldLockApplyDO baseLockApply = generatorBaseInfoFieldLockApplyDO(fieldVO.getBaseFields(), userId, fieldVO.getOrderId()); | 102 | + OrderFieldLockApplyDO baseLockApply = generatorBaseInfoFieldLockApplyDO(fieldVO, userId, fieldVO.getOrderId()); |
101 | if (Objects.nonNull(baseLockApply)) { | 103 | if (Objects.nonNull(baseLockApply)) { |
102 | resultList.add(baseLockApply); | 104 | resultList.add(baseLockApply); |
103 | } | 105 | } |
src/main/java/com/order/erp/common/utils/RedisUtils.java
@@ -167,11 +167,17 @@ public class RedisUtils { | @@ -167,11 +167,17 @@ public class RedisUtils { | ||
167 | * @param keys | 167 | * @param keys |
168 | * @return | 168 | * @return |
169 | */ | 169 | */ |
170 | - public List<Object> multiGet(List<String> keys) { | ||
171 | - Object obj = redisTemplate.opsForValue().multiGet(Collections.singleton(keys)); | ||
172 | - return null; | 170 | + public List<Object> multiGet(List<Object> keys) { |
171 | + try { | ||
172 | + List<Object> values = redisTemplate.opsForValue().multiGet(keys); | ||
173 | + return values != null ? values : Collections.emptyList(); | ||
174 | + } catch (Exception e) { | ||
175 | + e.printStackTrace(); | ||
176 | + return Collections.emptyList(); | ||
177 | + } | ||
173 | } | 178 | } |
174 | 179 | ||
180 | + | ||
175 | /** | 181 | /** |
176 | * 普通缓存放入 | 182 | * 普通缓存放入 |
177 | * | 183 | * |
@@ -643,4 +649,41 @@ public class RedisUtils { | @@ -643,4 +649,41 @@ public class RedisUtils { | ||
643 | return 0; | 649 | return 0; |
644 | } | 650 | } |
645 | } | 651 | } |
652 | + /** | ||
653 | + * set方式设置值 | ||
654 | + * | ||
655 | + * @param key 键 | ||
656 | + * @param count 移除多少个 | ||
657 | + * @param value 值 | ||
658 | + * @return 移除的个数 | ||
659 | + */ | ||
660 | + public boolean saddWithExpiry(String key, Object value, long time, TimeUnit timeUnit) { | ||
661 | + try { | ||
662 | + redisTemplate.opsForSet().add(key, value); | ||
663 | + if (time > 0) { | ||
664 | + redisTemplate.expire(key, time, timeUnit); | ||
665 | + } | ||
666 | + return true; | ||
667 | + } catch (Exception e) { | ||
668 | + e.printStackTrace(); | ||
669 | + return false; | ||
670 | + } | ||
671 | + } | ||
672 | + /** | ||
673 | + * set方式获取多个值 | ||
674 | + * | ||
675 | + * @param key 键 | ||
676 | + * @param count 移除多少个 | ||
677 | + * @param value 值 | ||
678 | + * @return 移除的个数 | ||
679 | + */ | ||
680 | + public Set<Object> getSetValues(String key) { | ||
681 | + try { | ||
682 | + return redisTemplate.opsForSet().members(key); | ||
683 | + } catch (Exception e) { | ||
684 | + e.printStackTrace(); | ||
685 | + return null; | ||
686 | + } | ||
687 | + } | ||
688 | + | ||
646 | } | 689 | } |
src/main/java/com/order/erp/controller/CalculateProfitController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.order.erp.common.constant.ServerResult; | ||
4 | +import com.order.erp.domain.vo.order.BusinessProfitRatioQueryVO; | ||
5 | +import com.order.erp.domain.vo.order.InnerProfitRatioQueryVO; | ||
6 | +import com.order.erp.service.order.impl.CalculateProfitServiceImpl; | ||
7 | +import org.springframework.validation.annotation.Validated; | ||
8 | +import org.springframework.web.bind.annotation.PostMapping; | ||
9 | +import org.springframework.web.bind.annotation.RequestBody; | ||
10 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
11 | +import org.springframework.web.bind.annotation.RestController; | ||
12 | + | ||
13 | +import javax.annotation.Resource; | ||
14 | +import javax.servlet.http.HttpServletResponse; | ||
15 | +import java.io.IOException; | ||
16 | + | ||
17 | +/** | ||
18 | + * 应收款账单表(InvoiceBillOrder)表控制层 | ||
19 | + * | ||
20 | + * @author makejava | ||
21 | + * @since 2024-08-05 16:26:34 | ||
22 | + */ | ||
23 | +@RestController | ||
24 | +@RequestMapping("/order/erp/calculate_profit") | ||
25 | +public class CalculateProfitController { | ||
26 | + /** | ||
27 | + * 服务对象 | ||
28 | + */ | ||
29 | + @Resource | ||
30 | + private CalculateProfitServiceImpl calculateProfitService; | ||
31 | + | ||
32 | + /** | ||
33 | + * 业务/研发净利润分析 | ||
34 | + * | ||
35 | + * @param queryVO 查询条件 | ||
36 | + * @return 查询结果 | ||
37 | + */ | ||
38 | + @PostMapping("/business_profit_ratio") | ||
39 | + public ServerResult businessProfitRatio(@RequestBody @Validated BusinessProfitRatioQueryVO queryVO) { | ||
40 | + return calculateProfitService.businessProfitRatio(queryVO); | ||
41 | + } | ||
42 | + | ||
43 | + /** | ||
44 | + * 业务/研发净利润分析-导出 | ||
45 | + * | ||
46 | + * @param queryVO 查询条件 | ||
47 | + * @return 查询结果 | ||
48 | + */ | ||
49 | + @PostMapping("/business_profit_ratio_export") | ||
50 | + public void businessProfitRatioExport(HttpServletResponse response, @RequestBody @Validated BusinessProfitRatioQueryVO queryVO) throws IOException { | ||
51 | + calculateProfitService.businessProfitRatioExport(response, queryVO); | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * 内部生产净利润分析表 | ||
56 | + * | ||
57 | + * @param queryVO 查询条件 | ||
58 | + * @return 查询结果 | ||
59 | + */ | ||
60 | + @PostMapping("/inner_profit_ratio") | ||
61 | + public ServerResult innerProfitRatio(@RequestBody @Validated InnerProfitRatioQueryVO queryVO) { | ||
62 | + return calculateProfitService.innerProfitRatio(queryVO); | ||
63 | + } | ||
64 | + | ||
65 | + /** | ||
66 | + * 内部生产净利润分析表-导出 | ||
67 | + * | ||
68 | + * @param queryVO 查询条件 | ||
69 | + * @return 查询结果 | ||
70 | + */ | ||
71 | + @PostMapping("/inner_profit_ratio_export") | ||
72 | + public void innerProfitRatioExport(HttpServletResponse response,@RequestBody @Validated InnerProfitRatioQueryVO queryVO) throws IOException { | ||
73 | + calculateProfitService.innerProfitRatioExport(response,queryVO); | ||
74 | + } | ||
75 | +} | ||
76 | + |
src/main/java/com/order/erp/controller/InvoiceBillOrderController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.order.erp.common.annotation.AnonymousAccess; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.common.excel4j.exceptions.Excel4JException; | ||
6 | +import com.order.erp.common.jsr303.OperateGroup; | ||
7 | +import com.order.erp.domain.dto.order.InvoiceBillOrderDO; | ||
8 | +import com.order.erp.domain.vo.order.*; | ||
9 | +import com.order.erp.service.order.InvoiceBillOrderService; | ||
10 | +import io.swagger.annotations.ApiOperation; | ||
11 | +import org.springframework.validation.annotation.Validated; | ||
12 | +import org.springframework.web.bind.annotation.PostMapping; | ||
13 | +import org.springframework.web.bind.annotation.RequestBody; | ||
14 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
15 | +import org.springframework.web.bind.annotation.RestController; | ||
16 | + | ||
17 | +import javax.annotation.Resource; | ||
18 | +import javax.servlet.http.HttpServletResponse; | ||
19 | +import java.io.IOException; | ||
20 | + | ||
21 | +/** | ||
22 | + * 应收款账单表(InvoiceBillOrder)表控制层 | ||
23 | + * | ||
24 | + * @author makejava | ||
25 | + * @since 2024-08-05 16:26:34 | ||
26 | + */ | ||
27 | +@RestController | ||
28 | +@RequestMapping("/order/erp/invoice_bill") | ||
29 | +public class InvoiceBillOrderController { | ||
30 | + /** | ||
31 | + * 服务对象 | ||
32 | + */ | ||
33 | + @Resource | ||
34 | + private InvoiceBillOrderService invoiceBillOrderService; | ||
35 | + | ||
36 | + /** | ||
37 | + * 分页查询 | ||
38 | + * | ||
39 | + * @param invoiceBillOrderQueryVO 查询条件 | ||
40 | + * @return 查询结果 | ||
41 | + */ | ||
42 | + @PostMapping("/list_by_page") | ||
43 | + public ServerResult listByPage(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | ||
44 | + return invoiceBillOrderService.listByPage(invoiceBillOrderQueryVO); | ||
45 | + } | ||
46 | + | ||
47 | + /** | ||
48 | + * 基础订单查询 | ||
49 | + * | ||
50 | + * @param queryVO 查询条件 | ||
51 | + * @return 查询结果 | ||
52 | + */ | ||
53 | + @PostMapping("/list_base_order_info_by") | ||
54 | + public ServerResult listBaseOrderInfoBy(@RequestBody @Validated InvoiceBaseOrderQueryVO queryVO) { | ||
55 | + return invoiceBillOrderService.listBaseOrderInfoBy(queryVO); | ||
56 | + } | ||
57 | + | ||
58 | + /** | ||
59 | + * 分析列表 | ||
60 | + * | ||
61 | + * @param queryVO 查询条件 | ||
62 | + * @return 查询结果 | ||
63 | + */ | ||
64 | + @PostMapping("/list_analysis_by") | ||
65 | + public ServerResult listAnalysisBy(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillAnalysisVO queryVO) { | ||
66 | + return invoiceBillOrderService.listAnalysisBy(queryVO); | ||
67 | + } | ||
68 | + | ||
69 | + /** | ||
70 | + * 导出分析列表 | ||
71 | + * | ||
72 | + * @param queryVO 查询条件 | ||
73 | + * @return 查询结果 | ||
74 | + */ | ||
75 | + @PostMapping(value = "/export") | ||
76 | + @ApiOperation("导出分析列表") | ||
77 | + @AnonymousAccess | ||
78 | + public void export(HttpServletResponse response, @RequestBody @Validated InvoiceBillAnalysisVO queryVO) throws IOException, Excel4JException { | ||
79 | + invoiceBillOrderService.export(response, queryVO); | ||
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 创建invoice单据 | ||
84 | + * | ||
85 | + * @param createVO 数据VO | ||
86 | + * @return 新增结果 | ||
87 | + */ | ||
88 | + @PostMapping("/create") | ||
89 | + public ServerResult create(@RequestBody InvoiceBillCreateVO createVO) { | ||
90 | + return invoiceBillOrderService.create(createVO); | ||
91 | + } | ||
92 | + | ||
93 | + /** | ||
94 | + * 获取必须回款日期 | ||
95 | + * | ||
96 | + * @param createVO 数据VO | ||
97 | + * @return 新增结果 | ||
98 | + */ | ||
99 | + @PostMapping("/get_back_refund_date") | ||
100 | + public ServerResult getBackRefundDate(@RequestBody InvoiceBillCreateVO createVO) { | ||
101 | + return invoiceBillOrderService.getBackRefundDate(createVO); | ||
102 | + } | ||
103 | + | ||
104 | + /** | ||
105 | + * 更新扣款信息 | ||
106 | + * | ||
107 | + * @param deductInfoVO 数据VO | ||
108 | + * @return 编辑结果 | ||
109 | + */ | ||
110 | + @PostMapping("/update_deduct_info") | ||
111 | + public ServerResult updateDeductInfo(@RequestBody InvoiceBillDeductInfoVO deductInfoVO) { | ||
112 | + return invoiceBillOrderService.updateDeductInfo(deductInfoVO); | ||
113 | + } | ||
114 | + | ||
115 | + /** | ||
116 | + * 更新其他金额信息 | ||
117 | + * | ||
118 | + * @param amountInfoVO 数据VO | ||
119 | + * @return 编辑结果 | ||
120 | + */ | ||
121 | + @PostMapping("/update_amount_info") | ||
122 | + public ServerResult updateAmountInfo(@RequestBody InvoiceBillAmountInfoVO amountInfoVO) { | ||
123 | + return invoiceBillOrderService.updateAmountInfo(amountInfoVO); | ||
124 | + } | ||
125 | + | ||
126 | + /** | ||
127 | + * 提交审核 | ||
128 | + * | ||
129 | + * @param commitApplyVO 数据VO | ||
130 | + * @return 编辑结果 | ||
131 | + */ | ||
132 | + @PostMapping("/commit_apply") | ||
133 | + public ServerResult commitApply(@RequestBody InvoiceBillCommitApplyVO commitApplyVO) { | ||
134 | + return invoiceBillOrderService.commitApply(commitApplyVO); | ||
135 | + } | ||
136 | + | ||
137 | + /** | ||
138 | + * 删除数据 | ||
139 | + * | ||
140 | + * @param invoiceBillOrderQueryVO 查询条件 | ||
141 | + * @return 删除是否成功 | ||
142 | + */ | ||
143 | + @PostMapping("/delete_by_id") | ||
144 | + public ServerResult deleteById(@RequestBody InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | ||
145 | + return invoiceBillOrderService.deleteById(invoiceBillOrderQueryVO); | ||
146 | + } | ||
147 | + /** | ||
148 | + * 获取扣款单 | ||
149 | + * | ||
150 | + * @param invoiceBillOrderQueryVO 查询条件 | ||
151 | + * @return 扣款单 | ||
152 | + */ | ||
153 | + @PostMapping("/getDeductUrl_by_id") | ||
154 | + public ServerResult getDeductUrl(@RequestBody InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | ||
155 | + return invoiceBillOrderService.getDeductUrlById(invoiceBillOrderQueryVO); | ||
156 | + } | ||
157 | + /** | ||
158 | + * 重新上传报关单 | ||
159 | + * | ||
160 | + * @param bgUrl 报关单 | ||
161 | + * @return | ||
162 | + */ | ||
163 | + @PostMapping("/reUploadBgUrl") | ||
164 | + public ServerResult getDeductUrl(@RequestBody InvoiceBillCreateVO bgUrl) { | ||
165 | + return invoiceBillOrderService.reUploadBgurl(bgUrl); | ||
166 | + } | ||
167 | + | ||
168 | + /** | ||
169 | + * 审核时导出的付款单 | ||
170 | + * @param queryVO 报关单 | ||
171 | + * @return | ||
172 | + */ | ||
173 | + @PostMapping("/exportReceipt") | ||
174 | + @AnonymousAccess | ||
175 | + public void exportReceipt(HttpServletResponse response, @RequestBody InvoiceBillOrderDO queryVO) throws IOException { | ||
176 | + invoiceBillOrderService.exportReceipt(response,queryVO); | ||
177 | + } | ||
178 | + | ||
179 | +} | ||
180 | + |
src/main/java/com/order/erp/controller/ProducePaymentCheckBillOrderController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.order.erp.common.annotation.AnonymousAccess; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.common.excel4j.exceptions.Excel4JException; | ||
6 | +import com.order.erp.common.jsr303.OperateGroup; | ||
7 | +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO; | ||
8 | +import com.order.erp.domain.vo.order.*; | ||
9 | +import com.order.erp.service.order.ProducePaymentCheckBillOrderService; | ||
10 | +import io.swagger.annotations.ApiOperation; | ||
11 | +import org.springframework.validation.annotation.Validated; | ||
12 | +import org.springframework.web.bind.annotation.PostMapping; | ||
13 | +import org.springframework.web.bind.annotation.RequestBody; | ||
14 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
15 | +import org.springframework.web.bind.annotation.RestController; | ||
16 | + | ||
17 | +import javax.annotation.Resource; | ||
18 | +import javax.servlet.http.HttpServletResponse; | ||
19 | +import java.io.IOException; | ||
20 | + | ||
21 | +/** | ||
22 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表控制 | ||
23 | + * | ||
24 | + * @author makejava | ||
25 | + * @since 2024-08-05 16:26:35 | ||
26 | + */ | ||
27 | +@RestController | ||
28 | +@RequestMapping("/order/erp/check_bill/") | ||
29 | +public class ProducePaymentCheckBillOrderController { | ||
30 | + /** | ||
31 | + * 服务对象 | ||
32 | + */ | ||
33 | + @Resource | ||
34 | + private ProducePaymentCheckBillOrderService producePaymentCheckBillOrderService; | ||
35 | + | ||
36 | + /** | ||
37 | + * 分页查询 | ||
38 | + * | ||
39 | + * @param queryVO 查询条件 | ||
40 | + * @return 查询结果 | ||
41 | + */ | ||
42 | + @PostMapping("/list_by_page") | ||
43 | + public ServerResult listByPage(@RequestBody @Validated({OperateGroup.List.class}) ProducePaymentCheckBillOrderQueryVO queryVO) { | ||
44 | + return producePaymentCheckBillOrderService.listByPage(queryVO); | ||
45 | + } | ||
46 | + | ||
47 | + /** | ||
48 | + * 基础订单查询 | ||
49 | + * | ||
50 | + * @param queryVO 查询条件 | ||
51 | + * @return 查询结果 | ||
52 | + */ | ||
53 | + @PostMapping("/list_base_order_info_by") | ||
54 | + public ServerResult listBaseOrderInfoBy(@RequestBody @Validated ProducePaymentBaseOrderQueryVO queryVO) { | ||
55 | + return producePaymentCheckBillOrderService.listBaseOrderInfoBy(queryVO); | ||
56 | + } | ||
57 | + | ||
58 | + /** | ||
59 | + * 分析列表 | ||
60 | + * | ||
61 | + * @param queryVO 查询条件 | ||
62 | + * @return 查询结果 | ||
63 | + */ | ||
64 | + @PostMapping("/list_analysis_by") | ||
65 | + public ServerResult listAnalysisBy(@RequestBody @Validated({OperateGroup.List.class}) ProducePaymentCheckBillOrderQueryVO queryVO) { | ||
66 | + return producePaymentCheckBillOrderService.listAnalysisBy(queryVO); | ||
67 | + } | ||
68 | + | ||
69 | + /** | ||
70 | + * 导出分析列表 | ||
71 | + * | ||
72 | + * @param queryVO 查询条件 | ||
73 | + * @return 查询结果 | ||
74 | + */ | ||
75 | + @PostMapping(value = "/export") | ||
76 | + @ApiOperation("导出分析列表") | ||
77 | + @AnonymousAccess | ||
78 | + public void export(HttpServletResponse response, @RequestBody @Validated ProducePaymentCheckBillOrderQueryVO queryVO) throws IOException, Excel4JException { | ||
79 | + producePaymentCheckBillOrderService.export(response, queryVO); | ||
80 | + } | ||
81 | + | ||
82 | + /** | ||
83 | + * 创建生产科应付单据 | ||
84 | + * | ||
85 | + * @param createVO 数据VO | ||
86 | + * @return 新增结果 | ||
87 | + */ | ||
88 | + @PostMapping("/create") | ||
89 | + public ServerResult create(@RequestBody ProducePaymentCheckBillCreateVO createVO) { | ||
90 | + return producePaymentCheckBillOrderService.create(createVO); | ||
91 | + } | ||
92 | + | ||
93 | + /** | ||
94 | + * 获取生产科应回款日期 | ||
95 | + * | ||
96 | + * @param createVO 数据VO | ||
97 | + * @return 新增结果 | ||
98 | + */ | ||
99 | + @PostMapping("/get_payed_date") | ||
100 | + public ServerResult getPayedDate(@RequestBody ProducePaymentCheckBillCreateVO createVO) { | ||
101 | + return producePaymentCheckBillOrderService.getPayedDate(createVO); | ||
102 | + } | ||
103 | + | ||
104 | + /** | ||
105 | + * 更新扣款信息 | ||
106 | + * | ||
107 | + * @param deductInfoVO 数据VO | ||
108 | + * @return 编辑结果 | ||
109 | + */ | ||
110 | + @PostMapping("/update_deduct_info") | ||
111 | + public ServerResult updateDeductInfo(@RequestBody ProducePaymentCheckBillDeductInfoVO deductInfoVO) { | ||
112 | + return producePaymentCheckBillOrderService.updateDeductInfo(deductInfoVO); | ||
113 | + } | ||
114 | + | ||
115 | + /** | ||
116 | + * 更新其他金额信息 | ||
117 | + * | ||
118 | + * @param amountInfoVO 数据VO | ||
119 | + * @return 编辑结果 | ||
120 | + */ | ||
121 | + @PostMapping("/update_amount_info") | ||
122 | + public ServerResult updateAmountInfo(@RequestBody ProducePaymentCheckBillAmountInfoVO amountInfoVO) { | ||
123 | + return producePaymentCheckBillOrderService.updateAmountInfo(amountInfoVO); | ||
124 | + } | ||
125 | + | ||
126 | + /** | ||
127 | + * 更新发票信息 | ||
128 | + * | ||
129 | + * @param invoiceInfoVO 数据VO | ||
130 | + * @return 编辑结果 | ||
131 | + */ | ||
132 | + @PostMapping("/update_invoice_info") | ||
133 | + public ServerResult updateInvoiceInfo(@RequestBody ProducePaymentCheckBillInvoiceInfoVO invoiceInfoVO) { | ||
134 | + return producePaymentCheckBillOrderService.updateInvoiceInfo(invoiceInfoVO); | ||
135 | + } | ||
136 | + | ||
137 | + /** | ||
138 | + * 提交审核 | ||
139 | + * | ||
140 | + * @param commitApplyVO 数据VO | ||
141 | + * @return 编辑结果 | ||
142 | + */ | ||
143 | + @PostMapping("/commit_apply") | ||
144 | + public ServerResult commitApply(@RequestBody ProducePaymentCheckBillCommitApplyVO commitApplyVO) { | ||
145 | + return producePaymentCheckBillOrderService.commitApply(commitApplyVO); | ||
146 | + } | ||
147 | + | ||
148 | + /** | ||
149 | + * 删除数据 | ||
150 | + * | ||
151 | + * @param producePaymentCheckBillOrderQueryVO 查询条件 | ||
152 | + * @return 删除是否成功 | ||
153 | + */ | ||
154 | + @PostMapping("/delete_by_id") | ||
155 | + public ServerResult deleteById(@RequestBody ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | ||
156 | + return producePaymentCheckBillOrderService.deleteById(producePaymentCheckBillOrderQueryVO); | ||
157 | + } | ||
158 | + /** | ||
159 | + * 获取扣款单 | ||
160 | + * | ||
161 | + * @param producePaymentCheckBillOrderQueryVO 查询条件 | ||
162 | + * @return 扣款单 | ||
163 | + */ | ||
164 | + @PostMapping("/getDeductUrl_by_id") | ||
165 | + public ServerResult getDeductUrl(@RequestBody ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | ||
166 | + //一定要保证文件中包含?和/.这样才不会报错。 | ||
167 | + return producePaymentCheckBillOrderService.getDeductUrlById(producePaymentCheckBillOrderQueryVO); | ||
168 | + } | ||
169 | + /** | ||
170 | + * 获取生产科发票 | ||
171 | + * | ||
172 | + * @param producePaymentCheckBillOrderQueryVO 查询条件 | ||
173 | + * @return 扣款单 | ||
174 | + */ | ||
175 | + @PostMapping("/getInvoiceUrl_by_id") | ||
176 | + public ServerResult getInvoiceUrl(@RequestBody ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) { | ||
177 | + return producePaymentCheckBillOrderService.getInvoiceUrlById(producePaymentCheckBillOrderQueryVO); | ||
178 | + } | ||
179 | + /** | ||
180 | + * 审核付款单导出 | ||
181 | + * | ||
182 | + * @param queryVO 查询条件 | ||
183 | + * @return 扣款单 | ||
184 | + */ | ||
185 | + @PostMapping("/exportReceipt") | ||
186 | + @AnonymousAccess | ||
187 | + public void exportReceipt(HttpServletResponse response, @RequestBody ProducePaymentCheckBillOrderDO queryVO) throws IOException { | ||
188 | + producePaymentCheckBillOrderService.exportReceipt(response,queryVO); | ||
189 | + } | ||
190 | +} | ||
191 | + |
src/main/java/com/order/erp/domain/ApplyStatusEnum.java
@@ -13,6 +13,8 @@ import lombok.Getter; | @@ -13,6 +13,8 @@ import lombok.Getter; | ||
13 | @AllArgsConstructor | 13 | @AllArgsConstructor |
14 | public enum ApplyStatusEnum { | 14 | public enum ApplyStatusEnum { |
15 | 15 | ||
16 | + NO_COMMIT(-1, "未提交审核"), | ||
17 | + | ||
16 | WAIT_AUDIT(0, "待审批"), | 18 | WAIT_AUDIT(0, "待审批"), |
17 | 19 | ||
18 | AUDIT_PASS(10, "已通过"), | 20 | AUDIT_PASS(10, "已通过"), |
src/main/java/com/order/erp/domain/ApplyTypeEnum.java
@@ -18,6 +18,12 @@ public enum ApplyTypeEnum { | @@ -18,6 +18,12 @@ public enum ApplyTypeEnum { | ||
18 | ORDER_PROFIT_APPLY(10, "利润分析申请"), | 18 | ORDER_PROFIT_APPLY(10, "利润分析申请"), |
19 | 19 | ||
20 | ORDER_REPORT_APPLY(20, "项目报告书申请"), | 20 | ORDER_REPORT_APPLY(20, "项目报告书申请"), |
21 | + | ||
22 | + INVOICE_BILL_APPLY(30, "应收账单申请"), | ||
23 | + | ||
24 | + CHECK_BILL_APPLY(40, "应付账单申请"), | ||
25 | + | ||
26 | + DEPARTMENT_INVOICE_APPLY(50,"生产科发票申请"), | ||
21 | ; | 27 | ; |
22 | private Integer type; | 28 | private Integer type; |
23 | 29 |
src/main/java/com/order/erp/domain/FinanceOverEnum.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import lombok.AllArgsConstructor; | ||
4 | +import lombok.Getter; | ||
5 | + | ||
6 | +@Getter | ||
7 | +@AllArgsConstructor | ||
8 | +public enum FinanceOverEnum { | ||
9 | + INVOICE_OVERTIME("你有invoice应收款未提交,请查收","Hi All 你以下invoice已超过回款日期,仍未生成应收款对账单提交审核,麻烦财务查询是否已打款,如未打款请业务员及时跟进\n。Invoice号为:"), | ||
10 | + PRODUCE_PAYMENT_CHECK_OVERTIME("你有生产科对账单未提交,请查收","Hi All 你以下生产科对账单已超过应付款日期,麻烦财务查询是否已打款,如未打款请说明原因,如未收到发票,请业务员及时跟进\n。生产科对账单号为:"), | ||
11 | + ; | ||
12 | + | ||
13 | + private String title; | ||
14 | + private String desc; | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/domain/RoleEnum.java
@@ -19,6 +19,7 @@ public enum RoleEnum { | @@ -19,6 +19,7 @@ public enum RoleEnum { | ||
19 | INSPECT_USER("inspect_user", 4L, "质检员"), | 19 | INSPECT_USER("inspect_user", 4L, "质检员"), |
20 | DATA_REPORT_USER("data_report_user", 5L, "数据分析员"), | 20 | DATA_REPORT_USER("data_report_user", 5L, "数据分析员"), |
21 | PRODUCE_USER("produce_user", 6L, "生产科"), | 21 | PRODUCE_USER("produce_user", 6L, "生产科"), |
22 | + FINANCE_USER("finance_user", 7L, "财务"), | ||
22 | ; | 23 | ; |
23 | private String code; | 24 | private String code; |
24 | 25 |
src/main/java/com/order/erp/domain/dto/order/CheckBillMappingDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 生产科对账单应收账单映射表(CheckBillMapping)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:36 | ||
15 | + */ | ||
16 | +@TableName("check_bill_mapping") | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class CheckBillMappingDO extends BaseDO implements Serializable { | ||
24 | + private static final long serialVersionUID = 199786248752278040L; | ||
25 | + | ||
26 | + private Long id; | ||
27 | + /** | ||
28 | + * 生产科对账单号 | ||
29 | + */ | ||
30 | + private String checkNo; | ||
31 | + /** | ||
32 | + * check账单id | ||
33 | + */ | ||
34 | + private Long checkBillId; | ||
35 | + /** | ||
36 | + * 订单id | ||
37 | + */ | ||
38 | + private Long orderId; | ||
39 | + | ||
40 | +} |
src/main/java/com/order/erp/domain/dto/order/InvoiceBillMappingDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:36 | ||
15 | + */ | ||
16 | +@TableName("invoice_bill_mapping") | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class InvoiceBillMappingDO extends BaseDO implements Serializable { | ||
24 | + | ||
25 | + private Long id; | ||
26 | + /** | ||
27 | + * 发票单号 | ||
28 | + */ | ||
29 | + private String invoiceNo; | ||
30 | + /** | ||
31 | + * invoice账单id | ||
32 | + */ | ||
33 | + private Long invoiceBillId; | ||
34 | + /** | ||
35 | + * 订单id | ||
36 | + */ | ||
37 | + private Long orderId; | ||
38 | + | ||
39 | +} |
src/main/java/com/order/erp/domain/dto/order/InvoiceBillOrderDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | +import java.math.BigDecimal; | ||
10 | + | ||
11 | +/** | ||
12 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2024-08-05 16:26:33 | ||
16 | + */ | ||
17 | +@TableName("invoice_bill_order") | ||
18 | +@Data | ||
19 | +@AllArgsConstructor | ||
20 | +@ToString | ||
21 | +@NoArgsConstructor | ||
22 | +@EqualsAndHashCode(callSuper = false) | ||
23 | +@SuperBuilder | ||
24 | +public class InvoiceBillOrderDO extends BaseDO implements Serializable { | ||
25 | + | ||
26 | + private Long id; | ||
27 | + /** | ||
28 | + * 发票单号 | ||
29 | + */ | ||
30 | + private String invoiceNo; | ||
31 | + /** | ||
32 | + * 报关单url地址 | ||
33 | + */ | ||
34 | + private String bgUrl; | ||
35 | + /** | ||
36 | + * 必须回款日期 | ||
37 | + */ | ||
38 | + private String backRefundDate; | ||
39 | + /** | ||
40 | + * 实际回款日期 | ||
41 | + */ | ||
42 | + private String actualRefundDate; | ||
43 | + | ||
44 | + /** | ||
45 | + * 发生扣款金额 | ||
46 | + */ | ||
47 | + private BigDecimal deductAmount; | ||
48 | + /** | ||
49 | + * 扣款单url地址 | ||
50 | + */ | ||
51 | + private String deductUrl; | ||
52 | + /** | ||
53 | + * 实际应收金额 | ||
54 | + */ | ||
55 | + private BigDecimal actualReceivableAmount; | ||
56 | + /** | ||
57 | + * 实际应付金额1 | ||
58 | + */ | ||
59 | + private BigDecimal actualPayedAmount1; | ||
60 | + /** | ||
61 | + * 实际应付金额2 | ||
62 | + */ | ||
63 | + private BigDecimal actualPayedAmount2; | ||
64 | + /** | ||
65 | + * 实际应付金额3 | ||
66 | + */ | ||
67 | + private BigDecimal actualPayedAmount3; | ||
68 | + /** | ||
69 | + * 其他费用金额 | ||
70 | + */ | ||
71 | + private BigDecimal otherAmount; | ||
72 | + /** | ||
73 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | ||
74 | + */ | ||
75 | + private Integer status; | ||
76 | + //需要在表中添加字段。 | ||
77 | + /** | ||
78 | + * 客户总价金额汇总 | ||
79 | + * */ | ||
80 | + private BigDecimal totalCustomerAmount; | ||
81 | + | ||
82 | + /** | ||
83 | + * 实际付款金额汇总 | ||
84 | + * */ | ||
85 | + private BigDecimal totalPayAmount; | ||
86 | + /** | ||
87 | + * 业务员 | ||
88 | + * */ | ||
89 | + private String businesPerson; | ||
90 | + /** | ||
91 | + * 收款单位 | ||
92 | + * */ | ||
93 | + private String payee; | ||
94 | + /** | ||
95 | + * 财务 --审核时使用。 | ||
96 | + * */ | ||
97 | + private String financePerson; | ||
98 | + | ||
99 | +} |
src/main/java/com/order/erp/domain/dto/order/OrderFieldLockApplyDO.java
@@ -62,5 +62,9 @@ public class OrderFieldLockApplyDO extends BaseDO implements Serializable { | @@ -62,5 +62,9 @@ public class OrderFieldLockApplyDO extends BaseDO implements Serializable { | ||
62 | * 拒绝原因备注 | 62 | * 拒绝原因备注 |
63 | */ | 63 | */ |
64 | private String refuseRemark; | 64 | private String refuseRemark; |
65 | + /** | ||
66 | + * 申请原因备注 | ||
67 | + */ | ||
68 | + private String applyRemark; | ||
65 | 69 | ||
66 | } | 70 | } |
src/main/java/com/order/erp/domain/dto/order/OrderProfitAnalysisDO.java
@@ -70,7 +70,7 @@ public class OrderProfitAnalysisDO extends BaseDO implements Serializable { | @@ -70,7 +70,7 @@ public class OrderProfitAnalysisDO extends BaseDO implements Serializable { | ||
70 | */ | 70 | */ |
71 | private Double packetPrice; | 71 | private Double packetPrice; |
72 | /** | 72 | /** |
73 | - * 包装费用合计¥ | 73 | + * 包装费用合计$ |
74 | */ | 74 | */ |
75 | private Double packetTotalPrice; | 75 | private Double packetTotalPrice; |
76 | 76 |
src/main/java/com/order/erp/domain/dto/order/ProducePaymentCheckBillOrderDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | +import java.math.BigDecimal; | ||
10 | + | ||
11 | +/** | ||
12 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2024-08-05 16:26:35 | ||
16 | + */ | ||
17 | +@TableName("produce_payment_check_bill_order") | ||
18 | +@Data | ||
19 | +@AllArgsConstructor | ||
20 | +@ToString | ||
21 | +@NoArgsConstructor | ||
22 | +@EqualsAndHashCode(callSuper = false) | ||
23 | +@SuperBuilder | ||
24 | +public class ProducePaymentCheckBillOrderDO extends BaseDO implements Serializable { | ||
25 | + | ||
26 | + private Long id; | ||
27 | + /** | ||
28 | + * 生产科对账单 | ||
29 | + */ | ||
30 | + private String checkNo; | ||
31 | + /** | ||
32 | + * 发票url地址 | ||
33 | + */ | ||
34 | + private String invoiceUrl; | ||
35 | + /** | ||
36 | + * 扣款单url地址 | ||
37 | + */ | ||
38 | + private String deductUrl; | ||
39 | + /** | ||
40 | + * 生产科应付款日期 | ||
41 | + */ | ||
42 | + private String payedDate; | ||
43 | + | ||
44 | + /** | ||
45 | + * 生产科实际付款日期 | ||
46 | + */ | ||
47 | + private String actualPayedDate; | ||
48 | + | ||
49 | + /** | ||
50 | + * 生产科扣款责任部门 | ||
51 | + */ | ||
52 | + private String deductDept; | ||
53 | + /** | ||
54 | + * 生产科扣款金额 | ||
55 | + */ | ||
56 | + private BigDecimal deductAmount; | ||
57 | + /** | ||
58 | + * 实际应付金额 | ||
59 | + */ | ||
60 | + private BigDecimal actualPayedAmount; | ||
61 | + /** | ||
62 | + * 实际应付金额1 | ||
63 | + */ | ||
64 | + private BigDecimal actualPayedAmount1; | ||
65 | + /** | ||
66 | + * 实际应付金额2 | ||
67 | + */ | ||
68 | + private BigDecimal actualPayedAmount2; | ||
69 | + /** | ||
70 | + * 实际应付金额3 | ||
71 | + */ | ||
72 | + private BigDecimal actualPayedAmount3; | ||
73 | + /** | ||
74 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | ||
75 | + */ | ||
76 | + private Integer status; | ||
77 | + //需要在表中添加三个字段。 | ||
78 | + /** | ||
79 | + * 生产科发票审核状态 0:待审核、1:审核通过,2:审核驳回 | ||
80 | + */ | ||
81 | + private Integer departmentInvoiceStatus; | ||
82 | + | ||
83 | + /** | ||
84 | + * 生产科总金额汇总 | ||
85 | + * */ | ||
86 | + private BigDecimal totalProductionAmount; | ||
87 | + /** | ||
88 | + * 实际付款金额汇总 | ||
89 | + * */ | ||
90 | + private BigDecimal totalActualPayedAmount; | ||
91 | + /** | ||
92 | + * 创建生产科对账单号选择的生产科 | ||
93 | + * */ | ||
94 | + private String productionName; | ||
95 | + /** | ||
96 | + * 未付金额 | ||
97 | + * */ | ||
98 | + private BigDecimal unPayedAmount; | ||
99 | + /** | ||
100 | + * 业务员 | ||
101 | + * */ | ||
102 | + private String businesPerson; | ||
103 | + /** | ||
104 | + * 财务 --审核时使用。 | ||
105 | + * */ | ||
106 | + private String financePerson; | ||
107 | + | ||
108 | + | ||
109 | +} |
src/main/java/com/order/erp/domain/vo/CostSettingItemVO.java
0 → 100644
1 | +package com.order.erp.domain.vo; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 系统配置(SystemSetting)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2023-12-05 13:44:01 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class CostSettingItemVO implements Serializable { | ||
21 | + | ||
22 | + /** | ||
23 | + * 关联code | ||
24 | + */ | ||
25 | + private String relationCode; | ||
26 | + /** | ||
27 | + * 名称 | ||
28 | + */ | ||
29 | + private String relationName; | ||
30 | + /** | ||
31 | + * 值 | ||
32 | + */ | ||
33 | + private String relationValue; | ||
34 | + | ||
35 | + | ||
36 | +} |
src/main/java/com/order/erp/domain/vo/SystemSettingResultVO.java
@@ -4,6 +4,7 @@ import lombok.*; | @@ -4,6 +4,7 @@ import lombok.*; | ||
4 | import lombok.experimental.SuperBuilder; | 4 | import lombok.experimental.SuperBuilder; |
5 | 5 | ||
6 | import java.io.Serializable; | 6 | import java.io.Serializable; |
7 | +import java.util.List; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * @author makejava | 10 | * @author makejava |
@@ -47,5 +48,9 @@ public class SystemSettingResultVO implements Serializable { | @@ -47,5 +48,9 @@ public class SystemSettingResultVO implements Serializable { | ||
47 | */ | 48 | */ |
48 | private String relationValue; | 49 | private String relationValue; |
49 | 50 | ||
51 | + /** | ||
52 | + * 成本配置 | ||
53 | + */ | ||
54 | + private List<CostSettingItemVO> costSettingItemVOS; | ||
50 | 55 | ||
51 | } | 56 | } |
src/main/java/com/order/erp/domain/vo/SystemSettingVO.java
@@ -4,6 +4,7 @@ import lombok.*; | @@ -4,6 +4,7 @@ import lombok.*; | ||
4 | import lombok.experimental.SuperBuilder; | 4 | import lombok.experimental.SuperBuilder; |
5 | 5 | ||
6 | import java.io.Serializable; | 6 | import java.io.Serializable; |
7 | +import java.util.List; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * 系统配置(SystemSetting)实体类 | 10 | * 系统配置(SystemSetting)实体类 |
@@ -49,5 +50,8 @@ public class SystemSettingVO implements Serializable { | @@ -49,5 +50,8 @@ public class SystemSettingVO implements Serializable { | ||
49 | */ | 50 | */ |
50 | private String relationValue; | 51 | private String relationValue; |
51 | 52 | ||
52 | - | 53 | + /** |
54 | + * 成本配置 | ||
55 | + */ | ||
56 | + private List<CostSettingItemVO> costSettingItemVOS; | ||
53 | } | 57 | } |
src/main/java/com/order/erp/domain/vo/order/BusinessProfitRatioQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import javax.validation.constraints.NotEmpty; | ||
8 | +import javax.validation.constraints.NotNull; | ||
9 | +import java.io.Serializable; | ||
10 | +import java.math.BigDecimal; | ||
11 | +import java.util.List; | ||
12 | + | ||
13 | +/** | ||
14 | + * 业务/研发净利润分析 | ||
15 | + * | ||
16 | + * @author makejava | ||
17 | + * @since 2024-08-05 16:26:34 | ||
18 | + */ | ||
19 | +@Data | ||
20 | +@AllArgsConstructor | ||
21 | +@ToString | ||
22 | +@NoArgsConstructor | ||
23 | +@EqualsAndHashCode(callSuper = false) | ||
24 | +@SuperBuilder | ||
25 | +public class BusinessProfitRatioQueryVO extends BasePageVO implements Serializable { | ||
26 | + /** | ||
27 | + * ids | ||
28 | + */ | ||
29 | + @NotEmpty(message = "选择订单不能为空") | ||
30 | + private List<Long> ids; | ||
31 | + | ||
32 | + /** | ||
33 | + * 客户编码 | ||
34 | + */ | ||
35 | + @NotEmpty(message = "客户编码不能为空") | ||
36 | + private String customerCode; | ||
37 | + | ||
38 | + /** | ||
39 | + * 项目号 | ||
40 | + */ | ||
41 | + @NotEmpty(message = "项目号不能为空") | ||
42 | + private List<String> projectNo; | ||
43 | + | ||
44 | + /** | ||
45 | + * 项目开发开始时间 | ||
46 | + */ | ||
47 | + @NotEmpty(message = "项目开发开始时间不能为空") | ||
48 | + private String projectStartTime; | ||
49 | + | ||
50 | + /** | ||
51 | + * 项目开发结束时间 | ||
52 | + */ | ||
53 | + @NotEmpty(message = "项目开发结束时间不能为空") | ||
54 | + private String projectEndTime; | ||
55 | + | ||
56 | + /** | ||
57 | + * 生产进行开始时间 这个没有使用过,应该不需要,所以应该不需要校验。 | ||
58 | + */ | ||
59 | + @NotEmpty(message = "生产进行开始时间不能为空") | ||
60 | + private String produceStartTime; | ||
61 | + | ||
62 | + /** | ||
63 | + * 生产进行结束时间 这个没有使用过,应该不需要,所以应该不需要校验。 | ||
64 | + */ | ||
65 | + @NotEmpty(message = "生产进行结束时间不能为空") | ||
66 | + private String produceEndTime; | ||
67 | + | ||
68 | + | ||
69 | + /** | ||
70 | + * 研发开发费合计 | ||
71 | + */ | ||
72 | + @NotNull(message = "研发开发费合计不能为空") | ||
73 | + private BigDecimal developTotalPrice; | ||
74 | + | ||
75 | + /** | ||
76 | + * 复制费合计 | ||
77 | + */ | ||
78 | + @NotNull(message = "复制费合计不能为空") | ||
79 | + private BigDecimal copyTotalPrice; | ||
80 | + | ||
81 | + | ||
82 | + /** | ||
83 | + * 西班牙提成比例 这个没有使用过,采用的是从系统中取出来的值。 应该可以删除。 | ||
84 | + */ | ||
85 | +// @NotNull(message = "西班牙提成比例不能为空") | ||
86 | + private Double spainRatio; | ||
87 | + | ||
88 | + /** | ||
89 | + * 中国团队提成比例 这个没有使用过,采用的是从系统中取出来的值。 应该可以删除。 | ||
90 | + */ | ||
91 | +// @NotNull(message = "中国团队提成比例不能为空") | ||
92 | + private Double chinaRatio; | ||
93 | + | ||
94 | + | ||
95 | + /** | ||
96 | + * 包装费用实际金额由财务手动输入 | ||
97 | + */ | ||
98 | + @NotNull(message = "包装费用实际金额不能为空") | ||
99 | + private BigDecimal packetActualTotalPrice; | ||
100 | + | ||
101 | + | ||
102 | + /** | ||
103 | + * 实际跟单单价=实际跟单费用/件数(人民币格式) | ||
104 | + */ | ||
105 | +// @NotNull(message = "实际跟单单价不能为空") | ||
106 | + private Double actualRmbPrice; | ||
107 | + | ||
108 | + /** | ||
109 | + * 实际跟单单价折算美金:人民币单价/汇率(6.2) | ||
110 | + */ | ||
111 | +// @NotNull(message = "实际跟单单价折算美金不能为空") | ||
112 | + private Double actualPrice; | ||
113 | + | ||
114 | + /** | ||
115 | + * 实际汇率(财务手动输入) | ||
116 | + */ | ||
117 | + @NotNull(message = "实际汇率不能为空") | ||
118 | + private BigDecimal actualRatio; | ||
119 | + /** | ||
120 | + * 实际跟单费用(财务手动输入) | ||
121 | + */ | ||
122 | +// @NotNull(message = "实际跟单费用不能为空") | ||
123 | + private Double actualdocumentaryPrice; | ||
124 | + | ||
125 | +} | ||
126 | + |
src/main/java/com/order/erp/domain/vo/order/BusinessProfitRatioResultVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 业务/研发净利润分析 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:34 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class BusinessProfitRatioResultVO implements Serializable { | ||
22 | + | ||
23 | + | ||
24 | + /** | ||
25 | + * 客户编码 | ||
26 | + */ | ||
27 | + private String customerCode; | ||
28 | + | ||
29 | + /** | ||
30 | + * 项目号 | ||
31 | + */ | ||
32 | + private String projectNo; | ||
33 | + | ||
34 | + /** | ||
35 | + * 项目开发开始时间 | ||
36 | + */ | ||
37 | + private String projectStartTime; | ||
38 | + | ||
39 | + /** | ||
40 | + * 项目开发结束时间 | ||
41 | + */ | ||
42 | + private String projectEndTime; | ||
43 | + | ||
44 | + /** | ||
45 | + * 生产进行开始时间 | ||
46 | + */ | ||
47 | + private String produceStartTime; | ||
48 | + | ||
49 | + /** | ||
50 | + * 生产进行结束时间 | ||
51 | + */ | ||
52 | + private String produceEndTime; | ||
53 | + | ||
54 | + /** | ||
55 | + * 客户总价$ | ||
56 | + */ | ||
57 | + private BigDecimal customerTotalPrice; | ||
58 | + | ||
59 | + /** | ||
60 | + * 生成科总价¥ | ||
61 | + */ | ||
62 | + private BigDecimal productionDepartmentTotalPrice; | ||
63 | + | ||
64 | + /** | ||
65 | + * 包装费用合计¥ | ||
66 | + */ | ||
67 | + private BigDecimal packetTotalPrice; | ||
68 | + | ||
69 | + /** | ||
70 | + * 研发开发费合计 | ||
71 | + */ | ||
72 | + private BigDecimal developTotalPrice; | ||
73 | + | ||
74 | + /** | ||
75 | + * 复制费合计 | ||
76 | + */ | ||
77 | + private BigDecimal copyTotalPrice; | ||
78 | + | ||
79 | + /** | ||
80 | + * 固定成本 | ||
81 | + * 开发持续时间*日固定成本(日固定成本需要从系统配置读取) | ||
82 | + */ | ||
83 | + private BigDecimal fixCost; | ||
84 | + | ||
85 | + /** | ||
86 | + * 西班牙提成比例 | ||
87 | + */ | ||
88 | + private BigDecimal spainRatioProfitPrice; | ||
89 | + | ||
90 | + /** | ||
91 | + * 中国团队提成比例 | ||
92 | + */ | ||
93 | + private BigDecimal chinaRatioProfitPrice; | ||
94 | + | ||
95 | + /** | ||
96 | + * 支出合计计算:客户总金额+生产科总价+包装费用+研发开发费+复制费用+固定成本+西班牙提成+中国团队提成 | ||
97 | + */ | ||
98 | + private BigDecimal outTotalPrice; | ||
99 | + | ||
100 | + /** | ||
101 | + * 毛利润 | ||
102 | + * 订单收入-Loca费用-跟单费用(正数黑色字体、负数红色字体并加上-号) | ||
103 | + */ | ||
104 | + private BigDecimal grossProfit; | ||
105 | + | ||
106 | + /** | ||
107 | + * 研发贸易利润 | ||
108 | + * 客户金额合计-支出合计(正数黑色字体、负数红色字体并加上-号) | ||
109 | + */ | ||
110 | + private BigDecimal developProfit; | ||
111 | + | ||
112 | + /** | ||
113 | + * 包装费用实际金额由财务手动输入 | ||
114 | + */ | ||
115 | + private BigDecimal packetActualTotalPrice; | ||
116 | + | ||
117 | + /** | ||
118 | + * 订单总数量 | ||
119 | + * 订单总数量计算项目号的数量合计 | ||
120 | + */ | ||
121 | + private Integer orderCount; | ||
122 | + | ||
123 | + /** | ||
124 | + * 实际跟单单价=实际跟单费用/件数(人民币格式) | ||
125 | + */ | ||
126 | + private BigDecimal actualRmbPrice; | ||
127 | + | ||
128 | + /** | ||
129 | + * 实际跟单单价折算美金:人民币单价/汇率(6.2) | ||
130 | + */ | ||
131 | + private BigDecimal actualPrice; | ||
132 | + | ||
133 | + /** | ||
134 | + * 包装费用收益计算:包装费用合计金额-包装费用实际金额 | ||
135 | + */ | ||
136 | + private BigDecimal packetProfitPrice; | ||
137 | + | ||
138 | + /** | ||
139 | + * 实际汇率(财务手动输入) | ||
140 | + */ | ||
141 | + private BigDecimal actualRatio; | ||
142 | + | ||
143 | + /** | ||
144 | + * 汇率收益计算:实际汇率(财务手动输入)-固定汇率(取系统汇率)*客户金额合计(基础信息汇总) | ||
145 | + */ | ||
146 | + private BigDecimal actualRatioProfitPrice; | ||
147 | + | ||
148 | + /** | ||
149 | + * 综合收益计算 | ||
150 | + * 易研发净利润+包装费用收益+汇率收益 | ||
151 | + */ | ||
152 | + private BigDecimal totalProfitPrice; | ||
153 | + /** | ||
154 | + * 包装费用合计金额 | ||
155 | + * 包装费用 * 汇率 (6.2) | ||
156 | + */ | ||
157 | + private BigDecimal packetTotalPriceCount; | ||
158 | + /** | ||
159 | + * 实际跟单费用 | ||
160 | + */ | ||
161 | + private BigDecimal actualdocumentaryPrice; | ||
162 | +} | ||
163 | + |
src/main/java/com/order/erp/domain/vo/order/CheckBillAnalysisExportVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应付款账单表(InvoiceBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class CheckBillAnalysisExportVO implements Serializable { | ||
22 | + | ||
23 | + private Long id; | ||
24 | + | ||
25 | + /** | ||
26 | + * checkNo | ||
27 | + */ | ||
28 | + private String checkNo; | ||
29 | + | ||
30 | + | ||
31 | + /** | ||
32 | + * 生产科 | ||
33 | + */ | ||
34 | + private String productionDepartment; | ||
35 | + | ||
36 | + /** | ||
37 | + * 生产科总价汇总 | ||
38 | + */ | ||
39 | + private BigDecimal productionDepartmentTotalPrice; | ||
40 | + | ||
41 | + /** | ||
42 | + * 生产科扣款金额汇总 | ||
43 | + */ | ||
44 | + private BigDecimal deductAmount; | ||
45 | + | ||
46 | + | ||
47 | + /** | ||
48 | + * 实际付款金额汇总 | ||
49 | + */ | ||
50 | + private BigDecimal actualPayedAmount; | ||
51 | + | ||
52 | + /** | ||
53 | + * 应付金额 - 扣款金额 | ||
54 | + * 生产科实际应付金额 | ||
55 | + */ | ||
56 | + private BigDecimal calculateActualPayedAmount; | ||
57 | + | ||
58 | + /** | ||
59 | + * 实际应付金额 - 实际付款金额 | ||
60 | + * 未付金额金额 | ||
61 | + */ | ||
62 | + private BigDecimal unPayedAmount; | ||
63 | + | ||
64 | + /** | ||
65 | + * 生产科应付款日期 | ||
66 | + */ | ||
67 | + private String payedDate; | ||
68 | + | ||
69 | + /** | ||
70 | + * 生产科实际付款日期 | ||
71 | + */ | ||
72 | + private String actualPayedDate; | ||
73 | + | ||
74 | +} |
src/main/java/com/order/erp/domain/vo/order/CheckBillAnalysisResultVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * 应付款账单表(InvoiceBillOrder)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:33 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class CheckBillAnalysisResultVO implements Serializable { | ||
23 | + | ||
24 | + | ||
25 | + /** | ||
26 | + * 导出列表 | ||
27 | + */ | ||
28 | + private List<CheckBillAnalysisExportVO> exportVOS; | ||
29 | + | ||
30 | + /** | ||
31 | + * 合计数据 | ||
32 | + */ | ||
33 | + | ||
34 | + /** | ||
35 | + * 生产科总价汇总 | ||
36 | + */ | ||
37 | + private BigDecimal productionDepartmentTotalPrice; | ||
38 | + | ||
39 | + /** | ||
40 | + * 生产科扣款金额汇总 | ||
41 | + */ | ||
42 | + private BigDecimal deductAmount; | ||
43 | + | ||
44 | + | ||
45 | + /** | ||
46 | + * 实际付款金额汇总 | ||
47 | + */ | ||
48 | + private BigDecimal actualPayedAmount; | ||
49 | + | ||
50 | + /** | ||
51 | + * 应付金额 - 扣款金额 | ||
52 | + * 生产科实际应付金额 | ||
53 | + */ | ||
54 | + private BigDecimal calculateActualPayedAmount; | ||
55 | + | ||
56 | + /** | ||
57 | + * 实际应付金额 - 实际付款金额 | ||
58 | + * 未付金额金额 | ||
59 | + */ | ||
60 | + private BigDecimal unPayedAmount; | ||
61 | + | ||
62 | + /** | ||
63 | + * 合计数据 | ||
64 | + */ | ||
65 | + | ||
66 | +} |
src/main/java/com/order/erp/domain/vo/order/CheckBillMappingQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * 生产科对账单应收账单映射表(CheckBillMapping)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:37 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class CheckBillMappingQueryVO extends BasePageVO implements Serializable { | ||
23 | + | ||
24 | + private List<Long> ids; | ||
25 | + | ||
26 | + | ||
27 | + private Long id; | ||
28 | + /** | ||
29 | + * 生产科对账单号 | ||
30 | + */ | ||
31 | + private String checkNo; | ||
32 | + /** | ||
33 | + * check账单id | ||
34 | + */ | ||
35 | + private Long checkBillId; | ||
36 | + /** | ||
37 | + * 订单id | ||
38 | + */ | ||
39 | + private Long orderId; | ||
40 | + | ||
41 | + | ||
42 | +} | ||
43 | + |
src/main/java/com/order/erp/domain/vo/order/CheckBillMappingVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 生产科对账单应收账单映射表(CheckBillMapping)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-08-05 16:26:37 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class CheckBillMappingVO implements Serializable { | ||
21 | + | ||
22 | + private Long id; | ||
23 | + /** | ||
24 | + * 生产科对账单号 | ||
25 | + */ | ||
26 | + private String checkNo; | ||
27 | + /** | ||
28 | + * check账单id | ||
29 | + */ | ||
30 | + private Long checkBillId; | ||
31 | + /** | ||
32 | + * 订单id | ||
33 | + */ | ||
34 | + private Long orderId; | ||
35 | + | ||
36 | + | ||
37 | +} |
src/main/java/com/order/erp/domain/vo/order/CheckBillOrdeBaseResultVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +@Data | ||
7 | +@AllArgsConstructor | ||
8 | +@ToString | ||
9 | +@NoArgsConstructor | ||
10 | +@EqualsAndHashCode(callSuper = false) | ||
11 | +@SuperBuilder | ||
12 | +public class CheckBillOrdeBaseResultVO { | ||
13 | + /** | ||
14 | + * 客户编码 | ||
15 | + */ | ||
16 | + private String customerCode; | ||
17 | + /** | ||
18 | + * 项目号 | ||
19 | + */ | ||
20 | + private String projectNo; | ||
21 | + /** | ||
22 | + * 内部编号 | ||
23 | + */ | ||
24 | + private String innerNo; | ||
25 | + /** | ||
26 | + * 客户po号 | ||
27 | + */ | ||
28 | + private String customerPo; | ||
29 | + /** | ||
30 | + * 客户STYLE# | ||
31 | + */ | ||
32 | + private String customerStyle; | ||
33 | + /** | ||
34 | + * Modelo(REFERENCE) | ||
35 | + */ | ||
36 | + private String modeleLo; | ||
37 | + /** | ||
38 | + * 缩略图片地址 这里不确认前端拿到的数据是缩略图url还是图片url,先采用缩略图url。 | ||
39 | + */ | ||
40 | + private String smallPicUrl; | ||
41 | + /** | ||
42 | + * 数量 | ||
43 | + */ | ||
44 | + private Integer orderCount; | ||
45 | + /** | ||
46 | + * 生产科单价 | ||
47 | + */ | ||
48 | + private Double productionDepartmentPrice; | ||
49 | + /** | ||
50 | + * 生产科总价 | ||
51 | + */ | ||
52 | + private Double productionDepartmentTotalPrice; | ||
53 | +} |
src/main/java/com/order/erp/domain/vo/order/CheckHoldTimeItemVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.order.OrderBaseInfoDO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应付账单 -- holdTime | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class CheckHoldTimeItemVO implements Serializable { | ||
22 | + | ||
23 | + /** | ||
24 | + * 生产科 | ||
25 | + */ | ||
26 | + private String productionDepartment; | ||
27 | + | ||
28 | + /** | ||
29 | + * 订单hold时间 | ||
30 | + */ | ||
31 | + private String holdTime; | ||
32 | + | ||
33 | + /** | ||
34 | + * 基础订单信息 | ||
35 | + */ | ||
36 | + private OrderBaseInfoDO baseInfoDO; | ||
37 | +} |
src/main/java/com/order/erp/domain/vo/order/CheckOrderBaseItemVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应付款账单表(InvoiceBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class CheckOrderBaseItemVO implements Serializable { | ||
22 | + | ||
23 | + private Long orderId; | ||
24 | + | ||
25 | + /** | ||
26 | + * checkNo编码 | ||
27 | + */ | ||
28 | + private String checkNo; | ||
29 | + | ||
30 | + /** | ||
31 | + * 生产科 | ||
32 | + */ | ||
33 | + private String productionDepartment; | ||
34 | + | ||
35 | + /** | ||
36 | + * 生成科总价 | ||
37 | + */ | ||
38 | + private BigDecimal productionDepartmentTotalPrice; | ||
39 | + | ||
40 | + | ||
41 | +} |
src/main/java/com/order/erp/domain/vo/order/FinanceEventJobVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.order.InvoiceBillOrderDO; | ||
4 | +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +@Data | ||
9 | +@AllArgsConstructor | ||
10 | +@ToString | ||
11 | +@NoArgsConstructor | ||
12 | +@EqualsAndHashCode(callSuper = false) | ||
13 | +@SuperBuilder | ||
14 | +public class FinanceEventJobVO { | ||
15 | + | ||
16 | + //应收款。 | ||
17 | + private InvoiceBillOrderDO invoiceBillOrderDO; | ||
18 | + //未收款。 | ||
19 | + private ProducePaymentCheckBillOrderDO producePaymentCheckBillOrderDO; | ||
20 | +} |
src/main/java/com/order/erp/domain/vo/order/InnerProfitRatioQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import javax.validation.constraints.NotEmpty; | ||
8 | +import javax.validation.constraints.NotNull; | ||
9 | +import java.io.Serializable; | ||
10 | +import java.math.BigDecimal; | ||
11 | +import java.util.List; | ||
12 | + | ||
13 | +/** | ||
14 | + * 内部生产净利润分析表 | ||
15 | + * | ||
16 | + * @author makejava | ||
17 | + * @since 2024-08-05 16:26:34 | ||
18 | + */ | ||
19 | +@Data | ||
20 | +@AllArgsConstructor | ||
21 | +@ToString | ||
22 | +@NoArgsConstructor | ||
23 | +@EqualsAndHashCode(callSuper = false) | ||
24 | +@SuperBuilder | ||
25 | +public class InnerProfitRatioQueryVO extends BasePageVO implements Serializable { | ||
26 | + | ||
27 | + /** | ||
28 | + * ids | ||
29 | + */ | ||
30 | + @NotEmpty(message = "选择订单不能为空") | ||
31 | + private List<Long> ids; | ||
32 | + /** | ||
33 | + * 客户编码 | ||
34 | + */ | ||
35 | + @NotEmpty(message = "客户编码不能为空") | ||
36 | + private String customerCode; | ||
37 | + | ||
38 | + /** | ||
39 | + * 项目号 | ||
40 | + */ | ||
41 | + @NotEmpty(message = "项目号不能为空") | ||
42 | + private List<String> projectNo; | ||
43 | + | ||
44 | + /** | ||
45 | + * 项目开发开始时间 | ||
46 | + */ | ||
47 | + @NotEmpty(message = "项目开发开始时间不能为空") | ||
48 | + private String projectStartTime; | ||
49 | + | ||
50 | + /** | ||
51 | + * 项目开发结束时间 | ||
52 | + */ | ||
53 | + @NotEmpty(message = "项目开发结束时间不能为空") | ||
54 | + private String projectEndTime; | ||
55 | + | ||
56 | + /** | ||
57 | + * 生产科预算金额由财务手动输入 | ||
58 | + */ | ||
59 | + @NotNull(message = "生产科预算金额不能为空") | ||
60 | + private BigDecimal productionDepartmentPredictPrice; | ||
61 | + | ||
62 | + | ||
63 | + /** | ||
64 | + * 实际发生费用 手动输入 | ||
65 | + */ | ||
66 | + @NotNull(message = "实际发生费用不能为空") | ||
67 | + private BigDecimal productionActualPrice; | ||
68 | +} | ||
69 | + |
src/main/java/com/order/erp/domain/vo/order/InnerProfitRatioResultVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 业务/研发净利润分析 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:34 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InnerProfitRatioResultVO implements Serializable { | ||
22 | + | ||
23 | + | ||
24 | + /** | ||
25 | + * 客户编码 | ||
26 | + */ | ||
27 | + private String customerCode; | ||
28 | + | ||
29 | + /** | ||
30 | + * 项目号 | ||
31 | + */ | ||
32 | + private String projectNo; | ||
33 | + | ||
34 | + /** | ||
35 | + * 项目开发开始时间 | ||
36 | + */ | ||
37 | + private String projectStartTime; | ||
38 | + | ||
39 | + /** | ||
40 | + * 项目开发结束时间 | ||
41 | + */ | ||
42 | + private String projectEndTime; | ||
43 | + | ||
44 | + /** | ||
45 | + * 生产持续时间 | ||
46 | + */ | ||
47 | + private Integer projectDays; | ||
48 | + | ||
49 | + /** | ||
50 | + * 订单数量 | ||
51 | + */ | ||
52 | + private Integer orderCount; | ||
53 | + | ||
54 | + /** | ||
55 | + * 客户总价$ | ||
56 | + */ | ||
57 | + private Double customerTotalPrice; | ||
58 | + | ||
59 | + | ||
60 | + /** | ||
61 | + * 生产科预算金额由财务手动输入 | ||
62 | + */ | ||
63 | + private BigDecimal productionDepartmentPredictPrice; | ||
64 | + | ||
65 | + | ||
66 | + /** | ||
67 | + * 实际发生费用 手动输入 | ||
68 | + */ | ||
69 | + private BigDecimal productionActualPrice; | ||
70 | + | ||
71 | + /** | ||
72 | + * 生产科总价合计 | ||
73 | + */ | ||
74 | + private BigDecimal productionDepartmentTotalPrice; | ||
75 | + | ||
76 | + | ||
77 | + /** | ||
78 | + * 预算占比 | ||
79 | + * 预算占比计算(实际发生费用/预算金额 | ||
80 | + */ | ||
81 | + private BigDecimal predictRatio; | ||
82 | + | ||
83 | + /** | ||
84 | + * 预算占比与实际占比差 | ||
85 | + * 预算占比与实际占比差计算(1-预算占比) | ||
86 | + */ | ||
87 | + private BigDecimal predictAndActualRatio; | ||
88 | + | ||
89 | + | ||
90 | + /** | ||
91 | + * 内部生产毛利润计算:生产科总价-实际发生费用就是得出 | ||
92 | + */ | ||
93 | + private BigDecimal grossProfit; | ||
94 | + | ||
95 | + /** | ||
96 | + * 内部生产固定成本 | ||
97 | + * 内部生产固定成本计算:生产持续时间*每天的固定成本(固定成本从系统配置中进行获取) | ||
98 | + */ | ||
99 | + private BigDecimal innerProduceFixProfit; | ||
100 | + | ||
101 | + /** | ||
102 | + * 内部生产提成计算:订单数量*单价(单价从系统配置中进行获取) | ||
103 | + */ | ||
104 | + private BigDecimal innerProduceTotalPrice; | ||
105 | + | ||
106 | + /** | ||
107 | + * 内部生产净利润计算:生产科总价-实际发生费用-内部生产提成 | ||
108 | + */ | ||
109 | + private BigDecimal innerProduceTotalProfit; | ||
110 | + | ||
111 | +} | ||
112 | + |
src/main/java/com/order/erp/domain/vo/order/InvoiceBaseOrderQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import javax.validation.constraints.NotBlank; | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:34 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class InvoiceBaseOrderQueryVO extends BasePageVO implements Serializable { | ||
23 | + | ||
24 | + /** | ||
25 | + * 发票单号 | ||
26 | + */ | ||
27 | + @NotBlank(message = "发票单号不能为空") | ||
28 | + private String invoiceNo; | ||
29 | +} | ||
30 | + |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAmountInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单 -- 其他金额信息 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InvoiceBillAmountInfoVO implements Serializable { | ||
22 | + | ||
23 | + private Long id; | ||
24 | + | ||
25 | + /** | ||
26 | + * 报关单url地址 | ||
27 | + */ | ||
28 | + private String bgUrl; | ||
29 | + | ||
30 | + /** | ||
31 | + * 实际应收金额 | ||
32 | + */ | ||
33 | + private BigDecimal actualReceivableAmount; | ||
34 | + /** | ||
35 | + * 实际应付金额1 | ||
36 | + */ | ||
37 | + private BigDecimal actualPayedAmount1; | ||
38 | + /** | ||
39 | + * 实际应付金额2 | ||
40 | + */ | ||
41 | + private BigDecimal actualPayedAmount2; | ||
42 | + /** | ||
43 | + * 实际应付金额3 | ||
44 | + */ | ||
45 | + private BigDecimal actualPayedAmount3; | ||
46 | + /** | ||
47 | + * 其他费用金额 | ||
48 | + */ | ||
49 | + private BigDecimal otherAmount; | ||
50 | + | ||
51 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisExportVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InvoiceBillAnalysisExportVO implements Serializable { | ||
22 | + | ||
23 | + private Long id; | ||
24 | + | ||
25 | + /** | ||
26 | + * 客户编码 | ||
27 | + */ | ||
28 | + private String customerCode; | ||
29 | + | ||
30 | + /** | ||
31 | + * 发票单号 | ||
32 | + */ | ||
33 | + private String invoiceNo; | ||
34 | + | ||
35 | + /** | ||
36 | + * 客户总价$ | ||
37 | + */ | ||
38 | + private BigDecimal customerTotalPrice; | ||
39 | + | ||
40 | + /** | ||
41 | + * 发生扣款金额 | ||
42 | + */ | ||
43 | + private BigDecimal deductAmount; | ||
44 | + | ||
45 | + /** | ||
46 | + * 实际应收金额 | ||
47 | + */ | ||
48 | + private BigDecimal actualReceivableAmount; | ||
49 | + | ||
50 | + /** | ||
51 | + * 实际应付金额 | ||
52 | + */ | ||
53 | + private BigDecimal actualPayedAmount; | ||
54 | + | ||
55 | + /** | ||
56 | + * 实际应收 - 实际应付 | ||
57 | + * 其他费用金额汇总 | ||
58 | + */ | ||
59 | + private BigDecimal otherAmount; | ||
60 | + | ||
61 | + /** | ||
62 | + * 未付金额 | ||
63 | + */ | ||
64 | + private BigDecimal otherTotalAmount; | ||
65 | + | ||
66 | + /** | ||
67 | + * 必须回款日期 | ||
68 | + */ | ||
69 | + private String backRefundDate; | ||
70 | + | ||
71 | + /** | ||
72 | + * 实际回款日期 | ||
73 | + */ | ||
74 | + private String actualRefundDate; | ||
75 | +// | ||
76 | +// /** | ||
77 | +// * 其他金额汇总 | ||
78 | +// */ | ||
79 | +// private BigDecimal unPayedAmount; | ||
80 | + | ||
81 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisResultVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:33 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class InvoiceBillAnalysisResultVO implements Serializable { | ||
23 | + | ||
24 | + | ||
25 | + /** | ||
26 | + * 导出列表 | ||
27 | + */ | ||
28 | + private List<InvoiceBillAnalysisExportVO> exportVOS; | ||
29 | + | ||
30 | + /** | ||
31 | + * 合计数据 | ||
32 | + */ | ||
33 | + | ||
34 | + /** | ||
35 | + * 客户总价$ | ||
36 | + */ | ||
37 | + private BigDecimal customerTotalPrice; | ||
38 | + | ||
39 | + /** | ||
40 | + * 发生扣款金额 | ||
41 | + */ | ||
42 | + private BigDecimal deductAmount; | ||
43 | + | ||
44 | + /** | ||
45 | + * 实际应收金额总计 实际应收1+2+3 | ||
46 | + */ | ||
47 | + private BigDecimal actualReceivableAmount; | ||
48 | + | ||
49 | + /** | ||
50 | + * 未收金额合计 实际应收-发生扣款金额总计 | ||
51 | + */ | ||
52 | + private BigDecimal actualPayedAmount; | ||
53 | + | ||
54 | + /** | ||
55 | + * 客户总金额-发生扣款金额总计 | ||
56 | + * 实际应收 | ||
57 | + */ | ||
58 | + private BigDecimal otherAmount; | ||
59 | + | ||
60 | + /** | ||
61 | + * 未付金额合计 | ||
62 | + */ | ||
63 | + private BigDecimal otherTotalAmount; | ||
64 | + | ||
65 | + /** | ||
66 | + * 合计数据 | ||
67 | + */ | ||
68 | + | ||
69 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.AllArgsConstructor; | ||
4 | +import lombok.Data; | ||
5 | +import lombok.EqualsAndHashCode; | ||
6 | +import lombok.ToString; | ||
7 | +import lombok.experimental.SuperBuilder; | ||
8 | + | ||
9 | +import java.io.Serializable; | ||
10 | + | ||
11 | +/** | ||
12 | + * 应收款账单 -- 分析 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2024-08-05 16:26:33 | ||
16 | + */ | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class InvoiceBillAnalysisVO extends InvoiceBillOrderQueryVO implements Serializable { | ||
23 | + | ||
24 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillCommitApplyVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 应收款账单 -- 提交审核 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-08-05 16:26:33 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class InvoiceBillCommitApplyVO implements Serializable { | ||
21 | + | ||
22 | + private Long id; | ||
23 | + private String actualRefundDate; | ||
24 | + private String payee; | ||
25 | + | ||
26 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillCreateVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InvoiceBillCreateVO implements Serializable { | ||
22 | + private static final long serialVersionUID = 543899167451834300L; | ||
23 | + | ||
24 | + private Long id; | ||
25 | + | ||
26 | + /** | ||
27 | + * 发票单号 | ||
28 | + */ | ||
29 | + private String invoiceNo; | ||
30 | + | ||
31 | + /** | ||
32 | + * 报关单url地址 | ||
33 | + */ | ||
34 | + private String bgUrl; | ||
35 | + | ||
36 | + /** | ||
37 | + * 必须回款日期 | ||
38 | + */ | ||
39 | + private String backRefundDate; | ||
40 | + | ||
41 | + /** | ||
42 | + * 订单id集合 | ||
43 | + */ | ||
44 | + private List<Long> orderIds; | ||
45 | + | ||
46 | + | ||
47 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillDeductInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单 -- 扣款信息 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InvoiceBillDeductInfoVO implements Serializable { | ||
22 | + | ||
23 | + private Long id; | ||
24 | + | ||
25 | + /** | ||
26 | + * 发票单号 | ||
27 | + */ | ||
28 | + private String invoiceNo; | ||
29 | + | ||
30 | + /** | ||
31 | + * 发生扣款金额 | ||
32 | + */ | ||
33 | + private BigDecimal deductAmount; | ||
34 | + | ||
35 | + /** | ||
36 | + * 扣款单url地址 | ||
37 | + */ | ||
38 | + private String deductUrl; | ||
39 | + | ||
40 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillMappingQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:36 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class InvoiceBillMappingQueryVO extends BasePageVO implements Serializable { | ||
23 | + private static final long serialVersionUID = -10772282327497511L; | ||
24 | + | ||
25 | + private List<Long> ids; | ||
26 | + | ||
27 | + | ||
28 | + private Long id; | ||
29 | + /** | ||
30 | + * 发票单号 | ||
31 | + */ | ||
32 | + private String invoiceNo; | ||
33 | + /** | ||
34 | + * invoice账单id | ||
35 | + */ | ||
36 | + private Long invoiceBillId; | ||
37 | + /** | ||
38 | + * 订单id | ||
39 | + */ | ||
40 | + private Long orderId; | ||
41 | + | ||
42 | + | ||
43 | +} | ||
44 | + |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillMappingVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-08-05 16:26:36 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class InvoiceBillMappingVO implements Serializable { | ||
21 | + private static final long serialVersionUID = -55765026730369748L; | ||
22 | + | ||
23 | + private Long id; | ||
24 | + /** | ||
25 | + * 发票单号 | ||
26 | + */ | ||
27 | + private String invoiceNo; | ||
28 | + /** | ||
29 | + * invoice账单id | ||
30 | + */ | ||
31 | + private Long invoiceBillId; | ||
32 | + /** | ||
33 | + * 订单id | ||
34 | + */ | ||
35 | + private Long orderId; | ||
36 | + | ||
37 | + | ||
38 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrdeBaserResultVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +@Data | ||
7 | +@AllArgsConstructor | ||
8 | +@ToString | ||
9 | +@NoArgsConstructor | ||
10 | +@EqualsAndHashCode(callSuper = false) | ||
11 | +@SuperBuilder | ||
12 | +public class InvoiceBillOrdeBaserResultVO { | ||
13 | + | ||
14 | + /** | ||
15 | + * 客户编码 | ||
16 | + */ | ||
17 | + private String customerCode; | ||
18 | + /** | ||
19 | + * 项目号 | ||
20 | + */ | ||
21 | + private String projectNo; | ||
22 | + /** | ||
23 | + * 内部编号 | ||
24 | + */ | ||
25 | + private String innerNo; | ||
26 | + /** | ||
27 | + * 客户po号 | ||
28 | + */ | ||
29 | + private String customerPo; | ||
30 | + /** | ||
31 | + * 客户STYLE# | ||
32 | + */ | ||
33 | + private String customerStyle; | ||
34 | + /** | ||
35 | + * Modelo(REFERENCE) | ||
36 | + */ | ||
37 | + private String modeleLo; | ||
38 | + /** | ||
39 | + * 缩略图片地址 这里不确认前端拿到的数据是缩略图url还是图片url,先采用缩略图url。 | ||
40 | + */ | ||
41 | + private String smallPicUrl; | ||
42 | + /** | ||
43 | + * 数量 | ||
44 | + */ | ||
45 | + private Integer orderCount; | ||
46 | + /** | ||
47 | + * 客户单价 $ | ||
48 | + */ | ||
49 | + private Double customerPrice; | ||
50 | + /** | ||
51 | + * 客户总价 $ | ||
52 | + */ | ||
53 | + private Double customerTotalPrice; | ||
54 | + | ||
55 | + | ||
56 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrderQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:34 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class InvoiceBillOrderQueryVO extends BasePageVO implements Serializable { | ||
23 | + | ||
24 | + private List<Long> ids; | ||
25 | + private Long id; | ||
26 | + | ||
27 | + /** | ||
28 | + * 发票单号 | ||
29 | + */ | ||
30 | + private String invoiceNo; | ||
31 | + | ||
32 | + /** | ||
33 | + * 总经理审核状态 -1,未提交审核,0:待审核、1:审核通过,2:审核驳回 | ||
34 | + */ | ||
35 | + private Integer status; | ||
36 | + | ||
37 | + /** | ||
38 | + * 客户编码 | ||
39 | + */ | ||
40 | + private String customerCode; | ||
41 | + | ||
42 | + /** | ||
43 | + * 项目号 | ||
44 | + */ | ||
45 | + private String projectNo; | ||
46 | + | ||
47 | + /** | ||
48 | + * 生产科 | ||
49 | + */ | ||
50 | + private String productionDepartment; | ||
51 | + | ||
52 | + /** | ||
53 | + * 内部编号 | ||
54 | + */ | ||
55 | + private String innerNo; | ||
56 | + | ||
57 | + /** | ||
58 | + * 客户po号 | ||
59 | + */ | ||
60 | + private String customerPo; | ||
61 | + | ||
62 | + /** | ||
63 | + * 开始时间 | ||
64 | + */ | ||
65 | + private String startTime; | ||
66 | + | ||
67 | + /** | ||
68 | + * 结束时间 | ||
69 | + */ | ||
70 | + private String endTime; | ||
71 | +} | ||
72 | + |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrderVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InvoiceBillOrderVO implements Serializable { | ||
22 | + private static final long serialVersionUID = 543899167451834300L; | ||
23 | + | ||
24 | + private Long id; | ||
25 | + | ||
26 | + /** | ||
27 | + * 发票单号 | ||
28 | + */ | ||
29 | + private String invoiceNo; | ||
30 | + | ||
31 | + /** | ||
32 | + * 报关单url地址 | ||
33 | + */ | ||
34 | + private String bgUrl; | ||
35 | + | ||
36 | + /** | ||
37 | + * 必须回款日期 | ||
38 | + */ | ||
39 | + private String backRefundDate; | ||
40 | + | ||
41 | + /** | ||
42 | + * 发生扣款金额 | ||
43 | + */ | ||
44 | + private BigDecimal deductAmount; | ||
45 | + | ||
46 | + /** | ||
47 | + * 扣款单url地址 | ||
48 | + */ | ||
49 | + private String deductUrl; | ||
50 | + | ||
51 | + /** | ||
52 | + * 实际应收金额 | ||
53 | + */ | ||
54 | + private BigDecimal actualReceivableAmount; | ||
55 | + | ||
56 | + /** | ||
57 | + * 实际应付金额1 | ||
58 | + */ | ||
59 | + private BigDecimal actualPayedAmount1; | ||
60 | + | ||
61 | + /** | ||
62 | + * 实际应付金额2 | ||
63 | + */ | ||
64 | + private BigDecimal actualPayedAmount2; | ||
65 | + | ||
66 | + /** | ||
67 | + * 实际应付金额3 | ||
68 | + */ | ||
69 | + private BigDecimal actualPayedAmount3; | ||
70 | + | ||
71 | + /** | ||
72 | + * 其他费用金额 | ||
73 | + */ | ||
74 | + private BigDecimal otherAmount; | ||
75 | + | ||
76 | + /** | ||
77 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | ||
78 | + */ | ||
79 | + private Integer status; | ||
80 | + | ||
81 | + | ||
82 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceHoldTimeItemVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.order.OrderBaseInfoDO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单 -- holdTime | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InvoiceHoldTimeItemVO implements Serializable { | ||
22 | + | ||
23 | + /** | ||
24 | + * 客户编码 | ||
25 | + */ | ||
26 | + private String customerCode; | ||
27 | + | ||
28 | + /** | ||
29 | + * 订单hold时间 | ||
30 | + */ | ||
31 | + private String holdTime; | ||
32 | + | ||
33 | + /** | ||
34 | + * 基础订单信息 | ||
35 | + */ | ||
36 | + private OrderBaseInfoDO baseInfoDO; | ||
37 | +} |
src/main/java/com/order/erp/domain/vo/order/InvoiceOrderBaseItemVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单表(InvoiceBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:33 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class InvoiceOrderBaseItemVO implements Serializable { | ||
22 | + | ||
23 | + private Long orderId; | ||
24 | + | ||
25 | + /** | ||
26 | + * invoice编码 | ||
27 | + */ | ||
28 | + private String invoiceCode; | ||
29 | + | ||
30 | + /** | ||
31 | + * 客户编码 | ||
32 | + */ | ||
33 | + private String customerCode; | ||
34 | + | ||
35 | + /** | ||
36 | + * 客户总价$ | ||
37 | + */ | ||
38 | + private BigDecimal customerTotalPrice; | ||
39 | + | ||
40 | + | ||
41 | +} |
src/main/java/com/order/erp/domain/vo/order/OrderApplyResultVO.java
@@ -110,5 +110,10 @@ public class OrderApplyResultVO implements Serializable { | @@ -110,5 +110,10 @@ public class OrderApplyResultVO implements Serializable { | ||
110 | */ | 110 | */ |
111 | private OrderInspectionStageVO inspectionStageInfo; | 111 | private OrderInspectionStageVO inspectionStageInfo; |
112 | 112 | ||
113 | + /** | ||
114 | + * 申请原因备注 | ||
115 | + */ | ||
116 | + private String applyRemark; | ||
117 | + | ||
113 | 118 | ||
114 | } | 119 | } |
src/main/java/com/order/erp/domain/vo/order/OrderLockFieldVO.java
1 | package com.order.erp.domain.vo.order; | 1 | package com.order.erp.domain.vo.order; |
2 | 2 | ||
3 | +import com.order.erp.domain.dto.order.InvoiceBillOrderDO; | ||
4 | +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO; | ||
3 | import lombok.*; | 5 | import lombok.*; |
4 | import lombok.experimental.SuperBuilder; | 6 | import lombok.experimental.SuperBuilder; |
5 | 7 | ||
@@ -44,6 +46,16 @@ public class OrderLockFieldVO implements Serializable { | @@ -44,6 +46,16 @@ public class OrderLockFieldVO implements Serializable { | ||
44 | private OrderInspectionStageFieldVO inspectionStageFields; | 46 | private OrderInspectionStageFieldVO inspectionStageFields; |
45 | 47 | ||
46 | /** | 48 | /** |
49 | + * 应收款账单字段 | ||
50 | + */ | ||
51 | + private InvoiceBillOrderDO invoiceBillOrderDO; | ||
52 | + | ||
53 | + /** | ||
54 | + * 应付款账单字段 | ||
55 | + */ | ||
56 | + private ProducePaymentCheckBillOrderDO checkBillOrderDO; | ||
57 | + | ||
58 | + /** | ||
47 | * 导出指定订单id集合 | 59 | * 导出指定订单id集合 |
48 | */ | 60 | */ |
49 | private List<Long> orderIds; | 61 | private List<Long> orderIds; |
src/main/java/com/order/erp/domain/vo/order/OrderUnlockFieldApplyVO.java
@@ -45,5 +45,9 @@ public class OrderUnlockFieldApplyVO implements Serializable { | @@ -45,5 +45,9 @@ public class OrderUnlockFieldApplyVO implements Serializable { | ||
45 | * 质检字段 | 45 | * 质检字段 |
46 | */ | 46 | */ |
47 | private OrderInspectionStageFieldVO inspectionStageFields; | 47 | private OrderInspectionStageFieldVO inspectionStageFields; |
48 | + /** | ||
49 | + * 申请描述。 | ||
50 | + */ | ||
51 | + private String applyRemark; | ||
48 | 52 | ||
49 | } | 53 | } |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentBaseOrderQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | + | ||
9 | +/** | ||
10 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:35 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class ProducePaymentBaseOrderQueryVO extends BasePageVO implements Serializable { | ||
22 | + | ||
23 | + /** | ||
24 | + * 生产科对账单 | ||
25 | + */ | ||
26 | + private String checkNo; | ||
27 | + | ||
28 | +} | ||
29 | + |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentBillOrderAnalysisVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | + | ||
9 | +/** | ||
10 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:35 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class ProducePaymentBillOrderAnalysisVO extends BasePageVO implements Serializable { | ||
22 | + | ||
23 | + /** | ||
24 | + * 生产科对账单 | ||
25 | + */ | ||
26 | + private String checkNo; | ||
27 | + | ||
28 | +} | ||
29 | + |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillAmountInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:35 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class ProducePaymentCheckBillAmountInfoVO implements Serializable { | ||
22 | + | ||
23 | + private Long id; | ||
24 | + | ||
25 | + /** | ||
26 | + * 实际应收金额 | ||
27 | + */ | ||
28 | + private BigDecimal actualPayedAmount; | ||
29 | + /** | ||
30 | + * 实际应付金额1 | ||
31 | + */ | ||
32 | + private BigDecimal actualPayedAmount1; | ||
33 | + /** | ||
34 | + * 实际应付金额2 | ||
35 | + */ | ||
36 | + private BigDecimal actualPayedAmount2; | ||
37 | + /** | ||
38 | + * 实际应付金额3 | ||
39 | + */ | ||
40 | + private BigDecimal actualPayedAmount3; | ||
41 | + | ||
42 | + | ||
43 | +} |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillCommitApplyVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-08-05 16:26:35 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class ProducePaymentCheckBillCommitApplyVO implements Serializable { | ||
21 | + | ||
22 | + private Long id; | ||
23 | + | ||
24 | + private String actualPayedDate; | ||
25 | +} |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillCreateVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:35 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class ProducePaymentCheckBillCreateVO implements Serializable { | ||
22 | + | ||
23 | + private Long id; | ||
24 | + /** | ||
25 | + * 生产科对账单 | ||
26 | + */ | ||
27 | + private String checkNo; | ||
28 | + | ||
29 | + /** | ||
30 | + * 生产科应付款日期 | ||
31 | + */ | ||
32 | + private String payedDate; | ||
33 | + | ||
34 | + /** | ||
35 | + * 订单id集合 | ||
36 | + */ | ||
37 | + private List<Long> orderIds; | ||
38 | + | ||
39 | + | ||
40 | +} |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillDeductInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +/** | ||
10 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:35 | ||
14 | + */ | ||
15 | +@Data | ||
16 | +@AllArgsConstructor | ||
17 | +@ToString | ||
18 | +@NoArgsConstructor | ||
19 | +@EqualsAndHashCode(callSuper = false) | ||
20 | +@SuperBuilder | ||
21 | +public class ProducePaymentCheckBillDeductInfoVO implements Serializable { | ||
22 | + | ||
23 | + private Long id; | ||
24 | + /** | ||
25 | + * 生产科对账单 | ||
26 | + */ | ||
27 | + private String checkNo; | ||
28 | + | ||
29 | + /** | ||
30 | + * 生产科扣款责任部门 | ||
31 | + */ | ||
32 | + private String deductDept; | ||
33 | + | ||
34 | + /** | ||
35 | + * 发生扣款金额 | ||
36 | + */ | ||
37 | + private BigDecimal deductAmount; | ||
38 | + | ||
39 | + /** | ||
40 | + * 扣款单url地址 | ||
41 | + */ | ||
42 | + private String deductUrl; | ||
43 | + | ||
44 | + | ||
45 | +} |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillInvoiceInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-08-05 16:26:35 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class ProducePaymentCheckBillInvoiceInfoVO implements Serializable { | ||
21 | + | ||
22 | + private Long id; | ||
23 | + | ||
24 | + /** | ||
25 | + * 发票url地址 | ||
26 | + */ | ||
27 | + private String invoiceUrl; | ||
28 | + | ||
29 | +} |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillOrderQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.BasePageVO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +/** | ||
11 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:35 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class ProducePaymentCheckBillOrderQueryVO extends BasePageVO implements Serializable { | ||
23 | + | ||
24 | + private List<Long> ids; | ||
25 | + | ||
26 | + | ||
27 | + private Long id; | ||
28 | + /** | ||
29 | + * 生产科对账单 | ||
30 | + */ | ||
31 | + private String checkNo; | ||
32 | + /** | ||
33 | + * 总经理审核状态 -1,未提交审核,0:待审核、1:审核通过,2:审核驳回 | ||
34 | + */ | ||
35 | + private Integer status; | ||
36 | + | ||
37 | + /** | ||
38 | + * 客户编码 | ||
39 | + */ | ||
40 | + private String customerCode; | ||
41 | + | ||
42 | + /** | ||
43 | + * 项目号 | ||
44 | + */ | ||
45 | + private String projectNo; | ||
46 | + | ||
47 | + /** | ||
48 | + * 生产科 | ||
49 | + */ | ||
50 | + private String productionDepartment; | ||
51 | + | ||
52 | + /** | ||
53 | + * 内部编号 | ||
54 | + */ | ||
55 | + private String innerNo; | ||
56 | + | ||
57 | + /** | ||
58 | + * 客户po号 | ||
59 | + */ | ||
60 | + private String customerPo; | ||
61 | + | ||
62 | + /** | ||
63 | + * 开始时间 | ||
64 | + */ | ||
65 | + private String startTime; | ||
66 | + | ||
67 | + /** | ||
68 | + * 结束时间 | ||
69 | + */ | ||
70 | + private String endTime; | ||
71 | + | ||
72 | +} | ||
73 | + |
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillOrderVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +import java.io.Serializable; | ||
7 | + | ||
8 | +/** | ||
9 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类 | ||
10 | + * | ||
11 | + * @author makejava | ||
12 | + * @since 2024-08-05 16:26:35 | ||
13 | + */ | ||
14 | +@Data | ||
15 | +@AllArgsConstructor | ||
16 | +@ToString | ||
17 | +@NoArgsConstructor | ||
18 | +@EqualsAndHashCode(callSuper = false) | ||
19 | +@SuperBuilder | ||
20 | +public class ProducePaymentCheckBillOrderVO implements Serializable { | ||
21 | + private static final long serialVersionUID = 239047702576286556L; | ||
22 | + | ||
23 | + private Long id; | ||
24 | + /** | ||
25 | + * 生产科对账单 | ||
26 | + */ | ||
27 | + private String checkNo; | ||
28 | + /** | ||
29 | + * 发票url地址 | ||
30 | + */ | ||
31 | + private String invoiceUrl; | ||
32 | + /** | ||
33 | + * 扣款单url地址 | ||
34 | + */ | ||
35 | + private String deductPdfUrl; | ||
36 | + /** | ||
37 | + * 生产科应付款日期 | ||
38 | + */ | ||
39 | + private String payedDate; | ||
40 | + /** | ||
41 | + * 生产科扣款责任部门 | ||
42 | + */ | ||
43 | + private String deductDept; | ||
44 | + /** | ||
45 | + * 生产科扣款金额 | ||
46 | + */ | ||
47 | + private Double deductAmount; | ||
48 | + /** | ||
49 | + * 实际应付金额 | ||
50 | + */ | ||
51 | + private Double actualPayedAmount; | ||
52 | + /** | ||
53 | + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | ||
54 | + */ | ||
55 | + private Integer status; | ||
56 | + | ||
57 | + | ||
58 | +} |
src/main/java/com/order/erp/job/FinanceJob.java
0 → 100644
1 | +package com.order.erp.job; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
5 | +import com.order.erp.common.constant.Constant; | ||
6 | +import com.order.erp.common.utils.EmailSendUtils; | ||
7 | +import com.order.erp.common.utils.RedisUtils; | ||
8 | +import com.order.erp.domain.ApplyStatusEnum; | ||
9 | +import com.order.erp.domain.FinanceOverEnum; | ||
10 | +import com.order.erp.domain.dto.BaseDO; | ||
11 | +import com.order.erp.domain.dto.admin.AdminUserDO; | ||
12 | +import com.order.erp.domain.dto.admin.AdminUserRoleDO; | ||
13 | +import com.order.erp.domain.dto.order.InvoiceBillOrderDO; | ||
14 | +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO; | ||
15 | +import com.order.erp.domain.vo.order.FinanceEventJobVO; | ||
16 | +import com.order.erp.service.admin.AdminUserRoleService; | ||
17 | +import com.order.erp.service.admin.AdminUserService; | ||
18 | +import com.order.erp.service.order.InvoiceBillOrderService; | ||
19 | +import com.order.erp.service.order.ProducePaymentCheckBillOrderService; | ||
20 | +import lombok.extern.slf4j.Slf4j; | ||
21 | +import org.apache.logging.log4j.util.Strings; | ||
22 | +import org.springframework.scheduling.annotation.Scheduled; | ||
23 | +import org.springframework.stereotype.Component; | ||
24 | + | ||
25 | +import javax.annotation.Resource; | ||
26 | +import java.time.LocalDate; | ||
27 | +import java.util.*; | ||
28 | +import java.util.concurrent.TimeUnit; | ||
29 | +import java.util.stream.Collectors; | ||
30 | + | ||
31 | +@Slf4j | ||
32 | +@Component | ||
33 | +public class FinanceJob { | ||
34 | + @Resource | ||
35 | + private EmailSendUtils emailSendUtils; | ||
36 | + @Resource | ||
37 | + private InvoiceBillOrderService invoiceBillOrderService; | ||
38 | + @Resource | ||
39 | + private ProducePaymentCheckBillOrderService producePaymentCheckBillOrderService; | ||
40 | + @Resource | ||
41 | + private AdminUserRoleService adminUserRoleService; | ||
42 | + @Resource | ||
43 | + private AdminUserService adminUserService; | ||
44 | + @Resource | ||
45 | + private RedisUtils redisService; | ||
46 | + //每天的7:15执行一次 | ||
47 | +// @Scheduled(cron = "0 15 7 * * ?", zone = "Asia/Shanghai") | ||
48 | + | ||
49 | + //每分钟执行一次 | ||
50 | + @Scheduled(cron = "0 * * * * ?", zone = "Asia/Shanghai") | ||
51 | + public void financeJob() { | ||
52 | + List<InvoiceBillOrderDO> eventInvoiceBillOrderDO=invoiceBillOrderService.getOverEvnetList(); | ||
53 | + List<ProducePaymentCheckBillOrderDO> eventProducePaymentCheckBillOrderDO= producePaymentCheckBillOrderService.getOverEventList(); | ||
54 | + LocalDate today = LocalDate.now(); | ||
55 | + List<InvoiceBillOrderDO> invoiceBillOrderDOList = eventInvoiceBillOrderDO.stream().filter(invoice -> invoice.getBackRefundDate() != null && Strings.isNotEmpty(invoice.getBackRefundDate())) | ||
56 | + .collect(Collectors.toList()); | ||
57 | + Set<String> emailList= new HashSet<>(); | ||
58 | + Set<String> twoEmail = new HashSet<>(); | ||
59 | + //获取所有用户。 | ||
60 | + List<AdminUserDO> allUser = adminUserService.list(new LambdaQueryWrapper<AdminUserDO>() | ||
61 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)); | ||
62 | + Map<Long, AdminUserDO> adminUserDOMap = allUser.stream().collect(Collectors.toMap(AdminUserDO::getId, AdminUserDO -> AdminUserDO, (existing, replacement) -> existing)); | ||
63 | + Map<String, AdminUserDO> userName = allUser.stream().collect(Collectors.toMap(AdminUserDO::getUserName, AdminUserDO -> AdminUserDO, (existing, replacement) -> existing)); | ||
64 | + //获取财务邮箱。 | ||
65 | + List<AdminUserRoleDO> list = adminUserRoleService.list(new LambdaQueryWrapper<AdminUserRoleDO>() | ||
66 | + .eq(AdminUserRoleDO::getRoleId, Constant.SEVEN)); | ||
67 | + Set<Long> userIds= list.stream().map(AdminUserRoleDO::getUserId).collect(Collectors.toSet()); | ||
68 | + List<String> financeEmailList = userIds.stream() | ||
69 | + .map(userId -> Optional.ofNullable(adminUserDOMap.get(userId)) | ||
70 | + .map(AdminUserDO::getEmail) | ||
71 | + .filter(Strings::isNotEmpty) | ||
72 | + .orElse(null)) | ||
73 | + .filter(Objects::nonNull) | ||
74 | + .collect(Collectors.toList()); | ||
75 | + | ||
76 | + if(CollectionUtils.isNotEmpty(invoiceBillOrderDOList)){ | ||
77 | + invoiceBillOrderDOList.forEach(invoiceBillOrderDO -> { | ||
78 | + if(today.toString().equals(invoiceBillOrderDO.getBackRefundDate())) { | ||
79 | + emailList.clear(); | ||
80 | + String redisKey = "invoice:" + invoiceBillOrderDO.getId()+invoiceBillOrderDO.getInvoiceNo(); | ||
81 | + //判断redis中是否有这个值,如果没有就发送邮件,如果有的话就不用发送邮件。 | ||
82 | + if(!redisService.hasKey(redisKey)){ | ||
83 | + if (CollectionUtils.isNotEmpty(financeEmailList)) { | ||
84 | + emailList.addAll(financeEmailList); | ||
85 | + } | ||
86 | + Set<String> userSet = new HashSet<>(); | ||
87 | + userSet.add(invoiceBillOrderDO.getCreateBy()); | ||
88 | + userSet.add(invoiceBillOrderDO.getBusinesPerson()); | ||
89 | + List<String> emails = userSet.stream() | ||
90 | + .map(userName::get) | ||
91 | + .filter(Objects::nonNull) // 确保 AdminUserDO 不为 null | ||
92 | + .map(AdminUserDO::getEmail) // 获取邮箱 | ||
93 | + .filter(Strings::isNotEmpty) // 确保邮箱不为空 | ||
94 | + .collect(Collectors.toList()); | ||
95 | + if (CollectionUtils.isNotEmpty(emails)) { | ||
96 | + emailList.addAll(emails); | ||
97 | + } | ||
98 | + FinanceEventJobVO eventJobVO = new FinanceEventJobVO(); | ||
99 | + eventJobVO.setInvoiceBillOrderDO(invoiceBillOrderDO); | ||
100 | + emailSendUtils.sendEmail(FinanceOverEnum.INVOICE_OVERTIME, new ArrayList<>(emailList), eventJobVO); | ||
101 | + boolean set = redisService.set(redisKey, invoiceBillOrderDO, Constant.TWENTY_FIRST, TimeUnit.DAYS);// 设置为21天后过期 | ||
102 | + if(set){ | ||
103 | + redisService.saddWithExpiry(Constant.REDISKEY,redisKey, Constant.TWENTY_FIRST, TimeUnit.DAYS); | ||
104 | + } | ||
105 | + } | ||
106 | + } | ||
107 | + }); | ||
108 | + } | ||
109 | + List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOList= eventProducePaymentCheckBillOrderDO.stream().filter(producePaymentCheckBillOrderDO -> producePaymentCheckBillOrderDO.getPayedDate()!=null && Strings.isNotEmpty(producePaymentCheckBillOrderDO.getPayedDate())) | ||
110 | + .collect(Collectors.toList()); | ||
111 | + if(CollectionUtils.isNotEmpty(producePaymentCheckBillOrderDOList)){ | ||
112 | + producePaymentCheckBillOrderDOList.forEach(producePaymentCheckBillOrderDO -> { | ||
113 | + if(today.toString().equals(producePaymentCheckBillOrderDO.getPayedDate())){ | ||
114 | + emailList.clear(); // 每次清除 uniqueEmails | ||
115 | + String redisKey = "check:" + producePaymentCheckBillOrderDO.getId()+producePaymentCheckBillOrderDO.getCheckNo(); | ||
116 | + if(!redisService.hasKey(redisKey)) { | ||
117 | + if (CollectionUtils.isNotEmpty(financeEmailList)) { | ||
118 | + emailList.addAll(financeEmailList); | ||
119 | + } | ||
120 | + //发送邮件 | ||
121 | + Set<String> userSet = new HashSet<>(); | ||
122 | + //获取业务,财务,管理员 | ||
123 | + userSet.add(producePaymentCheckBillOrderDO.getCreateBy()); | ||
124 | + userSet.add(producePaymentCheckBillOrderDO.getBusinesPerson()); | ||
125 | + List<String> emails = userSet.stream() | ||
126 | + .map(userName::get) | ||
127 | + .filter(Objects::nonNull) // 确保 AdminUserDO 不为 null | ||
128 | + .map(AdminUserDO::getEmail) // 获取邮箱 | ||
129 | + .filter(Strings::isNotEmpty) // 确保邮箱不为空 | ||
130 | + .collect(Collectors.toList()); | ||
131 | + | ||
132 | + if (CollectionUtils.isNotEmpty(emails)) { | ||
133 | + emailList.addAll(emails); | ||
134 | + } | ||
135 | + FinanceEventJobVO eventJobVO = new FinanceEventJobVO(); | ||
136 | + eventJobVO.setProducePaymentCheckBillOrderDO(producePaymentCheckBillOrderDO); | ||
137 | + emailSendUtils.sendEmail(FinanceOverEnum.PRODUCE_PAYMENT_CHECK_OVERTIME, new ArrayList<>(emailList), eventJobVO); | ||
138 | + boolean set = redisService.set(redisKey, producePaymentCheckBillOrderDO, Constant.TWENTY_FIRST, TimeUnit.DAYS);// 设置为21天后过期 | ||
139 | + if(set){ | ||
140 | + redisService.saddWithExpiry(Constant.REDISKEY,redisKey, Constant.TWENTY_FIRST, TimeUnit.DAYS); | ||
141 | + } | ||
142 | + } | ||
143 | + } | ||
144 | + }); | ||
145 | + } | ||
146 | + | ||
147 | + Map<String, List<Long>> stringListMap = byKeysGetValue(); | ||
148 | + if (stringListMap != null) { | ||
149 | + // 获取 InvoiceBillOrderDO 类型的 ID 列表 | ||
150 | + List<Long> invoiceBillOrderIds = stringListMap.get("InvoiceBillOrderDO"); | ||
151 | + if (invoiceBillOrderIds != null && !invoiceBillOrderIds.isEmpty()) { | ||
152 | + List<InvoiceBillOrderDO> invoiceBillOrderDOS = invoiceBillOrderService.listByIds(invoiceBillOrderIds); | ||
153 | + invoiceBillOrderDOS.forEach(x->{ | ||
154 | + if(ApplyStatusEnum.NO_COMMIT.getStatus()==x.getStatus() || ApplyStatusEnum.AUDIT_REFUSE.getStatus()==x.getStatus()){ | ||
155 | + twoEmail.clear(); | ||
156 | + twoEmail.addAll(financeEmailList); | ||
157 | + Set<String> userSet = new HashSet<>(); | ||
158 | + userSet.add(x.getCreateBy()); | ||
159 | + userSet.add(x.getBusinesPerson()); | ||
160 | + List<String> emails = userSet.stream() | ||
161 | + .map(userName::get) | ||
162 | + .filter(Objects::nonNull) // 确保 AdminUserDO 不为 null | ||
163 | + .map(AdminUserDO::getEmail) // 获取邮箱 | ||
164 | + .filter(Strings::isNotEmpty) // 确保邮箱不为空 | ||
165 | + .collect(Collectors.toList()); | ||
166 | + | ||
167 | + if (CollectionUtils.isNotEmpty(emails)) { | ||
168 | + twoEmail.addAll(emails); | ||
169 | + } | ||
170 | + FinanceEventJobVO eventJobVO = new FinanceEventJobVO(); | ||
171 | + eventJobVO.setInvoiceBillOrderDO(x); | ||
172 | + emailSendUtils.sendEmail(FinanceOverEnum.INVOICE_OVERTIME, new ArrayList<>(twoEmail), eventJobVO); | ||
173 | + } | ||
174 | + }); | ||
175 | + } | ||
176 | + // 获取 ProducePaymentCheckBillOrderDO 类型的 ID 列表 | ||
177 | + List<Long> producePaymentCheckBillIds = stringListMap.get("ProducePaymentCheckBillOrderDO"); | ||
178 | + if (producePaymentCheckBillIds != null && !producePaymentCheckBillIds.isEmpty()) { | ||
179 | + List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOS = producePaymentCheckBillOrderService.listByIds(producePaymentCheckBillIds); | ||
180 | + producePaymentCheckBillOrderDOS.forEach(x->{ | ||
181 | + if(ApplyStatusEnum.NO_COMMIT.getStatus()==x.getStatus() || ApplyStatusEnum.AUDIT_REFUSE.getStatus()==x.getStatus()){ | ||
182 | + twoEmail.clear(); | ||
183 | + twoEmail.addAll(financeEmailList); | ||
184 | + Set<String> userSet = new HashSet<>(); | ||
185 | + userSet.add(x.getCreateBy()); | ||
186 | + userSet.add(x.getBusinesPerson()); | ||
187 | + List<String> emails = userSet.stream() | ||
188 | + .map(userName::get) | ||
189 | + .filter(Objects::nonNull) // 确保 AdminUserDO 不为 null | ||
190 | + .map(AdminUserDO::getEmail) // 获取邮箱 | ||
191 | + .filter(Strings::isNotEmpty) // 确保邮箱不为空 | ||
192 | + .collect(Collectors.toList()); | ||
193 | + if (CollectionUtils.isNotEmpty(emails)) { | ||
194 | + twoEmail.addAll(emails); | ||
195 | + } | ||
196 | + FinanceEventJobVO eventJobVO = new FinanceEventJobVO(); | ||
197 | + eventJobVO.setProducePaymentCheckBillOrderDO(x); | ||
198 | + emailSendUtils.sendEmail(FinanceOverEnum.PRODUCE_PAYMENT_CHECK_OVERTIME, new ArrayList<>(twoEmail), eventJobVO); | ||
199 | + } | ||
200 | + }); | ||
201 | + } | ||
202 | + } | ||
203 | + } | ||
204 | + | ||
205 | + public Map<String, List<Long>> byKeysGetValue() { | ||
206 | + Map<String, List<Long>> resultMap = new HashMap<>(); | ||
207 | + List<Long> producePaymentCheckBillIds = new ArrayList<>(); | ||
208 | + List<Long> invoiceBillOrderIds = new ArrayList<>(); | ||
209 | + // 获取所有的 keys对应的value。 | ||
210 | + Set<Object> redisKeySet = redisService.getSetValues(Constant.REDISKEY); | ||
211 | + if (CollectionUtils.isNotEmpty(redisKeySet)) { | ||
212 | + List<Object> validKeys = new ArrayList<>(); | ||
213 | + | ||
214 | + // 遍历所有 keys,检查每个 key 的过期时间 | ||
215 | + for (Object key :redisKeySet) { | ||
216 | + Long expireTime = redisService.getExpire(key); // 获取过期时间(单位:秒) | ||
217 | + | ||
218 | + if (expireTime != null && expireTime > 0) { // 确保 expireTime 有值且大于 0 | ||
219 | + long daysRemaining = TimeUnit.SECONDS.toDays(expireTime); | ||
220 | + // 如果剩余时间为14天7天或1天,则符合条件 | ||
221 | + if (daysRemaining==14 || daysRemaining == 7 || daysRemaining == 1) { | ||
222 | + validKeys.add(key); // 满足条件,加入有效的 keys 列表 | ||
223 | + } | ||
224 | + } | ||
225 | + } | ||
226 | + // 如果存在有效的 keys,获取其对应的值 | ||
227 | + if (CollectionUtils.isNotEmpty(validKeys)) { | ||
228 | + List<Object> values = redisService.multiGet(validKeys); | ||
229 | + if (CollectionUtils.isNotEmpty(values)) { | ||
230 | + // 遍历每个 value,按类型分别收集 ID | ||
231 | + for (Object item : values) { | ||
232 | + if (item instanceof ProducePaymentCheckBillOrderDO) { | ||
233 | + ProducePaymentCheckBillOrderDO producePaymentCheckBillOrderDO = (ProducePaymentCheckBillOrderDO) item; | ||
234 | + producePaymentCheckBillIds.add(producePaymentCheckBillOrderDO.getId()); | ||
235 | + } else if (item instanceof InvoiceBillOrderDO) { | ||
236 | + InvoiceBillOrderDO invoiceBillOrderDO = (InvoiceBillOrderDO) item; | ||
237 | + invoiceBillOrderIds.add(invoiceBillOrderDO.getId()); | ||
238 | + } | ||
239 | + } | ||
240 | + } | ||
241 | + // 将结果放入 resultMap | ||
242 | + resultMap.put("ProducePaymentCheckBillOrderDO", producePaymentCheckBillIds); | ||
243 | + resultMap.put("InvoiceBillOrderDO", invoiceBillOrderIds); | ||
244 | + } | ||
245 | + } | ||
246 | + return resultMap; | ||
247 | + } | ||
248 | + | ||
249 | +} |
src/main/java/com/order/erp/mapper/order/CheckBillMappingMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | +import com.order.erp.domain.dto.order.CheckBillMappingDO; | ||
5 | + | ||
6 | +/** | ||
7 | + * 生产科对账单应收账单映射表(CheckBillMapping)表数据库访问层 | ||
8 | + * | ||
9 | + * @author makejava | ||
10 | + * @since 2024-08-05 16:26:37 | ||
11 | + */ | ||
12 | +public interface CheckBillMappingMapper extends BaseMapper<CheckBillMappingDO> { | ||
13 | + | ||
14 | + | ||
15 | +} | ||
16 | + |
src/main/java/com/order/erp/mapper/order/InvoiceBillMappingMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | +import com.order.erp.domain.dto.order.InvoiceBillMappingDO; | ||
5 | + | ||
6 | +/** | ||
7 | + * 应收款账单关联订单映射表(InvoiceBillMapping)表数据库访问层 | ||
8 | + * | ||
9 | + * @author makejava | ||
10 | + * @since 2024-08-05 16:26:36 | ||
11 | + */ | ||
12 | +public interface InvoiceBillMappingMapper extends BaseMapper<InvoiceBillMappingDO> { | ||
13 | + | ||
14 | + | ||
15 | +} | ||
16 | + |
src/main/java/com/order/erp/mapper/order/InvoiceBillOrderMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | +import com.order.erp.domain.dto.order.InvoiceBillOrderDO; | ||
5 | +import org.apache.ibatis.annotations.Select; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单表(InvoiceBillOrder)表数据库访问层 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:34 | ||
14 | + */ | ||
15 | +public interface InvoiceBillOrderMapper extends BaseMapper<InvoiceBillOrderDO> { | ||
16 | +@Select("SELECT * FROM invoice_bill_order WHERE status in('-1','20') and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 1 YEAR) <= date(create_time);") | ||
17 | +List<InvoiceBillOrderDO> getOverEventList(); | ||
18 | + | ||
19 | +} | ||
20 | + |
src/main/java/com/order/erp/mapper/order/ProducePaymentCheckBillOrderMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
4 | +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO; | ||
5 | +import org.apache.ibatis.annotations.Select; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表数据库访问层 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:35 | ||
14 | + */ | ||
15 | +public interface ProducePaymentCheckBillOrderMapper extends BaseMapper<ProducePaymentCheckBillOrderDO> { | ||
16 | + @Select("SELECT * FROM produce_payment_check_bill_order WHERE status in('-1','20') and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 1 YEAR) <= date(create_time);") | ||
17 | + List<ProducePaymentCheckBillOrderDO> getOverEventList(); | ||
18 | + | ||
19 | + | ||
20 | +} | ||
21 | + |
src/main/java/com/order/erp/service/admin/impl/AdminUserServiceImpl.java
@@ -346,6 +346,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | @@ -346,6 +346,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser | ||
346 | if(RoleEnum.PRODUCE_USER.getId().equals(x.getRoleId())){ | 346 | if(RoleEnum.PRODUCE_USER.getId().equals(x.getRoleId())){ |
347 | result.set(RoleEnum.PRODUCE_USER); | 347 | result.set(RoleEnum.PRODUCE_USER); |
348 | } | 348 | } |
349 | + if (RoleEnum.FINANCE_USER.getId().equals(x.getRoleId())) { | ||
350 | + result.set(RoleEnum.FINANCE_USER); | ||
351 | + } | ||
349 | }); | 352 | }); |
350 | return ServerResult.success(result.get()); | 353 | return ServerResult.success(result.get()); |
351 | } | 354 | } |
src/main/java/com/order/erp/service/impl/SystemSettingServiceImpl.java
@@ -2,6 +2,7 @@ package com.order.erp.service.impl; | @@ -2,6 +2,7 @@ package com.order.erp.service.impl; | ||
2 | 2 | ||
3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
4 | import cn.hutool.core.collection.CollUtil; | 4 | import cn.hutool.core.collection.CollUtil; |
5 | +import com.alibaba.fastjson.JSONArray; | ||
5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
6 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 7 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
7 | import com.baomidou.mybatisplus.core.metadata.IPage; | 8 | import com.baomidou.mybatisplus.core.metadata.IPage; |
@@ -11,8 +12,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | @@ -11,8 +12,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
12 | import com.order.erp.common.constant.Constant; | 13 | import com.order.erp.common.constant.Constant; |
13 | import com.order.erp.common.constant.ServerResult; | 14 | import com.order.erp.common.constant.ServerResult; |
15 | +import com.order.erp.common.exception.BusinessException; | ||
14 | import com.order.erp.domain.dto.BaseDO; | 16 | import com.order.erp.domain.dto.BaseDO; |
15 | import com.order.erp.domain.dto.SystemSettingDO; | 17 | import com.order.erp.domain.dto.SystemSettingDO; |
18 | +import com.order.erp.domain.vo.CostSettingItemVO; | ||
16 | import com.order.erp.domain.vo.SystemSettingQueryVO; | 19 | import com.order.erp.domain.vo.SystemSettingQueryVO; |
17 | import com.order.erp.domain.vo.SystemSettingResultVO; | 20 | import com.order.erp.domain.vo.SystemSettingResultVO; |
18 | import com.order.erp.domain.vo.SystemSettingVO; | 21 | import com.order.erp.domain.vo.SystemSettingVO; |
@@ -84,6 +87,9 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | @@ -84,6 +87,9 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | ||
84 | List<SystemSettingResultVO> queryVos = systemSettingDOS.stream().map(x -> { | 87 | List<SystemSettingResultVO> queryVos = systemSettingDOS.stream().map(x -> { |
85 | SystemSettingResultVO resultVO = new SystemSettingResultVO(); | 88 | SystemSettingResultVO resultVO = new SystemSettingResultVO(); |
86 | BeanUtils.copyProperties(x, resultVO); | 89 | BeanUtils.copyProperties(x, resultVO); |
90 | + if (x.getSettingType() == Constant.THREE && StringUtils.isNotBlank(x.getRelationValue())) { | ||
91 | + resultVO.setCostSettingItemVOS(JSONArray.parseArray(x.getRelationValue(), CostSettingItemVO.class)); | ||
92 | + } | ||
87 | return resultVO; | 93 | return resultVO; |
88 | }).collect(Collectors.toList()); | 94 | }).collect(Collectors.toList()); |
89 | webVOPage.setRecords(queryVos); | 95 | webVOPage.setRecords(queryVos); |
@@ -117,6 +123,23 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | @@ -117,6 +123,23 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | ||
117 | if (Objects.nonNull(systemSettingVO.getId())) { | 123 | if (Objects.nonNull(systemSettingVO.getId())) { |
118 | systemSettingVO.setId(null); | 124 | systemSettingVO.setId(null); |
119 | } | 125 | } |
126 | + if (systemSettingVO.getSettingType() == Constant.THREE || systemSettingVO.getSettingType() == Constant.FOUR) { | ||
127 | + if (CollectionUtils.isEmpty(systemSettingVO.getCostSettingItemVOS())) { | ||
128 | + throw new BusinessException("成本配置项不能为空"); | ||
129 | + } | ||
130 | + if(StringUtils.isNotBlank(systemSettingVO.getSettingValue())){ | ||
131 | + SystemSettingDO systemSettingDO = getOne(new LambdaQueryWrapper<SystemSettingDO>() | ||
132 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
133 | + .eq(SystemSettingDO::getSettingValue, systemSettingVO.getSettingValue()) | ||
134 | + .eq(SystemSettingDO::getSettingType,systemSettingVO.getSettingType())); | ||
135 | + if(Objects.nonNull(systemSettingDO)){ | ||
136 | + throw new BusinessException("已配置"+systemSettingVO.getSettingValue()+"的提成数据!"); | ||
137 | + } | ||
138 | + } | ||
139 | +// systemSettingVO.setRelationCode("costSettingItem"); | ||
140 | +// systemSettingVO.setRelationName("成本配置项集合"); | ||
141 | + systemSettingVO.setRelationValue(JSONArray.toJSONString(systemSettingVO.getCostSettingItemVOS())); | ||
142 | + } | ||
120 | SystemSettingDO systemSettingDo = BeanUtil.copyProperties(systemSettingVO, SystemSettingDO.class); | 143 | SystemSettingDO systemSettingDo = BeanUtil.copyProperties(systemSettingVO, SystemSettingDO.class); |
121 | 144 | ||
122 | save(systemSettingDo); | 145 | save(systemSettingDo); |
@@ -136,6 +159,14 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | @@ -136,6 +159,14 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | ||
136 | if (Objects.isNull(systemSettingVO.getId())) { | 159 | if (Objects.isNull(systemSettingVO.getId())) { |
137 | return ServerResult.fail("id 不能为空"); | 160 | return ServerResult.fail("id 不能为空"); |
138 | } | 161 | } |
162 | + if (Objects.nonNull(systemSettingVO.getSettingType()) && (systemSettingVO.getSettingType() == Constant.THREE || systemSettingVO.getSettingType() == Constant.FOUR)) { | ||
163 | + if (CollectionUtils.isEmpty(systemSettingVO.getCostSettingItemVOS())) { | ||
164 | + throw new BusinessException("成本配置项不能为空"); | ||
165 | + } | ||
166 | +// systemSettingVO.setRelationCode("costSettingItem"); | ||
167 | +// systemSettingVO.setRelationName("成本配置项集合"); | ||
168 | + systemSettingVO.setRelationValue(JSONArray.toJSONString(systemSettingVO.getCostSettingItemVOS())); | ||
169 | + } | ||
139 | SystemSettingDO systemSettingDo = BeanUtil.copyProperties(systemSettingVO, SystemSettingDO.class); | 170 | SystemSettingDO systemSettingDo = BeanUtil.copyProperties(systemSettingVO, SystemSettingDO.class); |
140 | 171 | ||
141 | updateById(systemSettingDo); | 172 | updateById(systemSettingDo); |
src/main/java/com/order/erp/service/order/CheckBillMappingService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.CheckBillMappingDO; | ||
6 | +import com.order.erp.domain.vo.order.CheckBillMappingQueryVO; | ||
7 | +import com.order.erp.domain.vo.order.CheckBillMappingVO; | ||
8 | + | ||
9 | +/** | ||
10 | + * 生产科对账单应收账单映射表(CheckBillMapping)表服务接口 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:37 | ||
14 | + */ | ||
15 | +public interface CheckBillMappingService extends IService<CheckBillMappingDO> { | ||
16 | + | ||
17 | + /** | ||
18 | + * 通过ID查询单条数据 | ||
19 | + * | ||
20 | + * @param checkBillMappingQueryVO 主键 | ||
21 | + * @return 实例对象 | ||
22 | + */ | ||
23 | + ServerResult queryById(CheckBillMappingQueryVO checkBillMappingQueryVO); | ||
24 | + | ||
25 | + /** | ||
26 | + * 分页查询 | ||
27 | + * | ||
28 | + * @param checkBillMappingQueryVO 筛选条件 | ||
29 | + * @return 查询结果 | ||
30 | + */ | ||
31 | + ServerResult list(CheckBillMappingQueryVO checkBillMappingQueryVO); | ||
32 | + | ||
33 | + /** | ||
34 | + * 新增数据 | ||
35 | + * | ||
36 | + * @param checkBillMappingVO 数据VO | ||
37 | + * @return 新增结果 | ||
38 | + */ | ||
39 | + ServerResult add(CheckBillMappingVO checkBillMappingVO); | ||
40 | + | ||
41 | + /** | ||
42 | + * 修改数据 | ||
43 | + * | ||
44 | + * @param checkBillMappingVO 数据VO | ||
45 | + * @return 编辑结果 | ||
46 | + */ | ||
47 | + ServerResult edit(CheckBillMappingVO checkBillMappingVO); | ||
48 | + | ||
49 | + /** | ||
50 | + * 通过主键删除数据 | ||
51 | + * | ||
52 | + * @param checkBillMappingQueryVO 筛选条件 | ||
53 | + * @return 是否成功 | ||
54 | + */ | ||
55 | + ServerResult deleteById(CheckBillMappingQueryVO checkBillMappingQueryVO); | ||
56 | + | ||
57 | +} |
src/main/java/com/order/erp/service/order/InvoiceBillMappingService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.InvoiceBillMappingDO; | ||
6 | +import com.order.erp.domain.vo.order.InvoiceBillMappingQueryVO; | ||
7 | +import com.order.erp.domain.vo.order.InvoiceBillMappingVO; | ||
8 | + | ||
9 | +/** | ||
10 | + * 应收款账单关联订单映射表(InvoiceBillMapping)表服务接口 | ||
11 | + * | ||
12 | + * @author makejava | ||
13 | + * @since 2024-08-05 16:26:36 | ||
14 | + */ | ||
15 | +public interface InvoiceBillMappingService extends IService<InvoiceBillMappingDO> { | ||
16 | + | ||
17 | + /** | ||
18 | + * 通过ID查询单条数据 | ||
19 | + * | ||
20 | + * @param invoiceBillMappingQueryVO 主键 | ||
21 | + * @return 实例对象 | ||
22 | + */ | ||
23 | + ServerResult queryById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO); | ||
24 | + | ||
25 | + /** | ||
26 | + * 分页查询 | ||
27 | + * | ||
28 | + * @param invoiceBillMappingQueryVO 筛选条件 | ||
29 | + * @return 查询结果 | ||
30 | + */ | ||
31 | + ServerResult list(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO); | ||
32 | + | ||
33 | + /** | ||
34 | + * 新增数据 | ||
35 | + * | ||
36 | + * @param invoiceBillMappingVO 数据VO | ||
37 | + * @return 新增结果 | ||
38 | + */ | ||
39 | + ServerResult add(InvoiceBillMappingVO invoiceBillMappingVO); | ||
40 | + | ||
41 | + /** | ||
42 | + * 修改数据 | ||
43 | + * | ||
44 | + * @param invoiceBillMappingVO 数据VO | ||
45 | + * @return 编辑结果 | ||
46 | + */ | ||
47 | + ServerResult edit(InvoiceBillMappingVO invoiceBillMappingVO); | ||
48 | + | ||
49 | + /** | ||
50 | + * 通过主键删除数据 | ||
51 | + * | ||
52 | + * @param invoiceBillMappingQueryVO 筛选条件 | ||
53 | + * @return 是否成功 | ||
54 | + */ | ||
55 | + ServerResult deleteById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO); | ||
56 | + | ||
57 | +} |
src/main/java/com/order/erp/service/order/InvoiceBillOrderService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.InvoiceBillOrderDO; | ||
6 | +import com.order.erp.domain.vo.order.*; | ||
7 | + | ||
8 | +import javax.servlet.http.HttpServletResponse; | ||
9 | +import java.io.IOException; | ||
10 | +import java.util.List; | ||
11 | + | ||
12 | +/** | ||
13 | + * 应收款账单表(InvoiceBillOrder)表服务接口 | ||
14 | + * | ||
15 | + * @author makejava | ||
16 | + * @since 2024-08-05 16:26:34 | ||
17 | + */ | ||
18 | +public interface InvoiceBillOrderService extends IService<InvoiceBillOrderDO> { | ||
19 | + | ||
20 | + /** | ||
21 | + * 分页查询 | ||
22 | + * | ||
23 | + * @param invoiceBillOrderQueryVO 筛选条件 | ||
24 | + * @return 查询结果 | ||
25 | + */ | ||
26 | + ServerResult listByPage(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | ||
27 | + | ||
28 | + /** | ||
29 | + * @param queryVO | ||
30 | + * @return | ||
31 | + */ | ||
32 | + ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO); | ||
33 | + | ||
34 | + /** | ||
35 | + * @param queryVO | ||
36 | + * @return | ||
37 | + */ | ||
38 | + ServerResult listAnalysisBy(InvoiceBillAnalysisVO queryVO); | ||
39 | + | ||
40 | + /** | ||
41 | + * @param queryVO | ||
42 | + * @return | ||
43 | + */ | ||
44 | + ServerResult export(HttpServletResponse response, InvoiceBillAnalysisVO queryVO) throws IOException; | ||
45 | + | ||
46 | + /** | ||
47 | + * 新增数据 | ||
48 | + * | ||
49 | + * @param createVO 数据VO | ||
50 | + * @return 新增结果 | ||
51 | + */ | ||
52 | + ServerResult create(InvoiceBillCreateVO createVO); | ||
53 | + | ||
54 | + /** | ||
55 | + * | ||
56 | + * @param createVO | ||
57 | + * @return | ||
58 | + */ | ||
59 | + ServerResult getBackRefundDate(InvoiceBillCreateVO createVO); | ||
60 | + | ||
61 | + /** | ||
62 | + * 更新扣款信息 | ||
63 | + * | ||
64 | + * @param deductInfoVO 数据VO | ||
65 | + * @return 编辑结果 | ||
66 | + */ | ||
67 | + ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO); | ||
68 | + | ||
69 | + /** | ||
70 | + * 更新其他金额信息 | ||
71 | + * | ||
72 | + * @param amountInfoVO | ||
73 | + * @return | ||
74 | + */ | ||
75 | + ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO); | ||
76 | + | ||
77 | + /** | ||
78 | + * 提交审核 | ||
79 | + * | ||
80 | + * @param commitApplyVO | ||
81 | + * @return | ||
82 | + */ | ||
83 | + ServerResult commitApply(InvoiceBillCommitApplyVO commitApplyVO); | ||
84 | + | ||
85 | + /** | ||
86 | + * 通过主键删除数据 | ||
87 | + * | ||
88 | + * @param invoiceBillOrderQueryVO 筛选条件 | ||
89 | + * @return 是否成功 | ||
90 | + */ | ||
91 | + ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | ||
92 | + | ||
93 | + /** | ||
94 | + * 通过主键得到扣款信息。 | ||
95 | + * | ||
96 | + * @param invoiceBillOrderQueryVO 筛选条件 | ||
97 | + * @return 是否成功 | ||
98 | + */ | ||
99 | + ServerResult getDeductUrlById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | ||
100 | + /** | ||
101 | + * 重新更新报关单 | ||
102 | + * | ||
103 | + * @param bgUrl | ||
104 | + * @return 是否成功 | ||
105 | + */ | ||
106 | + ServerResult reUploadBgurl(InvoiceBillCreateVO bgUrl); | ||
107 | + | ||
108 | + /** | ||
109 | + * 导出审核收款单数据。 | ||
110 | + * | ||
111 | + * @param queryVO | ||
112 | + * @return 是否成功 | ||
113 | + */ | ||
114 | + ServerResult exportReceipt(HttpServletResponse response,InvoiceBillOrderDO queryVO) throws IOException; | ||
115 | + | ||
116 | + List<InvoiceBillOrderDO> getOverEvnetList(); | ||
117 | + | ||
118 | +} |
src/main/java/com/order/erp/service/order/ProducePaymentCheckBillOrderService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO; | ||
6 | +import com.order.erp.domain.vo.order.*; | ||
7 | + | ||
8 | +import javax.servlet.http.HttpServletResponse; | ||
9 | +import java.io.IOException; | ||
10 | +import java.util.List; | ||
11 | + | ||
12 | +/** | ||
13 | + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表服务接口 | ||
14 | + * | ||
15 | + * @author makejava | ||
16 | + * @since 2024-08-05 16:26:35 | ||
17 | + */ | ||
18 | +public interface ProducePaymentCheckBillOrderService extends IService<ProducePaymentCheckBillOrderDO> { | ||
19 | + | ||
20 | + /** | ||
21 | + * 分页查询 | ||
22 | + * | ||
23 | + * @param queryVO 筛选条件 | ||
24 | + * @return 查询结果 | ||
25 | + */ | ||
26 | + ServerResult listByPage(ProducePaymentCheckBillOrderQueryVO queryVO); | ||
27 | + | ||
28 | + /** | ||
29 | + * 基础订单查询 | ||
30 | + * | ||
31 | + * @param queryVO | ||
32 | + * @return | ||
33 | + */ | ||
34 | + ServerResult listBaseOrderInfoBy(ProducePaymentBaseOrderQueryVO queryVO); | ||
35 | + | ||
36 | + /** | ||
37 | + * 分析列表 | ||
38 | + * | ||
39 | + * @param analysisVO | ||
40 | + * @return | ||
41 | + */ | ||
42 | + ServerResult listAnalysisBy(ProducePaymentCheckBillOrderQueryVO analysisVO); | ||
43 | + | ||
44 | + /** | ||
45 | + * | ||
46 | + * @param analysisVO | ||
47 | + * @return | ||
48 | + */ | ||
49 | + ServerResult export(HttpServletResponse response, ProducePaymentCheckBillOrderQueryVO analysisVO) throws IOException; | ||
50 | + | ||
51 | + /** | ||
52 | + * 创建生产科应付单据 | ||
53 | + * | ||
54 | + * @param createVO 数据VO | ||
55 | + * @return 新增结果 | ||
56 | + */ | ||
57 | + ServerResult create(ProducePaymentCheckBillCreateVO createVO); | ||
58 | + | ||
59 | + /** | ||
60 | + * 获取生产科应回款日期 | ||
61 | + * | ||
62 | + * @param createVO | ||
63 | + * @return | ||
64 | + */ | ||
65 | + ServerResult getPayedDate(ProducePaymentCheckBillCreateVO createVO); | ||
66 | + | ||
67 | + /** | ||
68 | + * 更新扣款信息 | ||
69 | + * | ||
70 | + * @param deductInfoVO 数据VO | ||
71 | + * @return 编辑结果 | ||
72 | + */ | ||
73 | + ServerResult updateDeductInfo(ProducePaymentCheckBillDeductInfoVO deductInfoVO); | ||
74 | + | ||
75 | + /** | ||
76 | + * 更新其他金额信息 | ||
77 | + * | ||
78 | + * @param amountInfoVO | ||
79 | + * @return | ||
80 | + */ | ||
81 | + ServerResult updateAmountInfo(ProducePaymentCheckBillAmountInfoVO amountInfoVO); | ||
82 | + | ||
83 | + /** | ||
84 | + * 更新发票信息 | ||
85 | + * | ||
86 | + * @param invoiceInfoVO | ||
87 | + * @return | ||
88 | + */ | ||
89 | + ServerResult updateInvoiceInfo(ProducePaymentCheckBillInvoiceInfoVO invoiceInfoVO); | ||
90 | + | ||
91 | + /** | ||
92 | + * @param commitApplyVO | ||
93 | + * @return | ||
94 | + */ | ||
95 | + ServerResult commitApply(ProducePaymentCheckBillCommitApplyVO commitApplyVO); | ||
96 | + | ||
97 | + /** | ||
98 | + * 通过主键删除数据 | ||
99 | + * | ||
100 | + * @param producePaymentCheckBillOrderQueryVO 筛选条件 | ||
101 | + * @return 是否成功 | ||
102 | + */ | ||
103 | + ServerResult deleteById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO); | ||
104 | + | ||
105 | + ServerResult getDeductUrlById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO); | ||
106 | + | ||
107 | + ServerResult getInvoiceUrlById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO); | ||
108 | + ServerResult exportReceipt(HttpServletResponse response, ProducePaymentCheckBillOrderDO queryVO) throws IOException; | ||
109 | + | ||
110 | + List<ProducePaymentCheckBillOrderDO> getOverEventList(); | ||
111 | +} |
src/main/java/com/order/erp/service/order/impl/CalculateProfitServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
4 | +import com.alibaba.fastjson.TypeReference; | ||
5 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
6 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
7 | +import com.order.erp.common.constant.Constant; | ||
8 | +import com.order.erp.common.constant.ServerResult; | ||
9 | +import com.order.erp.common.exception.BusinessException; | ||
10 | +import com.order.erp.common.utils.DateUtils; | ||
11 | +import com.order.erp.common.utils.EasyPdfUtils; | ||
12 | +import com.order.erp.domain.dto.BaseDO; | ||
13 | +import com.order.erp.domain.dto.SystemSettingDO; | ||
14 | +import com.order.erp.domain.dto.order.OrderBaseInfoDO; | ||
15 | +import com.order.erp.domain.dto.order.OrderProfitAnalysisDO; | ||
16 | +import com.order.erp.domain.vo.CostSettingItemVO; | ||
17 | +import com.order.erp.domain.vo.order.BusinessProfitRatioQueryVO; | ||
18 | +import com.order.erp.domain.vo.order.BusinessProfitRatioResultVO; | ||
19 | +import com.order.erp.domain.vo.order.InnerProfitRatioQueryVO; | ||
20 | +import com.order.erp.domain.vo.order.InnerProfitRatioResultVO; | ||
21 | +import com.order.erp.service.SystemSettingService; | ||
22 | +import com.order.erp.service.order.OrderBaseInfoService; | ||
23 | +import lombok.extern.slf4j.Slf4j; | ||
24 | +import org.apache.poi.ss.usermodel.*; | ||
25 | +import org.apache.poi.ss.util.CellRangeAddress; | ||
26 | +import org.apache.poi.xssf.usermodel.XSSFWorkbook; | ||
27 | +import org.springframework.beans.BeanUtils; | ||
28 | +import org.springframework.stereotype.Service; | ||
29 | + | ||
30 | +import javax.annotation.Resource; | ||
31 | +import javax.servlet.http.HttpServletResponse; | ||
32 | +import java.io.IOException; | ||
33 | +import java.math.BigDecimal; | ||
34 | +import java.math.RoundingMode; | ||
35 | +import java.util.List; | ||
36 | +import java.util.Objects; | ||
37 | +import java.util.Set; | ||
38 | +import java.util.function.Function; | ||
39 | +import java.util.stream.Collectors; | ||
40 | + | ||
41 | +/** | ||
42 | + * @author: xms | ||
43 | + * @description: TODO | ||
44 | + * @date: 2024/8/26 16:17 | ||
45 | + * @version: 1.0 | ||
46 | + */ | ||
47 | +@Slf4j | ||
48 | +@Service | ||
49 | +public class CalculateProfitServiceImpl { | ||
50 | + | ||
51 | + | ||
52 | + @Resource | ||
53 | + private OrderBaseInfoService orderBaseInfoService; | ||
54 | + | ||
55 | + @Resource | ||
56 | + private OrderProfitAnalysisServiceImpl orderProfitAnalysisService; | ||
57 | + | ||
58 | + @Resource | ||
59 | + private EasyPdfUtils pdfUtils; | ||
60 | + @Resource | ||
61 | + private SystemSettingService systemSettingService; | ||
62 | + | ||
63 | + /** | ||
64 | + * @param response | ||
65 | + * @param queryVO | ||
66 | + * @return | ||
67 | + */ | ||
68 | + public ServerResult businessProfitRatioExport(HttpServletResponse response, BusinessProfitRatioQueryVO queryVO) throws IOException { | ||
69 | + BusinessProfitRatioResultVO resultVO = buildBusinessProfitRatioResultVO(queryVO); | ||
70 | +// File file = pdfUtils.createBusinessProfitResultPdf(resultVO, "business_profit_ratio.pdf"); | ||
71 | +// FileUtil.downloadFile(request, response, file, true); | ||
72 | + //开始 | ||
73 | + Workbook workbook = new XSSFWorkbook(); | ||
74 | + Sheet sheet = workbook.createSheet("业务净利润分析表"); | ||
75 | + Row row = sheet.createRow(0); | ||
76 | + Cell cell = row.createCell(0); | ||
77 | + cell.setCellValue("业务净利润分析表"); | ||
78 | + sheet.setMargin(sheet.LeftMargin,0.5); | ||
79 | + sheet.setMargin(sheet.RightMargin,0.5); | ||
80 | + | ||
81 | + CellStyle titleStyle = workbook.createCellStyle(); | ||
82 | + Font titleFont = workbook.createFont(); | ||
83 | + titleFont.setFontHeightInPoints((short) 26); // 字体大小 | ||
84 | + titleFont.setBold(true); // 加粗 | ||
85 | + titleFont.setFontName("等线"); | ||
86 | + titleStyle.setAlignment(HorizontalAlignment.CENTER); // 水平居中 | ||
87 | + titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 垂直居中 | ||
88 | + // 合并单元格(第一行的第一列到第三列) | ||
89 | + sheet.addMergedRegion(new CellRangeAddress(0, 3, 0, 9)); | ||
90 | + titleStyle.setFont(titleFont); | ||
91 | + cell.setCellStyle(titleStyle); | ||
92 | + | ||
93 | + // 第二行 | ||
94 | + createMergedCell(sheet, workbook, 4, 0, 4, 5, 0, 1, "项目号"); | ||
95 | + createMergedCell(sheet, workbook, 4, 2, 4, 5, 2, 4, String.join(",",resultVO.getProjectNo())); | ||
96 | + createMergedCell(sheet, workbook, 4, 5, 4, 5, 5, 6, "开始时间"); | ||
97 | + createMergedCell(sheet, workbook, 4, 7, 4, 5, 7, 9, "结束时间"); | ||
98 | +// 第三行 | ||
99 | + createMergedCell(sheet, workbook, 6, 0, 6, 7, 0, 1, ""); | ||
100 | + createMergedCell(sheet, workbook, 6, 2, 6, 7, 2, 4, "项目开始时间"); | ||
101 | + createMergedCell(sheet, workbook, 6, 5, 6, 7, 5, 6, resultVO.getProjectStartTime()); | ||
102 | + createMergedCell(sheet, workbook, 6, 7, 6, 7, 7, 9, resultVO.getProjectEndTime()); | ||
103 | + | ||
104 | +// 第四行 | ||
105 | + createMergedCell(sheet, workbook, 8, 0, 8, 9, 0, 1, ""); | ||
106 | + createMergedCell(sheet, workbook, 8, 2, 8, 9, 2, 4, "生产进行时间"); | ||
107 | + createMergedCell(sheet, workbook, 8, 5, 8, 9, 5, 6, resultVO.getProduceStartTime()); | ||
108 | + createMergedCell(sheet, workbook, 8, 7, 8, 9, 7, 9, resultVO.getProduceEndTime()); | ||
109 | +//第五行 | ||
110 | + createMergedCell(sheet, workbook, 10, 0, 10, 11, 0, 1, "客户编码"); | ||
111 | + createMergedCell(sheet, workbook, 10, 2, 10, 11, 2, 4, resultVO.getCustomerCode()); | ||
112 | + createMergedCell(sheet, workbook, 10, 5, 10, 11, 5, 6, ""); | ||
113 | + createMergedCell(sheet, workbook, 10, 7, 10, 11, 7, 9, "备注"); | ||
114 | +//第六行 | ||
115 | + createMergedCell(sheet, workbook, 12, 0, 12, 13, 0, 4, "客户总金额计算"); | ||
116 | + createMergedCell(sheet, workbook, 12, 5, 12, 13, 5, 6, "¥"+resultVO.getCustomerTotalPrice()); | ||
117 | + createMergedCell(sheet, workbook, 12, 9, 12, 13, 7, 9, ""); | ||
118 | +////第七行 | ||
119 | + createMergedCell(sheet, workbook, 14, 0, 14, 15, 0, 4, "生产科总价合计"); | ||
120 | + createMergedCell(sheet, workbook, 14, 5, 14, 15, 5, 6, "¥"+resultVO.getProductionDepartmentTotalPrice()); | ||
121 | + createMergedCell(sheet, workbook, 14, 7, 14, 15, 7, 9, ""); | ||
122 | +////第八行 | ||
123 | + createMergedCell(sheet, workbook, 16, 0, 16, 17, 0, 4, "包装费用合计"); | ||
124 | + createMergedCell(sheet, workbook, 16, 5, 16, 17, 5, 6, "¥"+resultVO.getPacketTotalPrice()); | ||
125 | + createMergedCell(sheet, workbook, 16, 7, 16, 17, 7, 9, ""); | ||
126 | +////第九行 | ||
127 | + createMergedCell(sheet, workbook, 18, 0, 18, 19, 0, 4, "研发开发费合计"); | ||
128 | + createMergedCell(sheet, workbook, 18, 5, 18, 19, 5, 6, "¥"+resultVO.getDevelopTotalPrice().setScale(2, RoundingMode.HALF_UP)); | ||
129 | + createMergedCell(sheet, workbook, 18, 7, 18, 19, 7, 9, ""); | ||
130 | +////第十行 | ||
131 | + createMergedCell(sheet, workbook, 20, 0, 20, 21, 0, 4, "复制费用合计"); | ||
132 | + createMergedCell(sheet, workbook, 20, 5, 20, 21, 5, 6, "¥"+resultVO.getCopyTotalPrice().setScale(2, RoundingMode.HALF_UP)); | ||
133 | + createMergedCell(sheet, workbook, 20, 7, 20, 21, 7, 9, ""); | ||
134 | +//第十一行 | ||
135 | + createMergedCell(sheet, workbook, 22, 0, 22, 23, 0, 4, "固定成本"); | ||
136 | + createMergedCell(sheet, workbook, 22, 5, 22, 23, 5, 6, "¥"+resultVO.getFixCost()); | ||
137 | + createMergedCell(sheet, workbook, 22, 7, 22, 23, 7, 9, ""); | ||
138 | +//第十二行 | ||
139 | + createMergedCell(sheet, workbook, 24, 0, 24, 25, 0, 4, "西班牙提成"); | ||
140 | + createMergedCell(sheet, workbook, 24, 5, 24, 25, 5, 6, "¥"+resultVO.getSpainRatioProfitPrice()); | ||
141 | + createMergedCell(sheet, workbook, 24, 7, 24, 25, 7, 9, ""); | ||
142 | +//第十三行 | ||
143 | + createMergedCell(sheet, workbook, 26, 0, 26, 27, 0, 4, "中国团队提成"); | ||
144 | + createMergedCell(sheet, workbook, 26, 5, 26, 27, 5, 6, "¥"+resultVO.getChinaRatioProfitPrice()); | ||
145 | + createMergedCell(sheet, workbook, 26, 7, 26, 27, 7, 9, ""); | ||
146 | + //第十四行 | ||
147 | + createMergedCell(sheet, workbook, 28, 0, 28, 29, 0, 4, "支出合计"); | ||
148 | + createMergedCell(sheet, workbook, 28, 5, 28, 29, 5, 6, "¥"+resultVO.getOutTotalPrice()); | ||
149 | + createMergedCell(sheet, workbook, 28, 7, 28, 29, 7, 9, ""); | ||
150 | +//第十五行 | ||
151 | + createMergedCell(sheet, workbook, 30, 0, 30, 31, 0, 4, "毛利润"); | ||
152 | + createMergedCell(sheet, workbook, 30, 5, 30, 31, 5, 6, "¥"+resultVO.getGrossProfit()); | ||
153 | + createMergedCell(sheet, workbook, 30, 7, 30, 31, 7, 9, ""); | ||
154 | +////第十六行 | ||
155 | + createMergedCell(sheet, workbook, 32, 0, 32, 33, 0, 4, "研发贸易净利润"); | ||
156 | + createMergedCell(sheet, workbook, 32, 5, 32, 33, 5, 6, "¥"+resultVO.getDevelopProfit()); | ||
157 | + createMergedCell(sheet, workbook, 32, 7, 32, 33, 7, 9, ""); | ||
158 | +////第十七行 | ||
159 | + createMergedCell(sheet, workbook, 34, 0, 34, 35, 0, 4, "包装费用合计金额"); | ||
160 | + createMergedCell(sheet, workbook, 34, 5, 34, 35, 5, 6, "¥"+resultVO.getPacketTotalPrice()); | ||
161 | + createMergedCell(sheet, workbook, 34, 7, 34, 35, 7, 9, ""); | ||
162 | +////第十八行 | ||
163 | + createMergedCell(sheet, workbook, 36, 0, 36, 37, 0, 4, "包装费用实际金额"); | ||
164 | + createMergedCell(sheet, workbook, 36, 5, 36, 37, 5, 6, "¥"+resultVO.getPacketActualTotalPrice().setScale(2, RoundingMode.HALF_UP)); | ||
165 | + createMergedCell(sheet, workbook, 36, 7, 36, 37, 7, 9, ""); | ||
166 | +////第十九行 | ||
167 | + createMergedCell(sheet, workbook, 38, 0, 38, 39, 0, 4, "订单总数量"); | ||
168 | + createMergedCell(sheet, workbook, 38, 5, 38, 39, 5, 6, String.valueOf(resultVO.getOrderCount())); | ||
169 | + createMergedCell(sheet, workbook, 38, 7, 38, 39, 7, 9, ""); | ||
170 | +////第二十行 | ||
171 | + createMergedCell(sheet, workbook, 40, 0, 40, 41, 0, 4, "实际跟单单价=实际跟单费用/件数"); | ||
172 | + createMergedCell(sheet, workbook, 40, 5, 40, 41, 5, 6, "¥"+resultVO.getActualRmbPrice()); | ||
173 | + createMergedCell(sheet, workbook, 40, 7, 40, 41, 7, 9, ""); | ||
174 | +//第二十一行 | ||
175 | + createMergedCell(sheet, workbook, 42, 0, 42, 43, 0, 4, "实际跟单单价折算美金"); | ||
176 | + createMergedCell(sheet, workbook, 42, 5, 42, 43, 5, 6, "$"+resultVO.getActualPrice()); | ||
177 | + createMergedCell(sheet, workbook, 42, 7, 42, 43, 7, 9, ""); | ||
178 | +//第二十二行 | ||
179 | + createMergedCell(sheet, workbook, 44, 0, 44, 45, 0, 4, "包装费用收益"); | ||
180 | + createMergedCell(sheet, workbook, 44, 5, 44, 45, 5, 6, "¥"+resultVO.getPacketProfitPrice()); | ||
181 | + createMergedCell(sheet, workbook, 44, 7, 44, 45, 7, 9, ""); | ||
182 | +//第二十三行 | ||
183 | + createMergedCell(sheet, workbook, 46, 0, 46, 47, 0, 4, "实际汇率"); | ||
184 | + createMergedCell(sheet, workbook, 46, 5, 46, 47, 5, 6, "¥"+resultVO.getActualRatio().setScale(2, RoundingMode.HALF_UP)); | ||
185 | + createMergedCell(sheet, workbook, 46, 7, 46, 47, 7, 9, ""); | ||
186 | +//第二十四行 | ||
187 | + createMergedCell(sheet, workbook, 48, 0, 48, 49, 0, 4, "汇率收益"); | ||
188 | + createMergedCell(sheet, workbook, 48, 5, 48, 49, 5, 6, "¥"+resultVO.getActualRatioProfitPrice()); | ||
189 | + createMergedCell(sheet, workbook, 48, 7, 48, 49, 7, 9, ""); | ||
190 | +//第二十五行 | ||
191 | + createMergedCell(sheet, workbook, 50, 0, 50, 51, 0, 4, "综合收益"); | ||
192 | + createMergedCell(sheet, workbook, 50, 5, 50, 51, 5, 6, "¥"+resultVO.getTotalProfitPrice()); | ||
193 | + createMergedCell(sheet, workbook, 50, 7, 50, 51, 7, 9, ""); | ||
194 | + response.setHeader("Content-Disposition", "attachment; filename=\"-.xlsx\""); | ||
195 | + workbook.write(response.getOutputStream()); | ||
196 | + workbook.close(); | ||
197 | + //结束 | ||
198 | + return ServerResult.success(); | ||
199 | + } | ||
200 | + | ||
201 | + /** | ||
202 | + * @param response | ||
203 | + * @param queryVO | ||
204 | + * @return | ||
205 | + */ | ||
206 | + public ServerResult innerProfitRatioExport(HttpServletResponse response,InnerProfitRatioQueryVO queryVO) throws IOException { | ||
207 | + InnerProfitRatioResultVO resultVO = buildInnerProfitRatioResultVO(queryVO); | ||
208 | +// File file = pdfUtils.createInnerProfitResultPdf(resultVO, "inner_profit_ratio.pdf"); | ||
209 | +// FileUtil.downloadFile(request, response, file, true); | ||
210 | +////开始 | ||
211 | +//结束 | ||
212 | + Workbook workbook = new XSSFWorkbook(); | ||
213 | + Sheet sheet = workbook.createSheet("内部生产净利润分析表"); | ||
214 | + Row row = sheet.createRow(0); | ||
215 | + Cell cell = row.createCell(0); | ||
216 | + cell.setCellValue("内部生产净利润分析表"); | ||
217 | + | ||
218 | + CellStyle titleStyle = workbook.createCellStyle(); | ||
219 | + Font titleFont = workbook.createFont(); | ||
220 | + titleFont.setFontHeightInPoints((short) 26); // 字体大小 | ||
221 | + titleFont.setBold(true); // 加粗 | ||
222 | + titleFont.setFontName("等线"); | ||
223 | + titleStyle.setAlignment(HorizontalAlignment.CENTER); // 水平居中 | ||
224 | + titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 垂直居中 | ||
225 | + // 合并单元格(第一行的第一列到第三列) | ||
226 | + sheet.addMergedRegion(new CellRangeAddress(0, 3, 0, 10)); | ||
227 | + titleStyle.setFont(titleFont); | ||
228 | + cell.setCellStyle(titleStyle); | ||
229 | + | ||
230 | + // 第二行 | ||
231 | + createMergedCell(sheet, workbook, 4, 0, 4, 5, 0, 1, "项目号"); | ||
232 | + createMergedCell(sheet, workbook, 4, 2, 4, 5, 2, 3, resultVO.getProjectNo()); | ||
233 | + createMergedCell(sheet, workbook, 4, 4, 4, 5, 4, 5, "开始时间"); | ||
234 | + createMergedCell(sheet, workbook, 4, 6, 4, 5, 6, 7, "结束时间"); | ||
235 | + createMergedCell(sheet, workbook, 4, 8,4, 5, 8, 10, "生产持续时间"); | ||
236 | +// 第三行 | ||
237 | + createMergedCell(sheet, workbook, 6, 0, 6, 7, 0, 1, ""); | ||
238 | + createMergedCell(sheet, workbook, 6, 2, 6, 7, 2, 3, "项目开发时间"); | ||
239 | + createMergedCell(sheet, workbook, 6, 4, 6, 7, 4, 5, resultVO.getProjectStartTime()); | ||
240 | + createMergedCell(sheet, workbook, 6, 6, 6, 7, 6, 7, resultVO.getProjectEndTime()); | ||
241 | + createMergedCell(sheet, workbook, 6, 8, 6, 7, 8, 10, String.valueOf(resultVO.getProjectDays())); | ||
242 | + | ||
243 | +// 第四行 | ||
244 | + createMergedCell(sheet, workbook, 8, 0, 8, 9, 0, 1, "客户编码"); | ||
245 | + createMergedCell(sheet, workbook, 8, 2, 8, 9, 2, 3, resultVO.getCustomerCode()); | ||
246 | + createMergedCell(sheet, workbook, 8, 4, 8, 9, 4, 5, "明细"); | ||
247 | + createMergedCell(sheet, workbook, 8, 6, 8, 9, 6, 7, "金额"); | ||
248 | + createMergedCell(sheet, workbook, 8, 8, 8, 9, 8, 10, "订单数量"); | ||
249 | +//第五行 | ||
250 | + createMergedCell(sheet, workbook, 10, 0, 10, 11, 0, 3, "生产科总价合计"); | ||
251 | + createMergedCell(sheet, workbook, 10, 4, 10, 11, 4, 5, "¥"+ resultVO.getProductionDepartmentTotalPrice()); | ||
252 | + createMergedCell(sheet, workbook, 10, 6, 10, 11, 6, 7, "¥"+ resultVO.getProductionDepartmentTotalPrice()); | ||
253 | + createMergedCell(sheet, workbook, 10, 8, 10, 11, 8, 10, String.valueOf(resultVO.getOrderCount())); | ||
254 | +//第六行 | ||
255 | + createMergedCell(sheet, workbook, 12, 0, 12, 13, 0, 3, "生产科预算金额"); | ||
256 | + createMergedCell(sheet, workbook, 12, 4, 12, 13, 4, 5, "¥"+ resultVO.getProductionDepartmentPredictPrice().setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
257 | + createMergedCell(sheet, workbook, 12, 6, 12, 13, 6, 7, "预算占比"); | ||
258 | + createMergedCell(sheet, workbook, 12, 8, 12, 13, 8, 10, "预算占比与实际占比差"); | ||
259 | +//第七行 | ||
260 | + createMergedCell(sheet, workbook, 14, 0, 14, 15, 0, 3, "实际发生费用"); | ||
261 | + createMergedCell(sheet, workbook, 14, 4, 14, 15, 4, 5, "¥"+ resultVO.getProductionActualPrice().setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
262 | + createMergedCell(sheet, workbook, 14, 6, 14, 15, 6, 7, (resultVO.getPredictRatio())+"%"); | ||
263 | + createMergedCell(sheet, workbook, 14, 8, 14, 15, 8, 10, (resultVO.getPredictAndActualRatio())+"%"); | ||
264 | +//第八行 | ||
265 | + createMergedCell(sheet, workbook, 16, 0, 16, 17, 0, 3, "内部生产毛利润"); | ||
266 | + createMergedCell(sheet, workbook, 16, 4, 16, 17, 4, 5, "¥"+ resultVO.getGrossProfit()); | ||
267 | + createMergedCell(sheet, workbook, 16, 6, 16, 17, 6, 7, ""); | ||
268 | + createMergedCell(sheet, workbook, 16, 8, 16, 17, 8, 10, ""); | ||
269 | +//第九行 | ||
270 | + createMergedCell(sheet, workbook, 18, 0, 18, 19, 0, 3, "内部生产固定成本"); | ||
271 | + createMergedCell(sheet, workbook, 18, 4, 18, 19, 4, 5, "¥"+ resultVO.getInnerProduceFixProfit()); | ||
272 | + createMergedCell(sheet, workbook, 18, 6, 18, 19, 6, 7, ""); | ||
273 | + createMergedCell(sheet, workbook, 18, 8, 18, 19, 8, 10, ""); | ||
274 | +//第十行 | ||
275 | + createMergedCell(sheet, workbook, 20, 0, 20, 21, 0, 3, "内部生产提成"); | ||
276 | + createMergedCell(sheet, workbook, 20, 4, 20, 21, 4, 5, "¥"+ resultVO.getInnerProduceTotalPrice()); | ||
277 | + createMergedCell(sheet, workbook, 20, 6, 20, 21, 6, 7, ""); | ||
278 | + createMergedCell(sheet, workbook, 20, 8, 20, 21, 8, 10, ""); | ||
279 | + //第十一行 | ||
280 | + createMergedCell(sheet, workbook, 22, 0, 22, 23, 0, 3, "内部生产净利润"); | ||
281 | + createMergedCell(sheet, workbook, 22, 4, 22, 23, 4, 5, "¥"+ resultVO.getInnerProduceTotalProfit()); | ||
282 | + createMergedCell(sheet, workbook, 22, 6, 22, 23, 6, 7, ""); | ||
283 | + createMergedCell(sheet, workbook, 22, 8, 22, 23, 8, 10, ""); | ||
284 | + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8"); | ||
285 | + response.setHeader("Content-Disposition", "attachment; filename=\"-.xlsx\""); | ||
286 | + workbook.write(response.getOutputStream()); | ||
287 | + workbook.close(); | ||
288 | + return ServerResult.success(); | ||
289 | + } | ||
290 | + public void createMergedCell(Sheet sheet, Workbook workbook, int rowIndex, int colIndex, int startRow, int endRow, int startCol, int endCol, String value) { | ||
291 | + // 创建或获取当前行 | ||
292 | + Row row = sheet.getRow(rowIndex); | ||
293 | + if (row == null) { | ||
294 | + row = sheet.createRow(rowIndex); | ||
295 | + } | ||
296 | + | ||
297 | + // 创建第一个单元格并设置值 | ||
298 | + Cell cell = row.createCell(colIndex); | ||
299 | + cell.setCellValue(value); | ||
300 | + | ||
301 | + // 创建边框样式 | ||
302 | + CellStyle titleStyle = workbook.createCellStyle(); | ||
303 | + Font titleFont = workbook.createFont(); | ||
304 | + titleFont.setFontHeightInPoints((short) 14); // 字体大小 | ||
305 | + titleFont.setBold(true); // 加粗 | ||
306 | + titleFont.setFontName("等线"); | ||
307 | + titleStyle.setAlignment(HorizontalAlignment.CENTER); // 水平居中 | ||
308 | + titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 垂直居中 | ||
309 | + titleStyle.setFont(titleFont); | ||
310 | + | ||
311 | + // 设置边框样式 | ||
312 | + titleStyle.setBorderTop(BorderStyle.THIN); | ||
313 | + titleStyle.setBorderBottom(BorderStyle.THIN); | ||
314 | + titleStyle.setBorderLeft(BorderStyle.THIN); | ||
315 | + titleStyle.setBorderRight(BorderStyle.THIN); | ||
316 | + | ||
317 | + // 应用样式到第一个单元格 | ||
318 | + cell.setCellStyle(titleStyle); | ||
319 | + | ||
320 | + // 合并单元格 | ||
321 | + sheet.addMergedRegion(new CellRangeAddress(startRow, endRow, startCol, endCol)); | ||
322 | + | ||
323 | + // 为合并区域的每个单元格设置相同的样式 | ||
324 | + for (int rowIndexCurrent = startRow; rowIndexCurrent <= endRow; rowIndexCurrent++) { | ||
325 | + for (int colIndexCurrent = startCol; colIndexCurrent <= endCol; colIndexCurrent++) { | ||
326 | + Row currentRow = sheet.getRow(rowIndexCurrent); | ||
327 | + if (currentRow == null) { | ||
328 | + currentRow = sheet.createRow(rowIndexCurrent); | ||
329 | + } | ||
330 | + Cell currentCell = currentRow.getCell(colIndexCurrent); | ||
331 | + if (currentCell == null) { | ||
332 | + currentCell = currentRow.createCell(colIndexCurrent); | ||
333 | + } | ||
334 | + // 只为合并区域内的单元格设置样式 | ||
335 | + if (rowIndexCurrent == startRow && colIndexCurrent == colIndex) { | ||
336 | + currentCell.setCellStyle(titleStyle); // 为合并的单元格设置样式 | ||
337 | + } else { | ||
338 | + currentCell.setCellStyle(titleStyle); // 为其他合并的单元格设置样式 | ||
339 | + } | ||
340 | + } | ||
341 | + } | ||
342 | + } | ||
343 | + | ||
344 | + | ||
345 | + | ||
346 | + /** | ||
347 | + * 业务/研发净利润分析 | ||
348 | + * | ||
349 | + * @param queryVO | ||
350 | + * @return | ||
351 | + */ | ||
352 | + public ServerResult businessProfitRatio(BusinessProfitRatioQueryVO queryVO) { | ||
353 | + BusinessProfitRatioResultVO resultVO = buildBusinessProfitRatioResultVO(queryVO); | ||
354 | + return ServerResult.success(resultVO); | ||
355 | + } | ||
356 | + //都为人民币。 | ||
357 | + private BusinessProfitRatioResultVO buildBusinessProfitRatioResultVO(BusinessProfitRatioQueryVO queryVO) { | ||
358 | + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(queryVO.getIds()); | ||
359 | + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | ||
360 | + throw new BusinessException("订单数量为空"); | ||
361 | + } | ||
362 | + Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); | ||
363 | + List<OrderProfitAnalysisDO> profitAnalysisList = orderProfitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | ||
364 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
365 | + .in(OrderProfitAnalysisDO::getOrderId, orderIds)); | ||
366 | + List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisList.stream() | ||
367 | + .collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (existing, replacement) -> existing)) | ||
368 | + .values() | ||
369 | + .stream() | ||
370 | + .collect(Collectors.toList()); | ||
371 | + if(CollectionUtils.isEmpty(profitAnalysisList) ||orderIds.size()!= profitAnalysisDOS.size()){ | ||
372 | + throw new BusinessException("勾选订单的利润信息未填写!"); | ||
373 | + } | ||
374 | +// for(OrderProfitAnalysisDO analysisDO : profitAnalysisList){ | ||
375 | +// if(analysisDO.getCustomerPrice()==null){ | ||
376 | +// throw new BusinessException("勾选订单的利润信息未填写!"); | ||
377 | +// } | ||
378 | +// } | ||
379 | + int sumCount = orderBaseInfoDOList.stream().mapToInt(OrderBaseInfoDO::getOrderCount).sum(); | ||
380 | + Set<String> projectList = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getProjectNo).collect(Collectors.toSet()); | ||
381 | + //得到当前汇率。 | ||
382 | + BigDecimal exchangeRate = new BigDecimal(systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>() | ||
383 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
384 | + .eq(SystemSettingDO::getSettingCode,"exchangeRate") | ||
385 | + .last("limit 1")).getSettingValue()); | ||
386 | + BigDecimal spainRatioProfitPrice=new BigDecimal(Constant.ZERO); | ||
387 | + BigDecimal chinaRatioProfitPrice=new BigDecimal(Constant.ZERO); | ||
388 | + BigDecimal customerRmbTotalPrice = new BigDecimal(Constant.ZERO); | ||
389 | + BigDecimal productionDepartmentTotalPrice = new BigDecimal(Constant.ZERO); | ||
390 | + BigDecimal packetTotalPrice = new BigDecimal(Constant.ZERO); | ||
391 | + BigDecimal fixCost = new BigDecimal(Constant.ZERO); | ||
392 | + BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO); | ||
393 | + String spainRatio = Constant.ZERO_STRING; | ||
394 | + String chainRatio= Constant.ZERO_STRING; | ||
395 | + String dailyCost=Constant.ZERO_STRING; | ||
396 | + for (OrderProfitAnalysisDO profitAnalysisDO : profitAnalysisDOS) { | ||
397 | + customerRmbTotalPrice = customerRmbTotalPrice.add(new BigDecimal(profitAnalysisDO.getCustomerRmbTotalPrice())); | ||
398 | + customerTotalPrice=customerTotalPrice.add(new BigDecimal(profitAnalysisDO.getCustomerTotalPrice())); | ||
399 | + productionDepartmentTotalPrice = productionDepartmentTotalPrice.add(new BigDecimal(profitAnalysisDO.getProductionDepartmentTotalPrice())); | ||
400 | + //这里的包装费用好像为美元。需要采用人民币。 | ||
401 | + packetTotalPrice = packetTotalPrice.add(new BigDecimal(profitAnalysisDO.getPacketTotalPrice()).multiply(exchangeRate)); | ||
402 | + } | ||
403 | + | ||
404 | + //根据客户编码得到提成配置。 | ||
405 | + SystemSettingDO systemSettingServiceOne = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>() | ||
406 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
407 | + .eq(SystemSettingDO::getSettingType, Constant.THREE) | ||
408 | + .eq(SystemSettingDO::getSettingValue, queryVO.getCustomerCode()) | ||
409 | + .last("limit 1")); | ||
410 | + if(Objects.nonNull(systemSettingServiceOne)){ | ||
411 | + //json反序列化。 | ||
412 | + List<CostSettingItemVO> costSettingItemVOList = JSONObject.parseObject(systemSettingServiceOne.getRelationValue(), new TypeReference<List<CostSettingItemVO>>() {}); | ||
413 | + if( CollectionUtils.isNotEmpty(costSettingItemVOList)){ | ||
414 | + for (CostSettingItemVO relation : costSettingItemVOList) { | ||
415 | + if ("ratio".equals(relation.getRelationCode())) { | ||
416 | + chainRatio = relation.getRelationValue(); | ||
417 | + }if ("spainRatio".equals(relation.getRelationCode())) { | ||
418 | + spainRatio = relation.getRelationValue(); | ||
419 | + }if("fixCost".equals(relation.getRelationCode())){ | ||
420 | + dailyCost=relation.getRelationValue(); | ||
421 | + } | ||
422 | + } | ||
423 | + } | ||
424 | + } | ||
425 | + BigDecimal spainRatioValue = new BigDecimal(spainRatio); | ||
426 | + BigDecimal chainRatioValue = new BigDecimal(chainRatio); | ||
427 | + //当前系统配置中的提成比例没有配置时,中国和西班牙的金额就会为对应的o。 | ||
428 | + spainRatioProfitPrice = spainRatioValue.multiply(customerRmbTotalPrice); | ||
429 | + chinaRatioProfitPrice = chainRatioValue.multiply(customerRmbTotalPrice); | ||
430 | + BigDecimal dailyCostValue = new BigDecimal(dailyCost); | ||
431 | + fixCost = dailyCostValue.multiply(new BigDecimal(getProjectDays(queryVO))); | ||
432 | + BigDecimal outTotalPrice = customerRmbTotalPrice.add(productionDepartmentTotalPrice).add(packetTotalPrice) | ||
433 | + .add(queryVO.getDevelopTotalPrice()).add(queryVO.getCopyTotalPrice()) | ||
434 | + .add(fixCost).add(spainRatioProfitPrice).add(chinaRatioProfitPrice); | ||
435 | + BigDecimal developProfit = customerRmbTotalPrice.subtract(outTotalPrice); | ||
436 | + BigDecimal packetProfitPrice = packetTotalPrice.subtract(queryVO.getPacketActualTotalPrice()); | ||
437 | + BigDecimal actualRatioProfitPrice = queryVO.getActualRatio().subtract(exchangeRate).multiply(customerTotalPrice).setScale(2, BigDecimal.ROUND_HALF_UP); | ||
438 | + BigDecimal totalProfitPrice = developProfit.add(actualRatioProfitPrice).add(packetProfitPrice); | ||
439 | + BusinessProfitRatioResultVO resultVO = new BusinessProfitRatioResultVO(); | ||
440 | + BeanUtils.copyProperties(queryVO, resultVO); | ||
441 | + //5 | ||
442 | + resultVO.setCustomerTotalPrice(customerRmbTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
443 | + //6 | ||
444 | + resultVO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
445 | +// resultVO.setPacketTotalPrice(packetTotalPrice.multiply(new BigDecimal(10 )).doubleValue()); | ||
446 | + //7 | ||
447 | + resultVO.setPacketTotalPrice(packetTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
448 | + resultVO.setPacketTotalPriceCount(packetTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
449 | + //9 如果没有配置固定成本,就会得到0。 | ||
450 | + resultVO.setFixCost(fixCost.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
451 | + //10.1 | ||
452 | + resultVO.setSpainRatioProfitPrice(spainRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
453 | + //10.2 | ||
454 | + resultVO.setChinaRatioProfitPrice(chinaRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
455 | + //11 | ||
456 | + resultVO.setOutTotalPrice(outTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
457 | + //13 | ||
458 | + resultVO.setDevelopProfit(developProfit.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
459 | + //18 | ||
460 | + resultVO.setPacketProfitPrice(packetProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
461 | + //19 | ||
462 | + resultVO.setActualRatioProfitPrice(actualRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
463 | + //20 | ||
464 | + resultVO.setTotalProfitPrice(totalProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
465 | + // 16 | ||
466 | + resultVO.setActualRmbPrice(queryVO.getPacketActualTotalPrice().divide(new BigDecimal(sumCount), 2, BigDecimal.ROUND_HALF_UP)); | ||
467 | + resultVO.setActualPrice((resultVO.getActualRmbPrice().divide(exchangeRate,2, BigDecimal.ROUND_HALF_UP))); | ||
468 | + resultVO.setOrderCount(sumCount); | ||
469 | + //12 | ||
470 | + resultVO.setGrossProfit(customerRmbTotalPrice.subtract(productionDepartmentTotalPrice).subtract(packetTotalPrice).setScale(2, BigDecimal.ROUND_HALF_UP)); | ||
471 | + resultVO.setProjectNo(String.join(",",projectList)); | ||
472 | + return resultVO; | ||
473 | + } | ||
474 | + | ||
475 | + /** | ||
476 | + * @param queryVO | ||
477 | + * @return | ||
478 | + */ | ||
479 | + private int getProjectDays(BusinessProfitRatioQueryVO queryVO) { | ||
480 | + String projectStartTime = queryVO.getProjectStartTime(); | ||
481 | + | ||
482 | + String projectEndTime = queryVO.getProjectEndTime(); | ||
483 | + | ||
484 | + return DateUtils.parseDate(projectEndTime, DateUtils.DATE).getDayOfYear() - DateUtils.parseDate(projectStartTime, DateUtils.DATE).getDayOfYear() + 1; | ||
485 | + } | ||
486 | + | ||
487 | + /** | ||
488 | + * @param queryVO | ||
489 | + * @return | ||
490 | + */ | ||
491 | + private int getProjectDays(InnerProfitRatioQueryVO queryVO) { | ||
492 | + String projectStartTime = queryVO.getProjectStartTime(); | ||
493 | + | ||
494 | + String projectEndTime = queryVO.getProjectEndTime(); | ||
495 | + | ||
496 | + return DateUtils.parseDate(projectEndTime, DateUtils.DATE).getDayOfYear() - DateUtils.parseDate(projectStartTime, DateUtils.DATE).getDayOfYear() + 1; | ||
497 | + } | ||
498 | + | ||
499 | + /** | ||
500 | + * | ||
501 | + * @param queryVO | ||
502 | + * @return | ||
503 | + */ | ||
504 | + private InnerProfitRatioResultVO buildInnerProfitRatioResultVO(InnerProfitRatioQueryVO queryVO) { | ||
505 | + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(queryVO.getIds()); | ||
506 | + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | ||
507 | + throw new BusinessException("订单数量为空"); | ||
508 | + } | ||
509 | + Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); | ||
510 | + List<OrderProfitAnalysisDO> profitAnalysisList = orderProfitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | ||
511 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
512 | + .in(OrderProfitAnalysisDO::getOrderId, orderIds)); | ||
513 | + //避免,订单重复,有多个orderid重复。 | ||
514 | + List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisList.stream() | ||
515 | + .collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (existing, replacement) -> existing)) | ||
516 | + .values() | ||
517 | + .stream() | ||
518 | + .collect(Collectors.toList()); | ||
519 | + if(CollectionUtils.isEmpty(profitAnalysisList) || orderIds.size()!=profitAnalysisDOS.size()){ | ||
520 | + throw new BusinessException("勾选订单的利润信息未填写!"); | ||
521 | + } | ||
522 | + int sumCount = orderBaseInfoDOList.stream().mapToInt(OrderBaseInfoDO::getOrderCount).sum(); | ||
523 | + Set<String> projectNoSet = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getProjectNo).collect(Collectors.toSet()); | ||
524 | + BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO); | ||
525 | + BigDecimal productionDepartmentTotalPrice = new BigDecimal(Constant.ZERO); | ||
526 | + String dailyCost=Constant.ZERO_STRING; | ||
527 | + String price=Constant.ZERO_STRING; | ||
528 | + BigDecimal dailyCostValue = new BigDecimal(Constant.ZERO); | ||
529 | + BigDecimal priceValue = new BigDecimal(Constant.ZERO); | ||
530 | + for (OrderProfitAnalysisDO profitAnalysisDO : profitAnalysisDOS) { | ||
531 | + customerTotalPrice = customerTotalPrice.add(new BigDecimal(profitAnalysisDO.getCustomerRmbTotalPrice())); | ||
532 | + productionDepartmentTotalPrice = productionDepartmentTotalPrice.add(new BigDecimal(profitAnalysisDO.getProductionDepartmentTotalPrice())); | ||
533 | + } | ||
534 | + | ||
535 | + SystemSettingDO systemSettingServiceOne = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>() | ||
536 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
537 | + .eq(SystemSettingDO::getSettingType, Constant.FOUR) | ||
538 | + .eq(SystemSettingDO::getSettingValue, queryVO.getCustomerCode()) | ||
539 | + .last("limit 1")); | ||
540 | + if(Objects.nonNull(systemSettingServiceOne)){ | ||
541 | + //json反序列化。 | ||
542 | + List<CostSettingItemVO> costSettingItemVOList = JSONObject.parseObject(systemSettingServiceOne.getRelationValue(), new TypeReference<List<CostSettingItemVO>>() {}); | ||
543 | + if( CollectionUtils.isNotEmpty(costSettingItemVOList)){ | ||
544 | + for (CostSettingItemVO relation : costSettingItemVOList) { | ||
545 | + //这里是系统配置中的得到的,应该是从系统配置中的生产科中得到。 固定成本。 | ||
546 | + if("fixCost".equals(relation.getRelationCode())){ | ||
547 | + dailyCost=relation.getRelationValue(); | ||
548 | + } | ||
549 | + //生产提成单价 | ||
550 | + if("ratio".equals(relation.getRelationCode())){ | ||
551 | + price=relation.getRelationValue(); | ||
552 | + } | ||
553 | + } | ||
554 | + } | ||
555 | + } | ||
556 | + dailyCostValue = new BigDecimal(dailyCost); | ||
557 | + priceValue = new BigDecimal(price); | ||
558 | + Integer projectDays = getProjectDays(queryVO); | ||
559 | + BigDecimal innerProduceFixProfit = dailyCostValue.multiply(new BigDecimal(projectDays)); | ||
560 | + BigDecimal predictRatio=new BigDecimal(Constant.ZERO); | ||
561 | + BigDecimal bigDecimal = new BigDecimal("1.05"); | ||
562 | + // 10 | ||
563 | + BigDecimal innerProduceTotalPrice = new BigDecimal(sumCount).multiply(priceValue); | ||
564 | + // 7.1 | ||
565 | + if(Objects.nonNull(queryVO.getProductionDepartmentPredictPrice()) ){ | ||
566 | + if(queryVO.getProductionDepartmentPredictPrice().compareTo(BigDecimal.ZERO) == 0){ | ||
567 | + }else{ | ||
568 | + predictRatio = queryVO.getProductionActualPrice() | ||
569 | + .divide(queryVO.getProductionDepartmentPredictPrice(),2,BigDecimal.ROUND_HALF_UP); | ||
570 | + } | ||
571 | + } | ||
572 | + //如果大于1.05则就把内部生产提成变为0 | ||
573 | + if(predictRatio.compareTo(bigDecimal)>0){ | ||
574 | + innerProduceTotalPrice=BigDecimal.ZERO; | ||
575 | + } | ||
576 | + // 7.2 | ||
577 | + BigDecimal predictAndActualRatio = new BigDecimal(Constant.ONE).subtract(predictRatio); | ||
578 | + BigDecimal grossProfit = productionDepartmentTotalPrice.subtract(queryVO.getProductionActualPrice()); | ||
579 | + BigDecimal innerProduceTotalProfit = productionDepartmentTotalPrice.subtract(queryVO.getProductionActualPrice()).subtract(innerProduceTotalPrice).subtract(innerProduceFixProfit); | ||
580 | + | ||
581 | + | ||
582 | + InnerProfitRatioResultVO resultVO = new InnerProfitRatioResultVO(); | ||
583 | + BeanUtils.copyProperties(queryVO, resultVO); | ||
584 | + resultVO.setProjectDays(projectDays); | ||
585 | + resultVO.setOrderCount(sumCount); | ||
586 | + resultVO.setCustomerTotalPrice(customerTotalPrice.setScale(2, RoundingMode.HALF_UP).doubleValue()); | ||
587 | + // 5 | ||
588 | + resultVO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.setScale(2, RoundingMode.HALF_UP)); | ||
589 | + // 9 | ||
590 | + resultVO.setInnerProduceFixProfit(innerProduceFixProfit.setScale(2, RoundingMode.HALF_UP)); | ||
591 | + // 7.1 | ||
592 | + resultVO.setPredictRatio(predictRatio.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)); | ||
593 | + // 将计算结果乘以 100,并四舍五入到整数 | ||
594 | + resultVO.setPredictAndActualRatio(predictAndActualRatio.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)); | ||
595 | + // 8 | ||
596 | + resultVO.setGrossProfit(grossProfit.setScale(2, RoundingMode.HALF_UP)); | ||
597 | + // 10 | ||
598 | + resultVO.setInnerProduceTotalPrice(innerProduceTotalPrice.setScale(2, RoundingMode.HALF_UP)); | ||
599 | + // 11 | ||
600 | + resultVO.setInnerProduceTotalProfit(innerProduceTotalProfit.setScale(2, RoundingMode.HALF_UP)); | ||
601 | + //项目号 | ||
602 | + resultVO.setProjectNo(String.join(", ", projectNoSet)); | ||
603 | + return resultVO; | ||
604 | + } | ||
605 | + | ||
606 | + /** | ||
607 | + * 内部生产净利润分析表 | ||
608 | + * | ||
609 | + * @param queryVO | ||
610 | + * @return | ||
611 | + */ | ||
612 | + public ServerResult innerProfitRatio(InnerProfitRatioQueryVO queryVO) { | ||
613 | + InnerProfitRatioResultVO resultVO = buildInnerProfitRatioResultVO(queryVO); | ||
614 | + return ServerResult.success(resultVO); | ||
615 | + } | ||
616 | +} |
src/main/java/com/order/erp/service/order/impl/CheckBillMappingServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import cn.hutool.core.bean.BeanUtil; | ||
4 | +import cn.hutool.core.collection.CollUtil; | ||
5 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
6 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
7 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
8 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
9 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
10 | +import com.order.erp.common.constant.Constant; | ||
11 | +import com.order.erp.common.constant.ServerResult; | ||
12 | +import com.order.erp.common.utils.PageUtils; | ||
13 | +import com.order.erp.domain.dto.order.CheckBillMappingDO; | ||
14 | +import com.order.erp.domain.vo.order.CheckBillMappingQueryVO; | ||
15 | +import com.order.erp.domain.vo.order.CheckBillMappingVO; | ||
16 | +import com.order.erp.mapper.order.CheckBillMappingMapper; | ||
17 | +import com.order.erp.service.order.CheckBillMappingService; | ||
18 | +import lombok.extern.slf4j.Slf4j; | ||
19 | +import org.springframework.stereotype.Service; | ||
20 | + | ||
21 | +import java.util.List; | ||
22 | +import java.util.Objects; | ||
23 | + | ||
24 | +/** | ||
25 | + * 生产科对账单应收账单映射表(CheckBillMapping)表服务实现类 | ||
26 | + * | ||
27 | + * @author makejava | ||
28 | + * @since 2024-08-05 16:26:37 | ||
29 | + */ | ||
30 | +@Slf4j | ||
31 | +@Service | ||
32 | +public class CheckBillMappingServiceImpl extends ServiceImpl<CheckBillMappingMapper, CheckBillMappingDO> implements CheckBillMappingService { | ||
33 | + | ||
34 | + | ||
35 | + /** | ||
36 | + * 通过ID查询单条数据 | ||
37 | + * <p> | ||
38 | + * checkBillMappingQueryVO 主键 | ||
39 | + * | ||
40 | + * @return 实例对象 | ||
41 | + */ | ||
42 | + @Override | ||
43 | + public ServerResult queryById(CheckBillMappingQueryVO checkBillMappingQueryVO) { | ||
44 | + if (Objects.isNull(checkBillMappingQueryVO.getId())) { | ||
45 | + return ServerResult.fail("id 不能为空"); | ||
46 | + } | ||
47 | + CheckBillMappingDO CheckBillMappingDo = getById(checkBillMappingQueryVO.getId()); | ||
48 | + if (Objects.isNull(CheckBillMappingDo)) { | ||
49 | + return ServerResult.success(null); | ||
50 | + } | ||
51 | + return ServerResult.success(BeanUtil.copyProperties(CheckBillMappingDo, CheckBillMappingVO.class)); | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * 分页查询 | ||
56 | + * | ||
57 | + * @param checkBillMappingQueryVO 筛选条件 | ||
58 | + * @return 查询结果 | ||
59 | + */ | ||
60 | + @Override | ||
61 | + public ServerResult list(CheckBillMappingQueryVO checkBillMappingQueryVO) { | ||
62 | + | ||
63 | + LambdaQueryWrapper<CheckBillMappingDO> queryWapper = new LambdaQueryWrapper<CheckBillMappingDO>() | ||
64 | + .eq(CheckBillMappingDO::getEnableFlag, Constant.ENABLE_TEN) | ||
65 | + .orderByDesc(CheckBillMappingDO::getId); | ||
66 | + Page page = new Page<>(checkBillMappingQueryVO.getPage(), checkBillMappingQueryVO.getPageSize()); | ||
67 | + IPage<CheckBillMappingDO> iPage = page(page, queryWapper); | ||
68 | + checkBillMappingQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue()); | ||
69 | + return ServerResult.success(PageUtils.getPageReturn(null, checkBillMappingQueryVO)); | ||
70 | + } | ||
71 | + | ||
72 | + /** | ||
73 | + * 新增数据 | ||
74 | + * | ||
75 | + * @param checkBillMappingVO 实例对象 | ||
76 | + * @return 实例对象 | ||
77 | + */ | ||
78 | + @Override | ||
79 | + public ServerResult add(CheckBillMappingVO checkBillMappingVO) { | ||
80 | + //todo 校验 | ||
81 | + if (Objects.nonNull(checkBillMappingVO.getId())) { | ||
82 | + checkBillMappingVO.setId(null); | ||
83 | + } | ||
84 | + CheckBillMappingDO checkBillMappingDo = BeanUtil.copyProperties(checkBillMappingVO, CheckBillMappingDO.class); | ||
85 | + | ||
86 | + save(checkBillMappingDo); | ||
87 | + | ||
88 | + return ServerResult.success(); | ||
89 | + } | ||
90 | + | ||
91 | + /** | ||
92 | + * 修改数据 | ||
93 | + * | ||
94 | + * @param checkBillMappingVO 实例对象 | ||
95 | + * @return 实例对象 | ||
96 | + */ | ||
97 | + @Override | ||
98 | + public ServerResult edit(CheckBillMappingVO checkBillMappingVO) { | ||
99 | + //todo 校验 | ||
100 | + if (Objects.isNull(checkBillMappingVO.getId())) { | ||
101 | + return ServerResult.fail("id 不能为空"); | ||
102 | + } | ||
103 | + CheckBillMappingDO checkBillMappingDo = BeanUtil.copyProperties(checkBillMappingVO, CheckBillMappingDO.class); | ||
104 | + | ||
105 | + updateById(checkBillMappingDo); | ||
106 | + | ||
107 | + return ServerResult.success(); | ||
108 | + } | ||
109 | + | ||
110 | + /** | ||
111 | + * 通过主键删除数据 | ||
112 | + * | ||
113 | + * @param checkBillMappingQueryVO 筛选条件 | ||
114 | + * @return 是否成功 | ||
115 | + */ | ||
116 | + @Override | ||
117 | + public ServerResult deleteById(CheckBillMappingQueryVO checkBillMappingQueryVO) { | ||
118 | + List<Long> ids = checkBillMappingQueryVO.getIds(); | ||
119 | + if (CollUtil.isEmpty(ids)) { | ||
120 | + return ServerResult.fail("ids 参数不能为空"); | ||
121 | + } | ||
122 | + List<CheckBillMappingDO> checkBillMappingList = listByIds(ids); | ||
123 | + if (CollUtil.isEmpty(checkBillMappingList)) { | ||
124 | + return ServerResult.success(); | ||
125 | + } | ||
126 | + //todo 校验是否可以逻辑删除 | ||
127 | + LambdaUpdateWrapper<CheckBillMappingDO> updateWrapper = new LambdaUpdateWrapper<CheckBillMappingDO>() | ||
128 | + .in(CheckBillMappingDO::getId, ids) | ||
129 | + .set(CheckBillMappingDO::getEnableFlag, Constant.UNABLE_TWENTY); | ||
130 | + update(updateWrapper); | ||
131 | + return ServerResult.success(); | ||
132 | + } | ||
133 | +} |
src/main/java/com/order/erp/service/order/impl/InvoiceBillMappingServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import cn.hutool.core.bean.BeanUtil; | ||
4 | +import cn.hutool.core.collection.CollUtil; | ||
5 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
6 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
7 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
8 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
9 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
10 | +import com.order.erp.common.constant.Constant; | ||
11 | +import com.order.erp.common.constant.ServerResult; | ||
12 | +import com.order.erp.common.utils.PageUtils; | ||
13 | +import com.order.erp.domain.dto.order.InvoiceBillMappingDO; | ||
14 | +import com.order.erp.domain.vo.order.InvoiceBillMappingQueryVO; | ||
15 | +import com.order.erp.domain.vo.order.InvoiceBillMappingVO; | ||
16 | +import com.order.erp.mapper.order.InvoiceBillMappingMapper; | ||
17 | +import com.order.erp.service.order.InvoiceBillMappingService; | ||
18 | +import lombok.extern.slf4j.Slf4j; | ||
19 | +import org.springframework.stereotype.Service; | ||
20 | + | ||
21 | +import java.util.List; | ||
22 | +import java.util.Objects; | ||
23 | + | ||
24 | +/** | ||
25 | + * 应收款账单关联订单映射表(InvoiceBillMapping)表服务实现类 | ||
26 | + * | ||
27 | + * @author makejava | ||
28 | + * @since 2024-08-05 16:26:36 | ||
29 | + */ | ||
30 | +@Slf4j | ||
31 | +@Service | ||
32 | +public class InvoiceBillMappingServiceImpl extends ServiceImpl<InvoiceBillMappingMapper, InvoiceBillMappingDO> implements InvoiceBillMappingService { | ||
33 | + | ||
34 | + | ||
35 | + /** | ||
36 | + * 通过ID查询单条数据 | ||
37 | + * <p> | ||
38 | + * invoiceBillMappingQueryVO 主键 | ||
39 | + * | ||
40 | + * @return 实例对象 | ||
41 | + */ | ||
42 | + @Override | ||
43 | + public ServerResult queryById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) { | ||
44 | + if (Objects.isNull(invoiceBillMappingQueryVO.getId())) { | ||
45 | + return ServerResult.fail("id 不能为空"); | ||
46 | + } | ||
47 | + InvoiceBillMappingDO InvoiceBillMappingDo = getById(invoiceBillMappingQueryVO.getId()); | ||
48 | + if (Objects.isNull(InvoiceBillMappingDo)) { | ||
49 | + return ServerResult.success(null); | ||
50 | + } | ||
51 | + return ServerResult.success(BeanUtil.copyProperties(InvoiceBillMappingDo, InvoiceBillMappingVO.class)); | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * 分页查询 | ||
56 | + * | ||
57 | + * @param invoiceBillMappingQueryVO 筛选条件 | ||
58 | + * @return 查询结果 | ||
59 | + */ | ||
60 | + @Override | ||
61 | + public ServerResult list(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) { | ||
62 | + | ||
63 | + LambdaQueryWrapper<InvoiceBillMappingDO> queryWapper = new LambdaQueryWrapper<InvoiceBillMappingDO>() | ||
64 | + .eq(InvoiceBillMappingDO::getEnableFlag, Constant.ENABLE_TEN) | ||
65 | + .orderByDesc(InvoiceBillMappingDO::getId); | ||
66 | + Page page = new Page<>(invoiceBillMappingQueryVO.getPage(), invoiceBillMappingQueryVO.getPageSize()); | ||
67 | + IPage<InvoiceBillMappingDO> iPage = page(page, queryWapper); | ||
68 | + invoiceBillMappingQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue()); | ||
69 | + return ServerResult.success(PageUtils.getPageReturn(null, invoiceBillMappingQueryVO)); | ||
70 | + } | ||
71 | + | ||
72 | + /** | ||
73 | + * 新增数据 | ||
74 | + * | ||
75 | + * @param invoiceBillMappingVO 实例对象 | ||
76 | + * @return 实例对象 | ||
77 | + */ | ||
78 | + @Override | ||
79 | + public ServerResult add(InvoiceBillMappingVO invoiceBillMappingVO) { | ||
80 | + //todo 校验 | ||
81 | + if (Objects.nonNull(invoiceBillMappingVO.getId())) { | ||
82 | + invoiceBillMappingVO.setId(null); | ||
83 | + } | ||
84 | + InvoiceBillMappingDO invoiceBillMappingDo = BeanUtil.copyProperties(invoiceBillMappingVO, InvoiceBillMappingDO.class); | ||
85 | + | ||
86 | + save(invoiceBillMappingDo); | ||
87 | + | ||
88 | + return ServerResult.success(); | ||
89 | + } | ||
90 | + | ||
91 | + /** | ||
92 | + * 修改数据 | ||
93 | + * | ||
94 | + * @param invoiceBillMappingVO 实例对象 | ||
95 | + * @return 实例对象 | ||
96 | + */ | ||
97 | + @Override | ||
98 | + public ServerResult edit(InvoiceBillMappingVO invoiceBillMappingVO) { | ||
99 | + //todo 校验 | ||
100 | + if (Objects.isNull(invoiceBillMappingVO.getId())) { | ||
101 | + return ServerResult.fail("id 不能为空"); | ||
102 | + } | ||
103 | + InvoiceBillMappingDO invoiceBillMappingDo = BeanUtil.copyProperties(invoiceBillMappingVO, InvoiceBillMappingDO.class); | ||
104 | + | ||
105 | + updateById(invoiceBillMappingDo); | ||
106 | + | ||
107 | + return ServerResult.success(); | ||
108 | + } | ||
109 | + | ||
110 | + /** | ||
111 | + * 通过主键删除数据 | ||
112 | + * | ||
113 | + * @param invoiceBillMappingQueryVO 筛选条件 | ||
114 | + * @return 是否成功 | ||
115 | + */ | ||
116 | + @Override | ||
117 | + public ServerResult deleteById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) { | ||
118 | + List<Long> ids = invoiceBillMappingQueryVO.getIds(); | ||
119 | + if (CollUtil.isEmpty(ids)) { | ||
120 | + return ServerResult.fail("ids 参数不能为空"); | ||
121 | + } | ||
122 | + List<InvoiceBillMappingDO> invoiceBillMappingList = listByIds(ids); | ||
123 | + if (CollUtil.isEmpty(invoiceBillMappingList)) { | ||
124 | + return ServerResult.success(); | ||
125 | + } | ||
126 | + //todo 校验是否可以逻辑删除 | ||
127 | + LambdaUpdateWrapper<InvoiceBillMappingDO> updateWrapper = new LambdaUpdateWrapper<InvoiceBillMappingDO>() | ||
128 | + .in(InvoiceBillMappingDO::getId, ids) | ||
129 | + .set(InvoiceBillMappingDO::getEnableFlag, Constant.UNABLE_TWENTY); | ||
130 | + update(updateWrapper); | ||
131 | + return ServerResult.success(); | ||
132 | + } | ||
133 | +} |