物料,客户,供应商接口修改

product
chuang 2 years ago
parent b82b917c86
commit b53ef12a14

@ -0,0 +1,93 @@
package jnpf.mobilePort.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
import jnpf.purchaseorder.model.purchaseorder.*;
import lombok.Data;
import java.util.List;
/**
* @Author: WangChuang
* @Date: 17/2/2023 8:49
* @Description //注释用于生成pdf文件中所要的数据
* @Version 1.0
*/
@Data
public class PurchaseOrderVO {
/** 订单号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 合同编码 **/
@JsonProperty("contractCode")
private String contractCode;
/** 合同名称 **/
@JsonProperty("contractName")
private String contractName;
/** 供货单位 **/
@JsonProperty("supplierName")
private String supplierName;
/** 币种 **/
@JsonProperty("currency")
private String currency;
/** 对方合同号 **/
@JsonProperty("contractNo")
private String contractNo;
/** 垫资金额 **/
@JsonProperty("advanceAmount")
private String advanceAmount;
/** 重量 **/
@JsonProperty("num")
private String num;
/** 金额 **/
@JsonProperty("amount")
private String amount;
/** 不含税金额 **/
@JsonProperty("notAmount")
private String notAmount;
/** 备注信息 **/
@JsonProperty("remark")
private String remark;
/** 制单人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;
/** 制单时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** ERP订单号 **/
@JsonProperty("erpNo")
private String erpNo;
/** 已付款金额 **/
@JsonProperty("payPrice")
private String payPrice;
/** 发票数量 **/
@JsonProperty("invoiceNum")
private String invoiceNum;
/** 发票金额 **/
@JsonProperty("invoiceAmount")
private String invoiceAmount;
/** 单据状态 **/
@JsonProperty("status")
private String status;
/** 子表数据 **/
@JsonProperty("purchaseorder_item0List")
private List<Purchaseorder_item0Model> purchaseorder_item0List;
}

@ -1,8 +1,13 @@
package jnpf.purchaseorder.mapper;
import jnpf.purchaseorder.entity.PurchaseorderitemEntity;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.mobilePort.entity.PurchaseOrderVO;
import jnpf.purchaseorder.entity.PurchaseorderitemEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
@ -13,5 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* 2023-02-01
*/
public interface PurchaseorderitemMapper extends BaseMapper<PurchaseorderitemEntity> {
List<PurchaseOrderVO> getPurchorderItemMap(@Param("ew")Wrapper<PurchaseorderitemEntity> queryWrapper);
}

@ -1,4 +1,5 @@
package jnpf.purchaseorder.service;
import jnpf.mobilePort.entity.PurchaseOrderVO;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.entity.Invoices_item0itemEntity;
import jnpf.purchaseorder.entity.PaymentitemEntity;
@ -19,6 +20,8 @@ import java.util.*;
*/
public interface PurchaseorderitemService extends IService<PurchaseorderitemEntity> {
List<PurchaseOrderVO> getPMap(PurchaseorderPagination purchaseorderPagination);
List<PurchaseorderitemEntity> getList(PurchaseorderPagination purchaseorderPagination);
List<PurchaseorderitemEntity> getTypeList(PurchaseorderPagination purchaseorderPagination, String dataType);

@ -1,27 +1,29 @@
package jnpf.purchaseorder.service.impl;
import jnpf.purchaseorder.entity.*;
import jnpf.purchaseorder.mapper.PurchaseorderitemMapper;
import jnpf.purchaseorder.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.mobilePort.entity.PurchaseOrderVO;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.purchaseorder.entity.*;
import jnpf.purchaseorder.mapper.PurchaseorderitemMapper;
import jnpf.purchaseorder.model.purchaseorder.PurchaseorderPagination;
import jnpf.purchaseorder.service.*;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import jnpf.permission.service.AuthorizeService;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import jnpf.util.*;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
/**
*
@ -57,8 +59,16 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
@Autowired
private CollectionpoService collectionpoService;
@Resource
private PurchaseorderitemMapper purchaseorderitemMapper;
@Override
public List<PurchaseOrderVO> getPMap(PurchaseorderPagination purchaseorderPagination) {
// QueryWrapper<PurchaseorderitemEntity> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<PurchaseorderitemEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PurchaseorderitemEntity::getDocumentNo,purchaseorderPagination.getDocumentNo());
return purchaseorderitemMapper.getPurchorderItemMap(wrapper);
}
@Override
public List<PurchaseorderitemEntity> getList(PurchaseorderPagination purchaseorderPagination){

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.purchaseback.mapper.PurchaseorderMapper">
</mapper>

@ -43,7 +43,7 @@
IFNULL( SUM( b.settlement ), 0.0000000000 )* IFNULL( SUM( b.sales_price ), 0.0000000000 ) salesPriceSum
FROM
jg_customer a
LEFT JOIN jg_poundlist b ON a.id = b.customer_code
LEFT JOIN jg_poundlist b ON a.id = b.customer_id
WHERE
( a.delete_mark != 1 OR a.delete_mark IS NULL )
AND ( b.delete_mark != 1 OR b.delete_mark IS NULL )

@ -44,16 +44,16 @@
IFNULL( SUM( b.settlement ), 0.0000000000 ) purchasesWeight,
(
CASE
( SELECT COUNT( DISTINCT COALESCE ( purchase_code, 'NULL' )) FROM jg_poundlist WHERE material_code = a.id )
( SELECT COUNT( DISTINCT COALESCE ( purchase_id, 'NULL' )) FROM jg_poundlist WHERE material_id = a.id )
WHEN 0 THEN
0.0000000000 ELSE IFNULL( SUM( b.settlement ), 0.0000000000 )
END
) salesWeight,
( SELECT COUNT( DISTINCT COALESCE ( purchase_code, 'NULL' )) FROM jg_poundlist WHERE material_code = a.id ) salesNumber,
( SELECT COUNT( DISTINCT COALESCE ( purchase_code, 'NULL' )) FROM jg_poundlist WHERE material_code = a.id ) purchasesNumber
( SELECT COUNT( DISTINCT COALESCE ( purchase_id, 'NULL' )) FROM jg_poundlist WHERE material_id = a.id ) salesNumber,
( SELECT COUNT( DISTINCT COALESCE ( purchase_id, 'NULL' )) FROM jg_poundlist WHERE material_id = a.id ) purchasesNumber
FROM
jg_material a
LEFT JOIN jg_poundlist b ON a.id = b.material_code
LEFT JOIN jg_poundlist b ON a.id = b.material_id
AND ( b.purchase_status != 0 OR b.purchase_status IS NULL )
AND ( b.purchase_status != 99 OR b.purchase_status IS NULL )
AND ( b.pound_status != '1' OR b.pound_status IS NULL )

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.purchaseorder.mapper.PurchaseorderitemMapper">
<resultMap id="purchorderItemMap" type="jnpf.mobilePort.entity.PurchaseOrderVO">
<!-- 制单人 -->
<result property="creatorUserName" column="creatorUserName"/>
<!-- 订单日期 -->
<result property="creatorTime" column="creatorTime"/>
<!-- 对方合同号-->
<result property="contractNo" column="contractNo"/>
<!-- 合同编码-->
<result property="contractCode" column="contractCode"/>
<!-- 供货 单位-->
<result property="supplierName" column="supplierName"/>
<!-- 订单号 -->
<result property="documentNo" column="documentNo"/>
<collection property="purchaseorder_item0List">
<!-- `物料名称、规格型号`-->
<result property="materialName" column="materialName"/>
<!-- 税率-->
<result property="rate" column="rate"/>
<!-- 单价-->
<result property="price" column="price"/>
<!-- 数量-->
<result property="settlement" column="settlement"/>
<!-- 单位-->
<result property="unit" column="unit"/>
<!-- 金额-->
<result property="amount" column="amount"/>
</collection>
</resultMap>
<select id="getPurchorderItemMap" resultMap="purchorderItemMap">
SELECT
*
FROM
(
SELECT
a.*,
a.creator_user_name AS `creatorUserName`,
a.creator_time AS `creatorTime`,
a.contract_no AS `contractNo`,
a.contract_code AS `contractCode`,
a.supplier_name AS `supplierName`,
a.document_no AS `documentNo`,
b.material_name AS `materialName`,
(
CASE
b.rate
WHEN '0' THEN
13
WHEN '1' THEN
9
WHEN '2' THEN
6
WHEN '3' THEN
5
WHEN '4' THEN
3 ELSE b.unit
END
) AS `rate`,
AVG( b.price ) AS `price`,
SUM( b.settlement ) AS `settlement`,
( CASE b.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit`,
SUM( b.amount ) `amount`
FROM
jg_purchaseorder AS a
LEFT JOIN jg_purchaseorder_item0 AS b ON a.id = b.purchaseorder_id
LEFT JOIN jg_poundlist AS c ON b.poundlist_id = c.id
GROUP BY
b.material_name,
b.rate,
b.unit
) aaa ${ew.customSqlSegment}
</select>
</mapper>

@ -50,7 +50,7 @@
IFNULL( SUM( b.settlement ), 0.0000000000 )* IFNULL( SUM( b.sales_price ), 0.0000000000 ) salesPriceSum
FROM
jg_supplier a
LEFT JOIN jg_poundlist b ON a.id = b.supplier_code
LEFT JOIN jg_poundlist b ON a.id = b.supplier_id
WHERE
( a.delete_mark != 1 OR a.delete_mark IS NULL )
AND ( b.delete_mark != 1 OR b.delete_mark IS NULL )

@ -8,59 +8,119 @@
<style>
body {
font-family: SimSun;
transform: rotate(90deg); height: 100vw; width: 100vh; transform-origin: 0% 100%; top: -100vw; }
tr{
font-size: 12px;
}
</style>
</head>
<body>
<div class='wrapper'>
<div id="caption" class="msg">
<h2 style="text-align: center">${title!""}</h2>
<p style="text-indent: 2em">信息</p>
<br/>
<br/>
<p style="font-weight: bold">基本信息:</p>
<p style="text-indent: 2em">用户名称:${name!""}</p>
<p style="font-weight: bold">业务部门:${name!""}</p>
<#--<p style="text-indent: 2em">用户名称:</p>-->
<br/>
<br/>
<p style="font-weight: bold">集合:</p>
<table border="1" cellspacing="0" width="100%">
<tr bgcolor="#6495ed" style="font-weight: bold">
<td width="10%">字段1</td>
<td width="15%">字段2</td>
<td width="10%">字段3</td>
<td width="25%">字段4</td>
<td width="20%">字段5</td>
<td width="10%">字段6</td>
<td width="10%">字段7</td>
<tr bgcolor="#6495ed" style="line-height: 80px" >
<td colspan="2" rowspan="2">订单日期</td>
<td colspan="3" rowspan="2">2022-12-02</td>
<td colspan="4" rowspan="2">对方合同编号</td>
<td colspan="5" rowspan="2">对方合同编号</td>
<td colspan="4" rowspan="2">合同编号</td>
<td colspan="5" rowspan="2">合同编号</td>
</tr>
<#if reportList?? && (reportList?size>0)>
<#list reportList as reportData>
<#if reportData??>
<#if reportData_index == 0>
<tr style="page-break-inside: avoid;page-break-after: auto;">
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column1!""}</td>
<td width="15%" style="word-break: break-all;word-wrap: break-word">${reportData.column2!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column3!""}</td>
<td width="25%" style="word-break: break-all;word-wrap: break-word">${reportData.column4!""}</td>
<td width="20%" style="word-break: break-all;word-wrap: break-word">${reportData.column5!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column6!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column7!""}</td>
<tr bgcolor="#6495ed" style="">
</tr>
<#else >
<#assign preData=reportList[reportData_index-1] />
<tr style="page-break-inside: avoid;page-break-after: auto;">
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column1!""}</td>
<td width="15%" style="word-break: break-all;word-wrap: break-word">${reportData.column2!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column3!""}</td>
<td width="25%" style="word-break: break-all;word-wrap: break-word">${reportData.column4!""}</td>
<td width="20%" style="word-break: break-all;word-wrap: break-word">${reportData.column5!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column6!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column7!""}</td>
<tr bgcolor="#6495ed" style="line-height: 80px">
<td colspan="2" rowspan="2">供货单位</td>
<td colspan="21" rowspan="2">2022-12-02</td>
</tr>
</#if>
</#if>
</#list>
</#if>
<tr bgcolor="#6495ed" style="">
</tr>
<tr bgcolor="#6495ed" style="line-height: 40px">
<td colspan="4">订单号</td>
<td colspan="1">行号</td>
<td colspan="7">物料名称、规格型号</td>
<td colspan="2">数量</td>
<td colspan="2">单位</td>
<td colspan="3">单价(含税)</td>
<td colspan="3">金额(含税)</td>
<td colspan="1">税率(含税)</td>
</tr>
<tr>
</tr>
<tr bgcolor="#6495ed" style="line-height: 40px">
<td colspan="4">订单号</td>
<td colspan="1">行号</td>
<td colspan="7">废钢</td>
<td colspan="2">数量</td>
<td colspan="2">吨</td>
<td colspan="3">单价</td>
<td colspan="3">金额</td>
<td colspan="1">税率</td>
</tr>
<tr bgcolor="#6495ed" style="line-height: 40px">
<td colspan="4">合计</td>
<td colspan="1"></td>
<td colspan="7"></td>
<td colspan="2">数量</td>
<td colspan="2"></td>
<td colspan="3"></td>
<td colspan="3">金额</td>
<td colspan="1"></td>
</tr>
<#-- <#if reportList?? && (reportList?size>0)>-->
<#-- <#list reportList as reportData>-->
<#-- <#if reportData??>-->
<#-- <#if reportData_index == 0>-->
<#-- <tr style="page-break-inside: avoid;page-break-after: auto;">-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column1!""}</td>-->
<#-- <td width="15%" style="word-break: break-all;word-wrap: break-word">${reportData.column2!""}</td>-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column3!""}</td>-->
<#-- <td width="25%" style="word-break: break-all;word-wrap: break-word">${reportData.column4!""}</td>-->
<#-- <td width="20%" style="word-break: break-all;word-wrap: break-word">${reportData.column5!""}</td>-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column6!""}</td>-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column7!""}</td>-->
<#-- </tr>-->
<#-- <#else >-->
<#-- <#assign preData=reportList[reportData_index-1] />-->
<#-- <tr style="page-break-inside: avoid;page-break-after: auto;">-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column1!""}</td>-->
<#-- <td width="15%" style="word-break: break-all;word-wrap: break-word">${reportData.column2!""}</td>-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column3!""}</td>-->
<#-- <td width="25%" style="word-break: break-all;word-wrap: break-word">${reportData.column4!""}</td>-->
<#-- <td width="20%" style="word-break: break-all;word-wrap: break-word">${reportData.column5!""}</td>-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column6!""}</td>-->
<#-- <td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column7!""}</td>-->
<#-- </tr>-->
<#-- </#if>-->
<#-- </#if>-->
<#-- </#list>-->
<#-- </#if>-->
</table>
<br/>
<br/>
</div>
</div>
</body>
</html>

Loading…
Cancel
Save