Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
6d2440d2
由
康伟
编写于
2024-11-15 10:42:43 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
kangwei:赋能中心-药剂统购分销
1 个父辈
6dfd14be
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
214 行增加
和
23 行删除
sk-module-biz/src/main/java/com/skua/modules/erp/controller/ErpReportController.java
sk-module-biz/src/main/java/com/skua/modules/erp/controller/ErpSettlementController.java
sk-module-biz/src/main/java/com/skua/modules/erp/mapper/ErpSettlementMapper.java
sk-module-biz/src/main/java/com/skua/modules/erp/mapper/MaterialINMapper.java
sk-module-biz/src/main/java/com/skua/modules/erp/mapper/xml/ErpSettlementMapper.xml
sk-module-biz/src/main/java/com/skua/modules/erp/service/IErpSettlementService.java
sk-module-biz/src/main/java/com/skua/modules/erp/service/impl/ErpSettlementServiceImpl.java
sk-module-biz/src/main/java/com/skua/modules/erp/vo/AgentiaStatisticsVO.java
sk-module-biz/src/main/java/com/skua/modules/erp/vo/ErpSettlementFormVO.java
sk-module-biz/src/main/java/com/skua/modules/erp/vo/ErpSettlementItemVO.java
sk-module-biz/src/main/java/com/skua/modules/erp/controller/ErpReportController.java
0 → 100644
查看文件 @
6d2440d
package
com
.
skua
.
modules
.
erp
.
controller
;
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.skua.core.api.vo.Result
;
import
com.skua.core.aspect.annotation.AutoLog
;
import
com.skua.core.context.SpringContextUtils
;
import
com.skua.core.query.QueryGenerator
;
import
com.skua.modules.erp.entity.ErpSettlement
;
import
com.skua.modules.erp.vo.AgentiaStatisticsVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
@Slf4j
@Api
(
tags
=
"赋能中心"
)
@RestController
(
"erpReportController"
)
@RequestMapping
(
"/web/erp/report"
)
public
class
ErpReportController
{
@AutoLog
(
value
=
"赋能中心-药剂统购分销"
)
@ApiOperation
(
value
=
"赋能中心-药剂统购分销"
,
notes
=
"赋能中心-药剂统购分销"
)
@GetMapping
(
value
=
"/agentiaStatistics"
)
public
Result
<
List
<
AgentiaStatisticsVO
>>
agentiaStatistics
()
{
Result
<
List
<
AgentiaStatisticsVO
>>
result
=
new
Result
<
List
<
AgentiaStatisticsVO
>>();
String
sql
=
"select d.depart_name , mi.material_num ,sm.supp_name 'supplier_name' ,aaa.* from ("
;
sql
+=
" select pp.depart_id , ppi.sparepart_name ,ppi.purchase_num 'plan_num' ,ppi.sparepart_id from erp_purchase_plan_item ppi ,erp_purchase_plan pp where ppi.plan_id = pp.id and pp.apply_year = year(now()) )aaa"
;
sql
+=
" left join sys_depart d on d.id = aaa.depart_id "
;
sql
+=
" left join erp_material_in mi on (aaa.depart_id = mi.depart_id and aaa.sparepart_id = mi.sparepart_id )"
;
sql
+=
" left join ajh_supplier_manage sm on sm.id = aaa.sparepart_id"
;
//主库数据源
JdbcTemplate
masterDB
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"master"
);
List
<
AgentiaStatisticsVO
>
dataList
=
masterDB
.
query
(
sql
,
new
BeanPropertyRowMapper
<
AgentiaStatisticsVO
>(
AgentiaStatisticsVO
.
class
));
result
.
setSuccess
(
true
);
result
.
setResult
(
dataList
);
return
result
;
}
}
sk-module-biz/src/main/java/com/skua/modules/erp/controller/ErpSettlementController.java
查看文件 @
6d2440d
...
...
@@ -21,6 +21,7 @@ import com.skua.modules.erp.service.IErpSettlementService;
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.skua.modules.erp.vo.ErpSettlementFormVO
;
import
com.skua.modules.erp.vo.ErpSettlementVO
;
import
com.skua.modules.productionduty.utils.HolidaysUtils
;
import
com.skua.modules.quartz.util.BaseUtil
;
...
...
@@ -265,12 +266,12 @@ public class ErpSettlementController {
return
result
;
}
@AutoLog
(
value
=
"药剂结算单详情-导出:送货单以及物资验收单"
)
@ApiOperation
(
value
=
"药剂结算单详情-导出:送货单以及物资验收单"
,
notes
=
"药剂结算单详情-导出:送货单以及物资验收单"
)
@GetMapping
(
value
=
"/exportSupplierFormPDF"
)
public
Result
<
ErpSettlement
VO
>
export
SupplierFormPDF
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
Result
<
ErpSettlement
VO
>
result
=
new
Result
<
ErpSettlement
VO
>();
ErpSettlementVO
erpSettlement
=
erpSettlementService
.
query
ById
(
id
);
@AutoLog
(
value
=
"药剂结算单详情-导出:
(供应商)
送货单以及物资验收单"
)
@ApiOperation
(
value
=
"药剂结算单详情-导出:
(供应商)
送货单以及物资验收单"
,
notes
=
"药剂结算单详情-导出:送货单以及物资验收单"
)
@GetMapping
(
value
=
"/exportSupplier
Supplier
FormPDF"
)
public
Result
<
ErpSettlement
FormVO
>
exportSupplier
SupplierFormPDF
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
Result
<
ErpSettlement
FormVO
>
result
=
new
Result
<
ErpSettlementForm
VO
>();
ErpSettlementFormVO
erpSettlement
=
erpSettlementService
.
querySupplierSettlementForm
ById
(
id
);
if
(
erpSettlement
==
null
)
{
result
.
error500
(
"未找到对应实体"
);
}
else
{
...
...
@@ -279,6 +280,20 @@ public class ErpSettlementController {
}
return
result
;
}
@AutoLog
(
value
=
"药剂结算单详情-导出:(供应商)送货单以及物资验收单"
)
@ApiOperation
(
value
=
"药剂结算单详情-导出:(供应商)送货单以及物资验收单"
,
notes
=
"药剂结算单详情-导出:送货单以及物资验收单"
)
@GetMapping
(
value
=
"/exportWaterDepartSupplierFormPDF"
)
public
Result
<
ErpSettlementFormVO
>
exportWaterDepartSupplierFormPDF
(
@RequestParam
(
name
=
"id"
,
required
=
true
)
String
id
)
{
Result
<
ErpSettlementFormVO
>
result
=
new
Result
<
ErpSettlementFormVO
>();
ErpSettlementFormVO
erpSettlement
=
erpSettlementService
.
queryWaterDepartSettlementFormById
(
id
);
if
(
erpSettlement
==
null
)
{
result
.
error500
(
"未找到对应实体"
);
}
else
{
result
.
setResult
(
erpSettlement
);
result
.
setSuccess
(
true
);
}
return
result
;
}
@RequestMapping
(
value
=
"/exportXls"
)
public
ModelAndView
exportXls
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
sk-module-biz/src/main/java/com/skua/modules/erp/mapper/ErpSettlementMapper.java
查看文件 @
6d2440d
...
...
@@ -3,6 +3,8 @@ package com.skua.modules.erp.mapper;
import
java.util.List
;
import
com.skua.modules.erp.entity.ErpSettlementItem
;
import
com.skua.modules.erp.vo.ErpSettlementFormVO
;
import
com.skua.modules.erp.vo.ErpSettlementItemVO
;
import
com.skua.modules.erp.vo.ErpSettlementVO
;
import
org.apache.ibatis.annotations.Param
;
import
com.skua.modules.erp.entity.ErpSettlement
;
...
...
@@ -22,4 +24,10 @@ public interface ErpSettlementMapper extends BaseMapper<ErpSettlement> {
// 根据入库单ids,获取【水厂】结算单详情
List
<
ErpSettlementItem
>
queryWaterDepartSettlementByMaterialIds
(
@Param
(
"ids"
)
String
materialIds
);
//送货单以及物资验收单
List
<
ErpSettlementItemVO
>
querySettlementFormById
(
@Param
(
"id"
)
String
id
);
//(供应商)送货单以及物资验收单
List
<
ErpSettlementItemVO
>
querySupplierSettlementFormById
(
@Param
(
"id"
)
String
id
);
//(水厂) 送货单以及物资验收单
List
<
ErpSettlementItemVO
>
queryWaterDepartSettlementFormById
((
@Param
(
"id"
)
String
id
);
}
...
...
sk-module-biz/src/main/java/com/skua/modules/erp/mapper/MaterialINMapper.java
查看文件 @
6d2440d
...
...
@@ -3,6 +3,7 @@ package com.skua.modules.erp.mapper;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.skua.modules.erp.vo.AgentiaStatisticsVO
;
import
com.skua.modules.erp.vo.ArrivalRecordExcelExportVO
;
import
org.apache.ibatis.annotations.Param
;
import
com.skua.modules.erp.entity.MaterialIN
;
...
...
@@ -26,5 +27,6 @@ public interface MaterialINMapper extends BaseMapper<MaterialIN> {
* @param materialIN
* @return
*/
public
List
<
MaterialIN
>
selectAuditMaterialINByPage
(
IPage
<
MaterialIN
>
page
,
@Param
(
"materialIN"
)
MaterialIN
materialIN
);
List
<
MaterialIN
>
selectAuditMaterialINByPage
(
IPage
<
MaterialIN
>
page
,
@Param
(
"materialIN"
)
MaterialIN
materialIN
);
}
...
...
sk-module-biz/src/main/java/com/skua/modules/erp/mapper/xml/ErpSettlementMapper.xml
查看文件 @
6d2440d
...
...
@@ -48,4 +48,30 @@
and mi.id in (${ids})
order by mi.arrive_time asc
</select>
<select
id=
"querySupplierSettlementFormById"
resultType=
"com.skua.modules.erp.voErpSettlementItemVO"
>
select d.depart_name,pc.project_name ,pc.contract_code,sm.supp_name as supplier_name,mi.arrive_time, maf.appearance_info ,maf.matched_info ,maf.handle_msg ,maf.sender_sign ,maf.receiver_sign ,aaa.*
from (
select si.sparepart_name,si.material_num,si.specification,si.measuring_unit,s.purchase_contract_id,s.supplier_id,si.material_in_id
from erp_settlement s ,erp_settlement_item si where s.id = si.settlement_id and s.id = #{id}
)aaa
left join erp_purchase_contract pc on aaa.purchase_contract_id = pc.id
left join ajh_supplier_manage sm on aaa.supplier_id = sm.id
left join erp_material_in mi on mi.id = aaa.material_in_id
left join erp_material_acceptance_form maf on maf.id= aaa.material_in_id
left join sys_depart d on d.id = mi.depart_id
</select>
<select
id=
"queryWaterDepartSettlementFormById"
resultType=
"com.skua.modules.erp.voErpSettlementItemVO"
>
select d.depart_name,dc.contract_code,dc.contract_name as project_name ,mi.arrive_time, maf.appearance_info ,maf.matched_info ,maf.handle_msg ,maf.sender_sign ,maf.receiver_sign ,aaa.*
from (
select si.sparepart_name,si.material_num,si.specification,si.measuring_unit,
s.distribut_contract_id,s.supplier_id,si.material_in_id
from erp_settlement s ,erp_settlement_item si where s.id = si.settlement_id and s.id = #{id}
)aaa
left join erp_distribut_contract dc on aaa.distribut_contract_id = dc.id
left join erp_material_in mi on mi.id = aaa.material_in_id
left join erp_material_acceptance_form maf on maf.id= aaa.material_in_id
left join sys_depart d on d.id = mi.depart_id
</select>
</mapper>
...
...
sk-module-biz/src/main/java/com/skua/modules/erp/service/IErpSettlementService.java
查看文件 @
6d2440d
...
...
@@ -3,6 +3,7 @@ package com.skua.modules.erp.service;
import
com.skua.modules.erp.entity.ErpSettlement
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.skua.modules.erp.entity.ErpSettlementItem
;
import
com.skua.modules.erp.vo.ErpSettlementFormVO
;
import
com.skua.modules.erp.vo.ErpSettlementVO
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -40,5 +41,9 @@ public interface IErpSettlementService extends IService<ErpSettlement> {
List
<
ErpSettlementVO
>
waterDepartSettlement
(
String
materialInIds
);
// 根据入库单ids,获取【水厂】结算单详情
List
<
ErpSettlementItem
>
queryWaterDepartSettlementByMaterialIds
(
String
materialInIds
);
// (供应商)送货单以及物资验收单
ErpSettlementFormVO
querySupplierSettlementFormById
(
String
id
);
//(水厂) 送货单以及物资验收单
ErpSettlementFormVO
queryWaterDepartSettlementFormById
(
String
id
);
}
...
...
sk-module-biz/src/main/java/com/skua/modules/erp/service/impl/ErpSettlementServiceImpl.java
查看文件 @
6d2440d
...
...
@@ -8,10 +8,13 @@ import com.skua.modules.erp.entity.ErpSettlementItem;
import
com.skua.modules.erp.mapper.ErpSettlementItemMapper
;
import
com.skua.modules.erp.mapper.ErpSettlementMapper
;
import
com.skua.modules.erp.service.IErpSettlementService
;
import
com.skua.modules.erp.vo.ErpSettlementFormVO
;
import
com.skua.modules.erp.vo.ErpSettlementItemVO
;
import
com.skua.modules.erp.vo.ErpSettlementVO
;
import
com.skua.modules.system.entity.SysDepart
;
import
com.skua.modules.system.mapper.SysDepartMapper
;
import
com.skua.tool.util.JSUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -68,12 +71,17 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
//根据编号查询结算单
public
ErpSettlementVO
queryById
(
String
id
){
ErpSettlement
VO
erpSettlementVO
=(
ErpSettlementVO
)
this
.
baseMapper
.
selectById
(
id
);
ErpSettlement
erpSettlement
=
this
.
baseMapper
.
selectById
(
id
);
QueryWrapper
<
ErpSettlementItem
>
queryWrapper
=
new
QueryWrapper
<
ErpSettlementItem
>();
queryWrapper
.
eq
(
"settlement_id"
,
id
);
List
<
ErpSettlementItem
>
settlementItemList
=
settlementItemMapper
.
selectList
(
queryWrapper
);
ErpSettlementVO
erpSettlementVO
=
new
ErpSettlementVO
();
if
(
erpSettlementVO
!=
null
)
erpSettlementVO
.
setItemList
(
settlementItemList
);
if
(
erpSettlement
!=
null
){
//BeanUtils.copyProperties(有值的对象, 要被赋值的对象);
BeanUtils
.
copyProperties
(
erpSettlement
,
erpSettlementVO
);
erpSettlementVO
.
setItemList
(
settlementItemList
);
}
return
erpSettlementVO
;
}
...
...
@@ -102,4 +110,40 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
public
List
<
ErpSettlementItem
>
queryWaterDepartSettlementByMaterialIds
(
String
materialInIds
){
return
this
.
baseMapper
.
queryWaterDepartSettlementByMaterialIds
(
materialInIds
);
}
// 送货单以及物资验收单
public
ErpSettlementFormVO
querySupplierSettlementFormById
(
String
id
){
List
<
ErpSettlementItemVO
>
itemList
=
this
.
baseMapper
.
querySupplierSettlementFormById
(
id
);
ErpSettlementFormVO
erpSettlementFormVO
=
new
ErpSettlementFormVO
();
if
(
itemList
!=
null
&&
!
itemList
.
isEmpty
()){
for
(
ErpSettlementItemVO
settlementFormVO:
itemList
){
erpSettlementFormVO
.
setContractCode
(
settlementFormVO
.
getContractCode
());
erpSettlementFormVO
.
setDepartName
(
settlementFormVO
.
getDepartName
());
erpSettlementFormVO
.
setProjectName
(
settlementFormVO
.
getProjectName
());
erpSettlementFormVO
.
setSparepartName
(
settlementFormVO
.
getSparepartName
());
erpSettlementFormVO
.
setSpecification
(
settlementFormVO
.
getSpecification
());
erpSettlementFormVO
.
setSupplierName
(
settlementFormVO
.
getSupplierName
());
//erpSettlementFormVO.setSparepartTypeName(settlementFormVO.getSparepartName());
}
}
erpSettlementFormVO
.
setItemList
(
itemList
);
return
erpSettlementFormVO
;
}
//(水厂) 送货单以及物资验收单
public
ErpSettlementFormVO
queryWaterDepartSettlementFormById
(
String
id
){
List
<
ErpSettlementItemVO
>
itemList
=
this
.
baseMapper
.
queryWaterDepartSettlementFormById
(
id
);
ErpSettlementFormVO
erpSettlementFormVO
=
new
ErpSettlementFormVO
();
if
(
itemList
!=
null
&&
!
itemList
.
isEmpty
()){
for
(
ErpSettlementItemVO
settlementFormVO:
itemList
){
erpSettlementFormVO
.
setContractCode
(
settlementFormVO
.
getContractCode
());
erpSettlementFormVO
.
setDepartName
(
settlementFormVO
.
getDepartName
());
erpSettlementFormVO
.
setProjectName
(
settlementFormVO
.
getProjectName
());
erpSettlementFormVO
.
setSparepartName
(
settlementFormVO
.
getSparepartName
());
erpSettlementFormVO
.
setSpecification
(
settlementFormVO
.
getSpecification
());
erpSettlementFormVO
.
setSupplierName
(
settlementFormVO
.
getSupplierName
());
//erpSettlementFormVO.setSparepartTypeName(settlementFormVO.getSparepartName());
}
}
erpSettlementFormVO
.
setItemList
(
itemList
);
return
erpSettlementFormVO
;
}
}
...
...
sk-module-biz/src/main/java/com/skua/modules/erp/vo/AgentiaStatisticsVO.java
0 → 100644
查看文件 @
6d2440d
package
com
.
skua
.
modules
.
erp
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.skua.core.util.ConvertUtils
;
import
com.skua.tool.util.JSUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 药剂结算单详情
*/
@Data
@ApiModel
(
value
=
"AgentiaStatistics药剂统计对象"
,
description
=
"药剂统计对象"
)
public
class
AgentiaStatisticsVO
{
@ApiModelProperty
(
value
=
"供应商名称"
)
private
String
supplierName
;
@ApiModelProperty
(
value
=
"部门名称"
)
private
String
departName
;
@ApiModelProperty
(
value
=
"物料名称"
)
private
String
sparepartName
;
@ApiModelProperty
(
value
=
"计划数量"
)
private
String
planNum
;
@ApiModelProperty
(
value
=
"供货数量"
)
private
String
materialNum
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"剩余数量"
)
private
String
leaveNum
;
public
String
getLeaveNum
()
{
leaveNum
=
JSUtils
.
format
(
ConvertUtils
.
getDouble
(
this
.
planNum
,
0
d
)
-
ConvertUtils
.
getDouble
(
this
.
materialNum
,
0
d
));
return
leaveNum
;
}
}
sk-module-biz/src/main/java/com/skua/modules/erp/vo/ErpSettlementFormVO.java
查看文件 @
6d2440d
package
com
.
skua
.
modules
.
erp
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -43,7 +42,6 @@ public class ErpSettlementFormVO {
@ApiModelProperty
(
value
=
"规格型号"
)
private
String
specification
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"结算清单"
)
private
List
<
ErpSettlementItemVO
>
itemList
;
...
...
sk-module-biz/src/main/java/com/skua/modules/erp/vo/ErpSettlementItemVO.java
查看文件 @
6d2440d
package
com
.
skua
.
modules
.
erp
.
vo
;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.skua.modules.erp.entity.ErpSettlementItem
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
/**
* 药剂结算单详情
*/
@Data
@ApiModel
(
value
=
"erp_settlement_item数据传输对象"
,
description
=
"药剂结算单详情"
)
public
class
ErpSettlementItemVO
extends
ErpSettlementItem
{
@ApiModelProperty
(
value
=
"合同编号"
)
private
String
contractCode
;
@ApiModelProperty
(
value
=
"物料名称"
)
private
String
sparepartName
;
@ApiModelProperty
(
value
=
"规格型号"
)
private
String
specification
;
@ApiModelProperty
(
value
=
"项目名称"
)
private
String
projectName
;
@ApiModelProperty
(
value
=
"供应商名称"
)
private
String
supplierName
;
@ApiModelProperty
(
value
=
"部门名称"
)
private
String
departName
;
/**外观情况*/
@ApiModelProperty
(
value
=
"外观情况"
)
private
String
appearanceInfo
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论