增加调拨明细
This commit is contained in:
@@ -174,6 +174,50 @@ public class DepotHeadController {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调拨明细接口 TODO:by sdw 20210724
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @param oId
|
||||
* @param materialParam
|
||||
* @param depotIdF 调出仓库
|
||||
* @param depotId 调入仓库
|
||||
* @param beginTime
|
||||
* @param endTime
|
||||
* @param subType
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findAllocationDetail")
|
||||
public BaseResponseInfo findallocationDetail(@RequestParam("currentPage") Integer currentPage,
|
||||
@RequestParam("pageSize") Integer pageSize,
|
||||
@RequestParam("organId") Integer oId,
|
||||
@RequestParam("materialParam") String materialParam,
|
||||
@RequestParam("depotId") Integer depotId,
|
||||
@RequestParam("depotIdF") Integer depotIdF,
|
||||
@RequestParam("beginTime") String beginTime,
|
||||
@RequestParam("endTime") String endTime,
|
||||
@RequestParam("subType") String subType,
|
||||
HttpServletRequest request)throws Exception {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME);
|
||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||
List<DepotHeadVo4InDetail> list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, materialParam, depotId, depotIdF, oId, (currentPage-1)*pageSize, pageSize);
|
||||
int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, materialParam, depotId, depotIdF,oId);
|
||||
map.put("rows", list);
|
||||
map.put("total", total);
|
||||
res.code = 200;
|
||||
res.data = map;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对账单接口
|
||||
* @param currentPage
|
||||
|
||||
@@ -87,6 +87,26 @@ public interface DepotHeadMapperEx {
|
||||
@Param("depotId") Integer depotId,
|
||||
@Param("oId") Integer oId);
|
||||
|
||||
List<DepotHeadVo4InDetail> findAllocationDetail(
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("subType") String subType,
|
||||
@Param("materialParam") String materialParam,
|
||||
@Param("depotId") Integer depotId,
|
||||
@Param("depotIdF") Integer depotIdF,
|
||||
@Param("oId") Integer oId,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
int findAllocationDetailCount(
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("subType") String subType,
|
||||
@Param("materialParam") String materialParam,
|
||||
@Param("depotId") Integer depotId,
|
||||
@Param("depotIdF") Integer depotIdF,
|
||||
@Param("oId") Integer oId);
|
||||
|
||||
List<DepotHeadVo4StatementAccount> findStatementAccount(
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
|
||||
@@ -18,6 +18,10 @@ public class DepotHeadVo4InDetail {
|
||||
|
||||
private BigDecimal UnitPrice;
|
||||
|
||||
private String mUnit;
|
||||
|
||||
private String newRemark;
|
||||
|
||||
private BigDecimal OperNumber;
|
||||
|
||||
private BigDecimal AllPrice;
|
||||
@@ -80,6 +84,22 @@ public class DepotHeadVo4InDetail {
|
||||
UnitPrice = unitPrice;
|
||||
}
|
||||
|
||||
public String getmUnit() {
|
||||
return mUnit;
|
||||
}
|
||||
|
||||
public void setmUnit(String mUnit) {
|
||||
this.mUnit = mUnit;
|
||||
}
|
||||
|
||||
public String getNewRemark() {
|
||||
return newRemark;
|
||||
}
|
||||
|
||||
public void setNewRemark(String newRemark) {
|
||||
this.newRemark = newRemark;
|
||||
}
|
||||
|
||||
public BigDecimal getOperNumber() {
|
||||
return OperNumber;
|
||||
}
|
||||
|
||||
@@ -421,6 +421,26 @@ public class DepotHeadService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String materialParam, Integer depotId, Integer depotIdF, Integer oId, Integer offset, Integer rows) throws Exception{
|
||||
List<DepotHeadVo4InDetail> list = null;
|
||||
try{
|
||||
list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, materialParam, depotId, depotIdF, oId, offset, rows);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public int findAllocationDetailCount(String beginTime, String endTime, String subType, String materialParam, Integer depotId, Integer depotIdF,Integer oId) throws Exception{
|
||||
int result = 0;
|
||||
try{
|
||||
result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, materialParam, depotId,depotIdF, oId);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<DepotHeadVo4StatementAccount> findStatementAccount(String beginTime, String endTime, Integer organId, String supType, Integer offset, Integer rows)throws Exception {
|
||||
List<DepotHeadVo4StatementAccount> list = null;
|
||||
try{
|
||||
|
||||
@@ -172,8 +172,8 @@
|
||||
</select>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
|
||||
select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.oper_number,di.all_price,s.supplier SName,d.dName DName,
|
||||
date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType
|
||||
select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.material_unit as mUnit,di.oper_number,di.all_price,s.supplier SName,d.dName DName,
|
||||
date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType, concat_ws(' ',dh.remark,di.remark) as newRemark
|
||||
from jsh_depot_head dh
|
||||
inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
|
||||
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1'
|
||||
@@ -303,6 +303,62 @@
|
||||
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName) a
|
||||
</select>
|
||||
|
||||
<select id="findAllocationDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
|
||||
select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.material_unit as mUnit,di.oper_number,di.all_price,SName, d.dName DName,
|
||||
date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType, concat_ws(' ',dh.remark,di.remark) as newRemark
|
||||
from jsh_depot_head dh
|
||||
inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
|
||||
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1'
|
||||
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
|
||||
inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
|
||||
<!-- 调出仓库名查询 -->
|
||||
inner join (select id as aid,name as SName,delete_Flag as adelete_Flag from jsh_depot ) ddd on ddd.aid=di.another_depot_id and ifnull(ddd.adelete_Flag,'0') !='1'
|
||||
where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="depotIdF != null">
|
||||
and di.depot_id = #{depotIdF}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.another_depot_id = #{depotId}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type=#{subType}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} or dh.remark like #{bindKey})
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
ORDER BY oper_time DESC,number desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findAllocationDetailCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from jsh_depot_head dh
|
||||
inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
|
||||
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_Flag,'0') !='1'
|
||||
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
|
||||
inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
|
||||
where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime}
|
||||
<if test="depotIdF != null">
|
||||
and di.depot_id = #{depotIdF}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.another_depot_id = #{depotId}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type=#{subType}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} or dh.remark like #{bindKey})
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
ORDER BY oper_time DESC,number desc
|
||||
</select>
|
||||
|
||||
<select id="findStatementAccount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStatementAccount">
|
||||
select dh.number,concat(dh.sub_type,dh.type) as type,dh.discount_last_money,dh.other_money,dh.change_amount,s.supplier supplierName,
|
||||
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depot_head dh
|
||||
|
||||
Reference in New Issue
Block a user