fix:合同台帐查询修复

This commit is contained in:
zhangzq
2024-04-18 13:39:11 +08:00
parent af449f7ba1
commit 7d79fd22da
7 changed files with 26 additions and 18 deletions

View File

@@ -20,6 +20,8 @@ import java.sql.SQLException;
public class DataBaseConfig {
@Value("${erp.oracle.enabled}")
private boolean oracleIsConnect;
@Value("${spring.profiles.active}")
private String active;
@Value("${erp.oracle.jdbcurl}")
private String oracleJdbcUrl;
@Value("${erp.oracle.username}")
@@ -46,7 +48,12 @@ public class DataBaseConfig {
@Bean(name = "dataSource1")
@ConditionalOnExpression("${erp.oracle.enabled:true}")
@ConfigurationProperties(prefix = "spring.datasource.druid")
public DataSource dataSource1() {
System.out.println("项目启动环境active"+active);
if ("dev".equals(active)){
return new DruidDataSource();
}
System.out.println("是否连接oracle:"+oracleIsConnect);
System.out.println("erp.oracle.jdbcurl:"+oracleJdbcUrl);
System.out.println("erp.oracle.username:"+oracleUserName);

View File

@@ -217,16 +217,16 @@ public class PcsIfPurchaseorderprocServiceImpl implements PcsIfPurchaseorderproc
.collect(Collectors.joining("','"));
// 查询erp视图
List<JSONObject> ja = WQL.getWO("QERP").setDbname("dataSource1").addParam("flag", "8").addParam("no_ids", "('"+no_ids+"')").process().getResultJSONArray(0).toJavaList(JSONObject.class);
for (int i = 0; i < content.size(); i++) {
JSONObject jsonObject = content.get(i);
List<JSONObject> collect = ja.stream()
Optional<JSONObject> first = ja.stream()
.filter(row -> row.getString("vbillcode").equals(jsonObject.getString("contract_no"))
&& row.getString("material_code").equals("item_code"))
.collect(Collectors.toList());
jsonObject.put("subscribedate", ObjectUtil.isNotEmpty(collect) ? collect.get(0).getString("subscribedate") : "");
&& row.getString("item_code").equals(jsonObject.getString("material_code"))).findAny();
jsonObject.put("subscribedate",first.isPresent() ? first.get().get("subscribedate"): "");
}
json.put("content",content);

View File

@@ -133,6 +133,7 @@
mater.material_name,
mater.material_code,
oder.PRICE_TAX,
dtl.receive_code,
oder.QTY,
oder.QTY * oder.PRICE_TAX AS money,
oder.QTY - redtl.allqty AS notqty,
@@ -163,12 +164,7 @@
a.source_billdtl_id
)
AS redtl ON redtl.source_billdtl_id = dtl.source_billdtl_id
LEFT JOIN (
SELECT
p.input_time,p.receive_id,p.is_delete
FROM
PCS_RC_ReceiveMst p WHERE p.is_delete = '0' ORDER BY p.input_time desc LIMIT 1
) AS remst ON remst.receive_id = dtl.receive_id
LEFT JOIN PCS_RC_ReceiveMst remst ON remst.receive_id = dtl.receive_id
WHERE
oder.dr = '0'

View File

@@ -306,10 +306,14 @@ public class FlourworkServiceImpl implements FlourworkService {
List<JSONObject> moveForm = new ArrayList<>();
if (!CollectionUtils.isEmpty(need_move)){
Map<String, List<JSONObject>> collect = need_move.stream().collect(Collectors.groupingBy(move -> move.getString("storagevehicle_code")));
for (String storagevehicle_code : collect.keySet()) {
String material_id = collect.get(storagevehicle_code).get(0).getString("material_id");
for (JSONObject move_item : need_move) {
List<JSONObject> move_material_collect = collect.remove(move_item.getString("storagevehicle_code"));
if (CollectionUtils.isEmpty(move_material_collect)){
continue;
}
JSONObject in_point = null;
if (g_material.contains(material_id )){
if (g_material.contains(move_item.getString("material_id") )){
if (g_points.size()>0){ in_point= g_points.remove(0); }
}else if (notG_points.size()>0){
if (notG_points.size()>0){ in_point= notG_points.remove(0); }
@@ -326,7 +330,7 @@ public class FlourworkServiceImpl implements FlourworkService {
map.put("stor_name", "原材料库");
map.put("tableData",tableData);
moveForm.add(map);
for (JSONObject item : collect.get(storagevehicle_code)) {
for (JSONObject item : move_material_collect) {
tableData.add(packageMoveForm(item, in_point));
}

View File

@@ -3,7 +3,7 @@ server:
#ERP系统相关
erp:
oracle:
enabled: false
enabled: true
jdbcurl: jdbc:oracle:thin:@192.168.81.251:1522:ORCL2
username: system
password: 123456

View File

@@ -2,7 +2,7 @@ spring:
freemarker:
check-template-location: false
profiles:
active: prod
active: dev
jackson:
time-zone: GMT+8
data:

View File

@@ -69,7 +69,7 @@
</el-table-column>-->
<el-table-column label="合同内容" align="center">
<el-table-column prop="subscribedate" label="签订时间" width="150px" show-overflow-tooltip />
<el-table-column prop="contract_no" label="合同编码" width="120px" show-overflow-tooltip/>
<el-table-column prop="contract_no" label="合同编码2" width="120px" show-overflow-tooltip/>
<el-table-column prop="supp_name" label="供应商" min-width="220" show-overflow-tooltip/>
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip />
@@ -77,9 +77,10 @@
<el-table-column prop="qty" label="重量" show-overflow-tooltip :formatter="crud.formatNum3" />
<el-table-column prop="money" label="金额" show-overflow-tooltip :formatter="crud.formatNum3" width="110" />
<el-table-column prop="notqty" label="未到货重量" :formatter="crud.formatNum3" show-overflow-tooltip width="110"/>
<el-table-column prop="honour_days" label="账龄" width="150px" show-overflow-tooltip/>
<el-table-column prop="honour_days" label="账龄" width="100px" show-overflow-tooltip/>
</el-table-column>
<el-table-column label="到货情况" align="center">
<el-table-column prop="receive_code" label="到货通知单" width="120px" show-overflow-tooltip/>
<el-table-column prop="allqty" label="合计重量" show-overflow-tooltip :formatter="crud.formatNum3" />
<el-table-column prop="all_valmoney" label="合计金额" show-overflow-tooltip :formatter="crud.formatNum3" />
<el-table-column prop="input_time" label="到货时间" width="150px" show-overflow-tooltip />