Bläddra i källkod

1 添加货值暂估导入功能

11816 3 månader sedan
förälder
incheckning
c75bbf3a05

+ 31
- 0
src/main/java/com/example/backend/pAndSExe/dto/InfHuozhizanguExcelDTO.java Visa fil

@@ -0,0 +1,31 @@
1
+package com.example.backend.pAndSExe.dto;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import lombok.Data;
5
+
6
+/**
7
+ * InfHuozhizangu Excel导入DTO (Sheet13-货值暂估)
8
+ */
9
+@Data
10
+public class InfHuozhizanguExcelDTO {
11
+    @ExcelProperty(index = 0) // A列 - 采购合同号
12
+    private String pono;
13
+    @ExcelProperty(index = 1) // B列 - 物料描述
14
+    private String sdesc;
15
+    @ExcelProperty(index = 2) // C列 - 数量
16
+    private Double qty;
17
+    @ExcelProperty(index = 3) // D列 - 单位
18
+    private String ut;
19
+    @ExcelProperty(index = 4) // E列 - 不含税金额
20
+    private Double ntPoAmt;
21
+    @ExcelProperty(index = 5) // F列 - 不含税单价
22
+    private Double ntPoPrice;
23
+    @ExcelProperty(index = 6) // G列 - 含税单价
24
+    private Double poPrice;
25
+    @ExcelProperty(index = 7) // H列 - 含税金额
26
+    private Double poAmt;
27
+    @ExcelProperty(index = 8) // I列 - 币别
28
+    private String curcy;
29
+    @ExcelProperty(index = 9) // J列 - 税率
30
+    private Double inTaxRate;
31
+}

+ 12
- 10
src/main/java/com/example/backend/pAndSExe/dto/InfJinxiangfapiaoExcelDTO.java Visa fil

@@ -21,24 +21,26 @@ public class InfJinxiangfapiaoExcelDTO {
21 21
     private String taxInvType;
22 22
     @ExcelProperty(index = 5) // C列 - 发票号码
23 23
     private String taxInvNo;
24
-    @ExcelProperty(index = 6) // D列 - 物料编码,物料描述,品牌
24
+    @ExcelProperty(index = 6) // D列 - 发票号
25
+    private String invNo;
26
+    @ExcelProperty(index = 7) // D列 - 物料编码,物料描述,品牌
25 27
     private String itemnoSdescBrand;
26
-    @ExcelProperty(index = 7) // E列 - 数量
28
+    @ExcelProperty(index = 8) // E列 - 数量
27 29
     private Double qty;
28
-    @ExcelProperty(index = 8)
30
+    @ExcelProperty(index = 9)
29 31
     private Double poPrice;
30
-    @ExcelProperty(index = 9) // F列 - 不含税单价
32
+    @ExcelProperty(index = 10) // F列 - 不含税单价
31 33
     private Double ntPoPrice;
32
-    @ExcelProperty(index = 10) // G列 - 单位
34
+    @ExcelProperty(index = 11) // G列 - 单位
33 35
     private String ut;
34
-    @ExcelProperty(index = 11)
36
+    @ExcelProperty(index = 12)
35 37
     private Double poamt;
36
-    @ExcelProperty(index = 12) // H列 - 不含税金额
38
+    @ExcelProperty(index = 13) // H列 - 不含税金额
37 39
     private Double ntPoAmt;
38
-    @ExcelProperty(index = 13) // I列 - 税率
40
+    @ExcelProperty(index = 14) // I列 - 税率
39 41
     private Double inTaxRate;
40
-    @ExcelProperty(index = 14) // J列 - 税额
42
+    @ExcelProperty(index = 15) // J列 - 税额
41 43
     private Double taxAmt;
42
-    @ExcelProperty(index = 15) // K列 - 币别
44
+    @ExcelProperty(index = 16) // K列 - 币别
43 45
     private String curcypo;
44 46
 }

+ 23
- 0
src/main/java/com/example/backend/pAndSExe/mapper/InfHuozhizanguMapper.java Visa fil

@@ -0,0 +1,23 @@
1
+package com.example.backend.pAndSExe.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.pAndSExe.model.InfHuozhizangu;
5
+import com.example.backend.pAndSExe.model.InfJinxiangfapiao;
6
+import com.fasterxml.jackson.databind.ser.Serializers;
7
+import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Select;
9
+import org.apache.ibatis.annotations.Update;
10
+
11
+import java.util.List;
12
+
13
+@Mapper
14
+public interface InfHuozhizanguMapper extends BaseMapper<InfHuozhizangu> {
15
+
16
+    @Select("SELECT * FROM SGGMINFT.INF_HUOZHIZANGU WHERE dataStatus = '0'")
17
+    List<InfHuozhizangu> selectValidData();
18
+
19
+
20
+    @Update("UPDATE SGGMINFT.INF_JINXIANGFAPIAO SET dataStatus = '1' WHERE ID = #{id}")
21
+
22
+    void updateStatusById(String id);
23
+}

+ 1
- 1
src/main/java/com/example/backend/pAndSExe/mapper/MdkcctrlMapper.java Visa fil

@@ -43,7 +43,7 @@ public interface MdkcctrlMapper extends BaseMapper<Mdkcctrl> {
43 43
     List<Mdkcctrl> selectByPono(String fno);
44 44
 
45 45
     @Select("select stockno\n" +
46
-            "from warehouse\n" +
46
+            "from SGGMIIP.warehouse\n" +
47 47
             "where ifnull(del_flag, 0) <> 1\n" +
48 48
             "\tand ifnull(endsign, 0) = 1\n" +
49 49
             "and stockname=#{stockname}\n" +

+ 5
- 5
src/main/java/com/example/backend/pAndSExe/mapper/PaymgrctrlMapper.java Visa fil

@@ -18,12 +18,12 @@ public interface PaymgrctrlMapper extends BaseMapper<Paymgrctrl> {
18 18
 
19 19
 
20 20
     @Select("select    a.id,a.fname,a.fname1,\n" +
21
-            "(select rate from curcydtl where a.id=rid and targetcode='CNY' and nvl(del_flag,0)<>1) as rate ,\n" +
22
-            "(select rate from curcydtl where a.id=rid and targetcode='USD' and nvl(del_flag,0)<>1) rateUsd ,\n" +
23
-            "(SELECT b.rate from  curcyctrl a\n" +
24
-            "left join curcydtl b on a.id=rid\n" +
21
+            "(select rate from SGGMIIP.curcydtl where a.id=rid and targetcode='CNY' and nvl(del_flag,0)<>1) as rate ,\n" +
22
+            "(select rate from SGGMIIP.curcydtl where a.id=rid and targetcode='USD' and nvl(del_flag,0)<>1) rateUsd ,\n" +
23
+            "(SELECT b.rate from  SGGMIIP.curcyctrl a\n" +
24
+            "left join SGGMIIP.curcydtl b on a.id=rid\n" +
25 25
             "where targetcode='CNY' and a.fname='USD' and nvl(b.del_flag,0)<>1 and nvl(a.del_flag,0)<>1) as rateUs\n" +
26
-            "from curcyctrl A\n" +
26
+            "from SGGMIIP.curcyctrl A\n" +
27 27
             "where ifnull(a.del_flag, 0) <> 1\n" +
28 28
             "and fname=#{curry}\n" +
29 29
             "and ifnull(a.placed, '') = '2'\n" +

+ 7
- 0
src/main/java/com/example/backend/pAndSExe/mapper/ProvInDtlMapper.java Visa fil

@@ -0,0 +1,7 @@
1
+package com.example.backend.pAndSExe.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.pAndSExe.model.ProvInDtl;
5
+
6
+public interface ProvInDtlMapper extends BaseMapper<ProvInDtl> {
7
+}

+ 7
- 0
src/main/java/com/example/backend/pAndSExe/mapper/ProvInMapper.java Visa fil

@@ -0,0 +1,7 @@
1
+package com.example.backend.pAndSExe.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.pAndSExe.model.ProvIn;
5
+
6
+public interface ProvInMapper extends BaseMapper<ProvIn> {
7
+}

+ 88
- 0
src/main/java/com/example/backend/pAndSExe/model/InfHuozhizangu.java Visa fil

@@ -0,0 +1,88 @@
1
+package com.example.backend.pAndSExe.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import io.swagger.annotations.ApiModel;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.Getter;
10
+import lombok.Setter;
11
+import lombok.experimental.Accessors;
12
+
13
+import java.io.Serializable;
14
+import java.math.BigDecimal;
15
+import java.util.Date;
16
+
17
+/**
18
+ * 货值暂估信息表
19
+ */
20
+@Getter
21
+@Setter
22
+@Accessors(chain = true)
23
+@TableName("SGGMINFT.INF_HUOZHIZANGU")
24
+@ApiModel(value = "InfHuozhizangu对象", description = "货值暂估信息表")
25
+public class InfHuozhizangu implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @TableId(value = "ID", type = IdType.ASSIGN_ID)
30
+    @ApiModelProperty(value = "主键ID")
31
+    private String id;
32
+
33
+    @ApiModelProperty(value = "流水号")
34
+    @TableField(value = "FNO")
35
+    private String fno;
36
+
37
+    @ApiModelProperty(value = "采购合同号")
38
+    @TableField(value = "PONO")
39
+    private String pono;
40
+
41
+    @ApiModelProperty(value = "物料描述")
42
+    @TableField(value = "SDESC")
43
+    private String sdesc;
44
+
45
+    @ApiModelProperty(value = "数量")
46
+    @TableField(value = "QTY")
47
+    private BigDecimal qty;
48
+
49
+    @ApiModelProperty(value = "单位")
50
+    @TableField(value = "UT")
51
+    private String ut;
52
+
53
+    @ApiModelProperty(value = "不含税金额")
54
+    @TableField(value = "NTPOAMT")
55
+    private BigDecimal ntPoAmt;
56
+
57
+    @ApiModelProperty(value = "不含税单价")
58
+    @TableField(value = "NTPOPRICE")
59
+    private BigDecimal ntPoPrice;
60
+
61
+    @ApiModelProperty(value = "含税单价")
62
+    @TableField(value = "POPRICE")
63
+    private BigDecimal poPrice;
64
+
65
+    @ApiModelProperty(value = "含税金额")
66
+    @TableField(value = "POAMT")
67
+    private BigDecimal poAmt;
68
+
69
+    @ApiModelProperty(value = "币别")
70
+    @TableField(value = "CURCY")
71
+    private String curcy;
72
+
73
+    @ApiModelProperty(value = "税率")
74
+    @TableField(value = "INTAXRATE")
75
+    private BigDecimal inTaxRate;
76
+
77
+    @ApiModelProperty(value = "数据状态")
78
+    @TableField(value = "DATASTATUS")
79
+    private String dataStatus;
80
+
81
+    @ApiModelProperty(value = "错误日志")
82
+    @TableField(value = "ERRORLOG")
83
+    private String errorLog;
84
+
85
+    @ApiModelProperty(value = "创建时间")
86
+    @TableField(value = "CREATETIME")
87
+    private Date createTime;
88
+}

+ 3
- 0
src/main/java/com/example/backend/pAndSExe/model/InfJinxiangfapiao.java Visa fil

@@ -112,4 +112,7 @@ public class InfJinxiangfapiao implements Serializable {
112 112
 
113 113
     @TableField(value ="receiptNo")
114 114
     private String receiptNo;
115
+
116
+    @TableField(value="invNo")
117
+    private String invNo;
115 118
 }

+ 244
- 0
src/main/java/com/example/backend/pAndSExe/model/ProvIn.java Visa fil

@@ -0,0 +1,244 @@
1
+package com.example.backend.pAndSExe.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import lombok.Data;
8
+import java.math.BigDecimal;
9
+import java.util.Date;
10
+
11
+/**
12
+ * 进项发票主表(SGGMIIP.provIn)
13
+ */
14
+@Data
15
+@TableName("SGGMIIP.provIn") // 数据库表名
16
+public class ProvIn {
17
+
18
+    /** 主键ID(雪花ID,19位数字) */
19
+    @TableId(type = IdType.ASSIGN_ID)
20
+    private Long id;
21
+
22
+    // ========== 基础信息 ==========
23
+    /** 单据单号 */
24
+    @TableField("fno")
25
+    private String fno;
26
+
27
+    /** 单据日期 */
28
+    @TableField("fdate")
29
+    private Date fdate;
30
+
31
+    /** 销售合同号 */
32
+    @TableField("sono")
33
+    private String sono;
34
+
35
+    /** 我方代码 */
36
+    @TableField("fours")
37
+    private String fours;
38
+
39
+    /** 我方名称 */
40
+    @TableField("foursname")
41
+    private String foursname;
42
+
43
+    /** 供应商代码 */
44
+    @TableField("supCode")
45
+    private String supCode;
46
+
47
+    /** 供应商名称 */
48
+    @TableField("supName")
49
+    private String supName;
50
+
51
+    /** 开票总金额 */
52
+    @TableField("invTotalAmt")
53
+    private BigDecimal invTotalAmt;
54
+
55
+    /** 备注 */
56
+    @TableField("remark")
57
+    private String remark;
58
+
59
+    // ========== 基础流程/来源信息 ==========
60
+    /** 流程实例id */
61
+    @TableField("process_instance_id")
62
+    private String processInstanceId;
63
+
64
+    /** 单据状态 */
65
+    @TableField("placed")
66
+    private String placed;
67
+
68
+    /** 业务id */
69
+    @TableField("fmodalid")
70
+    private Long fmodalid;
71
+
72
+    /** 数据来源id */
73
+    @TableField("sourceid")
74
+    private Long sourceid;
75
+
76
+    /** 数据来源表 */
77
+    @TableField("sourcetable")
78
+    private String sourcetable;
79
+
80
+    /** 图片 */
81
+    @TableField("img_ids")
82
+    private String imgIds;
83
+
84
+    /** 调取次数 */
85
+    @TableField("inc")
86
+    private Integer inc;
87
+
88
+    /** 关联id */
89
+    @TableField("rid")
90
+    private Long rid;
91
+
92
+    /** 归档状态 0-未归档,1-已归档 */
93
+    @TableField("fsaved")
94
+    private String fsaved;
95
+
96
+    /** 模版名称 */
97
+    @TableField("sys_template_name")
98
+    private String sysTemplateName;
99
+
100
+    /** 采购合同号 */
101
+    @TableField("pono")
102
+    private String pono;
103
+
104
+    /** 业务账套 */
105
+    @TableField("acctSet")
106
+    private String acctSet;
107
+
108
+    /** 币别 */
109
+    @TableField("curcy")
110
+    private String curcy;
111
+
112
+    /** 汇率 */
113
+    @TableField("rate")
114
+    private BigDecimal rate;
115
+
116
+    /** 美元汇率 */
117
+    @TableField("rateUsd")
118
+    private BigDecimal rateUsd;
119
+
120
+    /** 人民币发票金额 */
121
+    @TableField("invTotalCnyAmt")
122
+    private BigDecimal invTotalCnyAmt;
123
+
124
+    /** 美元发票金额 */
125
+    @TableField("invTotalUsdAmt")
126
+    private BigDecimal invTotalUsdAmt;
127
+
128
+    /** 仓库代码 */
129
+    @TableField("stockno")
130
+    private String stockno;
131
+
132
+    /** 仓库名称 */
133
+    @TableField("stockname")
134
+    private String stockname;
135
+
136
+    /** IMP同步PLMS接口状态 */
137
+    @TableField("impToPLMSStatus")
138
+    private String impToPLMSStatus;
139
+
140
+    /** IMP同步PLMS接口数据状态 */
141
+    @TableField("impToPLMSFlag")
142
+    private String impToPLMSFlag;
143
+
144
+    /** IMP同步PLMS接口来源系统代码 */
145
+    @TableField("SYSID")
146
+    private String sysid;
147
+
148
+    /** IMP同步PLMS接口账套代码 */
149
+    @TableField("bookId")
150
+    private String bookId;
151
+
152
+    /** IMP同步PLMS接口PLMS组织ID */
153
+    @TableField("orgId")
154
+    private String orgId;
155
+
156
+    /** 提交审批日期 */
157
+    @TableField("submissionDate")
158
+    private Date submissionDate;
159
+
160
+    /** 成本类型 */
161
+    @TableField("costType")
162
+    private String costType;
163
+
164
+    /** 费用类型 */
165
+    @TableField("feeType")
166
+    private String feeType;
167
+
168
+    /** 期间 */
169
+    @TableField("periodCode")
170
+    private String periodCode;
171
+
172
+    /** 报表字段 */
173
+    @TableField("rptg")
174
+    private String rptg;
175
+
176
+    /** 业务类型 */
177
+    @TableField("serviceType")
178
+    private String serviceType;
179
+
180
+    /** 合同类型 */
181
+    @TableField("bizType")
182
+    private String bizType;
183
+
184
+    /** 合同产品类型 */
185
+    @TableField("bizProductType")
186
+    private String bizProductType;
187
+
188
+    /** 暂估单价预警 */
189
+    @TableField("estimatePriceWarning")
190
+    private String estimatePriceWarning;
191
+
192
+    /** 暂估单价预警原因 */
193
+    @TableField("estimatePriceReason")
194
+    private String estimatePriceReason;
195
+
196
+    /** 是否期初数据补录 */
197
+    @TableField("isinitDate")
198
+    private String isinitDate;
199
+
200
+    /** 期初标识 */
201
+    @TableField("QICHU")
202
+    private String qichu;
203
+
204
+    /** 销售订单ID */
205
+    @TableField("SOLOID")
206
+    private String soloid;
207
+
208
+    // ========== 公共审计字段 ==========
209
+    /** 创建账号 */
210
+    @TableField("create_by")
211
+    private String createBy;
212
+
213
+    /** 创建时间 */
214
+    @TableField("create_time")
215
+    private Date createTime;
216
+
217
+    /** 创建人 */
218
+    @TableField("create_by_name")
219
+    private String createByName;
220
+
221
+    /** 更新账号 */
222
+    @TableField("update_by")
223
+    private String updateBy;
224
+
225
+    /** 更新时间 */
226
+    @TableField("update_time")
227
+    private Date updateTime;
228
+
229
+    /** 更新人 */
230
+    @TableField("update_by_name")
231
+    private String updateByName;
232
+
233
+    /** 是否删除(0-未删除,1-已删除) */
234
+    @TableField("del_flag")
235
+    private Integer delFlag;
236
+
237
+    /** 部门名称 */
238
+    @TableField("dept_name")
239
+    private String deptName;
240
+
241
+    /** 部门ID */
242
+    @TableField("dept_id")
243
+    private String deptId;
244
+}

+ 368
- 0
src/main/java/com/example/backend/pAndSExe/model/ProvInDtl.java Visa fil

@@ -0,0 +1,368 @@
1
+package com.example.backend.pAndSExe.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import lombok.Data;
8
+import java.math.BigDecimal;
9
+import java.util.Date;
10
+
11
+/**
12
+ * 进项发票明细表(SGGMIIP.provInDtl)
13
+ */
14
+@Data
15
+@TableName("SGGMIIP.provInDtl") // 数据库表名
16
+public class ProvInDtl {
17
+
18
+    /** 主键ID(雪花ID,19位数字) */
19
+    @TableId(type = IdType.ASSIGN_ID)
20
+    private Long id;
21
+
22
+    // ========== 基础信息 ==========
23
+    /** 行号 */
24
+    @TableField("line")
25
+    private BigDecimal line;
26
+
27
+    /** 采购合同号 */
28
+    @TableField("pono")
29
+    private String pono;
30
+
31
+    /** 品名 */
32
+    @TableField("sdesc")
33
+    private String sdesc;
34
+
35
+    /** 规格 */
36
+    @TableField("spec")
37
+    private String spec;
38
+
39
+    /** 含税单价 */
40
+    @TableField("poPrice")
41
+    private BigDecimal poPrice;
42
+
43
+    /** 数量 */
44
+    @TableField("qty")
45
+    private BigDecimal qty;
46
+
47
+    /** 单位 */
48
+    @TableField("ut")
49
+    private String ut;
50
+
51
+    /** 含税金额 */
52
+    @TableField("poAmt")
53
+    private BigDecimal poAmt;
54
+
55
+    /** 税额 */
56
+    @TableField("taxAmt")
57
+    private BigDecimal taxAmt;
58
+
59
+    /** 不含税单价 */
60
+    @TableField("ntPoPrice")
61
+    private BigDecimal ntPoPrice;
62
+
63
+    /** 不含税金额 */
64
+    @TableField("ntPoAmt")
65
+    private BigDecimal ntPoAmt;
66
+
67
+    /** 税率 % */
68
+    @TableField("taxRate")
69
+    private BigDecimal taxRate;
70
+
71
+    /** 备注 */
72
+    @TableField("remark")
73
+    private String remark;
74
+
75
+    /** 商品编号 */
76
+    @TableField("itemno")
77
+    private String itemno;
78
+
79
+    /** 进项税率 */
80
+    @TableField("inTaxRate")
81
+    private BigDecimal inTaxRate;
82
+
83
+    /** 资源号 */
84
+    @TableField("resourceNo")
85
+    private String resourceNo;
86
+
87
+    /** 销售合同号 */
88
+    @TableField("sono")
89
+    private String sono;
90
+
91
+    /** 采购订单号 */
92
+    @TableField("poOrderNo")
93
+    private String poOrderNo;
94
+
95
+    /** 销售订单号 */
96
+    @TableField("soOrderNo")
97
+    private String soOrderNo;
98
+
99
+    /** 出口关税税率% */
100
+    @TableField("eDutyRate")
101
+    private BigDecimal eDutyRate;
102
+
103
+    /** 采购产品ID */
104
+    @TableField("poid")
105
+    private Long poid;
106
+
107
+    /** 销售产品ID */
108
+    @TableField("soid")
109
+    private Long soid;
110
+
111
+    /** 来源单号 */
112
+    @TableField("sourceno")
113
+    private String sourceno;
114
+
115
+    /** 仓库代码 */
116
+    @TableField("stockno")
117
+    private String stockno;
118
+
119
+    /** 仓库名称 */
120
+    @TableField("stockname")
121
+    private String stockname;
122
+
123
+    /** plms仓库代码 */
124
+    @TableField("plmsccno")
125
+    private String plmsccno;
126
+
127
+    /** plms仓库名称 */
128
+    @TableField("plmsccname")
129
+    private String plmsccname;
130
+
131
+    /** 美元采购金额 */
132
+    @TableField("usdpoamt")
133
+    private BigDecimal usdpoamt;
134
+
135
+    /** 人民币采购金额 */
136
+    @TableField("cnypoamt")
137
+    private BigDecimal cnypoamt;
138
+
139
+    /** 供应商代码 */
140
+    @TableField("supCode")
141
+    private String supCode;
142
+
143
+    /** 供应商名称 */
144
+    @TableField("supName")
145
+    private String supName;
146
+
147
+    /** 币别 */
148
+    @TableField("curcy")
149
+    private String curcy;
150
+
151
+    /** 汇率 */
152
+    @TableField("rate")
153
+    private BigDecimal rate;
154
+
155
+    /** 采购人民币汇率 */
156
+    @TableField("ratepo")
157
+    private BigDecimal ratepo;
158
+
159
+    /** 采购美元汇率 */
160
+    @TableField("rateusdpo")
161
+    private BigDecimal rateusdpo;
162
+
163
+    /** 采购币别 */
164
+    @TableField("curcypo")
165
+    private String curcypo;
166
+
167
+    /** 采购币别 */
168
+    @TableField("mdkcdtl")
169
+    private String mdkcdtl;
170
+
171
+    /** 湿吨数量 */
172
+    @TableField("wetTonQty")
173
+    private BigDecimal wetTonQty;
174
+
175
+    /** 干吨数量 */
176
+    @TableField("dryTonQty")
177
+    private BigDecimal dryTonQty;
178
+
179
+    /** 捆单重 */
180
+    @TableField("fnum6")
181
+    private BigDecimal fnum6;
182
+
183
+    /** 钢厂资源号 */
184
+    @TableField("SMRNo")
185
+    private String smrNo;
186
+
187
+    /** 批次号 */
188
+    @TableField("batchNo")
189
+    private String batchNo;
190
+
191
+    /** 计重方式 */
192
+    @TableField("ftype4")
193
+    private String ftype4;
194
+
195
+    /** 色标 */
196
+    @TableField("ftype5")
197
+    private String ftype5;
198
+
199
+    /** 文本预留字段1 */
200
+    @TableField("ftype6")
201
+    private String ftype6;
202
+
203
+    /** 文本预留字段2 */
204
+    @TableField("ftype7")
205
+    private String ftype7;
206
+
207
+    /** 煤焦计价水% */
208
+    @TableField("coalMoisture")
209
+    private BigDecimal coalMoisture;
210
+
211
+    /** 宽 */
212
+    @TableField("fnum2")
213
+    private BigDecimal fnum2;
214
+
215
+    /** 长 */
216
+    @TableField("fnum3")
217
+    private BigDecimal fnum3;
218
+
219
+    /** 捆支数 */
220
+    @TableField("fnum7")
221
+    private BigDecimal fnum7;
222
+
223
+    /** 数值预留字段1 */
224
+    @TableField("fnum8")
225
+    private BigDecimal fnum8;
226
+
227
+    /** 件数 */
228
+    @TableField("qua")
229
+    private BigDecimal qua;
230
+
231
+    /** 牌号 */
232
+    @TableField("brand")
233
+    private String brand;
234
+
235
+    /** 计价方式 */
236
+    @TableField("priceMtd")
237
+    private String priceMtd;
238
+
239
+    /** 卷重范围 */
240
+    @TableField("ftype1")
241
+    private String ftype1;
242
+
243
+    /** H型钢规格 */
244
+    @TableField("ftype2")
245
+    private String ftype2;
246
+
247
+    /** 规格 */
248
+    @TableField("ftype3")
249
+    private String ftype3;
250
+
251
+    /** 英文品名 */
252
+    @TableField("edesc")
253
+    private String edesc;
254
+
255
+    /** 数值预留字段 */
256
+    @TableField("fnum1")
257
+    private BigDecimal fnum1;
258
+
259
+    /** 数值预留字段 */
260
+    @TableField("fnum4")
261
+    private BigDecimal fnum4;
262
+
263
+    /** 数值预留字段 */
264
+    @TableField("fnum5")
265
+    private BigDecimal fnum5;
266
+
267
+    /** 数值预留字段 */
268
+    @TableField("fnum9")
269
+    private BigDecimal fnum9;
270
+
271
+    /** 业务账套 */
272
+    @TableField("acctSet")
273
+    private String acctSet;
274
+
275
+    /** 水分% */
276
+    @TableField("moisture")
277
+    private BigDecimal moisture;
278
+
279
+    /** 含铁量% */
280
+    @TableField("ironCont")
281
+    private BigDecimal ironCont;
282
+
283
+    // ========== 基础流程/来源信息 ==========
284
+    /** 流程实例id */
285
+    @TableField("process_instance_id")
286
+    private String processInstanceId;
287
+
288
+    /** 单据号 */
289
+    @TableField("fno")
290
+    private String fno;
291
+
292
+    /** 单据日期 */
293
+    @TableField("fdate")
294
+    private Date fdate;
295
+
296
+    /** 单据状态 */
297
+    @TableField("placed")
298
+    private String placed;
299
+
300
+    /** 业务id */
301
+    @TableField("fmodalid")
302
+    private Long fmodalid;
303
+
304
+    /** 数据来源id */
305
+    @TableField("sourceid")
306
+    private Long sourceid;
307
+
308
+    /** 数据来源表 */
309
+    @TableField("sourcetable")
310
+    private String sourcetable;
311
+
312
+    /** 图片 */
313
+    @TableField("img_ids")
314
+    private String imgIds;
315
+
316
+    /** 调取次数 */
317
+    @TableField("inc")
318
+    private Integer inc;
319
+
320
+    /** 关联id */
321
+    @TableField("rid")
322
+    private Long rid;
323
+
324
+    /** 归档状态 0-未归档,1-已归档 */
325
+    @TableField("fsaved")
326
+    private String fsaved;
327
+
328
+    /** 模版名称 */
329
+    @TableField("sys_template_name")
330
+    private String sysTemplateName;
331
+
332
+    /** 部门名称 */
333
+    @TableField("dept_name")
334
+    private String deptName;
335
+
336
+    /** 部门ID */
337
+    @TableField("dept_id")
338
+    private String deptId;
339
+
340
+    // ========== 公共审计字段 ==========
341
+    /** 创建账号 */
342
+    @TableField("create_by")
343
+    private String createBy;
344
+
345
+    /** 创建时间 */
346
+    @TableField("create_time")
347
+    private Date createTime;
348
+
349
+    /** 创建人 */
350
+    @TableField("create_by_name")
351
+    private String createByName;
352
+
353
+    /** 更新账号 */
354
+    @TableField("update_by")
355
+    private String updateBy;
356
+
357
+    /** 更新时间 */
358
+    @TableField("update_time")
359
+    private Date updateTime;
360
+
361
+    /** 更新人 */
362
+    @TableField("update_by_name")
363
+    private String updateByName;
364
+
365
+    /** 是否删除(0-未删除,1-已删除) */
366
+    @TableField("del_flag")
367
+    private Integer delFlag;
368
+}

+ 5
- 0
src/main/java/com/example/backend/pAndSExe/service/HuozhizanguSettleService.java Visa fil

@@ -0,0 +1,5 @@
1
+package com.example.backend.pAndSExe.service;
2
+
3
+public interface HuozhizanguSettleService {
4
+    String importHuozhizanguInfToSettle();
5
+}

+ 78
- 0
src/main/java/com/example/backend/pAndSExe/service/impl/HuozhizanguSettleServiceImpl.java Visa fil

@@ -0,0 +1,78 @@
1
+package com.example.backend.pAndSExe.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
4
+import com.example.backend.pAndSExe.mapper.InfHuozhizanguMapper;
5
+import com.example.backend.pAndSExe.mapper.ProvInMapper;
6
+import com.example.backend.pAndSExe.mapper.ProvInDtlMapper;
7
+import com.example.backend.pAndSExe.model.InfHuozhizangu;
8
+import com.example.backend.pAndSExe.model.ProvIn;
9
+import com.example.backend.pAndSExe.model.ProvInDtl;
10
+import com.example.backend.pAndSExe.service.HuozhizanguSettleService;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.stereotype.Service;
13
+import org.springframework.transaction.annotation.Transactional;
14
+
15
+import java.util.List;
16
+
17
+@Service
18
+public class HuozhizanguSettleServiceImpl implements HuozhizanguSettleService {
19
+
20
+    @Autowired
21
+    private InfHuozhizanguMapper infHuozhizanguMapper;
22
+
23
+    @Autowired
24
+    private ProvInMapper provInMapper;
25
+
26
+    @Autowired
27
+    private ProvInDtlMapper provInDtlMapper;
28
+
29
+    @Transactional(rollbackFor = Exception.class)
30
+    public String importHuozhizanguInfToSettle() {
31
+        List<InfHuozhizangu> infList = infHuozhizanguMapper.selectValidData();
32
+        if (infList.isEmpty()) {
33
+            return "未查询到货值暂估中间表中有效数据(dataStatus=0),无需导入";
34
+        }
35
+
36
+        int successCount = 0;
37
+        int failCount = 0;
38
+
39
+        for (InfHuozhizangu inf : infList) {
40
+            try {
41
+                ProvIn provIn = new ProvIn();
42
+                Long provInId = IdWorker.getId();
43
+                provIn.setId(provInId);
44
+                provIn.setPono(inf.getPono());
45
+                provIn.setCurcy(inf.getCurcy());
46
+                provIn.setQichu("1");
47
+                provIn.setSoloid(inf.getId());
48
+                provInMapper.insert(provIn);
49
+
50
+                ProvInDtl provInDtl = new ProvInDtl();
51
+                Long dtlId = IdWorker.getId();
52
+                provInDtl.setId(dtlId);
53
+                provInDtl.setInTaxRate(inf.getInTaxRate());
54
+                provInDtl.setRid(provInId);
55
+                provInDtl.setSdesc(inf.getSdesc());
56
+                provInDtl.setQty(inf.getQty());
57
+                provInDtl.setUt(inf.getUt());
58
+                provInDtl.setNtPoAmt(inf.getNtPoAmt());
59
+                provInDtl.setNtPoPrice(inf.getNtPoPrice());
60
+                provInDtl.setPoPrice(inf.getPoPrice());
61
+                provInDtl.setPoAmt(inf.getPoAmt());
62
+                provInDtl.setCurcy(inf.getCurcy());
63
+                provInDtlMapper.insert(provInDtl);
64
+
65
+                infHuozhizanguMapper.updateStatusById(inf.getId());
66
+                successCount++;
67
+            } catch (Exception e) {
68
+                failCount++;
69
+                System.err.println("导入货值暂估中间表数据到业务表失败,inf.id=" + inf.getId() + ",错误:" + e.getMessage());
70
+                e.printStackTrace();
71
+                continue;
72
+            }
73
+        }
74
+
75
+        return String.format("货值暂估中间表数据导入业务表完成:总条数=%d,成功=%d,失败=%d",
76
+                infList.size(), successCount, failCount);
77
+    }
78
+}

+ 151
- 1
src/main/java/com/example/backend/pAndSExe/util/PsExeExcelUtil.java Visa fil

@@ -70,6 +70,8 @@ public class PsExeExcelUtil {
70 70
           SHEET_MAPPINGS.add(new SheetMapping("销售结算开票", InfXiaoshoujiesuankaipiaoExcelDTO.class, "InfXiaoshoujiesuankaipiao"));
71 71
           //SHEET_MAPPINGS.add(new SheetMapping("费用结算登记", InfFeiyongjiesuandengjiExcelDTO.class, "InfFeiyongjiesuandengji"));
72 72
           SHEET_MAPPINGS.add(new SheetMapping("代理结算", InfDailijiesuanExcelDTO.class, "InfDailijiesuan"));
73
+
74
+          SHEET_MAPPINGS.add(new SheetMapping("货值暂估", InfHuozhizanguExcelDTO.class, "InfHuozhizangu"));
73 75
         /*SHEET_MAPPINGS.add(new SheetMapping("收款登记", InfExe6ExcelDTO.class, "InfExe6"));
74 76
         SHEET_MAPPINGS.add(new SheetMapping("销售结算开票", InfExe7ExcelDTO.class, "InfExe7"));*/
75 77
     }
@@ -203,6 +205,12 @@ public class PsExeExcelUtil {
203 205
                         .filter(entity -> entity != null)
204 206
                         .collect(Collectors.toList());
205 207
                 break;
208
+            case "InfHuozhizangu":
209
+                resultList = ((List<InfHuozhizanguExcelDTO>) dtoList).stream()
210
+                        .map(this::convertToInfHuozhizangu)
211
+                        .filter(entity -> entity != null)
212
+                        .collect(Collectors.toList());
213
+                break;
206 214
 
207 215
             default:
208 216
                 System.err.println("未知业务类型:" + businessType + ",无法转换DTO为实体");
@@ -1057,6 +1065,9 @@ public class PsExeExcelUtil {
1057 1065
             errorLogList.add("含税金额为空");
1058 1066
         }
1059 1067
         if (dto.getTaxInvNo() == null || dto.getTaxInvNo().isEmpty()) {
1068
+            errorLogList.add("税票号码为空");
1069
+        }
1070
+        if (dto.getInvNo()==null|| dto.getInvNo().isEmpty()) {
1060 1071
             errorLogList.add("发票号码为空");
1061 1072
         }
1062 1073
 
@@ -1125,6 +1136,7 @@ public class PsExeExcelUtil {
1125 1136
             String createBy=infExe1Mapper.selectCreateByFromPono(dto.getPono());
1126 1137
             entity.setCreateBy(createBy);
1127 1138
         }
1139
+        entity.setInvNo(dto.getInvNo());
1128 1140
 
1129 1141
         entity.setDataStatus(errorLog.isEmpty() ? "0" : "9"); // 0=有效,9=无效
1130 1142
         entity.setErrorLog(errorLog); // 错误日志
@@ -1299,7 +1311,7 @@ public class PsExeExcelUtil {
1299 1311
         } else {
1300 1312
             // 拆分规则:按第一个空格/逗号拆分,左侧为编号,右侧为名称
1301 1313
 
1302
-            String[] ctArr = ctNoCtName.split("[-,\\s]+");
1314
+            String[] ctArr = ctNoCtName.split("-");
1303 1315
 
1304 1316
             if (ctArr.length<2) {
1305 1317
                 errorLogList.add("客户编号+客户名称格式不正确");
@@ -1908,6 +1920,144 @@ public class PsExeExcelUtil {
1908 1920
 
1909 1921
         return entity;
1910 1922
     }
1923
+
1924
+
1925
+
1926
+    private InfHuozhizangu convertToInfHuozhizangu(InfHuozhizanguExcelDTO dto) {
1927
+        List<String> errorLogList = new ArrayList<>();
1928
+
1929
+        // 采购合同号校验
1930
+        String pono = trimField(dto.getPono());
1931
+        if (pono.isEmpty()) {
1932
+            errorLogList.add("采购合同号为空");
1933
+        } else {
1934
+            int pContractCount = infExe1Mapper.selectFnoByFno(pono);
1935
+            if (pContractCount == 0) {
1936
+                errorLogList.add("采购合同号【" + pono + "】不存在");
1937
+            }
1938
+        }
1939
+
1940
+        // 物料描述校验
1941
+        String sdesc = trimField(dto.getSdesc());
1942
+        if (sdesc.isEmpty()) {
1943
+            errorLogList.add("物料描述为空");
1944
+        }
1945
+
1946
+        // 数量校验
1947
+        BigDecimal qty = BigDecimal.ZERO;
1948
+        if (dto.getQty() == null) {
1949
+            errorLogList.add("数量为空");
1950
+        } else {
1951
+            qty = BigDecimal.valueOf(dto.getQty()).setScale(6, BigDecimal.ROUND_HALF_UP);
1952
+            if (qty.compareTo(BigDecimal.ZERO) <= 0) {
1953
+                errorLogList.add("数量必须大于0,当前值:" + dto.getQty());
1954
+            }
1955
+        }
1956
+
1957
+        // 单位校验
1958
+        String ut = trimField(dto.getUt());
1959
+        if (ut.isEmpty()) {
1960
+            errorLogList.add("单位为空");
1961
+        }
1962
+
1963
+        // 不含税金额校验
1964
+        BigDecimal ntPoAmt = BigDecimal.ZERO;
1965
+        if (dto.getNtPoAmt() == null) {
1966
+            errorLogList.add("不含税金额为空");
1967
+        } else {
1968
+            ntPoAmt = BigDecimal.valueOf(dto.getNtPoAmt()).setScale(6, BigDecimal.ROUND_HALF_UP);
1969
+            if (ntPoAmt.compareTo(BigDecimal.ZERO) <= 0) {
1970
+                errorLogList.add("不含税金额必须大于0,当前值:" + dto.getNtPoAmt());
1971
+            }
1972
+        }
1973
+
1974
+        // 不含税单价校验
1975
+        BigDecimal ntPoPrice = BigDecimal.ZERO;
1976
+        if (dto.getNtPoPrice() == null) {
1977
+            errorLogList.add("不含税单价为空");
1978
+        } else {
1979
+            ntPoPrice = BigDecimal.valueOf(dto.getNtPoPrice()).setScale(6, BigDecimal.ROUND_HALF_UP);
1980
+            if (ntPoPrice.compareTo(BigDecimal.ZERO) <= 0) {
1981
+                errorLogList.add("不含税单价必须大于0,当前值:" + dto.getNtPoPrice());
1982
+            }
1983
+        }
1984
+
1985
+        // 含税单价校验
1986
+        BigDecimal poPrice = BigDecimal.ZERO;
1987
+        if (dto.getPoPrice() == null) {
1988
+            errorLogList.add("含税单价为空");
1989
+        } else {
1990
+            poPrice = BigDecimal.valueOf(dto.getPoPrice()).setScale(6, BigDecimal.ROUND_HALF_UP);
1991
+            if (poPrice.compareTo(BigDecimal.ZERO) <= 0) {
1992
+                errorLogList.add("含税单价必须大于0,当前值:" + dto.getPoPrice());
1993
+            }
1994
+        }
1995
+
1996
+        // 含税金额校验
1997
+        BigDecimal poAmt = BigDecimal.ZERO;
1998
+        if (dto.getPoAmt() == null) {
1999
+            errorLogList.add("含税金额为空");
2000
+        } else {
2001
+            poAmt = BigDecimal.valueOf(dto.getPoAmt()).setScale(6, BigDecimal.ROUND_HALF_UP);
2002
+            if (poAmt.compareTo(BigDecimal.ZERO) <= 0) {
2003
+                errorLogList.add("含税金额必须大于0,当前值:" + dto.getPoAmt());
2004
+            }
2005
+        }
2006
+
2007
+        // 币别校验
2008
+        String curcy = trimField(dto.getCurcy());
2009
+        if (curcy.isEmpty()) {
2010
+            errorLogList.add("币别为空");
2011
+        }
2012
+
2013
+        // 税率校验
2014
+        BigDecimal inTaxRate = BigDecimal.ZERO;
2015
+        if (dto.getInTaxRate() == null) {
2016
+            errorLogList.add("税率为空");
2017
+        } else {
2018
+            inTaxRate = BigDecimal.valueOf(dto.getInTaxRate()).setScale(6, BigDecimal.ROUND_HALF_UP);
2019
+            if (inTaxRate.compareTo(BigDecimal.ZERO) < 0 || inTaxRate.compareTo(new BigDecimal("100")) > 0) {
2020
+                errorLogList.add("税率必须在0-100之间,当前值:" + dto.getInTaxRate());
2021
+            }
2022
+        }
2023
+
2024
+        String errorLog = errorLogList.isEmpty() ? "" : String.join(";", errorLogList);
2025
+
2026
+        InfHuozhizangu entity = new InfHuozhizangu();
2027
+        entity.setId(UUID.randomUUID().toString().replace("-", ""));
2028
+        entity.setDataStatus(errorLog.isEmpty() ? "0" : "9");
2029
+        entity.setErrorLog(errorLog);
2030
+        entity.setCreateTime(new Date());
2031
+        entity.setPono(pono);
2032
+        entity.setSdesc(sdesc);
2033
+        entity.setQty(qty);
2034
+        entity.setUt(ut);
2035
+        entity.setNtPoAmt(ntPoAmt);
2036
+        entity.setNtPoPrice(ntPoPrice);
2037
+        entity.setPoPrice(poPrice);
2038
+        entity.setPoAmt(poAmt);
2039
+        entity.setCurcy(curcy);
2040
+        entity.setInTaxRate(inTaxRate);
2041
+
2042
+        // 生成流水号(HZ+年月+6位自增ID)
2043
+        InfExe1Amount infExe1Amount = new InfExe1Amount();
2044
+        infExe1Amount.setCreateTime(new Date());
2045
+        infExe1AmountMapper.insert(infExe1Amount);
2046
+        Integer id = infExe1Amount.getId();
2047
+        SimpleDateFormat sdf = new SimpleDateFormat("yyMM");
2048
+        String yearMonth = sdf.format(new Date());
2049
+        StringBuilder sb = new StringBuilder();
2050
+        StringBuilder liushuihao = sb.append("POTI").append(yearMonth).append(String.format(String.valueOf(id))).append("-QC");
2051
+        entity.setFno(liushuihao.toString());
2052
+
2053
+        return entity;
2054
+    }
2055
+
2056
+
2057
+
2058
+
2059
+
2060
+
1911 2061
     /*private   InfExe3 convertToInfExe4(InfExe3ExcelDTO dto) {
1912 2062
         if (dto.getPfno() == null || dto.getPfno().isEmpty()) {
1913 2063
             System.err.println("InfExe3:采购合同号为空,过滤该条数据:" + dto);

+ 3
- 2
src/main/resources/application.yml Visa fil

@@ -10,8 +10,9 @@ spring:
10 10
       max-request-size: 10MB
11 11
   datasource:
12 12
     driver-class-name: dm.jdbc.driver.DmDriver
13
-    url: jdbc:dm://10.19.13.211:5236
14
-    username: SGGMIIP
13
+    #url: jdbc:dm://10.19.13.211:5236
14
+    url: jdbc:dm://10.19.14.22:5236
15
+    username: SGGMINFT
15 16
     password: SXxxjsgs2025
16 17
     druid:
17 18
       initial-size: 5

Loading…
Avbryt
Spara