解决的单据保存的bug:如果存在多账户结算需要将原账户的id置空

This commit is contained in:
季圣华
2023-04-14 19:47:24 +08:00
parent 9fecce5c5c
commit b9cb19fab6
3 changed files with 14 additions and 0 deletions

View File

@@ -235,4 +235,7 @@ public interface DepotHeadMapperEx {
BigDecimal getFinishDepositByNumberExceptCurrent( BigDecimal getFinishDepositByNumberExceptCurrent(
@Param("linkNumber") String linkNumber, @Param("linkNumber") String linkNumber,
@Param("number") String number); @Param("number") String number);
void setAccountIdToNull(
@Param("id") Long id);
} }

View File

@@ -987,6 +987,10 @@ public class DepotHeadService {
}catch(Exception e){ }catch(Exception e){
JshException.writeFail(logger, e); JshException.writeFail(logger, e);
} }
//如果存在多账户结算需要将原账户的id置空
if(StringUtil.isNotEmpty(depotHead.getAccountIdList())) {
depotHeadMapperEx.setAccountIdToNull(depotHead.getId());
}
/**入库和出库处理预付款信息*/ /**入库和出库处理预付款信息*/
if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())){ if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())){
if(depotHead.getOrganId()!=null){ if(depotHead.getOrganId()!=null){

View File

@@ -835,6 +835,7 @@
</foreach> </foreach>
) )
</update> </update>
<select id="getDepotHeadListByAccountIds" resultMap="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap"> <select id="getDepotHeadListByAccountIds" resultMap="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap">
select select
<include refid="com.jsh.erp.datasource.mappers.DepotHeadMapper.Base_Column_List" /> <include refid="com.jsh.erp.datasource.mappers.DepotHeadMapper.Base_Column_List" />
@@ -1070,4 +1071,10 @@
and dh.number!=#{number} and dh.number!=#{number}
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
</select> </select>
<update id="setAccountIdToNull">
update jsh_depot_head dh set dh.account_id = null
where dh.id=#{id}
and ifnull(dh.delete_flag,'0') !='1'
</update>
</mapper> </mapper>