给单据去掉多余的代码
This commit is contained in:
parent
828fc537e3
commit
e318375226
@ -27,21 +27,6 @@ public interface AccountHeadMapperEx {
|
||||
@Param("number") String number,
|
||||
@Param("inOutItemId") Long inOutItemId);
|
||||
|
||||
Long countsByAccountHead(
|
||||
@Param("type") String type,
|
||||
@Param("creatorArray") String[] creatorArray,
|
||||
@Param("billNo") String billNo,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("organId") Long organId,
|
||||
@Param("creator") Long creator,
|
||||
@Param("handsPersonId") Long handsPersonId,
|
||||
@Param("accountId") Long accountId,
|
||||
@Param("status") String status,
|
||||
@Param("remark") String remark,
|
||||
@Param("number") String number,
|
||||
@Param("inOutItemId") Long inOutItemId);
|
||||
|
||||
List<AccountHeadVo4ListEx> getDetailByNumber(
|
||||
@Param("billNo") String billNo);
|
||||
|
||||
|
||||
@ -36,27 +36,6 @@ public interface DepotHeadMapperEx {
|
||||
@Param("accountId") Long accountId,
|
||||
@Param("remark") String remark);
|
||||
|
||||
Long countsByDepotHead(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@Param("creatorArray") String[] creatorArray,
|
||||
@Param("hasDebt") String hasDebt,
|
||||
@Param("statusArray") String[] statusArray,
|
||||
@Param("purchaseStatusArray") String[] purchaseStatusArray,
|
||||
@Param("number") String number,
|
||||
@Param("linkApply") String linkApply,
|
||||
@Param("linkNumber") String linkNumber,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("materialParam") String materialParam,
|
||||
@Param("organId") Long organId,
|
||||
@Param("organArray") String[] organArray,
|
||||
@Param("creator") Long creator,
|
||||
@Param("depotId") Long depotId,
|
||||
@Param("depotArray") String[] depotArray,
|
||||
@Param("accountId") Long accountId,
|
||||
@Param("remark") String remark);
|
||||
|
||||
List<MaterialsListVo> findMaterialsListMapByHeaderIdList(
|
||||
@Param("idList") List<Long> idList);
|
||||
|
||||
|
||||
@ -130,28 +130,12 @@ public class AccountHeadService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long countAccountHead(String type, String billNo, String beginTime, String endTime,
|
||||
Long organId, Long creator, Long handsPersonId, Long accountId, String status,
|
||||
String remark, String number, Long inOutItemId) throws Exception{
|
||||
Long result=null;
|
||||
try{
|
||||
String [] creatorArray = getCreatorArray();
|
||||
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||
result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo,
|
||||
beginTime, endTime, organId, creator, handsPersonId, accountId, status, remark, number, inOutItemId);
|
||||
} catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色类型获取操作员数组
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private String[] getCreatorArray() throws Exception {
|
||||
public String[] getCreatorArray() throws Exception {
|
||||
String creator = "";
|
||||
User user = userService.getCurrentUser();
|
||||
String roleType = userService.getRoleTypeByUserId(user.getId()).getType(); //角色类型
|
||||
|
||||
@ -216,28 +216,6 @@ public class DepotHeadService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long countDepotHead(String type, String subType, String hasDebt, String status, String purchaseStatus, String number, String linkApply, String linkNumber,
|
||||
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark) throws Exception{
|
||||
Long result=null;
|
||||
try{
|
||||
String [] depotArray = getDepotArray(subType);
|
||||
String [] creatorArray = getCreatorArray();
|
||||
String [] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null;
|
||||
String [] purchaseStatusArray = StringUtil.isNotEmpty(purchaseStatus) ? purchaseStatus.split(",") : null;
|
||||
String [] organArray = getOrganArray(subType, purchaseStatus);
|
||||
//以销定购,查看全部数据
|
||||
creatorArray = StringUtil.isNotEmpty(purchaseStatus) ? null: creatorArray;
|
||||
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, hasDebt,
|
||||
statusArray, purchaseStatusArray, number, linkApply, linkNumber, beginTime, endTime,
|
||||
materialParam, organId, organArray, creator, depotId, depotArray, accountId, remark);
|
||||
} catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单据类型获取仓库数组
|
||||
* @param subType
|
||||
|
||||
@ -74,67 +74,6 @@
|
||||
order by ah.id desc
|
||||
</select>
|
||||
|
||||
<select id="countsByAccountHead" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1) from
|
||||
(select distinct ah.* FROM jsh_account_head ah
|
||||
left join jsh_account_item ai on ah.id=ai.header_id and ifnull(ai.delete_flag,'0') !='1'
|
||||
left join jsh_depot_head dh on dh.id=ai.bill_id and ifnull(dh.delete_flag,'0') !='1'
|
||||
WHERE 1=1
|
||||
<if test="billNo != null">
|
||||
<bind name="bindBillNo" value="'%'+billNo+'%'"/>
|
||||
and ah.bill_no like #{bindBillNo}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and ah.type=#{type}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and ah.bill_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and ah.bill_time <= #{endTime}
|
||||
</if>
|
||||
<if test="organId != null">
|
||||
and ah.organ_id=#{organId}
|
||||
</if>
|
||||
<if test="handsPersonId != null">
|
||||
and ah.hands_person_id=#{handsPersonId}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
and ah.creator=#{creator}
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and ah.creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="accountId != null">
|
||||
and ah.account_id=#{accountId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and ah.status=#{status}
|
||||
</if>
|
||||
<if test="remark != null and remark !=''">
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and ah.remark like #{bindRemark}
|
||||
</if>
|
||||
<if test="number != null and number !=''">
|
||||
<if test="number == 'QiChu'">
|
||||
and ai.bill_id is null
|
||||
</if>
|
||||
<if test="number != 'QiChu'">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
</if>
|
||||
</if>
|
||||
<if test="inOutItemId != null">
|
||||
and ai.in_out_item_id=#{inOutItemId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1') tb
|
||||
</select>
|
||||
|
||||
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx">
|
||||
select ah.*, s.supplier OrganName, p.Name HandsPersonName, a.Name AccountName
|
||||
from jsh_account_head ah
|
||||
|
||||
@ -167,105 +167,6 @@
|
||||
order by jdh.id desc
|
||||
</select>
|
||||
|
||||
<select id="countsByDepotHead" resultType="java.lang.Long">
|
||||
select
|
||||
count(1) from
|
||||
(select distinct dh.id from jsh_depot_head dh
|
||||
left join jsh_depot_item di on dh.Id = di.header_id and ifnull(di.delete_flag,'0') !='1'
|
||||
left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1'
|
||||
left join jsh_material_extend me on di.material_extend_id = me.id and ifnull(me.delete_flag,'0') !='1'
|
||||
WHERE 1=1
|
||||
<if test="type != null">
|
||||
and dh.type=#{type}
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type=#{subType}
|
||||
</if>
|
||||
<if test="statusArray != null and statusArray !=''">
|
||||
and dh.status in (
|
||||
<foreach collection="statusArray" item="status" separator=",">
|
||||
#{status}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="purchaseStatusArray != null and purchaseStatusArray !=''">
|
||||
and dh.purchase_status in (
|
||||
<foreach collection="purchaseStatusArray" item="purchaseStatus" separator=",">
|
||||
#{purchaseStatus}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="number != null">
|
||||
<bind name="bindNumber" value="'%'+number+'%'"/>
|
||||
and dh.number like #{bindNumber}
|
||||
</if>
|
||||
<if test="linkApply != null">
|
||||
<bind name="bindLinkApply" value="'%'+linkApply+'%'"/>
|
||||
and dh.link_apply like #{bindLinkApply}
|
||||
</if>
|
||||
<if test="linkNumber != null">
|
||||
<bind name="bindLinkNumber" value="'%'+linkNumber+'%'"/>
|
||||
and dh.link_number like #{bindLinkNumber}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= #{endTime}
|
||||
</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.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}
|
||||
or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey}
|
||||
or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey})
|
||||
</if>
|
||||
<if test="organId != null">
|
||||
and dh.organ_id=#{organId}
|
||||
</if>
|
||||
<if test="organArray != null and organArray !=''">
|
||||
and dh.organ_id in (
|
||||
<foreach collection="organArray" item="organId" separator=",">
|
||||
#{organId}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
and dh.creator=#{creator}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id=#{depotId}
|
||||
</if>
|
||||
<if test="depotArray != null and depotArray !=''">
|
||||
and di.depot_id in (
|
||||
<foreach collection="depotArray" item="depotId" separator=",">
|
||||
#{depotId}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and dh.creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="accountId != null">
|
||||
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
|
||||
and (dh.account_id=#{accountId} or dh.account_id_list like #{bindAccountId})
|
||||
</if>
|
||||
<if test="hasDebt != null and hasDebt ==1">
|
||||
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))>0)
|
||||
</if>
|
||||
<if test="hasDebt != null and hasDebt ==0">
|
||||
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))=0)
|
||||
</if>
|
||||
<if test="remark != null and remark !=''">
|
||||
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1') tb
|
||||
</select>
|
||||
|
||||
<select id="findMaterialsListMapByHeaderIdList" resultType="com.jsh.erp.datasource.vo.MaterialsListVo">
|
||||
select jsh_depot_item.header_id, group_concat(concat(jsh_material.name,' ',ifnull(jsh_material.standard,''),' ',
|
||||
ifnull(jsh_material.model,''),' ',ifnull(jsh_material.color,''))) as materialsList
|
||||
|
||||
Loading…
Reference in New Issue
Block a user